:root {
  --panel: rgba(247, 249, 246, 0.88);
  --panel-solid: #f7f9f6;
  --field: #ffffff;
  --ink: #17211c;
  --ink-2: #44524a;
  --ink-3: #5f6d65;
  --rule: rgba(23, 33, 28, 0.12);
  --chip: rgba(23, 33, 28, 0.06);
  --accent: #b8252b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(184, 37, 43, 0.12);
  --c1: #b8252b; --c2: #2f6db0; --c3: #c08a1a;
  --shadow: 0 1px 1px rgba(16, 30, 22, .05), 0 14px 34px -10px rgba(16, 30, 22, .28);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-data: ui-monospace, "SF Mono", "IBM Plex Mono", Menlo, monospace;
  --r-panel: 14px; --r-ctl: 9px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --panel: rgba(16, 22, 30, 0.84); --panel-solid: #121923; --field: #0c121a;
  --ink: #e9eef1; --ink-2: #b3bec6; --ink-3: #8f9ca6;
  --rule: rgba(233, 238, 241, 0.14); --chip: rgba(233, 238, 241, 0.08);
  --accent: #ee6a62; --accent-ink: #1d0d0b; --accent-soft: rgba(238, 106, 98, 0.18);
  --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 14px 34px -10px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
[hidden] { display: none !important; }
body { background: #b6d3e8; color: var(--ink); font: 14px/1.45 var(--f-ui); overflow: hidden; -webkit-font-smoothing: antialiased; }
input, button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.note { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
.label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; display: block; margin: 8px 0 4px; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 10px 0 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

#app { position: fixed; inset: 0; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
#scene:active { cursor: grabbing; }
#labels, #weather-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
#scene-transition { position: absolute; inset: 0; z-index: 4; background: var(--panel-solid); opacity: 0; pointer-events: none; transition: opacity .55s ease; }
#scene-transition.is-covering { opacity: 1; transition: none; }
#navigation-hint { position: absolute; inset: 0; z-index: 19; display: grid; place-items: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity .6s ease; }
#navigation-hint.is-visible { opacity: 1; }
#navigation-hint.is-leaving { opacity: 0; transition-duration: .8s; }
.navigation-hint-card { width: min(270px, calc(100vw - 32px)); padding: 12px 16px 14px; border: 1px solid rgba(226, 235, 241, .2); border-radius: 12px; background: rgba(17, 25, 32, .78); color: #f5f8fa; text-align: center; box-shadow: 0 12px 36px rgba(0, 0, 0, .26); backdrop-filter: blur(12px) saturate(130%); -webkit-backdrop-filter: blur(12px) saturate(130%); opacity: 0; transform: scale(.96); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
#navigation-hint.is-visible .navigation-hint-card { opacity: 1; transform: scale(1); }
#navigation-hint.is-leaving .navigation-hint-card { opacity: 0; transform: scale(.98); }
.navigation-hint-card h2 { margin: 0; font: 650 15px/1.3 var(--f-display); }
.navigation-hint-card p { min-height: 18px; margin: 3px 0 0; color: #c6d4dc; font-size: 12px; transition: opacity .14s ease, transform .14s ease; }
.navigation-hint-card p.is-changing { opacity: 0; transform: translateY(3px); }
.hint-gesture { display: block; width: 100%; height: 100px; margin: 0 auto 3px; overflow: visible; color: #91c6c4; }
.hint-grid { opacity: .18; }
.hint-cue { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .08; transition: opacity .28s ease; }
.hint-gesture[data-phase="pan"] .hint-pan-cue, .hint-gesture[data-phase="orbit"] .hint-orbit-cue, .hint-gesture[data-phase="zoom"] .hint-zoom-cue { opacity: 1; }
.hint-mouse { transform-box: view-box; transform-origin: center; }
.hint-mouse-body { fill: rgba(255,255,255,.08); stroke: rgba(245,248,250,.88); stroke-width: 2; }
.hint-mouse-button { fill: rgba(255,255,255,.04); stroke: rgba(245,248,250,.5); stroke-width: 1.2; transition: fill .2s ease; }
.hint-mouse-seam { stroke: rgba(245,248,250,.56); stroke-width: 1.2; }
.hint-mouse-wheel { fill: #d6e6e8; transform-box: fill-box; transform-origin: center; }
.hint-gesture[data-phase="pan"] .hint-mouse-left, .hint-gesture[data-phase="orbit"] .hint-mouse-right, .hint-gesture[data-phase="zoom"] .hint-mouse-wheel { fill: var(--accent); }
.hint-gesture[data-phase="pan"] .hint-mouse { animation: hint-pan 1.2s ease-in-out both; }
.hint-gesture[data-phase="orbit"] .hint-mouse { animation: hint-orbit 1.2s ease-in-out both; }
.hint-gesture[data-phase="zoom"] .hint-mouse { animation: hint-zoom 1.2s ease-in-out both; }
.hint-touch { display: none; }
#navigation-hint[data-input="touch"] .hint-mouse { display: none; }
#navigation-hint[data-input="touch"] .hint-touch { display: block; }
#navigation-hint[data-input="touch"] .hint-gesture[data-phase="pan"] .hint-touch { animation: hint-touch-pan 1.2s ease-in-out both; }
#navigation-hint[data-input="touch"] .hint-gesture[data-phase="orbit"] .hint-touch { animation: hint-touch-orbit 1.2s ease-in-out both; }
#navigation-hint[data-input="touch"] .hint-gesture[data-phase="zoom"] .hint-touch { animation: hint-touch-zoom 1.2s ease-in-out both; }
#navigation-hint[data-reduced="true"] .hint-cue { opacity: .72; }
@keyframes hint-pan { 0%,100% { transform: translateX(0); } 24% { transform: translateX(-28px); } 72% { transform: translateX(28px); } }
@keyframes hint-orbit { 0%,100% { transform: translate(0,0) rotate(0); } 35% { transform: translate(20px,-8px) rotate(8deg); } 72% { transform: translate(-15px,-18px) rotate(-7deg); } }
@keyframes hint-zoom { 0%,100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-4px) scale(1.08); } 70% { transform: translateY(4px) scale(.96); } }
@keyframes hint-touch-pan { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-24px); } 70% { transform: translateX(24px); } }
@keyframes hint-touch-orbit { 0%,100% { transform: rotate(0); } 50% { transform: rotate(18deg); } }
@keyframes hint-touch-zoom { 0%,100% { transform: scale(1); } 50% { transform: scale(1.32); } }
.plabel { position: absolute; left: 0; top: 0; font: 600 11.5px var(--f-ui); color: #16201b; white-space: nowrap; letter-spacing: .01em;
  text-shadow: 0 0 2px #fff, 0 0 4px #fff, 0 0 8px rgba(255,255,255,.8); will-change: transform; }
.plabel.big { font: 700 17px var(--f-display); }
:root[data-theme="dark"] .plabel { color: #f1f4f2; text-shadow: 0 0 3px #0b1220, 0 0 6px #0b1220; }

.panel { position: absolute; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-panel); box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); transition: background-color .6s, color .6s; }
@media (prefers-reduced-transparency: reduce) { .panel { background: var(--panel-solid); backdrop-filter: none; } }

.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink-2); font-size: 17px; transition: background-color .2s, color .2s; }
.icon-btn:hover { background: var(--chip); color: var(--ink); }
.icon-btn.on { background: var(--accent); color: var(--accent-ink); }
.btn { border: 1px solid var(--rule); background: var(--field); border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 500; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button, .chips button { border: 1px solid var(--rule); background: var(--field); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; color: var(--ink-2); }
.seg button:hover, .chips button:hover { color: var(--ink); border-color: var(--ink-3); }
.seg button.on, .chips button[aria-checked="true"] { background: var(--ink); color: var(--panel-solid); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
select, input[type="date"], input[type="search"] { background: var(--field); border: 1px solid var(--rule); border-radius: var(--r-ctl); padding: 6px 9px; }
select.wide { width: 100%; }

#brand, #clock-btn, #view-panel { height: 48px; }
#brand { top: 14px; left: 14px; width: 320px; padding: 5px 7px; z-index: 5; }
.search { position: relative; }
.search input { display: block; width: 100%; height: 36px; }
#search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 320px; overflow: auto;
  background: var(--panel-solid); border: 1px solid var(--rule); border-radius: var(--r-ctl); box-shadow: var(--shadow); z-index: 8; }
#search-results li { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
#search-results li:hover, #search-results li.active { background: var(--accent-soft); }
#search-results small { color: var(--ink-3); white-space: nowrap; }

#clock-btn { top: 14px; left: calc(50% - 18px); transform: translateX(-50%); width: 340px; padding: 7px 10px; display: grid; grid-template-columns: 136px minmax(0, 1fr) 24px; align-items: center; gap: 8px; z-index: 5; cursor: pointer; }
#clock-btn:hover, #clock-btn[aria-expanded="true"] { border-color: var(--ink-3); }
#clock-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#clock-time { display: block; width: 136px; overflow: hidden; font-size: 20px; font-weight: 500; white-space: nowrap; }
#clock-wx { display: block; min-width: 0; overflow: hidden; font-size: 12.5px; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.clock-chevron { display: block; width: 21px; height: 21px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease, color .18s ease, background-color .18s ease; }
#clock-btn:hover .clock-chevron, #clock-btn[aria-expanded="true"] .clock-chevron { color: var(--ink); background: var(--chip); }
#clock-btn[aria-expanded="true"] .clock-chevron { transform: rotate(180deg); }
#sky-panel { top: 62px; left: 50%; transform: translateX(-50%); width: min(400px, calc(100% - 28px)); padding: 14px 16px; z-index: 6; }
#sky-panel { display: flex; flex-direction: column; max-height: min(84vh, 740px); overflow: hidden; padding: 0; }
.sky-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 12px 14px 9px; border-bottom: 1px solid var(--rule); }
.sky-head .profile-eyebrow { display: block; margin: 0 0 2px; font-size: 9px; }
.sky-head h2 { font: 700 17px var(--f-display); }
#sky-panel-content { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 14px 12px; }
.sky-section { padding: 9px 0 11px; border-bottom: 1px solid var(--rule); }
.sky-section:last-child { border-bottom: 0; }
.sky-section > h3 { margin: 0 0 7px; font-size: 13px; }
.mode-segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.mode-segmented button { min-width: 0; padding: 6px 4px; font-size: 11px; }
.mode-segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sky-summary { margin: 0; color: var(--ink-2); font-size: 12px; }
.sky-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.sky-controls legend { padding: 0; margin: 0 0 3px; }
.sky-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.sky-row input[type="range"] { min-width: 0; flex: 1; accent-color: var(--accent); }
.sky-row input[type="date"] { min-width: 0; padding: 4px 7px; border: 1px solid var(--rule); border-radius: var(--r-ctl); background: var(--field); }
.sky-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.sky-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 2px 0; }
.sky-metrics > div > span { color: var(--ink-3); font-size: 11px; }
.sky-metrics > div > strong { min-width: 0; color: var(--ink); font-size: 12px; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.weather-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 10px; }
.weather-metrics > div { display: block; }
.weather-metrics > div > span, .weather-metrics > div > strong { display: block; text-align: left; }
.weather-metrics > div > strong { margin-top: 1px; }
.sky-attribution { margin: 5px 0 0; font-size: 10px; }
.pollen-metrics { margin-top: 5px; }
#sky-panel fieldset:disabled { opacity: .72; }
#sky-panel fieldset:disabled button, #sky-panel fieldset:disabled summary { cursor: not-allowed; }
.sky-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.sky-row input[type="range"] { flex: 1; accent-color: var(--accent); }
#sun-info { display: block; margin: 4px 0 0; }
#sun-info { margin-left: auto; margin-top: 0; }
#weather-mode { margin: 6px 0; }
#weather-mode button { min-width: 90px; }
#weather-effects { padding: 4px 0 2px; }
#weather-effects > summary { text-transform: none; letter-spacing: 0; font-size: 12px; }
#weather-effect-chips { padding-top: 6px; }

