:root {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: #f7f5ee;
  /* Behind the 3D canvas: dark, so a frame the canvas misses can never flash white. */
  background: #10201e;
  font-synthesis: none;
  --expo-green: #8dc63f;
  --expo-blue: #1d70b8;
  --expo-cream: #f7f5ee;
  --expo-ink: #10201e;
  --expo-panel: rgba(16, 32, 30, 0.91);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
#world,
#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#view {
  outline: none;
  touch-action: none;
  cursor: grab;
}
#view:active {
  cursor: grabbing;
}
button,
select,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
select {
  color: inherit;
  background: none;
  border: 0;
}
button:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--expo-green);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------
   Calm HUD (2026-11-29). The city fills the screen; one places entry
   top-left, help and about top-right, one dock bottom-left, the street
   map bottom-right. Everything else opens on demand as a sheet.
   ------------------------------------------------------------------ */
:root {
  --hud-bg: rgba(14, 26, 24, 0.86);
  --hud-sheet: rgba(14, 26, 24, 0.95);
  --hud-line: rgba(247, 245, 238, 0.14);
  --hud-muted: rgba(247, 245, 238, 0.74);
  --hud-hover: rgba(247, 245, 238, 0.08);
  --hud-gutter: 24px;
  --hud-top: max(var(--hud-gutter), env(safe-area-inset-top));
  --hud-bottom: max(var(--hud-gutter), env(safe-area-inset-bottom));
  --dock-h: 68px;
  --hud-fade: 0.8s;
}
#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  font-size: 16px;
  transition: opacity var(--hud-fade) ease, visibility 0s linear 0s;
}
#hud > * {
  pointer-events: auto;
}
body.hud-hidden #hud,
body.intro-pending #hud,
body.hud-hidden #toast,
body.hud-hidden #debug-panel,
body.hud-hidden #crosshair {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--hud-fade) ease, visibility 0s linear var(--hud-fade);
}
.hud-slab {
  background: var(--hud-bg);
  border: 1px solid var(--hud-line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(5, 12, 10, 0.32);
}
.hud-icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hud-icon .fill {
  fill: currentColor;
  stroke: none;
}

/* Places entry: the logo, where you are, and a way to search. */
#place-entry {
  position: fixed;
  top: var(--hud-top);
  left: var(--hud-gutter);
  width: min(380px, calc(100vw - 2 * var(--hud-gutter) - 116px));
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 12px;
  text-align: left;
  color: var(--expo-cream);
}
#place-entry:hover,
#place-entry[aria-expanded="true"] {
  border-color: rgba(141, 198, 63, 0.55);
}
#place-entry .expo-mark {
  width: 30px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}
#place-entry .expo-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}
.place-entry-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.place-entry-text strong {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-entry-hint {
  font-size: 15px;
  color: var(--hud-muted);
}
#place-entry > .hud-icon {
  color: var(--hud-muted);
}

/* Help and about, small and square, top-right. */
.hud-corner {
  position: fixed;
  top: var(--hud-top);
  right: var(--hud-gutter);
  display: flex;
  gap: 8px;
}
.hud-square {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  background: var(--hud-bg);
  border: 1px solid var(--hud-line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(5, 12, 10, 0.32);
  font-size: 22px;
  font-weight: 600;
  color: var(--expo-cream);
}
#about-model span {
  font: italic 24px Georgia, serif;
  color: var(--expo-green);
}
.hud-square:hover {
  border-color: rgba(141, 198, 63, 0.55);
}

/* The dock. */
#dock {
  position: fixed;
  left: var(--hud-gutter);
  bottom: var(--hud-bottom);
  display: flex;
  gap: 2px;
  padding: 4px;
}
#dock > button {
  position: relative;
  min-width: 76px;
  height: var(--dock-h);
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 9px;
  color: var(--expo-cream);
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
}
@media (hover: hover) {
  #dock > button:hover {
    background: var(--hud-hover);
  }
}
#dock > button[aria-expanded="true"] {
  background: rgba(141, 198, 63, 0.16);
}
#dock > button[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--expo-green);
}
.dock-year {
  height: 24px;
  font-size: 21px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0.02em;
  color: var(--expo-green);
}
#dock .time-sunset,
#dock .time-night,
body[data-light="sunset"] #dock .time-day,
body[data-light="night"] #dock .time-day {
  display: none;
}
body[data-light="sunset"] #dock .time-sunset,
body[data-light="night"] #dock .time-night {
  display: block;
}
#sound-toggle .sound-on,
#sound-toggle.is-on .sound-off {
  display: none;
}
#sound-toggle.is-on .sound-on {
  display: block;
  color: var(--expo-green);
}
#dock > #map-toggle,
body.no-fullscreen #dock > #fullscreen,
#dock > #sound-toggle[hidden] {
  display: none;
}

