/* Mizan — design system. Logical properties throughout so RTL and LTR share one sheet. */
@font-face { font-family: 'Inter'; src: url('../fonts/inter.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Kufi'; src: url('../fonts/kufi.woff2') format('woff2'); font-weight: 400 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+060C, U+061B, U+061F, U+066A-066D; }

/* ---------- tokens ---------- */
:root {
  --font: 'Inter', 'Kufi', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f5f6f3; --bg2: #eceee9; --card: #ffffff; --ink: #14201f; --ink2: #3a4846; --mute: #63706d; --line: #e1e5df; --line2: #cdd3cb; --grid: #e7eae4;
  --acc: #0d7d72; --acc-ink: #ffffff; --acc-soft: #e1f1ee; --acc-2: #0a6158;
  --good: #1f8a4c; --good-soft: #e3f3e8; --bad: #c2412d; --bad-soft: #fbe9e5; --warn: #b7791f; --warn-soft: #fbf1dc; --info: #2f6fb3; --info-soft: #e5eef8;
  --c1: #0d7d72; --c2: #e0892b; --c3: #4f63c9; --c4: #d0466b; --c5: #7a52b8; --c6: #2a9d5b; --c7: #7a8a3a; --c8: #6b7780;
  --r: 14px; --r-s: 10px; --r-l: 20px;
  --sh: 0 1px 2px rgba(20, 32, 31, .05), 0 1px 1px rgba(20, 32, 31, .03); --sh-h: 0 10px 28px -12px rgba(20, 32, 31, .22), 0 2px 6px rgba(20, 32, 31, .06); --sh-m: 0 24px 60px -20px rgba(10, 20, 20, .45);
  --hdr: 64px; --max: 1240px; --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
[data-palette="indigo"] { --acc: #4053c4; --acc-soft: #e7eafa; --acc-2: #3242a3; --c1: #4053c4; --c2: #e0892b; --c3: #0d8a80; --c4: #d0466b; --c5: #8a4fbf; --c6: #2a9d5b; }
[data-palette="emerald"] { --acc: #1d7f45; --acc-soft: #e2f2e8; --acc-2: #16653a; --c1: #1d7f45; --c2: #d98a1f; --c3: #3d66c4; --c4: #cc4a5d; --c5: #7a52b8; --c6: #0e8c96; }
[data-palette="plum"] { --acc: #8a3d8f; --acc-soft: #f4e7f4; --acc-2: #6f2f74; --c1: #8a3d8f; --c2: #e08a2b; --c3: #3f6cc4; --c4: #d0466b; --c5: #0d8277; --c6: #5f9e2f; }
[data-palette="graphite"] { --acc: #2e3a40; --acc-soft: #e7eaeb; --acc-2: #1d262a; --c1: #2e3a40; --c2: #d9822b; --c3: #3e74c2; --c4: #cf4b62; --c5: #0d8277; --c6: #7a56b6; }
[data-mode="dark"] {
  --bg: #0e1416; --bg2: #141c1f; --card: #172124; --ink: #e8eeec; --ink2: #c3ccca; --mute: #95a29f; --line: #26333a; --line2: #34444b; --grid: #243036;
  --acc: #3cc0ae; --acc-ink: #06201c; --acc-soft: #133532; --acc-2: #5fd3c2;
  --good: #4cc27f; --good-soft: #14321f; --bad: #f07a62; --bad-soft: #3a1c17; --warn: #e5b04f; --warn-soft: #362a12; --info: #73a9e6; --info-soft: #172a3d;
  --c1: #3cc0ae; --c2: #f0a24a; --c3: #8396f0; --c4: #f0739a; --c5: #b48ef0; --c6: #5fcf8a; --c7: #b9c45d; --c8: #9aa7b0;
  --sh: 0 1px 2px rgba(0, 0, 0, .3); --sh-h: 0 12px 30px -12px rgba(0, 0, 0, .7); --sh-m: 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
[data-mode="dark"][data-palette="indigo"] { --acc: #8b9bf5; --acc-soft: #1e2546; --acc-2: #a8b4fa; --c1: #8b9bf5; --c3: #3cc0ae; }
[data-mode="dark"][data-palette="emerald"] { --acc: #52c884; --acc-soft: #14321f; --acc-2: #72d89c; --c1: #52c884; --c3: #7fa2f0; --c6: #3cc0c8; }
[data-mode="dark"][data-palette="plum"] { --acc: #d58ad9; --acc-soft: #361d38; --acc-2: #e3a6e6; --c1: #d58ad9; --c3: #7fa2f0; --c5: #3cc0ae; }
[data-mode="dark"][data-palette="graphite"] { --acc: #c9d3d8; --acc-ink: #11181b; --acc-soft: #263136; --acc-2: #e2e8eb; --c1: #c9d3d8; --c3: #7fa2f0; --c5: #3cc0ae; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + 12px); }
body { margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.6; color: var(--ink); background: var(--bg); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
[lang="ar"] body { line-height: 1.75; }
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 750; letter-spacing: -.01em; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 { letter-spacing: 0; line-height: 1.5; }
p { margin: 0 0 .7em; } a { color: var(--acc); text-decoration: none; } a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; width: 20px; height: 20px; } .ic.xl { width: 44px; height: 44px; stroke-width: 1.4; color: var(--mute); }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
bdi.n { unicode-bidi: isolate; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mute { color: var(--mute); } .sm { font-size: .88em; }
kbd { font: 600 11.5px/1 var(--font); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line2); border-bottom-width: 2px; background: var(--card); color: var(--mute); }
.skip { position: fixed; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--acc); color: var(--acc-ink); padding: 10px 16px; border-radius: 10px; font-weight: 650; }
.skip:focus { top: 12px; }
.print-only { display: none; }
.noanim *, .noanim *::before, .noanim *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- header ---------- */
#hdr { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.hdr-in { max-width: var(--max); margin: 0 auto; height: var(--hdr); display: flex; align-items: center; gap: 18px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: linear-gradient(140deg, var(--acc), var(--acc-2)); color: var(--acc-ink); font-weight: 800; font-size: 18px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.brand img { border-radius: 10px; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-t strong { font-size: 18px; font-weight: 800; }
.brand-t small { font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { display: flex; gap: 2px; }
.top-nav a { color: var(--ink2); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.top-nav a:hover { background: var(--bg2); text-decoration: none; }
.top-nav a.on { color: var(--acc); background: var(--acc-soft); }
.search-btn { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; min-width: 240px; height: 40px; padding: 0 8px 0 12px; padding-inline: 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--mute); font-size: 14px; box-shadow: var(--sh); }
.search-btn:hover { border-color: var(--line2); color: var(--ink2); }
.search-btn kbd { margin-inline-start: auto; }
.prefs { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid transparent; background: none; color: var(--ink2); flex: none; }
.icon-btn:hover { background: var(--bg2); color: var(--ink); text-decoration: none; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; } .icon-btn.sm .ic { width: 17px; height: 17px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
#offBar { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 13.5px; font-weight: 600; padding: 6px 12px; }
#offBar[hidden] { display: none; }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; }
#view { max-width: var(--max); margin: 0 auto; padding: 28px 20px 64px; }
.sec { margin-top: 44px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sec-h h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.sec-h h2 .ic { color: var(--acc); }
.sec-h h2 small { font-size: 13px; font-weight: 600; color: var(--mute); background: var(--bg2); border-radius: 99px; padding: 1px 9px; }
.more-l { font-weight: 650; font-size: 14px; white-space: nowrap; }
.more-l::after { content: ' →'; } [dir="rtl"] .more-l::after { content: ' ←'; }
.page-h { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; justify-content: space-between; }
.page-h h1 { display: flex; align-items: center; gap: 12px; font-size: clamp(24px, 3.2vw, 32px); }
.page-h h1 .ic { width: 28px; height: 28px; color: var(--acc); }
.page-h p { color: var(--mute); margin: 6px 0 0; max-width: 70ch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--mute); margin-bottom: 14px; }
.crumbs a { color: var(--mute); } .crumbs a:hover { color: var(--acc); }
[dir="rtl"] .crumbs > span[aria-hidden] { transform: scaleX(-1); display: inline-block; }

/* ---------- category colour helper ---------- */
.c1 { --cc: var(--c1); } .c2 { --cc: var(--c2); } .c3 { --cc: var(--c3); } .c4 { --cc: var(--c4); } .c5 { --cc: var(--c5); } .c6 { --cc: var(--c6); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); display: inline-block; }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); font-weight: 650; font-size: 14.5px; white-space: nowrap; box-shadow: var(--sh); transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { text-decoration: none; border-color: var(--acc); color: var(--acc); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.primary:hover { background: var(--acc-2); border-color: var(--acc-2); color: var(--acc-ink); }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn.ghost:hover { background: var(--card); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; gap: 6px; } .btn.sm .ic { width: 17px; height: 17px; }
.btn.on { color: var(--acc); border-color: var(--acc); background: var(--acc-soft); }
.btn.on .ic { fill: currentColor; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .btn-row.end { justify-content: flex-end; } .btn-row.center { justify-content: center; }
[dir="rtl"] .btn .ic-arrow, [dir="rtl"] a.btn.primary > .ic:first-child { transform: scaleX(-1); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink2); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.chip:hover { border-color: var(--acc); color: var(--acc); text-decoration: none; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.chip.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.chip small { opacity: .7; font-weight: 600; }
.chip .ic { width: 16px; height: 16px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px; box-shadow: var(--sh); min-width: 0; }
.ch { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 750; margin-bottom: 16px; color: var(--ink); }
.ch .ic { width: 19px; height: 19px; color: var(--acc); }
.ch .push, .push { margin-inline-start: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.tcard { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--sh); transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); min-width: 0; }
.tcard:hover { text-decoration: none; border-color: color-mix(in srgb, var(--cc, var(--acc)) 45%, var(--line)); box-shadow: var(--sh-h); transform: translateY(-2px); }
.tc-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--cc); background: color-mix(in srgb, var(--cc) 13%, var(--card)); }
.tc-t { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.tc-t strong { font-size: 15px; font-weight: 700; line-height: 1.35; }
.tc-t small { color: var(--mute); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-fav { position: absolute; top: 10px; inset-inline-end: 10px; color: var(--warn); } .tc-fav .ic { width: 15px; height: 15px; fill: currentColor; }
.ccards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ccard { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 20px; border-radius: var(--r-l); background: var(--card); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--sh); overflow: hidden; transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .15s; }
.ccard::before { content: ''; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; background: var(--cc); opacity: .9; }
.ccard:hover { text-decoration: none; box-shadow: var(--sh-h); transform: translateY(-2px); border-color: color-mix(in srgb, var(--cc) 40%, var(--line)); }
.cc-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--cc); background: color-mix(in srgb, var(--cc) 13%, var(--card)); }
.cc-ic .ic { width: 24px; height: 24px; }
.cc-ic.big { width: 64px; height: 64px; border-radius: 18px; } .cc-ic.big .ic { width: 32px; height: 32px; }
.cc-t { display: flex; flex-direction: column; justify-content: center; }
.cc-t strong { font-size: 17px; font-weight: 750; } .cc-t small { color: var(--mute); font-size: 13px; }
.cc-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cc-list span { font-size: 12.5px; color: var(--ink2); background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cc-go { position: absolute; top: 22px; inset-inline-end: 18px; color: var(--mute); transition: transform .2s var(--ease), color .2s; }
[dir="rtl"] .cc-go { transform: scaleX(-1); }
.ccard:hover .cc-go { color: var(--cc); transform: translateX(3px); } [dir="rtl"] .ccard:hover .cc-go { transform: scaleX(-1) translateX(3px); }
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { font-size: 19px; } .empty p { color: var(--mute); max-width: 46ch; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 44px; align-items: center; padding: 26px 0 8px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--acc); background: var(--acc-soft); border-radius: 99px; padding: 5px 12px 5px 10px; margin-bottom: 18px; }
.eyebrow .ic { width: 16px; height: 16px; }
.hero h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.12; letter-spacing: -.025em; font-weight: 800; max-width: 17ch; }
[lang="ar"] .hero h1 { line-height: 1.45; letter-spacing: 0; font-size: clamp(28px, 3.9vw, 44px); max-width: 18ch; }
.hero .lead { font-size: 17px; color: var(--ink2); margin: 18px 0 24px; max-width: 54ch; }
.hero-search { position: relative; max-width: 560px; }
.hero-search.inline { margin-bottom: 22px; }
.inp.big { height: 58px; border-radius: 16px; padding: 0 16px; gap: 12px; box-shadow: var(--sh-h); border-color: var(--line2); }
.inp.big input { font-size: 16.5px; }
.inp.big .ic { color: var(--mute); width: 22px; height: 22px; }
.hero-res { position: absolute; inset-inline: 0; top: calc(100% + 8px); z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: var(--sh-m); display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.hero-res[hidden] { display: none; }
.hero-res .tcard { box-shadow: none; border-color: transparent; padding: 10px; } .hero-res .tcard:hover { transform: none; background: var(--bg); }
.hero-res p { margin: 10px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-v { position: relative; }
.hv-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 20px 20px 12px; box-shadow: var(--sh-m); }
.hv-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.hv-h span { font-weight: 700; color: var(--ink2); font-size: 14px; }
.hv-n { font-size: 26px; font-weight: 800; color: var(--acc); font-variant-numeric: tabular-nums; }
.hv-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: center; }
.hv-pills span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ink2); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; box-shadow: var(--sh); }
.hv-pills .ic { width: 15px; height: 15px; color: var(--acc); }
.studio-band { margin-top: 52px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 36px; align-items: center; padding: 36px; border-radius: 28px; background: linear-gradient(150deg, color-mix(in srgb, var(--acc) 10%, var(--card)), var(--card) 65%); border: 1px solid var(--line); }
.studio-band h2 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 12px; }
.studio-band p { color: var(--ink2); }
.ticks { list-style: none; padding: 0; margin: 16px 0 24px; display: grid; gap: 9px; }
.ticks li { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14.5px; }
.ticks .ic { color: var(--good); width: 18px; height: 18px; background: var(--good-soft); border-radius: 50%; padding: 3px; }
.sb-v { padding: 16px 16px 8px; box-shadow: var(--sh-h); }
.trust { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.trust > div { padding: 18px; border-radius: var(--r); border: 1px dashed var(--line2); }
.trust strong { display: block; margin: 10px 0 2px; } .trust p { color: var(--mute); font-size: 13.5px; margin: 0; }
.tr-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--acc-soft); color: var(--acc); }

/* ---------- category page ---------- */
.cat-h { align-items: center; justify-content: flex-start; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px; scrollbar-width: thin; }

/* ---------- forms ---------- */
.fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 14px; }
.f { grid-column: span 6; display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; border: 0; padding: 0; }
.f.w-half { grid-column: span 3; } .f.w-third { grid-column: span 2; } .f[hidden] { display: none; }
.f > label, .flab { font-size: 13.5px; font-weight: 650; color: var(--ink2); display: flex; align-items: center; gap: 6px; }
legend.flab { padding: 0; margin-bottom: 6px; }
.hint { color: var(--mute); font-size: 12.5px; line-height: 1.45; }
.err { color: var(--bad); font-size: 12.5px; font-weight: 600; } .err[hidden] { display: none; }
.inp { position: relative; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.inp:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
.inp input, .inp select { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; background: none; outline: none; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.inp input:focus-visible, .inp select:focus-visible { outline: none; }
[dir="rtl"] .inp input[dir="ltr"] { text-align: right; }
.inp .u { color: var(--mute); font-size: 13px; font-weight: 600; white-space: nowrap; }
.inp.sel select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 22px; }
.inp.sel::after { content: ''; position: absolute; inset-inline-end: 14px; top: 50%; width: 7px; height: 7px; border: solid var(--mute); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.inp.sel.mini { height: 38px; border-radius: 10px; padding: 0 10px; } .inp.sel.mini select { font-size: 13.5px; font-weight: 600; }
.f.bad .inp { border-color: var(--bad); }
textarea { width: 100%; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); padding: 10px 12px; font-size: 14.5px; line-height: 1.55; resize: vertical; font-variant-numeric: tabular-nums; }
[dir="rtl"] textarea[dir="ltr"] { text-align: left; }
textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 0; cursor: pointer; direction: ltr; }
[dir="rtl"] .slider { direction: rtl; }
.slider::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(var(--acc), var(--acc)) 0 / var(--p, 50%) 100% no-repeat, var(--line); }
[dir="rtl"] .slider::-webkit-slider-runnable-track { background: linear-gradient(var(--acc), var(--acc)) 100% 0 / var(--p, 50%) 100% no-repeat, var(--line); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 2px solid var(--acc); margin-top: -6.5px; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.slider::-moz-range-track { height: 5px; border-radius: 99px; background: var(--line); } .slider::-moz-range-progress { height: 5px; border-radius: 99px; background: var(--acc); }
.slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 2px solid var(--acc); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: var(--bg2); border: 1px solid var(--line); }
.seg button { flex: 1 1 auto; min-height: 36px; padding: 4px 12px; border-radius: 9px; border: 0; background: none; color: var(--ink2); font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--card); color: var(--acc); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.sw { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink2); }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-t { width: 40px; height: 24px; border-radius: 99px; background: var(--line2); position: relative; flex: none; transition: background .15s; }
.sw-t::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: inset-inline-start .15s var(--ease); }
.sw input:checked + .sw-t { background: var(--acc); } .sw input:checked + .sw-t::after { inset-inline-start: 19px; }
.sw input:focus-visible + .sw-t { outline: 2.5px solid var(--acc); outline-offset: 2px; }
.rows { display: grid; gap: 6px; }
.rw { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)) 32px; gap: 6px; align-items: center; }
.rw.rh span { font-size: 12px; font-weight: 650; color: var(--mute); padding-inline-start: 4px; }
.rw input { height: 40px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); padding: 0 10px; min-width: 0; width: 100%; font-variant-numeric: tabular-nums; }
.rw input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
[dir="rtl"] .rw input[dir="ltr"] { text-align: right; }
.rows > .btn { justify-self: start; margin-top: 4px; }
.advd { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.advd summary { cursor: pointer; font-weight: 650; font-size: 14px; color: var(--acc); list-style: none; display: flex; align-items: center; gap: 8px; }
.advd summary::-webkit-details-marker { display: none; }
.advd summary::before { content: '+'; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--acc-soft); font-weight: 800; }
.advd[open] summary::before { content: '−'; } .advd[open] summary { margin-bottom: 14px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.presets > span { font-size: 13px; color: var(--mute); font-weight: 600; margin-inline-end: 4px; }

/* ---------- tool page ---------- */
.tool-h { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; margin-bottom: 18px; }
.tool-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--cc); background: color-mix(in srgb, var(--cc) 13%, var(--card)); border: 1px solid color-mix(in srgb, var(--cc) 22%, var(--line)); }
.tool-ic .ic { width: 28px; height: 28px; }
.tool-ht h1 { font-size: clamp(22px, 2.8vw, 30px); }
.tool-ht p { margin: 4px 0 0; color: var(--mute); }
.tool-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.disc { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; background: var(--info-soft); color: var(--ink2); font-size: 13.5px; margin-bottom: 18px; }
.disc .ic { color: var(--info); width: 18px; height: 18px; margin-top: 2px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tool-grid.wide-in { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.results { position: sticky; top: calc(var(--hdr) + 16px); background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 6%, var(--card)), var(--card) 160px); }
.res-main { padding: 6px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; display: flex; flex-direction: column; gap: 2px; }
.res-main + .res-main { padding-top: 0; }
.res-main .rl { font-size: 13.5px; font-weight: 650; color: var(--mute); }
.res-main .rv { font-size: clamp(30px, 3.6vw, 40px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--acc); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.res-main + .res-main .rv { font-size: clamp(22px, 2.4vw, 27px); color: var(--ink); }
.res-main .rs { font-size: 13px; color: var(--mute); }
.res-main.t-good .rv { color: var(--good); } .res-main.t-bad .rv { color: var(--bad); } .res-main.t-warn .rv { color: var(--warn); }
.kv { margin: 0; display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink2); font-size: 14px; } .kv dd { margin: 0; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.kv dd small { display: block; font-weight: 500; color: var(--mute); font-size: 12px; }
.kv .strong dt { font-weight: 700; color: var(--ink); } .kv .strong dd { font-size: 1.08em; }
.kv .t-good dd { color: var(--good); } .kv .t-bad dd { color: var(--bad); } .kv .t-warn dd { color: var(--warn); }
.kv.sm > div { padding: 5px 0; font-size: 13px; } .kv.sm dt { font-size: 13px; }
.notes { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.notes li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; padding: 9px 12px; border-radius: 11px; background: var(--info-soft); color: var(--ink2); }
.notes li .ic { width: 17px; height: 17px; margin-top: 2px; color: var(--info); }
.notes li.warn { background: var(--warn-soft); } .notes li.warn .ic { color: var(--warn); }
.notes li.good { background: var(--good-soft); } .notes li.good .ic { color: var(--good); }
.notes li.bad { background: var(--bad-soft); } .notes li.bad .ic { color: var(--bad); }
.res-err { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.scale { margin: 4px 0 16px; }
.scale .bar { position: relative; display: flex; height: 10px; border-radius: 99px; overflow: visible; }
.scale .bar span { height: 100%; opacity: .85; } .scale .bar span:first-child { border-radius: 99px 0 0 99px; } .scale .bar span:last-child { border-radius: 0 99px 99px 0; }
.scale .bar i { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.scale-l { display: flex; margin-top: 6px; } .scale-l span { font-size: 11px; color: var(--mute); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.scen-bar { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.scen-n { font-size: 13px; color: var(--mute); }
.chart-card, .table-card, .scen-card, .tool-info, .related { margin-top: 18px; }
.chart-card[hidden], .table-card[hidden], .scen-card[hidden] { display: none; }
.chart-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-h .ch { margin: 0; } .chart-h h3 { font-size: 15px; }
.chart-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-info { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.explain p { color: var(--ink2); }
.tips { margin: 10px 0 0; padding-inline-start: 20px; color: var(--ink2); display: grid; gap: 6px; font-size: 14.5px; }
.tips li::marker { color: var(--acc); }
.fx { font: 600 14px/1.7 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; color: var(--ink); text-align: left; }
.fv { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.fv dt { font: 700 13px ui-monospace, Menlo, Consolas, monospace; color: var(--acc); direction: ltr; } .fv dd { margin: 0; color: var(--ink2); }
.related .ch { font-size: 17px; }
.tbl-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 12px; }
.tbl-wrap.big { max-height: 70vh; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 9px 12px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--bg2); font-weight: 700; color: var(--ink2); font-size: 12.5px; }
.tbl .num { text-align: end; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--acc) 5%, transparent); }
.tbl tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.tbl tbody tr:nth-child(even):hover { background: color-mix(in srgb, var(--acc) 6%, transparent); }
.tbl tfoot td { font-weight: 800; background: var(--bg2); border-bottom: 0; position: sticky; bottom: 0; }
.tbl tr.hl td { background: var(--acc-soft); font-weight: 700; }
.tbl tr.neg td, .tbl td.neg { color: var(--bad); }
.tbl tr.mainrow td, .tbl tr.mainrow th { font-weight: 800; color: var(--acc); }
.tbl tr.in th, .tbl tr.in td { color: var(--mute); }
.tbl tbody th { text-align: start; font-weight: 650; }
.show-all { margin-top: 10px; }

/* ---------- charts ---------- */
.chart-host { min-height: 120px; }
.mzc-wrap { position: relative; width: 100%; }
.mzc-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.mzc-svg text { font-family: var(--font); }
.mzc-hit { cursor: crosshair; outline: none; } .mzc-hit:focus-visible { stroke: var(--ink); stroke-width: 2; }
.mzc-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--card); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; line-height: 1.5; box-shadow: var(--sh-m); white-space: nowrap; max-width: 280px; }
.mzc-tip[hidden] { display: none; }
.mzc-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.mzc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 10px; }
.mzc-li { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 3px 6px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.mzc-li:hover { background: var(--bg2); } .mzc-li.off { opacity: .45; text-decoration: line-through; } .mzc-li.static { cursor: default; } .mzc-li.static:hover { background: none; }
.mzc-li i { width: 11px; height: 11px; border-radius: 3.5px; flex: none; }
.mzc-tools { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }

/* ---------- studio ---------- */
.studio-h { align-items: center; }
.ds-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: end; }
.ds-meta strong { font-size: 15px; } .ds-meta > span { font-size: 13px; color: var(--mute); }
.import { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.drop { grid-row: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 34px 20px; border: 2px dashed var(--line2); border-radius: 18px; background: var(--bg); transition: border-color .15s, background .15s; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--acc); background: var(--acc-soft); }
.drop strong { font-size: 17px; } .drop > span { color: var(--mute); font-size: 13.5px; max-width: 34ch; }
.drop .btn { margin-top: 8px; }
.paste { display: flex; flex-direction: column; gap: 8px; } .paste .btn-row { justify-content: flex-end; }
.samples { display: flex; flex-direction: column; gap: 8px; }
.privacy { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--mute); font-size: 13px; margin: 0; }
.privacy .ic { width: 16px; height: 16px; color: var(--good); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; color: var(--mute); font-weight: 650; font-size: 14.5px; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: var(--acc); border-bottom-color: var(--acc); }
.tab .ic { width: 18px; height: 18px; }
.cnt { font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--acc); color: var(--acc-ink); border-radius: 99px; padding: 0 7px; line-height: 18px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.fl-list { display: flex; flex-wrap: wrap; gap: 6px; } .fl-list:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding-inline: 12px 4px; border-radius: 99px; background: var(--acc-soft); color: var(--acc-2); font-size: 13px; }
[data-mode="dark"] .fchip { color: var(--acc); }
.fl-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fl-add select, .fl-add input { height: 36px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); padding: 0 10px; font-size: 13.5px; max-width: 180px; }
.fl-add .flab { margin-inline-end: 4px; } .fl-add .flab .ic { width: 16px; height: 16px; color: var(--acc); }
.fl-n { font-size: 13px; color: var(--mute); margin-inline-start: auto; }
.st-body > .card + .card { margin-top: 16px; }
.data-t .rn { color: var(--mute); width: 1%; font-weight: 500; }
.th-sort { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; font-weight: 700; color: inherit; font-size: inherit; }
.th-sort:hover { color: var(--acc); }
.tb { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 4px; border-radius: 5px; font-size: 10px; font-weight: 800; letter-spacing: .02em; background: var(--line); color: var(--ink2); }
.tb .ic { width: 12px; height: 12px; }
.tb-num { background: color-mix(in srgb, var(--c1) 16%, var(--card)); color: var(--c1); } .tb-date { background: color-mix(in srgb, var(--c2) 18%, var(--card)); color: var(--c2); }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; font-size: 13.5px; color: var(--mute); }
.coltypes { margin-top: 16px; } .coltypes summary { cursor: pointer; font-weight: 650; font-size: 14px; color: var(--acc); }
.ct-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 12px; }
.ct-list label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; padding-inline: 12px 6px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.ct-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-list select { height: 32px; border: 1px solid var(--line2); border-radius: 8px; background: var(--card); font-size: 13px; }
.sum-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sum header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sum h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { width: 100%; height: 34px; margin-bottom: 8px; fill: color-mix(in srgb, var(--acc) 55%, var(--card)); }
.pv-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.pv-cfg { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--hdr) + 16px); }
.pv-out { display: grid; gap: 16px; min-width: 0; } .pv-out > .card { min-width: 0; }
.pv-cfg select, .pv-cfg input:not([type="checkbox"]):not([type="radio"]) { height: 42px; border: 1px solid var(--line2); border-radius: 11px; background: var(--card); padding: 0 10px; width: 100%; font-size: 14px; }
.pv-cfg select:focus, .pv-cfg input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
.seg.wrap button { flex: 1 1 30%; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.ck { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; cursor: pointer; }
.ck:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.ck input { accent-color: var(--acc); margin: 0; }
.dash-bar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 14px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dcard .chart-h h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.dcard .btn-row { gap: 2px; }
.ch-note, .ch-out .mute { font-size: 12.5px; color: var(--mute); }

/* ---------- pages ---------- */
.prose { max-width: 78ch; } .prose h2 { font-size: 18px; margin: 4px 0 8px; } .prose p { color: var(--ink2); }
.prose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wl dl, .wl .kv { margin-top: 8px; }
[data-ph] { font-style: normal; }
.wl dd, .f-contact p { overflow-wrap: anywhere; }
.guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; counter-reset: g; }
.guide .g { position: relative; padding-inline-start: 68px; }
.guide .g::before { counter-increment: g; content: counter(g); position: absolute; inset-inline-start: 20px; top: 20px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); font-weight: 800; }
.guide .g h2 { font-size: 16px; margin-bottom: 6px; } .guide .g p { color: var(--ink2); margin: 0; font-size: 14.5px; }
.keys { grid-column: 1 / -1; } .keys dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 24px; margin: 0; }
.keys dl > div { display: flex; align-items: center; gap: 12px; } .keys dt { min-width: 92px; display: flex; gap: 4px; } .keys dd { margin: 0; color: var(--ink2); font-size: 14px; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.set-grid .card > .f + .f { margin-top: 16px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; padding-inline: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 600; }
.swatches button[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.swatches i { width: 24px; height: 24px; border-radius: 50%; }
.sw-teal i { background: #0d7d72; } .sw-indigo i { background: #4053c4; } .sw-emerald i { background: #1d7f45; } .sw-plum i { background: #8a3d8f; } .sw-graphite i { background: #2e3a40; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li + li { border-top: 1px solid var(--line); }
.hist a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: var(--ink); }
.hist a:hover { text-decoration: none; background: var(--bg); }
.hist a > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; } .hist small { color: var(--mute); font-size: 12.5px; }
.hist time, .scen-list time { font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.scen-list { margin-bottom: 16px; } .scen-list ul { list-style: none; margin: 0; padding: 0; }
.scen-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.nf { padding: 64px 24px; } .nf-n { font-size: 84px; font-weight: 800; line-height: 1; color: var(--acc); letter-spacing: -.04em; }

/* ---------- modal, palette, share, toast ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(8, 14, 14, .5); backdrop-filter: blur(3px); display: grid; place-items: start center; padding: 10vh 16px 16px; overflow: auto; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-m); animation: pop .2s var(--ease); }
.modal.wide { max-width: 640px; }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 0 20px; padding-inline: 20px 14px; }
.modal header h2 { font-size: 17px; }
.modal-body { padding: 14px 20px 20px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.mform { display: grid; gap: 16px; } .mform .f { display: flex; } .m-act { display: flex; justify-content: flex-end; gap: 8px; }
.pal-wrap .modal header { display: none; } .pal-wrap .modal-body { padding: 10px; } .pal-wrap { padding-top: 12vh; }
.pal-in { height: 52px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none !important; } .pal-in .ic { color: var(--mute); }
.pal-in input { font-size: 16.5px; }
.pal-list { list-style: none; margin: 8px 0; padding: 0; max-height: 52vh; overflow: auto; }
.pal-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; cursor: pointer; }
.pal-list li span { flex: 1; font-weight: 600; } .pal-list li small { color: var(--mute); font-size: 12.5px; }
.pal-list li .ic { color: var(--mute); }
.pal-list li[aria-selected="true"] { background: var(--acc-soft); } .pal-list li[aria-selected="true"] .ic { color: var(--acc); }
.pal-list li.none { cursor: default; color: var(--mute); justify-content: center; }
.pal-k { font-size: 12.5px; margin: 4px 10px 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.share-row { display: flex; gap: 8px; margin: 12px 0; }
.share-row input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line2); border-radius: 12px; background: var(--bg); padding: 0 12px; font-size: 13px; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--bg); }
.qr-box .qr { border-radius: 10px; background: #fff; padding: 4px; } .qr-box small { color: var(--mute); }
#toasts { position: fixed; z-index: 95; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
[dir="rtl"] #toasts { transform: translateX(50%); }
.toast { background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--sh-m); animation: pop .2s var(--ease); transition: opacity .3s, transform .3s; max-width: 90vw; }
.toast.good { background: var(--good); color: #fff; } .toast.bad { background: var(--bad); color: #fff; } .toast.out { opacity: 0; transform: translateY(6px); }
[data-mode="dark"] .toast.good, [data-mode="dark"] .toast.bad { color: #0b1210; }

/* ---------- countdown ---------- */
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 16px; direction: ltr; }
.cd > div { text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px; }
.cd b { display: block; font-size: clamp(22px, 3vw, 32px); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--acc); line-height: 1.2; }
.cd span { font-size: 12px; color: var(--mute); font-weight: 600; }
.past .cd b, .cd.past b { color: var(--mute); }

