/* Local History Hub — one stylesheet, organized top to bottom:
   tokens · base · components · header · pages · map · responsive */

/* ---------- tokens ---------- */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --surface-3: #e6e1d6;
  --ink: #1d2126;
  --ink-2: #464c54;
  --ink-3: #646a73;  /* 4.5:1 on --bg */
  --line: #e2dccf;
  --line-2: #cdc5b4;
  --brand: #1f4e5f;
  --brand-2: #163c49;
  --brand-soft: #e2ecee;
  --focus: #2b7a93;
  --danger: #a33a2b;

  --place: #2f6b4f;  --place-soft: #e3efe8;
  --person: #7b3f72; --person-soft: #f3e7f0;
  --event: #b4472d;  --event-soft: #f8e7e1;
  --photo: #85590b;  --photo-soft: #f6eddb;
  --story: #2e5c8a;  --story-soft: #e3ebf5;
  --document: #595650; --document-soft: #ebe8e1;
  --album: #5b4f8a;  --album-soft: #ebe9f5;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(29, 33, 38, .05), 0 4px 14px rgba(29, 33, 38, .06);
  --shadow-lg: 0 12px 40px rgba(29, 33, 38, .2);
  --topbar: 60px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 820px; }
.wrap--form { max-width: 860px; padding-bottom: 48px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.icon { flex: none; vertical-align: middle; }
.img-missing { opacity: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 36px 0 22px; flex-wrap: wrap; }
.page-head--center { justify-content: center; text-align: center; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-title { font: 500 clamp(30px, 4vw, 42px)/1.1 var(--serif); letter-spacing: -.01em; margin-bottom: 8px; }
.page-lede { font-size: 17px; color: var(--ink-2); max-width: 62ch; margin: 0; }
.section-title, .section-head h2 { font: 500 23px/1.25 var(--serif); display: flex; align-items: center; gap: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head__links { display: flex; gap: 14px; font-size: 14px; }
.section-head__links a { display: inline-flex; align-items: center; gap: 4px; }
.count { font: 600 12px/1 var(--sans); color: var(--ink-3); background: var(--surface-2); border-radius: 999px; padding: 4px 8px; }
.count:empty { display: none; }

.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink-3); padding-top: 22px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs > * { min-width: 0; }
/* What members write can hold a long web address or an unbroken word: let it break instead of
   pushing its box (and the page) wider than a phone. */
.page-title, .record__title, .card__title, .crumbs, .prose, .post__body, .comment__text, .reply__text,
.feed__line, .feed__quote, .feed__many, .resource__name, .resource__about, .resource__holdings,
.request-list__message, .town-groups__list { overflow-wrap: anywhere; }

/* ---------- components ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ink-3); }
.dot--place { background: var(--place); } .dot--person { background: var(--person); }
.dot--event { background: var(--event); } .dot--photo { background: var(--photo); } .dot--story { background: var(--story); }
.dot--album { background: var(--album); }
.dot--document { background: var(--document); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 11.5px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 7px 4px 6px; border-radius: 4px;
}
.badge--place { color: var(--place); background: var(--place-soft); }
.badge--person { color: var(--person); background: var(--person-soft); }
.badge--event { color: var(--event); background: var(--event-soft); }
.badge--photo { color: var(--photo); background: var(--photo-soft); }
.badge--story { color: var(--story); background: var(--story-soft); }
.badge--document { color: var(--document); background: var(--document-soft); }
.badge--album { color: var(--album); background: var(--album-soft); }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 12px/1 var(--sans); padding: 4px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
.pill--standing { background: var(--place-soft); color: var(--place); }
.pill--demolished, .pill--ruins { background: var(--surface-3); color: var(--ink-2); }
.pill--help, .pill--identification { background: var(--photo-soft); color: var(--photo); }
.pill--memory { background: var(--story-soft); color: var(--story); }
.pill--correction { background: var(--event-soft); color: var(--event); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; line-height: 1.2; text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--ink); white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-2); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { background: var(--surface); border-color: var(--ink-3); color: var(--ink); }
.btn--ghost[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.btn--danger:hover { color: var(--danger); border-color: var(--danger); }
.btn--sm { padding: 6px 11px; font-size: 13.5px; border-radius: 7px; }
.btn--block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .count { background: rgba(0, 0, 0, .06); padding: 3px 6px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand); cursor: pointer; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }

.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; letter-spacing: .02em;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar--md { width: 38px; height: 38px; font-size: 13.5px; }
.avatar--lg { width: 84px; height: 84px; font-size: 28px; }
.user-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.user-link:hover { text-decoration: underline; color: var(--ink); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel--flush { padding: 0; overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel__head h2, .panel__title { font: 600 13px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.panel__head h2 { margin: 0; }
.panel__more { display: inline-block; margin-top: 12px; font-size: 14px; }

.empty { text-align: center; padding: 56px 24px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.empty p { font-size: 16px; }

/* thumbnails */
.thumb { width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.thumb--empty { display: grid; place-items: center; }
.thumb--place { background: var(--place-soft); color: var(--place); }
.thumb--person { background: var(--person-soft); color: var(--person); }
.thumb--event { background: var(--event-soft); color: var(--event); }
.thumb--photo { background: var(--photo-soft); color: var(--photo); }
.thumb--story { background: var(--story-soft); color: var(--story); }
.thumb--document { background: var(--document-soft); color: var(--document); }
.thumb--album { background: var(--album-soft); color: var(--album); }
.thumb--sm { width: 48px; height: 48px; border-radius: var(--radius-sm); flex: none; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.grid--compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-2); color: var(--ink); }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.grid--photos .card__media { aspect-ratio: 4 / 3; }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card__phrase { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--ink-3); }
.card__title { font: 500 18.5px/1.25 var(--serif); }
.card__summary { font-size: 13.5px; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__town { margin-top: auto; padding-top: 4px; display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-3); }

/* compact rows */
.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }  /* long titles shorten with an ellipsis instead of widening the page */
.row { display: flex; align-items: center; gap: 6px; border-radius: 8px; }
.row:hover { background: var(--surface); }
.row__main { display: flex; align-items: center; gap: 12px; padding: 7px 8px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.row__text { display: flex; flex-direction: column; min-width: 0; }
.row__phrase { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.row__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { font-size: 13px; color: var(--ink-3); }
.row__remove { opacity: 0; }
.row:hover .row__remove, .row__remove:focus-visible { opacity: 1; }

/* flashes */
.flashes { position: fixed; top: calc(var(--topbar) + 12px); left: 50%; transform: translateX(-50%); z-index: 1500; display: grid; gap: 8px; width: min(560px, calc(100% - 32px)); }
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg);
  animation: flash-in .2s ease-out;
}
.flash .icon-btn { color: #fff; }
.flash .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.flash--success { background: #24553f; }
.flash--error { background: #8c3124; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { font-size: 12.5px; }
.field input, .field select, .field textarea, .toolbar select, .notice select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
.field abbr { color: var(--danger); text-decoration: none; }
.field--inline { flex-direction: row; align-items: center; gap: 8px; }
.field--inline > span { font-size: 13.5px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.field--inline select { width: auto; padding: 6px 30px 6px 10px; }
.field--fill select { flex: 1; min-width: 0; }  /* long options: fill the row instead of running past it */
.field--quiet select { border-color: transparent; background-color: transparent; font-weight: 600; font-size: 13.5px; }
.field--search { position: relative; }
.field--search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.field--search input { padding-left: 34px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); }
.form-error { color: var(--danger); font-size: 14px; margin: 0; min-height: 0; }
.form-error:empty { display: none; }

.form { display: grid; gap: 22px; }
.wrap--form .page-lede + .form, .wrap--form .page-title + .form { margin-top: 24px; }
.form__section { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 18px 20px 20px; margin: 0; display: grid; gap: 16px; min-width: 0; }
/* float keeps the legend inside the card instead of straddling its border */
.form__section legend { float: left; width: 100%; padding: 0; font: 500 21px/1.2 var(--serif); }
.form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form__help { margin: -6px 0 0; font-size: 13.5px; }
.form__actions { display: flex; justify-content: flex-end; gap: 10px; }

.notice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-2); }
.notice select { width: auto; display: inline-block; margin: 0 4px; padding: 5px 8px; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: 9px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); }
.segmented--sm span { padding: 4px 10px; font-size: 13px; }

