/* =====================================================================
   Saudi Denial Codes Reference — design system (2026)
   Minimal enterprise UI · one brand colour · WCAG 2.2 AA contrast ·
   logical properties for RTL/LTR · locally hosted fonts (offline).
   ===================================================================== */

/* ---------- fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Kufi Arabic"; src: url("fonts/noto-kufi-arabic-arabic-wght-normal.woff2") format("woff2-variations"), url("fonts/noto-kufi-arabic-arabic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
/* metric-adjusted fallbacks reduce layout shift while web fonts load */
@font-face { font-family: "Inter Fallback"; src: local("Segoe UI"), local("Arial"); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: "Plex Arabic Fallback"; src: local("Segoe UI"), local("Tahoma"); size-adjust: 104%; ascent-override: 102%; descent-override: 44%; line-gap-override: 0%; }

/* ---------- tokens ---------- */
:root {
  /* neutrals */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --surface-3: #eceff3;
  --border: #e3e7ec;
  --border-strong: #d0d7df;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5f6b7c;           /* 5.3:1 on white */
  --placeholder: #7b8696;
  /* brand */
  --brand: #0f766e;           /* 5.5:1 on white */
  --brand-hover: #0d625c;
  --brand-ink: #ffffff;
  --brand-soft: #e7f3f1;
  --brand-line: #b9dcd7;
  --ring: rgba(15, 118, 110, .28);
  /* semantic */
  --t-denial: #a5480b;  --t-denial-bg: #fdf2e7;
  --t-insurer: #6b2fd0; --t-insurer-bg: #f2edfd;
  --t-rule: #155e75;    --t-rule-bg: #e8f4f8;
  --ok: #166534;   --ok-bg: #ecf7ef;   --ok-line: #bfe3c9;
  --info: #1e40af; --info-bg: #eef3fd; --info-line: #c9d7f6;
  --warn: #8a4b07; --warn-bg: #fdf6e7; --warn-line: #f0d9a8;
  --danger: #b42318; --danger-bg: #fdefed; --danger-line: #f4c7c1;
  /* shape & depth */
  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 16px 40px -8px rgba(15, 23, 42, .18), 0 4px 10px rgba(15, 23, 42, .05);
  /* type */
  --font-en: "Inter", "Inter Fallback", "Segoe UI", system-ui, sans-serif;
  --font-ar: "Noto Kufi Arabic", "IBM Plex Sans Arabic", "Inter", "Plex Arabic Fallback", "Segoe UI", Tahoma, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-base: .9375rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 2.25rem;
  --scale: 1;
  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .16s;
  --header-h: 64px;
  color-scheme: light;
}
:root[data-text="large"] { --scale: 1.1; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f14; --surface: #11161d; --surface-2: #161c24; --surface-3: #1c2430; --border: #232c38; --border-strong: #303b49;
    --text: #e7ebf1; --text-2: #bcc5d1; --muted: #93a0b1; --placeholder: #7a8798;
    --brand: #2bc0b0; --brand-hover: #4fd2c4; --brand-ink: #04211e; --brand-soft: #0f2a29; --brand-line: #1d4d48; --ring: rgba(43, 192, 176, .35);
    --t-denial: #f2ae68; --t-denial-bg: #2b1d10; --t-insurer: #bea6ff; --t-insurer-bg: #221a3a; --t-rule: #7fd0e4; --t-rule-bg: #0f2a33;
    --ok: #79d99c; --ok-bg: #0f2418; --ok-line: #1f4a30; --info: #a5bdff; --info-bg: #121c38; --info-line: #263a6d;
    --warn: #f0c070; --warn-bg: #2a1f0c; --warn-line: #574217; --danger: #ff9b90; --danger-bg: #2d1311; --danger-line: #5a2621;
    --shadow-xs: none; --shadow-sm: 0 0 0 1px rgba(255,255,255,.02); --shadow-md: 0 8px 20px -6px rgba(0,0,0,.55); --shadow-lg: 0 20px 50px -10px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f14; --surface: #11161d; --surface-2: #161c24; --surface-3: #1c2430; --border: #232c38; --border-strong: #303b49;
  --text: #e7ebf1; --text-2: #bcc5d1; --muted: #93a0b1; --placeholder: #7a8798;
  --brand: #2bc0b0; --brand-hover: #4fd2c4; --brand-ink: #04211e; --brand-soft: #0f2a29; --brand-line: #1d4d48; --ring: rgba(43, 192, 176, .35);
  --t-denial: #f2ae68; --t-denial-bg: #2b1d10; --t-insurer: #bea6ff; --t-insurer-bg: #221a3a; --t-rule: #7fd0e4; --t-rule-bg: #0f2a33;
  --ok: #79d99c; --ok-bg: #0f2418; --ok-line: #1f4a30; --info: #a5bdff; --info-bg: #121c38; --info-line: #263a6d;
  --warn: #f0c070; --warn-bg: #2a1f0c; --warn-line: #574217; --danger: #ff9b90; --danger-bg: #2d1311; --danger-line: #5a2621;
  --shadow-xs: none; --shadow-sm: 0 0 0 1px rgba(255,255,255,.02); --shadow-md: 0 8px 20px -6px rgba(0,0,0,.55); --shadow-lg: 0 20px 50px -10px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: calc(100% * var(--scale)); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font-family: var(--font-en); font-size: var(--fs-base); line-height: 1.6; font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html[lang="ar"] body { font-family: var(--font-ar); font-size: var(--fs-md); line-height: 1.8; font-feature-settings: normal; }
h1, h2, h3 { margin: 0; color: var(--text); font-weight: 650; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-weight: 600; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
input, select { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); color: var(--text); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }
.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.narrow { max-width: 820px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.mono, code { font-family: var(--font-mono); font-size: .92em; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
bdi, [dir="ltr"], [dir="rtl"] { unicode-bidi: isolate; }
.ico { inline-size: 18px; block-size: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { inline-size: 15px; block-size: 15px; }
html[dir="rtl"] .flip { transform: scaleX(-1); }
.skip-link { position: absolute; inset-inline-start: 16px; inset-block-start: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { inset-block-start: 12px; }

/* mixed-direction lines follow the page side */
html[dir="rtl"] [dir="ltr"].follow { text-align: right; }
html[dir="ltr"] [dir="rtl"].follow { text-align: left; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; block-size: 40px; padding-inline: 16px; border-radius: var(--r-md);
  border: 1px solid transparent; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { block-size: 30px; padding-inline: 10px; font-size: var(--fs-xs); border-radius: var(--r-sm); gap: 6px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; font-size: inherit; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: inline-grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }

/* ---------- header ---------- */
.site-header { position: sticky; inset-block-start: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-block-end: 1px solid var(--border); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
.header-inner { display: flex; align-items: center; gap: 24px; block-size: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-inline-size: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { inline-size: 32px; block-size: 32px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.brand-mark svg { inline-size: 18px; block-size: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-weight: 650; font-size: var(--fs-base); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[lang="ar"] .brand-name { letter-spacing: 0; font-weight: 600; }
.primary-nav { display: flex; gap: 2px; margin-inline-start: 8px; }
.nav-link { background: none; border: 0; padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.lang-btn { display: inline-flex; align-items: center; gap: 8px; block-size: 40px; padding-inline: 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.lang-btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

/* ---------- menu (popover) ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 50; min-inline-size: 272px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  transform-origin: top right; animation: menu-in .14s var(--ease); }
html[dir="rtl"] .menu { transform-origin: top left; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-label { padding: 8px 10px 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.menu-sep { block-size: 1px; background: var(--border); margin: 6px 4px; }
.menu-item { inline-size: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font-size: var(--fs-sm); text-align: start; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item .ico { color: var(--muted); }
.menu-item .end { margin-inline-start: auto; display: inline-flex; align-items: center; }
.menu-item[role="menuitemradio"] .check { visibility: hidden; color: var(--brand); }
.menu-item[aria-checked="true"] .check { visibility: visible; }
.switch { inline-size: 32px; block-size: 18px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background var(--dur) var(--ease); flex: none; }
.switch::after { content: ""; position: absolute; inset-block-start: 2px; inset-inline-start: 2px; inline-size: 14px; block-size: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--dur) var(--ease); }
[aria-checked="true"] > .end > .switch { background: var(--brand); }
[aria-checked="true"] > .end > .switch::after { transform: translateX(14px); }
html[dir="rtl"] [aria-checked="true"] > .end > .switch::after { transform: translateX(-14px); }
.menu-foot { padding: 8px 10px 4px; font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kbd { font-family: var(--font-en); font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-strong); border-block-end-width: 2px; border-radius: 5px; padding: 0 5px; line-height: 17px; direction: ltr; white-space: nowrap; }
.only-mobile { display: none !important; }

/* ---------- hero & search ---------- */
.hero { padding-block: 56px 28px; border-block-end: 1px solid transparent; }
.hero-inner { text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 999px; padding: 4px 12px; margin-block-end: 18px; }
.hero h1 { font-size: clamp(1.75rem, 2.4vw + 1rem, var(--fs-2xl)); line-height: 1.15; letter-spacing: -.025em; font-weight: 700; }
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.4; font-weight: 700; }
.lead { margin: 12px auto 28px; max-inline-size: 600px; color: var(--muted); font-size: var(--fs-md); }
.is-results .hero { padding-block: 20px 4px; }
.is-results .hero .eyebrow, .is-results .hero h1, .is-results .lead, .is-results .examples { display: none; }

.search { position: relative; display: flex; align-items: center; gap: 6px; block-size: 58px; padding: 6px; padding-inline-start: 48px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.search:focus-within { border-color: var(--brand); box-shadow: var(--shadow-md), 0 0 0 4px var(--ring); }
.search-ico { position: absolute; inset-inline-start: 16px; inline-size: 20px; block-size: 20px; color: var(--muted); pointer-events: none; }
#q { flex: 1; min-inline-size: 0; block-size: 100%; border: 0; outline: 0; background: transparent; font-size: var(--fs-md); padding-inline: 2px; color: var(--text); }
#q::placeholder { color: var(--placeholder); }
.search .kbd { margin-inline-end: 6px; }
.search .btn-primary { block-size: 44px; padding-inline: 22px; border-radius: var(--r-lg); font-size: var(--fs-base); }
.clear-btn { inline-size: 32px; block-size: 32px; border-radius: 999px; }
#suggestions { position: absolute; z-index: 30; inset-inline: 0; inset-block-start: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; text-align: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); max-block-size: 380px; overflow: auto; animation: menu-in .14s var(--ease); }
#suggestions li { display: flex; align-items: baseline; gap: 14px; padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer; }
#suggestions li[aria-selected="true"], #suggestions li:hover { background: var(--surface-2); }
.s-code { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-sm); color: var(--brand); min-inline-size: 84px; direction: ltr; text-align: start; }
.s-desc { color: var(--text-2); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block-start: 12px; text-align: start; }
.privacy { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--muted); }
.privacy .ico { color: var(--ok); }
.adv-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px; border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.adv-toggle:hover { color: var(--text); background: var(--surface-2); }
.adv-toggle .chev { transition: transform var(--dur) var(--ease); }
.adv-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.adv { margin-block-start: 12px; padding: 16px 18px; text-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: end; animation: menu-in .16s var(--ease); }
.field-label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin-block-end: 6px; }
.adv-row { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.adv-actions { display: flex; gap: 8px; }
.check-field { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.check-field input { inline-size: 16px; block-size: 16px; accent-color: var(--brand); margin: 0; }
.select { block-size: 34px; padding-inline: 10px 28px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: var(--fs-sm); }
html[dir="rtl"] .select { padding-inline: 28px 10px; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-block-start: 20px; }
.examples-label { font-size: var(--fs-sm); color: var(--muted); }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 12px; font-size: var(--fs-sm); font-weight: 500; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease); }
.chip:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.pii-alert { display: flex; align-items: flex-start; gap: 10px; margin-block-start: 12px; padding: 12px 14px; text-align: start; background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 600; }

/* ---------- segmented control / tabs ---------- */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--text-2); padding: 5px 12px; border-radius: 7px; font-size: var(--fs-sm); font-weight: 550; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.segmented button:hover { color: var(--text); }
.segmented button[aria-checked="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .n { margin-inline-start: 6px; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.segmented:empty { display: none; }

/* ---------- layout sections ---------- */
main { flex: 1; padding-block: 16px 64px; }
.section { margin-block-start: 28px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-block-end: 14px; }
.section-head h2 { font-size: var(--fs-lg); letter-spacing: -.01em; }
html[lang="ar"] .section-head h2 { letter-spacing: 0; }
.section-head p { margin-block-start: 4px; color: var(--muted); font-size: var(--fs-sm); max-inline-size: 640px; }
.card-surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { display: grid; gap: 2px; align-content: start; text-align: start; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-block-end: 10px; }
.stat-ico { inline-size: 34px; block-size: 34px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--tb); color: var(--tc); }
.stat-ico .ico { inline-size: 18px; block-size: 18px; }
.stat-go { color: var(--muted); transition: color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.stat:hover .stat-go { color: var(--text); transform: translateX(2px); }
html[dir="rtl"] .stat:hover .stat-go { transform: translateX(-2px) scaleX(-1); }
.stat-num { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; font-family: var(--font-en); }
.stat-label { font-weight: 600; font-size: var(--fs-base); }
.stat-sub { font-size: var(--fs-sm); color: var(--muted); }
.k-denial { --tc: var(--t-denial); --tb: var(--t-denial-bg); }
.k-insurer { --tc: var(--t-insurer); --tb: var(--t-insurer-bg); }
.k-rule { --tc: var(--t-rule); --tb: var(--t-rule-bg); }

/* directory */
.dir-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; padding: 14px 16px; border-block-end: 1px solid var(--border); }
.filter-input { position: relative; flex: 1; min-inline-size: 200px; max-inline-size: 340px; }
.filter-input .ico { position: absolute; inset-inline-start: 10px; inset-block-start: 50%; transform: translateY(-50%); color: var(--muted); }
.filter-input input { inline-size: 100%; block-size: 36px; padding-inline: 34px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-sm); }
.filter-input input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.groups { display: grid; }
.group { border-block-end: 1px solid var(--border); }
.group:last-child { border-block-end: 0; }
.group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; font-size: var(--fs-sm); transition: background var(--dur) var(--ease); }
.group > summary::-webkit-details-marker { display: none; }
.group > summary:hover { background: var(--surface-2); }
.group .prefix { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; color: var(--t-denial); background: var(--t-denial-bg); border-radius: var(--r-xs); padding: 1px 7px; }
.group .count { margin-inline-start: auto; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.chev { inline-size: 16px; block-size: 16px; color: var(--muted); transition: transform var(--dur) var(--ease); }
.group > summary .chev { transform: rotate(-90deg); }
html[dir="rtl"] .group > summary .chev { transform: rotate(90deg); }
.group[open] > summary .chev { transform: none; }
.rows { display: grid; }
.row { display: grid; grid-template-columns: 104px 1fr auto; gap: 16px; align-items: center; padding: 10px 16px; border: 0; border-block-start: 1px solid var(--border); background: transparent; text-align: start; transition: background var(--dur) var(--ease); }
.row:hover { background: var(--surface-2); }
.row-code { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-sm); color: var(--brand); direction: ltr; text-align: start; }
.row-desc { min-inline-size: 0; display: grid; }
.row-desc .main { color: var(--text); font-size: var(--fs-sm); }
.row-desc .alt { color: var(--muted); font-size: var(--fs-xs); }
.dir-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge .dot { inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; }
.b-denial { background: var(--t-denial-bg); color: var(--t-denial); border-color: transparent; }
.b-insurer { background: var(--t-insurer-bg); color: var(--t-insurer); border-color: transparent; }
.b-rule { background: var(--t-rule-bg); color: var(--t-rule); border-color: transparent; }
.b-official { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.b-supported { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.b-unverified { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.b-off { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }

/* ---------- results ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block: 8px 14px; }
.status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }
.status strong { color: var(--text); font-weight: 650; }
.toolbar-end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dym { margin-block: -4px 14px; font-size: var(--fs-sm); color: var(--text-2); }
.results { display: grid; gap: 12px; }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); overflow: hidden; animation: rise .22s var(--ease) both;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.result:hover { border-color: var(--border-strong); }
.result.is-open { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.result.is-off { background: var(--surface-2); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result-head { inline-size: 100%; display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: start; padding: 18px 20px; background: transparent; border: 0; text-align: start; }
.code-cell { display: grid; gap: 8px; justify-items: start; }
.code { font-family: var(--font-mono); font-size: 1.0625rem; font-weight: 600; color: var(--text); direction: ltr; letter-spacing: -.01em; }
.desc-cell { min-inline-size: 0; display: grid; gap: 4px; }
.desc { font-size: var(--fs-md); font-weight: 600; color: var(--text); line-height: 1.5; }
.desc-alt { font-size: var(--fs-sm); color: var(--muted); }
.desc-note { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 6px; }
.expand { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.result-head:hover .expand { background: var(--surface-2); color: var(--text); }
.expand .chev { transition: transform var(--dur) var(--ease); }
.is-open .expand .chev { transform: rotate(180deg); }
.result-body { border-block-start: 1px solid var(--border); padding: 20px; display: grid; gap: 20px; animation: rise .18s var(--ease); }
.block-title { font-size: var(--fs-xs); font-weight: 650; color: var(--muted); margin-block-end: 8px; letter-spacing: .04em; text-transform: uppercase; }
html[lang="ar"] .block-title { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); font-weight: 600; }
.block p { color: var(--text-2); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-2); font-size: var(--fs-sm); }
.notice .ico { margin-block-start: 3px; color: var(--muted); }
.solution { margin-block-start: 10px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid; }
.solution-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-block-end: 6px; }
.solution-title { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 650; }
.solution p { color: var(--text); }
.solution .note { margin-block-start: 8px; font-size: var(--fs-xs); color: var(--muted); }
.s-official { background: var(--ok-bg); border-color: var(--ok-line); } .s-official .solution-title { color: var(--ok); }
.s-supported { background: var(--info-bg); border-color: var(--info-line); } .s-supported .solution-title { color: var(--info); }
.s-unverified { background: var(--warn-bg); border-color: var(--warn-line); } .s-unverified .solution-title { color: var(--warn); }
.disclosure { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); border-radius: var(--r-md); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--text); background: var(--surface-2); }
.disclosure > summary .chev { margin-inline-start: auto; }
.disclosure[open] > summary { border-block-end: 1px solid var(--border); border-end-start-radius: 0; border-end-end-radius: 0; }
.disclosure[open] > summary .chev { transform: rotate(180deg); }
.disclosure-body { padding: 14px; display: grid; gap: 14px; font-size: var(--fs-sm); }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 20px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.ref { padding-inline-start: 12px; border-inline-start: 2px solid var(--brand-line); display: grid; gap: 4px; }
.ref-title { font-weight: 600; color: var(--text); }
.ref-meta { font-size: var(--fs-xs); color: var(--muted); }
.ref blockquote { margin: 0; color: var(--text-2); }
.result-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-block-start: 14px; border-block-start: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }
.result-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.result-foot .spacer { flex: 1; }

/* states */
.state { display: grid; justify-items: center; gap: 8px; padding: 44px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.state-ico { inline-size: 44px; block-size: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); margin-block-end: 4px; }
.state-ico .ico { inline-size: 22px; block-size: 22px; }
.state.is-error .state-ico { background: var(--danger-bg); color: var(--danger); }
.state h3 { font-size: var(--fs-md); }
.state p { color: var(--muted); font-size: var(--fs-sm); max-inline-size: 520px; }
.skeleton { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; display: grid; grid-template-columns: 120px 1fr; gap: 18px; }
.sk { block-size: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk.w30 { inline-size: 30%; } .sk.w60 { inline-size: 60%; } .sk.w80 { inline-size: 80%; } .sk.h16 { block-size: 16px; }
.sk-col { display: grid; gap: 10px; align-content: start; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- dialog ---------- */
.dialog { inline-size: min(760px, calc(100vw - 32px)); max-block-size: min(84vh, 820px); padding: 0; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog[open] { animation: menu-in .18s var(--ease); }
.dialog::backdrop { background: rgba(8, 13, 20, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dialog-head { position: sticky; inset-block-start: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: var(--surface); border-block-end: 1px solid var(--border); }
.dialog-head h2 { font-size: var(--fs-lg); }
.dialog-body { padding: 18px 22px 22px; display: grid; gap: 12px; }
.dialog-body > p { color: var(--muted); font-size: var(--fs-sm); }
.src { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); }
.src-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.src-org { font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: var(--r-xs); padding: 1px 7px; letter-spacing: .02em; }
.src-title { font-weight: 600; font-size: var(--fs-sm); }
.src-meta { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.legend-item { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); }
.legend-item p { color: var(--text-2); font-size: var(--fs-sm); grid-column: 2; }
.legend-item .badge { grid-row: span 2; }
.legend-item h3 { font-size: var(--fs-sm); }

/* ---------- toast ---------- */
.toast { position: fixed; inset-block-end: 24px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 70; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-md); background: var(--text); color: var(--surface); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .18s var(--ease); }
html[dir="rtl"] .toast { transform: translateX(50%); }
.toast .ico { color: var(--brand-hover); }

/* ---------- footer ---------- */
.site-footer { border-block-start: 1px solid var(--border); background: var(--surface); font-size: var(--fs-sm); color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 18px; }
.footer-note { color: var(--danger); font-weight: 600; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links button { background: none; border: 0; padding: 0; color: var(--text-2); font-size: var(--fs-sm); }
.footer-links button:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .primary-nav { display: none; }
  .only-mobile { display: flex !important; }
}
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .adv { grid-template-columns: 1fr; }
  .result-head { grid-template-columns: 1fr auto; gap: 10px 12px; padding: 16px; }
  .code-cell { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 10px; }
  .desc-cell { grid-column: 1; }
  .expand .label { display: none; }
  .result-body { padding: 16px; }
  .row { grid-template-columns: 84px 1fr; }
  .row .badge { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-block-start: 8px; }
  .skeleton { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { padding-inline: 16px; }
  .header-inner { gap: 10px; }
  .brand-name { font-size: var(--fs-sm); }
  .lang-btn .lang-label { display: none; }
  .lang-btn { padding-inline: 10px; }
  .hero { padding-block: 32px 20px; }
  .search { block-size: 54px; padding-inline-start: 42px; border-radius: var(--r-lg); }
  .search-ico { inset-inline-start: 13px; }
  .search .kbd { display: none; }
  .search .btn-primary { padding-inline: 14px; block-size: 42px; border-radius: var(--r-md); }
  .search-meta { flex-direction: column; align-items: flex-start; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .menu { position: fixed; inset-inline: 12px; inset-block-start: calc(var(--header-h) + 6px); min-inline-size: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .switch, .badge, .btn-primary { border: 1px solid CanvasText; } }
@media print {
  .site-header, .hero, .site-footer, .toolbar, .expand, .toast { display: none !important; }
  .result { box-shadow: none; break-inside: avoid; }
}
.sprite { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
.src-list { display: grid; gap: 10px; }
.badge-dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: currentColor; flex: none; }
.disclosure > summary > span:last-child { margin-inline-start: auto; display: inline-flex; }
.disclosure[open] > summary > span:last-child .chev { transform: rotate(180deg); }
.lang-short { display: none; font-weight: 700; font-size: var(--fs-xs); }
@media (max-width: 560px) { .lang-short { display: inline; } }
html[dir="rtl"] .stat-go svg { transform: scaleX(-1); }
html[dir="rtl"] .stat:hover .stat-go { transform: translateX(-2px); }

/* ---------- code directory (v2): category rail + list + drawer ---------- */
.dir { display: grid; grid-template-columns: 240px 1fr; overflow: hidden; }
.dir-side { border-inline-end: 1px solid var(--border); background: var(--surface-2); padding: 14px 10px; }
.dir-side-label { padding: 2px 10px 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.dir-cats { display: grid; gap: 2px; }
.cat { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; inline-size: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-2); text-align: start; font-size: var(--fs-sm); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.cat:hover { background: var(--surface-3); color: var(--text); }
.cat[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.cat-key { min-inline-size: 30px; text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--muted); }
.cat[aria-pressed="true"] .cat-key { background: var(--brand-soft); color: var(--brand); }
.cat-key.all { font-family: var(--font-en); }
.cat-name { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-n { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--muted); font-family: var(--font-en); }
.cat-n.zero { opacity: .45; }
.dir-main { min-inline-size: 0; display: flex; flex-direction: column; }
.dir .dir-tools { padding: 12px 16px; border-block-end: 1px solid var(--border); }
.filter-input .filter-clear { position: absolute; inset-inline-end: 3px; inset-block-start: 50%; transform: translateY(-50%); inline-size: 30px; block-size: 30px; }
.filter-input .filter-clear .ico { position: static; transform: none; }
.seg-sm button { padding: 4px 10px; font-size: var(--fs-xs); display: inline-flex; align-items: center; gap: 6px; }
.ev-dot { inline-size: 7px; block-size: 7px; border-radius: 50%; }
.ev-dot-supported { background: var(--info); } .ev-dot-unverified { background: var(--warn); }
.dir-head, .code-row { display: grid; grid-template-columns: 112px 1fr 150px 20px; gap: 16px; align-items: center; padding-inline: 16px; }
.dir-head { padding-block: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); background: var(--surface-2); border-block-end: 1px solid var(--border); }
.dir-head span:last-child { grid-column: span 2; }
.dir-list { max-block-size: 560px; overflow: auto; overscroll-behavior: contain; }
.code-row { inline-size: 100%; padding-block: 12px; border: 0; border-block-end: 1px solid var(--border); background: transparent; text-align: start; position: relative;
  transition: background var(--dur) var(--ease); }
.code-row:last-child { border-block-end: 0; }
.code-row:hover { background: var(--surface-2); }
.code-row:focus-visible { outline-offset: -2px; border-radius: 0; }
.code-row.is-current { background: var(--brand-soft); }
.code-row.is-current::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 3px; background: var(--brand); }
.cr-code { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; color: var(--brand); direction: ltr; text-align: start; }
.cr-desc { min-inline-size: 0; display: grid; gap: 1px; }
.cr-main { color: var(--text); font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; }
.cr-alt { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; }
.cr-cat { display: none; }
.cr-go { color: var(--muted); transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
html[dir="rtl"] .cr-go svg { transform: scaleX(-1); }
.code-row:hover .cr-go { color: var(--text); transform: translateX(2px); }
html[dir="rtl"] .code-row:hover .cr-go { transform: translateX(-2px); }
mark { background: color-mix(in srgb, var(--warn) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.dir-foot { padding: 10px 16px; border-block-start: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); background: var(--surface-2); }
.dir-empty { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.dir-empty .ico { inline-size: 22px; block-size: 22px; }

/* drawer */
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; inset-inline-start: auto; margin: 0; block-size: 100dvh; max-block-size: 100dvh;
  inline-size: min(560px, 100vw); max-inline-size: 100vw; padding: 0; border: 0; border-inline-start: 1px solid var(--border); border-radius: 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .22s var(--ease); }
html[dir="rtl"] .drawer[open] { animation-name: drawer-in-rtl; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-in-rtl { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer::backdrop { background: rgba(8, 13, 20, .4); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-block-end: 1px solid var(--border); }
html[dir="rtl"] .drawer-head { padding: 14px 20px 14px 16px; }
.drawer-title { display: flex; align-items: center; gap: 10px; min-inline-size: 0; }
.drawer-title .code { font-size: var(--fs-lg); }
.drawer-actions { display: flex; gap: 2px; }
.flip-rtl-prev { transform: rotate(90deg); } .flip-rtl-next { transform: rotate(-90deg); }
html[dir="rtl"] .flip-rtl-prev { transform: rotate(-90deg); } html[dir="rtl"] .flip-rtl-next { transform: rotate(90deg); }
.drawer-body { flex: 1; overflow: auto; padding: 20px; display: grid; gap: 20px; align-content: start; }
.drawer-desc { display: grid; gap: 6px; }
.drawer-desc .desc { font-size: var(--fs-lg); }
.drawer .result-body { border: 0; padding: 0; animation: none; }
.drawer-loading { display: grid; gap: 10px; }

@media (max-width: 860px) {
  .dir { grid-template-columns: 1fr; }
  .dir-side { border-inline-end: 0; border-block-end: 1px solid var(--border); padding: 10px 12px; }
  .dir-side-label { display: none; }
  .dir-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block-end: 2px; }
  .dir-cats::-webkit-scrollbar { display: none; }
  .cat { inline-size: auto; flex: none; grid-template-columns: auto auto auto; border: 1px solid var(--border); background: var(--surface); }
  .cat-name { max-inline-size: 180px; }
}
@media (max-width: 640px) {
  .dir-head { display: none; }
  .code-row { grid-template-columns: 1fr 20px; grid-template-areas: "code go" "desc go" "ev go"; gap: 4px 12px; }
  .cr-code { grid-area: code; } .cr-desc { grid-area: desc; } .cr-ev { grid-area: ev; } .cr-go { grid-area: go; }
  .dir .dir-tools { flex-direction: column; align-items: stretch; }
  .filter-input { max-inline-size: none; }
  .dir-list { max-block-size: none; }
  .drawer { inline-size: 100vw; border-inline-start: 0; }
}
.dir > * { min-inline-size: 0; }
.dir-side { overflow: hidden; }
html[dir="rtl"] .cr-code, html[dir="rtl"] .s-code { text-align: right; }

/* =====================================================================
   v8: colour accents, popovers, animated hiding, grouped sources
   ===================================================================== */
:root {
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --grad-brand: linear-gradient(135deg, #0f766e 0%, #0e9488 45%, #2563eb 100%);
  --grad-line: linear-gradient(90deg, #0f766e, #14b8a6 35%, #3b82f6 70%, #6366f1);
  --hero-tint: radial-gradient(60% 120% at 85% -10%, rgba(20, 184, 166, .13), transparent 60%),
               radial-gradient(50% 110% at 10% 0%, rgba(99, 102, 241, .10), transparent 60%);
  --c-ad: #b45309; --c-ad-bg: #fef3e2;
  --c-be: #be123c; --c-be-bg: #fdecef;
  --c-cv: #1d4ed8; --c-cv-bg: #e9effd;
  --c-mn: #7c3aed; --c-mn-bg: #f1ebfe;
  --c-se: #047857; --c-se-bg: #e4f6ee;
  --c-me: #6d28d9; --c-me-bg: #f1ebfe;
  --c-bd: #be123c; --c-bd-bg: #fdecef;
}
:root[data-theme="dark"] {
  --accent: #8b8cf8; --accent-soft: #1d1d3d;
  --grad-brand: linear-gradient(135deg, #14b8a6 0%, #22c3b4 40%, #60a5fa 100%);
  --hero-tint: radial-gradient(60% 120% at 85% -10%, rgba(45, 212, 191, .12), transparent 60%), radial-gradient(50% 110% at 10% 0%, rgba(129, 140, 248, .12), transparent 60%);
  --c-ad: #f5b36b; --c-ad-bg: #2d1f0f; --c-be: #fb8fa6; --c-be-bg: #33141c; --c-cv: #93b4ff; --c-cv-bg: #142040;
  --c-mn: #c4a8ff; --c-mn-bg: #241a3d; --c-se: #6ee7b7; --c-se-bg: #0f2a20; --c-me: #c4a8ff; --c-me-bg: #241a3d; --c-bd: #fb8fa6; --c-bd-bg: #33141c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #8b8cf8; --accent-soft: #1d1d3d;
    --grad-brand: linear-gradient(135deg, #14b8a6 0%, #22c3b4 40%, #60a5fa 100%);
    --hero-tint: radial-gradient(60% 120% at 85% -10%, rgba(45, 212, 191, .12), transparent 60%), radial-gradient(50% 110% at 10% 0%, rgba(129, 140, 248, .12), transparent 60%);
    --c-ad: #f5b36b; --c-ad-bg: #2d1f0f; --c-be: #fb8fa6; --c-be-bg: #33141c; --c-cv: #93b4ff; --c-cv-bg: #142040;
    --c-mn: #c4a8ff; --c-mn-bg: #241a3d; --c-se: #6ee7b7; --c-se-bg: #0f2a20; --c-me: #c4a8ff; --c-me-bg: #241a3d; --c-bd: #fb8fa6; --c-bd-bg: #33141c;
  }
}
.cc-AD { --cc: var(--c-ad); --ccb: var(--c-ad-bg); } .cc-BE { --cc: var(--c-be); --ccb: var(--c-be-bg); }
.cc-CV { --cc: var(--c-cv); --ccb: var(--c-cv-bg); } .cc-MN { --cc: var(--c-mn); --ccb: var(--c-mn-bg); }
.cc-SE { --cc: var(--c-se); --ccb: var(--c-se-bg); } .cc-ME { --cc: var(--c-me); --ccb: var(--c-me-bg); } .cc-BD { --cc: var(--c-bd); --ccb: var(--c-bd-bg); }

/* brand accents */
.site-header::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 3px; background: var(--grad-line); }
.brand-mark { background: var(--grad-brand); box-shadow: 0 4px 12px -3px rgba(15, 118, 110, .45); }
.hero { background: var(--hero-tint); border-block-end: 1px solid var(--border); margin-block-end: 8px; }
.hl { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn-primary { background: var(--grad-brand); background-size: 160% 100%; background-position: 0 0; box-shadow: 0 6px 16px -6px rgba(15, 118, 110, .55); transition: background-position .35s var(--ease), box-shadow var(--dur) var(--ease); }
.btn-primary:hover { background: var(--grad-brand); background-size: 160% 100%; background-position: 100% 0; box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .45); }
.search:focus-within { border-color: transparent; box-shadow: var(--shadow-md), 0 0 0 2px var(--brand), 0 0 0 6px var(--ring); }
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 3px; background: var(--tc); opacity: .85; }
.stat::after { content: ""; position: absolute; inline-size: 160px; block-size: 160px; inset-inline-end: -60px; inset-block-end: -90px; border-radius: 50%; background: var(--tc); opacity: .07; transition: opacity var(--dur) var(--ease); }
.stat:hover::after { opacity: .13; }
.result { position: relative; }
.result::before { content: ""; position: absolute; inset-block: 16px; inset-inline-start: 0; inline-size: 3px; border-start-end-radius: 3px; border-end-end-radius: 3px; background: var(--tc, var(--brand)); }
.result.k-denial { --tc: var(--t-denial); } .result.k-insurer { --tc: var(--t-insurer); } .result.k-rule { --tc: var(--t-rule); }

/* coloured categories in the directory */
.cat-key[class*="cc-"] { background: var(--ccb); color: var(--cc); }
.cat[aria-pressed="true"] .cat-key[class*="cc-"] { background: var(--cc); color: var(--surface); }
.code-row .cr-code { display: inline-flex; align-items: center; gap: 8px; }
.code-row .cr-code::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 3px; background: var(--cc, var(--brand)); flex: none; }
.code-row[class*="cc-"]:hover { background: color-mix(in srgb, var(--ccb) 55%, var(--surface)); }
.badge.cat-badge[class*="cc-"] { background: var(--ccb); color: var(--cc); border-color: transparent; }

/* directory preview + expand */
#dirMore:empty { display: none; }
.dir-more { position: relative; display: flex; justify-content: center; padding: 12px 16px; border-block-start: 1px solid var(--border); }
.dir-more.is-collapsed::before { content: ""; position: absolute; inset-inline: 0; inset-block-end: 100%; block-size: 56px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--surface)); }
.chev.up { transform: rotate(180deg); }
.dir-list { max-block-size: none; }

/* advanced options popover */
.adv-wrap { position: relative; }
.adv-count { display: inline-grid; place-items: center; min-inline-size: 18px; block-size: 18px; padding-inline: 5px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 700; font-family: var(--font-en); }
.adv { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 35; inline-size: min(560px, calc(100vw - 32px)); margin: 0;
  grid-template-columns: 1fr; box-shadow: var(--shadow-lg); border-radius: var(--r-lg); }
.adv-head { display: flex; align-items: center; justify-content: space-between; margin-block-end: -4px; }
.adv-title { font-weight: 650; font-size: var(--fs-sm); color: var(--text); }
.adv-close { inline-size: 30px; block-size: 30px; }
.adv-actions { justify-content: flex-end; padding-block-start: 10px; border-block-start: 1px solid var(--border); }
.adv-toggle[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
@media (max-width: 560px) { .adv { position: fixed; inset-inline: 12px; inset-block-start: auto; inset-block-end: 12px; inline-size: auto; } }

/* animated hiding */
@keyframes menu-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes drawer-out { from { transform: none; opacity: 1; } to { transform: translateX(28px); opacity: 0; } }
@keyframes drawer-out-rtl { from { transform: none; opacity: 1; } to { transform: translateX(-28px); opacity: 0; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
.menu.is-closing, .adv.is-closing { animation: menu-out .13s var(--ease) forwards; pointer-events: none; }
.dialog.is-closing { animation: menu-out .17s var(--ease) forwards; }
.drawer.is-closing { animation: drawer-out .17s var(--ease) forwards; }
html[dir="rtl"] .drawer.is-closing { animation-name: drawer-out-rtl; }
dialog.is-closing::backdrop { animation: fade-out .17s var(--ease) forwards; }

/* drawer accent */
.drawer-head { position: relative; }
.drawer-head::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px; block-size: 2px; background: var(--grad-line); opacity: .8; }

/* grouped sources */
.src-group { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.src-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface-2); font-weight: 600; font-size: var(--fs-sm); }
.src-group > summary::-webkit-details-marker { display: none; }
.src-group > summary:hover { background: var(--surface-3); }
.src-group > summary > span:last-child { margin-inline-start: auto; display: inline-flex; }
.src-group[open] > summary > span:last-child .chev { transform: rotate(180deg); }
.src-group-n { font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-en); }
.src-items { display: grid; gap: 8px; padding: 10px; }
.src-items .src { background: var(--surface); }
.src-title { display: inline-flex; align-items: baseline; gap: 6px; color: var(--text); }
.src-title:hover { color: var(--brand); }
.src-title .ico { color: var(--muted); align-self: center; }
.src-actions, .ref-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-block-start: 4px; }
.src-link, .ref-links a { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 600; }
.result-foot a + a { color: var(--text-2); }

/* =====================================================================
   v9: Code explorer (merged toolbar, filter popover, cards / list)
   ===================================================================== */
.view-toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.view-toggle button { display: grid; place-items: center; inline-size: 34px; block-size: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.view-toggle button:hover { color: var(--text); }
.view-toggle button[aria-checked="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

.explorer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); }
.explorer-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px; border-block-end: 1px solid var(--border); }
.explorer-bar .segmented button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; }
.explorer-bar .segmented button .ico { color: var(--muted); }
.explorer-bar .segmented button[aria-selected="true"] .ico { color: var(--brand); }
.explorer-search { flex: 1; min-inline-size: 220px; max-inline-size: none; }
.explorer-search input { block-size: 40px; border-radius: var(--r-md); background: var(--surface-2); border-color: transparent; }
.explorer-search input:hover { border-color: var(--border-strong); }
.explorer-search input:focus { background: var(--surface); }
.filter-btn { block-size: 40px; gap: 8px; }
.filter-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--brand-line); }
.pop-wrap { position: relative; }
.popover { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 36; inline-size: min(440px, calc(100vw - 32px));
  display: grid; gap: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: menu-in .16s var(--ease); }
.popover.is-closing { animation: menu-out .13s var(--ease) forwards; pointer-events: none; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease); }
html[dir="rtl"] .cat-chip { padding: 6px 6px 6px 10px; }
.cat-chip:hover { border-color: var(--cc, var(--border-strong)); color: var(--text); }
.cat-chip[aria-pressed="true"] { background: var(--ccb); border-color: var(--cc); color: var(--text); font-weight: 600; }
.cat-chip .cat-key { min-inline-size: 28px; border-radius: 999px; }
.cat-chip[aria-pressed="true"] .cat-key { background: var(--cc); color: var(--surface); }
.cat-chip .cat-name { white-space: nowrap; }

.active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-block-end: 1px solid var(--border); background: var(--surface-2); }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
  background: var(--ccb, var(--surface)); color: var(--cc, var(--text-2)); border: 1px solid var(--cc, var(--border-strong)); animation: menu-in .14s var(--ease); }
html[dir="rtl"] .fchip { padding: 3px 10px 3px 4px; }
.fchip.b-supported, .fchip.b-unverified { border-color: currentColor; }
.fchip-x { display: grid; place-items: center; inline-size: 20px; block-size: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .75; }
.fchip-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.fchip-clear { font-size: var(--fs-xs); margin-inline-start: 4px; }
.explorer-meta { padding: 10px 16px 0; font-size: var(--fs-xs); color: var(--muted); }

/* card grid */
.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 12px 14px 16px; }
.code-grid > [role="listitem"] { display: flex; }
.code-card { position: relative; inline-size: 100%; display: flex; flex-direction: column; gap: 6px; text-align: start; padding: 14px 16px 12px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.code-card::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 3px; background: var(--cc, var(--brand)); opacity: .9; }
.code-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--cc, var(--brand)) 40%, var(--border)); }
.code-card:focus-visible { outline-offset: 2px; border-radius: var(--r-lg); }
.code-card.is-current { border-color: var(--cc, var(--brand)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc, var(--brand)) 22%, transparent); }
.cc-top { display: flex; align-items: center; gap: 8px; min-inline-size: 0; }
.cc-code { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 700; color: var(--cc, var(--brand)); background: var(--ccb, var(--brand-soft)); border-radius: var(--r-xs); padding: 1px 8px; direction: ltr; flex: none; }
.cc-cat { flex: 1; min-inline-size: 0; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-ev { inline-size: 8px; block-size: 8px; border-radius: 50%; flex: none; border: 0; padding: 0; background: currentColor; }
.cc-title { color: var(--text); font-weight: 600; font-size: var(--fs-base); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[lang="ar"] .cc-title { font-size: var(--fs-md); }
.cc-title.mono-title { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; text-align: start; }
html[dir="rtl"] .cc-title.mono-title { text-align: right; }
.cc-sub { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.cc-foot { margin-block-start: auto; padding-block-start: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-foot .badge { font-size: 11px; }
.cc-open { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); transition: color var(--dur) var(--ease), gap var(--dur) var(--ease); }
html[dir="rtl"] .cc-open svg { transform: scaleX(-1); }
.code-card:hover .cc-open { color: var(--cc, var(--brand)); gap: 7px; }

/* compact list mode */
.code-grid.is-list { grid-template-columns: 1fr; gap: 0; padding: 6px 0 0; }
.code-grid.is-list .code-card { flex-direction: row; align-items: center; gap: 14px; border: 0; border-block-end: 1px solid var(--border); border-radius: 0; box-shadow: none; padding: 11px 16px; }
.code-grid.is-list .code-card::before { inset-block: 10px; inset-inline-start: 0; inset-inline-end: auto; inline-size: 3px; block-size: auto; border-radius: 0 3px 3px 0; }
html[dir="rtl"] .code-grid.is-list .code-card::before { border-radius: 3px 0 0 3px; }
.code-grid.is-list .code-card:hover { transform: none; background: var(--surface-2); }
.code-grid.is-list .cc-top { flex: 0 0 auto; inline-size: 120px; }
.code-grid.is-list .cc-cat, .code-grid.is-list .cc-ev { display: none; }
.code-grid.is-list .cc-title { flex: 1; -webkit-line-clamp: 1; font-size: var(--fs-sm); }
.code-grid.is-list .cc-sub { display: none; }
.code-grid.is-list .cc-foot { margin: 0; padding: 0; flex: none; gap: 14px; }
.code-grid.is-list .cc-open .label, .code-grid.is-list .cc-open { font-size: 0; gap: 0; }
.code-grid.is-list .cc-open svg { inline-size: 15px; block-size: 15px; }
.code-grid .dir-empty { grid-column: 1 / -1; }
#dirMore .dir-more { border-block-start: 1px solid var(--border); }

@media (max-width: 720px) {
  .explorer-bar { flex-direction: column; align-items: stretch; }
  .explorer-bar .segmented { display: grid; grid-template-columns: 1fr 1fr; }
  .explorer-bar .segmented button { justify-content: center; }
  .pop-wrap { align-self: stretch; } .filter-btn { inline-size: 100%; }
  .popover { position: fixed; inset-inline: 12px; inset-block-start: auto; inset-block-end: 12px; inline-size: auto; max-block-size: 75vh; overflow: auto; }
  .code-grid { grid-template-columns: 1fr; padding: 10px; }
  .code-grid.is-list .cc-top { inline-size: 96px; }
  .code-grid.is-list .cc-foot .badge { display: none; }
}

/* patient-data warning in red */
.privacy { color: var(--danger); font-weight: 600; }
.privacy .ico { color: var(--danger); }

.cc-title.mono-title { overflow-wrap: normal; word-break: normal; font-size: .8125rem; }

/* v12: code lists collapsed by default */
.dir-head-actions { display: flex; align-items: center; gap: 8px; }
.dir-toggle .chev { transition: transform var(--dur) var(--ease); }
.dir-toggle.is-open .chev { transform: rotate(180deg); }
.dir-collapsed { display: grid; justify-items: center; gap: 10px; padding: 28px 20px 30px; text-align: center; color: var(--muted); font-size: var(--fs-sm); animation: rise .2s var(--ease); }
.dir-collapsed-ico { inline-size: 44px; block-size: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.dir-collapsed-ico .ico { inline-size: 22px; block-size: 22px; }
.code-grid:not([hidden]) .code-card { animation: rise .22s var(--ease) both; }
.explorer-meta[hidden] + .code-grid { padding-block-start: 0; }

/* v13: directory opens from the overview cards; validation-rule colours */
.stat[aria-pressed="true"] { border-color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 22%, transparent), var(--shadow-md); }
.stat[aria-pressed="true"] .stat-go { color: var(--tc); transform: rotate(90deg); }
html[dir="rtl"] .stat[aria-pressed="true"] .stat-go { transform: rotate(-90deg); }
#directory:not([hidden]) { animation: rise .24s var(--ease); }
#directory.is-closing { animation: fade-out .16s var(--ease) forwards; }
.explorer-bar .segmented { flex-wrap: wrap; }
.code-card.is-off { opacity: .78; }
:root { --c-bv: #0f766e; --c-bv-bg: #e3f4f1; --c-dt: #0e7490; --c-dt-bg: #e2f3f7; --c-ib: #4338ca; --c-ib-bg: #ecebfd;
  --c-ic: #0369a1; --c-ic-bg: #e5f2fb; --c-re: #475569; --c-re-bg: #eef1f5; --c-ge: #b91c1c; --c-ge-bg: #fdecec; --c-fr: #6b7280; --c-fr-bg: #f1f2f4; }
:root[data-theme="dark"] { --c-bv: #5eead4; --c-bv-bg: #0f2a27; --c-dt: #67e8f9; --c-dt-bg: #0c2a31; --c-ib: #a5b4fc; --c-ib-bg: #1c1d3e;
  --c-ic: #7dd3fc; --c-ic-bg: #0c2536; --c-re: #cbd5e1; --c-re-bg: #1e2733; --c-ge: #fca5a5; --c-ge-bg: #3a1515; --c-fr: #d1d5db; --c-fr-bg: #22262d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-bv: #5eead4; --c-bv-bg: #0f2a27; --c-dt: #67e8f9; --c-dt-bg: #0c2a31; --c-ib: #a5b4fc; --c-ib-bg: #1c1d3e;
  --c-ic: #7dd3fc; --c-ic-bg: #0c2536; --c-re: #cbd5e1; --c-re-bg: #1e2733; --c-ge: #fca5a5; --c-ge-bg: #3a1515; --c-fr: #d1d5db; --c-fr-bg: #22262d; } }
.cc-BV { --cc: var(--c-bv); --ccb: var(--c-bv-bg); } .cc-DT { --cc: var(--c-dt); --ccb: var(--c-dt-bg); } .cc-IB { --cc: var(--c-ib); --ccb: var(--c-ib-bg); }
.cc-IC { --cc: var(--c-ic); --ccb: var(--c-ic-bg); } .cc-RE { --cc: var(--c-re); --ccb: var(--c-re-bg); } .cc-GE { --cc: var(--c-ge); --ccb: var(--c-ge-bg); } .cc-FR { --cc: var(--c-fr); --ccb: var(--c-fr-bg); }
.code-grid.is-list .cc-title { white-space: nowrap; text-overflow: ellipsis; display: block; }
.code-grid.is-list .cc-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-grid.is-list .code-card { align-items: flex-start; }
.code-grid.is-list .cc-texts { flex: 1; min-inline-size: 0; }
.cc-texts { display: grid; gap: 4px; min-inline-size: 0; }

/* formal Arabic typography (Noto Kufi Arabic) */
html[lang="ar"] body { font-size: .9375rem; line-height: 1.95; }
html[lang="ar"] .hero h1 { font-weight: 700; line-height: 1.55; font-size: clamp(1.6rem, 2.1vw + .9rem, 2.1rem); }
html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .brand-name { font-weight: 700; }
html[lang="ar"] .desc, html[lang="ar"] .cc-title { font-weight: 600; line-height: 1.8; }
html[lang="ar"] .btn, html[lang="ar"] .nav-link, html[lang="ar"] .badge { font-weight: 600; }
html[lang="ar"] .lead, html[lang="ar"] .block p, html[lang="ar"] .solution p { line-height: 2; }
html[lang="ar"] #q { font-size: .975rem; }

/* code-system link + identifier */
.cs-cell { display: grid; gap: 2px; }
.cs-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; justify-self: start; }
.cs-id { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }

.src-cell { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* copy-code button beside the code */
.result-head { cursor: default; }
.result-head .code-cell { cursor: pointer; }
.code-line { display: inline-flex; align-items: center; gap: 6px; }
.copy-code-btn { display: inline-grid; place-items: center; inline-size: 28px; block-size: 28px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.copy-code-btn:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }
.copy-code-btn:active { transform: scale(.94); }
.result-toggle { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; padding: 0; border: 0; background: transparent; text-align: start; cursor: pointer; }
.result-toggle:hover .expand { background: var(--surface-2); color: var(--text); }
.is-open .result-toggle .expand .chev { transform: rotate(180deg); }
@media (max-width: 760px) {
  .result-toggle { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr auto; gap: 10px 12px; }
}

/* v21: simplified result details */
.result-body { gap: 18px; }
.result-body .block + .block { padding-block-start: 16px; border-block-start: 1px dashed var(--border); }
.block-title { display: flex; align-items: center; gap: 8px; }
.block-title::before { content: ""; inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--brand); }
.solution { margin-block-start: 6px; }
.solution p { font-size: var(--fs-md); line-height: 1.9; }
html[lang="en"] .solution p { line-height: 1.7; }

/* badge explanations (hover / keyboard focus) */
.has-tip { position: relative; cursor: help; }
.has-tip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 999px; }
.has-tip::after { content: attr(data-tip); position: absolute; inset-block-end: calc(100% + 8px); inset-inline-start: 50%; transform: translateX(-50%) translateY(4px);
  inline-size: max-content; max-inline-size: 280px; white-space: normal; padding: 8px 11px; border-radius: var(--r-sm); background: var(--text); color: var(--surface);
  font-size: var(--fs-xs); font-weight: 500; line-height: 1.7; text-align: start; box-shadow: var(--shadow-lg); z-index: 60;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .14s var(--ease), transform .14s var(--ease), visibility .14s; }
html[dir="rtl"] .has-tip::after { transform: translateX(50%) translateY(4px); inset-inline-start: auto; inset-inline-end: 50%; }
.has-tip:hover::after, .has-tip:focus-visible::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
html[dir="rtl"] .has-tip:hover::after, html[dir="rtl"] .has-tip:focus-visible::after { transform: translateX(50%) translateY(0); }
.desc-note { display: none; }

/* tooltip placement fix: open from the badge's start edge, never clipped by the card */
.result { overflow: visible; }
.result-head { border-start-start-radius: var(--r-lg); border-start-end-radius: var(--r-lg); }
.has-tip::after, html[dir="rtl"] .has-tip::after { inset-inline-start: 0; inset-inline-end: auto; transform: translateY(4px); }
.has-tip:hover::after, .has-tip:focus-visible::after,
html[dir="rtl"] .has-tip:hover::after, html[dir="rtl"] .has-tip:focus-visible::after { transform: translateY(0); }
.has-tip:hover, .has-tip:focus-visible { z-index: 61; }
.drawer .has-tip::after { inset-block-end: auto; inset-block-start: calc(100% + 8px); }

/* v24: full-page code details */
.is-detail .hero { display: none; }
.detail { padding-block: 22px 8px; animation: rise .22s var(--ease); }
.detail-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block-end: 14px; }
.detail-back { padding-inline: 10px; }
html[dir="ltr"] .back-ico { transform: scaleX(-1); }
.detail-steps { display: flex; align-items: center; gap: 8px; }
.detail-pos { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; min-inline-size: 64px; text-align: center; }
.prev-ico { transform: rotate(90deg); } .next-ico { transform: rotate(-90deg); }
html[dir="rtl"] .prev-ico { transform: rotate(-90deg); } html[dir="rtl"] .next-ico { transform: rotate(90deg); }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); overflow: visible; }
.detail-head { position: relative; display: grid; gap: 8px; padding: 26px 28px 22px; border-block-end: 1px solid var(--border); }
.detail-head::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 4px; border-start-start-radius: var(--r-xl); border-start-end-radius: var(--r-xl); background: var(--tc, var(--brand)); }
.detail-head.k-denial { --tc: var(--t-denial); } .detail-head.k-insurer { --tc: var(--t-insurer); } .detail-head.k-rule { --tc: var(--t-rule); }
.detail-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-code { margin: 0; font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.detail-desc { font-size: 1.3rem; font-weight: 700; line-height: 1.6; color: var(--text); }
html[lang="ar"] .detail-desc { line-height: 1.9; }
.detail-head .desc-alt { font-size: var(--fs-base); }
.detail-card .result-body { border: 0; padding: 24px 28px 28px; animation: none; }
.result-toggle .expand .go { display: inline-flex; }
html[dir="rtl"] .result-toggle .expand .go svg { transform: scaleX(-1); }
.result-head:hover .expand { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
@media (max-width: 640px) {
  .detail-head { padding: 20px 18px 18px; }
  .detail-card .result-body { padding: 18px; }
  .detail-desc { font-size: 1.1rem; }
  .detail-steps .btn span { display: none; }
}

/* v28: compact overview bar (replaces the large cards) */
.stats { gap: 10px; }
.stat { display: flex; flex-direction: row; align-items: center; gap: 12px; min-block-size: 0; padding: 12px 14px;
  border-radius: var(--r-lg); border: 1px solid var(--border); border-inline-start: 3px solid var(--tc); overflow: hidden; }
.stat::before, .stat::after { content: none; display: none; }
.stat:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border-strong); border-inline-start-color: var(--tc); }
.stat-ico { inline-size: 36px; block-size: 36px; flex: none; border-radius: 10px; }
.stat-text { flex: 1; min-inline-size: 0; display: grid; gap: 1px; }
.stat-label { font-size: var(--fs-base); font-weight: 700; line-height: 1.4; }
.stat-sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.stat-num { flex: none; font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0; line-height: 1; padding: 6px 10px; border-radius: 999px;
  background: var(--tb); color: var(--tc); font-family: var(--font-en); }