/* ---------- footer, bottom nav ---------- */
#ftr { border-top: 1px solid var(--line); background: var(--card); margin-top: 40px; }
.ftr-in { max-width: var(--max); margin: 0 auto; padding: 36px 20px 24px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.f-brand { display: flex; gap: 12px; align-items: flex-start; } .f-brand strong { font-size: 17px; } .f-brand p { color: var(--mute); font-size: 13.5px; margin: 2px 0 0; }
#ftr h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin-bottom: 10px; }
[lang="ar"] #ftr h2 { letter-spacing: 0; font-size: 14px; }
.f-cats, .f-links { display: flex; flex-direction: column; gap: 6px; } .f-cats a, .f-links a { color: var(--ink2); font-size: 14px; } .f-cats a:hover, .f-links a:hover { color: var(--acc); }
.f-contact p { font-size: 14px; color: var(--ink2); margin: 0 0 6px; }
[dir="rtl"] .f-contact p[dir="ltr"] { text-align: right; }
.ftr-b { max-width: var(--max); margin: 0 auto; padding: 16px 20px 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--mute); }
.ftr-b p { margin: 0; display: flex; align-items: center; gap: 6px; } .ftr-b .ic { width: 15px; height: 15px; color: var(--good); }
#bnav { display: none; }

/* ---------- embed ---------- */
.embed #hdr, .embed #ftr, .embed #bnav, .embed .crumbs, .embed .related, .embed .tool-info { display: none !important; }
.embed #view { padding-top: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .top-nav a { padding: 8px 9px; } .search-btn { min-width: 180px; } }
@media (max-width: 1080px) {
  .search-btn span { display: none; } .search-btn { min-width: 0; width: 40px; padding: 0; justify-content: center; } .search-btn kbd { display: none; }
  .ccards { grid-template-columns: repeat(2, 1fr); } .trust { grid-template-columns: repeat(2, 1fr); }
  .tool-h { grid-template-columns: auto 1fr; } .tool-act { grid-column: 1 / -1; justify-content: flex-start; }
  .ftr-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; } .hero h1 { max-width: 22ch; }
  .studio-band { grid-template-columns: 1fr; padding: 26px; }
  .tool-grid, .tool-grid.wide-in { grid-template-columns: 1fr; }
  .results { position: static; }
  .tool-info { grid-template-columns: 1fr; }
  .pv-grid { grid-template-columns: 1fr; } .pv-cfg { position: static; }
  .dash-grid { grid-template-columns: 1fr; }
  .import { grid-template-columns: 1fr; } .drop { grid-row: auto; }
  .set-grid, .prose-grid, .guide { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --hdr: 58px; }
  body { font-size: 15px; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .hdr-in { padding: 0 14px; gap: 8px; }
  .top-nav, .hide-m { display: none !important; }
  .search-btn { margin-inline-start: auto; }
  .brand-t small { display: none; }
  #view { padding: 18px 14px 40px; }
  #bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 45; inset-inline: 0; bottom: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  #bnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 12px; color: var(--mute); font-size: 11px; font-weight: 650; text-align: center; line-height: 1.2; min-width: 0; }
  #bnav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #bnav a:hover { text-decoration: none; } #bnav a.on { color: var(--acc); } #bnav a.on .ic { background: var(--acc-soft); }
  #bnav .ic { width: 40px; height: 28px; padding: 4px 10px; border-radius: 99px; }
  .card { padding: 16px; border-radius: 16px; }
  .ccards { grid-template-columns: 1fr; } .cards { grid-template-columns: 1fr; gap: 10px; }
  .trust { grid-template-columns: 1fr 1fr; gap: 10px; } .trust > div { padding: 14px; }
  .sec { margin-top: 34px; }
  .hero { padding-top: 6px; } .hero .lead { font-size: 15.5px; }
  .inp.big { height: 54px; }
  .tool-ic { width: 46px; height: 46px; border-radius: 13px; } .tool-ic .ic { width: 23px; height: 23px; }
  .tool-act .btn span { display: none; } .tool-act .btn { width: 40px; padding: 0; }
  .fields { gap: 14px 10px; }
  .f.w-third { grid-column: span 3; }
  .studio-band { padding: 20px; margin-top: 36px; border-radius: 20px; }
  .ftr-in { grid-template-columns: 1fr; gap: 20px; padding-top: 26px; }
  .ds-meta { align-items: flex-start; text-align: start; }
  .fl-n { margin-inline-start: 0; width: 100%; }
  .modal-wrap { padding: 8px; place-items: end center; } .modal { border-radius: 20px 20px 16px 16px; } .pal-wrap { padding-top: 8px; place-items: start center; }
  #toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .tbl th, .tbl td { padding: 8px 10px; }
}
@media (max-width: 400px) {
  .f.w-half, .f.w-third { grid-column: span 6; }
  .trust { grid-template-columns: 1fr; }
  .tab { padding: 10px 12px; }
  .cd { gap: 5px; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --card: #fff; --sh: none; --sh-h: none; color-scheme: light; }
  body { background: #fff; color: #000; font-size: 11pt; padding: 0 !important; display: block; }
  #hdr, #ftr, #bnav, #offBar, #toasts, .skip, .tool-act, .presets, .advd, .scen-bar, .related, .mzc-tools, .chart-tabs, .crumbs, .inputs, [data-act], .dash-bar, .dcard .btn-row, .tabs, .filters, .ds-meta .btn-row, .hero-search, .modal-wrap, .slider { display: none !important; }
  #view { padding: 0; max-width: none; }
  .print-only { display: block; } .print-meta { margin-top: 16px; font-size: 9.5pt; color: #333; } .print-meta p[dir] { word-break: break-all; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; padding: 12px; border-radius: 8px; }
  .tool-grid { display: block; } .results { position: static; background: #fff; }
  .chart-card, .table-card, .tool-info { margin-top: 10px; }
  .tool-info { display: block; } .tool-info .card + .card { margin-top: 10px; }
  .tbl-wrap { max-height: none !important; overflow: visible; border: 0; } .tbl thead th { position: static; }
  .tbl tfoot td { position: static; }
  .dash-grid { display: block; } .dcard { margin-bottom: 10px; }
  a { color: #000; }
}

/* ---------- mobile result pill (tool pages) ---------- */
.mres { display: none; }
@media (max-width: 900px) {
  .mres:not([hidden]) { display: flex; position: fixed; z-index: 44; inset-inline: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--acc) 40%, var(--line)); background: var(--card); color: var(--ink); box-shadow: var(--sh-m); text-align: start; animation: pop .2s var(--ease); }
  .mres span { font-size: 12.5px; color: var(--mute); font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mres strong { font-size: 18px; font-weight: 800; color: var(--acc); }
  .mres .ic { color: var(--mute); width: 18px; height: 18px; }
}
@media (min-width: 761px) and (max-width: 900px) { .mres:not([hidden]) { bottom: 16px; inset-inline: auto 16px; min-width: 300px; } }
@media print { .mres { display: none !important; } }
.ic.down { transform: rotate(90deg); } .ic.up { transform: rotate(-90deg); }
[dir="rtl"] .ic.fwd { transform: scaleX(-1); }
h1[tabindex="-1"]:focus, #view:focus { outline: none; }
/* long text results (ages, dates, durations) may wrap instead of overflowing on small phones */
.res-main .rv bdi.n, .kv dd bdi.n, .mres strong bdi.n { white-space: normal; }
.kv > div { flex-wrap: wrap; } .kv dt { min-width: 0; flex: 1 1 auto; } .kv dd { min-width: 0; max-width: 100%; }
.pv-cfg .inp select, .pv-cfg .inp input { border: 0 !important; height: 100% !important; padding: 0 !important; background: none !important; box-shadow: none !important; }
.pv-cfg .inp.sel select { padding-inline-end: 22px !important; }