/* Sheets: open on demand, close on Esc or a tap outside. */
.sheet {
  position: fixed;
  left: var(--hud-gutter);
  bottom: calc(var(--hud-bottom) + var(--dock-h) + 22px);
  width: min(420px, calc(100vw - 2 * var(--hud-gutter)));
  max-height: calc(100dvh - var(--dock-h) - 160px);
  display: flex;
  flex-direction: column;
  background: var(--hud-sheet);
  border: 1px solid var(--hud-line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(5, 12, 10, 0.45);
  color: var(--expo-cream);
  overflow: hidden;
  animation: sheet-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet[hidden] {
  display: none;
}
.sheet-places {
  top: calc(var(--hud-top) + 70px);
  bottom: auto;
  max-height: calc(100dvh - var(--hud-top) - 70px - var(--hud-bottom) - var(--dock-h) - 22px);
}
.sheet-small {
  width: min(360px, calc(100vw - 2 * var(--hud-gutter)));
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 8px 20px;
}
.sheet-title {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}
.sheet-scroll .sheet-title {
  padding: 8px 8px 6px;
}
.sheet-close {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 10px;
  font-size: 28px;
  line-height: 1;
  color: var(--hud-muted);
}
.sheet-close:hover {
  background: var(--hud-hover);
  color: var(--expo-cream);
}
.sheet-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 12px 14px;
}
.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(247, 245, 238, 0.24);
  border-radius: 10px;
  background: rgba(247, 245, 238, 0.06);
  color: var(--hud-muted);
}
.search-field:focus-within {
  border-color: var(--expo-green);
}
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--expo-cream);
  font-size: 17px;
}
.search-field input::placeholder {
  color: var(--hud-muted);
}
.search-field input::-webkit-search-cancel-button {
  filter: invert(1);
}
.sheet-places .sheet-head {
  padding-left: 12px;
}
.place-list {
  display: grid;
  gap: 2px;
}
.choice {
  position: relative;
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px 12px 16px;
  border-radius: 10px;
  text-align: left;
  color: var(--expo-cream);
}
.choice[hidden] {
  display: none;
}
.choice strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}
.choice span {
  font-size: 15px;
  line-height: 1.35;
  color: var(--hud-muted);
}
.choice-plain {
  min-height: 48px;
  padding-block: 10px;
}
.choice-plain strong {
  font-size: 17px;
  font-weight: 500;
}
.choice:focus-visible {
  background: var(--hud-hover);
}
@media (hover: hover) {
  .choice:hover {
    background: var(--hud-hover);
  }
  .choice:hover::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 2px;
    background: var(--expo-green);
  }
}
.choice:focus-visible::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: var(--expo-green);
}
.more-toggle {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 0 16px;
  border-top: 1px solid var(--hud-line);
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  color: var(--expo-green);
}
.more-toggle[hidden] {
  display: none;
}
.place-group h3 {
  margin: 18px 8px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--hud-muted);
}
.place-group[hidden] {
  display: none;
}
.sheet-empty {
  margin: 8px;
  font-size: 16px;
  color: var(--hud-muted);
}
.option-list {
  display: grid;
  gap: 2px;
  padding: 0 12px 14px;
}
.option-list button {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 60px;
  padding: 12px 16px 12px 20px;
  border-radius: 10px;
  text-align: left;
}
.option-list strong {
  font-size: 19px;
  font-weight: 600;
}
.option-list span {
  font-size: 15px;
  color: var(--hud-muted);
}
@media (hover: hover) {
  .option-list button:hover {
    background: var(--hud-hover);
  }
}
.option-list button.active {
  background: rgba(141, 198, 63, 0.14);
}
.option-list button.active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 2px;
  background: var(--expo-green);
}
/* Then and now (pass 2): the 1974 photograph fills the screen over the same view and the
   only chrome left is one compare bar at the bottom. A tap on the view closes it. */
body.comparing #place-entry,
body.comparing .hud-corner,
body.comparing #dock,
body.comparing #map-wrap,
body.comparing #crosshair {
  visibility: hidden;
}
#archive-sheet {
  left: 50%;
  right: auto;
  bottom: var(--hud-bottom);
  width: min(760px, calc(100vw - 2 * var(--hud-gutter)));
  transform: translateX(-50%);
  animation: none;
  background: rgba(14, 26, 24, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#archive-sheet .sheet-head {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0;
}
#archive-sheet .sheet-title {
  display: none;
}
#archive-host {
  padding: 18px 64px 16px 22px;
  overflow: visible;
}
#archive-host .spw-card {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#archive-host .spw-slider-wrap {
  margin: 0 0 12px;
}
#archive-host .spw-range {
  margin: 8px 0 6px;
  height: 10px;
}
#archive-host .spw-range::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
#archive-host .spw-range::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
#archive-host .spw-slider-labels {
  margin: 0;
  font-size: 17px;
  color: var(--hud-muted);
}
#archive-host .spw-nav-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
#archive-host .spw-step {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  font-size: 34px;
  line-height: 1;
  padding: 0 0 4px;
}
#archive-host .spw-photo-meta {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
}
#archive-host .spw-photo-title {
  font-family: inherit;
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 2px;
}
#archive-host .spw-photo-credit {
  font-size: 14px;
  color: var(--hud-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 700px) {
  #archive-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    transform: none;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #archive-host {
    padding: 16px 56px 14px 16px;
  }
  #archive-host .spw-photo-title {
    font-size: 17px;
  }
}

/* Help: big, plain and two columns where there is room. */
#help-dialog {
  max-width: 760px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 32px 36px 28px;
}
#help-dialog h2 {
  margin: 0 0 18px;
  font-size: 34px;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 28px;
}
.help-grid h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
}
#help-dialog dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}
#help-dialog dt {
  font-weight: 600;
  white-space: nowrap;
}
#help-dialog .primary {
  margin-top: 24px;
  min-height: 52px;
  font-size: 17px;
  text-align: center;
  border-radius: 10px;
}
#help-dialog .close,
#detail-dialog .close {
  width: 44px;
  height: 44px;
  font-size: 30px;
}
@media (max-width: 700px) {
  #help-dialog {
    padding: 24px 20px 20px;
  }
  .help-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  #help-dialog dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  #help-dialog dd {
    margin-bottom: 8px;
    color: #45574f;
  }
}

