/* Layout and components. Values come from tokens.css. */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font: 400 var(--t-md)/var(--lh-sans) var(--f-sans);
  background-image: radial-gradient(rgba(37,35,30,.035) 1px, transparent 1.2px);
  background-size: 5px 5px;
  display: flex; flex-direction: column; min-height: 100dvh;
}
a { color: var(--forest); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { top: 8px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.1; margin: 0; }

.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--forest); font-size: var(--t-sm); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn { background: var(--forest); color: var(--paper); border: 1px solid var(--forest); border-radius: var(--r-control); padding: 8px 14px; font-weight: 600; font-size: var(--t-sm); cursor: pointer; }
.btn:disabled { opacity: .4; cursor: default; }
.map-note { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); margin: 0; background: var(--paper-lift); border: 1px solid var(--ink); padding: 8px 12px; font-size: var(--t-xs); max-width: 80%; text-align: center; z-index: 2; }
.btn.ghost { background: var(--paper-lift); color: var(--forest); }

/* Header */
.bar { display: flex; align-items: center; gap: var(--s-5); padding: 10px var(--s-4); border-bottom: 1px solid var(--ink); background: var(--paper-lift); min-height: var(--bar-h); }
.brand { font-size: 1.4rem; white-space: nowrap; }
.brand a { color: var(--ink); text-decoration: none; }
.search { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--ink-soft); border-radius: var(--r-control); padding: 0 10px; background: var(--paper-lift); color: var(--ink-soft); }
.search:focus-within { outline: 3px solid var(--rust); outline-offset: 1px; }
.search input { flex: 1; border: 0; background: transparent; padding: 8px 0; color: var(--ink); font-size: var(--t-sm); min-width: 0; }
.search input:focus { outline: none; }
.bar-actions { margin-left: auto; display: flex; gap: var(--s-4); }
.notice { margin: 0; padding: 6px var(--s-4); font-size: var(--t-xs); background: var(--forest-wash); border-bottom: 1px solid var(--rule); color: var(--ink); }

/* Filters */
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding: 8px var(--s-4); border-bottom: 1px solid var(--rule); background: var(--paper); }
.filters-toggle { display: none; }
.filter-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2) var(--s-3); }
.field { display: flex; flex-direction: column; gap: 2px; font-size: .75rem; color: var(--ink-soft); font-weight: 600; }
.field select { font-size: var(--t-xs); font-weight: 500; color: var(--ink); background: var(--paper-lift); border: 1px solid var(--ink-soft); border-radius: var(--r-control); padding: 5px 26px 5px 8px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 13px) 55%, calc(100% - 9px) 55%; background-size: 4px 4px; background-repeat: no-repeat; max-width: 210px; }
.field select.on { background-color: var(--forest); color: var(--paper); border-color: var(--forest); background-image: linear-gradient(45deg, transparent 50%, var(--paper) 50%), linear-gradient(135deg, var(--paper) 50%, transparent 50%); }
.reset { background: none; border: 0; color: var(--forest); font-weight: 600; font-size: var(--t-xs); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 2px; }
.count { margin: 0 0 0 auto; font-size: var(--t-xs); color: var(--ink-soft); }

/* Three-column layout */
.layout { flex: 1; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--story-w); min-height: 0; }
@media (min-width: 821px) { body { height: 100dvh; } .layout { overflow: hidden; } }
.rail { border-right: 1px solid var(--rule); display: flex; flex-direction: column; min-height: 0; background: var(--paper-lift); }
.tabs { display: flex; border-bottom: 1px solid var(--ink); }
.tabs [role=tab] { flex: 1; background: var(--paper); border: 0; border-right: 1px solid var(--rule); padding: 10px 8px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.tabs [role=tab]:last-child { border-right: 0; }
.tabs [role=tab][aria-selected=true] { background: var(--paper-lift); color: var(--ink); box-shadow: inset 0 -3px 0 var(--forest); }
.tabs .n { font-weight: 500; }
.list { overflow-y: auto; flex: 1; min-height: 0; }
.list:focus { outline: none; }
.group-h { position: sticky; top: 0; z-index: 1; margin: 0; padding: 10px var(--s-4) 6px; font: 700 var(--t-xs)/1.3 var(--f-sans); color: var(--ink-soft); background: var(--paper-lift); border-bottom: 1px solid var(--rule); }
.group-note { margin: 0; padding: 8px var(--s-4); font-size: var(--t-xs); color: var(--ink-soft); }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(183,168,132,.5); padding: 10px var(--s-4); cursor: pointer; }
.item:hover { background: var(--paper); }
.item[aria-current=true] { background: var(--paper-deep); box-shadow: inset 3px 0 0 var(--rust); }
.item .t { display: block; font-weight: 600; font-size: var(--t-sm); line-height: 1.3; }
.item .s { display: block; font-size: var(--t-xs); color: var(--ink-soft); margin-top: 2px; }
.item.dim .t { color: var(--ink-soft); font-weight: 500; }
.item.dim svg { opacity: .55; }
.item .when { color: var(--rust); font-weight: 600; }
.tag { display: inline-block; font-size: .6875rem; font-weight: 600; border: 1px solid currentColor; border-radius: 2px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; color: var(--rust); }
.tag.forest { color: var(--forest); }
.lead { border-bottom: 1px solid rgba(183,168,132,.5); }
.lead summary { list-style: none; display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 9px var(--s-4); cursor: pointer; }
.lead summary::-webkit-details-marker { display: none; }
.lead .t { font-weight: 600; font-size: var(--t-sm); line-height: 1.3; }
.lead .s { display: block; font-size: var(--t-xs); color: var(--ink-soft); }
.lead .more { padding: 0 var(--s-4) 12px 48px; font-size: var(--t-xs); }
.lead .more p { margin: 0 0 6px; }
.empty { padding: var(--s-5) var(--s-4); font-size: var(--t-sm); }
.empty b { display: block; font-family: var(--f-serif); font-size: 1.1rem; margin-bottom: 4px; }
.goto { margin: var(--s-3) var(--s-4) 0; }

