/* mappalachia.com — design tokens */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-translucent: rgba(255, 255, 255, 0.72);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --text-mute: #86868b;
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --good: #1f8a3d;
  --warn: #b87514;
  --bad: #b23a48;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --transition: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 52px;
  --footer-h: 36px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --surface: #1d1d1f;
    --surface-2: #2a2a2c;
    --surface-translucent: rgba(29, 29, 31, 0.72);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f5f5f7;
    --text-soft: #aeaeb2;
    --text-mute: #8e8e93;
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --good: #30d158;
    --warn: #ff9f0a;
    --bad: #ff6961;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
    --shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.7), 0 4px 14px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; cursor: pointer; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ───────── nav ───────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 20px;
  background: var(--surface-translucent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.brand-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.brand {
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 18px;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-tag {
  font-weight: 400;
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
@media (max-width: 640px) {
  .brand-tag { display: none; }
}

.nav-toggle {
  display: none;             /* desktop hides the hamburger entirely */
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 18px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--bg); }

.navlinks { display: flex; gap: 18px; align-items: center; }
.navlinks a {
  font-size: 14px;
  color: var(--text-soft);
}
.navlinks a:hover { color: var(--text); text-decoration: none; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topnav { position: sticky; top: 0; }   /* keep behavior, just be explicit */
  .navlinks {
    display: none;
    position: absolute;
    top: calc(var(--nav-h) - 4px);
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 60;            /* above the sticky topnav (z:50) */
  }
  .navlinks.is-open { display: flex; }
  .navlinks a {
    font-size: 15px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
  }
  .navlinks a:hover { background: var(--bg); }
  .brand { font-size: 19px; }
}

/* ───────── layout ───────── */
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  flex: 1;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  min-height: 0;
}

.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }

@media (max-width: 880px) {
  /* Drop the fixed-height inner cages — let the document scroll naturally
     so the list flows and the footer ends up at the bottom of *all*
     content instead of permanently squatting on the viewport. */
  body { display: block; min-height: auto; }
  .layout {
    display: flex;
    flex-direction: column;
    flex: none;
    height: auto;
    min-height: 0;
  }
  .mapwrap {
    order: 1;
    height: 320px;
    min-height: 320px;
  }
  #map { position: relative; inset: auto; height: 100%; }
  .sidebar {
    order: 2;
    border-right: none;
    border-top: 1px solid var(--border);
    overflow: visible;        /* was hidden — let it grow */
    min-height: 0;
  }
  .list-wrap {
    overflow: visible;        /* was overflow-y: auto — let the page scroll */
    flex: none;
    padding-bottom: 24px;
  }
}

/* ───────── admin form ───────── */
.admin-table input[type="date"],
.admin-table input[type="time"],
.admin-table input[type="text"] {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.admin-table input[type="date"],
.admin-table input[type="time"] { width: auto; min-width: 130px; }
.admin-flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 18px 0;
}
.admin-flash.is-ok  { background: rgba(31, 138, 61, 0.12); color: var(--good); }
.admin-flash.is-err { background: rgba(178, 58, 72, 0.12); color: var(--bad);  }
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(0.94); }

/* ───────── stat tiles ───────── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 14px 8px 14px;
}
.tile {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-width: 0;
}
.tile-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.tile-value {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ───────── filters ───────── */
.filters { padding: 0 14px 8px 14px; }

.control { margin-bottom: 8px; }
.controls-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.text {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.text::placeholder { color: var(--text-mute); }
.text.num { max-width: 96px; padding-right: 8px; }
.text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.range-label {
  font-size: 12px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.select {
  height: 36px;
  padding: 0 32px 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: 0 14px;
  height: 36px;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition),
              transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: var(--bg);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(0, 0, 0, 0.06); }
@media (prefers-color-scheme: dark) {
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
}
.btn-clear {
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-soft);
}