.stat-go { flex: none; color: var(--muted); transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
.stat-go svg, html[dir="rtl"] .stat-go svg { transform: rotate(-90deg); }
html[dir="rtl"] .stat-go svg { transform: rotate(90deg); }
.stat:hover .stat-go, html[dir="rtl"] .stat:hover .stat-go { color: var(--text); transform: none; }
.stat[aria-pressed="true"] { background: color-mix(in srgb, var(--tb) 55%, var(--surface)); border-color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 18%, transparent); }
.stat[aria-pressed="true"] .stat-go, html[dir="rtl"] .stat[aria-pressed="true"] .stat-go { color: var(--tc); transform: none; }
.stat[aria-pressed="true"] .stat-go svg { transform: none; }
.section:has(#stats) { margin-block-start: 18px; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
}
.stat-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: clip; font-size: .72rem; line-height: 1.55; }

/* v30: refreshed hero */
.hero { padding-block: 52px 30px; }
.hero h1 { font-size: clamp(1.7rem, 2.2vw + 1rem, 2.35rem); }
.hl-solid { color: var(--brand); }
.lead { margin: 12px auto 26px; max-inline-size: 560px; font-size: var(--fs-base); line-height: 1.9; }
.search { block-size: 62px; padding: 7px; padding-inline-start: 50px; border-radius: 16px; }
.search-ico { inset-inline-start: 18px; inline-size: 21px; block-size: 21px; }
#q { font-size: 1.02rem; }
.search .search-submit { block-size: 48px; padding-inline: 22px 24px; gap: 8px; border-radius: 12px; font-size: var(--fs-base); }
.search .kbd { display: none; }
.search-meta { margin-block-start: 14px; align-items: center; }
.privacy { display: inline-flex; align-items: flex-start; gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--danger-bg); border: 1px solid var(--danger-line);
  color: var(--danger); font-size: var(--fs-xs); font-weight: 600; line-height: 1.7; text-align: start; max-inline-size: 620px; }
