:root {
  color-scheme: dark;
  --bg: #090e13;
  --panel: #111b23;
  --ink: #edece3;
  --muted: #a6b2bc;
  --line: #34414c;
  --accent: #dfbd81;
  --gutter: 32px;
  --header-height: 96px;
  --footer-height: 184px;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100svh; overflow: hidden; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, select, input { font: inherit; }
button, select { color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 7px; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); color: var(--accent); }
button:disabled, select:disabled { opacity: .45; cursor: default; }
:is(button, select, input, a, canvas, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button[aria-pressed=true] { background: #e0c89b; color: #151b21; border-color: #e0c89b; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
.text-button { border: 0; background: none; padding: 6px; color: var(--muted); font-size: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow, .brand>span { font-size: 9px; letter-spacing: 1.6px; font-weight: 600; color: var(--muted); }
header { position: absolute; z-index: 4; inset: 0 0 auto; height: var(--header-height); padding: 20px var(--gutter); display: flex; align-items: center; gap: 24px; background: linear-gradient(#090e13f2, #090e1399, transparent); pointer-events: none; }
header>* { pointer-events: auto; }
.brand { text-decoration: none; color: var(--ink); line-height: 1; flex-shrink: 0; }
h1 { font: 400 39px/.95 Georgia, serif; letter-spacing: -1.6px; margin: 6px 0 0; }
nav { display: flex; gap: 4px; margin: auto; }
nav button, .header-actions button { padding: 8px 13px; font-size: 12px; white-space: nowrap; background: #10171cb3; border-color: #56616c66; min-height: 36px; }
.header-actions { display: flex; align-items: center; gap: 6px; }
#search-toggle { display: flex; align-items: center; gap: 7px; }
#search-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
#place-search { position: absolute; z-index: 6; top: calc(var(--header-height) + 8px); left: var(--gutter); width: min(440px,calc(100% - 2 * var(--gutter))); max-height: calc(100svh - var(--header-height) - var(--footer-height) - 24px); overflow-y: auto; padding: 14px; border: 1px solid #64717b88; border-radius: 12px; background: #101a22fa; box-shadow: 0 16px 60px #0006; }
.search-field { display: flex; align-items: center; min-height: 48px; gap: 4px; padding: 4px; border: 1px solid #52616d; border-radius: 8px; background: #1b2831; }
.search-field:focus-within { border-color: var(--accent); }
#search-input { flex: 1; min-width: 0; width: 100%; min-height: 38px; border: 0; border-radius: 4px; outline: none; background: transparent; color: var(--ink); padding: 8px; font-size: 14px; line-height: 1.4; }
#search-input::placeholder { color: #a6b2bc; opacity: 1; }
#search-input::-webkit-search-cancel-button { display: none; }
.search-field button { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 5px; font-size: 22px; line-height: 1; }
.search-field button:hover { background: #34434d; }
#search-clear { width: auto; padding: 0 7px; font-size: 11px; color: var(--muted); }
#search-status { margin: 12px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
#search-shortcuts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
#search-shortcuts button { padding: 9px 12px; min-height: 40px; text-align: left; font-size: 12px; background: #1b2831; border-color: #43515e88; }
#search-shortcuts button:hover { border-color: var(--accent); background: #26343d; }
#search-results { padding: 0; margin: 10px 0 0; list-style: none; max-height: min(340px,calc(100svh - var(--header-height) - var(--footer-height) - 128px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
#search-results li { padding: 12px; border-radius: 5px; cursor: pointer; font-size: 13px; overflow-wrap: anywhere; }
#search-results li+li { border-top: 1px solid #34414c66; }
#search-results li:is(:hover,[aria-selected=true]) { background: #29383f; color: #f1dfbd; }
#search-results small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
#search-results strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 500; }
#map-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
#map-labels .map-label--district { text-transform: uppercase; font-size: 10px !important; letter-spacing: .18em !important; color: #a9b5c38c !important; }
#map-labels .map-label--river { font: italic 15px/20px Georgia,serif !important; color: #8eb9dcbd !important; letter-spacing: .12em !important; }
#map-labels .map-label--landmark { font-size: 10px !important; color: #e4d9bbbc !important; }
body.search-open .environment-status { visibility: hidden; }
main, #viewport { position: absolute; inset: 0; min-width: 0; min-height: 0; }
#viewport { overflow: hidden; background: radial-gradient(ellipse at 52% 43%, #132028, #090e13 75%); }
#viewport::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, #090e13f5 3%, #090e13ad 16%, transparent 39%, transparent 75%, #090e13c4 100%); z-index: 1; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
.environment-status { position: absolute; z-index: 2; left: var(--gutter); top: calc(var(--header-height) + 62px); max-width: 240px; }
.environment-status p { margin: 6px 0 0; font-size: 11px; line-height: 1.5; color: #d7c89d; text-shadow: 0 1px 5px #000; }
.environment-status .text-button { padding: 2px 0; font-size: 11px; color: var(--accent); }
.view-navigation { position: absolute; z-index: 2; top: calc(var(--header-height) + 3px); right: calc(var(--gutter) - 6px); width: 122px; display: grid; justify-items: center; gap: 3px; }
#view-handle { width: 122px; height: 115px; border-radius: 50%; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
#view-handle svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.handle-halo { fill: #101c25; fill-opacity: .87; stroke: #849497; stroke-opacity: .12; stroke-width: 1; }
.handle-ring { fill: none; stroke: #99b0b7; stroke-width: 1; stroke-opacity: .36; stroke-linecap: round; }
.handle-arrows { fill: none; stroke: #d9c69f; stroke-opacity: .64; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.handle-shadow { fill: #02080e; opacity: .45; }
.handle-model { filter: drop-shadow(0 4px 3px #0005); }
#view-handle:is(:hover,:focus-visible) .handle-halo { stroke: #d7c39b; stroke-opacity: .7; fill: #1a2930; }
#view-handle:is(:hover,:focus-visible) .handle-arrows { stroke-opacity: 1; }
#view-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#view-handle.is-held { cursor: grabbing; }
#view-handle.is-held .handle-halo { stroke: #e6d4ac; stroke-opacity: 1; fill: #22343b; }
.map-tools { display: flex; gap: 6px; }
.map-tools button { height: 36px; min-width: 36px; padding: 0 8px; background: #0c141ae6; }
.sound-control { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; margin-top: 7px; border: 1px solid #62758066; border-radius: 50%; background: #0c141ae6; color: #a2b3bd; }
.sound-control svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.sound-control[aria-pressed=true] { background: #0c141ae6; }
.sound-control .sound-waves { display: none; }
.sound-control[data-state=playing] { color: #dfc79c; border-color: #b6a58080; }
.sound-control[data-state=playing] .sound-waves { display: block; }
.sound-control[data-state=playing] .sound-off { display: none; }
.sound-control:hover { color: #f2ead9; background: #1a2930; }
.map-bottom { position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: calc(var(--footer-height) + 18px); pointer-events: none; }
.motion-controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.motion-controls button { pointer-events: auto; border-color: #6e7b8566; background: #0c141be8; backdrop-filter: blur(12px); padding: 8px 13px; font-size: 12px; min-height: 38px; }
.motion-controls #explore { background: #dfc79c; color: #121a20; border-color: #dfc79c; }
.motion-controls #pause { min-width: 80px; }
.motion-controls span { font-size: 10px; color: var(--muted); }
#progress { display: none; }
#loading { position: absolute; z-index: 8; inset: 0; background: #090e13ed; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 30px; text-align: center; color: var(--muted); backdrop-filter: blur(10px); }
.loading-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; animation: pulse 1.5s infinite; flex: none; }
@keyframes pulse { 50% { opacity: .25; } }
aside { position: absolute; z-index: 5; top: calc(var(--header-height) + 3px); right: var(--gutter); bottom: calc(var(--footer-height) + 12px); width: 326px; max-width: calc(100% - 2 * var(--gutter)); padding: 26px; background: #101a22f5; backdrop-filter: blur(22px); border: 1px solid #43515e88; border-radius: 12px; box-shadow: 0 20px 70px #0006; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #586873 transparent; }
.dialog-close { display: grid; place-items: center; position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; padding: 0; border: 0; font-size: 26px; line-height: 1; }
.inspector-toolbar { position: sticky; z-index: 1; top: -26px; display: flex; align-items: center; justify-content: space-between; margin: -26px -26px 18px; padding: 7px 14px 7px 26px; background: #101a22; border-bottom: 1px solid var(--line); }
.inspector-toolbar .dialog-close { position: static; }
#building-card { padding-top: 2px; }
.place-selected aside { width: 350px; bottom: auto; max-height: calc(100svh - var(--header-height) - var(--footer-height) - 30px); }
.date-label { font: 30px/1.16 Georgia,serif; letter-spacing: -.6px; margin: 17px 0 9px; }
.date-badge { display: inline-flex; gap: 7px; align-items: center; font-size: 11px; line-height: 1.4; padding: 5px 8px; border: 1px solid #526054; border-radius: 4px; color: #c6d3b5; }
.date-badge.provisional { border-color: #70634b; color: #efd1a0; }
.date-badge.approximate { border-color: #69607b; color: #d1c1e3; }
.building-address { font-size: 13px; margin: 12px 0 3px; font-weight: 500; overflow-wrap: anywhere; }
.building-name { font: 28px/1.15 Georgia,serif; letter-spacing: -.4px; margin: 0 0 18px; overflow-wrap: anywhere; scroll-margin-top: 70px; }
.building-story { font-size: 14px; line-height: 1.7; color: #e0ddd4; margin: 18px 0; }
.building-facts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; margin: 13px 0; font-size: 11px; color: #d3d9dc; }
.date-explanation { font-size: 12px; line-height: 1.65; color: var(--muted); margin: 13px 0; }
.source-link { display: inline-block; font-size: 11px; margin: 3px 0; overflow-wrap: anywhere; }
.raw-source { margin-top: 14px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.raw-source summary { cursor: pointer; padding: 4px 0; }
.raw-source p { line-height: 1.6; }
.excluded-note { font-size: 11px; color: #f1c991; }
footer { position: absolute; z-index: 3; inset: auto 0 0; padding: 12px var(--gutter) 14px; background: linear-gradient(transparent,#090e13ed 18%,#090e13); }
.legend-heading { display: flex; align-items: center; }
.legend-heading .text-button { padding: 4px 0 4px 8px; }
.legend-notes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; line-height: 1.4; }
.map-credits { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.map-signature { color: var(--muted); white-space: nowrap; }
.map-signature a { color: inherit; text-decoration: none; }
.map-signature a:hover { color: var(--ink); text-decoration: underline; }
.legend-notes #about { font-size: inherit; padding: 6px 0 6px 8px; }
.timeline-controls input { appearance: none; background: transparent; cursor: pointer; margin: 0; }
.timeline-controls input:disabled { opacity: .4; }
.timeline-controls input::-webkit-slider-thumb { appearance: none; border-radius: 50%; }
dialog { max-width: 600px; width: calc(100% - 32px); max-height: calc(100svh - 40px); overflow: auto; overscroll-behavior: contain; border: 1px solid #57616b; border-radius: 14px; padding: 30px; background: #141e26; color: var(--ink); font-size: 13px; line-height: 1.7; scrollbar-width: thin; scrollbar-color: #586873 transparent; }
dialog::backdrop { background: #000b; backdrop-filter: blur(5px); }
.about-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -30px; background: #141e26; z-index: 1; padding: 12px 0; margin-top: -12px; }
.about-header .dialog-close { position: static; margin-right: -9px; }
dialog h2 { font: 36px/1.15 Georgia,serif; letter-spacing: -.8px; margin: 12px 0 18px; }
dialog p { color: #bdc7ce; }
.about-intro { margin: 0; font-size: 14px; line-height: 1.7; }
.about-author { margin: 30px 0 28px; }
.about-author .eyebrow { display: block; }
.about-author h3 { margin: 6px 0 12px; font: 28px/1.2 Georgia,serif; letter-spacing: -.3px; overflow-wrap: anywhere; }
.author-links { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.author-links a { display: inline-block; padding: 3px 0; font-size: 14px; }
.about-sources { border-top: 1px solid var(--line); padding-top: 20px; }
.about-sources h3 { margin: 0 0 10px; }
.about-sources p { margin: 0; font-size: 12px; line-height: 1.8; }
.about-sources a { color: #d2c5ac; }
.about-sources a:hover { color: var(--accent); }
.about-sources .about-limits { margin-top: 14px; color: var(--muted); }
@media (min-width:1500px) { :root { --gutter: 40px; } aside { width: 340px; } }
@media (max-width:1000px) { :root { --gutter: 22px; } header { gap: 16px; } nav button { padding: 8px 10px; font-size: 11px; } .brand>span { font-size: 8px; } aside { width: 310px; } }
@media (max-width:700px) {
  :root { --gutter: 18px; --header-height: 116px; }
  header { padding: 13px var(--gutter); gap: 10px; flex-wrap: wrap; align-content: flex-start; }
  h1 { font-size: 32px; }
  .brand>span { font-size: 8px; }
  .header-actions { margin-left: auto; }
  .header-actions button { font-size: 11px; min-height: 40px; padding: 7px 11px; }
  #search-toggle { gap: 5px; }
  nav { order: 3; width: 100%; margin: 0; }
  nav button { flex: 1; font-size: 10px; padding: 7px 5px; min-height: 36px; }
  .environment-status { top: calc(var(--header-height) + 52px); max-width: calc(100% - 154px); }
  .environment-status p { font-size: 10px; }
  .view-navigation { top: var(--header-height); right: 10px; width: 120px; gap: 2px; }
  #view-handle { width: 102px; height: 97px; }
  .map-tools { gap: 3px; }
  .map-tools button { min-width: 38px; min-height: 40px; padding: 0 7px; }
  .sound-control { width: 40px; height: 40px; }
  .motion-controls { gap: 5px; }
  .motion-controls button { font-size: 11px; padding: 7px 10px; min-height: 40px; }
  .motion-controls span { display: none; }
  aside { left: 12px; right: 12px; width: auto; max-width: none; padding: 24px; }
  .place-selected aside { width: auto; top: auto; bottom: calc(var(--footer-height) + 12px); max-height: min(330px,calc((100svh - var(--header-height) - var(--footer-height) - 24px) * .6)); }
  .inspector-toolbar { top: -24px; margin: -24px -24px 18px; padding-left: 24px; }
  body.inspector-open .map-bottom { visibility: hidden; }
  dialog { padding: 22px; max-height: calc(100svh - 24px); }
  dialog h2 { font-size: 31px; }
  .about-header { top: -22px; }
  .about-author { margin: 26px 0; }
  .map-credits { gap: 8px; }
}
@media (max-width:380px) {
  #search-toggle span { display: none; }
  #search-toggle { justify-content: center; min-width: 40px; padding-inline: 10px; }
}
@media (max-height:650px) and (min-width:701px) {
  :root { --header-height: 76px; }
  header { padding-top: 12px; padding-bottom: 12px; }
  h1 { font-size: 31px; }
}
@media (max-height:650px) and (max-width:700px) {
  #view-handle { width: 90px; height: 86px; }
}
@media (min-height:551px) and (max-height:650px) and (max-width:700px) {
  .place-selected aside { padding: 16px; }
  .place-selected .inspector-toolbar { top: -16px; margin: -16px -16px 10px; padding: 5px 8px 5px 16px; }
  .place-selected .building-name { font-size: 22px; margin-bottom: 8px; }
  .place-selected .date-label { font-size: 24px; margin: 8px 0; }
}
@media (max-height:550px) {
  .environment-status { left: var(--gutter); }
  .environment-status { top: calc(var(--header-height) + 38px); max-width: calc(100% - 165px); }
  #view-handle { width: 80px; height: 76px; }
  .view-navigation { width: 112px; }
  .sound-control { position: absolute; right: 110px; top: 0; margin: 0; }
  .motion-controls button { min-height: 32px; padding: 5px 9px; }
  aside, .place-selected aside { z-index: 7; top: 10px; bottom: 10px; right: 10px; left: auto; width: min(430px,52vw); max-height: none; padding: 22px; }
  .inspector-toolbar { top: -22px; margin: -22px -22px 18px; padding-left: 22px; }
  .building-name { font-size: 25px; margin-bottom: 12px; }
  .building-story { margin: 13px 0; line-height: 1.65; }
  .date-label { margin-top: 10px; }
  body.inspector-open .view-navigation { visibility: hidden; }
}
.load-failed .loading-dot { animation: none; }
#load-retry { padding: 9px 14px; }
