:root {
  color-scheme: light;
  --canvas: #f2f3f4;
  --surface: #fff;
  --ink: #181a1d;
  --muted: #636970;
  --quiet: #6d747b;
  --line: #dde0e3;
  --hover: #f3f4f5;
  --control: #eceef0;
  --metal: #c9ced3;
  --frame: linear-gradient(110deg,#d5d9dd,#f3f5f7 30%,#bcc2c8 60%,#e4e7ea);
  --grooves: repeating-linear-gradient(90deg,transparent 0 9px,#ffffff2b 9px 10px,#171a1d0a 10px 11px,transparent 11px 20px);
  font-family: -apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111214;
  --surface: #1a1c1f;
  --ink: #eceff2;
  --muted: #abb1b9;
  --quiet: #8c949e;
  --line: #33373d;
  --hover: #23262b;
  --control: #292d32;
  --metal: #4d535b;
  --frame: linear-gradient(110deg,#41464c,#626970 30%,#2d3238 60%,#4b5158);
  --grooves: repeating-linear-gradient(90deg,transparent 0 9px,#ffffff0b 9px 10px,#0000003a 10px 11px,transparent 11px 20px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button,select { font: inherit; color: inherit; }
button,a,select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible,a:focus-visible,select:focus-visible,[tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
button,a,select { transition: background-color 140ms,color 140ms; }
a { color: inherit; }
svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 10000; left: 20px; top: -100px; background: var(--ink); color: var(--surface); padding: 12px 20px; }
.skip-link:focus { top: 10px; }
.app-shell { max-width: 1680px; margin: auto; padding: 0 48px; }
.topbar { height: 84px; display: flex; align-items: center; gap: 48px; border-bottom: 1px solid var(--line); }
.wordmark { display: flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: 23px; letter-spacing: -.8px; }
.brand-icon { width: 27px; height: 31px; stroke-width: 1.35; }
.top-nav { display: flex; align-items: center; gap: 5px; }
.top-nav a { padding: 8px 16px; display: flex; align-items: center; gap: 9px; text-decoration: none; border-radius: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.top-nav a:hover { background: var(--control); }
.top-nav a.active { color: var(--ink); background: var(--control); }
.saved-count { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.header-actions { margin-left: auto; display: flex; align-items: center; }
.theme-toggle { width: 38px; height: 38px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); }
.theme-toggle:hover { background: var(--control); color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.intro { padding: 40px 0 38px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
h1 { margin: 0; font-size: clamp(32px,3.8vw,52px); font-weight: 500; letter-spacing: -2px; line-height: 1.12; }
.intro-copy p { margin: 13px 0 0; color: var(--muted); font-size: 15px; }
.location-control { display: flex; flex-direction: column; align-items: flex-end; gap: 11px; }
.location-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.location-label svg { width: 15px; height: 15px; }
.location-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 15px; color: var(--surface); background: var(--ink); border: 1px solid var(--ink); border-radius: 7px; font-size: 12px; font-weight: 500; }
.location-button:hover { opacity: .85; }
.location-button svg { width: 16px; height: 16px; }
.discover { scroll-margin-top: 20px; }
.workspace-toolbar { display: flex; align-items: center; gap: 30px; padding: 0 0 19px; }
h2 { font-weight: 550; font-size: 16px; letter-spacing: -.25px; margin: 0; }
.filters { display: flex; align-items: center; gap: 4px; }
.filter { display: inline-flex; gap: 7px; align-items: center; min-height: 34px; padding: 0 12px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: 12px; white-space: nowrap; }
.filter:hover { background: var(--control); }
.filter.active { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: 0 1px 2px #00000004; }
.filter span { color: var(--quiet); font-size: 10px; font-variant-numeric: tabular-nums; }
.view-controls { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.radius-select { display: flex; align-items: center; position: relative; }
.radius-select select { appearance: none; height: 34px; border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 0 30px 0 12px; font-size: 12px; cursor: pointer; }
.radius-select svg { position: absolute; right: 8px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.radius-select option { background: var(--surface); }
.map-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; background: transparent; color: var(--muted); height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 11px; font-size: 12px; }
.map-toggle[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.map-toggle svg { width: 15px; height: 15px; }
.case-frame { padding: 9px; border: 1px solid var(--metal); border-radius: 16px; background-image: var(--grooves),var(--frame); box-shadow: inset 0 1px 0 #ffffff55,0 4px 14px #00000006; }
.results-layout { height: clamp(460px,58vh,650px); display: grid; grid-template-columns: 390px minmax(0,1fr); background: var(--surface); border: 1px solid var(--metal); border-radius: 9px; overflow: hidden; }
.place-list { overflow-y: auto; overflow-x: hidden; min-width: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; background: var(--surface); }
.place-card { display: grid; grid-template-columns: 48px minmax(0,1fr) 30px; align-items: start; gap: 14px; padding: 22px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.place-card:hover,.place-card.selected { background: var(--hover); }
.place-card:last-child { border-bottom: none; }
.place-thumb { width: 48px; height: 54px; display: grid; place-items: center; border-radius: 6px; color: var(--ink); border: 1px solid var(--line); background: var(--control); }
.place-thumb svg { width: 25px; height: 25px; stroke-width: 1.15; }
.place-meta { min-width: 0; }
.type-label { font-size: 10px; line-height: 1.2; font-weight: 500; color: var(--muted); }
.place-title { font-size: 15px; font-weight: 550; line-height: 1.3; letter-spacing: -.15px; margin: 0 0 7px; }
.place-distance { color: var(--muted); font-size: 11px; line-height: 1.5; }
.save-button { border: 0; padding: 6px; margin-top: -5px; color: var(--quiet); background: transparent; border-radius: 5px; width: 30px; height: 32px; display: grid; place-items: center; }
.save-button:hover { color: var(--ink); background: var(--control); }
.save-button svg { width: 17px; height: 17px; }
.save-button.saved { color: var(--ink); }
.save-button.saved svg { fill: currentColor; }
.map-panel { position: relative; min-width: 0; background: var(--control); border-left: 1px solid var(--line); }
.map-panel #map { position: absolute; inset: 0; z-index: 1; background: var(--control); }
.map-fallback { display:flex; flex-direction:column; justify-content:center; align-items:center; padding:32px; gap:16px; text-align:center; color:var(--muted); }
.map-fallback a { color:var(--ink); }
.elsewhere-marker-wrap { background: none; border: 0; }
.elsewhere-marker { width: 31px; height: 31px; border: 2px solid var(--surface); color: var(--surface); background: var(--ink); box-shadow: 0 2px 6px #00000030; border-radius: 50%; display: grid; place-items: center; font: 500 10px -apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif; font-variant-numeric: tabular-nums; }
.map-status { position: absolute; left: 14px; bottom: 20px; max-width: calc(100% - 30px); z-index: 500; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; font-size: 10px; color: var(--muted); background: var(--surface); pointer-events: none; box-shadow: 0 2px 5px #00000008; }
.live-status { font-size: 11px; color: var(--muted); padding: 14px 20px; background: var(--hover); }
.empty-state { padding: 40px 24px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.8; }
.retry-button { margin-top: 15px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 15px; color: var(--ink); }
.results-layout.list-only { grid-template-columns: 1fr; }
.results-layout.list-only .map-panel { display: none; }
.results-layout.list-only .place-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; }
.results-layout.list-only .live-status,.results-layout.list-only .empty-state { grid-column: 1 / -1; }
.results-layout.list-only .place-card:nth-child(odd) { border-right: 1px solid var(--line); }
footer { padding: 25px 2px 29px; display: flex; justify-content: space-between; align-items: center; color: var(--quiet); font-size: 10px; }
footer a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
footer svg { width: 12px; height: 12px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%,8px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--surface); padding: 12px 20px; border-radius: 7px; font-size: 12px; box-shadow: 0 4px 20px #00000020; transition: opacity 160ms,transform 160ms; z-index: 1000; max-width: calc(100% - 32px); width: max-content; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.place-dialog { width: min(520px,calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 40px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 25px 100px #00000030; }
.place-dialog::backdrop { background: #0d111570; backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); border-radius: 5px; display: grid; place-items: center; }
.dialog-close:hover { background: var(--hover); }
.dialog-title { font-size: 29px; font-weight: 500; line-height: 1.18; letter-spacing: -.7px; margin: 15px 25px 12px 0; }
.dialog-subtitle { color: var(--muted); font-size: 12px; }
.dialog-description { font-size: 14px; line-height: 1.8; margin: 23px 0 18px; }
.dialog-fact { color: var(--muted); font-size: 12px; line-height: 1.8; }
.dialog-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 9px; }
.dialog-actions button,.directions-link { font-size: 12px; font-weight: 500; padding: 10px 15px; border: 1px solid var(--ink); color: var(--surface); background: var(--ink); border-radius: 6px; text-decoration: none; }
.dialog-actions button.secondary { background: transparent; border-color: var(--line); color: var(--ink); }
.source-note { margin-top: 24px; font-size: 10px; color: var(--quiet); }
.source-note a { text-underline-offset: 3px; }
@media (min-width: 1550px) { .results-layout { grid-template-columns: 440px minmax(0,1fr); } .place-card { padding: 25px 26px; } }
@media (max-width: 1000px) { .app-shell { padding: 0 28px; } .workspace-toolbar { gap: 18px; flex-wrap: wrap; } .workspace-toolbar h2 { margin-right: auto; } .filters { order: 3; flex-basis: 100%; } .results-layout { grid-template-columns: 340px minmax(0,1fr); } .place-card { gap: 10px; padding: 20px 16px; } .view-controls { margin-left: 0; } }
@media (max-width: 700px) {
  .app-shell { padding: 0 16px; }
  .topbar { height: 68px; gap: 12px; }
  .wordmark { font-size: 20px; gap: 8px; }
  .brand-icon { width: 22px; height: 27px; }
  .top-nav { margin-left: auto; gap: 0; }
  .top-nav a { font-size: 12px; padding: 7px 10px; gap: 5px; }
  .header-actions { margin-left: 0; }
  .theme-toggle { height: 32px; width: 32px; }
  .intro { padding: 30px 0 26px; display: block; }
  h1 { font-size: 35px; letter-spacing: -1.2px; }
  .intro-copy p { font-size: 13px; margin-top: 10px; }
  .location-control { flex-direction: row; align-items: center; justify-content: space-between; margin-top: 22px; gap: 10px; }
  .location-button { height: 36px; padding: 0 11px; font-size: 11px; }
  .workspace-toolbar { gap: 12px; padding-bottom: 14px; }
  .workspace-toolbar h2 { font-size: 15px; }
  .filters { gap: 1px; justify-content: space-between; }
  .filter { padding: 0 9px; font-size: 11px; gap: 6px; }
  .case-frame { border-radius: 11px; padding: 5px; }
  .results-layout { display: flex; flex-direction: column; height: auto; border-radius: 6px; }
  .map-panel { order: -1; height: 310px; border-left: 0; border-bottom: 1px solid var(--line); flex: none; }
  .place-list { max-height: 480px; }
  .place-card { grid-template-columns: 42px minmax(0,1fr) 30px; padding: 19px 16px; gap: 13px; }
  .place-thumb { width: 42px; height: 49px; }
  .results-layout.list-only .place-list { display: block; max-height: none; }
  .results-layout.list-only .place-card:nth-child(odd) { border-right: 0; }
  .map-status { left: 10px; bottom: 22px; font-size: 9px; padding: 6px 8px; }
  .place-dialog { padding: 30px 24px; }
  footer { gap: 14px; font-size: 9px; padding-top: 20px; }
}
@media (max-width: 380px) { .wordmark { font-size: 18px; } .top-nav a { padding: 7px 8px; } .brand-icon { display: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*:before,*:after { transition: none !important; } }

/* Search and evidence use the existing graphite and silver palette. */
input { font: inherit; color: inherit; }
input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.location-label { max-width: 320px; }
.location-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-search-wrap { position: relative; width: min(560px,100%); margin: -6px 0 30px; }
.location-search { display: flex; gap: 8px; }
.location-search input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); height: 40px; padding: 0 13px; font-size: 12px; }
.location-search input::placeholder { color: var(--muted); }
.location-search button { border: 1px solid var(--line); border-radius: 6px; background: var(--control); padding: 0 14px; font-size: 12px; }
.location-search button:hover { background: var(--hover); }
.location-results { position: absolute; top: 47px; left: 0; right: 0; z-index: 700; border: 1px solid var(--line); border-radius: 7px; padding: 8px; background: var(--surface); box-shadow: 0 8px 24px #00000018; color: var(--muted); font-size: 12px; }
.location-results button { display: block; width: 100%; background: transparent; color: var(--ink); text-align: left; border: 0; border-radius: 4px; padding: 11px; font-size: 12px; }
.location-results button:hover { background: var(--hover); }
.discovery-status { color: var(--muted); font-size: 11px; line-height: 1.6; margin: -4px 0 14px; min-height: 18px; }
.source-refresh { border: 0; padding: 0; background: transparent; color: var(--ink); font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.search-map-area { position: absolute; top: 12px; left: 12px; z-index: 500; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 8px 11px; color: var(--ink); font-size: 11px; box-shadow: 0 2px 5px #00000008; }
.search-map-area:hover { background: var(--hover); }
.place-dialog { width: min(620px,calc(100% - 32px)); }
.detail-section { margin-top: 25px; }
.detail-section h3 { margin: 0 0 10px; font-size: 13px; font-weight: 550; }
.detail-section .dialog-description { margin: 0; }
.research-label { margin: 18px 0 0; font-size: 11px; color: var(--muted); }
.research-progress { font-size: 12px; color: var(--muted); margin: 20px 0; }
.detail-section blockquote { margin: 10px 0 14px; font-size: 14px; line-height: 1.8; }
.detail-note { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 8px 0; }
.fact-list { margin: 0; font-size: 12px; }
.fact-list > div { display: grid; grid-template-columns: minmax(110px,35%) 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fact-list dt { color: var(--muted); }
.fact-list dd { margin: 0; }
.source-list { margin: 0; padding-left: 19px; font-size: 12px; }
.source-list li { padding: 4px 0 10px 3px; }
.source-list li > span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.detail-section sup { font-size: 9px; padding-left: 2px; }
.detail-section a { text-underline-offset: 3px; }
.source-note { line-height: 1.7; }
@media (max-width: 700px) {
  .location-search-wrap { margin-top: -5px; margin-bottom: 24px; }
  .location-label { max-width: 185px; }
  .location-search button { font-size: 11px; padding: 0 10px; }
  .discovery-status { font-size: 10px; }
  .fact-list > div { grid-template-columns: minmax(90px,36%) 1fr; }
  footer { flex-wrap: wrap; }
}

.card-description { margin:10px 0 6px; color:var(--ink); font-size:13px; line-height:1.6; }
.card-pending { color:var(--muted); }
.card-source,.card-coverage { margin:6px 0 10px; color:var(--muted); font-size:10px; line-height:1.5; }
.card-source a { color:inherit; text-decoration:underline; text-underline-offset:3px; }
.card-details { margin:10px 0; font-size:11px; line-height:1.5; }
.card-details div { display:grid; grid-template-columns:90px 1fr; gap:10px; margin:3px 0; }
.card-details dt { color:var(--muted); }
.card-details dd { margin:0; color:var(--ink); }
.card-visit { font-size:11px; line-height:1.6; color:var(--muted); margin:10px 0; }
.card-visit a { color:inherit; text-underline-offset:3px; }

.collection-button { background:transparent; color:inherit; border:0; font:inherit; text-decoration:underline; cursor:pointer; padding:0; }

.card-photo { grid-column:1 / -1; margin:0 0 8px; min-width:0; }
.card-photo img { display:block; width:100%; height:210px; object-fit:cover; border-radius:5px; background:var(--control); }
.card-photo figcaption { margin-top:6px; font-size:10px; line-height:1.5; color:var(--muted); overflow-wrap:anywhere; }
.card-photo figcaption a { color:inherit; }
.photo-fallback { grid-column:2 / -1; font-size:11px; line-height:1.5; color:var(--muted); margin:0; }
.photo-fallback a { color:inherit; }
.place-card > .save-button { grid-column:3; grid-row:1; }
.place-card:has(.card-photo) > .save-button { grid-row:2; }

.card-photo.photo-unavailable img { display:none; }
.card-photo.photo-unavailable::before { content:'Photo temporarily unavailable'; display:block; padding:20px; background:var(--control); color:var(--muted); font-size:12px; }

.card-significance { margin: 18px 0 12px; }
.card-significance h4 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }

.photo-gallery { grid-column:1 / -1; min-width:0; margin:0 0 8px; }
.photo-track { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; overscroll-behavior-x:contain; scrollbar-width:thin; }
.photo-track .card-photo { flex:0 0 100%; scroll-snap-align:start; margin:0; }
.photo-expand { display:block; width:100%; padding:0; position:relative; background:transparent; border:0; cursor:zoom-in; color:white; }
.photo-expand span { position:absolute; right:8px; bottom:8px; padding:5px 8px; border-radius:4px; background:#000b; font-size:11px; }
.gallery-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; font-size:12px; color:var(--muted); }
.gallery-controls button { border:1px solid var(--line); border-radius:5px; background:var(--control); color:var(--ink); padding:6px 14px; cursor:pointer; }
.place-card:has(.photo-gallery) > .save-button { grid-row:2; }
.photo-lightbox { width:min(1100px,96vw); max-width:96vw; max-height:94dvh; padding:48px 18px 18px; background:#111; color:#fff; border:1px solid #444; border-radius:8px; overflow:auto; }
.photo-lightbox::backdrop { background:#000d; }
.lightbox-close { position:absolute; top:8px; right:12px; background:transparent; color:white; border:0; font-size:30px; cursor:pointer; }
.lightbox-image { display:flex; justify-content:center; align-items:center; min-height:100px; }
.lightbox-image img { max-width:100%; width:auto; max-height:70dvh; object-fit:contain; }
.lightbox-controls { display:flex; justify-content:center; align-items:center; gap:24px; margin:14px 0; }
.lightbox-controls button { background:#222; color:white; border:1px solid #555; padding:8px 18px; border-radius:5px; cursor:pointer; }
.lightbox-credit { font-size:12px; line-height:1.6; color:#bbb; overflow-wrap:anywhere; }
.lightbox-credit a { color:inherit; }
@media(prefers-reduced-motion:reduce) { .photo-track { scroll-behavior:auto; } }