/* Map */
.mapwrap { position: relative; background: var(--water); min-height: 0; overflow: hidden; }
.map-stage, #map { position: absolute; inset: 0; width: 100%; height: 100%; }
#map { display: block; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
#map:focus-visible { outline-offset: -3px; }
.county { fill: var(--land); stroke: var(--county); stroke-width: .8; vector-effect: non-scaling-stroke; cursor: pointer; }
.county:hover { stroke: var(--ink-soft); }
.county-hatch { pointer-events: none; }
.county-sel { fill: none; stroke: var(--rust); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-dasharray: 6 4; pointer-events: none; }
.county-focus { fill: rgba(44,88,65,.10); stroke: var(--forest); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.state { fill: none; stroke: var(--state-line); stroke-width: 1.4; vector-effect: non-scaling-stroke; pointer-events: none; }
.town text, .clabel { font-family: var(--f-serif); font-style: italic; fill: var(--ink-soft); pointer-events: none; }
.clabel { font-style: normal; font-family: var(--f-sans); fill: var(--ink-soft); opacity: .8; }
.mk { cursor: pointer; }
.mk:focus { outline: none; }
.mk:focus-visible .ring-focus { stroke: var(--rust); stroke-width: 3; }
.county-count-box { fill: var(--paper-lift); stroke: var(--ink-soft); stroke-width: 1; }
.county-count text { fill: var(--ink-soft); font: 600 11px var(--f-sans); pointer-events: none; }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s-5); text-align: center; background: var(--water); }
.map-msg[hidden], .layers[hidden], [hidden] { display: none !important; }
.map-msg div { max-width: 34ch; background: var(--paper-lift); border: 1px solid var(--ink); padding: var(--s-4); }
.map-msg b { display: block; font-family: var(--f-serif); font-size: 1.1rem; margin-bottom: 6px; }

.map-tools { position: absolute; right: var(--s-4); top: var(--s-4); display: flex; flex-direction: column; border: 1px solid var(--ink); background: var(--paper-lift); }
.map-tools button { width: 38px; height: 38px; border: 0; border-bottom: 1px solid var(--rule); background: none; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.map-tools button:last-child { border-bottom: 0; }
.map-tools #zoomAll { font-size: 12px; font-weight: 700; }
.map-tools button[aria-expanded=true] { background: var(--forest); color: var(--paper); }
.layers { position: absolute; right: 64px; top: var(--s-4); width: 270px; background: var(--paper-lift); border: 1px solid var(--ink); padding: var(--s-3); font-size: var(--t-xs); z-index: 4; }
.layers h3 { font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 700; margin-bottom: 6px; }
.layers p { margin: 0 0 8px; color: var(--ink-soft); }
.layers label { display: block; margin: 8px 0 2px; font-weight: 600; }
.layers input[type=range] { width: 100%; accent-color: var(--forest); }
.layers select { width: 100%; padding: 4px; border: 1px solid var(--ink-soft); border-radius: var(--r-control); background: var(--paper-lift); }
.seg { display: flex; border: 1px solid var(--ink-soft); border-radius: var(--r-control); overflow: hidden; margin-top: 6px; }
.seg button { flex: 1; border: 0; background: none; padding: 5px; font-size: var(--t-xs); font-weight: 600; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--forest); color: var(--paper); }

.legend { position: absolute; left: var(--s-4); top: var(--s-4); width: auto; max-width: 380px; background: var(--paper-lift); border: 1px solid var(--ink); font-size: var(--t-xs); z-index: 3; }
.legend summary { padding: 8px 12px; font-weight: 700; cursor: pointer; }
.legend[open] { width: 360px; }
.legend-body { padding: 0 10px 10px; }
.legend-body { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
.legend-body hr, .legend-body .fine, .legend-body > svg { grid-column: 1 / -1; }
.legend .row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend .row svg { flex: none; }
.legend hr { border: 0; border-top: 1px solid var(--rule); margin: 8px 0; }
.legend .fine { color: var(--ink-soft); margin: 4px 0 0; }

.timebar { position: absolute; left: var(--s-4); right: var(--s-4); bottom: var(--s-4); display: flex; align-items: center; gap: var(--s-3); background: var(--paper-lift); border: 1px solid var(--ink); padding: 8px 12px; z-index: 3; flex-wrap: wrap; }
.time-toggle { border: 1px solid var(--forest); color: var(--forest); background: var(--paper-lift); border-radius: var(--r-control); padding: 6px 10px; font-weight: 600; font-size: var(--t-xs); cursor: pointer; }
.time-toggle[aria-pressed=true] { background: var(--forest); color: var(--paper); }
.time-ctl { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 220px; }
.time-ctl[hidden] { display: none; }
.play { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--ink); background: var(--paper-lift); cursor: pointer; font-size: 12px; }
#year { flex: 1; accent-color: var(--forest); }
#yearOut { font-family: var(--f-display); font-size: 1.6rem; min-width: 3.4em; text-align: right; line-height: 1; }
.time-note { flex-basis: 100%; margin: 0; font-size: var(--t-xs); color: var(--ink-soft); }

