/* Night reading: graphite-green surfaces, warm ink, unchanged original engravings. */
#theme-toggle{flex-shrink:0;border:1px solid transparent;border-radius:50%}
#theme-toggle:hover{border-color:var(--rule);background:var(--soft)}
html[data-theme="dark"]{--paper:#1e2722;--light:#28322b;--ink:#e3e3d4;--muted:#b1bba5;--rule:#4d5949;--red:#e29b83;--soft:#354133;color-scheme:dark;scrollbar-color:#849177 var(--paper)}
html[data-theme="dark"] ::selection{background:#647252;color:#fff9e9}
html[data-theme="dark"] body.reading{--paper:#1e2722;background:var(--paper)}
html[data-theme="dark"] :is(.sidebar,.reading .topbar){background:#222d25}
html[data-theme="dark"] .nav-link:hover{background:#303e30}
html[data-theme="dark"] .nav-link.active{background:#3a4835}
html[data-theme="dark"] :is(.side-note,.hero-copy,.footer,.reader-intro .intro-text,.quote,.lore-contents a,.board-header p){color:var(--muted)}
html[data-theme="dark"] .hero-art{mix-blend-mode:normal}
html[data-theme="dark"] .hero:after{background:linear-gradient(90deg,#1e2722 3%,#1e2722f5 22%,#1e2722bd 43%,#1e272218 85%)}
html[data-theme="dark"] .hero h1 em{color:#bcc9a7}
html[data-theme="dark"] .stamp{background:#1e2722e8;color:var(--red);border-color:var(--red)}
html[data-theme="dark"] .primary{background:#b9c6a4;border-color:#b9c6a4;color:#1e2b20}
html[data-theme="dark"] .primary:hover{background:#d1d9bd;color:#18221a}
html[data-theme="dark"] :is(.filter.active,.filter:hover,.archive-table tr.featured td,.classification-example){background:#303d2f}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] .search input::placeholder{color:var(--muted)}
html[data-theme="dark"] :is(.archive-table td,.archive-table th,.case-passport,.case-context,.scientific-note,.scientific-note dl,.note-id,.board-header,.additional-findings,.deduction){border-color:var(--rule)}
html[data-theme="dark"] :is(.case-state.live,.note-id){color:var(--red)}
html[data-theme="dark"] :is(.class-label,.case-context summary,.lore-chapter blockquote){color:#c1cfad}
html[data-theme="dark"] .scientific-note p:not(.note-sub){color:#d0d7c4}
html[data-theme="dark"] :is(.note-id span,.note-sign){color:var(--muted)}
html[data-theme="dark"] .scene-caption{background:#202b24f2;color:var(--ink);border-color:#86957880}
html[data-theme="dark"] .scene-caption small{color:#bdc8ac}
html[data-theme="dark"] :is(.story-strip img,.encounter img){mix-blend-mode:normal}
html[data-theme="dark"] .reader-page{background:#28322bf5;border-color:var(--rule)}
html[data-theme="dark"] .clue-sheet{background:#2b362c;box-shadow:0 8px 25px #0c140c38}
html[data-theme="dark"] .clue-sheet.missing{background:transparent;border-color:#6f7d63}
html[data-theme="dark"] .evidence-print{background:#414c3a}
html[data-theme="dark"] .evidence-stamp{border-color:#e29b8380}
html[data-theme="dark"] .hypotheses button:hover{background:#354133}
html[data-theme="dark"] .hypotheses button>span{color:#b0bd9c}
html[data-theme="dark"] .secret-memo{background:#30382c;border-top-color:var(--red)}
html[data-theme="dark"] :is(.memo-last,.memo-seal){color:var(--red)}
html[data-theme="dark"] dialog::backdrop{background:#07100cce}
html[data-theme="dark"] #evidence-dialog{background:var(--light)}
html[data-theme="dark"] .examination-toolbar{background:#222e25;border-color:var(--rule)}
html[data-theme="dark"] :is(.examination-toolbar>span,#evidence-dialog .lab-copy .text-small){color:var(--muted)}
html[data-theme="dark"] #evidence-dialog .instrument-bay{background-color:#374130;border-color:var(--rule)}
html[data-theme="dark"] #evidence-dialog .lab-copy{background-color:#2d372c}
/* Artwork stays on its original warm paper; no inversion or dark multiply. */
html[data-theme="dark"] :is(.instrument-art,.drawn-reel,#evidence-dialog .lift-door){mix-blend-mode:normal}
html[data-theme="dark"] #evidence-dialog :is(.lab-copy p,.lab-readout,.instrument-plate strong,.tape-timeline){color:var(--ink)}
html[data-theme="dark"] #evidence-dialog :is(.instrument-plate span,.instrument-plate small,.console-label,.route-machine span,.observation-log>span,.lab-folio,.recording-caption,.tape-volume label,.tape-volume button,.comparison-tabs button){color:#bdc9ac}
html[data-theme="dark"] #evidence-dialog :is(.instrument-plate,.observation-log,.lab-folio,.comparison-tabs,.field-player){border-color:#738267}
html[data-theme="dark"] #evidence-dialog :is(.lab-controls .filter,.comparison-answers button,.lab-copy .primary,.field-player .tape-play,.examination-toolbar .dialog-close){background:#3b4934;color:var(--ink);border-image-source:url('assets/ink-frame-dark.svg')}
html[data-theme="dark"] #evidence-dialog :is(.lab-controls .filter,.comparison-answers button,.lab-copy .primary,.field-player .tape-play,.examination-toolbar .dialog-close):hover:not(:disabled){background:#4a593e;color:#fff6de}
html[data-theme="dark"] #evidence-dialog .lab-copy .primary:disabled{background:#3b4335}
html[data-theme="dark"] #evidence-dialog :is(.key-inscription strong,.comparison-tabs button[aria-pressed=true],#comparison-feedback){color:var(--red)}
html[data-theme="dark"] #evidence-dialog .clue-destination{background:#b9c6a4;color:#1e2b20}
html[data-theme="dark"] #evidence-dialog .field-player input[type=range]::-webkit-slider-runnable-track{border-color:#a4b38d;background:#637652}
html[data-theme="dark"] #evidence-dialog .field-player input[type=range]::-webkit-slider-thumb{border-color:#899b70;background:#e1d8bb}
@media(max-width:800px){
  .reading .top-right{display:flex;flex-shrink:0}
  .reading .top-right :is(.clearance,#sound-toggle){display:none}
  .reading .reader-tools{width:auto;min-width:0}
  html[data-theme="dark"] .scientific-note{background:#263126}
  html[data-theme="dark"] .hero:after{background:linear-gradient(90deg,#1e2722fa,#1e2722e0 30%,#1e27224d)}
}
@media(max-width:520px){
  .reading .topbar{gap:6px}
  .reading .reader-tools{gap:6px}
  .reading #theme-toggle{width:32px}
  html[data-theme="dark"] .hero:after{background:linear-gradient(90deg,#1e2722fa,#1e2722d9 48%,#1e27225e)}
}
