.map-theme-row {
  justify-content: space-between; gap: 16px; min-height: 41px;
  margin-bottom: 4px; padding-bottom: 5px; border-bottom: 1px solid var(--night-border);
}
#map-theme-title { font-size: 14px; font-weight: 750; white-space: nowrap; }
.map-theme-switch {
  --theme-offset: 100%;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); position: relative;
  isolation: isolate; padding: 3px; border-radius: 999px; background: var(--night-wash);
  box-shadow: inset 0 0 0 1px var(--night-border);
}
:root[data-color-theme="light"] .map-theme-switch { --theme-offset: 0%; }
.map-theme-switch::before {
  content: ''; position: absolute; z-index: -1; inset: 3px auto 3px 3px; width: calc(50% - 3px);
  border-radius: inherit; background: var(--night-red); transform: translateX(var(--theme-offset));
  transition: transform .22s cubic-bezier(.2,.7,.3,1);
}
.map-theme-switch label {
  position: relative; display: grid; place-items: center; width: 39px; min-height: 32px;
  border-radius: 999px; color: var(--night-muted); cursor: pointer;
}
.map-theme-switch label:has(input:checked) { color: #fff; }
.map-theme-switch label:not(:has(input:checked)):hover { color: var(--night-accent); }
.map-theme-switch label:has(:focus-visible) { outline: 2px solid var(--night-accent); outline-offset: 2px; }
.map-theme-switch input { position: absolute; width: 1px; height: 1px; margin: 0; clip-path: inset(50%); }
.map-theme-switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 480px) {
  .map-theme-switch label { width: 43px; min-height: 37px; }
}
@media (prefers-reduced-motion: reduce) {
  .map-theme-switch::before { transition: none; }
}