/* Street map: bottom-right on larger screens, a sheet on phones. */
#map-wrap {
  position: fixed;
  right: var(--hud-gutter);
  bottom: var(--hud-bottom);
  width: 300px;
  overflow: hidden;
  background: #e7e1cd;
  color: #294039;
  border: 1px solid rgba(23, 59, 57, 0.2);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(5, 12, 10, 0.32);
}
.map-bar {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}
#map-zoom,
#map-close {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  color: #294039;
  background: rgba(247, 243, 230, 0.92);
  border: 1px solid rgba(41, 64, 57, 0.18);
  box-shadow: 0 2px 6px rgba(23, 49, 45, 0.18);
}
#map-zoom:hover,
#map-close:hover {
  background: #fffdf5;
}
#map-close {
  display: none;
  font-size: 28px;
}
#minimap {
  display: block;
  width: 100%;
  height: 200px;
  cursor: crosshair;
}
.map-hint {
  margin: 0;
  padding: 8px 14px 10px;
  font-size: 14px;
  color: #4a5d55;
}
#map-wrap.expanded {
  width: min(calc(100vw - 2 * var(--hud-gutter)), 720px);
  z-index: 4;
}
#map-wrap.expanded #minimap {
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: calc(100dvh - 200px);
}

/* Where the enlarged map would reach the dock, it sits above it. */
@media (max-width: 1320px) {
  #map-wrap.expanded {
    bottom: calc(var(--hud-bottom) + var(--dock-h) + 22px);
  }
  #map-wrap.expanded #minimap {
    max-height: calc(100dvh - var(--dock-h) - 260px);
  }
}

/* While a tour runs, its banner owns the top of the screen. */
@media (max-width: 1100px) {
  body.touring #place-entry {
    visibility: hidden;
  }
}

/* The arrival. */
#enter {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 52%, rgba(8, 20, 18, 0.5), rgba(8, 20, 18, 0.86)),
    linear-gradient(rgba(8, 20, 18, 0.2), rgba(8, 20, 18, 0.55));
  color: var(--expo-cream);
  text-align: center;
  opacity: 0;
  transition: opacity 0.9s ease;
}
#enter[hidden] {
  display: none;
}
#enter.is-shown {
  opacity: 1;
}
#enter.is-leaving {
  opacity: 0;
  transition-duration: 0.6s;
}
.enter-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  transform: translateY(10px);
  transition: transform 1.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
#enter.is-shown .enter-card {
  transform: none;
}
.enter-mark svg {
  display: block;
  width: clamp(72px, 9vw, 96px);
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}
#enter-title {
  margin: 6px 0 0;
  font-family: "Rockwell", "Clarendon", Georgia, serif;
  font-size: clamp(64px, 11vw, 124px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.enter-dates {
  margin: 0 0 18px;
  font-size: clamp(19px, 2.2vw, 24px);
  color: rgba(247, 245, 238, 0.92);
}
#enter-button {
  min-height: 66px;
  padding: 0 44px;
  border-radius: 12px;
  background: var(--expo-green);
  color: var(--expo-ink);
  font-size: 21px;
  font-weight: 700;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
#enter-button:hover {
  background: #a2d65a;
  transform: translateY(-1px);
}
#enter-button:focus-visible {
  outline: 3px solid var(--expo-cream);
  outline-offset: 4px;
}
.enter-note {
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--hud-muted);
}
/* Shown when the GPU lost its memory twice within two minutes (canvas-release.ts). */
#gpu-memory-card {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
  padding: 24px 16px;
  background: var(--expo-ink);
  color: var(--expo-cream);
  text-align: center;
}
#gpu-memory-text {
  max-width: 30ch;
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.35;
}
#gpu-memory-card button {
  min-height: 60px;
  min-width: 180px;
  padding: 0 36px;
  border-radius: 12px;
  background: var(--expo-green);
  color: var(--expo-ink);
  font-size: 21px;
  font-weight: 700;
}
#gpu-memory-card button:focus-visible {
  outline: 3px solid var(--expo-cream);
  outline-offset: 4px;
}
/* Small things. */
#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 22px;
  font-weight: 200;
  pointer-events: none;
  display: none;
}
body.mouse-look #crosshair {
  display: block;
}
#toast {
  z-index: 1001;
  position: fixed;
  left: 50%;
  top: calc(var(--hud-top) + 6px);
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-line);
  border-radius: 10px;
  font-size: 16px;
  pointer-events: none;
}
#toast:empty {
  display: none;
}
body.touring #toast {
  top: calc(var(--hud-top) + 150px);
}

/* Developer tools: only with ?debug=1. */
#debug-panel {
  position: fixed;
  top: calc(var(--hud-top) + 70px);
  left: var(--hud-gutter);
  z-index: 11;
  display: grid;
  gap: 8px;
  width: 260px;
  padding: 14px;
  background: var(--hud-sheet);
  border: 1px dashed rgba(141, 198, 63, 0.5);
  border-radius: 12px;
  font-size: 14px;
}
#debug-panel[hidden] {
  display: none;
}
#debug-panel .layers {
  display: grid;
  gap: 8px;
}
#debug-panel button {
  text-align: left;
  min-height: 36px;
}
#debug-panel select {
  min-height: 44px;
  border-radius: 6px;
  background: #10201e;
  color: inherit;
  border: 1px solid var(--hud-line);
}
#position {
  margin: 0;
  font-size: 13px;
  color: var(--hud-muted);
  font-variant-numeric: tabular-nums;
}
#legend p {
  margin: 6px 0 0;
}
.inferred {
  color: #e3bf6d;
}
.placeholder {
  color: #d29ebd;
}