.upload { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.upload__preview { width: 180px; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.upload__drop {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 14px; padding: 18px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); cursor: pointer; color: var(--ink-2);
  position: relative;
}
.upload__drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload__drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload__drop .icon { color: var(--photo); }
.upload__drop--file { flex: none; }
.upload__drop--file .icon { color: var(--ink-2); }
.form__current { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 14px; color: var(--ink-2); }
.check--inline { display: inline-flex; margin-left: 6px; }
.picker-map { height: 340px; border-radius: 8px; border: 1px solid var(--line); }
.picker-map__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.chip[aria-pressed="false"] { background: transparent; color: var(--ink-3); border-style: dashed; }
.chip[aria-pressed="false"] .dot { opacity: .35; }
.chip[aria-pressed="true"] { color: var(--ink); }
.chip__count { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.chip--check input { position: absolute; opacity: 0; pointer-events: none; }
.chip--check:has(input:not(:checked)) { background: transparent; color: var(--ink-3); border-style: dashed; }
.chip--check:has(input:not(:checked)) .dot { opacity: .35; }
.chip--check:has(input:focus-visible) { outline: 2px solid var(--focus); }
.chips--sm .chip { padding: 4px 9px; font-size: 12.5px; }

.toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 0 22px; border-top: 1px solid var(--line); }
.pager { display: flex; justify-content: center; gap: 10px; padding: 28px 0 48px; }

/* dialogs */
.dialog { border: 0; padding: 0; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 48px); color: var(--ink); }
.dialog::backdrop { background: rgba(20, 24, 28, .45); }
.dialog__inner { display: grid; gap: 14px; padding: 20px 22px 22px; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; }
.dialog__head h2 { font: 500 23px/1.2 var(--serif); }
.dialog__inner > p { margin: 0; }
.dialog__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; font-size: 13.5px; }
.picker { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow-y: auto; }
.picker:empty { display: none; }
.picker li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.picker li:hover, .picker li:focus-visible { background: var(--surface-2); outline: none; }
.picker li[aria-selected="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.picker img, .picker__icon { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; }
.picker strong { display: block; font-size: 14.5px; }
.picker small { color: var(--ink-3); font-size: 12.5px; }
.picker__empty { color: var(--ink-3); cursor: default !important; }
.connect-sentence { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 14.5px; }
.connect-sentence select { width: auto; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); font-weight: 600; }
.connect-step { display: grid; gap: 12px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1200; height: var(--topbar);
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand__name { font: 600 21px/1 var(--serif); letter-spacing: -.01em; }
.brand__region { font-size: 12px; font-weight: 600; color: var(--ink-3); border-left: 1px solid var(--line-2); padding-left: 10px; }
.nav-toggle { display: none; margin-left: auto; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav > a, .nav__menu > summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; list-style: none; white-space: nowrap;
}
.nav__menu > summary::-webkit-details-marker { display: none; }
.nav > a:hover, .nav__menu > summary:hover { background: var(--surface-2); color: var(--ink); }
.nav [aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.nav__menu { position: relative; }
.nav__dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; z-index: 1100;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px;
  display: grid;
}
.nav__dropdown--right { left: auto; right: 0; }
.nav__dropdown a, .nav__dropdown button {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; border: 0; background: none;
  color: var(--ink); text-decoration: none; font-size: 14px; text-align: left; width: 100%; cursor: pointer;
}
.nav__dropdown a:hover, .nav__dropdown button:hover { background: var(--surface-2); }
.nav__who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.nav__who span { color: var(--ink-3); font-size: 13px; }
.nav__menu--user > summary { padding: 2px; border-radius: 50%; }
.nav__search { position: relative; margin-left: auto; width: min(300px, 26vw); }
.nav__search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.nav__search input { width: 100%; padding: 8px 12px 8px 33px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 14px; }
.nav__search input:focus { background: var(--surface); outline: 2px solid var(--focus); outline-offset: -1px; }
.nav__actions { display: flex; align-items: center; gap: 8px; margin-left: 10px; }

.region-switch { flex: none; }
.region-switch > summary {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 8px; cursor: pointer; list-style: none;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.region-switch > summary::-webkit-details-marker { display: none; }
.region-switch > summary:hover { background: var(--surface-2); color: var(--ink); }
.region-switch > summary span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.region-switch > summary .icon { flex: none; }
.region-switch .nav__dropdown [aria-current="page"] { font-weight: 700; color: var(--brand); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 26px 0 32px; margin-top: 48px; font-size: 14px; color: var(--ink-2); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.footer__small { font-size: 12.5px; color: var(--ink-3); }

/* ---------- explore (home map) ---------- */
.page-explore { height: 100vh; overflow: hidden; }
.explore { display: grid; grid-template-columns: 390px 1fr; height: calc(100vh - var(--topbar)); }
.explore__panel { overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; }
.explore__map { position: relative; }
.explore__map .map { position: absolute; inset: 0; }

.intro { position: relative; margin: 16px 16px 0; padding: 18px 20px; border-radius: 12px; background: var(--brand); color: #fff; }
.intro h1 { font: 500 24px/1.15 var(--serif); margin: 0 26px 8px 0; }
.intro p { font-size: 14px; color: rgba(255, 255, 255, .85); }
.intro__close { position: absolute; top: 10px; right: 10px; color: rgba(255, 255, 255, .8); }
.intro__close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.intro__actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.intro__link { color: #fff; font-size: 13.5px; font-weight: 600; }
.intro__link:hover { color: #fff; }
.btn--light { background: #fff; color: var(--brand); }
.btn--light:hover { background: var(--brand-soft); color: var(--brand-2); }

.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); }
.filters__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.era { display: grid; gap: 6px; }
.era__head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.era__head output { color: var(--ink); margin-right: auto; }
.era__track { position: relative; height: 26px; }
.era__track::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.era__fill { position: absolute; top: 11px; height: 4px; border-radius: 2px; background: var(--brand); }
.era__track input {
  position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.era__track input::-webkit-slider-runnable-track { background: none; height: 26px; }
.era__track input::-moz-range-track { background: none; }
.era__track input::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); cursor: grab;
}
.era__track input::-moz-range-thumb {
  pointer-events: auto; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand); cursor: grab;
}
.era__ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); padding: 0 2px; }
.era__ticks span:nth-child(2) { margin-left: 10%; } /* ticks sit at 1800/1900/2000 on a 1700–2030 scale */

.results__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 4px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.results { list-style: none; margin: 0; padding: 4px 8px 16px; }
.results li { display: flex; align-items: center; border-radius: 10px; }
.results li:hover { background: var(--surface); }
.result { display: flex; align-items: center; gap: 12px; padding: 8px; flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
.result__img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; }
.result__text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.result__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.result__title { font: 500 16.5px/1.25 var(--serif); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.result__town { font-size: 12.5px; color: var(--ink-3); }
.result__folded { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--photo); }
.result__locate { margin-right: 6px; opacity: 0; }
.results li:hover .result__locate, .result__locate:focus-visible { opacity: 1; }
.results__empty, .results__more { padding: 20px 12px; color: var(--ink-3); font-size: 14px; }
/* Phones only (see the responsive section): the sheet's handle and the folded filters */
.sheet__handle, .filters__toggle { display: none; }
.filters__more { display: contents; }

.legend {
  position: absolute; left: 12px; bottom: 26px; z-index: 500; display: flex; gap: 12px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .94); padding: 7px 12px; border-radius: 8px; box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.legend > span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- leaflet additions ---------- */
.map { background: #e8e4da; }
.leaflet-container { font-family: var(--sans); }
.leaflet-control-layers, .leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 8px !important; }
.leaflet-control-attribution { font-size: 10.5px; background: rgba(255, 255, 255, .8) !important; }

.pin { background: none; border: 0; }
.pin__dot {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: transform .12s;
}
.pin:hover .pin__dot { transform: scale(1.15); }
/* photos + stories folded into this pin */
.pin__badge, .legend__badge {
  display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; border: 1.5px solid #fff; background: var(--photo); color: #fff;
  font: 700 10px/1 var(--sans); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.pin__badge { position: absolute; top: -7px; right: -9px; pointer-events: none; }
.pin--place { background: var(--place); } .pin--person { background: var(--person); }
.pin--event { background: var(--event); } .pin--photo { background: var(--photo); } .pin--story { background: var(--story); }
.pin--document { background: var(--document); } .pin--album { background: var(--album); }
/* A photo with a spot of its own: a small print on a stem whose tip marks the spot */
.photo-pin { background: none; }
.photo-pin__frame {
  position: absolute; left: 1px; top: 0; display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden;
  border: 2px solid #fff; border-radius: 7px; background: var(--photo-soft); color: var(--photo);
  box-shadow: 0 0 0 1.5px var(--photo), 0 2px 6px rgba(0, 0, 0, .35); transition: transform .12s;
}
.photo-pin__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-pin__frame img.img-missing { visibility: hidden; }
.photo-pin::before { content: ""; position: absolute; left: 21px; top: 43px; width: 2px; height: 8px; background: var(--photo); }
.photo-pin::after { content: ""; position: absolute; left: 18.5px; top: 49px; width: 7px; height: 7px; border-radius: 50%; background: var(--photo); border: 1.5px solid #fff; box-sizing: border-box; }
.photo-pin:hover .photo-pin__frame { transform: scale(1.12) translateY(-2px); }
.photo-pin .pin__badge { top: -8px; right: -8px; }
.photo-pin--stack .photo-pin__frame { box-shadow: 0 0 0 1.5px var(--photo), 4px -4px 0 -1px #fff, 4px -4px 0 .5px var(--photo), 0 2px 6px rgba(0, 0, 0, .35); }
.photo-pin__count {
  position: absolute; top: -9px; right: -10px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; border: 1.5px solid #fff; background: var(--ink); color: #fff; font: 700 11px/1 var(--sans); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.is-highlighted .photo-pin__frame { transform: scale(1.25) translateY(-4px); box-shadow: 0 0 0 1.5px var(--photo), 0 0 0 5px rgba(31, 78, 95, .35), 0 2px 6px rgba(0, 0, 0, .35); }
.legend__photo { display: inline-block; width: 14px; height: 14px; border: 1.5px solid #fff; border-radius: 3px; background: var(--photo-soft); box-shadow: 0 0 0 1.5px var(--photo); }
.cluster { background: none; }
.cluster .pin__badge { top: -5px; right: -7px; }
.cluster__ring { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 1px 5px rgba(0, 0, 0, .3); transition: transform .12s; }
.cluster__count { display: grid; place-items: center; width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; background: #fff; font-weight: 700; font-size: 13px; color: var(--ink); }
.cluster:hover .cluster__ring { transform: scale(1.08); }
.is-highlighted .pin__dot, .is-highlighted .cluster__ring { transform: scale(1.3); box-shadow: 0 0 0 4px rgba(31, 78, 95, .35), 0 2px 6px rgba(0, 0, 0, .35); }
.is-highlighted { z-index: 10000 !important; }

.town-label { pointer-events: none; display: none !important; }
.show-town-labels .town-label { display: grid !important; place-items: center; }
.town-label span {
  font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--brand-2);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff; white-space: nowrap;
}

.popup-wrap .leaflet-popup-content-wrapper { padding: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); }
.popup-wrap .leaflet-popup-content { margin: 0; width: 280px !important; }
.popup { display: block; color: var(--ink); }
/* .leaflet-container a (Leaflet's default link color) would otherwise win */
.leaflet-container .popup__main { display: block; color: var(--ink); text-decoration: none; }
.leaflet-container .popup__main:hover { color: var(--ink); }
.popup__main:hover .popup__title { text-decoration: underline; }
.popup__img { width: 100%; height: 150px; object-fit: cover; }
.popup__body { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px 10px; align-items: flex-start; }
.popup__title { font: 500 18px/1.25 var(--serif); }
.popup__meta { font-size: 12.5px; color: var(--ink-3); }
.popup__summary { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.popup__via { font-size: 12px; color: var(--ink-3); font-style: italic; }
.leaflet-container .popup__open { display: block; padding: 0 14px 14px; font-size: 13px; font-weight: 700; color: var(--brand); text-decoration: none; }
.popup__folded { display: grid; gap: 8px; margin: 0 14px 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.popup__gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.popup__gallery a { display: block; aspect-ratio: 1; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.popup__gallery img { width: 100%; height: 100%; object-fit: cover; }
.leaflet-container .popup__count { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--photo); text-decoration: none; }
.popup__count:hover { text-decoration: underline; }

/* ---------- record page ---------- */
.record__head { background: var(--surface); border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.record--place .record__head { box-shadow: inset 0 4px 0 var(--place); }
.record--person .record__head { box-shadow: inset 0 4px 0 var(--person); }
.record--event .record__head { box-shadow: inset 0 4px 0 var(--event); }
.record--photo .record__head { box-shadow: inset 0 4px 0 var(--photo); }
.record--story .record__head { box-shadow: inset 0 4px 0 var(--story); }
.record--document .record__head { box-shadow: inset 0 4px 0 var(--document); }
.record--album .record__head { box-shadow: inset 0 4px 0 var(--album); }
.record__kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 10px; }
.record__date { font-weight: 600; color: var(--ink-2); }
.record__title { font: 500 clamp(32px, 4.6vw, 50px)/1.08 var(--serif); letter-spacing: -.015em; max-width: 24ch; }
.record__aka { margin: 8px 0 0; color: var(--ink-3); font-style: italic; }
.record__lede { font: 400 20px/1.45 var(--serif); color: var(--ink-2); max-width: 60ch; margin: 12px 0 0; }
.record__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.record__actions form { display: contents; }
.record__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding-top: 28px; }
.record__main { display: grid; gap: 34px; align-content: start; min-width: 0; }
.record__aside { display: grid; gap: 16px; align-content: start; }

.prose { font: 400 18.5px/1.65 var(--serif); color: var(--ink); max-width: 68ch; }
.prose p { margin: 0 0 1em; }
.prose h2 { font: 500 26px/1.2 var(--serif); margin: 1.4em 0 .5em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }

.cover { margin: 0; }
.cover-empty {
  height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: #fbfaf7;
  color: var(--ink-2); text-decoration: none; font-size: 14px; text-align: center; padding: 0 16px;
}
.cover-empty .icon { color: var(--photo); }
.cover-empty strong { color: var(--ink); font-size: 15px; }
.cover-empty:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--ink-2); }
.cover img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); }
.cover__open { position: relative; display: block; line-height: 0; cursor: zoom-in; }
.cover__hint {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px;
  border-radius: 8px; background: rgba(20, 24, 28, .72); color: #fff; font: 600 13px/1 var(--sans);
}
.cover__open:hover .cover__hint { background: rgba(20, 24, 28, .9); }
.cover figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }

.photo { margin: 0; }
.tagger { position: relative; display: inline-block; max-width: 100%; border-radius: var(--radius); overflow: hidden; background: #1d2126; line-height: 0; }
.tagger img { max-height: 78vh; width: auto; max-width: 100%; margin: 0 auto; }
.tagger.is-tagging img { cursor: crosshair; }
.tagger.is-tagging::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--photo); pointer-events: none; }
.tag-dot {
  position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; background: var(--person); color: #fff; font: 700 12px/1 var(--sans);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 5px rgba(0, 0, 0, .5); transition: transform .12s;
}
.tag-dot.is-unknown { background: var(--photo); }
.tag-dot:hover, .tag-dot.is-active { transform: translate(-50%, -50%) scale(1.3); }
.tagger.is-tagging .tag-dot { pointer-events: none; opacity: .6; }
.tagger__hint {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); line-height: 1.4;
  background: rgba(20, 24, 28, .85); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; white-space: nowrap;
}
.tagger__hint .link-btn { color: #fff; margin-left: 6px; }
.photo__credit { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.photo__credit a { display: inline-flex; align-items: center; gap: 3px; }

.tag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tag-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.tag-list li.is-active { background: var(--surface-2); }
.tag-list__num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--person); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.tag-list__num.is-unknown { background: var(--photo); }
.tag-list__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13.5px; }

