/* Shared night palette for the forecast, directory and information pages. */
html[data-theme=dark] {
  color-scheme: dark;
  --paper: #0c0e14;
  --solid: #17191f;
  --panel: #17191ff7;
  --ink: #f5f5f7;
  --muted: #bec1cb;
  --line: #3a3d46;
  --border: #474a54;
  --blue: #dcdfe6;
  --blue-soft: #26282f;
  --selected: #33363f;
  --on-selected: #fff;
  --night-hover: #2e3139;
  --night-active-edge: #aeb2bf;
  --shadow: 0 16px 52px -30px #000b, inset 0 1px 0 #ffffff0b;
  --sunny: var(--blue-soft);
  --cloudy: var(--blue-soft);
  --rainy: var(--blue-soft);
  --bg: var(--paper);
  --card: var(--solid);
  --accent: var(--blue);
  --tint: var(--blue-soft);
  --text: var(--ink);
  --text2: var(--muted);
}
html[data-theme=dark] .weather-horizon,
body.dark .weather-horizon {
  --h-bg: var(--paper);
  --h-card: var(--solid);
  --h-ink: #f5f5f7;
  --h-muted: #c0c3ce;
  --h-rule: #a5a9b4;
  --h-night-field: #13151c;
  --h-day-field: #282624;
  --h-edge: #c1c4cf28;
}
html[data-theme=dark] :is(#outlook,#forecast.hourly-panel) {
  background: var(--paper);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
html[data-theme=dark] #outlook .day-card {
  --day-base: var(--solid);
  --day-ink: var(--ink);
  --tile-shadow: #0008;
  background: var(--day-base);
  border-color: var(--line);
}
html[data-theme=dark] #outlook .day-card[aria-pressed=true] {
  background: var(--selected);
  border-color: var(--night-active-edge);
  box-shadow: inset 0 0 0 1px var(--night-active-edge), var(--tile-depth);
}
html[data-theme=dark] #forecast.hourly-panel,
html[data-theme=dark] dialog#hourDialog {
  --hour-surface: var(--solid);
  --hour-soft: #22242b;
  --hour-header: #24262d;
  --hour-row: #202228;
  --hour-muted: var(--muted);
  --hour-text: var(--ink);
  --hour-edge: var(--line);
  --hour-rule: var(--line);
  --hour-accent: var(--blue);
}
html[data-theme=dark] .timeline-hour {
  --chapter: var(--blue);
  --chapter-text: var(--ink);
  --chapter-muted: var(--muted);
  --chapter-edge: var(--line);
  --hour-divider: var(--line);
  --chapter-hover: var(--night-hover);
  --hour-night: #181a21;
  --hour-day: #2c2e37;
}
html[data-theme=dark] .hour-stream:not(.sources-visible) { border-color: var(--line); }
html[data-theme=dark] .sources-visible .timeline-hour {
  --comparison-head: #292b32;
  --comparison-base: var(--solid);
  --comparison-edge: var(--border);
  --comparison-line: var(--line);
}
html[data-theme=dark] #toggleSources .source-toggle-label,
html[data-theme=dark] .map-modes button[aria-pressed=true],
html[data-theme=dark] #radarPlay,
html[data-theme=dark] .primary {
  background-color: var(--selected);
  color: var(--on-selected);
  box-shadow: inset 0 0 0 1px var(--night-active-edge);
}
html[data-theme=dark] :is(button[aria-pressed=true],.globe-speed-options label:has(:checked)) {
  box-shadow: inset 0 0 0 1px var(--night-active-edge);
}
/* Against the sky, use the same opaque surface as the forecast panels. */
html[data-theme=dark] :is(.preferences,.searcharea,#currentWeather) {
  --panel: var(--paper);
  --solid: var(--paper);
  --selected: #1d1f26;
}
html[data-theme=dark] #languageSelect { background-color: var(--paper); color: var(--ink); }
html[data-theme=dark] .hour-navigation button:not(:disabled):hover,
html[data-theme=dark] #supportDockReopen { background: var(--night-hover); color: var(--ink); }
html[data-theme=dark] #hourDialog { border-color: var(--border); }
html[data-theme=dark] dialog::backdrop { background: #0506099c; }
html[data-theme=dark] .support-dock,
html[data-theme=dark] .support-bar { background: var(--solid); border-color: var(--border); }
html[data-theme=dark] :is(.support-dock,.support-actions) :is(button,a) {
  background: var(--blue-soft);
  color: var(--ink);
  border-color: var(--border);
}
html[data-theme=dark] :is(.support-dock,.support-actions) :is(button,a):hover { background: var(--night-hover); }
html[data-theme=dark] :is(.warning-alert,.orb-air,.map-clock) { background: var(--solid); }
html[data-theme=dark] .warning-alert:hover { background: var(--night-hover); }
html[data-theme=dark] :is(#airDetails,#rainDetails)>summary { background: var(--solid); color: var(--ink); }
html[data-theme=dark] #rainDetails .rain-map-art,
html[data-theme=dark] #rainDetails>summary .extra-arrow { background: var(--blue-soft); }
html[data-theme=dark] #rainDetails>summary :is(.section-kicker,small) { color: var(--muted); }
html[data-theme=dark] #radarMap .leaflet-bar a { background: var(--blue-soft); color: var(--ink); border-color: var(--line); }
html[data-theme=dark] #radarMap .leaflet-bar a:hover { background: var(--night-hover); }
html[data-theme=dark] #radarMap .leaflet-bar .leaflet-disabled { color: var(--muted); }
html[data-theme=dark] #radarMap .leaflet-control-attribution { background: var(--solid); color: var(--muted); }
html[data-theme=dark] #radarMap .leaflet-control-attribution a { color: var(--ink); }
html[data-theme=dark] .wj-scene-sky { background: linear-gradient(#0c0e14,#202127); }
html[data-theme=dark] .knowledge-page {
  --paper: #0c0e14;
  --ink: #f5f5f7;
  --muted: #bec1cb;
  --accent: var(--blue);
  --edge: var(--line);
  background: var(--paper);
}
html[data-theme=dark] body:has(.directory-shell) { background: var(--paper); }
html[data-theme=dark] .directory-shell .search-link,
html[data-theme=dark] .directory-header nav a[aria-current] {
  background: var(--selected);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--night-active-edge);
}