/* Tablets in portrait keep the desktop layout with a slightly smaller map. */
@media (max-width: 1100px) {
  :root {
    --hud-gutter: 20px;
  }
  #map-wrap {
    width: 280px;
  }
  #minimap {
    height: 186px;
  }
}

/* Phones. */
@media (max-width: 700px) {
  :root {
    --hud-gutter: 12px;
    --dock-h: 62px;
  }
  #place-entry {
    width: calc(100vw - 2 * var(--hud-gutter) - 118px);
    min-height: 54px;
    padding-right: 12px;
  }
  .place-entry-hint {
    display: none;
  }
  .hud-corner {
    gap: 6px;
  }
  .hud-square {
    width: 48px;
    height: 54px;
  }
  #dock {
    left: var(--hud-gutter);
    right: var(--hud-gutter);
  }
  #dock > button {
    flex: 1;
    min-width: 0;
    padding-inline: 2px;
  }
  #dock > #map-toggle {
    display: flex;
  }
  #dock > #fullscreen {
    display: none;
  }
  #map-wrap {
    display: none;
    left: var(--hud-gutter);
    right: var(--hud-gutter);
    bottom: calc(var(--hud-bottom) + var(--dock-h) + 20px);
    width: auto;
  }
  body.map-open #map-wrap {
    display: block;
  }
  #map-zoom {
    display: none;
  }
  #map-close {
    display: block;
  }
  #minimap {
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .sheet,
  .sheet-places {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-height: 78dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation-name: sheet-up;
  }
  .sheet-places {
    height: 78dvh;
  }
  @keyframes sheet-up {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
  body.touring .hud-corner {
    visibility: hidden;
  }
  #toast {
    top: calc(var(--hud-top) + 66px);
  }
  #debug-panel {
    width: auto;
    right: var(--hud-gutter);
  }
}

@media (prefers-reduced-motion: reduce) {
  #hud,
  #enter,
  .enter-card,
  .sheet {
    transition: none !important;
    animation: none !important;
  }
}

dialog {
  position: fixed;
  border: 1px solid #d8d2be44;
  background: #f0eadb;
  color: #223c38;
  border-radius: 6px;
  max-width: 520px;
  width: calc(100% - 32px);
  padding: 35px;
  box-shadow: 0 30px 100px #0b272266;
}
dialog::backdrop {
  background: #0b27225c;
}
dialog .close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 25px;
}
dialog h2 {
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
  margin: 12px 0 20px;
}
dialog p {
  font-size: 13px;
  line-height: 1.65;
}
dialog .section-label {
  color: #8d683f;
}
dl {
  display: grid;
  grid-template-columns: 44% 56%;
  font-size: 12px;
  line-height: 2.5;
  margin: 24px 0;
}
dt {
  font-weight: 600;
}
dd {
  margin: 0;
}
.note {
  border-top: 1px solid #223c3825;
  padding-top: 15px;
  font-size: 11px !important;
  color: #57685c;
}
.primary {
  background: #284a43;
  color: #f1e5cf;
  padding: 12px 20px;
  border-radius: 3px;
  width: 100%;
  text-align: left;
}
.primary:hover {
  background: #3e6053;
}
#detail-dialog {
  max-width: 800px;
  max-height: 86vh;
  overflow: auto;
}
#detail img {
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  background: #d8d3c5;
}
#detail h2 {
  font-size: 25px;
}
#detail a {
  color: #32554b;
}
#detail .badge {
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid;
  padding: 4px 7px;
  display: inline-block;
}
#detail .metadata {
  font-size: 11px;
  white-space: pre-wrap;
}
#photo-markers {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.photo-pin {
  position: absolute;
  pointer-events: auto;
  border: 2px solid #f3e1b1;
  background: #1c4848e8;
  color: #f2dfba;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
}
body.kodachrome #view,
body.kodachrome[data-light="day"] #view {
  filter: sepia(0.03) saturate(1.03);
}
body.kodachrome[data-light="sunset"] #view {
  filter: sepia(0.03) contrast(1.04) saturate(1.14);
}
body.kodachrome[data-light="night"] #view {
  filter: sepia(0.01) contrast(1.05) saturate(1.10);
}
#diagnostics {
  position: fixed;
  top: 125px;
  right: 24px;
  max-width: 440px;
  max-height: 360px;
  overflow: auto;
  background: #163631f2;
  color: #e5deca;
  font: 10px/1.4 monospace;
  padding: 15px;
  z-index: 5;
  pointer-events: none;
}

.photo-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 11px;
}
.photo-nav button {
  padding: 9px;
  border: 1px solid #29433750;
  border-radius: 3px;
}
.photo-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