.connections__group { margin-bottom: 18px; }
.connections__type { display: flex; align-items: center; gap: 8px; font: 600 12.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-strip__item { position: relative; }
.photo-strip__item a { display: block; text-decoration: none; color: var(--ink); cursor: zoom-in; }
.photo-strip__item .thumb { transition: transform .15s; }
.photo-strip__item a:hover .thumb { transform: scale(1.03); }
.photo-strip__item a:hover .photo-strip__cap { text-decoration: underline; }
.connections__slideshow { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font: 600 13px/1 var(--sans); letter-spacing: 0; text-transform: none; }
.photo-strip__item .thumb { aspect-ratio: 4 / 3; border-radius: 8px; height: auto; }
.photo-strip__cap { display: block; font-size: 13px; margin-top: 5px; line-height: 1.35; color: var(--ink-2); }
.photo-strip__remove { position: absolute; top: 6px; right: 6px; background: rgba(255, 255, 255, .9); opacity: 0; }
.photo-strip__item:hover .photo-strip__remove, .photo-strip__remove:focus-visible { opacity: 1; }
@media (hover: none) {  /* touch screens can't hover, so remove buttons always show there */
  .row__remove, .photo-strip__remove { opacity: 1; }
}
.shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.shortcut {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.shortcut:hover { border-color: var(--line-2); color: var(--ink); }
.shortcut--place .icon { color: var(--place); } .shortcut--person .icon { color: var(--person); }
.shortcut--event .icon { color: var(--event); } .shortcut--photo .icon { color: var(--photo); } .shortcut--story .icon { color: var(--story); }
.shortcut--document .icon { color: var(--document); } .shortcut--album .icon { color: var(--album); }

.discussion__intro { margin-top: -6px; }
.comment { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.comment__body { flex: 1; min-width: 0; }
.comment__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; }
.comment__meta time { color: var(--ink-3); }
.comment__meta form { margin-left: auto; }
.comment__meta .link-btn { color: var(--ink-3); font-size: 13px; }
.comment__text { margin-top: 6px; font-size: 15.5px; }
.comment__text p:last-child { margin: 0; }
.comment--memory .comment__text { font: 400 18px/1.55 var(--serif); padding-left: 14px; border-left: 3px solid var(--story); }
.comment-form { display: grid; gap: 10px; margin-top: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; resize: vertical; }
.comment-form__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.signin-prompt { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; }

.facts dl { margin: 0; display: grid; gap: 10px; }
.facts dl > div { display: grid; grid-template-columns: 118px 1fr; gap: 10px; font-size: 14.5px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.minimap { height: 230px; }
.minimap__foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line); }
.mini-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.mini-timeline::before { content: ""; position: absolute; left: 44px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.mini-timeline__item { display: grid; grid-template-columns: 38px 1fr; gap: 20px; padding: 5px 0; position: relative; font-size: 14px; }
.mini-timeline__item::before { content: ""; position: absolute; left: 40px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); border: 2px solid var(--surface); }
.mini-timeline__item--place::before { background: var(--place); } .mini-timeline__item--person::before { background: var(--person); }
.mini-timeline__item--event::before { background: var(--event); } .mini-timeline__item--photo::before { background: var(--photo); }
.mini-timeline__item--story::before { background: var(--story); }
.mini-timeline__item--document::before { background: var(--document); }
.mini-timeline__item--album::before { background: var(--album); }
.mini-timeline__year { font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 1px; }
.mini-timeline__title { color: var(--ink); text-decoration: none; }
a.mini-timeline__title:hover { text-decoration: underline; }
.mini-timeline__item.is-current .mini-timeline__title { font-weight: 700; }
.mini-timeline__item.is-current::before { box-shadow: 0 0 0 3px var(--brand-soft); }
.sources__text { font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.sources__text p:last-child { margin: 0; }
.provenance { font-size: 13px; color: var(--ink-3); margin: 0; padding: 0 4px; }

/* ---------- timeline page ---------- */
.histogram { display: flex; align-items: flex-end; gap: 2px; height: 90px; padding: 0 0 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); position: relative; }
.histogram__bar { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; text-decoration: none; min-width: 3px; }
.histogram__bar span { width: 100%; background: #8fb1ba; border-radius: 2px 2px 0 0; transition: background .12s; }
.histogram__bar:hover span, .histogram__bar.is-current span { background: var(--brand); }
.histogram__bar.is-empty { pointer-events: none; }
.histogram__bar em { position: absolute; top: 100%; left: 0; margin-top: 4px; font: 600 11px/1 var(--sans); color: var(--ink-3); font-style: normal; }
.timeline { list-style: none; margin: 0; padding: 0 0 48px; }
.timeline__decade { display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--topbar) + 16px); }
.timeline__label { font: 500 30px/1 var(--serif); color: var(--ink-2); position: sticky; top: calc(var(--topbar) + 16px); align-self: start; }
.timeline__entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.timeline__entry { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; }
.timeline__year { font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 12px; }
.timeline__card { display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ink-3); border-radius: 8px; text-decoration: none; color: var(--ink); }
.timeline__card:hover { box-shadow: var(--shadow); color: var(--ink); }
.timeline__entry--place .timeline__card { border-left-color: var(--place); } .timeline__entry--person .timeline__card { border-left-color: var(--person); }
.timeline__entry--event .timeline__card { border-left-color: var(--event); } .timeline__entry--photo .timeline__card { border-left-color: var(--photo); }
.timeline__entry--story .timeline__card { border-left-color: var(--story); }
.timeline__entry--document .timeline__card { border-left-color: var(--document); }
.timeline__entry--album .timeline__card { border-left-color: var(--album); }
.timeline__card > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.timeline__card strong { font: 500 18px/1.25 var(--serif); }
.timeline__meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.timeline__summary { font-size: 14px; color: var(--ink-2); }