/* Story panel */
.story { border-left: 1px solid var(--ink); background: var(--paper-lift); overflow-y: auto; min-height: 0; }
.story:focus { outline: none; }
.story-inner { padding-bottom: var(--s-6); }
.story-top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px var(--s-4); background: var(--paper-lift); border-bottom: 1px solid var(--rule); font-size: var(--t-xs); }
.story-top .acts { display: flex; gap: var(--s-3); }
.story-body { padding: var(--s-4); }
.story h2.name { font-size: var(--t-xl); margin: 4px 0; }
.story .place { font-size: var(--t-sm); color: var(--ink-soft); margin: 0 0 var(--s-3); }
.story .aka { font-family: var(--f-serif); font-style: italic; font-size: var(--t-xs); color: var(--ink-soft); margin: -6px 0 var(--s-3); }
.story h3 { font-family: var(--f-serif); font-weight: 700; font-size: var(--t-sm); margin: var(--s-5) 0 4px; }
.story p { font-size: var(--t-sm); line-height: var(--lh-sans); margin: 0 0 8px; }
.story .muted { color: var(--ink-soft); font-size: var(--t-xs); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 5px var(--s-3); font-size: var(--t-xs); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: var(--s-2) 0; margin: 0 0 var(--s-3); }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 500; }
.q { color: var(--rust); font-weight: 600; }
.plate { aspect-ratio: 16/9; background: var(--paper-deep); border: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: flex-end; padding: var(--s-4); position: relative; margin: var(--s-4) var(--s-4) 0; background-image: repeating-linear-gradient(135deg, rgba(44,88,65,.11) 0 1px, transparent 1px 7px); }
.plate .pl-name { font-family: var(--f-display); font-size: var(--t-xxl); line-height: .95; color: var(--forest); overflow-wrap: anywhere; }
.plate .pl-sub { font-family: var(--f-serif); font-size: var(--t-sm); color: var(--ink-soft); margin-top: 6px; }
.plate .pl-cap { position: absolute; top: 10px; left: 12px; right: 12px; font-size: .6875rem; color: var(--ink-soft); }
.sure { border: 1px solid var(--forest); background: var(--forest-wash); padding: 10px 12px; font-size: var(--t-xs); margin-top: var(--s-4); }
.sure h3 { margin: 0 0 4px; font-family: var(--f-sans); font-size: var(--t-xs); color: var(--forest); }
.sure p { font-size: var(--t-xs); }
.checks { list-style: none; padding: 0; margin: 6px 0 0; }
.checks li { display: flex; gap: 6px; align-items: baseline; }
.checks .y { color: var(--forest); font-weight: 700; }
.checks .n { color: var(--rust); font-weight: 700; }
.ev { list-style: none; padding: 0; margin: 0; counter-reset: ev; }
.ev li { counter-increment: ev; display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: var(--t-xs); }
.ev li::before { content: counter(ev); font-family: var(--f-display); font-size: 1.2rem; color: var(--forest); line-height: 1; }
.ev .ex { font-family: var(--f-serif); font-style: italic; font-size: var(--t-sm); display: block; margin: 2px 0; }
.ev .row { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.nearby { list-style: none; padding: 0; margin: 0; }
.nearby button { background: none; border: 0; padding: 4px 0; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; font-size: var(--t-sm); }
.story-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--ink); }
.review-line { font-size: var(--t-xs); color: var(--ink-soft); margin-top: var(--s-3); }
.intro { padding: var(--s-5) var(--s-4); }
.intro h2 { font-size: 2.1rem; margin-bottom: var(--s-3); }
.intro p { font-size: var(--t-sm); }
.key { display: grid; grid-template-columns: 34px 1fr; gap: 8px 10px; align-items: center; margin: var(--s-3) 0 var(--s-4); font-size: var(--t-xs); }
.key b { display: block; font-size: var(--t-sm); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin: var(--s-4) 0; }
.stats div { padding: 8px 0; }
.stats b { display: block; font-family: var(--f-display); font-size: 1.9rem; line-height: 1; color: var(--forest); }
.stats span { font-size: .75rem; color: var(--ink-soft); }
.depth-line { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); margin: 6px 0; }

/* Photos: single and then/now compare */
.photo { margin: var(--s-4) var(--s-4) 0; }
.photo img { display: block; width: 100%; height: auto; border: 1px solid var(--ink); }
.credit { font-family: var(--f-serif); font-style: italic; font-size: .75rem; color: var(--ink-soft); margin-top: 4px; }
.compare { position: relative; border: 1px solid var(--ink); overflow: hidden; --exposure: 50%; }
.compare img { display: block; width: 100%; height: auto; }
.compare .top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--exposure)) 0 0); }
.compare .divider { position: absolute; top: 0; bottom: 0; left: var(--exposure); width: 2px; margin-left: -1px; background: var(--paper-lift); box-shadow: 0 0 0 1px var(--ink); pointer-events: none; }
.compare .tagl, .compare .tagr { position: absolute; top: 8px; font-size: .6875rem; font-weight: 700; background: var(--paper-lift); padding: 2px 6px; border: 1px solid var(--ink); }
.compare .tagl { left: 8px; } .compare .tagr { right: 8px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare:focus-within { outline: 3px solid var(--rust); outline-offset: 2px; }

/* Tour */
.tour-step { padding: var(--s-4); }
.tour-step .stepno { font-family: var(--f-display); font-size: 3rem; color: var(--forest); line-height: 1; }
.tour-step h2 { font-size: 1.9rem; margin: 6px 0 var(--s-3); }
.tour-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: var(--s-5); border-top: 1px solid var(--ink); padding-top: var(--s-3); }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--forest); }
.dots i.on { background: var(--forest); }

/* Dialogs */
.dlg { border: 1px solid var(--ink); background: var(--paper-lift); color: var(--ink); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-shadow: var(--shadow-offset); }
.dlg-wide { width: min(980px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(37,35,30,.45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 12px var(--s-4); border-bottom: 1px solid var(--ink); position: sticky; top: 0; background: var(--paper-lift); z-index: 1; }
.dlg-head h2 { font-size: 1.5rem; }
.close { background: none; border: 1px solid var(--ink-soft); width: 34px; height: 34px; cursor: pointer; border-radius: var(--r-control); }
.dlg form, .dlg > div:not(.dlg-head) { padding: 0 0 var(--s-4); }
.dlg-lede, .dlg .f, .dlg .fine, .dlg-actions, .about { margin-left: var(--s-4); margin-right: var(--s-4); }
.dlg-lede { font-size: var(--t-sm); margin-top: var(--s-3); }
.f { display: block; margin-top: var(--s-3); font-size: var(--t-xs); font-weight: 600; }
.f span { display: block; margin-bottom: 4px; }
.f textarea, .f input, .f select { width: 100%; border: 1px solid var(--ink-soft); border-radius: var(--r-control); background: var(--paper-lift); padding: 8px; font-size: var(--t-sm); font-weight: 400; }
.fine { font-size: var(--t-xs); color: var(--ink-soft); }
.dlg-actions { display: flex; gap: var(--s-4); align-items: center; margin-top: var(--s-3); }
.ev-view { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s-4); padding: var(--s-4); }
.ev-view .scan { background: var(--paper-deep); border: 1px solid var(--rule); max-height: 70vh; overflow: auto; }
.ev-view .scan img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.ev-view .scan.zoomed img { width: 200%; cursor: zoom-out; }
.ev-view .meta p { font-size: var(--t-sm); margin: 0 0 8px; }
.ev-view .rights { border: 1px solid var(--rust); color: var(--ink); padding: 8px; font-size: var(--t-xs); }
.ev-view .noscan { padding: var(--s-5); font-size: var(--t-sm); }
.ev-pager { display: flex; justify-content: space-between; padding: 0 var(--s-4); }
.about p, .about li { font-size: var(--t-sm); }
.about h3 { font-family: var(--f-serif); font-weight: 700; font-size: 1rem; margin: var(--s-4) 0 4px; }

.skeleton { padding: var(--s-4); }
.skeleton i { display: block; height: 12px; margin: 12px 0; background: var(--paper-deep); border-radius: 2px; }
.skeleton i:nth-child(odd) { width: 70%; }
@media (prefers-reduced-motion: no-preference) { .skeleton i { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .45; } }

.viewswitch { display: none; }

/* Medium: story drops below */
@media (max-width: 1180px) and (min-width: 821px) {
  :root { --rail-w: 290px; --story-w: 360px; }
  .bar-actions .link-btn#aboutBtn { display: none; }
}

/* Phone */
@media (max-width: 820px) {
  .bar { flex-wrap: wrap; gap: 8px var(--s-3); padding: 10px var(--s-4); }
  .brand { font-size: 1.15rem; white-space: normal; flex: 1; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .bar-actions { gap: var(--s-3); }
  .bar-actions #aboutBtn { display: none; }
  .filters { padding: 6px var(--s-4); }
  .filters-toggle { display: inline-block; border: 1px solid var(--ink-soft); background: var(--paper-lift); border-radius: var(--r-control); padding: 6px 10px; font-size: var(--t-xs); font-weight: 600; }
  .filter-fields { display: none; flex-basis: 100%; }
  .filters.open .filter-fields { display: flex; }
  .field { flex: 1 1 45%; }
  .field select { max-width: none; width: 100%; }
  .layout { display: block; position: relative; flex: 1; }
  .rail, .mapwrap { position: absolute; inset: 0 0 64px; }
  .rail { border-right: 0; }
  body.view-map .rail { display: none; }
  body.view-list .mapwrap { display: none; }
  .legend { bottom: auto; top: var(--s-3); left: var(--s-3); width: 220px; }
  .legend:not([open]) { width: auto; }
  .timebar { left: var(--s-3); right: var(--s-3); bottom: var(--s-3); }
  .layers { right: 60px; width: min(270px, calc(100vw - 80px)); }
  .viewswitch { display: flex; position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 20; border: 1px solid var(--ink); border-radius: var(--r-pill); overflow: hidden; background: var(--paper-lift); box-shadow: var(--shadow-offset); }
  .viewswitch button { border: 0; background: none; padding: 10px 22px; font-weight: 600; font-size: var(--t-sm); cursor: pointer; }
  .viewswitch button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
  .story { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 55dvh; z-index: 30; border-left: 0; border-top: 1px solid var(--ink); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: 0 -6px 0 rgba(226,214,187,.8); transform: translateY(110%); visibility: hidden; transition: transform var(--dur-move) var(--ease), visibility 0s linear var(--dur-move); }
  body.sheet-open .story { transform: none; visibility: visible; transition: transform var(--dur-move) var(--ease); }
  body.sheet-full .story { height: calc(100dvh - 24px); }
  .grab { display: block; width: 100%; background: none; border: 0; padding: 8px 0 0; cursor: pointer; }
  .grab::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--ink-soft); margin: 0 auto; }
  .ev-view { grid-template-columns: 1fr; }
}
@media (min-width: 821px) { .grab { display: none; } }