.watchlist-toggle {
  width: 100%;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  border: 1px solid var(--border);
}
.watchlist-toggle .wl-star { color: var(--bad); font-size: 14px; }
.watchlist-toggle .wl-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.watchlist-toggle.is-on {
  background: var(--bad);
  color: white;
  border-color: var(--bad);
}
.watchlist-toggle.is-on .wl-star { color: white; }
.watchlist-toggle.is-on .wl-count {
  background: rgba(255, 255, 255, 0.22);
  color: white;
}
.watchlist-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ───────── list ───────── */
.list-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 10px 16px 10px;
  min-height: 0;
  scrollbar-gutter: stable;
}
.parcel-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.parcel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-gap: 4px 12px;
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition), background var(--transition);
  position: relative;
}
.parcel-card.is-watched {
  border-color: rgba(224, 36, 94, 0.35);
  background: linear-gradient(180deg, rgba(224, 36, 94, 0.03), var(--surface) 40%);
}
@media (prefers-color-scheme: dark) {
  .parcel-card.is-watched {
    background: linear-gradient(180deg, rgba(255, 105, 97, 0.08), var(--surface) 40%);
  }
}

.pc-bid-col {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pc-star {
  background: transparent;
  border: none;
  padding: 2px 4px;
  margin: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--text-mute);
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
  border-radius: 6px;
}
.pc-star:hover { color: var(--bad); transform: scale(1.12); }
.pc-star.is-on { color: var(--bad); }
.pc-star:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.parcel-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.parcel-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pc-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pc-bid {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
.pc-meta {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.pc-meta .sep { color: var(--text-mute); }
.pc-county-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: white;
  text-shadow: 0 0 1px rgba(0,0,0,0.2);
  letter-spacing: 0.01em;
}
.pc-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  color: var(--text-mute);
  background: transparent;
  font-weight: 600;
}
.pc-pill.is-onmap     { color: var(--good); }
.pc-pill.is-centroid  { color: var(--warn); }
.pc-pill.is-unresolved{ color: var(--bad); }
.pc-legal {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ───────── empty + load states ───────── */
.empty {
  list-style: none;
  color: var(--text-mute);
  font-size: 14px;
  padding: 32px 12px;
  text-align: center;
}

/* ───────── footer ───────── */
.site-footer {
  font-size: 11px;
  color: var(--text-soft);
  padding: 8px 16px;
  background: var(--surface-translucent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  text-align: center;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 6px;
}
.footer-credit {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.01em;
}
.footer-credit a { color: var(--text-soft); }
.footer-credit a:hover { color: var(--accent); text-decoration: none; }
.heart {
  display: inline-block;
  color: #e0245e;
  font-size: 11px;
  transform: translateY(0.5px);
  margin: 0 1px;
}
.site-footer .sep { color: var(--text-mute); }
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--text); }

/* ───────── leaflet popup ───────── */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  color: var(--text);
}
.leaflet-popup-content { margin: 14px 16px; min-width: 240px; max-width: 320px; }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-container { font-family: inherit; font-size: 13px; }