#about-model-dialog { max-width:760px; max-height:calc(100dvh - 32px); overflow:auto; overscroll-behavior:contain; padding:34px 38px 24px; }
#about-model-dialog h2 { margin-bottom:12px; font-size:37px; }
#about-model-dialog .about-intro { max-width:58ch; margin-bottom:25px; }
#about-model-dialog section { margin-top:24px; }
#about-model-dialog h3 { font-size:14px; margin:0; font-weight:650; }
#about-model-dialog .about-close { position:sticky; float:right; top:0; margin:-20px -22px 0 0; width:44px; height:44px; border-radius:50%; background:#f0eadb; font-size:27px; color:#223c38; z-index:1; }
.about-section-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding-bottom:12px; border-bottom:1px solid #29403930; }
.about-section-heading > span { font-size:10px; color:#655e4f; text-align:right; }
#about-model-dialog .about-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:16px 0 8px; line-height:1.4; }
.about-stats dt { font-size:11px; color:#58635a; }
.about-stats dd { margin:5px 0 0; font:34px Georgia,serif; color:#213e35; }
#about-model-dialog .about-caption { font-size:11px; line-height:1.55; margin:10px 0 0; color:#586057; }
.about-process { list-style:none; padding:0; margin:14px 0 0; counter-reset:making; }
.about-process li { display:grid; grid-template-columns:26px 90px 1fr; gap:10px; padding:12px 0; border-top:1px solid #29403920; font-size:12px; line-height:1.6; }
.about-process li::before { counter-increment:making; content:counter(making,decimal-leading-zero); color:#916d40; font-size:10px; padding-top:2px; }
.about-uncertainty { border-left:3px solid #b38c56; padding:4px 0 4px 16px; }
#about-model-dialog .about-uncertainty p { font-size:12px; margin:8px 0 0; }
#about-model-dialog .about-footnote { color:#656b60; font-size:10px; margin:24px 0 0; }
@media(max-width:600px) {
  #about-model-dialog { padding:23px 21px; max-height:calc(100dvh - 24px); }
  #about-model-dialog h2 { font-size:29px; }
  #about-model-dialog .about-close { margin:-14px -13px 0 0; }
  .about-section-heading { display:block; }
  .about-section-heading > span { display:block; margin-top:5px; text-align:left; }
  #about-model-dialog .about-stats { gap:7px; }
  .about-stats dt { font-size:10px; min-height:28px; }
  .about-stats dd { font-size:27px; }
  .about-process li { grid-template-columns:22px 1fr; gap:4px 8px; }
  .about-process li span { grid-column:2; }
}

/* Original offline loading poster. Presentation only; readiness remains in main.ts. */
#loading[hidden] { display: none !important; }

#loading { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 100vh; min-height: 100dvh; padding: clamp(1rem, 3vw, 2.5rem); box-sizing: border-box; overflow-x: hidden; overflow-y: auto; background-color: #173b37; color: #efe5cd; font-family: "Optima", "Gill Sans", "Trebuchet MS", sans-serif; font-size: clamp(0.95rem, 1.6vw, 1.125rem); line-height: 1.55; text-align: center; -webkit-font-smoothing: antialiased; }

#loading *, #loading *::before, #loading *::after { box-sizing: border-box; }

#loading .load-poster { width: 100%; max-width: 44rem; margin: auto; display: flex; flex-direction: column; align-items: center; gap: clamp(0.6rem, 1.8vh, 1.15rem); }

#loading .load-header { display: flex; align-items: center; justify-content: center; gap: 0.85rem; width: 100%; max-width: 34rem; }

#loading .load-rule { flex: 1; height: 1px; background-color: #75aaa0; opacity: 0.55; }

#loading .load-kicker { margin: 0; color: #dbac61; font-size: clamp(0.7rem, 1.4vw, 0.82rem); font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; white-space: nowrap; }

#loading .load-emblem { position: relative; width: 100%; max-width: 42.5rem; }

#loading .load-year { position: absolute; top: 10.5%; left: 50%; transform: translateX(-50%); z-index: 2; margin: 0; color: #efe5cd; font-family: "Rockwell", "Clarendon", "Georgia", serif; font-size: clamp(2.1rem, 6.4vw, 3.85rem); font-weight: 700; line-height: 1; letter-spacing: 0.14em; padding-left: 0.14em; text-shadow: 0 2px 0 #173b37, 0 4px 0 rgba(219, 172, 97, 0.32); }

#loading .load-svg { display: block; width: 100%; height: auto; overflow: visible; }

#loading .load-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }

#loading .load-stroke-ochre, #loading .load-pedestal, #loading .load-pavilion-crown { stroke: #dbac61; stroke-width: 1.6; }

#loading .load-stroke-teal, #loading .load-pavilion-net { stroke: #75aaa0; stroke-width: 1.25; }

#loading .load-stroke-cream, #loading .load-clock-face, #loading .load-bridge-arch { stroke: #efe5cd; stroke-width: 1.6; }

#loading .load-sun-outer { stroke: #dbac61; stroke-width: 1.4; stroke-dasharray: 5 7; opacity: 0.75; }

#loading .load-sun-inner, #loading .load-sun-rays { stroke: #dbac61; stroke-width: 1.5; opacity: 0.85; }

#loading .load-svg .load-pine-fill { fill: #173b37; stroke: #75aaa0; stroke-width: 1.4; }

#loading .load-svg .load-tower-body, #loading .load-svg .load-mid-skyline, #loading .load-svg .load-pavilion-fill { fill: #173b37; stroke: #efe5cd; stroke-width: 1.75; }

#loading .load-svg .load-bridge-spandrels { fill: #173b37; stroke: #75aaa0; stroke-width: 1.3; }

#loading .load-svg-city { opacity: 1; transform: translateY(0); animation: load-city-reveal 1.1s cubic-bezier(0.22, 1, 0.36, 1) both; }

#loading .load-falls-crest { stroke: #efe5cd; stroke-width: 1.6; stroke-dasharray: 6 8; animation: load-falls-pulse 2.4s ease-in-out infinite; }

#loading .load-river-flow { stroke: #75aaa0; stroke-width: 2; stroke-dasharray: 28 14; animation: load-river-dash 5.5s linear infinite; }

#loading .load-river-foam { stroke: #dbac61; stroke-width: 1.6; stroke-dasharray: 18 18; animation: load-river-dash 4.2s linear infinite reverse, load-falls-pulse 3.2s ease-in-out infinite; }

#loading .load-river-c { stroke: #efe5cd; opacity: 0.85; }

#loading .load-subtitle { margin: -0.15rem 0 0; color: #efe5cd; font-family: "Georgia", "Iowan Old Style", "Times New Roman", serif; font-style: italic; font-size: clamp(1rem, 2vw, 1.25rem); letter-spacing: 0.08em; }

#loading .load-footer { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; width: 100%; }

#loading .load-status-line { margin: 0; }

#loading #loading-status { display: inline-block; padding: 0.3rem 0.95rem; color: #dbac61; font-size: clamp(1.05rem, 1.8vw, 1.2rem); letter-spacing: 0.02em; }

#loading .load-bar-row { display: flex; align-items: center; gap: 0.9rem; width: min(26rem, 86vw); margin: 10px 0 6px; }

#loading .load-bar-track { flex: 1; height: 10px; background: rgba(117, 170, 160, 0.2); border: 1px solid rgba(117, 170, 160, 0.48); border-radius: 2px; overflow: hidden; }

/* The bar and the rolling number move as compositor animations from the driver in index.html, so they keep moving while the city builds. */
#loading .load-bar-fill { width: 100%; height: 100%; background: linear-gradient(90deg, #75aaa0 0%, #dbac61 100%); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

#loading .load-pct { display: inline-flex; align-items: center; color: #efe5cd; font-size: 1.3rem; font-variant-numeric: tabular-nums; line-height: 1; }
#loading .load-pct-window { display: block; width: 1.9em; height: 1.25em; overflow: hidden; text-align: right; -webkit-mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent); }
#loading .load-pct-strip { display: block; will-change: transform; }
#loading .load-pct-strip > span { display: block; height: 1.25em; line-height: 1.25em; }

#loading[data-phase="error"] .load-bar-row { display: none; }

#loading .load-steps { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }

#loading .load-step { display: inline-flex; align-items: center; gap: 0.42rem; padding: 0.25rem 0.65rem; border: 1px solid rgba(117, 170, 160, 0.4); color: #75aaa0; font-size: clamp(0.72rem, 1.3vw, 0.8rem); letter-spacing: 0.14em; text-transform: uppercase; transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease; }

#loading .load-step::before { content: ""; width: 0.42rem; height: 0.42rem; border: 1.5px solid currentColor; transform: rotate(45deg); }

#loading .load-step-sep { width: clamp(0.75rem, 2.5vw, 1.5rem); height: 1px; background-color: #75aaa0; opacity: 0.45; }

#loading[data-phase="city"] .load-step-city, #loading[data-phase="light"] .load-step-light, #loading[data-phase="view"] .load-step-view { color: #efe5cd; border-color: #dbac61; background-color: rgba(219, 172, 97, 0.14); }

#loading[data-phase="city"] .load-step-city::before, #loading[data-phase="light"] .load-step-light::before, #loading[data-phase="view"] .load-step-view::before { background-color: #dbac61; border-color: #dbac61; }

#loading[data-phase="light"] .load-step-city, #loading[data-phase="view"] .load-step-city, #loading[data-phase="view"] .load-step-light { color: #dbac61; border-color: #75aaa0; }

#loading[data-phase="light"] .load-step-city::before, #loading[data-phase="view"] .load-step-city::before, #loading[data-phase="view"] .load-step-light::before { background-color: #75aaa0; border-color: #75aaa0; }

#loading[data-phase="light"] .load-sun-outer, #loading[data-phase="view"] .load-sun-outer { opacity: 1; }

#loading[hidden] *, #loading[aria-hidden="true"] *, #loading[data-phase="error"], #loading[data-phase="error"] * { animation: none !important; transition: none !important; }

@keyframes load-city-reveal { 0% { opacity: 0.25; transform: translateY(6px); }

  100% { opacity: 1; transform: translateY(0); }
 }

@keyframes load-river-dash { 0% { stroke-dashoffset: 84; }

  100% { stroke-dashoffset: 0; }
 }

@keyframes load-falls-pulse { 0%, 100% { opacity: 0.45; }

  50% { opacity: 0.95; }
 }

@media (prefers-reduced-motion: reduce) { #loading, #loading *, #loading *::before, #loading *::after { animation: none !important; transition: none !important; }

  #loading .load-svg-city, #loading .load-river-flow, #loading .load-river-foam, #loading .load-falls-crest { opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; }
 }

#loading .load-motion { color: #b6ccc1; font: inherit; font-size: 12px; padding: 10px 16px; min-height: 40px; border: 0; background: none; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

#loading .load-motion:hover { color: #efe5cd; }

#loading .load-motion:focus-visible { outline: 2px solid #dbac61; outline-offset: 2px; }

#loading[data-paused="true"] * { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) { #loading .load-motion { display: none; }
 }

@media (max-height: 520px) {
 #loading { padding: 12px; }
 #loading .load-poster { gap: 6px; flex-shrink: 0; }
 #loading .load-emblem { max-width: min(42.5rem, calc((100vh - 185px) * 2)); max-width: min(42.5rem, calc((100dvh - 185px) * 2)); }
 #loading .load-year { font-size: clamp(1.5rem, calc((100vh - 185px) * 0.18), 3.85rem); font-size: clamp(1.5rem, calc((100dvh - 185px) * 0.18), 3.85rem); }
 #loading .load-footer { gap: 4px; }
 #loading .load-subtitle { font-size: 1rem; }
 #loading #loading-status { font-size: 11px; padding: 2px 12px; }
 #loading .load-motion { padding: 6px 12px; min-height: 32px; }
}

/* ------------------------------------------------------------------
   Touch move buttons (touch-move.ts, 2026-11-29). Phones and tablets
   only: Forward above Back, held to glide. Right edge, above the street
   map on tablets and above the dock on phones. Desktop never shows them.
   ------------------------------------------------------------------ */
#touch-move {
  position: fixed;
  right: var(--hud-gutter);
  bottom: calc(var(--hud-bottom) + var(--touch-map-h, 228px) + 16px);
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
}
@media (pointer: coarse) {
  #touch-move {
    display: flex;
  }
}
.touch-move-btn {
  width: 104px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 9px;
  color: var(--expo-cream);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.touch-move-btn {
  position: relative;
}
/* A hairline between Forward and Back, so the slab reads as two buttons at rest. */
.touch-move-btn + .touch-move-btn::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--hud-line);
}
.touch-move-btn .hud-icon {
  width: 34px;
  height: 34px;
  stroke-width: 2.6;
}
.touch-move-btn.is-held {
  background: rgba(141, 198, 63, 0.3);
  color: #fff;
}
.touch-move-btn.is-held .hud-icon {
  color: var(--expo-green);
}
body.touring #touch-move,
body:has(#map-wrap.expanded) #touch-move {
  visibility: hidden;
}
/* Phones: the dock spans the bottom, so the buttons sit just above it. */
@media (max-width: 700px) {
  #touch-move {
    bottom: calc(var(--hud-bottom) + var(--dock-h) + 26px);
  }
  .touch-move-btn {
    width: 96px;
    height: 76px;
  }
  body[data-sheet] #touch-move,
  body.map-open #touch-move {
    visibility: hidden;
  }
}
/* Phones turned sideways: no room above the map, so the left edge, between the
   places entry and the dock. */
