:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #e8edf2;
  background: #0c1014;
  --ink: #e8edf2;
  --muted: #a3adb8;
  --line: #323b45;
  --panel: #131a22;
  --focus: #91c9e4;
  --header: 52px;
  --ease-out: cubic-bezier(.23,1,.32,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; transition: background-color 140ms ease, color 140ms ease; }
button:disabled { cursor: default; color: #626e7a; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p, figure { margin: 0; }
h1 { font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -.5px; }
h2 { font-size: 17px; font-weight: 500; line-height: 1.4; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 20; padding: 10px; color: var(--ink); background: var(--panel); }
.skip-link:focus { top: 8px; }
.app-header { height: var(--header); display: flex; align-items: center; padding: 0 24px; gap: 24px; background: #0c1014; position: relative; z-index: 8; border-bottom: 1px solid var(--line); }
.identity { display: flex; gap: 14px; align-items: center; font-size: 13px; font-weight: 500; white-space: nowrap; }
.identity-section { font-weight: 400; color: var(--muted); }
.round-counter { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.header-actions { display: flex; align-items: center; margin-left: auto; gap: 24px; height: 100%; }
.view-switch { display: flex; gap: 2px; }
.view-switch button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 12px; }
.view-switch button[aria-pressed=true] { background: #202a34; color: var(--ink); }
.view-switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.mode-switch { display: flex; gap: 24px; align-self: stretch; }
.mode-switch button { position: relative; border: 0; background: none; color: var(--muted); padding: 0 2px; min-width: 44px; min-height: 44px; font-size: 13px; }
.mode-switch button[aria-pressed=true] { color: var(--ink); }
.mode-switch button[aria-pressed=true]::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--focus); }
.experience { position: relative; width: 100%; height: calc(100dvh - var(--header)); }
.composition, .photograph { position: absolute; inset: 0; }
.photo-viewport { position: absolute; inset: 0; overflow: hidden; background: #080b0f; touch-action: none; cursor: grab; user-select: none; }
.photo-viewport.is-dragging { cursor: grabbing; }
.photo-viewport:focus-visible { outline-offset: -4px; }
.photo-viewport img { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; user-select: none; transform-origin: 0 0; will-change: transform; }
.image-index { display: none !important; position: absolute; z-index: 2; top: 20px; left: 24px; display: flex; gap: 12px; align-items: center; padding: 7px 10px; background: #10161ee8; border-left: 2px solid var(--focus); font-size: 11px; pointer-events: none; }
.image-index span:first-child { color: var(--muted); }
#image-id { font-variant-numeric: tabular-nums; letter-spacing: .6px; }
.viewer-toolbar { position: absolute; z-index: 5; bottom: max(20px, env(safe-area-inset-bottom)); left: 24px; display: flex; align-items: center; gap: 16px; width: max-content; max-width: calc(100% - 48px); padding: 5px 6px; background: #10161e; border: 1px solid var(--line); border-radius: 3px; }
.photo-toolbar, .desktop-photo-tools, .actions { display: flex; align-items: center; gap: 2px; }
.photo-toolbar { position: relative; }
.actions { border-left: 1px solid var(--line); padding-left: 12px; }
.toolbar-button, .icon-button, .primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border-radius: 2px; font-size: 12px; line-height: 1.4; border: 0; white-space: nowrap; }
.toolbar-button { padding: 0 10px; background: transparent; color: var(--ink); }
.toolbar-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 44px; padding: 0; background: transparent; color: var(--ink); font-size: 20px; flex-shrink: 0; }
.primary-button { padding: 0 20px; min-width: 80px; background: #bad6e4; color: #101820; font-weight: 600; }
.primary-button:disabled { background: #252e38; color: #a3adb8; }
.secondary-button { padding: 0 12px; border: 1px solid #536170; background: #1d2732; color: var(--ink); }
.toolbar-button[aria-expanded=true] { color: #b2d9ed; background: #202e3b; }
output { font-size: 12px; color: var(--muted); min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.floating-panel { position: absolute; z-index: 4; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; margin: 0 0 10px; }
.panel-heading .icon-button { font-size: 14px; color: var(--muted); }
.eyebrow { display: block; margin-bottom: 3px; font-size: 10px; line-height: 1.5; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
.photo-tools { left: -7px; bottom: calc(100% + 12px); padding: 16px; width: 236px; z-index: 7; }
.tools-heading { font-size: 12px; font-weight: 500; text-align: center; }
.pan-pad { display: grid; grid-template-columns: repeat(3,44px); grid-template-rows: repeat(3,44px); gap: 4px; justify-content: center; margin: 12px 0; }
.pan-up { grid-column: 2; grid-row: 1; }
.pan-left { grid-column: 1; grid-row: 2; }
.pan-center { grid-column: 2; grid-row: 2; }
.pan-right { grid-column: 3; grid-row: 2; }
.pan-down { grid-column: 2; grid-row: 3; }
.pan-pad .icon-button { background: #202b36; }
.tools-zoom { display: flex; align-items: center; justify-content: center; border-top: 1px solid var(--line); padding-top: 8px; }
.tools-zoom .toolbar-button { padding: 0 10px; }
.photo-story { bottom: 92px; left: 24px; width: 430px; max-width: calc(100% - 48px); padding: 16px 20px 20px; max-height: calc(100% - 160px); overflow: auto; }
.location-detail { font-size: 12px; color: var(--muted); line-height: 1.6; }
.photo-caption { margin-top: 12px; font-size: 14px; line-height: 1.65; color: #d5dde5; }
.map-panel { display: flex; flex-direction: column; position: absolute; z-index: 4; right: 24px; bottom: 20px; width: 300px; max-width: calc(100% - 48px); max-height: calc(100% - 40px); overflow: hidden; overscroll-behavior: contain; padding: 0; background: #101720; border: 0; border-radius: 3px; box-shadow: 0 8px 28px #0005; }
.map-heading { position: absolute; z-index: 3; top: 8px; left: 12px; right: 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.map-heading h2 { margin-top: 0; padding: 5px 8px; background: #101720e8; font-size: 12px; font-weight: 500; }
.map-heading .icon-button { width: 44px; min-height: 44px; background: #101720e8; font-size: 14px; pointer-events: auto; }
.map-surface { height: 184px; min-height: 100px; flex-shrink: 1; position: relative; overflow: hidden; background: #101720; border: 0; }
.map-footer { flex-shrink: 0; max-height: 50%; overflow: auto; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 8px; align-items: center; padding: 4px 12px; background: #131a22; }
.map-footer > .result, .map-footer > .map-status { grid-column: 1 / -1; }
.map-footer > .result { padding: 0 0 8px; }
.map-surface svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.ocean { fill: #101720; }
.grid-line { fill: none; stroke: #293847; stroke-width: .6; vector-effect: non-scaling-stroke; }
.country { fill: #344454; stroke: #17212b; stroke-width: .7; vector-effect: non-scaling-stroke; }
.map-labels { fill: #a5b5c4; text-anchor: middle; pointer-events: none; }
.map-zoom { position: absolute; bottom: 28px; top: auto; right: 8px; display: flex; flex-direction: row; border: 1px solid #465565; border-radius: 2px; overflow: hidden; }
.map-zoom button { width: 44px; height: 44px; border: 0; border-right: 1px solid var(--line); background: #17212c; color: var(--ink); font-size: 19px; }
.map-zoom button:last-child { border: 0; font-size: 17px; }
.map-credit { position: absolute; bottom: 6px; left: 8px; font-size: 10px; color: var(--muted); pointer-events: none; background: #101720c9; }
.map-pan-tools { display: flex; align-items: center; gap: 4px; padding-top: 8px; }
.map-pan-tools span { font-size: 12px; color: var(--muted); margin-right: auto; }
.map-pan-tools button { width: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 2px; background: transparent; color: var(--ink); font-size: 18px; }
.map-readout { font-size: 11px; color: var(--muted); min-width: 0; }
#coordinates { color: #bbd8e7; font-variant-numeric: tabular-nums; }
.coordinate-entry { margin-top: 0; font-size: 12px; color: var(--muted); }
.coordinate-entry[open] { grid-column: 1 / -1; }
.coordinate-entry summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; list-style: none; width: max-content; }
.coordinate-entry summary::-webkit-details-marker { display: none; }
.coordinate-entry form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 8px 0; }
.coordinate-entry label { flex: 1; min-width: 110px; }
.coordinate-entry input { display: block; width: 100%; min-height: 44px; background: #0c131a; color: var(--ink); font-size: 16px; border: 1px solid #536170; border-radius: 2px; padding: 8px; margin-top: 6px; }
.result { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-top: 12px; }
.distance { font-size: 22px; color: var(--ink); font-weight: 500; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.guess-ring { fill: #101720; stroke: #edc587; }
.guess-core { fill: #edc587; }
.actual-ring { fill: #a3d9f1; stroke: #101720; }
.map-connection { fill: none; stroke: #edc587; stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.pin-text { fill: #e8edf2; font-weight: 500; paint-order: stroke; stroke: #101720; stroke-linejoin: round; text-anchor: middle; }
@media (min-width: 801px) and (max-width: 1100px) {
  .viewer-toolbar { gap: 8px; }
  .map-panel { width: 280px; right: 20px; bottom: 20px; }
  .photo-story { width: 390px; }
  .desktop-photo-tools .icon-button { width: 36px; }
  .actions { padding-left: 6px; }
}


@media (max-height: 540px) {
  .photo-tools { padding: 8px; }
  .pan-pad { grid-template-rows: repeat(3,36px); grid-template-columns: repeat(3,40px); margin: 4px 0; }
  .pan-pad button { min-height: 36px; height: 36px; width: 40px; }
  .map-panel { max-height: calc(100% - 90px); }
  .photo-story { max-height: calc(100% - 160px); width: 34%; }
}
@media (hover: hover) {
  .toolbar-button:hover, .icon-button:hover, .map-pan-tools button:hover, .map-zoom button:hover { background: #293845; color: #f3f7fa; }
  .primary-button:hover:not(:disabled) { background: #d7e8f0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* Daily challenge and released field notes. */
#detailed-map { position: absolute; inset: 0; }
#world-map { position: relative; }
.map-zoom { z-index: 2; }
.map-window-tools { display: flex; pointer-events: auto; margin-top: -4px; }
.map-action { flex-shrink: 0; padding: 0 8px 8px; background: #131a22; }
.map-action .primary-button { width: 100%; min-height: 44px; border-radius: 4px; }
.map-launcher { position: absolute; z-index: 5; right: 24px; bottom: max(20px,env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border: 0; border-radius: 6px; background: #131a22; color: var(--ink); font-size: 13px; box-shadow: 0 4px 20px #0003; }
.map-launcher svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; }
button:active:not(:disabled) { transform: scale(.97); }
@media (min-width:801px) {
  body[data-layout=pip][data-map-expanded=true] .map-panel { width: min(560px,48vw); }
  body[data-layout=pip][data-map-expanded=true] .map-surface { height: min(50dvh,440px); }
  body[data-layout=split] #expand-map { display: none; }
}
.map-status { color: var(--muted); font-size: 11px; padding-top: 8px; }
.maplibregl-ctrl-attrib { font: 9px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background: #101720e8 !important; color: #c0c9d3; }
.maplibregl-ctrl-attrib a { color: #c0c9d3; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.location-marker { width: 12px; height: 12px; border: 2px solid #101720; border-radius: 50%; background: #a3d9f1; }
.location-marker.guess { background: #edc587; }
.location-marker span { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 1.3; white-space: nowrap; color: #e8edf2; text-shadow: 0 1px 3px #000,0 0 3px #000; }
.location-note { color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.app-status { position: absolute; z-index: 10; top: 12px; left: 24px; right: 24px; margin: auto; width: max-content; max-width: calc(100% - 48px); background: #25202a; border: 1px solid #7a6676; padding: 10px 14px; font-size: 13px; }
.launch-panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 440px; max-width: calc(100% - 48px); }
.launch-panel h2 { font-size: 42px; line-height: 1.2; letter-spacing: -1px; margin: 16px 0 24px; }
.launch-panel p { color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 330px; }
.history-panel { z-index: 9; top: 24px; right: 24px; width: 600px; max-width: calc(100% - 48px); max-height: calc(100% - 48px); overflow: auto; padding: 20px; }
#history-copy { font-size: 12px; color: var(--muted); padding-bottom: 16px; }
.history-photos { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.history-photos button { padding: 0; border: 1px solid var(--line); background: #101720; text-align: left; color: var(--ink); }
.history-photos img { display: block; width: 100%; aspect-ratio: 1.6; object-fit: cover; }
.history-photos span { display: block; padding: 10px 12px; }
.history-photos small { display: block; font-size: 11px; color: var(--muted); }
.history-photos strong { font-size: 13px; font-weight: 500; }
.just-revealed { animation: reveal-result 280ms cubic-bezier(.2,.8,.2,1); }
@keyframes reveal-result { from {opacity: 0;transform:translateY(6px);} to {opacity: 1;transform:translateY(0);} }


.caption-actions { display: flex; gap: 0; align-items: center; }
.photo-story .panel-heading > div:first-child { min-width: 0; }

.identity a { color: inherit; text-decoration: none; }
body[data-stage=loading] .composition { visibility: hidden; }

/* A map is a surface, not a card inside a card. The layout switch is immediate. */
@media (min-width:801px) {
body[data-layout=split][data-map-visible=true] .composition { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,38%); }
body[data-layout=split][data-map-visible=true] .photograph { position: relative; inset: auto; min-width: 0; min-height: 0; }
body[data-layout=split][data-map-visible=true] .map-panel { position: relative; inset: auto; display: flex; flex-direction: column; width: auto; max-width: none; max-height: none; min-height: 0; border-radius: 0; box-shadow: none; border-left: 1px solid #29323b; overflow: hidden; }
body[data-layout=split][data-map-visible=true] .map-surface { flex: 1; height: auto; min-height: 100px; }
body[data-layout=split] .map-footer { flex-shrink: 0; max-height: 60%; overflow: auto; }
body[data-layout=split] .map-heading { position: absolute; }
body[data-layout=split] .photo-story { max-width: calc(100% - 48px); }
}
@media (max-width:1100px) {
  .identity-section { display: none; }
  .header-actions { gap: 16px; }
  body[data-layout=split] .desktop-photo-tools { display: none; }

}



@media (hover:hover) {
  .view-switch button:hover { background: #293845; color: var(--ink); }
}
.view-switch button:active { transform: scale(.97); }


.mobile-identity, .mobile-fit { display: none; }
.photo-score { display: block; margin: 4px 0 8px; color: #bfdcea; font-size: 14px; font-variant-numeric: tabular-nums; }
.preview-menu { position: relative; color: var(--muted); font-size: 11px; }
.preview-menu > summary { display: flex; min-height: 44px; align-items: center; padding: 0 8px; cursor: pointer; list-style: none; }
.preview-menu > summary::-webkit-details-marker { display: none; }
.preview-menu[open] > summary { color: var(--ink); }
.preview-options { position: absolute; z-index: 12; top: calc(100% + 4px); right: 0; width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; box-shadow: 0 8px 24px #0005; }
.preview-options p { font-size: 12px; line-height: 1.5; }
.preview-options button { display: block; width: 100%; min-height: 44px; margin-top: 8px; border: 0; border-radius: 4px; background: #27343f; color: var(--ink); font-size: 13px; }
@media (min-width:801px) {
  body[data-layout=split][data-map-visible=true] .viewer-toolbar { max-width: calc(100% - max(38%,320px) - 48px); }
}
@media (max-width:1100px) and (min-width:801px) {
  .app-header { gap: 12px; }
  .header-actions { gap: 12px; }
  .round-counter { left: 33%; }
}
/* The phone map is a sheet on the photograph, with its action attached. */
@media (max-width:800px) {
  :root { --header: calc(52px + env(safe-area-inset-top,0px)); }
  .app-header { padding: env(safe-area-inset-top,0px) max(16px,env(safe-area-inset-right,0px)) 0 max(16px,env(safe-area-inset-left,0px)); gap: 8px; border-bottom-color: #242d36; }
  .identity, .round-counter, .view-switch, .image-index { display: none !important; }
  .mobile-identity { display: flex; flex-direction: column; min-width: 0; }
  .mobile-identity a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
  #mobile-day { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
  .header-actions { gap: 8px; height: 100%; }
  .mode-switch { gap: 0; }
  .mode-switch button { min-width: 48px; padding: 0 2px; font-size: 12px; }
  #today-button { display: none; }
  body[data-mode=history] #today-button { display: block; }
  body[data-mode=history] #history-button { display: none; }
  .preview-menu > summary { padding: 0 6px; font-size: 10px; }
  .preview-options { right: -56px; }
  .composition { display: block; }
  .photograph { inset: 0; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
  .photo-viewport { position: relative; flex: 1; min-height: 0; }
  .photo-story { position: relative; inset: auto; z-index: 1; flex-shrink: 0; width: 100%; max-width: none; max-height: 60%; padding: 16px 20px calc(82px + env(safe-area-inset-bottom,0px)); border: 0; border-top: 1px solid #29323b; border-radius: 0; background: #10161d; }
  .photo-story .panel-heading { min-height: 36px; gap: 8px; margin-bottom: 4px; }
  .photo-story .eyebrow { display: none; }
  .photo-story h2 { font-size: 22px; font-weight: 500; letter-spacing: -.3px; }
  .photo-story .panel-heading .icon-button { min-height: 44px; width: 44px; }
  .location-detail { font-size: 12px; }
  .photo-caption { margin-top: 12px; font-size: 15px; line-height: 1.6; }
  .location-note { font-size: 11px; }
  .viewer-toolbar { left: max(16px,env(safe-area-inset-left,0px)); right: auto; bottom: max(16px,env(safe-area-inset-bottom)); width: auto; max-width: none; min-height: 48px; gap: 0; padding: 0; background: #10161ef5; border: 0; border-radius: 6px; }
  .photo-toolbar { gap: 0; }
  .desktop-photo-tools { display: none; }
  #pan-toggle, .mobile-fit, #caption-toggle { min-width: 44px; width: 44px; padding: 0; min-height: 48px; background: none; color: var(--ink); font-size: 12px; }
  #pan-toggle span { display: none; }
  #pan-toggle svg { width: 19px; height: 19px; }
  .mobile-fit { display: inline-flex; }
  .actions { border: 0; padding: 0; gap: 0; }
  .map-launcher { right: max(16px,env(safe-area-inset-right,0px)); bottom: max(16px,env(safe-area-inset-bottom)); min-height: 48px; padding: 0 12px; gap: 8px; font-size: 12px; }
  .map-launcher svg { width: 18px; height: 18px; }
  .pan-pad { grid-template-columns: repeat(3,44px); grid-template-rows: repeat(3,44px); }
  .pan-pad .icon-button { min-height: 44px; height: 44px; width: 44px; }
  .photo-tools { left: 0; bottom: calc(100% + 12px); max-height: calc(100dvh - var(--header) - 100px); overflow: auto; border-radius: 8px; padding: 12px; width: 224px; }
  .map-panel { position: absolute; inset: auto 0 0; display: flex; flex-direction: column; width: 100%; max-width: none; height: min(72%,620px); max-height: calc(100% - 12px); min-height: 0; overflow: hidden; border: 0; border-radius: 12px 12px 0 0; box-shadow: 0 -8px 32px #0004; }
  body[data-map-expanded=true] .map-panel { height: calc(100% - 12px); }
  .map-heading { position: relative; top: auto; left: auto; right: auto; flex-shrink: 0; align-items: center; height: 52px; padding: 4px 8px 4px 20px; background: #131a22; }
  .map-heading h2 { font-size: 13px; font-weight: 500; padding: 0; margin: 0; background: none; }
  .map-window-tools { margin: 0; }
  .map-heading .icon-button { width: 44px; min-height: 44px; background: transparent; }
  .map-heading #expand-map { font-size: 22px; }
  .map-surface { flex: 1; height: auto; min-height: 80px; }
  .map-footer { flex-shrink: 0; max-height: calc(100% - 200px); overflow: auto; padding: 0 16px; background: #131a22; }
  .map-readout { font-size: 11px; }
  .coordinate-entry { font-size: 12px; }
  .coordinate-entry summary { font-size: 11px; }
  .map-pan-tools button { min-height: 44px; width: 44px; }
  .map-zoom { right: 10px; bottom: 28px; flex-direction: row; border-color: #3d4a57; border-radius: 6px; }
  .map-zoom button { width: 44px; height: 44px; border-bottom: 0; border-right: 1px solid var(--line); }
  .map-zoom button:last-child { border: 0; }
  .map-action { padding: 0 16px calc(16px + env(safe-area-inset-bottom,0px)); }
  .map-action .primary-button { min-height: 48px; font-size: 14px; border-radius: 6px; }
  .map-credit { font-size: 10px; }
  .result { font-size: 12px; gap: 8px; }
  .distance { font-size: 22px; }
  body[data-mobile-pane=map] .viewer-toolbar { display: none; }
  .history-panel { position: absolute; inset: 0; width: 100%; max-width: none; max-height: none; padding: 16px 20px; border: 0; border-radius: 0; }
  .history-panel .panel-heading h2 { font-size: 22px; }
  .history-photos { gap: 16px 12px; }
  .history-photos button { border: 0; background: none; }
  .history-photos img { border-radius: 4px; }
  .history-photos span { padding: 8px 0; }
  .history-photos strong { line-height: 1.4; }
  .app-status { top: 12px; left: 12px; right: 12px; max-width: calc(100% - 24px); }
  .launch-panel h2 { font-size: 36px; }
  body[data-input=pointer] .map-panel { transition: transform 220ms var(--ease-out),opacity 220ms var(--ease-out); }
  @starting-style { body[data-input=pointer] .map-panel { transform: translateY(24px); opacity: .4; } }
}
@media (max-width:360px) {
  .app-header { padding-left: 12px; padding-right: 12px; }
  .viewer-toolbar { left: 12px; }
  .map-launcher { right: 12px; gap: 6px; font-size: 11px; }
  .photo-story, .history-panel { padding-left: 16px; padding-right: 16px; }
  .map-heading { padding-left: 16px; }
}
@media (max-width:800px) and (max-height:540px) {
  .map-panel { height: calc(100% - 12px); }
  .map-heading { height: 44px; padding-top: 0; padding-bottom: 0; }
  .map-action { padding-bottom: max(8px,env(safe-area-inset-bottom)); }
  .map-action .primary-button { min-height: 44px; }
  .coordinate-entry[open] { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 0 16px; align-items: center; }
  .coordinate-entry .map-pan-tools { padding: 0; }
  .coordinate-entry form { grid-column: 1 / -1; }
}

/* A photograph with its label, not an answer card. */
.browse-result { position: absolute; z-index: 5; right: 24px; bottom: 20px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 500; }
.browse-result span { margin-left: 12px; }
body[data-stage=reveal] .composition { display: block !important; }
body[data-stage=reveal] .photograph { position: absolute !important; inset: 16px 24px 92px !important; display: flex; flex-direction: column; gap: 12px; }
body[data-stage=reveal] .photo-viewport { position: relative; flex: 1; min-height: 0; background: transparent; border: 1px solid #e8edf230; }
body[data-stage=reveal] .photo-story { position: relative; inset: auto; width: 100%; max-width: none; max-height: 40%; flex-shrink: 0; padding: 0; border: 0; background: transparent; overflow: auto; }
body[data-stage=reveal] .photo-story .panel-heading { margin: 0; min-height: 0; }
body[data-stage=reveal] .photo-story h2 { font-size: 18px; line-height: 1.5; font-weight: 500; letter-spacing: -.2px; }
body[data-stage=reveal] .caption-actions, body[data-stage=reveal] .photo-story .eyebrow { display: none; }
body[data-stage=reveal] .photo-score { display: flex; align-items: flex-start; line-height: 1.5; border: 0; padding: 0; margin: 2px 0 0; min-height: 44px; background: transparent; color: var(--muted); font-size: 12px; text-align: left; text-decoration: underline dotted #a3adb870; text-underline-offset: 4px; }
body[data-stage=reveal] .photo-caption { max-width: 52ch; font-size: 14px; margin-top: 8px; }
body[data-stage=reveal] .location-detail { margin-top: 8px; font-size: 12px; }
body[data-stage=reveal] .location-note { border: 0; margin: 8px 0 0; padding: 0; max-width: 60ch; }
body[data-stage=reveal] .viewer-toolbar { border: 0; background: transparent; padding: 0; bottom: 20px; gap: 12px; }
body[data-stage=reveal] .viewer-toolbar .desktop-photo-tools, body[data-stage=reveal] .mobile-fit { display: none; }
body[data-stage=reveal] #pan-toggle svg { display: none; }
body[data-stage=reveal] #pan-toggle span { display: inline; }
body[data-stage=reveal] .actions { border: 0; padding: 0; }
body[data-stage=reveal] #pan-toggle, body[data-stage=reveal] #caption-toggle { min-width: 44px; width: auto; padding: 0; background: transparent; color: var(--muted); font-size: 12px; }
body[data-stage=reveal] .photo-tools { left: 0; }
body[data-stage=reveal] .map-panel { position: absolute !important; right: 24px; bottom: 20px; width: 352px; }
@media(max-width:800px) {
  body[data-stage=reveal] .photograph { inset: 8px 12px calc(72px + env(safe-area-inset-bottom,0px)) !important; gap: 10px; }
  body[data-stage=reveal] .photo-story h2 { font-size: 17px; }
  body[data-stage=reveal] .photo-story { max-height: 45%; }
  body[data-stage=reveal] .viewer-toolbar { left: 12px; bottom: max(12px,env(safe-area-inset-bottom)); min-height: 44px; }
  .browse-result { right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); font-size: 12px; }
  body[data-stage=reveal] .map-panel { inset: auto 0 0; width: 100%; }
}

body[data-stage=reveal] .map-surface { height: 216px; flex: none; }
@media(max-width:800px) { body[data-stage=reveal] .map-surface { height: auto; min-height: 80px; flex: 1; } }

/* Continue one photograph at a time; the collection is an explicit destination. */
.result-actions { position: absolute; z-index: 5; bottom: max(12px,env(safe-area-inset-bottom)); left: 24px; right: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.result-actions button { min-height: 44px; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; }
.result-actions .browse-result { position: static; color: var(--muted); }
body[data-stage=reveal] .viewer-toolbar { bottom: max(60px,calc(env(safe-area-inset-bottom) + 48px)); }
body[data-stage=reveal] .photograph { bottom: 128px !important; }
.running-score { color: var(--muted); font-size: 12px; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
body[data-stage=reveal] .photo-story { display: flex; flex-direction: column; }
body[data-stage=reveal] .running-score { order: 5; }
.history-panel { position: absolute; inset: 0; width: 100%; max-width: none; max-height: none; padding: 0; border: 0; border-radius: 0; background: #0c1014; }
.history-panel .panel-heading { position: sticky; top: 0; z-index: 1; height: 56px; padding: 0 16px; margin: 0; background: #0c1014; }
.history-panel .panel-heading h2 { font-size: 16px; font-weight: 500; }
.gallery-back { min-height: 44px; min-width: 44px; padding: 0; color: var(--ink); border: 0; background: transparent; font-size: 14px; }
#history-copy { display: none; }
.history-photos { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; margin: 0; padding: 0; }
.history-photos button { position: relative; display: block; border: 0; margin: 0; padding: 0; background: transparent; overflow: hidden; }
.history-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 0; }
.history-photos span { position: absolute; inset: auto 0 0; padding: 24px 16px 16px; text-align: left; background: linear-gradient(transparent,#000a); opacity: 0; pointer-events: none; transition: opacity 150ms ease-out; }
.history-photos small { font-size: 12px; color: #e0e2e5; }
.history-photos strong { font-size: 14px; font-weight: 500; color: white; }
.history-photos button:focus-visible { outline-offset: -3px; }
.history-photos button:focus-visible span { opacity: 1; transition: none; }
@media(hover:hover) and (pointer:fine) { .history-photos button:hover span { opacity: 1; } }
@media(prefers-reduced-motion:reduce) { .history-photos span { transition: none; } }
@media(max-width:800px) {
  .result-actions { left: 12px; right: 12px; }
  body[data-mode=play] #today-button { display: block; }
  body[data-stage=reveal] .photograph { bottom: calc(116px + env(safe-area-inset-bottom,0px)) !important; }
  .history-panel { padding: 0; }
  .history-photos { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; }
}

/* Collection browsing has no chronology and its own single header. */
body[data-gallery-open=true] .app-header { visibility: hidden; }
.history-panel { position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; overflow: hidden; }
.gallery-header { flex-shrink: 0; min-height: 60px; padding: calc(6px + env(safe-area-inset-top,0px)) 20px 6px; display: flex; align-items: center; gap: 24px; background: #0c1014; }
.gallery-header h2 { font-size: 16px; font-weight: 500; margin-right: auto; }
.gallery-view { display: flex; gap: 4px; }
.gallery-view button { border: 0; border-radius: 0; background: transparent; color: var(--muted); min-height: 44px; min-width: 44px; padding: 0 8px; }
.gallery-view button[aria-pressed=true] { color: var(--ink); box-shadow: inset 0 -1px var(--ink); }
.gallery-group { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.gallery-group select { min-height: 44px; max-width: 120px; font: inherit; font-size: 16px; border: 0; border-radius: 0; color: var(--ink); background: #0c1014; padding: 0 20px 0 4px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4 3 3 3-3' fill='none' stroke='%23a3adb8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; }
.gallery-content { min-height: 0; overflow: auto; flex: 1; }
.gallery-scene h3 { margin: 0; padding: 16px; font-size: 14px; font-weight: 500; color: var(--muted); }
.gallery-status { position: absolute; z-index: 4; top: 72px; left: 16px; right: 16px; padding: 12px; background: #131a22; color: var(--ink); font-size: 14px; }
.collection-map { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #101c27; }
.collection-detail, #collection-outline, .collection-markers { position: absolute; inset: 0; width: 100%; height: 100%; }
#collection-outline { touch-action: none; }
#collection-outline path { fill: #293b4a; stroke: #506779; stroke-width: .7; }
.collection-markers { pointer-events: none; }
.collection-cluster { position: absolute; transform: translate(-50%,-50%); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; pointer-events: auto; }
.cluster-mark { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #ffffff38; border-radius: 50%; background: #cbd3d9; color: #14212b; font-size: 12px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; transition: background-color 140ms ease; }
.cluster-mark[data-single=true] { width: 8px; height: 8px; }
.collection-cluster:focus-visible { outline-offset: -5px; }
.collection-cluster:focus-visible .cluster-mark { background: #fff; transition: none; }
.collection-cluster:active:not(:disabled) .cluster-mark { background: #fff; }
@media(hover:hover) and (pointer:fine) { .collection-cluster:hover .cluster-mark { background: #fff; } }
@media(prefers-reduced-motion:reduce) { .cluster-mark { transition: none; } }
.collection-map-controls { position: absolute; z-index: 2; right: 16px; top: 16px; display: flex; background: #131a22; border: 1px solid var(--line); }
.collection-map-controls button, .collection-selection header button { min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; color: var(--ink); background: transparent; }
.collection-map-controls button:first-child { font-size: 20px; }
.collection-credit { position: absolute; left: 12px; bottom: 8px; font-size: 11px; color: var(--muted); }
.collection-selection { position: absolute; z-index: 3; right: 16px; top: 72px; width: 360px; max-width: calc(100% - 32px); max-height: calc(100% - 120px); overflow: auto; background: #0c1014; border: 1px solid var(--line); }
.collection-selection header { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px; }
.collection-selection h3 { margin: 0; font-size: 14px; font-weight: 500; }
.collection-selection .history-photos { grid-template-columns: repeat(2,minmax(0,1fr)); }
@media(max-width:600px) {
  .gallery-header { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: calc(4px + env(safe-area-inset-top,0px)) 12px 4px; }
  .gallery-header h2 { grid-column: 1; grid-row: 1; }
  .gallery-header .gallery-back { grid-column: 2; grid-row: 1; justify-self: end; }
  .gallery-view { grid-column: 1; grid-row: 2; width: max-content; }
  .gallery-group { grid-column: 2; grid-row: 2; }
  .gallery-status { top: 100px; }
  .collection-selection { top: auto; right: 0; left: 0; bottom: 0; width: 100%; max-width: none; max-height: 50%; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom,0px); }
}
.collection-cluster:active:not(:disabled) { transform: translate(-50%,-50%); }
