.appearance-controls{display:flex;align-items:center;gap:6px;flex-shrink:0}
.theme-switch{position:relative;width:58px;height:34px;border:1px solid #b9c8a3;border-radius:22px;background:#d4dfc4;touch-action:none;user-select:none;padding:0;flex-shrink:0;isolation:isolate}
.theme-sun,.theme-moon{position:absolute;top:50%;transform:translateY(-50%);font:16px/1 Georgia;color:#667c55;pointer-events:none}
.theme-sun{left:7px}.theme-moon{right:8px}
.theme-thumb{position:absolute;left:2px;top:2px;width:28px;height:28px;display:grid;place-items:center;background:#fffdf0;border-radius:50%;box-shadow:0 1px 4px #3e583a38;transition:transform .18s ease;pointer-events:none;color:#8c9e64}
.theme-thumb:after{content:'☀';font:15px/1 Georgia}
.theme-switch[aria-checked=true] .theme-thumb{transform:translateX(24px)}
.theme-switch[aria-checked=true] .theme-thumb:after{content:'☾'}
.theme-switch.is-dragging .theme-thumb{transition:none}
.theme-auto{width:34px;height:34px;padding:0;border:1px solid transparent;border-radius:50%;background:transparent;color:#7d8c70;display:grid;place-items:center;font:21px/1 Georgia;flex-shrink:0}
.theme-auto[aria-pressed=true]{background:#e5ecd8;border-color:#c9d5b9;color:#46734d}
.site-header nav{gap:22px}
:root[data-theme="dark"]{--paper:#111d1b;--ink:#e3eadc;--muted:#b2beab;--green:#a7cdaa;--lime:#344633;--line:#34463d;--orange:#e3af79;--white:#1b2b27;color-scheme:dark}
html[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .brand-mark{color:#a7cdaa}
html[data-theme="dark"] .intro-copy,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .place-area,
html[data-theme="dark"] .exploration-meta,
html[data-theme="dark"] .exploration-meta>span:first-child,
html[data-theme="dark"] .journey-top>p,
html[data-theme="dark"] .route-summary small,
html[data-theme="dark"] .route-icon,
html[data-theme="dark"] .next-place>p:first-of-type,
html[data-theme="dark"] .advance-note,
html[data-theme="dark"] .journal-note,
html[data-theme="dark"] .section-heading>p,
html[data-theme="dark"] .stop-card p,
html[data-theme="dark"] .memory-placeholder p,
html[data-theme="dark"] .memory-placeholder small,
html[data-theme="dark"] .region-note p:not(.eyebrow),
html[data-theme="dark"] .region-note #catalog-note,
html[data-theme="dark"] .practical-note,
html[data-theme="dark"] .site-footer{color:#acbba6}
html[data-theme="dark"] .travel-stamp{color:#a9ba9b;border-color:#6b8265;outline-color:#425a45}
html[data-theme="dark"] .demo-pill{background:#263d30;color:#c3d3b7}
html[data-theme="dark"] .demo-pill i{background:#b0c58a}
html[data-theme="dark"] .tiny-sun{color:#e7bd87}
html[data-theme="dark"] .day-tag{background:#2c4230;color:#cad9b8}
html[data-theme="dark"] .companion-card{background:#20382e;border-color:#3b5341}
html[data-theme="dark"] .companion-card p{color:#c1ceb6}
html[data-theme="dark"] .companion-card b span{color:#a7b79c}
html[data-theme="dark"] .primary-button{background:#376b53;color:#f1f5df}
html[data-theme="dark"] .primary-button:disabled{background:#2d3e32;color:#9aaf95}
html[data-theme="dark"] .secondary-button{background:#354a37;color:#dde6cf}
html[data-theme="dark"] .slow-journal{background:#1a2d25;border-color:#364c3c}
html[data-theme="dark"] .journal-stop{background:#263c2d;border-color:#435a40;color:#dce6d0}
html[data-theme="dark"] .journal-stop>span{color:#b0c29d}
html[data-theme="dark"] .journal-stop[aria-pressed=true]{background:#a5c394;color:#1b3828;border-color:#a5c394}
html[data-theme="dark"] .journal-stop[aria-pressed=true]>span{color:#345b3d}
html[data-theme="dark"] .stop-card{background:#1a2c25;border-color:#374e3b}
html[data-theme="dark"] .memory-placeholder{background:#192d25;border-color:#4b6247}
html[data-theme="dark"] .memory-placeholder>span{color:#a8c28e}
html[data-theme="dark"] .region-emblem{border-color:#71876a;color:#b2c89d}
html[data-theme="dark"] .terrain-postcard{background-image:linear-gradient(0deg,#0b2331e8,#0a26366b),url('/images/nantou-terrain.png')}
html[data-theme="dark"] .geo-credit{color:#a1b19a}
html[data-theme="dark"] .geo-credit a{color:#c0d2ac}
html[data-theme="dark"] .map-legend{color:#bbcaaf}
html[data-theme="dark"] .legend-current{background:#e4b172;box-shadow:0 0 0 2px #455a42}
html[data-theme="dark"] .legend-past{background:#afc89b}
html[data-theme="dark"] .legend-future{background:#617d66}
html[data-theme="dark"] .geography-shell,
html[data-theme="dark"] .art-mode #geo-map{background:#172c2a}
html[data-theme="dark"] #geo-map{background-color:#172c2a;background-image:radial-gradient(#63837233 .7px,transparent .7px)}
html[data-theme="dark"] #geo-map .leaflet-terrainArt-pane>.leaflet-image-layer{filter:brightness(.58) saturate(.72) hue-rotate(16deg)}
html[data-theme="dark"] #geo-map .leaflet-tile-pane{filter:invert(.92) hue-rotate(180deg) saturate(.58) brightness(.83)}
html[data-theme="dark"] .geography-shell .map-toolbar>span,
html[data-theme="dark"] .geography-shell.road-mode #map-caption{background:#1d332eeb;color:#e1eacd;border-color:#587154;box-shadow:0 2px 7px #0003}
html[data-theme="dark"] .view-switch{background:#1a302aee;box-shadow:0 2px 9px #0004}
html[data-theme="dark"] .view-switch button{color:#c6d6b9}
html[data-theme="dark"] .view-switch button[aria-pressed=true]{background:#aec89b;color:#173c2b}
html[data-theme="dark"] .geography-shell .map-foot,
html[data-theme="dark"] .geography-shell.art-mode .map-foot{background:#193029ed;border-top-color:#41583e;color:#c0ceb3}
html[data-theme="dark"] .art-mode .map-foot>span{color:#c0ceb3}
html[data-theme="dark"] .geography-shell .map-foot button{color:#d0dfc0}
html[data-theme="dark"] #geo-map .leaflet-control-zoom a{background:#203a2fed;color:#e2edcd;border-color:#546c4d}
html[data-theme="dark"] #geo-map .leaflet-control-zoom a.leaflet-disabled{color:#83947b}
html[data-theme="dark"] #geo-map .leaflet-control-zoom{border-color:#526c4d}
html[data-theme="dark"] #geo-map .leaflet-control-attribution{background:#193028e8;color:#b4c7a7}
html[data-theme="dark"] #geo-map .leaflet-control-attribution a{color:#d1e4bb}
html[data-theme="dark"] .geography-shell .leaflet-tooltip.place-tooltip{background:#213c2eef;border-color:#82976d;color:#f0f4d9;box-shadow:0 2px 7px #0006}
html[data-theme="dark"] .geography-shell .leaflet-tooltip-top:before{border-top-color:#82976d!important}
html[data-theme="dark"] .place-marker,
html[data-theme="dark"] .art-mode .place-marker{background:#4a7050;border-color:#bacd99;color:#f3f7db;box-shadow:0 2px 6px #0006}
html[data-theme="dark"] .place-marker.is-selected,
html[data-theme="dark"] .art-mode .place-marker.is-selected{background:#c48d53;border-color:#f4d5a0;box-shadow:0 0 0 1px #c48d53,0 3px 9px #0007;color:#fffce9}
html[data-theme="dark"] .county-label,
html[data-theme="dark"] .neighbor-label{color:#a6bb96;text-shadow:0 1px 2px #132b20}
html[data-theme="dark"] .art-mode .water-label{background:#17363ee8;color:#b1dfdf;box-shadow:0 2px 6px #0005}
html[data-theme="dark"] .lake-shape{fill:#2e6676;stroke:#8db4af}
html[data-theme="dark"] #sunmoon-water stop:nth-child(1){stop-color:#8bd7d5}
html[data-theme="dark"] #sunmoon-water stop:nth-child(2){stop-color:#337e9a}
html[data-theme="dark"] #sunmoon-water stop:nth-child(3){stop-color:#244d7b}
html[data-theme="dark"] .art-mode .illustrated-lake{fill:url(#sunmoon-water);stroke:#b6cab0;filter:drop-shadow(0 0 3px #60aab290)}
html[data-theme="dark"] #county-texture rect{fill:#263e36}
html[data-theme="dark"] #county-texture path{stroke:#6f936055}
html[data-theme="dark"] .neighbor-shape{fill:#1e352d;stroke:#4c654e}
html[data-theme="dark"] .travel-route{stroke:#b2c99a}
html[data-theme="dark"] .travel-route.active-route{stroke:#efba7b}
html[data-theme="dark"] .future-place{stroke:#819b7b;fill:#506e59}
html[data-theme="dark"] .map-fallback{background:#2e4030;color:#e6efd5;border:1px solid #809368}
html[data-theme="dark"] dialog{background:#1b2b27;border-color:#4b6350;color:#e3eadc;box-shadow:0 20px 100px #0008}
html[data-theme="dark"] dialog::backdrop{background:#071411b8}
html[data-theme="dark"] .dialog-close{background:#2d4637ed;color:#eef3d9}
html[data-theme="dark"] .detail-hero{background:#263b2e}
html[data-theme="dark"] .detail-body>p,
html[data-theme="dark"] .sources-dialog p,
html[data-theme="dark"] .sources-dialog li,
html[data-theme="dark"] .replay-dialog>p:not(.eyebrow){color:#c0cfb7}
html[data-theme="dark"] .detail-meta,
html[data-theme="dark"] .catalog-dialog-note{background:#293f30;color:#d5e2c9}
html[data-theme="dark"] .detail-links a{background:#354d37;color:#e1edcf}
html[data-theme="dark"] .photo-credit{color:#b5c3a9}
html[data-theme="dark"] .chat-dialog header p,
html[data-theme="dark"] .chat-notice{color:#b0c09f}
html[data-theme="dark"] .message{background:#2b4132;color:#e6edda}
html[data-theme="dark"] .message.user{background:#426e52;color:#f2f7e1}
html[data-theme="dark"] .chat-topics button{border-color:#6a825b;color:#d9e8c7;background:#233b2b}
html[data-theme="dark"] .chat-dialog input{background:#132820;border-color:#6c825d;color:#eef4df}
html[data-theme="dark"] .chat-dialog input::placeholder{color:#afc1a1}
html[data-theme="dark"] .chat-dialog form button{background:#608450;color:#fffce9}
html[data-theme="dark"] .skip-link{background:#284532;color:#f2f7df}
html[data-theme="dark"] #toast{background:#b9d29deb;color:#163c29;box-shadow:0 5px 18px #0004}
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] summary:focus-visible{outline-color:#edc48a}
@media(max-width:800px){html[data-theme="dark"] .exploration-panel{background:#1b2d25;border-color:#40563f}.site-header nav{gap:17px}}


html[data-theme="dark"] .theme-switch{background:#2b4937;border-color:#718767}
html[data-theme="dark"] .theme-sun,html[data-theme="dark"] .theme-moon{color:#b8cca0}
html[data-theme="dark"] .theme-thumb{background:#d1dfb9;color:#25452f;box-shadow:0 1px 5px #07190c80}
html[data-theme="dark"] .theme-auto{color:#9db78b}
html[data-theme="dark"] .theme-auto[aria-pressed=true]{background:#2f4b35;border-color:#7c9565;color:#deebc7}
html[data-theme="dark"] .water-label,html[data-theme="dark"] .north-label{color:#b9d4c5;text-shadow:0 1px 3px #102c28}
@media(max-width:520px){.site-header nav{gap:10px}.site-header nav #open-sources{font-size:10px}.appearance-controls{gap:4px}}
@media(max-width:350px){.brand{font-size:21px;gap:7px}.brand-mark{font-size:35px}.site-header nav{gap:7px}.site-header nav #open-sources{font-size:9px}.theme-auto{width:30px}}

/* The miniature stage keeps a cream footer in both themes: never inherit pale dark-mode ink. */
html[data-theme] .geography-shell.local-scene-mode .map-foot,
html[data-theme] .geography-shell.local-scene-mode .map-foot>span,
html[data-theme] .geography-shell.local-scene-mode .map-foot button{
  color:#304c3b;
  opacity:1;
}
html[data-theme] .local-scene-mode .scene-caption{
  color:#304c3b;
  background:#fff8e7;
  padding:8px 10px;
  border-radius:8px;
  opacity:1;
}
