/* DT_R5_F26 v1 (round 5, lane frontdash, 2026-10-02) - complete, consistent dark mode: the gaps the U01 dark layer
   (assets/v4/v4-dark.css + v4-dark.js) leaves, found by a dark crawl of every shelled ortho member page + the /dashboard
   panel (desktop 1440 + phone 390). Loaded after v4-dark.css. EVERY rule is under html[data-theme="dark"]: light and
   amber (data-theme=light + data-read=amber) never match. Site dark tokens: ground #111b2b, surface #19263a,
   surface-2 #1c2a44, ink #edf1ff, text-2 #b4c1d9, line #35445e, accent #6f9dff (dark ink #07132a on it).
   Text contrast target 4.5:1 (3:1 for large bold headings). Chapter illustrations are never inverted. */

/* ---------- 0. tokens ---------- */
html[data-theme="dark"]{--fd26-ground:#111b2b;--fd26-surf:#19263a;--fd26-surf2:#1c2a44;--fd26-ink:#edf1ff;--fd26-ink2:#c9d3e6;
  --fd26-muted:#b4c1d9;--fd26-line:#35445e;--fd26-acc:#6f9dff;--fd26-on-acc:#07132a;--fd26-mat:#e3e8f0}

/* ---------- 1. images with a white background: a soft light mat instead of a hard white box (class set by fd-f26-v1.js) ---------- */
html[data-theme="dark"] img.fd26-mat{border-radius:8px;box-shadow:0 0 0 3px var(--fd26-mat),0 6px 18px rgba(0,0,0,.35)}
html[data-theme="dark"] img.fd26-mat-r{box-shadow:0 0 0 2px var(--fd26-line),0 4px 12px rgba(0,0,0,.3)}

/* ---------- 2. /dashboard panel (html.nu): OrthoBullets card chips + name + button ---------- */
html.nu[data-theme="dark"] .ob3-name{color:#7cc4f5}
html.nu[data-theme="dark"] .ob3-tag span{background:#14324a;color:#9fd3f7;border-color:#2a5576}
html.nu[data-theme="dark"] .ob3-tag span + span{background:#136fa8;color:#fff;border-color:#136fa8}
html.nu[data-theme="dark"] .ob3-topics span{background:#14324a;color:#9fd3f7;border-color:#2a5576}
html.nu[data-theme="dark"] .ob3 .go3{background:#136fa8;box-shadow:0 8px 16px -8px rgba(19,111,168,.8)}

/* ---------- 3. page fixes (shelled pages) ---------- */
/* /atlas + /atlas/ao: count badge on the active tab (white on the light accent fill) */
html[data-theme="dark"] .dt-atabs-a.on b,html[data-theme="dark"] .aoh-tab.on .num{color:var(--fd26-on-acc)!important;background:rgba(7,19,42,.12)}
/* /oral: the list header keeps the light skin gradient (a light-only rule) under light text */
html[data-theme="dark"].v4-pg-oral body .mf-card .mf-head{background:linear-gradient(135deg,#1f3155,#26406d)!important;border-bottom-color:var(--fd26-line)!important}
/* /interactive: the kind chip on each coloured cover (block tone text on the same tone) */
html[data-theme="dark"] .iv-kind{background:rgba(7,19,42,.62)!important;color:var(--fd26-ink)!important;border-color:rgba(237,241,255,.18)!important}
/* /pmp/darsname: white text on the light block fills (gold, spine, peds): one deep step, every block colour passes */
html[data-theme="dark"].v4-pp-pmp-darsname a.bcard{box-shadow:inset 0 0 0 100vmax rgba(0,0,0,.30),0 6px 16px rgba(0,0,0,.35)!important}
/* /analysis: day numbers on the heatmap fills (inline colours): a dark halo keeps them legible on every level */
html[data-theme="dark"] .heatmap-cell.studied{text-shadow:0 0 2px rgba(0,0,0,.9),0 0 1px #000;font-weight:800}
/* private / missing pages that render the porcelain state card (404.html through the shell) */
html[data-theme="dark"] body.ps{--ps-ink:#edf1ff;--ps-ink2:#c9d3e6;--ps-muted:#b4c1d9;--ps-acc:#6f9dff;--ps-acc-d:#94b6ff;--ps-line:#35445e;--ps-bg:#111b2b;--ps-soft:#1c2a44;
  background:radial-gradient(900px 520px at 85% -8%,#1a2a47 0,rgba(26,42,71,0) 62%),#111b2b!important}
html[data-theme="dark"] body.ps .ps-card{background:#19263a;border-color:#35445e;box-shadow:0 24px 64px rgba(0,0,0,.45)}
html[data-theme="dark"] body.ps .ps-art{background:radial-gradient(120% 90% at 50% 20%,#24365a 0,#1c2a44 55%,#16233a 100%)}
html[data-theme="dark"] body.ps .ps-btn.pri{background:#6f9dff;color:#07132a!important}
html[data-theme="dark"] body.ps .ps-btn.pri:hover{background:#94b6ff}
html[data-theme="dark"] body.ps .ps-btn.sec{background:#1c2a44;color:#edf1ff!important;border-color:#35445e}
html[data-theme="dark"] body.ps .ps-btn.sec:hover{background:#22345a;border-color:#4a5f86}
/* the porcelain sheet's ".ps a" accent rule also reached the site sidebar / tab bar links */
html[data-theme="dark"] body.ps :where(#v4Side,#v4Tabs,.v4t) a:not([aria-current]){color:inherit}
html[data-theme="dark"] body.ps .ps-brand span{color:#edf1ff}

/* /blocks block sheet: the 3D bone viewer (v4-shell.css, skipped by the U01 copy) had no dark values */
html[data-theme="dark"] .v4bv-stage{background:radial-gradient(120% 80% at 50% 20%,#26385c,color-mix(in srgb,var(--blk,#6f9dff) 18%,#152036));border-color:color-mix(in srgb,var(--blk,#6f9dff) 40%,#35445e)}
html[data-theme="dark"] .v4bv-tabs button{background:#1c2a44;border-color:#35445e;color:#edf1ff}
html[data-theme="dark"] .v4bv-tabs button[aria-selected=true]{background:color-mix(in srgb,var(--blk,#6f9dff) 28%,#19263a);border-color:color-mix(in srgb,var(--blk,#6f9dff) 70%,#fff)}
html[data-theme="dark"] .v4bv-legend a{background:#1c2a44;border-color:#35445e;color:#edf1ff}
html[data-theme="dark"] .v4bv-legend a:hover,html[data-theme="dark"] .v4bv-legend a:focus-visible{border-color:color-mix(in srgb,var(--blk,#6f9dff) 70%,#fff);background:color-mix(in srgb,var(--blk,#6f9dff) 16%,#19263a)}
html[data-theme="dark"] .v4bv-legend small{color:#b4c1d9}
html[data-theme="dark"] .v4bv-spots a{color:#edf1ff}
html[data-theme="dark"] .v4bv-spots span{background:#19263a;border-color:#35445e;color:#edf1ff}
html[data-theme="dark"] .v4bv-motion{background:#1c2a44;border-color:#35445e}
html[data-theme="dark"] .v4bv-motion svg{fill:#edf1ff}
html[data-theme="dark"] .v4bv-hint{color:#b4c1d9}
/* /Videos + /atlas media switch and the /blocks tile icon chip (v4-shell.css literals) */
html[data-theme="dark"] .v4m-tabs{background:#19263a;border-color:#35445e;box-shadow:0 2px 10px rgba(0,0,0,.3)}
html[data-theme="dark"] .v4m-tab:not([aria-current=page]){color:#c9d3e6}
html[data-theme="dark"] .v4m-tab:not([aria-current=page]):hover{color:#94b6ff}
html[data-theme="dark"] .v4m-tab:not([aria-current=page]) .v4m-lock{color:#e9bb75}
html[data-theme="dark"] .v4b-icon{background:rgba(237,241,255,.14);box-shadow:inset 0 0 0 1px rgba(237,241,255,.16)}

/* ---------- 4. mirror-translation book reader (/tarjome/read/<book>/<nn>, html.fd26-paper): a printed page = page image
   + Persian overlay in print colours. In dark mode the page stays paper (fd-f26-v1.js gives the overlay its print colours
   back after the U01 layer lifted them for a dark ground) with a soft frame and a slight dim; the reflow view, contents
   panel and bar follow the U01 layer. ---------- */
html.fd26-paper[data-theme="dark"] .page{box-shadow:0 0 0 1px #35445e,0 10px 30px rgba(0,0,0,.55);border-radius:4px}
html.fd26-paper[data-theme="dark"] .page::after{content:"";position:absolute;inset:0;background:rgba(17,27,43,.10);pointer-events:none;z-index:7}
html.fd26-paper[data-theme="dark"] .page .u:not(.k-badge){color:#111}
html.fd26-paper[data-theme="dark"] .page .pn{color:#888}
html.fd26-paper[data-theme="dark"] #reflow mark.hl{color:#111}
html.fd26-paper[data-theme="dark"] #reflow img{border-radius:8px;box-shadow:0 0 0 3px var(--fd26-mat)}