.popup .pop-name {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 2px 0;
  letter-spacing: -0.005em;
}
.popup .pop-sub {
  color: var(--text-soft);
  font-size: 12px;
  margin-bottom: 8px;
}
.popup .pop-bid {
  font-weight: 600;
  font-size: 17px;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin: 6px 0;
  font-variant-numeric: tabular-nums;
}
.popup .pop-row { margin: 4px 0; }
.popup .pop-row .k {
  color: var(--text-mute);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  margin-right: 4px;
}
.popup .pop-legal {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
  max-height: 96px;
  overflow-y: auto;
  margin: 6px 0;
  padding-right: 4px;
}
.popup .pop-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.popup .pop-links a {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}
.popup .pop-links a:hover { background: var(--accent); color: white; }
.popup .pop-disclaimer {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-mute);
  font-style: italic;
}
.flood-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text);
}
.flood-tag.is-sfha {
  background: rgba(178, 58, 72, 0.12);
  color: var(--bad);
}
.lc-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text);
}
/* NLCD palette-ish coloring so a quick glance gives the gist */
.lc-tag.lc-11 { background: rgba(70, 107, 159, 0.18); color: #466b9f; }   /* Open Water */
.lc-tag.lc-21,
.lc-tag.lc-22,
.lc-tag.lc-23,
.lc-tag.lc-24 { background: rgba(222, 153, 197, 0.20); color: #b35a8a; }  /* Developed */
.lc-tag.lc-31 { background: rgba(178, 173, 163, 0.30); color: #6e6357; }  /* Barren */
.lc-tag.lc-41,
.lc-tag.lc-42,
.lc-tag.lc-43 { background: rgba(56, 129, 78, 0.18); color: #38814e; }    /* Forest */
.lc-tag.lc-52 { background: rgba(204, 184, 121, 0.25); color: #8b7a44; }  /* Shrub/Scrub */
.lc-tag.lc-71 { background: rgba(220, 217, 90, 0.25); color: #7a7720; }   /* Grassland */
.lc-tag.lc-81,
.lc-tag.lc-82 { background: rgba(220, 216, 60, 0.20); color: #a3a002; }   /* Pasture / Crops */
.lc-tag.lc-90,
.lc-tag.lc-95 { background: rgba(140, 188, 211, 0.25); color: #427f9e; }  /* Wetlands */

/* ───────── about ───────── */
.about {
  max-width: 720px;
  margin: 48px auto;
  padding: 0 24px 96px 24px;
}
.about h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 12px 0;
}
.about h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 36px 0 10px 0;
}
.about p { margin: 0 0 14px 0; }
.about ul { padding-left: 20px; margin: 0 0 14px 0; }
.about li { margin-bottom: 6px; }
.about .lede {
  font-size: 19px;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 32px;
}

/* ───────── per-parcel detail page ───────── */
.parcel-page {
  max-width: 980px;
  margin: 36px auto;
  padding: 0 24px 80px 24px;
}
.parcel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 24px;
}
.parcel-head-info { min-width: 0; flex: 1 1 320px; }
.parcel-county-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
  text-shadow: 0 0 1px rgba(0,0,0,0.2);
}
.parcel-county-badge:hover { text-decoration: none; opacity: 0.92; }
.parcel-head h1 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
  word-break: break-word;
}
.parcel-sub {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 4px;
}
.parcel-sub .sep { color: var(--text-mute); margin: 0 4px; }
.parcel-bid {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 22px;
  text-align: right;
  box-shadow: var(--shadow-sm);
  min-width: 160px;
}
.parcel-bid-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.parcel-bid-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.parcel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 28px;
}
@media (max-width: 720px) {
  .parcel-grid { grid-template-columns: 1fr; }
}
.parcel-mini-map {
  height: 380px;
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.parcel-map-caption {
  font-size: 12px;
  color: var(--text-soft);
  margin: 8px 0 14px 0;
}
.parcel-facts h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin: 0 0 12px 0;
}
.facts-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px 16px;
  margin: 0 0 24px 0;
}
.facts-list dt {
  font-size: 12px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  align-self: center;
}
.facts-list dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}
.facts-list dd small { color: var(--text-soft); font-size: 12px; }
.parcel-legal {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0;
}
.parcel-disclaimer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-soft);
}

/* ───────── trending page ───────── */
.page-toggle {
  display: inline-flex;
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
  margin: 0 0 24px 0;
}
.page-toggle .btn {
  height: 32px;
  padding: 0 14px;
  background: transparent;
  font-weight: 500;
}
.page-toggle .btn.is-active {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.trend-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trend-card {
  display: grid !important;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 0 16px;
  text-decoration: none;
  color: inherit;
}
.trend-card:hover { text-decoration: none; }
.trend-card .pc-rank {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-mute);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.trend-card .trend-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trend-card .trend-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.trend-card .trend-row .pc-name { flex: 1; min-width: 0; }
.trend-views {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}
.trend-views strong {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ───────── stats page ───────── */
.stats-page { max-width: 1080px; }

.summary-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0 36px 0;
}
.summary-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.summary-tile .st-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 500;
}
.summary-tile .st-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

.stats-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 12px 0 24px 0;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stats-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.stats-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.stats-table tbody tr:last-child td { border-bottom: none; }
.stats-table tbody tr:hover { background: var(--bg); }
.stats-table th.num,
.stats-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.county-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: middle;
}
.stats-footnote {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-top: 12px;
}
.owner-link {
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}
.owner-link:hover { text-decoration: underline; }

/* ───────── first-paint staggered fade-in ───────── */
.parcel-list.is-first-paint .parcel-card { animation: fade-up 280ms ease-out backwards; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.parcel-list.is-first-paint .parcel-card:nth-child(1)  { animation-delay:   0ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(2)  { animation-delay:  20ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(3)  { animation-delay:  40ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(4)  { animation-delay:  60ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(5)  { animation-delay:  80ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(6)  { animation-delay: 100ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(7)  { animation-delay: 120ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(8)  { animation-delay: 140ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(9)  { animation-delay: 160ms; }
.parcel-list.is-first-paint .parcel-card:nth-child(10) { animation-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