#view-panel { top: 14px; right: 14px; display: flex; align-items: center; gap: 4px; padding: 5px 7px; z-index: 5; }
#view-panel .toolbar-button { position: relative; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 8px; }
.toolbar-icon { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toolbar-pin { width: 18px; height: 18px; flex: none; color: var(--ink-2); }
.toolbar-button:hover { background: var(--chip); color: var(--ink); }
.toolbar-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.toolbar-button:focus-visible, .toolbar-position:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.toolbar-divider { display: block; flex: 0 0 1px; width: 1px; height: 22px; margin: 0 2px; background: var(--rule); }
.toolbar-position { position: relative; display: flex; align-items: center; gap: 5px; min-width: 0; padding: 3px 6px; border: 1px solid var(--rule); border-radius: var(--r-ctl); background: var(--field); color: var(--ink-2); }
.toolbar-position:focus-within { border-color: var(--accent); }
#preset-select { max-width: 150px; min-width: 0; padding: 3px 3px; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
#view-panel [data-tooltip]::after { content: attr(data-tooltip); position: absolute; top: calc(100% + 7px); left: 50%; z-index: 25; padding: 5px 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel-solid); color: var(--ink); box-shadow: var(--shadow); font: 500 11px/1.3 var(--f-ui); white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, -3px); transition: opacity .14s ease, transform .14s ease, visibility .14s; }
#view-panel [data-tooltip]:hover::after, #view-panel [data-tooltip]:focus-visible::after, #view-panel [data-tooltip]:focus-within::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
#view-panel .toolbar-position[data-tooltip]::after { left: auto; right: 0; transform: translateY(-3px); }
#view-panel .toolbar-position[data-tooltip]:hover::after, #view-panel .toolbar-position[data-tooltip]:focus-within::after { transform: translateY(0); }
#map-dock { left: 14px; bottom: 14px; z-index: 8; display: flex; align-items: stretch; gap: 4px; padding: 7px; max-width: calc(100vw - 28px); }
#base-map-cards { position: relative; flex: 0 0 82px; width: 82px; height: 96px; overflow: visible; transition: width .24s ease, flex-basis .24s ease; }
#quick-access { display: flex; align-items: stretch; gap: 4px; }
#base-map-cards[data-open="true"] { flex-basis: 246px; width: 246px; }
.map-card { width: 78px; display: grid; justify-items: center; gap: 4px; padding: 2px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 10.5px; font-weight: 600; }
.map-card-preview { flex: none; }
#base-map-cards .map-card { position: absolute; left: 0; bottom: 0; height: 96px; z-index: 1; transition: transform .24s ease, opacity .18s ease; }
#base-map-cards[data-open="false"] .map-card:not([aria-pressed="true"]) { visibility: hidden; opacity: 0; pointer-events: none; }
#base-map-cards[data-open="false"] .map-card[aria-pressed="true"] { z-index: 4; transform: none; }
#base-map-cards[data-open="false"] .map-card[aria-pressed="true"]::after { content: ""; position: absolute; top: 9px; right: 10px; width: 13px; height: 8px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--panel-solid); transform: skewY(-25deg); box-shadow: 0 3px 0 -1px var(--panel-solid), 0 3px 0 0 var(--ink-2), 0 6px 0 -1px var(--panel-solid), 0 6px 0 0 var(--ink-2); }
#base-map-cards[data-open="false"] [data-base="sim"]:not([aria-pressed="true"]) { z-index: 2; transform: translate(8px, -5px) scale(.94); }
#base-map-cards[data-open="false"] [data-base="aerial"]:not([aria-pressed="true"]) { z-index: 1; transform: translate(16px, -10px) scale(.88); }
#base-map-cards[data-open="false"] [data-base="map"]:not([aria-pressed="true"]) { z-index: 2; transform: translate(8px, -5px) scale(.94); }
#base-map-cards[data-open="true"] [data-base="sim"] { transform: translateX(0); z-index: 1; }
#base-map-cards[data-open="true"] [data-base="aerial"] { transform: translateX(82px); z-index: 1; }
#base-map-cards[data-open="true"] [data-base="map"] { transform: translateX(164px); z-index: 1; }
.map-card:hover { background: var(--chip); color: var(--ink); }
.map-card[aria-pressed="true"] { color: var(--accent); }
.map-card[aria-pressed="true"] .map-card-preview { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.map-card-preview { position: relative; display: block; width: 64px; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--rule); border-radius: 8px; background: var(--chip); }
.map-card-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.preview-sim::after { content: ""; position: absolute; inset: 0; background: rgba(64, 98, 55, .3); mix-blend-mode: color; pointer-events: none; }
.preview-aerial img { filter: saturate(1.08) contrast(1.06); }
.preview-topo { background: #e8e4d8; }
#quick-access { width: 0; overflow: hidden; opacity: 0; visibility: hidden; transition: width .22s ease, opacity .18s ease; }
#map-dock[data-expanded="true"] #quick-access { width: 320px; opacity: 1; visibility: visible; }
.quick-card { display: grid; align-content: center; justify-items: center; gap: 3px; width: 74px; min-width: 68px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 10.5px; font-weight: 600; }
.quick-card > span { display: grid; place-items: center; width: 64px; aspect-ratio: 1; border-radius: 8px; background: var(--chip); color: var(--ink); font-size: 28px; }
.quick-card svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-card:hover, .quick-card[aria-expanded="true"] { background: var(--accent-soft); color: var(--ink); }
.quick-card[aria-expanded="true"] > span { background: var(--accent); color: var(--accent-ink); }
body.map-details-open #map-dock #quick-access { width: 0 !important; opacity: 0; visibility: hidden; pointer-events: none; }
#quick-panel { position: fixed; left: 14px; bottom: 120px; width: min(350px, calc(100vw - 28px)); max-height: min(58vh, 520px); overflow: auto; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--panel-solid); box-shadow: var(--shadow); }
#quick-panel[data-mode="buildings"], #quick-panel[data-mode="traffic"] { top: 110px; bottom: 14px; width: min(460px, calc(100vw - 28px)); max-height: none; }
#quick-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
#quick-panel h2, #layers-panel h2 { font: 700 16px var(--f-display); }
.quick-layer-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; width: min(100%, 360px); }
.quick-layer-toggle { display: flex; align-items: center; gap: 7px; min-height: 32px; cursor: pointer; font-size: 12px; }
.quick-layer-toggle input { accent-color: var(--accent); }
#layers-panel { left: 14px; right: auto; bottom: 136px; width: min(460px, calc(100vw - 28px)); max-height: calc(100% - 180px); z-index: 7; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.map-details-head { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 14px 18px 10px; border-bottom: 1px solid var(--rule); }
.map-details-head .profile-eyebrow { margin-bottom: 0; }
.map-details-head h2 { font-size: 19px !important; }
.map-details-scroll { min-height: 0; padding: 12px 18px 18px; overflow: auto; }
.map-details-section { padding: 10px 0 14px; border-bottom: 1px solid var(--rule); }
.map-details-section > h3 { margin: 0 0 8px; font-size: 14px; }
#layer-list, #analysis-layer-list, #display-layer-list { display: block; }
.map-details-layers .layer-group, #analysis-layer-list .layer-group, #display-layer-list .layer-group { min-width: 0; }
.map-details-display .building-mode-controls { margin-top: 5px; }
.map-details-tools #tool-list { margin-bottom: 6px; }
.control-state { display: none !important; }
.building-toggle-bar { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; margin: 4px 0 12px; padding: 7px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--field); cursor: pointer; }
.building-toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.building-toggle-track { position: relative; grid-column: 1; display: block; width: 36px; height: 21px; border-radius: 999px; background: var(--ink-3); transition: background-color .2s; }
.building-toggle-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.building-toggle-input:checked + .building-toggle-track { background: var(--accent); }
.building-toggle-input:checked + .building-toggle-track::after { transform: translateX(15px); }
.building-toggle-input:focus-visible + .building-toggle-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.building-toggle-label { grid-column: 2; min-width: 0; font-size: 13px; font-weight: 600; }
.quick-building-toggle { grid-template-columns: 38px; width: 72px; justify-self: start; }
.building-toggle-state { color: var(--ink-3); font-size: 11px; font-weight: 600; }
.building-mode-controls { display: block; min-width: 0; max-height: 560px; margin: 0; padding: 0; border: 0; opacity: 1; visibility: visible; overflow: visible; transition: max-height .25s ease, opacity .2s ease, margin .25s ease, visibility 0s; }
.building-mode-controls legend { margin-bottom: 6px; }
.building-mode-controls.is-collapsed { max-height: 0; margin: 0; opacity: 0; visibility: hidden; overflow: hidden; pointer-events: none; transition-delay: 0s, 0s, 0s, .25s; }
.building-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 7px; width: min(100%, 360px); aspect-ratio: 1; }
.building-mode-tile, .layer-row { --selector-preview-height: 56px; }
.building-mode-tile { position: relative; display: grid; grid-template-rows: var(--selector-preview-height) minmax(2.4em, 1fr); gap: 3px; min-width: 0; min-height: 0; padding: 6px; overflow: hidden; border: 1px solid var(--rule); border-radius: 8px; background: var(--field); color: var(--ink-2); text-align: left; font-size: 10.5px; line-height: 1.2; }
.building-mode-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); }
.building-mode-tile:disabled { cursor: not-allowed; }
.building-mode-tile:disabled .building-mode-preview { opacity: .35; }
.building-mode-label { min-width: 0; overflow-wrap: anywhere; word-break: normal; hyphens: auto; }
.building-mode-preview { display: block; width: 100%; height: var(--selector-preview-height); min-height: 0; border-radius: 5px; background: var(--chip); }
.building-mode-controls.is-collapsed #color-legend { visibility: hidden; }
.preview-dorf { background: linear-gradient(135deg, rgba(187, 116, 76, .5), rgba(60, 96, 68, .35)), url("../public/data/ortho.jpg") center/cover; }
.preview-neutral { background: linear-gradient(135deg, #dedbd3 0 48%, #bdbdb7 49% 100%); }
.preview-usage { background: linear-gradient(90deg, #d98c5f 0 25%, #b05a9c 25% 50%, #4f81bd 50% 75%, #7b7f86 75%); }
.preview-year { background: linear-gradient(90deg, #6c6579, #739a95, #d2bd72, #af5241); }
.preview-height { background: linear-gradient(90deg, #286da8, #68b4b4, #f0d35e, #cb4737); }
.preview-floors, .preview-dwellings, .preview-heat { background: linear-gradient(90deg, #e6d8b4, #d59a54, #c95844, #762d3d); }
.preview-status { background: linear-gradient(90deg, #3d8c64, #bf9a38, #c85243, #7e7f80); }
#timeline-year-display { position: absolute; top: 18px; left: 20px; z-index: 9; pointer-events: none; color: var(--ink); }
#timeline-year-display span { display: block; color: var(--ink-2); font-size: 12px; font-weight: 700; }
#timeline-year { display: block; font-size: 68px; line-height: 1.05; }
#time-travel-panel { left: 50%; bottom: 14px; transform: translateX(-50%); width: min(920px, calc(100vw - 28px)); z-index: 9; padding: 7px 10px; }
.timeline-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-height: 34px; }
.timeline-row .icon-btn { flex: none; width: 32px; height: 32px; }
.timeline-row input[type="range"] { flex: 1 1 auto; min-width: 80px; margin: 0 4px; accent-color: var(--accent); }
#timeline-speed { flex: none; width: 62px; min-width: 0; padding: 5px 6px; }
#timeline-rate { flex: none; min-width: 38px; text-align: center; font-size: 12px; }
.timeline-info { position: absolute; right: 0; bottom: calc(100% + 8px); width: min(430px, calc(100vw - 16px)); max-height: min(48vh, 300px); padding: 12px 14px; overflow: auto; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel-solid); box-shadow: var(--shadow); color: var(--ink-2); font-size: 11px; }
.timeline-info p { margin: 0 0 7px; overflow-wrap: anywhere; }
.timeline-info p:last-child { margin-bottom: 0; }
.timeline-count { font-weight: 700; color: var(--ink); }
.time-travel-active #brand, .time-travel-active #clock-btn, .time-travel-active #sky-panel,
.time-travel-active #view-panel, .time-travel-active #map-dock, .time-travel-active #layers-panel,
.time-travel-active #dock, .time-travel-active #statusbar, .time-travel-active #labels,
.time-travel-active #weather-overlay { display: none !important; }
#layer-list { display: grid; gap: 2px; }
.layer-group { border-top: 1px solid var(--rule); padding: 5px 0 2px; }
.layer-group:first-child { border-top: 0; }
.layer-group-summary { display: flex; align-items: center; margin: 0; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.layer-group-summary::before { flex: none; }
.layer-group-count { margin-left: auto; color: var(--ink-3); font: 10px var(--f-data); }
.layer-group-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; width: min(100%, 360px); padding: 7px 0 5px; }
details { border-top: 1px solid var(--rule); padding: 8px 0; }
details:first-child { border-top: 0; }
summary { cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; list-style: none; margin-bottom: 4px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "\25B8"; display: inline-block; width: 14px; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
.layer-row { position: relative; display: grid; grid-template-rows: var(--selector-preview-height) minmax(0, 1fr); gap: 4px; width: 100%; min-width: 0; aspect-ratio: 1; padding: 6px; overflow: hidden; border: 1px solid var(--rule); border-radius: 8px; background: var(--field); color: var(--ink-2); text-align: left; font-size: 10.5px; line-height: 1.2; cursor: pointer; }
.layer-row[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); }
.layer-row:hover { background: var(--chip); }
.layer-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.layer-row .swatch { grid-row: 1; display: block; width: 100%; height: 100%; min-height: 0; border-radius: 5px; }
.layer-row-info { grid-row: 2; display: flex; align-items: start; justify-content: space-between; gap: 4px; min-width: 0; min-height: 2.4em; overflow: hidden; }
.layer-row .name { display: -webkit-box; flex: 1; min-width: 0; overflow: hidden; overflow-wrap: anywhere; word-break: normal; hyphens: auto; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.layer-row .count { flex: none; color: var(--ink-3); font-size: 9.5px; font-family: var(--f-data); text-align: right; }
.selector-source-icon { position: absolute; top: 10px; right: 10px; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--rule); border-radius: 50%; background: var(--panel-solid); color: var(--ink); font: 700 12px/1 var(--f-data); text-align: center; cursor: help; touch-action: manipulation; }
.source-info-popup { position: fixed; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: start; gap: 8px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel-solid); box-shadow: var(--shadow); color: var(--ink); font-size: 12px; line-height: 1.4; }
.source-info-text { margin: 0; overflow-wrap: anywhere; }
.source-info-close { width: 28px; height: 28px; }
.demographic-legend { padding: 2px 4px 8px 28px; }
.demographic-legend span { display: block; margin-bottom: 3px; color: var(--ink-3); font-size: 10px; }
.demographic-legend img { display: block; width: min(240px, 100%); max-height: 56px; object-fit: contain; object-position: left center; }
.layer-row:disabled { opacity: .5; cursor: not-allowed; }
.legend { margin-top: 8px; font-size: 12px; color: var(--ink-2); display: grid; gap: 3px; }
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }

#inspector { top: 66px; right: 14px; width: min(440px, calc(100vw - 28px)); max-height: calc(100% - 140px); overflow: hidden; padding: 0; z-index: 5; display: flex; flex-direction: column; }
#inspector .close { position: absolute; top: 6px; right: 6px; z-index: 3; }
#inspector-body { width: 100%; min-height: 0; }
#inspector-body:not(.building-profile) { overflow: auto; padding: 14px 16px; }
#inspector-body.building-profile { overflow: auto; padding: 0; }
#inspector h3 { margin: 0 28px 2px 0; font-size: 17px; }
#inspector .sub { color: var(--ink-3); margin-bottom: 10px; font-size: 12.5px; }
#inspector dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; }
#inspector dt { color: var(--ink-3); }
#inspector dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
#inspector .src { font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 10px; }
.profile-header { position: sticky; top: 0; z-index: 2; padding: 14px 44px 0 16px; background: var(--panel-solid); border-bottom: 1px solid var(--rule); }
.profile-eyebrow { display: block; margin-bottom: 3px; color: var(--ink-3); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.profile-header h3 { overflow-wrap: anywhere; }
.profile-header .sub { margin: 2px 0 0; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.profile-tabs { display: flex; gap: 2px; margin-top: 8px; overflow-x: auto; border-bottom: 1px solid var(--rule); scrollbar-width: thin; }
.profile-tabs button { flex: none; padding: 7px 9px 6px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-3); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.profile-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.profile-panel { min-height: 0; }
.profile-content { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 18px; }
.profile-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.profile-kpi { min-width: 0; padding: 9px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel-solid); }
.profile-kpi span, .profile-building-metrics span { display: block; color: var(--ink-3); font-size: 10.5px; }
.profile-kpi strong, .profile-building-metrics strong { display: block; margin-top: 2px; font: 700 16px/1.2 var(--f-display); overflow-wrap: anywhere; }
.profile-kpi .tag { font: 500 11px/1.4 var(--f-ui); }
.profile-demographics { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel-solid); }
.profile-demographic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-demographic-grid > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.profile-demographic-grid strong { font: 700 18px/1.1 var(--f-display); }
.profile-demographic-grid span { color: var(--ink-3); font-size: 10px; }
.profile-section { display: flex; flex-direction: column; gap: 7px; }
.profile-section h4, .profile-section-title h4 { margin: 0; font: 700 13px/1.35 var(--f-display); }
.profile-section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.profile-section-title > span, .profile-section-title > strong { color: var(--ink-3); font-size: 10.5px; font-weight: 600; text-align: right; }
.profile-section .profile-note, .profile-note { margin: 0; color: var(--ink-3); font-size: 10.5px; }
.profile-age { display: grid; gap: 4px; }
.profile-age-value { font: 700 21px/1.15 var(--f-display); }
.profile-area-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-area-compare > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; padding: 8px 9px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel-solid); }
.profile-area-compare span { color: var(--ink-3); font-size: 10.5px; }
.profile-area-compare b { font: 700 16px/1.2 var(--f-display); overflow-wrap: anywhere; }
.profile-area-delta { margin: 0; color: var(--ink-2); font-size: 11px; }
.profile-area-reference { display: flex; flex-direction: column; gap: 2px; padding-left: 9px; border-left: 3px solid var(--accent); }
.profile-area-reference b { font-size: 11px; }
.profile-area-reference span { font-size: 11px; }
.profile-area-reference small { color: var(--ink-3); font-size: 10px; }
.profile-building-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-floor-stack { display: flex; flex-direction: column-reverse; gap: 2px; width: 50px; padding: 5px; border: 1px solid var(--rule); border-bottom-width: 3px; border-radius: 4px; }
.profile-floor-stack span { height: 6px; border-radius: 1px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.profile-nearby { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.profile-nearby li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 11.5px; }
.profile-nearby li span { min-width: 0; }
.profile-nearby b, .profile-nearby small { display: block; overflow-wrap: anywhere; }
.profile-nearby small { color: var(--ink-3); font-size: 10.5px; }
.profile-nearby strong { flex: none; font: 600 11px var(--f-data); }
.profile-highlight { margin: 0; padding: 8px 10px; border-left: 3px solid var(--accent); border-radius: 3px; background: var(--accent-soft); font-size: 12px; font-weight: 600; }
.profile-rating { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px 12px; width: 100%; padding: 11px 13px; border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 10px; background: linear-gradient(110deg, var(--accent-soft), var(--panel-solid) 72%); color: var(--ink); text-align: left; }
.profile-rating:hover, .profile-rating[aria-expanded="true"] { border-color: var(--accent); }
.profile-rating-score { align-self: center; font: 700 30px/.95 var(--f-display); }
.profile-rating-score small { display: block; margin-top: 5px; color: var(--ink-3); font: 500 10px/1 var(--f-ui); }
.profile-rating-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; }
.profile-rating-copy b { font: 700 13px/1.2 var(--f-display); }
.profile-rating-copy small { color: var(--ink-3); font-size: 10px; }
.profile-rating-meter { display: flex; grid-column: 1 / -1; gap: 4px; }
.profile-rating-meter i { flex: 1; height: 5px; border-radius: 4px; background: var(--chip); }
.profile-rating-meter i.on { background: var(--accent); }
.profile-rating-action { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--rule); color: var(--accent); font-size: 12px; font-weight: 650; }
.profile-rating-action svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.profile-rating[aria-expanded="true"] .profile-rating-action svg { transform: rotate(180deg); }
.profile-rating-details { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel-solid); }
.profile-rating-details > p { margin: 0; color: var(--ink-3); font-size: 10.5px; }
.profile-rating-details h4 { margin: 2px 0 0; font: 700 12px/1.3 var(--f-display); }
.profile-rating-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.profile-rating-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 10.5px; }
.profile-rating-list li span { min-width: 0; }
.profile-rating-list b, .profile-rating-list small { display: block; overflow-wrap: anywhere; }
.profile-rating-list small { margin-top: 2px; color: var(--ink-3); font-size: 9.5px; }
.profile-rating-list li > strong { flex: none; font: 600 10px var(--f-data); }
.profile-rating-excluded { color: var(--ink-2); }
.profile-environment-list { margin-bottom: 2px; }
.profile-compare { display: grid; gap: 5px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.profile-compare .profile-section-title strong { color: var(--ink); }
.profile-histogram { display: flex; align-items: end; gap: 3px; height: 96px; padding: 6px 2px 0; border-bottom: 1px solid var(--rule); }
.profile-histogram-bin { display: flex; flex: 1; min-width: 0; height: 100%; flex-direction: column; align-items: center; justify-content: end; gap: 2px; color: var(--ink-3); }
.profile-histogram-bin b { font: 9px var(--f-data); }
.profile-histogram-bin i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--ink-3); opacity: .52; }
.profile-histogram-bin.is-current { color: var(--accent); }
.profile-histogram-bin.is-current i { background: var(--accent); opacity: 1; }
.profile-histogram-bin small { width: 100%; overflow: hidden; color: var(--ink-3); font: 8px var(--f-data); text-align: center; text-overflow: clip; white-space: nowrap; }
.profile-compare p, .profile-empty, .profile-source { margin: 0; color: var(--ink-3); font-size: 10.5px; }
.profile-source { border-top: 1px solid var(--rule); padding-top: 8px; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; background: var(--chip); color: var(--ink-2); }
.tag.warn { background: rgba(192, 138, 26, .18); color: #8a6212; }

#dock { right: 14px; bottom: 14px; padding: 6px; z-index: 4; }
#statusbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; color: var(--ink-2); background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; pointer-events: none; }

#almanac { position: absolute; inset: 0; z-index: 15; display: grid; place-items: center; background: rgba(10, 20, 18, .35); padding: 16px; }
.sheet { position: relative; width: min(1280px, 100%); height: min(900px, calc(100% - 32px)); max-height: calc(100% - 32px); display: flex; flex-direction: column; overflow: hidden; background: var(--panel-solid); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px 10px; flex: none; }
.sheet-head-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.sheet-head h2 { font-size: 22px; }
.tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--rule); overflow-x: auto; flex: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 7px 10px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
#almanac-body { min-height: 0; padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
#almanac-body p { margin: 0; max-width: 70ch; }
.imprint { flex: none; display: grid; gap: 12px; margin-top: 12px; padding: 22px; border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: 8px; background: var(--field); overflow-wrap: anywhere; }
.imprint h3 { margin: 0; font-size: 22px; }
.imprint h4 { margin: 8px 0 0; font-size: 14px; }
.imprint address { font-style: normal; }
.imprint-address { display: inline-flex; align-items: center; gap: 8px; }
.imprint-location { flex: none; color: var(--accent); background: var(--accent-soft); }
.imprint-location svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: imprint-pin 2.4s ease-in-out infinite; }
.imprint-location:hover svg, .imprint-location:focus-visible svg { animation-play-state: paused; }
.imprint-location:disabled { opacity: .45; cursor: default; }
.imprint-location:disabled svg { animation: none; }
.imprint-contact { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
@keyframes imprint-pin { 0%, 70%, 100% { transform: translateY(0); } 35% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .imprint-location svg { animation: none; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; }
.stat .num { font-size: 22px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 6px; align-items: center; font-size: 12.5px; }
.bar .t { position: relative; padding: 2px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 4px; }
.bar .t i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; opacity: .8; }
.bar .t span { position: relative; }
.bar .v { text-align: right; }
.src { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 6px 14px; font-size: 13px; margin: 0; }
.src dt { color: var(--ink-3); } .src dd { margin: 0; }
.vote { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.vbar { position: relative; height: 12px; background: var(--rule); border-radius: 3px; }
.vbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.vbar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.vlbl { display: flex; justify-content: space-between; font-size: 12px; margin-top: 3px; }

#loading { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 42%, #dcecf7 0%, #b6d3e8 100%); z-index: 20; transition: opacity .7s; }
#loading.done { opacity: 0; pointer-events: none; }
.loading-card { width: min(400px, calc(100vw - 32px)); padding: 28px 26px; text-align: center; background: rgba(247, 249, 246, .9); border: 1px solid rgba(23, 33, 28, .12); border-radius: var(--r-panel); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.loading-spinner { display: block; width: 30px; height: 30px; margin: 0 auto 12px; border: 3px solid rgba(23, 33, 28, .12); border-top-color: var(--accent); border-radius: 50%; animation: loading-spin 1s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.loading-card h2 { font-size: 36px; }
.bar > #loading-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.loading-card .bar { height: 5px; background: var(--chip); border-radius: 3px; overflow: hidden; margin: 12px 0 8px; display: block; }
.loading-card p { margin: 8px 0 0; }
.loading-note { min-height: 2.9em; color: var(--ink-2); }
#error-banner { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); max-width: min(720px, 92vw); background: #7a1f12; color: #fff; border-radius: 10px; padding: 10px 16px; z-index: 30; box-shadow: var(--shadow); }
#error-banner ul { margin: 4px 0 0; padding-left: 18px; }

@media (max-width: 900px) {
  #brand { width: 250px; }
  #layers-panel { left: 8px; right: auto; bottom: 136px; max-height: calc(100% - 170px); width: min(700px, calc(100vw - 16px)); }
  #inspector { width: min(380px, calc(100vw - 24px)); }
  .building-mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 761px) and (max-width: 1244px) {
  #clock-btn { top: 70px; left: 50%; transform: translateX(-50%); }
  #sky-panel { top: 126px; }
}
@media (min-width: 1245px) and (max-width: 1299px) {
  #clock-btn { top: 14px; left: calc(50% - 25px); transform: translateX(-50%); }
}
@media (max-width: 760px) {
  #brand, #clock-btn, #view-panel { height: 38px; }
  #brand { top: 8px; left: 8px; width: calc(100vw - 16px); padding: 3px 7px; }
  .search input { height: 30px; }
  #clock-btn { top: 54px; left: 8px; right: 8px; transform: none; width: auto; grid-template-columns: 136px minmax(0, 1fr) 24px; padding: 5px 7px; gap: 6px; }
  #clock-time { font-size: 16px; }
  #clock-wx { display: block; font-size: 11px; }
  .clock-chevron { width: 21px; height: 21px; }
  #view-panel { top: 100px; left: 8px; right: 8px; display: grid; grid-template-columns: 30px 1px repeat(2, 30px) 1px repeat(2, 30px) 1px minmax(0, 1fr) 30px; gap: 4px; padding: 3px 4px; }
  #view-panel .toolbar-button { width: 30px; height: 30px; }
  #view-panel .toolbar-icon { width: 19px; height: 19px; }
  #view-panel .toolbar-divider { margin: 0; height: 19px; }
  .toolbar-position { gap: 2px; padding: 2px 3px; }
  .toolbar-pin { width: 15px; height: 15px; }
  #preset-select { flex: 1; width: 100%; max-width: none; padding: 3px 1px; font-size: 10px; }
  #sky-panel { top: 146px; left: 8px; right: 8px; transform: none; width: auto; max-height: calc(100% - 170px); }
  #statusbar { display: none; }
}
@media (max-width: 600px) {
  .navigation-hint-card { width: min(248px, calc(100vw - 24px)); padding: 10px 13px 12px; }
  .hint-gesture { height: 88px; }
  #sky-panel-content { padding-left: 11px; padding-right: 11px; }
  .sky-head { padding-left: 11px; padding-right: 11px; }
  .weather-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #map-dock { left: 8px; bottom: 8px; max-width: calc(100vw - 16px); padding: 5px; gap: 2px; }
  #base-map-cards .map-card { width: 62px; height: 84px; font-size: 9.5px; }
  .map-card-preview { width: 52px; }
  #base-map-cards { flex-basis: 66px; width: 66px; height: 84px; }
  #base-map-cards[data-open="true"] { flex-basis: 198px; width: 198px; }
  #base-map-cards[data-open="true"] [data-base="aerial"] { transform: translateX(66px); }
  #base-map-cards[data-open="true"] [data-base="map"] { transform: translateX(132px); }
  #map-dock[data-expanded="true"] #quick-access { width: min(190px, calc(100vw - 224px)); }
  .quick-card { width: 60px; min-width: 54px; padding: 0; font-size: 9px; }
  .quick-card > span { width: min(52px, 100%); font-size: 24px; }
  #map-dock[data-expanded="true"] { flex-wrap: wrap; }
  #map-dock[data-expanded="true"] #quick-access { width: 100%; justify-content: space-around; }
  #quick-panel { left: 8px; bottom: 104px; width: min(350px, calc(100vw - 16px)); }
  #quick-panel[data-mode="buildings"], #quick-panel[data-mode="traffic"] { top: 146px; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: none; }
  #layers-panel { top: auto; bottom: 108px; left: 8px; right: 8px; width: auto; max-height: calc(100% - 170px); }
  .map-details-head { padding: 10px 12px 8px; }
  .map-details-scroll { padding: 8px 12px 12px; }
  #layer-list { grid-template-columns: 1fr; }
  .building-mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  #time-travel-panel { left: 8px; bottom: 8px; transform: none; width: calc(100vw - 16px); padding: 10px 12px; }
  .timeline-foot { align-items: flex-start; flex-direction: column; gap: 2px; }
  #timeline-year { font-size: 52px; }
  #almanac { padding: 8px; }
  .sheet { width: 100%; height: calc(100% - 16px); max-height: calc(100% - 16px); }
  .sheet-head { gap: 8px; padding: 12px; }
  .sheet-head-main { gap: 8px; }
  .sheet-head h2 { font-size: 18px; }
  .sheet-head .btn { padding: 5px 9px; }
  .tabs { padding: 0 8px; }
  #almanac-body { padding: 14px; }
  #inspector { top: 54px; right: 8px; width: calc(100vw - 16px); max-height: calc(100% - 72px); }
  .time-travel-active #statusbar { display: none; }
  .profile-header { padding-left: 12px; }
  .profile-content { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.easter-photo-overlay[hidden] { display: none; }
.easter-photo-overlay {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 24px; background: rgba(10, 14, 16, 0.92); cursor: zoom-out;
}
.easter-photo-overlay img { max-width: min(94vw, 1400px); max-height: 90vh; object-fit: contain; }
.easter-photo-close {
  position: absolute; top: 18px; right: 18px; border: 1px solid rgba(255,255,255,.4);
  border-radius: 4px; padding: 8px 12px; color: #fff; background: rgba(22,28,30,.9);
  font: inherit; cursor: pointer;
}
.easter-photo-missing { max-width: 520px; color: #fff; text-align: center; }