.no-map .map-tools, .no-map .timebar, .no-map .legend { display: none; }

/* =====================================================================
   v2 "Pine Tree Army" redesign: one focal point (the map), slim chrome,
   plain language. Rules below intentionally override earlier ones.
   ===================================================================== */
body { background-image: none; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; }

/* Slim spruce header with gold lettering */
.bar { background: var(--spruce); border-bottom: 0; min-height: 0; padding: 10px var(--s-4); gap: var(--s-4); color: var(--paper-lift); }
.brand { font-size: 1.5rem; letter-spacing: .005em; }
.brand a { color: var(--gold); }
.search { background: var(--paper-lift); border: 0; border-radius: var(--r-control); max-width: 420px; }
.search:focus-within { outline-color: var(--gold); }
.bar-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(246,241,226,.55); background: transparent; color: var(--paper-lift); border-radius: var(--r-control); padding: 7px 12px; font-weight: 600; font-size: var(--t-xs); cursor: pointer; }
.bar-btn[aria-expanded=true] { background: var(--paper-lift); color: var(--spruce); }
.badge { background: var(--gold); color: var(--ink); border-radius: var(--r-pill); padding: 0 7px; font-size: .75rem; }
.bar-actions { gap: var(--s-4); align-items: center; }
.bar-link { background: none; border: 0; color: var(--paper-lift); font-weight: 600; font-size: var(--t-sm); cursor: pointer; padding: 4px 2px; text-decoration: underline; text-decoration-color: rgba(246,241,226,.45); text-underline-offset: 4px; }
.bar-link:hover { color: var(--gold); text-decoration-color: var(--gold); }
.pill { background: none; border: 1px solid var(--gold); color: var(--gold); border-radius: var(--r-pill); padding: 3px 10px; font-size: .75rem; font-weight: 600; cursor: pointer; }
.bar :focus-visible { outline-color: var(--gold); }
.notice { display: none; }

