/* Sun/moon appearance control; the reading styles below leave Classic intact. */
.style-toggle { display:inline-grid; place-items:center; flex:0 0 42px; width:42px; height:42px; padding:10px; background:transparent; border:1px solid var(--line); color:var(--ink); border-radius:50%; }
.style-toggle:hover { background:#edf0e5; border-color:#a4b397; }
.style-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.style-toggle svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.style-toggle .theme-sun { display:none; }
html[data-style='after-hours'] .style-toggle .theme-moon { display:none; }
html[data-style='after-hours'] .style-toggle .theme-sun { display:block; }
@media(max-width:860px) { .site-header { gap:12px; } .navigation-toggle { margin-left:auto; order:2; } .site-header nav { order:3; } }
/* The light/dark switch sits at the end of the footer. */
footer .style-toggle { order:4; }
@media(max-width:560px) { footer .style-toggle { margin-left:auto; } }
@media(max-width:440px) { .site-header { padding-left:18px; padding-right:18px; gap:9px; } .site-header .brand { font-size:29px; } .navigation-toggle { padding:10px; gap:7px; } }
@media print { .style-toggle { display:none; } }
@media screen {
html[data-style='after-hours'] {
  color-scheme:dark;
  --paper:#1d211f;
  --ink:#e8e9df;
  --muted:#a1aa9d;
  --line:#3a443b;
  --accent:#b5c297;
  --night-panel:#252b27;
  --night-soft:#2c342c;
  --night-active:#394732;
}
html[data-style='after-hours'] body { background:var(--paper); color:var(--ink); }
html[data-style='after-hours'] ::selection { background:#526345; color:#f6f7ec; }
html[data-style='after-hours'] :is(.primary,.audio-play,.grammar-tabs button[aria-pressed=true],.collection-tools button[aria-pressed=true]) { background:var(--accent); color:#20291a; border-color:var(--accent); box-shadow:none; }
html[data-style='after-hours'] :is(.primary:hover,.audio-play:hover) { background:#c4cfaa; }
html[data-style='after-hours'] :is(.sample,.story-card,.reader-shell,.grammar-section,.tense-card,.word-suggestions,#word-dialog,.dictionary-top,.audio-player,.newsletter-card) { background:var(--night-panel); border-color:var(--line); color:var(--ink); box-shadow:none; }
html[data-style='after-hours'] .sample { transform:rotate(1deg); }
html[data-style='after-hours'] .paper-stamp { background:#38432e; border-color:#697953; color:#d5dfc2; }
html[data-style='after-hours'] :is(.sample-line small,.sample-bottom,.sample-bottom span,.paragraph-number,.english,.word-pair.word-button .english,.grammar-decoration,.dictionary-hint,.audio-times,.audio-speed-label,.audio-status,.speaker-name) { color:var(--muted); }
html[data-style='after-hours'] :is(.story-card.active,.level,.random-story,.grammar-tabs button,.grammar-search-row input,.word-suggestions,.navigation-toggle) { border-color:#53614b; }
html[data-style='after-hours'] .story-card.active:after { background:var(--accent); }
/* Story icons keep their light-theme background colours in After hours too. */
html[data-style='after-hours'] :is(.context-meaning,.grammar-link,.back-to-stories,.practice,.audio-settings,.audio-heading) { background:var(--night-soft); border-color:var(--line); }
html[data-style='after-hours'] :is(.collection-tools select,.grammar-search-row input,.audio-speed-label select) { background:var(--night-soft); color:var(--ink); border-color:#53614b; }
html[data-style='after-hours'] :is(.site-header nav,.site-header nav a[aria-current=page]) { border-color:#53614b; box-shadow:none; }
html[data-style='after-hours'] :is(.site-header nav a:hover,.navigation-toggle:hover,.navigation-toggle[aria-expanded=true],.collection-arrow:hover:enabled,.word-suggestions button:hover,.word-suggestions button:focus-visible,#dictionary-close:hover,.outline:hover) { background:var(--night-soft); color:var(--ink); border-color:#53614b; }
html[data-style='after-hours'] .word-pair.word-button .spanish { border-bottom-color:#58664f; }
html[data-style='after-hours'] :is(.word-pair.word-button:hover,.word-pair.word-button:focus-visible,.word-pair.word-button.selected-word) { background:#394732; color:#e4eccc; }
html[data-style='after-hours'] :is(.word-pair.word-button:hover,.word-pair.word-button:focus-visible,.word-pair.word-button.selected-word) .english { color:#c5d4af; }
html[data-style='after-hours'] .word-pair.word-button.selected-word .spanish { border-bottom-color:var(--accent); }
html[data-style='after-hours'] .switch { background:#566051; }
html[data-style='after-hours'] .switch:after { background:#f2f4e9; }
html[data-style='after-hours'] .switch-label input:checked+.switch { background:#849971; }
html[data-style='after-hours'] :is(.audio-settings input,.audio-timeline input,.volume-control input) { accent-color:#b5c297; }
html[data-style='after-hours'] :is(.audio-skip,.audio-language,.audio-speed-label,.audio-story-name) { color:var(--ink); }
html[data-style='after-hours'] .audio-player.is-following { background:var(--night-panel); border-color:#647451; box-shadow:none; }
/* Current narrated line: one soft band behind the row (as in Classic), not a box per word. */
html[data-style='after-hours'] .audio-line-marker { background:#2e3a2a; border-left-color:#8fa774; }
html[data-style='after-hours'] .audio-current-line .spanish { border-bottom-color:#8fa774 !important; }
html[data-style='after-hours'] :is(.conversation-turn,.character-turn).conversation-audio-current { background:#2c4037; border-left-color:#6c9c85; color:#bfdbc9; }
html[data-style='after-hours'] :is(.conversation-turn,.character-turn).speaker-tone-amber.conversation-audio-current { background:#41382a; border-left-color:#aa8955; color:#e0c493; }
html[data-style='after-hours'] :is(.conversation-turn,.character-turn).speaker-tone-violet.conversation-audio-current { background:#383140; border-left-color:#967bad; color:#d1bddd; }
html[data-style='after-hours'] :is(.conversation-turn,.character-turn) .speaker-name { color:#b1cbbb; }
html[data-style='after-hours'] :is(.conversation-turn,.character-turn).speaker-tone-amber .speaker-name { color:#d2b789; }
html[data-style='after-hours'] :is(.conversation-turn,.character-turn).speaker-tone-violet .speaker-name { color:#c9b2d9; }
html[data-style='after-hours'] :is(.word-form-tags span,.free-tag,.audio-available,.conversation-tag) { color:#c2d2b0; background:#37442e; }
html[data-style='after-hours'] :is(.rare-tag,.grammar-note strong) { color:#d5bc96; border-color:#7c6346; }
html[data-style='after-hours'] :is(.tense-example,.dictionary-alternatives .dictionary-section) { border-color:#63774f; }
html[data-style='after-hours'] :is(.conjugation-table td,.dictionary-top,.dictionary-example,.dictionary-alternatives,.practice,.reader-tools,.reader-end,.grammar-word-header,.audio-settings,.audio-player) { border-color:var(--line); }
html[data-style='after-hours'] .dictionary-top:before { background:#657459; }
html[data-style='after-hours'] :is(.sample,.reader-shell,.story-card,.audio-player,.grammar-section,#word-dialog,.word-suggestions) { box-shadow:none; }
}
@media screen {
  html[data-style='after-hours'] .audio-heading .eyebrow { color:#aebb9c; }
  html[data-style='after-hours'] .audio-heading p { color:var(--ink); }
  html[data-style='after-hours'] .sample-bottom { border-color:var(--line); }
}

@media screen { html[data-style='after-hours'] .style-toggle:hover { background:var(--night-soft); border-color:#637456; } }

/* After hours audio player: one even panel like Classic, not three differently coloured strips. */
@media screen {
  html[data-style='after-hours'] .audio-player,
  html[data-style='after-hours'] .audio-player.is-following { background:#262d29; border-color:#3a443b; }
  html[data-style='after-hours'] :is(.audio-heading,.audio-settings) { background:transparent; }
  html[data-style='after-hours'] .audio-settings { border-top:1px solid #3a443b; }
  html[data-style='after-hours'] .audio-language { background:transparent; border-color:#4a5647; color:var(--muted); }
  html[data-style='after-hours'] .audio-speed-label select { background:transparent; }
  html[data-style='after-hours'] :is(#audio-seek,.volume-control input) { accent-color:#b5c297; }
}
