/* Chinaroutemap — dark mode.
   Loaded in <head> on every page so the theme is settled before first paint.
   The class itself is set by the inline guard in <head>; chinaroutemap-theme.js
   only owns the toggle button afterwards.
   Link this last: some rules here match the base stylesheet's specificity. */
html.dark{
  --ink:#ECE3D3; --ink-soft:#A79C88;
  --paper:#15120C; --cream:#211C14; --line:#37301F;
  --accent:#E2563B; --accent-soft:#2A201B;
  --card-shadow:0 1px 2px rgba(0,0,0,.55),0 12px 28px -14px rgba(0,0,0,.8);
  --surface:#1D1810; color-scheme:dark;
}
html.dark .strip{ background:#100D08; color:#CFC5B2; }
html.dark .lang-toggle button.on{ background:var(--accent); color:#fff; }
html.dark header.site{ border-bottom-color:var(--line); }
html.dark .ess-card, html.dark .gcard, html.dark .rail-card, html.dark .citycard,
html.dark .aircard, html.dark .fac2, html.dark .flow2, html.dark .app, html.dark .app2,
html.dark .em-num, html.dark .submit-card, html.dark .ev-card, html.dark .rc, html.dark .rcard,
html.dark .how-card, html.dark .season-card, html.dark .cta-card, html.dark .dest-card,
html.dark .composer, html.dark .filters button, html.dark .tr-chip, html.dark .ev-chip,
html.dark .scene, html.dark .bd-sorts, html.dark .toc{ background:var(--surface); border-color:var(--line); }
html.dark .ess-chips span, html.dark .week-date, html.dark .city-grid a, html.dark .city-more, html.dark .ab-toc a{ background:var(--cream); border-color:var(--line); }
/* Pill controls that hardcode a white background in their page's own <style>. */
html.dark .ct-chip, html.dark .se-sugg a{ background:var(--surface); border-color:var(--line); }
html.dark .ct-chip.on{ background:var(--accent); border-color:var(--accent); color:#fff; }
/* The highlight has to stay legible against the snippet's own ink, which is
   light in dark mode — the light-mode wash would leave it at ~1:1. */
html.dark .se-snip mark{ background:color-mix(in oklab, var(--accent), black 45%); color:#FFF1EC; }
html.dark input, html.dark textarea, html.dark select, html.dark .search{ background:var(--cream); color:var(--ink); border-color:var(--line); }
html.dark input::placeholder, html.dark textarea::placeholder{ color:var(--ink-soft); }
html.dark .ess-tip, html.dark .rail .air-tip, html.dark .ac-tip, html.dark .gtip, html.dark .note-card, html.dark .ab-note, html.dark .fl-note{ background:#241c10; color:#dcc69d; border-color:#3c3019; }
html.dark .emergency, html.dark .notice.alert-card, html.dark .rcard.em, html.dark .city-hero .fact{ background:#2a1712; }
html.dark .filters button.on{ background:var(--accent); color:#fff; border-color:var(--accent); }
html.dark .rail-cta{ background:var(--accent); color:#fff; }
html.dark .rail-cta[style]{ background:var(--surface) !important; color:var(--ink) !important; }
/* Elements drawn as physical paper keep their light background in dark mode,
   so they have to carry light-mode ink with them or the text goes invisible. */
html.dark .notice, html.dark .postcard{ --ink:#211C15; --ink-soft:#5C5346; --line:#E2D8C4; --paper:#FBF7EE; --cream:#F4EDDF; color:#211C15; }
html.dark .notice.alert-card{ --ink-soft:#6b4a42; background:#FFF6F2; }
html.dark .post img.pimg, html.dark .gcard img.gphoto{ border-color:var(--line); }
html.dark .gphoto, html.dark .gc-photo{ filter:brightness(.92); }
.theme-toggle{ font-family:"Courier Prime",monospace; font-size:12px; letter-spacing:.04em; color:#B7AC97; border:1px solid #4a4234; border-radius:3px; padding:2px 9px; white-space:nowrap; }
.theme-toggle:hover{ color:#EFE6D4; }