.privacy .ico { color: var(--danger); margin-block-start: 3px; flex: none; }
.adv-toggle { white-space: nowrap; }
.examples { margin-block-start: 18px; gap: 8px; }
.examples-label { font-weight: 600; }
.chip { padding: 5px 13px; }
html[lang="ar"] .chip[data-only="en"], html[lang="en"] .chip[data-only="ar"] { display: none; }
@media (max-width: 560px) {
  .search { block-size: 56px; padding-inline-start: 42px; }
  .search .search-submit { block-size: 42px; padding-inline: 12px; }
  .search .search-submit span { display: none; }
  .privacy { inline-size: 100%; }
}

/* v33: modern light mode */
:root[data-theme="light"] {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f1f4f9; --surface-3: #e8ecf3;
  --border: #e3e8f0; --border-strong: #cfd7e3;
  --text: #0b1324; --text-2: #2f3b52; --muted: #5b6679; --placeholder: #8792a5;
  --brand: #0f766e; --brand-hover: #0b5f58; --brand-soft: #e6f6f3; --brand-line: #b4e2da; --ring: rgba(13, 148, 136, .22);
  --grad-brand: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #4f46e5 100%);
  --grad-text: linear-gradient(100deg, #0f766e 0%, #0e7490 45%, #4338ca 100%);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px -6px rgba(16, 24, 40, .08);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .04), 0 12px 28px -10px rgba(16, 24, 40, .14);
  --shadow-lg: 0 4px 8px rgba(16, 24, 40, .04), 0 24px 56px -16px rgba(16, 24, 40, .22);
  --glass: rgba(255, 255, 255, .72);
}
@media (prefers-color-scheme: light) {
:root:not([data-theme="dark"]) {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f1f4f9; --surface-3: #e8ecf3;
  --border: #e3e8f0; --border-strong: #cfd7e3;
  --text: #0b1324; --text-2: #2f3b52; --muted: #5b6679; --placeholder: #8792a5;
  --brand: #0f766e; --brand-hover: #0b5f58; --brand-soft: #e6f6f3; --brand-line: #b4e2da; --ring: rgba(13, 148, 136, .22);
  --grad-brand: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #4f46e5 100%);
  --grad-text: linear-gradient(100deg, #0f766e 0%, #0e7490 45%, #4338ca 100%);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px -6px rgba(16, 24, 40, .08);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .04), 0 12px 28px -10px rgba(16, 24, 40, .14);
  --shadow-lg: 0 4px 8px rgba(16, 24, 40, .04), 0 24px 56px -16px rgba(16, 24, 40, .22);
  --glass: rgba(255, 255, 255, .72);
}
}
:root[data-theme="light"] body { background:
    radial-gradient(900px 520px at 100% -8%, rgba(20, 184, 166, .14), transparent 62%),
    radial-gradient(780px 480px at -6% 4%, rgba(99, 102, 241, .11), transparent 60%),
    radial-gradient(700px 420px at 50% 112%, rgba(14, 165, 233, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed; }
:root[data-theme="light"] .site-header { background: var(--glass); border-block-end: 1px solid rgba(15, 23, 42, .06);
  backdrop-filter: saturate(170%) blur(16px); -webkit-backdrop-filter: saturate(170%) blur(16px); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset; }
:root[data-theme="light"] .site-header::before { opacity: .9; }
:root[data-theme="light"] .brand-mark { background: var(--grad-brand); box-shadow: 0 6px 16px -6px rgba(13, 148, 136, .65), inset 0 1px 0 rgba(255, 255, 255, .35); }
:root[data-theme="light"] .nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
:root[data-theme="light"] .nav-link:hover { background: rgba(15, 23, 42, .045); }
:root[data-theme="light"] .lang-btn, :root[data-theme="light"] .icon-btn { background: rgba(255, 255, 255, .8); border-color: var(--border); box-shadow: var(--shadow-xs); }
:root[data-theme="light"] .lang-btn:hover, :root[data-theme="light"] .icon-btn:hover { background: #fff; border-color: var(--border-strong); }
:root[data-theme="light"] .hero { position: relative; background: transparent; border-block-end: 0; isolation: isolate; }
:root[data-theme="light"] .hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(15, 23, 42, .09) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 85% at 50% 30%, #000 20%, transparent 75%); mask-image: radial-gradient(70% 85% at 50% 30%, #000 20%, transparent 75%); }
:root[data-theme="light"] .hl-solid { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
:root[data-theme="light"] .lead { color: var(--text-2); }
:root[data-theme="light"] .search { background: #fff; border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 40px -18px rgba(13, 79, 110, .28), 0 0 0 6px rgba(255, 255, 255, .55); }
:root[data-theme="light"] .search:focus-within { border-color: transparent;
  box-shadow: 0 18px 40px -18px rgba(13, 79, 110, .32), 0 0 0 2px var(--brand), 0 0 0 7px var(--ring); }
:root[data-theme="light"] .search .search-submit { background: var(--grad-brand); color: #fff; border: 0;
  box-shadow: 0 8px 18px -8px rgba(8, 145, 178, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
:root[data-theme="light"] .search .search-submit:hover { filter: brightness(1.06) saturate(1.05); box-shadow: 0 10px 22px -8px rgba(8, 145, 178, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
:root[data-theme="light"] .privacy { background: #fff5f4; border-color: #f6cfca; box-shadow: 0 1px 2px rgba(180, 35, 24, .05); }
:root[data-theme="light"] .adv-wrap > button, :root[data-theme="light"] .adv-btn { background: rgba(255, 255, 255, .7); }
:root[data-theme="light"] .chip { background: rgba(255, 255, 255, .85); border-color: var(--border); box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease); }
:root[data-theme="light"] .chip:hover { transform: translateY(-1px); background: #fff; border-color: var(--brand-line); color: var(--brand); box-shadow: 0 6px 14px -8px rgba(13, 148, 136, .45); }
:root[data-theme="light"] .stat { background: rgba(255, 255, 255, .9); border: 1px solid rgba(15, 23, 42, .07); border-inline-start: 1px solid rgba(15, 23, 42, .07);
  border-radius: 16px; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
:root[data-theme="light"] .stat::before { content: ""; display: block; position: absolute; inset-block: 12px; inset-inline-start: 0; inline-size: 3px; block-size: auto; border-radius: 0 3px 3px 0; background: var(--tc); }
:root[data-theme="light"][dir="rtl"] .stat::before { border-radius: 3px 0 0 3px; }
:root[data-theme="light"] .stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--tc) 30%, rgba(15, 23, 42, .07)); }
:root[data-theme="light"] .stat-ico { background: var(--tb); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 14%, transparent); }
:root[data-theme="light"] .stat[aria-pressed="true"] { background: #fff; border-color: color-mix(in srgb, var(--tc) 55%, transparent);
  box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--tc) 12%, transparent); }
:root[data-theme="light"] .result, :root[data-theme="light"] .detail-card, :root[data-theme="light"] .explorer, :root[data-theme="light"] .card-surface, :root[data-theme="light"] .code-card, :root[data-theme="light"] .menu, :root[data-theme="light"] .dialog-panel, :root[data-theme="light"] dialog { border-color: rgba(15, 23, 42, .07); }
:root[data-theme="light"] .result, :root[data-theme="light"] .detail-card, :root[data-theme="light"] .explorer, :root[data-theme="light"] .card-surface { box-shadow: var(--shadow-sm); border-radius: 16px; }
:root[data-theme="light"] .code-card { box-shadow: var(--shadow-xs); }
:root[data-theme="light"] .code-card:hover { box-shadow: var(--shadow-md); }
:root[data-theme="light"] .menu { box-shadow: var(--shadow-lg); }
:root[data-theme="light"] .site-footer { background: rgba(255, 255, 255, .6); border-block-start: 1px solid rgba(15, 23, 42, .06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
@media (prefers-color-scheme: light) {
:root:not([data-theme="dark"]) body { background:
    radial-gradient(900px 520px at 100% -8%, rgba(20, 184, 166, .14), transparent 62%),
    radial-gradient(780px 480px at -6% 4%, rgba(99, 102, 241, .11), transparent 60%),
    radial-gradient(700px 420px at 50% 112%, rgba(14, 165, 233, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed; }
:root:not([data-theme="dark"]) .site-header { background: var(--glass); border-block-end: 1px solid rgba(15, 23, 42, .06);
  backdrop-filter: saturate(170%) blur(16px); -webkit-backdrop-filter: saturate(170%) blur(16px); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset; }
:root:not([data-theme="dark"]) .site-header::before { opacity: .9; }
:root:not([data-theme="dark"]) .brand-mark { background: var(--grad-brand); box-shadow: 0 6px 16px -6px rgba(13, 148, 136, .65), inset 0 1px 0 rgba(255, 255, 255, .35); }
:root:not([data-theme="dark"]) .nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
:root:not([data-theme="dark"]) .nav-link:hover { background: rgba(15, 23, 42, .045); }
:root:not([data-theme="dark"]) .lang-btn, :root:not([data-theme="dark"]) .icon-btn { background: rgba(255, 255, 255, .8); border-color: var(--border); box-shadow: var(--shadow-xs); }
:root:not([data-theme="dark"]) .lang-btn:hover, :root:not([data-theme="dark"]) .icon-btn:hover { background: #fff; border-color: var(--border-strong); }
:root:not([data-theme="dark"]) .hero { position: relative; background: transparent; border-block-end: 0; isolation: isolate; }
:root:not([data-theme="dark"]) .hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(15, 23, 42, .09) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 85% at 50% 30%, #000 20%, transparent 75%); mask-image: radial-gradient(70% 85% at 50% 30%, #000 20%, transparent 75%); }
:root:not([data-theme="dark"]) .hl-solid { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
:root:not([data-theme="dark"]) .lead { color: var(--text-2); }
:root:not([data-theme="dark"]) .search { background: #fff; border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 40px -18px rgba(13, 79, 110, .28), 0 0 0 6px rgba(255, 255, 255, .55); }
:root:not([data-theme="dark"]) .search:focus-within { border-color: transparent;
  box-shadow: 0 18px 40px -18px rgba(13, 79, 110, .32), 0 0 0 2px var(--brand), 0 0 0 7px var(--ring); }
:root:not([data-theme="dark"]) .search .search-submit { background: var(--grad-brand); color: #fff; border: 0;
  box-shadow: 0 8px 18px -8px rgba(8, 145, 178, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
:root:not([data-theme="dark"]) .search .search-submit:hover { filter: brightness(1.06) saturate(1.05); box-shadow: 0 10px 22px -8px rgba(8, 145, 178, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
:root:not([data-theme="dark"]) .privacy { background: #fff5f4; border-color: #f6cfca; box-shadow: 0 1px 2px rgba(180, 35, 24, .05); }
:root:not([data-theme="dark"]) .adv-wrap > button, :root:not([data-theme="dark"]) .adv-btn { background: rgba(255, 255, 255, .7); }
:root:not([data-theme="dark"]) .chip { background: rgba(255, 255, 255, .85); border-color: var(--border); box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease); }
:root:not([data-theme="dark"]) .chip:hover { transform: translateY(-1px); background: #fff; border-color: var(--brand-line); color: var(--brand); box-shadow: 0 6px 14px -8px rgba(13, 148, 136, .45); }
:root:not([data-theme="dark"]) .stat { background: rgba(255, 255, 255, .9); border: 1px solid rgba(15, 23, 42, .07); border-inline-start: 1px solid rgba(15, 23, 42, .07);
  border-radius: 16px; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
:root:not([data-theme="dark"]) .stat::before { content: ""; display: block; position: absolute; inset-block: 12px; inset-inline-start: 0; inline-size: 3px; block-size: auto; border-radius: 0 3px 3px 0; background: var(--tc); }
:root:not([data-theme="dark"])[dir="rtl"] .stat::before { border-radius: 3px 0 0 3px; }
:root:not([data-theme="dark"]) .stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--tc) 30%, rgba(15, 23, 42, .07)); }
:root:not([data-theme="dark"]) .stat-ico { background: var(--tb); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 14%, transparent); }
:root:not([data-theme="dark"]) .stat[aria-pressed="true"] { background: #fff; border-color: color-mix(in srgb, var(--tc) 55%, transparent);
  box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--tc) 12%, transparent); }
:root:not([data-theme="dark"]) .result, :root:not([data-theme="dark"]) .detail-card, :root:not([data-theme="dark"]) .explorer, :root:not([data-theme="dark"]) .card-surface, :root:not([data-theme="dark"]) .code-card, :root:not([data-theme="dark"]) .menu, :root:not([data-theme="dark"]) .dialog-panel, :root:not([data-theme="dark"]) dialog { border-color: rgba(15, 23, 42, .07); }
:root:not([data-theme="dark"]) .result, :root:not([data-theme="dark"]) .detail-card, :root:not([data-theme="dark"]) .explorer, :root:not([data-theme="dark"]) .card-surface { box-shadow: var(--shadow-sm); border-radius: 16px; }
:root:not([data-theme="dark"]) .code-card { box-shadow: var(--shadow-xs); }
:root:not([data-theme="dark"]) .code-card:hover { box-shadow: var(--shadow-md); }
:root:not([data-theme="dark"]) .menu { box-shadow: var(--shadow-lg); }
:root:not([data-theme="dark"]) .site-footer { background: rgba(255, 255, 255, .6); border-block-start: 1px solid rgba(15, 23, 42, .06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}
@media (max-width: 760px) { .hero::before { background-size: 18px 18px; } }

/* v35: Atlas brand lockup */
.brand { gap: 11px; }
.brand-mark { position: relative; inline-size: 40px; block-size: 40px; border-radius: 12px; background: var(--grad-brand);
  box-shadow: 0 8px 18px -8px rgba(8, 145, 178, .75), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(0, 0, 0, .12); }
.brand-mark::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, .35), transparent 55%); }
.brand-mark svg { inline-size: 26px; block-size: 26px; stroke: #fff; stroke-width: 1.6; fill: none; transition: transform .6s var(--ease); }
.brand-mark .atlas-ring { stroke-opacity: .6; }
.brand-mark .atlas-tick { stroke-opacity: .75; stroke-width: 1.8; }
.brand-mark .atlas-needle { fill: #fff; stroke: none; }
.brand-mark .atlas-dot { fill: var(--brand); stroke: none; }
.brand:hover .brand-mark svg { transform: rotate(-35deg); }
.brand-text { display: grid; gap: 1px; min-inline-size: 0; line-height: 1.2; }
.brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
  background: linear-gradient(100deg, var(--text) 0%, var(--text) 45%, var(--brand) 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent; }
html[lang="ar"] .brand-name { font-size: 1.35rem; font-weight: 800; letter-spacing: 0; line-height: 1.25; }
.brand-tag { font-size: .72rem; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }
html[lang="ar"] .brand-tag { font-size: .7rem; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .brand:hover .brand-mark svg { transform: none; } }
@media (max-width: 760px) {
  .brand { gap: 9px; }
  .brand-mark { inline-size: 36px; block-size: 36px; border-radius: 11px; }
  .brand-mark svg { inline-size: 23px; block-size: 23px; }
  .brand-name, html[lang="ar"] .brand-name { font-size: 1.15rem; }
  .brand-tag, html[lang="ar"] .brand-tag { font-size: .65rem; }
}

/* v36: keep the hero (and its suggestions list) above the overview cards */
.hero { position: relative; z-index: 20; }

/* v37: About Atlas dialog + copyright line */
.footer-copy { padding-block: 12px 18px; border-block-start: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.about-dialog { inline-size: min(680px, calc(100vw - 32px)); }
.about-body { gap: 18px; }
.about-story { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 9%, var(--surface)), color-mix(in srgb, #4f46e5 7%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border)); }
.about-story-mark { inline-size: 40px; block-size: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-brand);
  box-shadow: 0 8px 18px -8px rgba(8, 145, 178, .7); }
.about-story-mark svg { inline-size: 24px; block-size: 24px; stroke: #fff; stroke-width: 1.6; fill: none; }
.about-story-mark .atlas-ring { stroke-opacity: .6; } .about-story-mark .atlas-tick { stroke-opacity: .75; }
.about-story-mark .atlas-needle { fill: #fff; stroke: none; } .about-story-mark .atlas-dot { fill: var(--brand); stroke: none; }
.about-story h3 { font-size: var(--fs-md); margin-block-end: 6px; }
.about-story p { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.9; }
.about-story p + p { margin-block-start: 8px; }
.about-author { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.author-head { display: flex; align-items: center; gap: 14px; }
.author-avatar { inline-size: 56px; block-size: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-en);
  font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; color: #fff; background: var(--grad-brand);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--brand) 35%, transparent); }
.author-id { display: grid; gap: 1px; min-inline-size: 0; }
.author-kicker { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.author-id h3 { font-size: var(--fs-lg); font-weight: 800; line-height: 1.35; }
.author-role { font-size: var(--fs-sm); color: var(--brand); font-weight: 600; }
.author-bio { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.9; }
.about-author h4 { font-size: var(--fs-sm); font-weight: 700; color: var(--text); margin-block-start: 4px; }
.about-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.about-list li { position: relative; padding-inline-start: 26px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.85; }
.about-list li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: .45em; inline-size: 16px; block-size: 16px; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 11px no-repeat;
  box-shadow: inset 0 0 0 1px var(--brand-line); }
.skill-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chips li { padding: 4px 11px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-line); }
@media (max-width: 760px) {
  .about-story { grid-template-columns: 1fr; padding: 14px; }
  .about-author { padding: 14px; }
  .author-avatar { inline-size: 48px; block-size: 48px; font-size: 1rem; }
}
.about-author h4 + ul { margin-block-start: -6px; }
.about-author h4 { margin-block-start: 6px; }

/* v39: About — prose bio + signature */
.author-head { padding-block-end: 12px; border-block-end: 1px solid var(--border); }
.author-role { line-height: 1.6; }
.author-bio + .author-bio { margin-block-start: -2px; }
.about-sign { text-align: center; font-size: var(--fs-sm); font-weight: 700; color: var(--brand); padding-block: 2px 4px; }

/* v40: About Atlas — tabs, story, founder */
.about-dialog { inline-size: min(780px, calc(100vw - 32px)); }
.about-body { gap: 0; padding-block-start: 0; }
.about-tabs { position: sticky; inset-block-start: 0; z-index: 2; display: flex; gap: 4px; padding: 12px 0; margin-block-end: 6px; background: var(--surface); }
.about-tab { flex: 1; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 8px 14px;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.about-tab:hover { color: var(--text); border-color: var(--border-strong); }
.about-tab[aria-selected="true"] { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(8, 145, 178, .8); }
.about-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.about-panel { display: grid; gap: 16px; animation: rise .2s var(--ease); }
.about-hero { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 11%, var(--surface)), color-mix(in srgb, #4f46e5 9%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border)); }
.about-kicker { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--brand); margin-block-end: 2px; }
.about-hero h3 { font-size: var(--fs-lg); font-weight: 800; line-height: 1.5; }
.about-sec { display: grid; gap: 10px; }
.about-sec h4 { font-size: var(--fs-md); font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.about-sec h4::before { content: ""; inline-size: 4px; block-size: 1.1em; border-radius: 4px; background: var(--grad-brand); flex: none; }
.about-sec p, .vm-card p, .exp-card p { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.95; }
.about-turn { font-size: var(--fs-md); font-weight: 800; color: var(--brand); text-align: center; padding: 10px; border-block: 1px dashed var(--brand-line); }
.about-principle { margin: 0; padding: 18px 20px; border-radius: 16px; text-align: center; background: var(--surface-2); border: 1px solid var(--border); }
.about-principle figcaption { font-size: var(--fs-sm); color: var(--muted); margin-block-end: 6px; }
.about-principle blockquote { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.7;
  background: var(--grad-text, var(--grad-brand)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
:root[data-theme="dark"] .about-principle blockquote { background: linear-gradient(100deg, #5eead4, #93c5fd); -webkit-background-clip: text; background-clip: text; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .about-principle blockquote { background: linear-gradient(100deg, #5eead4, #93c5fd); -webkit-background-clip: text; background-clip: text; } }
.about-vm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vm-card { padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 6px; align-content: start; }
.vm-card h4 { font-size: var(--fs-base); font-weight: 800; color: var(--brand); }
.about-signature { display: grid; gap: 2px; justify-items: center; text-align: center; padding-block: 8px 4px; border-block-start: 1px solid var(--border); }
.about-signature strong { font-size: var(--fs-md); font-weight: 800; }
.about-signature span { font-size: var(--fs-xs); color: var(--muted); }
.about-panel .author-head { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, transparent), transparent 60%); }
.about-panel .author-role { font-size: var(--fs-xs); line-height: 1.7; }
.exp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exp-card { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 4px; align-content: start;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.exp-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.exp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.exp-head strong { font-size: var(--fs-sm); font-weight: 800; color: var(--text); }
.exp-en { font-family: var(--font-en); font-size: .68rem; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 1px 8px; }
.exp-card p { font-size: var(--fs-xs); line-height: 1.85; }
@media (max-width: 760px) {
  .about-vm, .exp-grid { grid-template-columns: 1fr; }
  .about-hero { padding: 14px; }
  .about-tab { padding: 7px 10px; font-size: var(--fs-xs); }
}
.about-panel h3, .about-panel h4, .about-panel p, .about-panel blockquote, .about-panel figcaption { margin: 0; }
.about-tabs { margin-inline: -22px; padding-inline: 22px; border-block-end: 1px solid var(--border); margin-block-end: 14px; }
.exp-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* v44: hero banner card */
.hero { padding-block: 28px 26px; }
.banner-wrap { margin-block-end: 26px; }
.hero-banner { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: center; gap: 12px 28px; padding: 34px 44px; border-radius: 28px;
  background:
    radial-gradient(420px 260px at 0% 100%, rgba(45, 212, 191, .18), transparent 70%),
    radial-gradient(380px 240px at 100% 0%, rgba(59, 130, 246, .12), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(246, 249, 255, .86));
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 0 0 1px rgba(15, 23, 42, .05), 0 24px 60px -28px rgba(13, 79, 110, .35); }
.hero-banner::before, .hero-banner::after { content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(2px); }
.hero-banner::before { inline-size: 520px; block-size: 220px; inset-block-end: -150px; inset-inline-end: -120px;
  background: linear-gradient(90deg, rgba(56, 189, 248, .22), rgba(99, 102, 241, .14)); transform: rotate(-8deg); }
.hero-banner::after { inline-size: 460px; block-size: 200px; inset-block-start: -140px; inset-inline-start: -110px;
  background: linear-gradient(90deg, rgba(45, 212, 191, .2), rgba(14, 165, 233, .1)); transform: rotate(10deg); }
.banner-dots { position: absolute; z-index: -1; inline-size: 150px; block-size: 90px; pointer-events: none; opacity: .55;
  background-image: radial-gradient(rgba(37, 99, 235, .35) 1.4px, transparent 1.6px); background-size: 16px 16px; }
.banner-dots-a { inset-block-start: 18px; inset-inline-start: 22px; -webkit-mask-image: linear-gradient(135deg, #000, transparent 85%); mask-image: linear-gradient(135deg, #000, transparent 85%); }
.banner-dots-b { inset-block-end: 16px; inset-inline-end: 22px; -webkit-mask-image: linear-gradient(-45deg, #000, transparent 85%); mask-image: linear-gradient(-45deg, #000, transparent 85%); }
.banner-text { display: grid; justify-items: center; text-align: center; gap: 12px; }
.banner-orn { display: flex; align-items: center; gap: 10px; color: var(--brand); }
.banner-orn svg { inline-size: 64px; block-size: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[dir="rtl"] .banner-orn svg { transform: scaleX(-1); }
.orn-line { inline-size: 70px; block-size: 1.5px; border-radius: 2px; background: linear-gradient(90deg, transparent, currentColor); opacity: .55; }
.orn-line:last-child { background: linear-gradient(90deg, currentColor, transparent); }
.hero .hero-banner h1 { margin: 0; font-size: clamp(1.75rem, 2.6vw + 1rem, 2.75rem); line-height: 1.5; font-weight: 800; color: var(--text); }
html[lang="ar"] .hero .hero-banner h1 { font-size: clamp(1.75rem, 2.6vw + 1rem, 2.85rem); line-height: 1.6; }
.pill { display: inline-block; padding: .02em .38em .12em; margin-inline: .06em; border-radius: .38em; color: #fff; line-height: 1.3;
  -webkit-text-fill-color: #fff; box-shadow: 0 10px 22px -12px currentColor, inset 0 1px 0 rgba(255, 255, 255, .25); }
.pill-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 12px 24px -12px rgba(37, 99, 235, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.pill-green { background: linear-gradient(135deg, #14b8a6, #0f766e); box-shadow: 0 12px 24px -12px rgba(13, 148, 136, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.hero-banner .lead { margin: 0; max-inline-size: 36rem; font-size: var(--fs-lg); line-height: 1.85; color: var(--text-2); }
.banner-rule { inline-size: 150px; block-size: 4px; border-radius: 4px; background: linear-gradient(90deg, #2dd4bf, #3b82f6); margin-block-start: 4px; }
.banner-visual { display: grid; place-items: center; }
.banner-art { inline-size: 100%; max-inline-size: 290px; block-size: auto; filter: drop-shadow(0 18px 28px rgba(30, 64, 175, .18)); }
.art-shield { animation: art-float 6s var(--ease) infinite; transform-origin: 70px 70px; }
.art-lens { animation: art-float 6s var(--ease) infinite reverse; transform-origin: 200px 200px; }
@keyframes art-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .art-shield, .art-lens { animation: none; } }
.is-results .banner-wrap, .is-detail .banner-wrap { display: none; }
.hero-inner > .search { margin-block-start: 0; }

:root[data-theme="dark"] .hero-banner {
  background: radial-gradient(420px 260px at 0% 100%, rgba(45, 212, 191, .14), transparent 70%), radial-gradient(380px 240px at 100% 0%, rgba(59, 130, 246, .14), transparent 70%), linear-gradient(180deg, #121a24, #0f1620);
  border-color: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 24px 60px -28px rgba(0, 0, 0, .8); }
:root[data-theme="dark"] .banner-dots { background-image: radial-gradient(rgba(147, 197, 253, .35) 1.4px, transparent 1.6px); }
:root[data-theme="dark"] .banner-art { filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .5)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-banner {
    background: radial-gradient(420px 260px at 0% 100%, rgba(45, 212, 191, .14), transparent 70%), radial-gradient(380px 240px at 100% 0%, rgba(59, 130, 246, .14), transparent 70%), linear-gradient(180deg, #121a24, #0f1620);
    border-color: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 24px 60px -28px rgba(0, 0, 0, .8); }
  :root:not([data-theme="light"]) .banner-dots { background-image: radial-gradient(rgba(147, 197, 253, .35) 1.4px, transparent 1.6px); }
}

@media (max-width: 860px) {
  .hero-banner { grid-template-columns: 1fr; padding: 26px 22px 22px; border-radius: 22px; }
  .banner-visual { order: -1; }
  .banner-art { max-inline-size: 170px; }
  .hero-banner .lead { font-size: var(--fs-md); }
}
@media (max-width: 480px) {
  .hero { padding-block: 16px 20px; }
  .banner-wrap { margin-block-end: 18px; }
  .banner-art { max-inline-size: 140px; }
  .orn-line { inline-size: 40px; }
}

/* v45: calmer, hand-crafted banner (no glossy/AI look) */
.hero-banner { background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -20px rgba(16, 24, 40, .18); }
.hero-banner::before, .hero-banner::after { content: none; }
.banner-dots { opacity: .35; background-image: radial-gradient(var(--border-strong) 1.3px, transparent 1.5px); }
.title-pills { white-space: nowrap; }
.pill { padding: 0 .32em .08em; border-radius: .3em; box-shadow: none; }
.pill-blue { background: #2563eb; box-shadow: none; }
.pill-green { background: #0f766e; box-shadow: none; }
.banner-rule { inline-size: 64px; block-size: 3px; background: var(--brand); }
.banner-orn { color: var(--muted); }
.orn-line { opacity: .5; }
.banner-art { filter: none; max-inline-size: 260px; }
.art-shield, .art-lens { animation: none; }
.art-disc { fill: var(--brand-soft); }
.art-back { fill: var(--surface-3); }
.art-sheet { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.art-shield-body { fill: #0f766e; }
.art-handle { stroke: #1e3a8a; }
.art-lens-glass { fill: #eff6ff; stroke: #2563eb; }
:root[data-theme="dark"] .art-lens-glass { fill: #172554; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .art-lens-glass { fill: #172554; } }
:root[data-theme="dark"] .hero-banner { background: var(--surface); border-color: var(--border); box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-banner { background: var(--surface); border-color: var(--border); box-shadow: none; } }
:root[data-theme="dark"] .pill-blue { background: #1d4ed8; } :root[data-theme="dark"] .pill-green { background: #0d9488; }
@media (max-width: 1000px) { .hero-banner { grid-template-columns: minmax(0, 1fr) 200px; padding: 30px 32px; } }
@media (max-width: 860px) { .hero-banner { grid-template-columns: 1fr; padding: 24px 20px 22px; } .banner-art { max-inline-size: 150px; } }

/* v46: motion layer companions (GSAP drives entrances; CSS handles hovers) */
.has-motion .result { animation: none; }
.chip:active { transform: scale(.96); }
.code-card { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.code-card:hover { transform: translateY(-2px); }
.about-tab { transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease); }
.about-tab:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .code-card, .about-tab { transition: none; }
  .code-card:hover { transform: none; }
}

/* v49: design review fixes */
/* result cards: the type badge needs its own width so it never runs under the description */
@media (min-width: 761px) {
  .result-head { grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); }
}
/* code page: section titles carry the hierarchy (were small grey labels) */
.block-title, html[lang="ar"] .block-title { font-size: var(--fs-md); font-weight: 800; color: var(--text); letter-spacing: 0; text-transform: none; margin-block-end: 10px; }
.block-title::before { inline-size: 4px; block-size: 1.05em; border-radius: 4px; background: var(--brand); }
.solution-title { font-size: var(--fs-xs); }
/* search area aligns with the banner rhythm */
.hero-inner > .search { margin-block-start: 2px; }
.hero .examples { margin-block-start: 14px; }
/* hidden badge tooltips must never widen the page (caused sideways scroll on phones):
   take them out of layout until shown, and fade them in with a keyframe instead of a transition */
.has-tip:not(:hover):not(:focus-visible)::after { display: none; }
.has-tip:hover::after, .has-tip:focus-visible::after { animation: tip-in .16s var(--ease) both; }
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .has-tip:hover::after, .has-tip:focus-visible::after { animation: none; } }

/* v52: compact banner + new title "دليل التحقق ومعالجة المرفوضات" */
.hero { padding-block: 18px 22px; }
.banner-wrap { margin-block-end: 18px; }
.hero-banner { grid-template-columns: minmax(0, 1fr) 170px; padding: 20px 34px; gap: 8px 22px; border-radius: 22px; }
.banner-text { gap: 8px; }
.banner-orn svg { inline-size: 52px; block-size: 22px; }
.orn-line { inline-size: 50px; }
.hero .hero-banner h1, html[lang="ar"] .hero .hero-banner h1 { font-size: clamp(1.45rem, 1.5vw + 1rem, 2.2rem); line-height: 1.55; }
.title-pills { white-space: normal; }
.pill { white-space: nowrap; }
.hero-banner .lead { font-size: var(--fs-base); line-height: 1.8; max-inline-size: 34rem; }
.banner-rule { inline-size: 48px; margin-block-start: 0; }
.banner-art { max-inline-size: 160px; }
.banner-dots { inline-size: 110px; block-size: 64px; }
@media (max-width: 1000px) { .hero-banner { grid-template-columns: minmax(0, 1fr) 140px; padding: 18px 24px; } }
@media (max-width: 860px) {
  .hero-banner { grid-template-columns: 1fr; padding: 16px 16px 18px; }
  .banner-art { max-inline-size: 96px; }
}

/* v53: simple title — no banner card, no boxes, no illustration */
.hero-banner { display: block; padding: 10px 0 0; text-align: center; background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0; overflow: visible; }
.banner-visual, .banner-orn, .banner-rule, .banner-dots { display: none !important; }
.banner-text { gap: 10px; }
.hero .hero-banner h1, html[lang="ar"] .hero .hero-banner h1 { font-size: clamp(1.6rem, 1.4vw + 1.1rem, 2.3rem); font-weight: 800; line-height: 1.5; color: var(--text); }
.hero-banner .lead { font-size: var(--fs-md); color: var(--muted); max-inline-size: 36rem; margin-inline: auto; }
.banner-wrap { margin-block-end: 22px; }

/* v55: About Atlas — sidebar navigation + organised sections */
.about-dialog { inline-size: min(1000px, calc(100vw - 32px)); block-size: min(86vh, 820px); max-block-size: none; }
.about-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.about-dialog .dialog-head { flex: none; padding: 14px 22px; }
.ab-brand { display: flex; align-items: center; gap: 12px; }
.ab-brand .brand-mark { inline-size: 38px; block-size: 38px; border-radius: 11px; }
.ab-brand .brand-mark svg { inline-size: 24px; block-size: 24px; }
.ab-brand h2 { margin: 0; font-size: var(--fs-lg); font-weight: 800; line-height: 1.3; }
.ab-tag { display: block; font-size: var(--fs-xs); color: var(--muted); }
.about-body { flex: 1; min-block-size: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 0; padding: 0; }
.ab-side { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 18px 14px; border-inline-end: 1px solid var(--border); background: var(--surface-2); overflow: auto; }
.ab-nav { display: grid; gap: 4px; }
.ab-link { display: flex; align-items: center; gap: 10px; inline-size: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; text-align: start; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.ab-link .ai { inline-size: 18px; block-size: 18px; flex: none; opacity: .75; }
.ab-link:hover { background: var(--surface-3); color: var(--text); }
.ab-link[aria-current="true"] { background: var(--surface); color: var(--brand); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(16, 24, 40, .05); }
.ab-link[aria-current="true"] .ai { opacity: 1; }
.ab-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ab-mini { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.ab-mini strong { display: block; font-size: var(--fs-sm); font-weight: 800; }
.ab-main { overflow: auto; padding: 8px 36px 36px; }
.ab-main:focus { outline: none; }
.ai { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ab-sec { display: grid; gap: 14px; padding-block: 28px; border-block-end: 1px solid var(--border); }
.ab-sec:last-child { border-block-end: 0; }
.ab-sec p { margin: 0; color: var(--text-2); font-size: var(--fs-base); line-height: 2; max-inline-size: 68ch; }
.ab-sec p.ab-lead { font-size: var(--fs-md); color: var(--text); }
.ab-head { display: flex; align-items: center; gap: 12px; margin-block-end: 4px; }
.ab-ico { inline-size: 42px; block-size: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line); }
.ab-ico .ai { inline-size: 22px; block-size: 22px; }
.ab-kicker { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--brand); }
.ab-head h3 { margin: 0; font-size: 1.25rem; font-weight: 800; line-height: 1.45; color: var(--text); }
.ab-q { margin: 6px 0 0; font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.ab-turn { display: flex; align-items: center; gap: 14px; margin-block: 6px; color: var(--brand); font-weight: 800; font-size: var(--fs-md); }
.ab-turn::before, .ab-turn::after { content: ""; flex: 1; block-size: 1px; background: var(--brand-line); }
.ab-principle { margin: 6px 0; padding: 22px 26px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); border-inline-start: 4px solid var(--brand); }
.ab-principle figcaption { font-size: var(--fs-sm); color: var(--muted); margin-block-end: 6px; }
.ab-principle blockquote { margin: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.8; color: var(--text); }
.ab-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--info-bg); border: 1px solid var(--info-line); }
.ab-note p { color: var(--text); font-size: var(--fs-sm); line-height: 1.9; }
.ab-note-ico { color: var(--info); flex: none; margin-block-start: 3px; }
.ab-note-ico .ai { inline-size: 18px; block-size: 18px; }
.ab-vm { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ab-card { display: grid; gap: 8px; align-content: start; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.ab-card h4 { margin: 0; font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.ab-card p { font-size: var(--fs-sm); line-height: 1.95; }
.ab-card-ico { inline-size: 36px; block-size: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.ab-card-ico .ai { inline-size: 20px; block-size: 20px; }
.ab-profile { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.ab-avatar { inline-size: 64px; block-size: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-en); font-weight: 700; font-size: 1.2rem;
  color: #fff; background: var(--brand); box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--brand-line); }
.ab-avatar.sm { inline-size: 36px; block-size: 36px; font-size: .8rem; box-shadow: none; }
.ab-id { display: grid; gap: 8px; min-inline-size: 0; }
.ab-id strong { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.ab-roles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ab-roles li { font-size: var(--fs-xs); font-weight: 600; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 999px; padding: 3px 11px; }
.ab-exp { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ab-exp-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.ab-exp-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.ab-exp-ico { inline-size: 36px; block-size: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--brand); border: 1px solid var(--border); }
.ab-exp-ico .ai { inline-size: 19px; block-size: 19px; }
.ab-exp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-block-end: 4px; }
.ab-exp-head strong { font-size: var(--fs-sm); font-weight: 800; color: var(--text); }
.ab-en { font-family: var(--font-en); font-size: .68rem; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.ab-exp-card p { font-size: var(--fs-xs); line-height: 1.9; }
.ab-exp-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ab-dev { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ab-dev li { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.ab-dev-ico { inline-size: 36px; block-size: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.ab-dev-ico .ai { inline-size: 19px; block-size: 19px; }
.ab-dev p { font-size: var(--fs-sm); line-height: 1.95; }
.ab-sign { display: flex; align-items: center; gap: 12px; margin-block-start: 10px; padding-block-start: 18px; border-block-start: 1px dashed var(--border-strong); }
.ab-sign-mark { inline-size: 40px; block-size: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--brand); flex: none; }
.ab-sign-mark svg { inline-size: 24px; block-size: 24px; stroke: #fff; stroke-width: 1.6; fill: none; }
.ab-sign-mark .atlas-ring { stroke-opacity: .6; }
.ab-sign-mark .atlas-tick { stroke-opacity: .75; }
.ab-sign-mark .atlas-needle { fill: #fff; stroke: none; }
.ab-sign-mark .atlas-dot { fill: var(--brand); stroke: none; }
.ab-sign strong { display: block; font-size: var(--fs-md); font-weight: 800; }
.ab-sign span { font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 760px) {
  .about-dialog { block-size: calc(100vh - 24px); inline-size: calc(100vw - 16px); }
  .about-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .ab-side { flex-direction: row; padding: 10px 12px; border-inline-end: 0; border-block-end: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; }
  .ab-nav { display: flex; gap: 6px; }
  .ab-link { inline-size: auto; white-space: nowrap; padding: 8px 12px; }
  .ab-mini { display: none; }
  .ab-main { padding: 0 18px 24px; }
  .ab-vm, .ab-exp { grid-template-columns: 1fr; }
  .ab-profile { flex-direction: column; text-align: center; }
  .ab-roles { justify-content: center; }
}
.ab-main { position: relative; }

/* v56: About — contact cards */
.ab-contact { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ab-contact-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.ab-contact-link:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); text-decoration: none; transform: translateY(-1px); }
.ab-contact-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ab-contact-ico { inline-size: 40px; block-size: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.ab-contact-ico .ai { inline-size: 20px; block-size: 20px; }
.ab-contact-text { display: grid; gap: 1px; min-inline-size: 0; }
.ab-contact-text strong { font-size: var(--fs-sm); font-weight: 800; }
.ab-contact-text span { font-family: var(--font-en); font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ab-contact-link:hover { transform: none; } }
.ab-flash .ab-head h3 { animation: ab-flash .9s var(--ease); }
@keyframes ab-flash { 0% { color: var(--brand); } 100% { color: var(--text); } }
@media (prefers-reduced-motion: reduce) { .ab-flash .ab-head h3 { animation: none; } }

/* v58: badge guide in the header + full guide dialog */
.guide-btn .ico { color: var(--brand); }
.guide-dialog { inline-size: min(820px, calc(100vw - 32px)); }
/* explicit height: Safari (iOS) collapses a flex:1 child to 0 when the column only has a max-height */
.guide-dialog[open] { display: flex; flex-direction: column; overflow: hidden; block-size: min(86vh, 860px); max-block-size: min(86vh, 860px); }
@supports (height: 1dvh) { .guide-dialog[open] { block-size: min(86dvh, 860px); max-block-size: min(86dvh, 860px); } }
.guide-dialog .dialog-head { flex: none; }
.bg-body { flex: 1 1 auto; min-block-size: 0; overflow: auto; -webkit-overflow-scrolling: touch; position: relative; display: block; padding: 0 24px 26px; }
.bg-intro { margin: 16px 0 12px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.9; }
.bg-jump { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 12px; background: var(--surface); border-block-end: 1px solid var(--border); }
.bg-chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.bg-chip:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.bg-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bg-group { padding-block: 22px 6px; }
.bg-head { margin-block-end: 12px; }
.bg-head h3 { margin: 0 0 2px; font-size: var(--fs-md); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.bg-head h3::before { content: ""; inline-size: 4px; block-size: 1.05em; border-radius: 4px; background: var(--brand); }
.bg-head p { margin: 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.8; }
.bg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bg-list.cols { grid-template-columns: 1fr 1fr; }
.bg-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.bg-list.cols .bg-row { grid-template-columns: 1fr; gap: 8px; }
.bg-badge { display: flex; align-items: flex-start; }
.bg-badge .badge { white-space: nowrap; cursor: default; }
.bg-text strong { display: block; font-size: var(--fs-sm); font-weight: 800; margin-block-end: 2px; color: var(--text); }
.bg-text p { margin: 0; font-size: var(--fs-sm); line-height: 1.85; color: var(--text-2); }
@media (max-width: 760px) {
  .bg-body { padding: 0 16px 20px; }
  .bg-list.cols { grid-template-columns: 1fr; }
  .bg-row { grid-template-columns: 1fr; gap: 8px; }
  .bg-jump { flex-wrap: nowrap; overflow-x: auto; }
  .bg-chip { white-space: nowrap; }
}

/* v61: founder card with contact buttons */
.ab-profile { position: relative; display: block; padding: 0; overflow: hidden; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); text-align: start; }
.ab-cover { block-size: 64px; background-color: var(--brand-soft); border-block-end: 1px solid var(--brand-line);
  background-image: radial-gradient(color-mix(in srgb, var(--brand) 22%, transparent) 1.2px, transparent 1.4px); background-size: 14px 14px; }
.ab-pbody { display: flex; align-items: flex-end; gap: 16px; padding: 0 22px 18px; margin-block-start: -34px; }
.ab-profile .ab-avatar { inline-size: 76px; block-size: 76px; font-size: 1.35rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--brand-line); }
.ab-profile .ab-id { display: grid; gap: 4px; padding-block-end: 2px; }
.ab-profile .ab-id strong { font-size: 1.3rem; font-weight: 800; line-height: 1.4; }
.ab-title { font-size: var(--fs-sm); font-weight: 700; color: var(--brand); }
.ab-profile .ab-roles { margin-block-start: 4px; }
.ab-profile .ab-roles li { color: var(--text-2); background: var(--surface-2); border-color: var(--border); font-weight: 600; }
.ab-pfoot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 14px 22px; border-block-start: 1px solid var(--border); background: var(--surface-2); }
.ab-pfoot-label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.ab-cbtns { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ab-cbtn { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.ab-cbtn:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.ab-cbtn-link { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 14px; color: var(--text); text-decoration: none; font-size: var(--fs-sm); }
.ab-cbtn-link:hover { text-decoration: none; color: var(--brand); }
.ab-cbtn-ico { inline-size: 26px; block-size: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); flex: none; }
.ab-cbtn-ico .ai { inline-size: 15px; block-size: 15px; }
.ab-cbtn-val { font-family: var(--font-en); font-weight: 600; font-size: var(--fs-sm); }
.ab-cbtn-copy { display: grid; place-items: center; padding: 0 12px; border: 0; border-inline-start: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.ab-cbtn-copy:hover { color: var(--brand); background: var(--brand-soft); }
.ab-cbtn-link:focus-visible, .ab-cbtn-copy:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (max-width: 760px) {
  .ab-profile { text-align: center; }
  .ab-pbody { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .ab-profile .ab-roles { justify-content: center; }
  .ab-pfoot { justify-content: center; }
}
.ab-pbody { align-items: flex-start; }
.ab-profile .ab-id { padding-block-start: 42px; }
@media (max-width: 760px) { .ab-profile .ab-id { padding-block-start: 0; } }

/* v64: Atlas logo above the title; home page keeps its empty space on top, not under the cards */
.hero-logo { display: grid; justify-items: center; gap: 8px; margin-block-end: 6px; }
.hero-mark { position: relative; inline-size: 84px; block-size: 84px; border-radius: 24px; display: grid; place-items: center; background: var(--grad-brand, var(--brand));
  box-shadow: 0 18px 36px -18px rgba(8, 145, 178, .75), inset 0 1px 0 rgba(255, 255, 255, .3); }
.hero-mark::after { content: ""; position: absolute; inset: -8px; border-radius: 30px; border: 1px solid var(--brand-line); opacity: .7; }
.hero-mark svg { inline-size: 52px; block-size: 52px; stroke: #fff; stroke-width: 1.5; fill: none; }
.hero-mark .atlas-ring { stroke-opacity: .6; }
.hero-mark .atlas-tick { stroke-opacity: .8; stroke-width: 1.7; }
.hero-mark .atlas-needle { fill: #fff; stroke: none; }
.hero-mark .atlas-dot { fill: var(--brand); stroke: none; }
.hero-word { font-size: 1.5rem; font-weight: 800; line-height: 1.2; color: var(--brand); }
body:not(.is-results):not(.is-detail) .hero { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }
body:not(.is-results):not(.is-detail) main { flex: 0 0 auto; padding-block: 8px 28px; }
@media (max-width: 760px) {
  .hero-mark { inline-size: 64px; block-size: 64px; border-radius: 18px; }
  .hero-mark::after { inset: -6px; border-radius: 23px; }
  .hero-mark svg { inline-size: 40px; block-size: 40px; }
  .hero-word { font-size: 1.25rem; }
}

/* v65: new logo (stacked verification layers) — shown on its own, no tile behind it */
.brand-mark, .ab-brand .brand-mark, .hero-mark { background: none !important; box-shadow: none !important; border-radius: 0; }
.brand-mark::after, .hero-mark::after { content: none !important; }
.brand-mark svg, .hero-mark svg { stroke: none; fill: none; }
.brand-mark { inline-size: 42px; block-size: 42px; }
.brand-mark svg { inline-size: 40px; block-size: 40px; transition: transform .35s var(--ease); }
.brand:hover .brand-mark svg { transform: translateY(-2px); }
.ab-brand .brand-mark { inline-size: 38px; block-size: 38px; }
.ab-brand .brand-mark svg { inline-size: 36px; block-size: 36px; }
.hero-mark { inline-size: 104px; block-size: 104px; }
.hero-mark svg { inline-size: 100px; block-size: 100px; filter: drop-shadow(0 14px 14px rgba(11, 37, 64, .16)); }
:root[data-theme="dark"] .hero-mark svg { filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .5)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-mark svg { filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .5)); } }
@media (max-width: 760px) {
  .brand-mark { inline-size: 36px; block-size: 36px; }
  .brand-mark svg { inline-size: 34px; block-size: 34px; }
  .hero-mark { inline-size: 76px; block-size: 76px; }
  .hero-mark svg { inline-size: 74px; block-size: 74px; }
}
@media (prefers-reduced-motion: reduce) { .brand:hover .brand-mark svg { transform: none; } }

/* v66: hero lockup — the word أطلس beside the logo */
.hero-logo { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 14px; margin-inline: auto; margin-block-end: 10px; }
.hero-mark { inline-size: 84px; block-size: 84px; }
.hero-mark svg { inline-size: 80px; block-size: 80px; }
.hero-word { font-size: 2.6rem; line-height: 1; }
@media (max-width: 760px) {
  .hero-logo { gap: 10px; }
  .hero-mark { inline-size: 60px; block-size: 60px; }
  .hero-mark svg { inline-size: 58px; block-size: 58px; }
  .hero-word { font-size: 2rem; }
}

/* v67: performance — no fixed background repaint, no live blur behind sticky bars */
body { background-attachment: scroll !important; }
.site-header { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: color-mix(in srgb, var(--surface) 97%, transparent) !important; }
.site-footer { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.dialog::backdrop, .drawer::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(8, 13, 20, .55); }

/* ---------- anti-scraping check (Cloudflare Turnstile, shown only if a visitor must interact) ---------- */
.ts-box { position: fixed; inset-inline: 0; bottom: 24px; z-index: 90; display: flex; justify-content: center; pointer-events: none; }
.ts-box > div { pointer-events: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
.ts-box[hidden] { display: none; }
/* ---------- terms of use ---------- */
.terms-updated { color: var(--muted); font-size: var(--fs-sm); margin-block: 0 12px; }
.terms-sec h3 { font-size: var(--fs-md, 1rem); margin-block: 16px 6px; color: var(--text); }
.terms-sec p { margin: 0; line-height: 1.9; color: var(--text-2); }

/* ---------- founder card (two columns: identity | contact actions) ---------- */
#ab-founder { container-type: inline-size; }
.ab-fcard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 22px;
  padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.ab-fc-id { display: grid; gap: 6px; }
.ab-fc-kicker { font-size: var(--fs-xs); font-weight: 700; color: var(--brand); letter-spacing: .01em; }
.ab-fc-name { font-size: 1.45rem; font-weight: 800; line-height: 1.35; color: var(--text); }
.ab-fc-sum { margin: 2px 0 0; font-size: var(--fs-sm); line-height: 1.9; color: var(--text-2); max-inline-size: 46ch; }
.ab-fc-side { display: grid; gap: 10px; padding-inline-start: 22px; border-inline-start: 1px solid var(--border); }
.ab-fc-label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.ab-fc-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ab-fc-act { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  transition: border-color .15s ease, background-color .15s ease; }
.ab-fc-act:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.ab-fc-act.is-main { border-color: var(--brand-line); }
.ab-fc-link { flex: 1; min-inline-size: 0; display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--text); text-decoration: none; }
.ab-fc-link:hover { text-decoration: none; }
.ab-fc-ico { inline-size: 34px; block-size: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.ab-fc-ico .ai { inline-size: 18px; block-size: 18px; }
.ab-fc-txt { display: grid; min-inline-size: 0; }
.ab-fc-act-label { flex: 1; min-inline-size: 0; font-size: var(--fs-sm); font-weight: 700; line-height: 1.5; }
.ab-fc-val { font-family: var(--font-en); font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.ab-fc-go { color: var(--muted); display: grid; place-items: center; }
.ab-fc-act:hover .ab-fc-go { color: var(--brand); }
[dir="rtl"] .ab-fc-go svg { transform: scaleX(-1); }
.ab-fc-copy { display: grid; place-items: center; padding: 0 12px; border: 0; border-inline-start: 1px solid var(--border); background: transparent; color: var(--muted);
  border-start-end-radius: 12px; border-end-end-radius: 12px; cursor: pointer; }
.ab-fc-copy:hover { color: var(--brand); }
.ab-fc-link:focus-visible, .ab-fc-copy:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 11px; }
@container (max-width: 600px) {
  .ab-fcard { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .ab-fc-side { padding-inline-start: 0; border-inline-start: 0; padding-block-start: 16px; border-block-start: 1px solid var(--border); }
}
