/*
 * DMpro language tools (2026-11-13): the language button, the language sheet (first-open picker and menu), the
 * suggestion bar on the public pages, the legal note, and a few direction fixes for right-to-left languages.
 * Shared by the web pages (/i18n/i18n.css) and the extension (app/client/i18n/i18n.css, a byte-identical copy).
 * Every class starts with dlx-.
 */
:root {
  --dlx-coral: var(--coral, #FF5B47);
  --dlx-coral-deep: var(--coral-deep, #E84934);
  --dlx-coral-tint: var(--coral-tint, #FFEDE6);
  --dlx-ink: var(--espresso, #2A1A14);
  --dlx-ink-2: var(--espresso-2, #5A4A42);
  --dlx-ink-3: var(--espresso-3, #8A7A72);
  --dlx-line: var(--line, #EAE0D2);
  --dlx-cream: var(--cream, #FAF3E7);
}

/* ── the button: globe + code ──────────────────────────────────────────────────────────────────────── */
.dlx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 9px 0 8px; box-sizing: border-box;
  border-radius: 999px; border: 1px solid rgba(42, 26, 20, .10);
  background: #fff; color: var(--dlx-ink); cursor: pointer;
  font: 700 11px/1 'DM Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: .02em;
  box-shadow: 0 1px 2px rgba(42, 26, 20, .05);
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
  white-space: nowrap; flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.dlx-btn svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--dlx-coral-deep); }
.dlx-btn:hover { border-color: rgba(232, 73, 52, .45); box-shadow: 0 2px 8px rgba(42, 26, 20, .08); transform: translateY(-1px); }
.dlx-btn:active { transform: none; }
.dlx-btn:focus-visible { outline: 2px solid var(--dlx-coral-deep); outline-offset: 2px; }
.dlx-btn .dlx-btn-code { direction: ltr; unicode-bidi: isolate; }
.dlx-btn .dlx-btn-name { font-weight: 600; letter-spacing: 0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.dlx-btn .dlx-btn-chev { display: inline-flex; color: var(--dlx-ink-3); }
.dlx-btn .dlx-btn-chev svg { width: 11px; height: 11px; color: currentColor; }
.dlx-btn.is-lg { height: 36px; padding: 0 12px 0 11px; font-size: 12.5px; border-radius: 10px; gap: 7px; }
.dlx-btn.is-lg svg { width: 15px; height: 15px; }

/* ── the sheet: a dialog on wide screens, a bottom sheet on narrow ones ───────────────────────────── */
html.dlx-open, html.dlx-open body { overflow: hidden !important; }
.dlx-shade {
  position: fixed; inset: 0; z-index: 2147483640;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(42, 26, 20, 0); backdrop-filter: blur(0px);
  transition: background .18s ease, backdrop-filter .18s ease;
  font-family: 'DM Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--dlx-ink); text-align: start;
}
.dlx-shade.is-in { background: rgba(42, 26, 20, .42); backdrop-filter: blur(3px); }
.dlx-box {
  width: 100%; max-width: 460px; max-height: min(86vh, 720px);
  display: flex; flex-direction: column; box-sizing: border-box;
  background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(42, 26, 20, .18);
  transform: translateY(24px); opacity: 0; transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
  overflow: hidden;
}
.dlx-shade.is-in .dlx-box { transform: none; opacity: 1; }
@media (min-width: 560px) {
  .dlx-shade { align-items: center; padding: 24px; }
  .dlx-box { border-radius: 20px; box-shadow: 0 24px 60px rgba(42, 26, 20, .22); transform: translateY(10px) scale(.985); }
}
.dlx-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--dlx-line); }
.dlx-head-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--dlx-coral-tint); color: var(--dlx-coral-deep); flex-shrink: 0; }
.dlx-head-ic svg { width: 18px; height: 18px; }
.dlx-head-txt { flex: 1; min-width: 0; padding-top: 1px; }
.dlx-title { margin: 0; font: 800 17px/1.25 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif; color: var(--dlx-ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
.dlx-sub { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--dlx-ink-2); overflow-wrap: anywhere; }
.dlx-x { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--dlx-line); background: #fff; color: var(--dlx-ink-2); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; padding: 0; }
.dlx-x:hover { background: var(--dlx-cream); color: var(--dlx-ink); }
.dlx-x:focus-visible { outline: 2px solid var(--dlx-coral-deep); outline-offset: 2px; }
.dlx-list-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 12px 12px 10px; }
.dlx-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--dlx-line); background: #FCF9F4; color: var(--dlx-ink-3); flex-shrink: 0; cursor: text; }
.dlx-search:focus-within { border-color: rgba(232, 73, 52, .55); box-shadow: 0 0 0 3px rgba(255, 91, 71, .12); background: #fff; }
.dlx-search svg { flex-shrink: 0; }
.dlx-search-in { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 14px/1 inherit; font-family: inherit; color: var(--dlx-ink); padding: 0; height: 100%; }
.dlx-search-in::placeholder { color: var(--dlx-ink-3); }
.dlx-search-in::-webkit-search-cancel-button { cursor: pointer; }
.dlx-list { list-style: none; margin: 8px 0 0; padding: 2px 2px 4px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 120px; outline: 0; scrollbar-width: thin; }
.dlx-sep { padding: 10px 10px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--dlx-ink-3); }
.dlx-sep.is-first { padding-top: 4px; }
.dlx-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 11px; cursor: pointer; outline: 0; box-sizing: border-box; transition: background .12s; }
.dlx-item:hover { background: #FBF5EC; }
.dlx-item:focus-visible { background: #FBF5EC; box-shadow: inset 0 0 0 2px var(--dlx-coral-deep); }
.dlx-item.is-on { background: var(--dlx-coral-tint); }
.dlx-item.is-sug .dlx-native::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dlx-coral); margin-inline-start: 7px; vertical-align: middle; }
.dlx-native { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--dlx-ink); overflow-wrap: anywhere; }
.dlx-en { font-size: 12.5px; color: var(--dlx-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; }
/* the list rows: the language's own name over its name in the language on screen; each line hugs the start
   edge whatever its own direction (an Arabic name in an English list starts at the left like the others) */
.dlx-names { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 1px 0; }
.dlx-names .dlx-native { flex: none; max-width: 100%; line-height: 1.3; }
.dlx-names .dlx-en { max-width: 100%; white-space: normal; overflow: visible; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.3; }
.dlx-ck { width: 18px; height: 18px; display: grid; place-items: center; color: var(--dlx-coral-deep); flex-shrink: 0; }
.dlx-empty { margin: 18px 0 10px; text-align: center; color: var(--dlx-ink-3); font-size: 13px; }
@media (max-width: 380px) {
  .dlx-head { padding: 14px 14px 10px; }
  .dlx-list-wrap { padding: 10px 8px 8px; }
  .dlx-en { max-width: 42%; font-size: 12px; }
  .dlx-names .dlx-en { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .dlx-shade, .dlx-box, .dlx-btn { transition: none !important; }
}

/* ── the suggestion bar (public pages) ─────────────────────────────────────────────────────────────── */
.dlx-bar { position: relative; z-index: 60; background: var(--dlx-ink); color: #FAF3E7; font: 500 13.5px/1.4 'DM Sans', system-ui, sans-serif; }
.dlx-bar-in { max-width: 1200px; margin: 0 auto; padding: 9px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.dlx-bar-txt { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.dlx-bar-txt svg { color: #FFC940; flex-shrink: 0; }
.dlx-bar-go { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px; background: #FF5B47; color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.dlx-bar-go:hover { background: #E84934; }
.dlx-bar-go:focus-visible, .dlx-bar-stay:focus-visible, .dlx-bar-x:focus-visible { outline: 2px solid #FFC940; outline-offset: 2px; }
.dlx-bar-stay { background: none; border: 0; color: #E8DCCB; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }
.dlx-bar-x { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .08); color: #FAF3E7; display: grid; place-items: center; cursor: pointer; padding: 0; }
.dlx-bar-x:hover { background: rgba(255, 255, 255, .16); }

/* ── the legal note (translated Terms and Privacy) ─────────────────────────────────────────────────── */
.dlx-legal { margin: 0 0 20px; padding: 12px 14px; border-radius: 12px; background: #FFF6E0; border: 1px solid #F5DFA0; color: #5A4A42; font-size: 13.5px; line-height: 1.5; }
.dlx-legal a { color: #B4311F; font-weight: 700; }

/* ── right to left: what the generated mirror stylesheets cannot know ─────────────────────────────── */
[dir="rtl"] .dlx-btn .dlx-btn-chev { margin: 0; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[type="tel"] { direction: ltr; text-align: right; }
[dir="rtl"] input[type="email"]:placeholder-shown, [dir="rtl"] input[type="url"]:placeholder-shown, [dir="rtl"] input[type="tel"]:placeholder-shown { direction: rtl; }
[dir="rtl"] code, [dir="rtl"] kbd, [dir="rtl"] pre { direction: ltr; unicode-bidi: isolate; }
/* long words (German compounds, Finnish, Russian) never push a page sideways: a heading word that does not fit
   its line breaks, with a hyphen where the browser knows the language */
h1, h2, h3, h4 { overflow-wrap: anywhere; }
html:not([lang|="en"]) :is(h1, h2, h3, h4) { -webkit-hyphens: auto; hyphens: auto; }
/* scripts without italics (Arabic, Persian, Hebrew, Urdu, Hindi, Bengali, Thai, Japanese, Korean, Chinese): the accent
   words keep their color and stand upright instead of a slanted fallback font */
html:is([lang|="ar"], [lang|="fa"], [lang|="he"], [lang|="ur"], [lang|="hi"], [lang|="bn"], [lang|="th"], [lang|="ja"], [lang|="ko"], [lang|="zh"]) :is(em, i, .editorial) { font-style: normal; }
/* drawings never mirror: the text inside a logo (the "DM" tile and "pro") keeps its own direction */
[dir="rtl"] svg { direction: ltr; }

/* ── no flash of English while a page's translation loads (i18n.js; at most 3.5 s) ─────────────────── */
html.dlx-wait body { visibility: hidden !important; }

/* ── the corner language button on pages without a header (sign-in, gift) ─────────────────────────── */
.dlx-float { position: fixed; top: 14px; right: 14px; z-index: 50; }
[dir="rtl"] .dlx-float { right: auto; left: 14px; }
.dlx-float .dlx-btn { height: 34px; padding: 0 11px 0 10px; box-shadow: 0 2px 10px rgba(42, 26, 20, .08); }
.ac-top-lang { margin-inline-start: 10px; display: inline-flex; }

/* ── the public pages' language menu: plain links (search engines follow them), a panel under the button ── */
.dlx-switch { position: relative; display: inline-flex; }
.dlx-links { position: relative; }
.dlx-links > summary { list-style: none; }
.dlx-links > summary::-webkit-details-marker { display: none; }
.dlx-links-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 80; width: 440px; max-width: calc(100vw - 24px);
  max-height: min(70vh, 560px); overflow: auto; padding: 10px; box-sizing: border-box;
  background: #fff; border: 1px solid var(--dlx-line); border-radius: 16px; box-shadow: 0 18px 50px rgba(42, 26, 20, .18);
  font-family: 'DM Sans', 'Inter', system-ui, sans-serif; text-align: start;
}
[dir="rtl"] .dlx-links-panel { right: auto; left: 0; }
.dlx-links-panel .dlx-search { margin: 0 0 8px; height: 38px; }
.dlx-links-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
.dlx-links-list li[hidden] { display: none; }
.dlx-links-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--dlx-ink); text-decoration: none; min-width: 0; }
.dlx-links-list a:hover { background: #FBF5EC; }
.dlx-links-list a:focus-visible { outline: 2px solid var(--dlx-coral-deep); outline-offset: -2px; }
.dlx-links-list a.is-on { background: var(--dlx-coral-tint); }
.dlx-links-list .dlx-native { font-size: 13.5px; font-weight: 600; }
.dlx-links-list .dlx-en { font-size: 11.5px; max-width: 50%; }
@media (max-width: 560px) {
  .dlx-links-panel { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; max-height: 78vh; border-radius: 18px 18px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  [dir="rtl"] .dlx-links-panel { left: 0; right: 0; }
  .dlx-links-list { grid-template-columns: 1fr; }
}