@media (min-width: 701px) and (max-height: 560px) {
  #touch-move {
    left: var(--hud-gutter);
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .touch-move-btn {
    width: 96px;
    height: 64px;
  }
}

/* ------------------------------------------------------------------
   Settings (pass 3): a labelled gear top-right opens one sheet under it.
   Big plain choices; the chosen one is filled green. No switches.
   ------------------------------------------------------------------ */
.hud-settings {
  width: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 0 14px;
  font-size: 17px;
  font-weight: 600;
}
.hud-settings .hud-icon {
  width: 26px;
  height: 26px;
}
.hud-settings[aria-expanded="true"] {
  border-color: var(--expo-green);
}
.sheet-settings {
  /* Solid: on phones it sits over the dock, whose labels would show through. */
  background: #0f1d1b;
  top: calc(var(--hud-top) + 62px);
  bottom: auto;
  left: auto;
  right: var(--hud-gutter);
  width: min(460px, calc(100vw - 2 * var(--hud-gutter)));
  max-height: calc(100dvh - var(--hud-top) - 62px - var(--hud-bottom) - var(--dock-h) - 22px);
}
.settings-list {
  display: grid;
  padding: 0 18px 12px 20px;
}
.setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 18px;
  padding: 16px 0;
  border-top: 1px solid var(--hud-line);
}
.setting:first-child {
  border-top: 0;
  padding-top: 4px;
}
.setting-text {
  display: grid;
  gap: 4px;
}
.setting-text strong {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
}
.setting-text span,
.setting-note {
  font-size: 15px;
  line-height: 1.4;
  color: var(--hud-muted);
}
.setting-note {
  margin: 0;
}
.setting-status {
  color: var(--expo-green);
}
.setting-choices {
  display: flex;
  border: 1px solid rgba(247, 245, 238, 0.28);
  border-radius: 10px;
  overflow: hidden;
}
.setting-choices button {
  min-width: 66px;
  min-height: 50px;
  padding: 0 16px;
  font-size: 17px;
  color: var(--expo-cream);
}
.setting-choices button + button {
  border-left: 1px solid rgba(247, 245, 238, 0.2);
}
@media (hover: hover) {
  .setting-choices button:not(.active):not(:disabled):hover {
    background: var(--hud-hover);
  }
}
.setting-choices button.active {
  background: var(--expo-green);
  color: var(--expo-ink);
  font-weight: 700;
}
.setting-choices button:disabled {
  color: rgba(247, 245, 238, 0.32);
  cursor: not-allowed;
}
.setting-wide {
  grid-template-columns: minmax(0, 1fr);
}
.setting-wide .setting-choices button {
  flex: 1;
}
.sheet-settings.is-applying .setting-choices button {
  cursor: progress;
}
.setting-choices button.is-pending {
  background: rgba(141, 198, 63, 0.35);
}
.settings-about {
  margin: 4px -14px 0;
  width: calc(100% + 28px);
}
.settings-about::after {
  content: "\203A";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-52%);
  font-size: 26px;
  color: var(--hud-muted);
}