/* ---------- community ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; align-items: start; padding-bottom: 32px; }
.sidebar { display: grid; gap: 16px; position: sticky; top: calc(var(--topbar) + 16px); }
.feed { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.feed__entry { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.feed__entry:first-child { border-top: 0; padding-top: 0; }
.feed__body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.feed__line { margin: 0; font-size: 15px; line-height: 1.5; }
.feed__item-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; text-decoration: none; }
.feed__item-link:hover { text-decoration: underline; }
.feed__phrase { color: var(--ink-3); font-style: italic; }
.feed__time { display: block; font-size: 12.5px; color: var(--ink-3); }
.feed__quote { margin: 0; padding: 10px 14px; background: var(--surface); border-left: 3px solid var(--line-2); border-radius: 0 8px 8px 0; font: 400 16px/1.5 var(--serif); color: var(--ink-2); }
.feed__many { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.feed__media { display: block; max-width: 320px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; }
.mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.mini-grid a { aspect-ratio: 1; border-radius: 6px; overflow: hidden; display: block; }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.people-list li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.people-list li > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.people-list small { color: var(--ink-3); font-size: 12.5px; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; }

/* ---------- towns ---------- */
.towns { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 40px; }
.towns__map { height: 620px; border-radius: var(--radius); border: 1px solid var(--line); position: sticky; top: calc(var(--topbar) + 16px); }
.towns__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.town-card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.town-card:hover { border-color: var(--brand); box-shadow: var(--shadow); color: var(--ink); }
.town-card__name { font: 500 21px/1.2 var(--serif); }
.town-card__villages { font-size: 12.5px; color: var(--ink-3); }
.town-card__counts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.town-card__counts > span { display: inline-flex; align-items: center; gap: 4px; }
.town-map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 12px; }
.town-section { padding: 24px 0 8px; }
.town-section .section-title { margin-bottom: 14px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14.5px; color: var(--ink-2); }
.stat-row > span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- search, profile, contribute, auth ---------- */
.search-big { position: relative; display: flex; gap: 10px; margin-bottom: 12px; }
.search-big .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-big input { flex: 1; padding: 13px 16px 13px 46px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 17px; background: var(--surface); }

.profile { display: flex; gap: 24px; align-items: flex-start; padding: 40px 0 16px; flex-wrap: wrap; }
.profile__text { flex: 1; min-width: 260px; }
.profile__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--ink-3); font-size: 14.5px; }
.profile__bio { max-width: 60ch; color: var(--ink-2); }
.profile__stats { display: grid; grid-template-columns: repeat(4, auto); gap: 8px 24px; margin: 0; }
.profile__stats dt { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.profile__stats dd { margin: 0; font: 500 30px/1.1 var(--serif); }

.choose { display: grid; gap: 10px; margin-bottom: 24px; }
.choose__card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.choose__card:hover { box-shadow: var(--shadow); border-color: var(--line-2); color: var(--ink); }
.choose__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; flex: none; }
.choose__card--place .choose__icon { background: var(--place-soft); color: var(--place); }
.choose__card--person .choose__icon { background: var(--person-soft); color: var(--person); }
.choose__card--event .choose__icon { background: var(--event-soft); color: var(--event); }
.choose__card--photo .choose__icon { background: var(--photo-soft); color: var(--photo); }
.choose__card--story .choose__icon { background: var(--story-soft); color: var(--story); }
.choose__card--document .choose__icon { background: var(--document-soft); color: var(--document); }
.choose__card--album .choose__icon { background: var(--album-soft); color: var(--album); }
.choose__text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.choose__text strong { font: 500 21px/1.2 var(--serif); }
.choose__text span { color: var(--ink-2); font-size: 14.5px; }
.choose__arrow { color: var(--ink-3); }
.choose__card:hover .choose__arrow { color: var(--brand); transform: translateX(2px); }

.auth { display: grid; place-items: center; padding: 48px 16px; }
.auth__card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; gap: 16px; }
.auth__card .page-title { font-size: 32px; margin: 0; }
.auth__card p { margin: 0; }
.error-page, .prose-page { padding: 56px 24px; }
.error-page .page-lede { margin-bottom: 24px; }