/* Filters: a drawer under the bar, closed by default */
.filters { display: none; background: var(--paper-lift); border-bottom: 1px solid var(--rule); box-shadow: var(--shadow); padding: 12px var(--s-4); }
.filters.open { display: block; }
.filters .filter-fields { display: flex !important; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
.filters .btn { margin-left: auto; }
.field select { border-radius: var(--r-control); }

/* Layout: map gets the space; story column only when something is open */
.layout { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
@media (min-width: 821px) {
  body.story-open .layout { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--story-w); }
  body:not(.story-open) .story { display: none; }
}
.rail { background: var(--paper); border-right: 1px solid var(--rule); }
.tabs { border-bottom: 0; padding: 10px 12px 0; gap: 6px; }
.tabs [role=tab] { background: transparent; border: 0; border-radius: var(--r-control) var(--r-control) 0 0; color: var(--ink-soft); font-size: var(--t-sm); padding: 8px 10px; }
.tabs [role=tab][aria-selected=true] { background: var(--paper-lift); color: var(--ink); box-shadow: inset 0 -3px 0 var(--spruce); }
.rail-head { background: var(--paper-lift); padding: 8px var(--s-4) 6px; border-bottom: 1px solid var(--rule); }
.rail-head .count { margin: 0; text-align: left; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.chip { border: 0; background: var(--spruce); color: var(--paper-lift); border-radius: var(--r-pill); padding: 4px 10px; font-size: .75rem; font-weight: 600; cursor: pointer; }
.list { background: var(--paper-lift); }
.group-h { background: var(--paper-lift); font-family: var(--f-display); font-size: .95rem; color: var(--ink); border-bottom: 1px solid var(--rule); }
.group-note { color: var(--ink-soft); }
.item { border-bottom: 1px solid rgba(185,172,130,.45); padding: 11px var(--s-4); }
.item .t { font-size: var(--t-sm); }
.item .s abbr, .lead .s abbr { text-decoration: none; border-bottom: 1px dotted var(--ink-soft); cursor: help; }
.item[aria-current=true] { background: var(--spruce-wash); box-shadow: inset 4px 0 0 var(--spruce); }

/* Map: clean khaki land, sage water, no texture by default */
.mapwrap { background: var(--water); }
.county { fill: var(--land); stroke: var(--county); stroke-width: .9; }
.county:hover { fill: #E3D8AC; stroke: var(--ink-soft); }
.county-hatch { display: none; }
#map.show-coverage .county-hatch { display: inline; }
.county-count { cursor: pointer; }
.county-count-box { fill: var(--paper-deep); stroke: var(--ink-soft); stroke-width: 1; }
.county-count text { fill: var(--ink); font: 700 11px var(--f-sans); }
.county-count:hover .county-count-box { fill: var(--gold); }
.mk:hover { filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.town text { font-family: var(--f-sans); font-style: normal; fill: var(--ink-soft); font-weight: 500; }

/* Map chrome: rounded, quieter */
.map-tools, .legend, .layers, .timebar, .welcome { border-radius: var(--r-card); box-shadow: var(--shadow); border-color: rgba(30,36,28,.35); }
.map-tools { overflow: hidden; }
.legend { top: auto; bottom: 72px; left: var(--s-4); max-width: 330px; }
.legend[open] { width: 330px; }
.legend summary { font-family: var(--f-display); font-size: 1rem; }
.legend-body { display: block; }
.legend .row { align-items: flex-start; gap: 10px; margin: 6px 0; line-height: 1.35; }
.legend .more { margin-top: 6px; border-top: 1px solid var(--rule); padding-top: 6px; }
.legend .more summary { font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 600; color: var(--spruce); padding: 2px 0; }
.timebar { right: auto; padding: 6px; border: 1px solid rgba(30,36,28,.35); }
.timebar:has(#timeCtl:not([hidden])) { right: var(--s-4); padding: 8px 12px; }
.time-toggle { border-color: var(--spruce); color: var(--spruce); }
.time-toggle[aria-pressed=true] { background: var(--spruce); color: var(--gold); }
#year { accent-color: var(--spruce); }
.layers .check { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 0 0 4px; }
.layers h3 { margin-top: 10px; }

/* Welcome card: the one thing to read first */
.welcome { position: absolute; left: var(--s-4); top: var(--s-4); width: min(380px, calc(100% - 96px)); background: var(--paper-lift); border: 1px solid rgba(30,36,28,.35); padding: var(--s-4) var(--s-4) var(--s-3); z-index: 4; }
.welcome[hidden], .welcome.tucked { display: none; }
.welcome h2 { font-size: 1.75rem; line-height: 1.05; color: var(--spruce); margin: 0 28px 8px 0; }
.welcome p { font-size: var(--t-sm); margin: 0 0 10px; }
.welcome .muted { color: var(--ink-soft); font-size: var(--t-xs); }
.w-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.welcome .close-x { position: absolute; right: 8px; top: 8px; }
.w-short { display: none; }
.close-x { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 50%; font-size: 14px; cursor: pointer; color: var(--ink-soft); }
.close-x:hover { background: var(--paper-deep); color: var(--ink); }

/* Buttons */
.btn { background: var(--spruce); border-color: var(--spruce); color: var(--paper-lift); border-radius: var(--r-control); }
.btn:hover { background: #24402A; }
.btn.ghost { background: transparent; color: var(--spruce); border-color: var(--spruce); }

/* Story: poster plate, plain lede, research tucked away */
.story { background: var(--paper-lift); border-left: 1px solid var(--rule); }
.story-top { border-bottom: 0; padding: 8px var(--s-3) 0 var(--s-4); }
.plate { margin: 4px var(--s-4) 0; background: var(--spruce); background-image: none; border: 0; border-radius: var(--r-card); aspect-ratio: 16/8; }
.plate .pl-name { color: var(--gold); font-size: var(--t-xxl); font-weight: 700; }
.plate .pl-sub { color: var(--paper-lift); font-family: var(--f-sans); font-size: var(--t-xs); }
.plate .pl-cap { top: 10px; bottom: auto; left: auto; right: 14px; color: rgba(246,241,226,.75); font-size: .6875rem; }
.story h2.name { font-size: 1.9rem; line-height: 1.08; margin-top: 2px; }
.story .place { margin-bottom: 10px; }
.story .lede { font-size: var(--t-lg); line-height: 1.45; margin: 0 0 var(--s-4); }
.story .lede abbr { text-decoration: none; }
.facts { border-top: 2px solid var(--spruce); border-bottom: 1px solid var(--rule); }
.story h3 { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; color: var(--spruce); }
.story-actions { border-top: 0; margin-top: var(--s-4); padding-top: 0; }
.howknow { margin-top: var(--s-5); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 4px 0; }
.howknow > summary { cursor: pointer; padding: 10px 0; font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; color: var(--spruce); }
.howknow[open] > summary { margin-bottom: 4px; }
.howknow .srclist { margin: 0 0 var(--s-3); padding-left: 1.2em; }
.howknow .srclist li { margin: 2px 0; }
.story-actions { align-items: center; }
.sure { background: var(--spruce-wash); border-color: var(--spruce); border-radius: var(--r-card); margin-top: 0; }
.sure h3 { color: var(--spruce); }
.tag { color: var(--patch-red); }
.aka { font-family: var(--f-sans); }
.ev .ex { font-family: var(--f-serif); font-style: italic; }
.credit { font-family: var(--f-sans); }

@media (max-width: 820px) {
  .bar { flex-wrap: wrap; }
  .brand { font-size: 1.15rem; }
  .bar-btn { order: 4; }
  .search { order: 3; flex: 1 1 60%; }
  .bar-actions .pill { display: none; }
  .bar-actions #aboutBtn { display: none; }
  .filters .field { flex: 1 1 45%; }
  .welcome { width: auto; right: var(--s-3); left: var(--s-3); top: var(--s-3); padding: 12px 14px 10px; }
  .welcome h2 { font-size: 1.3rem; }
  .w-long, .welcome .muted { display: none; }
  .w-short { display: block; }
  body.sheet-open .welcome { display: none; }
  .legend { bottom: 66px; left: var(--s-3); }
  .legend[open] { width: calc(100% - 24px); max-width: none; }
  .story .lede { font-size: var(--t-md); }
}
.mapwrap:has(#timeCtl:not([hidden])) .legend { bottom: 132px; }
@media (max-width: 820px) { .mapwrap:has(#timeCtl:not([hidden])) .legend { bottom: 150px; } }

/* Field Atlas: a poster masthead, an open map and an editorial index. */
.bar { min-height: 84px; padding: 16px 28px; gap: 24px; background: var(--spruce); border-bottom: 1px solid #799184; }
.brand a { display: flex; align-items: center; gap: 12px; color: var(--paper-lift); }
.brand-mark { display: grid; place-items: center; width: 40px; height: 44px; border: 1px solid var(--gold); color: var(--gold); font: 700 38px/.9 var(--f-display); clip-path: polygon(0 0,100% 0,100% 82%,50% 100%,0 82%); padding-bottom: 4px; }
.brand-text { font: 700 25px/1 var(--f-display); }
.brand-sub { display: block; margin-top: 7px; font: 400 11px/1.3 var(--f-sans); color: #DBE3D6; }
.search { margin-left: auto; max-width: 360px; background: #294E43; color: #E2E8DA; border: 1px solid #82978A; border-radius: 2px; }
.search input { color: var(--paper-lift); padding: 11px 0; font-size: 14px; }
.search input::placeholder { color: #E2E8DA; opacity: 1; }
.bar-actions { margin-left: 0; gap: 22px; }
.bar-link { font-size: 13px; text-decoration: none; }
.bar-btn { min-height: 42px; border-radius: 2px; }
.pill { font-size: 11px; border-radius: 2px; padding: 6px 9px; }
.rail { background: var(--paper); }
.atlas-title { flex: none; padding: 26px 28px 23px; position: relative; background: var(--gold); color: var(--spruce); border-bottom: 1px solid #A88C48; }
.atlas-edition { margin: 0 0 16px; font-size: 12px; }
.atlas-title h2 { font: 800 88px/.78 var(--f-display); letter-spacing: -2px; }
.atlas-period { display: block; font: 600 27px/1 var(--f-display); letter-spacing: 0; margin-top: 16px; }
.atlas-deck { margin: 17px 0 0; font: 500 17px/1.3 var(--f-serif); }
.welcome { position: relative; inset: auto; width: auto; padding: 18px 28px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; box-shadow: none; background: var(--paper); flex: none; }
.welcome h2 { font: 600 21px/1.1 var(--f-display); margin: 0 20px 6px 0; }
.welcome p { font-size: 12px; line-height: 1.5; }
.welcome .muted { display: none; }
.welcome .w-acts { margin: 12px 0 0; }
.welcome .btn { font-size: 11px; padding: 7px 10px; }
.welcome .close-x { right: 12px; top: 12px; }
.tabs { padding: 0; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); }
.tabs [role=tab] { border-radius: 0; padding: 14px 8px; font-size: 12px; }
.tabs [role=tab][aria-selected=true] { background: var(--paper-lift); box-shadow: inset 0 -3px 0 var(--spruce); }
.tabs .n { margin-left: 4px; font-variant-numeric: tabular-nums; }
.rail-head { padding: 10px 24px; }
.count { font-size: 11px; }
.group-h { padding: 12px 24px 8px; font: 600 18px/1.1 var(--f-display); }
.group-note { padding: 10px 24px; font-size: 11px; }
.item { padding: 15px 24px; gap: 12px; }
.item .t { font-family: var(--f-serif); font-size: 17px; font-weight: 600; }
.item .s { font-size: 11px; line-height: 1.55; margin-top: 5px; }
.item:hover { background: #E8EBDD; }
.item[aria-current=true] { background: #E1E8D9; box-shadow: inset 4px 0 0 var(--spruce); }
.lead summary { padding: 15px 24px; }
.lead .t { font: 600 17px/1.25 var(--f-serif); }
.lead .s { font-size: 11px; margin-top: 5px; }
.mapwrap { background-color: var(--water); background-image: linear-gradient(#FAF8EF0A 1px, transparent 1px), linear-gradient(90deg,#FAF8EF0A 1px,transparent 1px); background-size: 64px 64px; }
.mapwrap::after { content: ''; position: absolute; inset: 16px; border: 1px solid #FAF8EF30; pointer-events: none; }
.map-caption { position: absolute; top: 30px; left: 32px; pointer-events: none; color: var(--paper-lift); display: flex; flex-direction: column; gap: 5px; background: var(--spruce); padding: 12px 16px; border-left: 3px solid var(--gold); }
.map-caption span:first-child { font: 600 27px/1 var(--f-display); }
.map-caption span:last-child { font-size: 11px; color: #F0EDDF; max-width: 155px; }
.map-north { position: absolute; bottom: 32px; right: 32px; color: var(--paper-lift); display: grid; justify-items: center; gap: 5px; pointer-events: none; }
.map-north span { font-size: 11px; }
.map-north svg { width: 18px; height: 34px; }
.county { fill: var(--land); stroke: var(--county); stroke-width: .65; }
.county:hover { fill: #F4E4AA; stroke: var(--spruce); }
.state { stroke: #203F34; stroke-width: 2; filter: drop-shadow(0 4px 2px #19372D40); }
.town text { fill: #3F584B; }
.county-count-box { fill: #FAF8EF; stroke: #56635A; rx: 3px; }
.county-count text { fill: #183F35; }
.map-tools { top: 30px; right: 30px; border: 0; box-shadow: 0 3px 12px #19372D25; border-radius: 3px; }
.map-tools button { width: 40px; height: 42px; }
.map-tools button:hover { background: var(--paper-deep); }
.legend { left: 32px; bottom: 90px; border: 0; box-shadow: 0 3px 12px #19372D25; }
.legend summary { font-family: var(--f-sans); font-size: 12px; }
.timebar { left: 32px; bottom: 32px; border: 0; box-shadow: 0 3px 12px #19372D25; padding: 4px; }
.time-toggle { border: 0; padding: 10px 12px; font-size: 12px; }
.layers { right: 82px; top: 30px; }
.story-top { padding: 12px 24px; border-bottom: 1px solid var(--rule); }
.story-top .link-btn { font-size: 12px; }
.story-body { padding: 24px; }
.story h2.name { font: 700 40px/.98 var(--f-display); margin: 0 0 10px; }
.story .place { font-size: 12px; }
.story .lede { font: 500 20px/1.4 var(--f-serif); margin: 20px 0; }
.story h3, .howknow > summary { font: 600 23px/1.1 var(--f-display); }
.facts { padding: 14px 0; margin: 20px 0; gap: 9px 16px; }
.plate { margin: 20px 24px 0; padding: 26px 22px 22px; border-radius: 0; min-height: 190px; aspect-ratio: auto; background: var(--spruce); border-bottom: 6px solid var(--gold); }
.plate .pl-name { font-size: 64px; text-transform: uppercase; line-height: .86; overflow-wrap: normal; word-break: normal; }
.plate .pl-sub { margin-top: 14px; font-size: 12px; }
.plate .pl-cap { position: static; margin-bottom: 20px; order: -1; font-size: 10px; }
.dlg-head h2 { font-size: 30px; }
.btn, .btn.ghost { border-radius: 2px; }
.tour-step { padding: 24px; }
.tour-step h2 { font-size: 38px; }
.rail, .story, .list { scrollbar-width: thin; scrollbar-color: #A5B19E transparent; }
@media (max-height: 830px) and (min-width: 821px) {
  .atlas-title { padding-top: 20px; padding-bottom: 18px; }
  .atlas-title h2 { font-size: 70px; }
  .atlas-period { font-size: 23px; margin-top: 12px; }
  .atlas-deck { font-size: 15px; margin-top: 12px; }
  .welcome { padding-top: 12px; padding-bottom: 12px; }
  .welcome .w-long { display: none; }
}
@media (min-width: 821px) and (max-width: 1180px) {
  :root { --rail-w: 300px; --story-w: 350px; }
  .bar { gap: 16px; padding-left: 20px; padding-right: 20px; }
  .bar-actions #aboutBtn, .bar-actions .pill { display: none; }
  .atlas-title h2 { font-size: 72px; }
  body.story-open .rail .atlas-title { padding: 20px; }
}
@media (max-width: 820px) {
  body { height: 100dvh; overflow: hidden; }
  .bar { padding: 16px 18px 14px; gap: 14px 12px; }
  .brand { flex: 1; }
  .brand-mark { width: 33px; height: 39px; font-size: 32px; }
  .brand-text { font-size: 26px; }
  .brand-sub { font-size: 10px; margin-top: 5px; }
  .bar-actions { margin: 0; }
  .bar-actions .bar-link { font-size: 11px; max-width: 48px; text-align: right; }
  .search { flex: 1 1 60%; margin: 0; max-width: none; order: 3; }
  .search input { font-size: 16px; padding: 9px 0; }
  .bar-btn { order: 4; padding: 8px 12px; }
  .rail, .mapwrap { bottom: 62px; }
  .atlas-title { padding: 18px 24px; }
  .atlas-title h2 { font-size: 54px; line-height: .86; }
  .atlas-title h2 br { display: none; }
  .atlas-title h2 br::after { content: ' '; }
  .atlas-period { display: inline-block; font-size: 23px; margin: 0 0 0 12px; }
  .atlas-edition, .atlas-deck, .welcome { display: none; }
  body.view-list .rail { display: flex; }
  .map-caption { top: 24px; left: 24px; }
  .map-caption span:first-child { font-size: 30px; }
  .map-caption span:last-child { max-width: 170px; font-size: 10px; }
  .map-tools { top: 24px; right: 24px; }
  .map-tools button { width: 36px; height: 38px; }
  .map-north { right: 24px; bottom: 24px; }
  .mapwrap::after { inset: 12px; }
  .legend { left: 24px; bottom: 77px; }
  .legend[open] { width: calc(100% - 48px); max-height: 65%; overflow: auto; }
  .timebar { left: 24px; bottom: 24px; }
  .timebar:has(#timeCtl:not([hidden])) { right: 24px; }
  .layers { top: 24px; right: 68px; }
  .viewswitch { bottom: 11px; border: 0; border-radius: 3px; box-shadow: none; background: var(--paper-deep); }
  .viewswitch button { padding: 9px 30px; font-size: 12px; }
  .viewswitch button[aria-pressed=true] { background: var(--spruce); color: var(--paper-lift); }
  .story { box-shadow: 0 -8px 30px #183F3530; border-radius: 12px 12px 0 0; }
  .story .lede { font-size: 19px; }
  .story h2.name { font-size: 36px; }
  .plate .pl-name { font-size: 54px; }
}
@media (prefers-reduced-motion: no-preference) {
  .atlas-title { animation: atlas-reveal 550ms ease-out both; }
  @keyframes atlas-reveal { from { opacity: 0; } to { opacity: 1; } }
}

/* Categories and photos (master inventory pass) */
.cats { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 0 8px; }
.cat { flex: 0 0 auto; border: 1px solid var(--spruce); background: transparent; color: var(--spruce); border-radius: var(--r-pill); padding: 3px 9px; font-size: .75rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cat:hover { background: rgba(31,67,52,.08); }
.cat[aria-pressed="true"] { background: var(--spruce); color: var(--paper-lift); }
.item:has(.thumb), .lead summary:has(.thumb) { grid-template-columns: 22px 1fr 64px; align-items: start; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 3px; border: 1px solid var(--rule); background: var(--paper-deep); }
.photo img { max-height: 320px; object-fit: cover; }
.photo .credit a { color: inherit; }

/* New Deal Passport */
.passport { padding: 4px var(--s-4) var(--s-5, 24px); }
.passport h2 { font-family: var(--f-display); font-size: var(--t-xxl); line-height: 1; color: var(--spruce); margin: 6px 0 10px; }
.passport h3 { font-family: var(--f-display); font-size: var(--t-lg, 1.25rem); color: var(--spruce); margin: 22px 0 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
.pp-progress { margin: 14px 0 6px; }
.pp-bar { height: 8px; background: var(--paper-deep); border-radius: 99px; overflow: hidden; }
.pp-bar i { display: block; height: 100%; background: var(--spruce); }
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stamp { position: relative; display: flex; flex-direction: column; width: 100%; text-align: left; background: var(--paper-lift); border: 1.5px dashed var(--spruce); border-radius: 10px; padding: 0 0 10px; overflow: hidden; cursor: pointer; color: var(--ink); }
.stamp:hover { border-style: solid; }
.stamp img, .stamp .noimg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--spruce); background-image: repeating-linear-gradient(135deg, rgba(242,196,91,.18) 0 2px, transparent 2px 10px); }
.stamp .st-t { font-weight: 700; font-size: var(--t-sm); line-height: 1.25; padding: 8px 10px 0; }
.stamp .st-s { font-size: var(--t-xs); color: var(--ink-soft); padding: 2px 10px 0; }
.stamp.done { border: 2px solid var(--rust); }
.stamp .st-mark { position: absolute; top: 10px; right: 10px; transform: rotate(-9deg); border: 2px solid var(--rust); color: var(--rust); background: var(--paper-lift); border-radius: 6px; padding: 3px 7px; font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: center; line-height: 1.2; }
.stampbox { border: 2px dashed var(--spruce); border-radius: 10px; background: rgba(242,196,91,.16); padding: 12px 14px; margin: 12px 0 16px; }
.stampbox .sb-k { margin: 0 0 4px; font-size: var(--t-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--spruce); }
.stampbox p { margin: 0 0 8px; }
.stampbox .sb-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 0; }
#passportBtn .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--gold); color: var(--spruce); font-size: .6875rem; text-decoration: none; text-align: center; }

/* Rail usability pass (Oct 13): the whole rail scrolls; tabs, categories and count stay pinned. */
@media (min-width: 821px) {
  .rail { overflow-y: auto; overscroll-behavior: contain; }
  .rail > .list { overflow: visible; flex: none; min-height: 0; }
  .rail-sticky { position: sticky; top: 0; z-index: 3; background: var(--paper); box-shadow: 0 6px 10px -8px rgba(24,47,42,.35); }
  .atlas-title { padding: 16px 24px 14px; }
  .atlas-title .atlas-edition { margin: 0 0 6px; font-size: 11px; }
  .atlas-title h2 { font-size: 52px; letter-spacing: -1px; line-height: .82; }
  .atlas-title .atlas-period { display: inline-block; font-size: 20px; margin: 0 0 0 10px; }
  .atlas-title h2 br { display: none; }
  .atlas-title .atlas-deck { margin-top: 8px; font-size: 14px; }
  .welcome { padding: 12px 24px; }
  .welcome h2 { font-size: 18px; }
}
@media (min-width: 821px) and (max-height: 760px) {
  .atlas-title .atlas-deck, .atlas-title .atlas-edition { display: none; }
  .atlas-title { padding: 12px 24px; }
}
/* Categories: one row that scrolls sideways (wheel works too), with a fade hinting there is more. */
.cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.cats::-webkit-scrollbar { display: none; }
.cats.at-end { -webkit-mask-image: none; mask-image: none; }
.rail-head { padding-top: 8px; padding-bottom: 8px; }

/* One list: tabs retired, verified badge */
.tabs { display: none !important; }
.verified { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: var(--spruce); color: var(--paper-lift); font: 700 10px/1.5 var(--f-sans); letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.story-top .verified { margin-left: 0; }
@media (min-width: 821px) { .atlas-title .atlas-period { display: block; margin: 6px 0 0; font-size: 18px; } }

/* ===== Public pass (Oct 13 evening) ===== */
/* Statewide overview: county shading and one count per county */
.choro-c { fill: var(--spruce); stroke: none; pointer-events: none; transition: fill-opacity .25s; }
.county-total { cursor: pointer; }
.county-total-box { fill: var(--paper-lift); stroke: var(--spruce); stroke-width: 1.2; }
.county-total text { font: 700 10px/1 var(--f-sans); fill: var(--spruce); }
.county-total:hover .county-total-box, .county-total:focus .county-total-box { fill: var(--gold); }
.map-hint { position: absolute; left: 50%; transform: translateX(-50%); top: 16px; margin: 0; background: var(--paper-lift); color: var(--ink); border: 1px solid var(--rule); border-radius: 99px; padding: 6px 14px; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); pointer-events: none; white-space: nowrap; max-width: calc(100% - 140px); overflow: hidden; text-overflow: ellipsis; }
body:not(.map-overview) .legend .ov-only { display: none; }
.star-mk { cursor: pointer; }
.star-mk:hover path, .star-mk:focus path { stroke-width: 2.4; }
/* Header link that is a real link */
a.bar-link { text-decoration: none; display: inline-block; }
/* Cards for nearby / tours / county lists */
.cards { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card { display: flex; flex-direction: column; width: 100%; text-align: left; background: var(--paper-lift); border: 1px solid var(--rule); border-radius: 8px; padding: 0 0 8px; overflow: hidden; cursor: pointer; color: var(--ink); font: inherit; }
.card:hover, .card:focus-visible { border-color: var(--spruce); }
.card img, .card .noimg { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--paper-deep); background-image: repeating-linear-gradient(135deg, rgba(24,63,53,.08) 0 2px, transparent 2px 9px); }
.card .ct { font-weight: 700; font-size: 13px; line-height: 1.25; padding: 6px 8px 0; }
.card .cs { font-size: 11.5px; color: var(--ink-soft); padding: 2px 8px 0; }
.cats.wrap { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; margin: 4px 0 8px; }
.cat .n { font-weight: 500; opacity: .8; margin-left: 2px; }
/* 1930s photo label */
.photo { position: relative; }
.photo .era { position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--ink); color: var(--paper-lift); font: 700 11px/1 var(--f-sans); letter-spacing: .04em; text-transform: uppercase; padding: 5px 8px; border-radius: 3px; }
/* Passport extras */
.stampbox .sb-look { font-size: 13px; color: var(--ink-soft); }
.pp-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.pp-rh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-top: 1px solid var(--rule); margin-top: 22px; padding-top: 12px; }
.pp-rh h3 { border: 0; margin: 0; padding: 0; }
.pp-rh .link-btn { font-size: 13px; white-space: nowrap; }
/* Phone: bigger tap targets */
@media (max-width: 820px) {
  .cat { min-height: 36px; padding: 6px 12px; }
  .bar-actions .bar-link { min-height: 36px; display: inline-flex; align-items: center; }
  .map-hint { top: auto; bottom: 120px; font-size: 11px; white-space: normal; text-align: center; max-width: 80%; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Print a paper passport */
.print-only { display: none; }
@media print {
  body.printing-passport > *:not(#printPassport) { display: none !important; }
  body.printing-passport #printPassport { display: block !important; color: #000; font-family: var(--f-sans); }
  #printPassport .pp-cover { page-break-after: always; text-align: center; padding-top: 30vh; }
  #printPassport h1 { font: 800 56px/1 var(--f-display); margin: 8px 0 16px; }
  #printPassport .pp-k { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
  #printPassport .pp-owner { margin-top: 48px; }
  #printPassport .pp-url { margin-top: 24px; font-size: 12px; }
  #printPassport .pp-region { page-break-inside: avoid; margin-bottom: 18px; }
  #printPassport h2 { font: 700 26px/1 var(--f-display); border-bottom: 2px solid #000; padding-bottom: 4px; }
  #printPassport .pp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  #printPassport .pp-box { border: 1.5px dashed #000; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 3px; font-size: 11px; page-break-inside: avoid; }
  #printPassport .pp-ring { width: 74px; height: 74px; border: 1.5px solid #000; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; font-size: 10px; text-align: center; }
  #printPassport .pp-box b { font-size: 13px; }
  #printPassport .pp-look { font-style: italic; }
}
@media print { body.printing-passport { background: #fff !important; } }

.f.check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; }
.f.check input { margin-top: 3px; width: auto; }
.list-tools { padding: 8px 16px 0; }