#year-sheet .era-compare-open {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--hud-line);
  border-radius: 10px;
  color: var(--expo-cream);
  background: var(--hud-hover);
  font-weight: 650;
}
#era-compare {
  box-sizing: border-box;
  width: min(1080px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: clamp(12px, 2vw, 24px);
  overflow: auto;
  border: 1px solid #50605a;
  border-radius: 16px;
  background: #10201e;
  color: var(--expo-cream);
  color-scheme: dark;
}
#era-compare::backdrop { background: rgba(8, 16, 15, 0.77); }
.era-compare-header, .era-compare-controls, #era-compare-footer, .era-compare-ends {
  display: flex;
  align-items: center;
  gap: 12px;
}
.era-compare-header, #era-compare-footer { justify-content: space-between; }
.era-compare-header h2 { margin: 0; font-size: clamp(18px, 3vw, 26px); line-height: 1.18; }
.era-compare-controls { margin: 12px 0; }
#era-compare button, #era-compare select {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #74847d;
  border-radius: 8px;
  background: #203430;
  color: var(--expo-cream);
  font: inherit;
  touch-action: manipulation;
}
#era-compare-place { min-width: 0; max-width: 100%; }
#era-compare #era-compare-done { background: var(--expo-green); border-color: var(--expo-green); color: var(--expo-ink); font-weight: 700; }
.era-compare-frame {
  position: relative;
  width: min(100%, max(290px, calc((100dvh - 208px) * 1.6)));
  aspect-ratio: 8 / 5;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 9px;
  background: #172c29;
}
#era-compare-stage, #era-compare-images, #era-compare-images img, .era-compare-feedback { position: absolute; inset: 0; }
#era-compare-stage { --split: 50%; isolation: isolate; cursor: ew-resize; touch-action: pan-y; }
#era-compare-stage:focus-within { outline: 3px solid var(--expo-green); outline-offset: -3px; }
#era-compare-images img { display: block; width: 100%; height: 100%; pointer-events: none; }
#era-compare-images img + img { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.era-compare-years {
  position: absolute;
  inset: 10px 10px auto;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.era-compare-years span { background: #10201e; color: white; padding: 4px 9px; border-radius: 5px; font-weight: 700; }
.era-compare-divider {
  position: absolute;
  inset: 0 auto 0 var(--split);
  width: 3px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 1px #10201e;
  pointer-events: none;
}
.era-compare-grip {
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  left: clamp(22px, var(--split), calc(100% - 22px));
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid #10201e;
  border-radius: 50%;
  background: #fff;
  color: #10201e;
  font-size: 26px;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}
#era-compare-slider { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.era-compare-feedback { display: grid; place-content: center; justify-items: center; padding: 12px; text-align: center; pointer-events: none; }
.era-compare-feedback button { pointer-events: auto; }
#era-compare-status { margin: 0 0 8px; }
#era-compare-status:empty { margin: 0; }
#era-compare-footer { margin-top: 12px; flex-wrap: wrap; }
#era-compare-footer[hidden] { display: none; }
#era-compare-instructions { margin: 0; }
.era-compare-ends { gap: 8px; }
#era-compare .era-compare-ends button[aria-pressed="true"] { border-color: var(--expo-green); color: var(--expo-green); }

@media (min-width: 701px) {
  body.map-off #map-wrap {
    display: none;
  }
}
@media (max-width: 700px) {
  .hud-settings {
    width: 54px;
    padding: 0;
    justify-content: center;
  }
  .hud-settings span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .sheet-settings {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-height: 86dvh;
  }
  /* Phones open the map from the dock; the corner map does not exist there. */
  .setting-map {
    display: none;
  }
  .setting {
    padding: 14px 0;
  }
}