/* ---------- home (all counties) ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
.hero__title { font: 500 clamp(38px, 5vw, 58px)/1.05 var(--serif); letter-spacing: -.02em; margin: 0 0 16px; }
.hero__lede { font: 400 20px/1.5 var(--serif); color: var(--ink-2); margin: 0 0 24px; max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.finder { position: relative; max-width: 520px; }
.finder__label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.finder__box { position: relative; display: flex; gap: 8px; }
.finder__box > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.finder__box input { flex: 1; min-width: 0; height: 46px; padding: 0 14px 0 42px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 16px; }
.finder__box input:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.finder__box .btn { height: 46px; padding: 0 20px; }
.finder__results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1100; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 340px; overflow-y: auto;
}
.finder__result { display: grid; gap: 1px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.finder__result[aria-selected="true"], .finder__result:hover { background: var(--surface-2); }
.finder__name { font-weight: 600; }
.finder__detail { font-size: 13px; color: var(--ink-3); }
.finder__result--request .finder__name { color: var(--ink-2); }
.finder__result--request .finder__detail { color: var(--brand); font-weight: 600; }
.finder__none { padding: 8px 10px; font-size: 14px; color: var(--ink-3); }
.finder__more { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 28px; font-size: 14px; font-weight: 600; }
.finder__more span { color: var(--ink-3); }
.hero__stats { display: flex; gap: 36px; margin: 0; }
.hero__stats dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.hero__stats dd { margin: 0; font: 500 32px/1.1 var(--serif); }
.hero__map { height: 440px; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.county-label { pointer-events: none; display: grid !important; place-items: center; }
.county-label span {
  font: 700 11.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brand-2);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff; white-space: nowrap;
}
.home-section { padding-top: 40px; }
.home-section .section-head h2 { font-size: 28px; }
.county-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.county-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink);
  box-shadow: inset 0 4px 0 var(--brand); transition: box-shadow .15s, border-color .15s;
}
.county-card:hover { border-color: var(--brand); box-shadow: inset 0 4px 0 var(--brand), var(--shadow); color: var(--ink); }
.county-card--new { box-shadow: none; border-style: dashed; background: #fbfaf7; }
.county-card--new:hover { box-shadow: var(--shadow); }
.county-card__state { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.county-card__name { font: 500 25px/1.15 var(--serif); }
.county-card__meta { font-size: 13.5px; color: var(--ink-3); }
.county-card__counts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.county-card__counts > span { display: inline-flex; align-items: center; gap: 5px; }
.county-card__empty { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.county-card__go { margin-top: auto; padding-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--brand); }
.add-county { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; padding: 28px 32px; border-radius: 14px; background: var(--brand-soft); }
.add-county h2 { font: 500 26px/1.2 var(--serif); margin: 0 0 8px; }
.add-county p { margin: 0; max-width: 60ch; color: var(--ink-2); }
.choose__icon--county { background: var(--brand-soft); color: var(--brand); }
.add-county__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.thanks__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.count--alert { background: var(--event-soft); color: var(--event); margin-left: auto; }

/* community: county chips, stream tabs, composer, posts */
.county-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; font-size: 14px; }
.county-chips .chip { text-decoration: none; }
.community-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.stream-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.stream-tabs a { padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.stream-tabs a:hover { color: var(--ink); }
.stream-tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.composer { display: grid; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.composer__row { display: flex; gap: 12px; align-items: flex-start; }
.composer textarea, .reply-form textarea {
  flex: 1; width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; resize: vertical; font-size: 15px; line-height: 1.5;
}
.composer__about { padding-left: 50px; display: grid; gap: 8px; }
.composer__attach > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--brand); list-style: none; }
.composer__attach > summary::-webkit-details-marker { display: none; }
.composer__attach[open] { display: grid; gap: 8px; }
.composer__chosen { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.composer__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-left: 50px; }
.post { display: grid; gap: 10px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.post--announcement { box-shadow: inset 3px 0 0 var(--story); }
.post--question { box-shadow: inset 3px 0 0 var(--event); }
.post--memory { box-shadow: inset 3px 0 0 var(--photo); }
.post__head { display: flex; align-items: flex-start; gap: 12px; }
.post__meta { flex: 1; min-width: 0; }
.post__who { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.post__sub { font-size: 13px; color: var(--ink-3); }
.post__sub a { color: var(--ink-3); }
.post__delete { color: var(--ink-3); font-size: 13px; }
.post__body { font-size: 15.5px; }
.post--memory .post__body { font: 400 18px/1.55 var(--serif); }
.post__body p:last-child { margin: 0; }
.post__record { display: grid; gap: 4px; padding: 6px 8px; border-radius: 8px; background: var(--bg); }
.post__about { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.post__record .post__about { padding: 2px 8px 0; }
.post__replies { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.post__more, .post__signin { font-size: 13.5px; font-weight: 600; }
.reply { display: flex; gap: 10px; }
.reply__body { flex: 1; min-width: 0; }
.reply__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; }
.reply__meta time { color: var(--ink-3); }
.reply__meta form { margin-left: auto; }
.reply__meta .link-btn { color: var(--ink-3); font-size: 12.5px; }
.reply__text { font-size: 14.5px; }
.reply__text p { margin: 2px 0 0; }
.reply-form { display: flex; align-items: flex-start; gap: 10px; }
.reply-form textarea { padding: 7px 10px; font-size: 14.5px; min-height: 36px; }
.pill--post-question { background: var(--event-soft); color: var(--event); }
.pill--post-memory { background: var(--photo-soft); color: var(--photo); }
.pill--post-announcement { background: var(--story-soft); color: var(--story); }
.post-page { padding-bottom: 48px; }
.post-page .post { margin-top: 18px; }
.feed__empty { padding: 12px 0; }

/* county requests (admin) */
.requests { display: grid; gap: 10px; padding-bottom: 48px; }
.request-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.request-group--added, .request-group--declined { opacity: .75; }
.request-group > summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 14px 18px; cursor: pointer; list-style: none;
}
.request-group > summary::-webkit-details-marker { display: none; }
.request-group__name { font-size: 16px; margin-right: auto; }
.request-group__time { font-size: 13px; color: var(--ink-3); }
.pill--status-new { background: var(--event-soft); color: var(--event); }
.pill--status-contacted { background: var(--story-soft); color: var(--story); }
.pill--status-added { background: var(--place-soft); color: var(--place); }
.request-group__body { border-top: 1px solid var(--line); padding: 14px 18px 18px; display: grid; gap: 14px; }
.request-group__tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.request-group__command { font: 13px/1.4 ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 6px 10px; border-radius: 6px; user-select: all; }
.request-group__status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.request-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.request-list li { padding: 12px 14px; border-radius: 8px; background: var(--bg); }
.request-list__who { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.request-list__meta { font-size: 13px; margin-top: 2px; }
.request-list__message { margin-top: 8px; font-size: 14.5px; }
.request-list__message p:last-child { margin: 0; }
.search-big__region { padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 15px; }

/* ---------- zoom, then and now, recordings, documents ---------- */
.zoom-btn {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px;
  border: 0; border-radius: 8px; background: rgba(20, 24, 28, .72); color: #fff; font: 600 13.5px/1 var(--sans); cursor: pointer;
}
.zoom-btn:hover { background: rgba(20, 24, 28, .9); }
.tagger.is-tagging .zoom-btn { display: none; }

.viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #111417; color: #fff; overflow: hidden; }
.viewer::backdrop { background: #111417; }
.viewer__stage { position: absolute; inset: 0 0 60px; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: grab; }
.viewer__stage.is-dragging { cursor: grabbing; }
.viewer__img { max-width: 100%; max-height: 100%; transform-origin: 50% 50%; user-select: none; will-change: transform; }
.viewer__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #000; }
.viewer__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14.5px; }
.viewer__btn { min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px; background: transparent; color: #fff; font: 600 16px/1 var(--sans); cursor: pointer; }
.viewer__btn:hover { background: rgba(255, 255, 255, .14); }
.viewer__btn:focus-visible { outline: 2px solid #9cc7c9; outline-offset: 2px; }
.viewer__level { min-width: 52px; text-align: center; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.viewer__loading { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .7); font-size: 13.5px; }

.then-now .panel__head h2 { display: flex; align-items: center; gap: 6px; }
.compare { position: relative; overflow: hidden; border-radius: var(--radius); background: #1d2126; line-height: 0; user-select: none; }
.compare__then { display: block; width: 100%; }
.compare__now { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: inset(0 0 0 var(--pos)); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; }
.compare__handle::after {
  content: "\2194"; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow); color: var(--ink); font: 700 18px/38px var(--sans); text-align: center;
}
.compare:focus-within .compare__handle::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.compare__label { position: absolute; top: 12px; padding: 5px 9px; border-radius: 6px; background: rgba(20, 24, 28, .72); color: #fff; font: 600 12.5px/1.2 var(--sans); pointer-events: none; }
.compare__label--then { left: 12px; }
.compare__label--now { right: 12px; }
.compare__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.then-now__credit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 0; font-size: 13.5px; color: var(--ink-3); }
.then-now__add, .transcription__edit { margin-top: 12px; }
.then-now__add > summary, .transcription__edit > summary { list-style: none; cursor: pointer; width: fit-content; }
.then-now__add > summary::-webkit-details-marker, .transcription__edit > summary::-webkit-details-marker { display: none; }
.then-now__form { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }

.recording { margin: 0; display: grid; gap: 8px; }
.recording__player { width: 100%; }
video.recording__player { max-height: 72vh; border-radius: var(--radius); background: #000; }
.recording__audio { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px 16px; padding: 20px; border-radius: var(--radius); background: var(--story-soft); }
.recording__audio audio { grid-column: 1 / -1; }
.recording__icon { width: 54px; height: 54px; border-radius: 50%; background: var(--story); color: #fff; display: grid; place-items: center; }
.recording__who { display: grid; gap: 2px; }
.recording__who strong { font: 500 21px/1.25 var(--serif); }
.recording__who span { font-size: 14px; color: var(--ink-2); }
.recording__embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.recording__embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose-head { font: 500 24px/1.2 var(--serif); margin: 0; }
.timestamp {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border: 0; border-radius: 5px; background: var(--story-soft); color: var(--story);
  font: 600 13px/1.5 var(--sans); font-variant-numeric: tabular-nums; vertical-align: 2px;
}
button.timestamp { cursor: pointer; }
button.timestamp:hover { background: var(--story); color: #fff; }
.card__flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--story); }
.card__flag--album { color: var(--album); }

.document { margin: 0; display: grid; gap: 8px; }
.document__pdf { width: 100%; height: min(82vh, 920px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.document__scan { position: relative; line-height: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); text-align: center; }
.document__scan img { max-width: 100%; max-height: 78vh; }
.pill--doc { background: var(--document-soft); color: var(--document); }
a.pill { text-decoration: none; }
.transcription { display: grid; gap: 10px; }
.transcription .panel__title { margin: 0; }
.transcription__note, .transcription__empty { margin: 0; font-size: 14.5px; }
.transcription__note { font-size: 13.5px; }
.transcription__text {
  max-height: 560px; overflow: auto; padding: 14px 16px; border-radius: 8px; background: var(--bg);
  white-space: pre-wrap; overflow-wrap: anywhere; font: 400 16.5px/1.6 var(--serif);
}
.transcription__edit form { display: grid; gap: 10px; margin-top: 12px; }
.textarea--transcription { width: 100%; min-height: 240px; padding: 12px; border: 1px solid var(--line-2); border-radius: 8px; font: 400 16px/1.55 var(--serif); resize: vertical; }
.transcription__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; padding-top: 28px; padding-bottom: 56px; }
.admin-nav { position: sticky; top: calc(var(--topbar) + 20px); display: grid; gap: 2px; }
.admin-nav__title { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; text-decoration: none; }
.admin-nav a:hover { background: var(--surface); color: var(--ink); }
.admin-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.admin-nav .count { margin-left: auto; }
.admin-nav__back { margin-top: 12px; border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: 14px !important; font-weight: 500 !important; font-size: 13.5px !important; }
.admin-nav__back .icon { transform: scaleX(-1); }
.admin-main { display: grid; gap: 18px; min-width: 0; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-head .page-title { margin: 0; }
.admin-head .page-lede { margin-top: 6px; font-size: 15.5px; }
.admin-head--member { align-items: center; justify-content: flex-start; }
.admin-main > div > .admin-head { margin-bottom: 20px; }  /* pages that keep their content in one wrapper: requests, reports, listings */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.admin-stack { display: grid; gap: 18px; min-width: 0; }
.admin-note { margin: -6px 0 0; font-size: 14px; }
.panel__head--pad { padding: 16px 20px 0; }
.panel__head a { font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; margin: 0; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
a.tile:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.tile__label { flex: 1; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.tile__value { margin: 0; font: 500 30px/1.15 var(--serif); }
.tile__new { font-size: 13px; color: var(--ink-3); }
.tile__new--up { color: var(--place); font-weight: 600; }
.tiles--small .tile { padding: 10px 14px; }
.tiles--small .tile__value { font-size: 24px; }

.attention { list-style: none; margin: 0; padding: 0; display: grid; }
.attention li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.attention li:first-child { border-top: 0; padding-top: 0; }
.attention .count--alert { margin-left: 0; }
.attention--clear a { color: var(--ink-2); }
.attention__ok { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--place); }

.admin-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-filters .field--search { flex: 1 1 240px; max-width: 360px; }
.admin-filters input[type="search"] { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 14.5px; }
.admin-tabs { margin-top: -4px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel--flush .table-wrap { border: 0; border-radius: 0; margin-top: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); }
.table thead th { border-top: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; background: var(--surface-2); }
.table tbody th { font-weight: 600; }
.table small { display: block; font-size: 12.5px; font-weight: 400; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: #fbfaf7; }
.table tr.is-suspended th, .table tr.is-suspended td { color: var(--ink-3); }
.table__person { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.table__person:hover span { text-decoration: underline; }
.table__person small { color: var(--ink-3); }
.table__record { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.table__record:hover { text-decoration: underline; }
.table__record + small { padding-left: 17px; }
.table__flags { white-space: nowrap; }
.table__flags .pill + .pill { margin-left: 4px; }
.table__actions { white-space: nowrap; text-align: right; }
.table__actions > * { display: inline-block; margin-left: 12px; font-size: 13.5px; }
.link-btn--danger { color: var(--danger); font-size: 13.5px; }

.pill--role-member { background: var(--surface-2); color: var(--ink-2); }
.pill--role-moderator { background: var(--story-soft); color: var(--story); }
.pill--role-admin { background: var(--brand-soft); color: var(--brand); }
.pill--suspended { background: var(--event-soft); color: var(--danger); }
.pill--flag { background: var(--photo-soft); color: var(--photo); }
.pill--kind-post { background: var(--brand-soft); color: var(--brand); }
.pill--kind-reply { background: var(--surface-2); color: var(--ink-2); }
.pill--kind-comment { background: var(--place-soft); color: var(--place); }

.entries { list-style: none; margin: 0; padding: 0; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.entries > li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.entries > li:first-child { border-top: 0; }
.entries__main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.entries__where { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--ink-3); }
.entries__where strong { color: var(--ink); }
.entries__body { font-size: 14.5px; overflow-wrap: anywhere; }
.entries--compact { background: none; border: 0; }
.entries--compact > li { display: grid; gap: 3px; padding: 10px 0; }
.entries--compact > li:first-child { padding-top: 0; }

.member-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; font-size: 14.5px; }
.member-reason { margin: 8px 0 0; font-size: 14px; }
.admin-form { display: grid; gap: 12px; justify-items: start; }
.admin-form .field { width: 100%; }
.admin-form__help { margin: 0; font-size: 14px; color: var(--ink-2); }
.admin-form--row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.admin-form--row .field { width: auto; flex: 1 1 200px; }

.log { list-style: none; margin: 0; padding: 0; display: grid; }
.log li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; padding-top: 0; }
.log__text { font-size: 14.5px; }
.log__text a { color: var(--ink); }
.log__meta { font-size: 13px; color: var(--ink-3); }
.log__meta a { color: var(--ink-2); }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1270px) {
  .nav__search { width: 200px; }
  .brand__region { display: none; }
}
@media (min-width: 1271px) and (max-width: 1470px) {
  /* Room for the full name and a usable search box: the links keep their words, lose their icons */
  .nav > a > .icon, .nav__menu > summary > .icon:first-child { display: none; }
}
/* The menu folds into the ☰ button once the full row (name, county, links, search, buttons) no longer fits */
@media (max-width: 1270px) {
  .nav-toggle { display: inline-grid; flex: none; width: 44px; height: 44px; }  /* finger-sized */
  .nav {
    display: none; position: fixed; top: var(--topbar); left: 0; right: 0; bottom: 0; z-index: 999;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 16px; background: var(--surface); overflow-y: auto;
  }
  .nav-open .nav { display: flex; }
  .nav > a, .nav__menu > summary { padding: 12px; font-size: 16px; }
  .nav__dropdown { position: static; box-shadow: none; border: 0; padding: 0 0 0 20px; }
  .nav__search { order: -1; width: 100%; margin: 0 0 8px; }
  .nav__search input { padding: 11px 12px 11px 34px; font-size: 16px; }
  .nav__actions { margin: 12px 0 0; justify-content: space-between; }
  .nav__menu--user .nav__dropdown { position: absolute; right: 0; bottom: 100%; top: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 6px; }
  .region-switch > summary { max-width: 150px; }
  /* the county switcher stays a popover; only the slide-out nav's dropdowns go inline */
  .region-switch .nav__dropdown { position: absolute; left: auto; right: 0; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 6px; }
}
@media (max-width: 1024px) {
  .record__grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .admin { grid-template-columns: 1fr; gap: 18px; padding-top: 16px; }
  .admin-nav { position: static; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
  .admin-nav__title { display: none; }
  .admin-nav a { flex: none; font-size: 14px; }
  .admin-nav__back { margin: 0; border: 0; padding-top: 8px !important; }
  .admin-grid { grid-template-columns: 1fr; }
  .towns { grid-template-columns: 1fr; }
  .towns__map { position: static; height: 420px; }
  .hero__inner { grid-template-columns: 1fr; gap: 28px; }
  .hero__map { height: 340px; }
}
@media (max-width: 860px) {
  /* The county map fills the screen, and the filters and list sit in a sheet over its lower part:
     just the search box (peek), half the screen, or all of it (full). The map shrinks to the part
     above the sheet, so the list ("in view") matches what's showing. */
  .page-explore { height: 100vh; height: 100dvh; overflow: hidden; }
  .explore { --sheet-peek: 112px; display: block; position: relative; height: calc(100vh - var(--topbar)); height: calc(100dvh - var(--topbar)); }
  .explore__map { position: absolute; top: 0; left: 0; right: 0; bottom: calc(50% - 16px); z-index: 0; isolation: isolate; }
  .explore[data-sheet="peek"] .explore__map { bottom: calc(var(--sheet-peek) - 16px); }
  .explore[data-sheet="half"] .explore__map, .explore[data-sheet="full"] .explore__map { transition: bottom 0s .25s; }  /* shrink once the sheet covers it */
  .explore .leaflet-bottom { bottom: 16px; }  /* the map credit clears the sheet's rounded top */
  .explore__panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 50%;
    border-right: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(29, 33, 38, .14);
    overscroll-behavior: contain; transition: height .25s ease; padding-bottom: env(safe-area-inset-bottom);
  }
  .explore[data-sheet="peek"] .explore__panel { height: calc(var(--sheet-peek) + env(safe-area-inset-bottom)); overflow: hidden; }
  .explore[data-sheet="full"] .explore__panel { height: 100%; border-radius: 0; }
  .sheet__handle {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; flex: none; width: 100%;
    padding: 20px 16px 6px; border: 0; background: var(--bg); color: var(--ink); font: inherit; text-align: left;
    cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent;
  }
  .sheet__grip { position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line-2); }
  .sheet__title { margin-right: auto; font-size: 15px; font-weight: 700; }
  .sheet__hint { font-size: 13px; font-weight: 600; color: var(--ink-3); }
  .sheet__chevron { color: var(--ink-3); transform: rotate(180deg); transition: transform .2s; }
  .explore[data-sheet="full"] .sheet__chevron { transform: none; }
  .intro { display: none; }
  .filters { padding-top: 6px; gap: 12px; }
  .explore .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .explore .chips::-webkit-scrollbar { display: none; }
  .explore .chip { flex: none; }
  .filters__toggle {
    display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px;
    background: var(--surface); color: var(--ink-2); font: 600 14px/1 var(--sans); cursor: pointer;
  }
  .filters__on { color: var(--brand); }
  .filters__chevron { margin-left: auto; color: var(--ink-3); transition: transform .2s; }
  .filters__toggle[aria-expanded="true"] .filters__chevron { transform: rotate(180deg); }
  .filters__more { display: none; }
  .filters__more.is-open { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .results__head #r-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* the sheet's title says it */
  .results__head { justify-content: flex-end; }
  .result__locate { opacity: 1; }  /* no hover on touch screens */
  .legend { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .topbar { padding: 0 12px 0 16px; gap: 10px; }
  .brand__name { font-size: 19px; }
  .region-switch { flex: 0 1 auto; min-width: 0; }
  .region-switch > summary { max-width: 100%; }
  .page-head { padding-top: 24px; }
  .timeline__decade { grid-template-columns: 1fr; gap: 10px; }
  .timeline__label { position: static; font-size: 24px; }
  .timeline__entry { grid-template-columns: 1fr; gap: 2px; }
  .timeline__year { padding-top: 0; }
  .facts dl > div { grid-template-columns: 100px 1fr; }
  .record__actions .btn--sm { min-height: 44px; padding: 0 14px; }  /* thumb-sized targets */
  .profile__stats { grid-template-columns: repeat(2, auto); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card__title { font-size: 16.5px; }
  .card__summary { display: none; }
  .dialog__foot { flex-direction: column-reverse; align-items: stretch; }
  .search-big { flex-direction: column; }
  .search-big .icon { top: 25px; }
}

/* ---------- policies ---------- */
.policy { padding-bottom: 56px; }
.policy .prose { font-size: 17.5px; }
.policy .prose h2 { font-size: 24px; }
.policy__unset { padding: 1px 6px; border-radius: 5px; background: var(--photo-soft); color: var(--photo); font: 600 .85em/1.4 var(--sans); }
.auth__aside { margin: -6px 0 0 !important; font-size: 14px; text-align: right; }

/* ---------- person and place timelines ---------- */
.life { display: grid; gap: 14px; }
.life__list { list-style: none; margin: 0; padding: 0; position: relative; }
.life__list::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 141px; width: 2px; background: var(--line); }
.life__entry { position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 4px 28px; align-items: baseline; padding: 9px 0; }
.life__entry::before {
  content: ""; position: absolute; left: 136px; top: 14px; width: 13px; height: 13px; box-sizing: border-box; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--ink-3);
}
.life__entry--start::before, .life__entry--end::before { background: var(--ink); border-color: var(--ink); }
.life__entry--milestone::before { border-color: var(--brand); }
.life__entry--place::before { border-color: var(--place); } .life__entry--person::before { border-color: var(--person); }
.life__entry--event::before { border-color: var(--event); } .life__entry--photo::before { border-color: var(--photo); }
.life__entry--story::before { border-color: var(--story); } .life__entry--document::before { border-color: var(--document); }
.life__entry--album::before { border-color: var(--album); }
.life__when { font: 600 14px/1.4 var(--sans); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.life__what { display: grid; gap: 3px; min-width: 0; }
.life__text { font-size: 15.5px; }
.life__text a { font-weight: 600; }  /* inline, so a long title wraps with the sentence */
.life__text a .dot { margin-right: 6px; vertical-align: 1px; }
.life__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--ink-3); }
.life__meta form { display: inline; }
.life__meta .link-btn { font-size: 13px; color: var(--ink-3); }
.life__thumb img { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; margin-top: 4px; }
.life__age { padding: 2px 8px; border-radius: 999px; background: var(--person-soft); color: var(--person); font-size: 12px; font-weight: 700; white-space: nowrap; }
.life__empty { margin: 0; }
.life__undated { padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.life__undated > summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
.life__undated p { margin: 8px 0; font-size: 13.5px; }
.life__undated ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.life__undated li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; font-size: 14.5px; }
.life__undated li a { display: inline-flex; align-items: center; gap: 6px; }
.life__years { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-3); }
.life__years input { width: 88px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 14px; }
.life__add > summary { list-style: none; cursor: pointer; width: fit-content; }
.life__add > summary::-webkit-details-marker { display: none; }
.life__form { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.life__form-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; }
.life__form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.life__signin { margin: 0; font-size: 14.5px; }
.form__grid--years { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .life__list::before { left: 7px; }
  .life__entry { grid-template-columns: minmax(0, 1fr) auto; padding-left: 26px; gap: 2px 10px; }
  .life__entry::before { left: 2px; top: 13px; }
  .life__when { grid-column: 1 / -1; text-align: left; }
  .life__form-row { grid-template-columns: 1fr; }
}

/* ---------- help identify ---------- */
.identify { display: grid; gap: 10px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: inset 0 3px 0 var(--photo); }
.identify__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.identify__head h2 { display: flex; align-items: center; gap: 7px; margin: 0; font: 500 22px/1.2 var(--serif); }
.identify__head h2 .icon { color: var(--photo); align-self: center; }
.identify__head .muted { font-size: 14px; }
.identify__all { margin-left: auto; font-size: 14px; font-weight: 600; }
.identify__lede { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.identify__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.identify__grid--page { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding-bottom: 48px; }
.identify__empty { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.identify__empty p { margin: 0; flex: 1 1 280px; font-size: 14.5px; color: var(--ink-2); }
.mystery { display: grid; gap: 4px; align-content: start; color: var(--ink); text-decoration: none; }
.mystery__img { display: block; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.mystery__img .thumb { display: grid; place-items: center; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; transition: transform .2s; }
.mystery:hover .mystery__img .thumb { transform: scale(1.04); }
.mystery__title { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mystery:hover .mystery__title { text-decoration: underline; }
.mystery__meta { font-size: 12.5px; font-weight: 600; color: var(--photo); }
@media (max-width: 600px) {
  .identify__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- albums ---------- */
.pill--album { background: var(--album-soft); color: var(--album); }
.album { display: grid; gap: 14px; }
.album__tools { display: flex; gap: 8px; flex-wrap: wrap; }
.album__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.album__tile { position: relative; display: grid; gap: 6px; align-content: start; }
.album__link { display: grid; gap: 6px; color: var(--ink); text-decoration: none; }
.album__link .thumb { display: grid; place-items: center; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); transition: transform .15s; }
.album__link:hover .thumb { transform: scale(1.02); }
.album__cap { display: grid; font-size: 14px; font-weight: 600; line-height: 1.3; }
.album__cap small { font-weight: 500; font-size: 12.5px; color: var(--ink-3); }
.album__link:hover .album__cap { text-decoration: underline; }
.album__tile:first-child .album__link .thumb { box-shadow: 0 0 0 2px var(--album); }  /* the cover */
.album__edit { display: flex; align-items: center; gap: 4px; }
.album__pos input { width: 52px; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; font-size: 14px; }
.album__remove { margin-left: auto; font-size: 13px; color: var(--danger); }
.album__save { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; background: var(--album-soft); font-size: 14px; }
/* With scripts, the arranging tools wait behind "Arrange" */
.album--js:not(.is-arranging) .album__edit, .album--js:not(.is-arranging) .album__save { display: none; }
.is-arranging .album__tile[draggable="true"] { cursor: grab; }
.is-arranging .album__link { pointer-events: none; }
.is-arranging .album__tile { padding: 6px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface); }
.album__tile.is-dragging { opacity: .45; }
.album__empty { margin: 0; }
.album__add > summary { list-style: none; cursor: pointer; width: fit-content; }
.album__add > summary::-webkit-details-marker { display: none; }
.album__add-body { display: grid; gap: 22px; margin-top: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.album__upload { display: grid; gap: 12px; }
.album__upload-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 14px; }
.album__upload-done { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 8px; background: var(--place-soft); }
.album__existing { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.album__existing h3 { margin: 0; font-size: 15px; }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow: auto; font-size: 13.5px; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 7px 10px; border-radius: 6px; background: var(--bg); }
.upload-list__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.upload-list__size { color: var(--ink-3); }
.upload-list__status { grid-column: 1 / -1; color: var(--ink-3); }
.upload-list .is-active { background: var(--brand-soft); }
.upload-list .is-done .upload-list__status { color: var(--place); }
.upload-list .is-error { background: #fbeeeb; }
.upload-list .is-error .upload-list__status { color: var(--danger); }

/* A photo that's in an album: where it falls, and the way to its neighbors */
.album-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--album-soft); font-size: 14.5px; }
.album-bar__where { display: flex; align-items: flex-start; gap: 8px; }
.album-bar__where .icon { flex: none; margin-top: 2px; color: var(--album); }
.album-bar__where > span { display: grid; }
.album-bar__where small { font-size: 13px; color: var(--ink-2); }
.album-bar__steps { display: flex; gap: 6px; }

/* The slideshow */
.slides { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #111417; color: #fff; overflow: hidden; }
.slides::backdrop { background: #111417; }
.slides__stage { position: absolute; inset: 0 0 72px; display: flex; align-items: center; justify-content: center; padding: 16px 72px; touch-action: pan-y; }
.slides__img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.slides__img.img-missing { visibility: hidden; }
.slides__nav {
  position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; font: 400 34px/1 var(--sans); cursor: pointer;
}
.slides__nav:hover { background: rgba(255, 255, 255, .24); }
.slides--single .slides__nav, .slides--single [data-act="play"], .slides--single .slides__count { display: none; }  /* one photo */
.slides__nav--prev { left: 12px; } .slides__nav--next { right: 12px; }
.slides__bar { position: absolute; left: 0; right: 0; bottom: 0; min-height: 72px; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #000; }
.slides__caption { flex: 1; min-width: 0; display: grid; }
.slides__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.slides__meta { font-size: 13px; color: rgba(255, 255, 255, .7); }
.slides__count { font-size: 13.5px; color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slides__btn { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px; background: transparent; color: #fff; font: 600 14px/1 var(--sans); text-decoration: none; cursor: pointer; }
.slides__btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.slides button:focus-visible, .slides a:focus-visible { outline: 2px solid #9cc7c9; outline-offset: 2px; }
@media (max-width: 600px) {
  .album__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .slides__stage { padding: 8px; }
  .slides__nav { width: 40px; height: 40px; margin-top: -20px; font-size: 28px; background: rgba(0, 0, 0, .45); }
  .slides__nav--prev { left: 6px; } .slides__nav--next { right: 6px; }
  .slides__bar { flex-wrap: wrap; }
  .slides__open { display: none; }
}

/* ---------- page history ---------- */
.versions { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; }
.version { display: grid; gap: 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.version--current { box-shadow: inset 3px 0 0 var(--brand); }
.version__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 14.5px; }
.version__head time { font-size: 13.5px; color: var(--ink-3); }
.version__head form { margin-left: auto; }
.version__note { margin: 0; font-size: 14px; }
.pill--current { background: var(--brand-soft); color: var(--brand); }
.changes { margin: 0; display: grid; gap: 10px; }
.changes > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 16px; }
.changes dt { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.changes dd { margin: 0; }
.diff { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
/* Removed words are struck through and added ones underlined, so the difference doesn't rest on color alone */
.diff del { padding: 0 2px; border-radius: 3px; background: #fbe4df; color: #7a2a1d; text-decoration: line-through; }
.diff ins { padding: 0 2px; border-radius: 3px; background: #dff0e5; color: #1d5236; text-decoration: underline; text-decoration-color: #3a8a5c; text-underline-offset: 3px; }
.diff__gap, .diff__none, .diff__arrow { color: var(--ink-3); }
.diff__none { font-style: italic; }
.diff__note { font-weight: 600; }
.history__pager { display: flex; justify-content: space-between; gap: 12px; }
@media (max-width: 600px) {
  .changes > div { grid-template-columns: 1fr; }
  .version__head form { margin-left: 0; }
}

/* ---------- categories ---------- */
.categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.category-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.category-option input { margin-top: 3px; accent-color: var(--brand); }
.category-option span { display: grid; gap: 2px; }
.category-option strong { font-size: 14.5px; }
.category-option small { font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.category-option:hover { border-color: var(--line-2); }
.category-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.category-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.category-option--none { grid-column: 1 / -1; align-items: center; }
.pill--category { background: var(--surface-2); color: var(--ink-2); }
.pill--category:hover { background: var(--brand-soft); color: var(--brand); }
.card__category { color: var(--ink-3); white-space: nowrap; }  /* moves to its own line rather than wrapping beside the badge */
@media (max-width: 600px) {
  .card__category { flex-basis: 100%; white-space: normal; }  /* narrow cards: its own line, wrapped, never cut off */
}
.browse__categories { margin: -6px 0 16px; }
.browse__categories .chip { text-decoration: none; }
.browse__categories .chip[aria-current="page"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
@media (max-width: 600px) {
  .categories { grid-template-columns: 1fr; }
}

/* ---------- reports ---------- */
.report-link { color: var(--ink-3); font-size: 13px; }
.comment__meta .report-link, .reply__meta .report-link { margin-left: auto; }
.comment__meta form + .report-link, .reply__meta form + .report-link { margin-left: 0; }
.post__report { align-self: flex-start; white-space: nowrap; }
.report-target { display: grid; gap: 2px; margin: 24px 0 20px; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.report-target__what { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.report-target a { font: 500 18px/1.3 var(--serif); }
.report-reasons { display: grid; gap: 8px; }
.report-note { margin-top: 18px; font-size: 13.5px; }
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.report-actions__note { flex: 1 1 260px; }
.report-actions__note input { width: 100%; }
.report-handled { margin: 28px 0 10px; }
.pill--report { background: var(--event-soft); color: var(--event); }
.pill--status-removed { background: var(--surface-2); color: var(--ink-2); }
.pill--status-fixed { background: var(--place-soft); color: var(--place); }
.pill--status-dismissed { background: var(--surface-2); color: var(--ink-3); }

/* Touch screens: buttons at least 44 x 44px, the usual minimum for a fingertip */
@media (pointer: coarse) {
  .leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
  .result__locate { width: 44px; height: 44px; }
}

/* ---------- county resources: historians and history groups ---------- */
.resource-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 4px 0 8px; }
.resource-filters .toolbar { border: 0; padding: 0; }
.resource-filters .chip { text-decoration: none; }
.resource-filters .chip[aria-current="page"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.resource-group, .resource-mine { margin: 26px 0 8px; }
.resource-mine + .resource-filters { margin-top: 26px; }
.resource-group .section-title, .resource-mine .section-title { margin-bottom: 12px; }
.resource-list { display: grid; gap: 16px; }
.resource { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: calc(var(--topbar) + 16px); }
.resource:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.resource__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.resource__kind { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 2px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.resource__name { margin: 0; font: 500 21px/1.25 var(--serif); }
.resource__serves { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.resource__about p, .resource__holdings p { margin: 0 0 8px; font-size: 15px; }
.resource__holdings h4 { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.resource__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 24px; align-items: start; }
.resource__contact { display: grid; gap: 6px; margin: 0; padding: 2px 0 2px 20px; border-left: 1px solid var(--line); font-size: 14px; }
@media (max-width: 760px) {
  .resource__cols { grid-template-columns: 1fr; gap: 12px; }
  .resource__contact { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
.resource__contact div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.resource__contact dt { color: var(--ink-3); font-weight: 600; }
.resource__contact dd { margin: 0; overflow-wrap: anywhere; }
.resource__foot { margin-top: auto; font-size: 12.5px; color: var(--ink-3); }
.resource__note { font-size: 14px; }
.pill--verified { display: inline-flex; align-items: center; gap: 4px; background: var(--place-soft); color: var(--place); text-transform: none; letter-spacing: 0; }
.pill--status-pending { background: var(--photo-soft); color: var(--photo); }
.pill--status-declined, .pill--status-hidden { background: var(--surface-2); color: var(--ink-3); }
.resource-empty { margin: 28px 0; padding: 40px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.resource-empty h2 { margin: 0 0 8px; font: 500 24px/1.25 var(--serif); color: var(--ink); }
.resource-empty p { max-width: 620px; margin: 0 auto 18px; font-size: 16px; }
.resource-footnote { margin: 24px 0 8px; font-size: 13.5px; }
.town-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.town-groups h2 { display: flex; align-items: center; gap: 8px; }
.town-groups__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.listings-heading { margin: 30px 0 12px; }
.admin-head + .listings-heading { margin-top: 0; }
.listing-queue { padding-bottom: 0; }
.listing-review { padding: 4px 4px 0; }
.listing-review .request-group__body { border-top: 0; gap: 10px; }
.listing-review .request-group__body > p { margin: 0; }
.listing-review .report-actions { margin: 2px 0 0; }
.listing-review__connection { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.listing-action { display: flex; align-items: center; gap: 6px; }
.listing-action input[type="text"] { width: 220px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 13.5px; }
.listing-rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.listing-rows li { display: grid; gap: 8px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.listing-rows__name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