/* Keep the existing map layout; share its palette variables across both color modes. */
:root[data-color-theme="light"] body {
  color-scheme: light;
  --night-ink: #302226;
  --night-copy: #4e3b42;
  --night-muted: #716066;
  --night-red: #ff3a3a;
  --night-accent: #ff3a3a;
  --night-active: #f9e4e6;
  --night-border: #e5d6d8;
  --night-surface: #fffdfa;
  --night-search-surface: #fffdfa;
  --night-wash: #f5eeed;
  --night-hover: #faebeb;
  --night-glass: linear-gradient(150deg, #fffefcfb, #fff7f5f5);
  --night-shadow: 0 14px 42px #602c2d26, 0 2px 9px #602c2d14;
  --day-art-placeholder: #eee2e2;
  --day-scroll-thumb: #ad8d93;
  background: #f7f3ef;
  color: var(--night-ink);
}

:root[data-color-theme="light"] :is(#map, #map.network-view) { background: #e9eeee; }
:root[data-color-theme="light"] #map .leaflet-tile-pane { filter: saturate(.35) brightness(1.01) contrast(.95) !important; }
:root[data-color-theme="light"] #map .leaflet-control-zoom a { background: var(--night-surface); }
:root[data-color-theme="light"] #map .leaflet-control-zoom a:is(:hover, :focus-visible) { background: var(--night-hover); }
:root[data-color-theme="light"] #map .leaflet-control-zoom a.leaflet-disabled { background: var(--night-wash); color: #907c81; }
:root[data-color-theme="light"] #map .leaflet-control-attribution { background: #fffdfae8; }
:root[data-color-theme="light"] #map .leaflet-control-attribution a { color: #8d2937; }
:root[data-color-theme="light"] #map .singer-avatar-main { border-color: #fff; box-shadow: 0 2px 7px #4b32334d; }
:root[data-color-theme="light"] #map .singer-custom-marker.is-profile-selected .singer-avatar-main {
  border-color: #fff; box-shadow: 0 0 0 2px var(--night-red), 0 3px 10px #682f4255;
}
:root[data-color-theme="light"] :is(.network-dock-avatar, .network-avatar-fallback) { background: var(--day-art-placeholder); }

:root[data-color-theme="light"] :is(#singer-search, #mobile-control-dialog #singer-search) { border-color: var(--night-border); box-shadow: var(--night-shadow); }
:root[data-color-theme="light"] #search-mode-switch { background: var(--night-wash); }
:root[data-color-theme="light"] #search-mode-switch button:not([aria-pressed="true"]):hover { color: var(--night-accent); }
:root[data-color-theme="light"] #mobile-history-section:is(.desktop-history-open, #mobile-control-dialog *) { color: var(--night-ink); border-color: var(--night-border); }
:root[data-color-theme="light"] #mobile-history-section :is(.mobile-sheet-title, #mobile-history-clear, .mobile-history-empty) { color: var(--night-muted); }
:root[data-color-theme="light"] #mobile-history-section .mobile-history-item { background: var(--night-wash); color: var(--night-ink); border-color: var(--night-border); }
:root[data-color-theme="light"] #mobile-history-section .mobile-history-item:is(:hover, :focus-visible) { background: var(--night-hover); color: var(--night-accent); }
:root[data-color-theme="light"] #mobile-history-section .city-tag { background: var(--night-active); color: var(--night-accent); }
:root[data-color-theme="light"] :is(#rank-tab-bar, #index-tab-bar, #map-home-panel #mode-filter-tabs, #mobile-control-dialog #mode-filter-tabs, .fan-threshold-track) { background: var(--night-wash); }
:root[data-color-theme="light"] :is(.rank-avatar, .index-avatar) { background: var(--day-art-placeholder); border-color: var(--night-border); }
:root[data-color-theme="light"] .map-filter-chip:not([aria-pressed="true"]) { background: var(--night-wash); }
:root[data-color-theme="light"] :is(.home-panel-scroll, #rank-panel-body, #index-list, #search-suggestions, #mobile-view-filter, .profile-album-creators .profile-album-people) { scrollbar-color: var(--day-scroll-thumb) transparent; }
:root[data-color-theme="light"] :is(#map-settings-toggle, #map-display-settings, #map-filter-toggle, #desktop-map-rail button, #map .leaflet-control-zoom) { box-shadow: 0 4px 16px #602c2d23; }

:root[data-color-theme="light"] :is(#artist-profile-panel:not([data-profile-type="album"]), #map-home-panel:has([data-topic-view="detail"]), #mobile-control-dialog[data-panel="recommend"] .mobile-panel-sheet:has([data-topic-view="detail"]))::before {
  background: linear-gradient(163deg, #fffcf9dd, #fff8f7ef 46%, #fffdfa), var(--night-artwork, none) center 10% / cover no-repeat;
}
:root[data-color-theme="light"] #artist-profile-panel:not([data-profile-type="album"]) { --profile-paper: var(--night-surface); }
:root[data-color-theme="light"] #artist-profile-panel.artist-profile-panel[data-profile-type="album"] {
  --profile-ink: var(--night-ink); --album-copy: var(--night-copy); --album-muted: var(--night-muted); --album-wash: var(--night-wash);
  border: 1px solid var(--night-border); background: var(--night-glass);
}
:root[data-color-theme="light"] #artist-profile-panel[data-profile-type="album"]::before {
  background: linear-gradient(160deg, #fff9f5c9, #fff8f6eb 55%, #fffdfa), var(--album-cover-backdrop, none) center 35% / cover no-repeat;
}
:root[data-color-theme="light"] .artist-profile-panel :is(.profile-avatar-frame:not(.profile-cover-avatar), .profile-song-cover, .profile-album-cover) { background: var(--day-art-placeholder); }
:root[data-color-theme="light"] .artist-profile-panel .profile-scrollbar-thumb { background: var(--day-scroll-thumb); }
:root[data-color-theme="light"] #artist-profile-panel[data-profile-type="catalogue"] :is(.profile-back, .profile-close),
:root[data-color-theme="light"] #artist-profile-panel[data-profile-type="album"][data-profile-sheet] :is(.profile-back, .profile-close) { color: var(--night-ink); background: transparent; text-shadow: none; }
:root[data-color-theme="light"] #artist-profile-panel:is([data-profile-type="catalogue"], [data-profile-sheet]) .profile-back :is(svg, span) { filter: none; }
:root[data-color-theme="light"] #artist-profile-panel[data-profile-type="album"] .profile-rank-badge,
:root[data-color-theme="light"] #artist-profile-panel:not([data-profile-type="album"]) .profile-bio-heading .profile-rank-badge { color: var(--night-accent); background: var(--night-active); }
:root[data-color-theme="light"] #artist-profile-panel .profile-rank-badge:is(:hover, :focus-visible) { background: var(--night-hover); }
:root[data-color-theme="light"] #artist-profile-panel .profile-rank-badge :is(strong, .profile-rank-badge-arrow) { color: inherit; }
:root[data-color-theme="light"] #artist-profile-panel .profile-group-actions .profile-network { background: var(--night-wash); color: var(--night-accent); border-color: var(--night-border); }

:root[data-color-theme="light"] #home-topics { --topic-ink: var(--night-ink); --topic-dim: var(--night-muted); --topic-accent: var(--night-accent); --topic-edge: var(--night-border); }
:root[data-color-theme="light"] #home-topics :is(.topic-art, .topic-event img, .topic-pending-art, .profile-song-cover) { background: var(--day-art-placeholder); }
:root[data-color-theme="light"] #home-topics .topic-pending-art,
:root[data-color-theme="light"] #home-topics :is(.topic-intro, .topic-event-stop:disabled) { color: var(--night-muted); }
#home-topics .topic-shortcut { font-size: 14px; }
:root[data-color-theme="light"] #home-topics .topic-shortcut { color: #000; border-color: #ddd; background: var(--night-search-surface); }
:root[data-color-theme="light"] #home-topics .topic-shortcut svg { color: #d4141c; }
:root[data-color-theme="light"] #home-topics .topic-shortcut:is(:hover, :focus-visible) { border-color: #c8c8c8; }
:root[data-color-theme="light"] #home-topics .topic-category-heading .topic-back { color: var(--night-ink); }
:root[data-color-theme="light"] #home-topics .topic-detail[data-topic-kind="projects"] .topic-project-relations {
  color: var(--night-copy); background: var(--night-wash); border-color: var(--night-muted);
}
:root[data-color-theme="light"] #home-topics .topic-detail[data-topic-kind="projects"] .topic-project-relations:is(:hover, :focus-visible) {
  color: var(--night-ink); background: var(--night-hover);
}
:root[data-color-theme="light"] :is(#search-btn, #home-topics .topic-project-home):hover { background: #e63434; }
:root[data-color-theme="light"] #home-topics :is(.topic-event-stop, .topic-event-ticket:disabled, .topic-detail[data-topic-kind="shows"] .topic-project-relations) { color: var(--night-copy); background: var(--night-wash); border-color: var(--night-border); }
:root[data-color-theme="light"] #home-topics :is(.topic-new-album, a.topic-event-stop, .topic-person, .topic-detail[data-topic-kind="shows"] .topic-project-relations):is(:hover, :focus-visible) { background: var(--night-hover); color: var(--night-accent); }
:root[data-color-theme="light"] #topic-map-filter.active { background: var(--night-surface); color: var(--night-accent); border-color: var(--night-border); box-shadow: var(--night-shadow); }

:root[data-color-theme="light"] .rank-hub-results .rank-hub-result:not(:last-child) { border-color: var(--night-border); }
:root[data-color-theme="light"] .rank-hub-result-link:is(a, button):is(:hover, :focus-visible) { background: var(--night-hover); color: var(--night-ink); }
:root[data-color-theme="light"] .rank-hub-podium .rank-hub-result-link { border-color: var(--night-border); background: var(--night-surface); }
:root[data-color-theme="light"] .rank-hub-podium .rank-hub-result-link:is(:hover, :focus-visible, .is-rank-target) { border-color: #dcadb3; background: var(--night-hover); }
:root[data-color-theme="light"] .rank-hub-movement.is-up { color: var(--night-accent); }
:root[data-color-theme="light"] .rank-hub-movement.is-down { color: #245e98; }
:root[data-color-theme="light"] .rank-hub-movement.is-new { color: #216d55; }
:root[data-color-theme="light"] :is(.rank-hub-empty, .rank-hub-art) { border-color: var(--night-border); background: var(--night-wash); color: var(--night-copy); }
:root[data-color-theme="light"] .rank-hub-cover { box-shadow: 0 0 0 1px var(--night-border); }

@media (max-width: 480px) {
  :root[data-color-theme="light"] #mobile-map-tools :is(.mobile-map-search, .mobile-map-tool-rail) { background: var(--night-surface); box-shadow: 0 4px 16px #602c2d23; }
  :root[data-color-theme="light"] :is(.mobile-panel-handle, .mobile-panel-handle::before, #artist-profile-panel[data-profile-sheet] .profile-sheet-handle::before) { background-color: var(--day-scroll-thumb); }
  :root[data-color-theme="light"] #mobile-control-dialog[data-panel="recommend"] .mobile-panel-handle { background: transparent; }
}