/* ------------------------------------------------------------------
   On-demand Era Switch Loading Overlay (1971 & Today lazy load)
   Softly dims and desaturates the active scene while fetching,
   building, and compiling shaders for the selected era.
   ------------------------------------------------------------------ */
#era-loading {
  position: fixed;
  inset: 0;
  z-index: 920;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 18, 17, 0.56);
  backdrop-filter: blur(4px) saturate(0.45);
  -webkit-backdrop-filter: blur(4px) saturate(0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
#era-loading.is-visible {
  opacity: 1;
  pointer-events: auto;
}
#era-loading[hidden] {
  display: none;
}
.era-loading-card {
  width: min(400px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--hud-sheet);
  border: 1px solid var(--hud-line);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(4, 10, 9, 0.52);
  color: var(--expo-cream);
}
.era-loading-ring {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  border: 3px solid rgba(247, 245, 238, 0.16);
  border-top-color: var(--expo-green);
  border-right-color: rgba(141, 198, 63, 0.45);
  animation: era-spin 0.85s linear infinite;
}
.era-loading-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.era-loading-copy strong {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
  color: var(--expo-cream);
}
.era-loading-copy span {
  font-size: 14px;
  line-height: 1.35;
  color: var(--hud-muted);
}
.era-loading-cancel {
  flex: none;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--hud-line);
  border-radius: 8px;
  background: var(--hud-hover);
  color: var(--expo-cream);
  font-size: 14px;
  font-weight: 600;
}
.era-loading-cancel:hover {
  border-color: rgba(141, 198, 63, 0.55);
  background: rgba(247, 245, 238, 0.14);
}
@keyframes era-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .era-loading-ring {
    animation: era-pulse 1.4s ease-in-out infinite;
    border-color: var(--expo-green);
  }
  @keyframes era-pulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
  }
}
.stream-cue {
  position: fixed;
  left: 18px;
  bottom: 84px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: rgba(247, 245, 238, 0.88);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(10, 14, 12, 0.85);
  pointer-events: none;
  user-select: none;
  transition: opacity 0.25s ease;
}
.stream-cue[hidden] {
  display: none;
}
.stream-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--expo-green);
  flex: none;
  animation: stream-dot-pulse 1.5s ease-in-out infinite;
}
@keyframes stream-dot-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .stream-dot {
    animation: none;
  }
}
