:root {
  --bg: #0B0F14;
  --panel: #141A20;
  --cream: #F7F4EE;
  --muted: #9AA3AD;
  --sage: #3D6B5A;
  --sage2: #8FBFA9;
  --line: #1e262e;
  --radius: 12px;
  --gold: #E6D5A3;
  --low: #1F5C4A;
  --mid: #C4A35A;
  --high: #B85C38;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--cream);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}
html.embed, html.embed body { height: 100%; overflow: hidden; }
a { color: var(--sage2); text-decoration: none; }
a:hover { color: var(--cream); }
.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;
}

header.app-bar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: rgba(11,15,20,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.app-bar img.wordmark { height: 32px; width: auto; display: block; }
header.app-bar .sub {
  color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
header.app-bar nav { margin-left: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
header.app-bar nav a { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
header.app-bar nav a:hover { color: var(--cream); }

.open-full { display: none; }
html.embed .open-full {
  display: inline-flex; align-items: center; gap: .35rem;
  position: fixed; top: 8px; right: 8px; z-index: 4000;
  background: var(--sage); color: var(--cream); text-decoration: none;
  font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: .55rem .85rem; border-radius: 999px;
  border: 1px solid rgba(143,191,169,.35);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
html.embed header.app-bar { padding-right: 9.5rem; }
html.embed header.app-bar img.wordmark { height: 22px; }
html.embed header.app-bar .sub { display: none; }

.hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 22px 22px 8px;
}
.hero-copy { max-width: 48rem; }
.hero h1 {
  margin: 0 0 6px;
  font-family: Syne, "IBM Plex Sans", sans-serif;
  font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em;
}
.hero p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hero-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap;
}
.hero-meta .kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sage2);
}

.cue {
  margin: 0 22px 4px;
  padding: 10px 14px;
  background: rgba(61,107,90,.12);
  border: 1px solid rgba(143,191,169,.22);
  border-radius: 10px;
  color: var(--cream); font-size: 13px; line-height: 1.45;
}
.cue.dim { opacity: .55; }

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 22px 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 11px;
  min-height: 92px;
}
.card .lbl {
  display: block;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.card .val {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.35rem; font-weight: 500; letter-spacing: -.03em;
  color: var(--cream); line-height: 1.15;
}
.card .val em { font-style: normal; color: var(--muted); font-size: 0.72em; margin-left: 2px; }
.card .sub { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.card[data-card="pmms30"] .val { color: var(--sage2); }
.card[data-card="delta"] .val.up { color: #E08A6A; }
.card[data-card="delta"] .val.down { color: var(--sage2); }

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  min-height: 640px;
}
.rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 14px 14px 28px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  position: sticky; top: 56px;
}
.rail-sec { margin-bottom: 18px; }
.rail-lbl {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.linkish {
  background: none; border: 0; color: var(--sage2); cursor: pointer;
  font: inherit; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 0;
}
.linkish:hover { color: var(--cream); }

#search-form { position: relative; }
#search-input {
  width: 100%;
  background: var(--bg); color: var(--cream);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 13px;
}
#search-input:focus { outline: 1px solid var(--sage2); border-color: var(--sage); }
.search-results {
  list-style: none; margin: 4px 0 0; padding: 4px 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  max-height: 320px; overflow: auto; position: absolute; left: 0; right: 0; z-index: 40;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
.search-results li button,
.search-results li .search-hit {
  width: 100%; text-align: left; background: none; border: 0; color: var(--cream);
  padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.search-results li button:hover,
.search-results li button.active,
.search-results li .search-hit:hover,
.search-results li .search-hit.active { background: rgba(143,191,169,.12); }
.search-results .sr-type {
  flex: 0 0 auto;
  font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sage2); background: rgba(61,107,90,.28);
  border: 1px solid rgba(143,191,169,.35); border-radius: 999px;
  padding: 3px 7px; min-width: 52px; text-align: center;
}
.search-results .sr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.search-results .sr-name { color: var(--cream); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .sr-sub { color: var(--muted); font-size: 11px; font-family: "IBM Plex Mono", monospace; }
.search-results .sr-rate {
  flex: 0 0 auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px; color: var(--sage2); font-weight: 500;
}
.search-results .search-empty {
  padding: 12px 14px; font-size: 12px; color: var(--muted); line-height: 1.45;
}

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.seg button {
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.seg button[aria-current="true"] {
  color: var(--cream); border-color: var(--sage); background: rgba(61,107,90,.25);
}
.seg button:disabled { opacity: .4; cursor: not-allowed; }

.filter-track {
  position: relative; height: 28px; display: flex; align-items: center;
}
.filter-track input[type=range] {
  position: absolute; left: 0; right: 0; width: 100%;
  pointer-events: none; appearance: none; background: transparent; height: 28px; margin: 0;
}
.filter-track input[type=range]::-webkit-slider-thumb {
  pointer-events: auto; appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--sage2); border: 2px solid var(--bg); cursor: pointer;
}
.filter-track input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 16px; height: 16px;
  border-radius: 50%; background: var(--sage2); border: 2px solid var(--bg); cursor: pointer;
}
.filter-fill {
  position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--low), var(--mid), var(--high));
  opacity: .85;
}
.filter-vals {
  display: flex; justify-content: space-between;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--muted); margin-top: 2px;
}
.filter-count { margin-top: 6px; font-size: 11px; color: var(--muted); }

.pmms-pinned { margin-bottom: 8px; }
.pmms-callout { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pmms-big {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.7rem; font-weight: 500; color: var(--sage2); letter-spacing: -.03em;
}
.pmms-when { font-size: 11px; color: var(--muted); }
.pmms-readout {
  margin-top: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px; color: var(--muted); line-height: 1.45;
  min-height: 2.9em;
}
.pmms-readout .ro-row { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.pmms-readout .ro-k { color: var(--muted); }
.pmms-readout .ro-v { color: var(--cream); }
.pmms-readout .ro-v.sage { color: var(--sage2); }
.pmms-readout .ro-v.gold { color: var(--gold); }
.pmms-readout .ro-v.up { color: var(--high); }
.pmms-readout .ro-v.down { color: var(--sage2); }
.pmms-readout.is-pinned .ro-pin {
  display: inline-block; margin-left: 4px; font-size: 10px;
  color: var(--gold); letter-spacing: .04em; text-transform: uppercase;
}
.chart-toolbar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.chart-toolbar .seg-3 { grid-template-columns: repeat(3, 1fr); }
.chart-toolbar .seg button { padding: 6px 4px; font-size: 11px; }
.chart-wrap {
  position: relative;
  touch-action: none;
  user-select: none;
}
#pmms-chart {
  width: 100%; height: 148px; display: block;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  cursor: crosshair;
}
.chart-tooltip {
  position: absolute; z-index: 3; pointer-events: none;
  background: rgba(20,26,32,.96); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px;
  font-family: "IBM Plex Mono", monospace; font-size: 11px;
  color: var(--cream); line-height: 1.4;
  max-width: min(220px, 90%);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.chart-tooltip .tt-date { color: var(--muted); margin-bottom: 4px; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; }
.chart-tooltip .tt-row .k { color: var(--muted); }
.chart-tooltip .tt-row .v.sage { color: var(--sage2); }
.chart-tooltip .tt-row .v.gold { color: var(--gold); }
.pay-spark-row { margin-top: 8px; }
.pay-spark-lbl {
  font-size: 10px; color: var(--muted); margin-bottom: 4px;
  letter-spacing: .02em;
}
#pmms-pay-spark {
  width: 100%; height: 36px; display: block;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.chart-hint { margin-top: 6px; font-size: 10px; color: var(--muted); }

.field {
  display: block; font-size: 11px; color: var(--muted); margin-bottom: 8px;
}
.field input, .field select {
  display: block; width: 100%; margin-top: 4px;
  background: var(--bg); color: var(--cream);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 13px;
}
/* ——— Payment studio hero (v20260920k) ——— */
.pay-hero {
  margin: 12px 0 10px;
  padding: 14px 14px 12px;
  background: linear-gradient(165deg, rgba(61,107,90,.16), rgba(11,15,20,.4));
  border: 1px solid rgba(143,191,169,.28);
  border-radius: 12px;
}
.pay-hero-lbl {
  font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--sage2); margin-bottom: 4px;
}
.pay-hero-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.75rem, 5.5vw, 2.15rem);
  font-weight: 500; color: var(--gold);
  letter-spacing: -.03em; line-height: 1.1;
  word-break: break-word;
}
.pay-hero-sub {
  margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.35;
}
.pay-total-wrap {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(143,191,169,.2);
}
.pay-total-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.pay-total-lbl {
  font-size: 12px; color: var(--cream); font-weight: 500;
}
.pay-total-tag {
  display: inline-block; margin-left: 4px;
  font-size: 10px; font-weight: 400; color: var(--muted);
  letter-spacing: .02em;
}
.pay-total-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.15rem, 3.8vw, 1.35rem);
  color: var(--cream); letter-spacing: -.02em;
}
.pay-bar {
  display: flex; height: 6px; margin-top: 10px;
  border-radius: 999px; overflow: hidden;
  background: rgba(30,38,46,.9);
}
.pay-bar-pi { background: var(--gold); height: 100%; min-width: 2px; }
.pay-bar-ex { background: var(--sage); height: 100%; min-width: 0; }
.pay-bar-legend {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 6px; font-size: 10px; color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}
.pay-micro {
  margin: 10px 0 0; font-size: 11px; line-height: 1.4; color: var(--muted);
}

.housing-extras {
  margin: 0 0 10px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden;
}
.housing-extras > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 12px;
  font-size: 13px; color: var(--cream);
  background: var(--panel);
  min-height: 44px; /* iPhone tap */
}
.housing-extras > summary::-webkit-details-marker { display: none; }
.housing-extras > summary::before {
  content: "+"; flex: 0 0 auto;
  width: 1.1em; color: var(--sage2); font-weight: 600;
}
.housing-extras[open] > summary::before { content: "−"; }
.extras-sum-main { flex: 1; }
.extras-hint {
  font-size: 10px; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.extras-note {
  margin: 0; padding: 0 12px 10px;
  font-size: 11px; line-height: 1.4; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.extras-stack { display: grid; gap: 0; }
.extras-row {
  display: grid; grid-template-columns: 1fr minmax(88px, 110px);
  align-items: center; gap: 10px;
  margin: 0; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.extras-row:last-child { border-bottom: none; }
.extras-row-lbl em {
  font-style: normal; color: var(--muted); opacity: .75; font-size: 10px;
}
.extras-row input {
  width: 100%; margin: 0;
  background: var(--bg); color: var(--cream);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; font: inherit; font-size: 14px;
  font-family: "IBM Plex Mono", monospace; text-align: right;
  min-height: 42px;
}
.extras-row input:focus {
  outline: none; border-color: var(--sage); box-shadow: 0 0 0 2px rgba(61,107,90,.25);
}
.extras-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 10px 12px 12px;
}
.btn-ghost-sm {
  margin-top: 0; padding: 9px 8px; font-size: 11px; min-height: 40px;
}
.rate-source-btns { display: grid; gap: 6px; margin-top: 4px; }

.btn-ghost {
  display: block; width: 100%; margin-top: 6px;
  background: transparent; color: var(--sage2);
  border: 1px solid rgba(143,191,169,.3); border-radius: 8px;
  padding: 10px 10px; font: inherit; font-size: 12px; cursor: pointer;
  min-height: 42px;
}
.btn-ghost:hover { background: rgba(143,191,169,.1); color: var(--cream); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.rate-median-hint { margin: 6px 0 0; line-height: 1.35; opacity: .78; font-size: 12px; }

@media (max-width: 640px) {
  .pay-hero { padding: 16px 14px 14px; }
  .pay-hero-num { font-size: 2rem; }
  .extras-row { grid-template-columns: 1fr minmax(96px, 42%); }
}

.map-pane {
  position: relative; min-height: 640px; background: #0d1218;
}
#map { position: absolute; inset: 0; background: #0d1218; }
.map-overlay {
  /* Clear Leaflet zoom (+/-) top-left (~34–40px + 10px margin) — not under controls */
  position: absolute; top: 12px; left: 52px; z-index: 500;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  pointer-events: none;
  max-width: calc(100% - 52px - 12px);
}
.chip {
  pointer-events: none;
  background: rgba(20,26,32,.92); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
  width: fit-content; max-width: min(420px, calc(100vw - 64px));
  backdrop-filter: blur(6px);
}
.chip h3 {
  margin: 0 0 2px; font-size: 13px; font-weight: 600;
  white-space: normal; overflow: visible; text-overflow: clip;
  overflow-wrap: break-word;
}
.chip span { display: block; font-size: 11px; color: var(--muted); line-height: 1.35; }
.overlay-hint { margin-top: 4px !important; color: var(--sage2) !important; }
.satellite-chip {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20,26,32,.92); color: var(--cream);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer;
  backdrop-filter: blur(6px);
}
.satellite-chip[aria-pressed="true"] {
  border-color: var(--sage); background: rgba(61,107,90,.35);
}

.map-overlay-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  pointer-events: auto;
}
.show-all-chip {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(61,107,90,.42); color: var(--cream);
  border: 1px solid var(--sage); border-radius: 999px;
  padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer;
  backdrop-filter: blur(6px);
}
.show-all-chip:hover { background: rgba(61,107,90,.62); }
.show-all-chip[hidden] { display: none !important; }

/* Selected market lift on SVG paths */
.leaflet-interactive.mr-feat-selected {
  filter: drop-shadow(0 0 6px rgba(247,244,238,.35));
}
.leaflet-interactive.mr-feat-dimmed {
  transition: fill-opacity .25s ease, stroke-opacity .25s ease;
}

.layers-box {
  position: absolute; top: 12px; right: 12px; z-index: 500;
  width: 190px;
  background: rgba(20,26,32,.94); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; backdrop-filter: blur(6px);
}
.layers-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: transparent; border: 0; color: var(--cream);
  padding: 9px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.layers-body { padding: 0 12px 10px; border-top: 1px solid var(--line); }
.layers-box.collapsed .layers-body { display: none; }
.layers-sec { margin-top: 8px; }
.layers-sec-lbl {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.layers-opt {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--cream); margin: 4px 0; cursor: pointer;
}
.layers-opt input { accent-color: var(--sage2); }

.legend {
  position: absolute; bottom: 16px; left: 12px; z-index: 500;
  background: rgba(20,26,32,.94); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-width: 160px;
  font-size: 11px; color: var(--muted);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.legend.visible { opacity: 1; pointer-events: auto; }
.legend .leg-title {
  color: var(--cream); font-weight: 600; margin-bottom: 6px; font-size: 12px;
  white-space: normal; overflow: visible; text-overflow: clip;
  overflow-wrap: break-word;
}
.legend .swatch-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend .sw { width: 18px; height: 10px; border-radius: 2px; border: 1px solid rgba(255,255,255,.08); }
.legend .leg-note { margin-top: 6px; font-size: 10px; }

.hover-card {
  position: absolute; z-index: 600; pointer-events: none;
  background: rgba(11,15,20,.95); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  font-size: 12px; transform: translate(12px, 12px);
}
.hover-card .hc-name { font-weight: 600; margin-bottom: 2px; }
.hover-card .hc-rate {
  font-family: "IBM Plex Mono", monospace; font-size: 15px; color: var(--sage2);
}
.hover-card .hc-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }

.detail-panel {
  position: absolute; top: 12px; right: 214px; z-index: 550;
  width: min(360px, calc(100% - 230px));
  background: rgba(20,26,32,.96); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
}
.detail-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.detail-head h3 {
  margin: 0; font-size: 16px; font-weight: 600;
  white-space: normal; overflow: visible; text-overflow: clip;
  overflow-wrap: break-word;
}
.detail-geoid { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.detail-close {
  background: transparent; border: 0; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.detail-close:hover { color: var(--cream); }
.detail-cue {
  margin: 8px 0 10px; font-size: 12px; color: var(--sage2);
  font-family: "IBM Plex Mono", monospace;
}
.detail-rows { display: grid; gap: 8px; }
.detail-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding-bottom: 7px; border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.detail-row:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-row .k {
  color: var(--muted); min-width: 0;
  white-space: normal; overflow: visible; text-overflow: clip;
  overflow-wrap: break-word;
}
.detail-row .v {
  min-width: 0;
  font-family: "IBM Plex Mono", monospace; color: var(--cream); text-align: right;
  white-space: normal; overflow: visible; text-overflow: clip;
  overflow-wrap: break-word;
}

.page-foot {
  padding: 18px 22px 28px;
  border-top: 1px solid var(--line);
  display: grid; gap: 10px;
  font-size: 12px; color: var(--muted); line-height: 1.5;
}
.page-foot b { color: var(--cream); font-weight: 600; }
.page-foot em { font-style: normal; color: var(--sage2); }

/* Leaflet tweaks */
.leaflet-container { background: #0d1218; font: inherit; }
.leaflet-control-attribution {
  background: rgba(11,15,20,.75) !important; color: var(--muted) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--sage2) !important; }
.leaflet-bar a {
  background: var(--panel) !important; color: var(--cream) !important;
  border-bottom-color: var(--line) !important;
}
.leaflet-bar a:hover { background: #1a222b !important; }

.state-label {
  background: transparent !important; border: 0 !important;
  box-shadow: none !important; color: rgba(247,244,238,.78);
  font-family: "IBM Plex Sans", sans-serif; font-size: 11px; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.85); pointer-events: none;
}

@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 1fr; }
  .rail {
    position: static; max-height: none;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .map-pane { min-height: 520px; height: 60vh; }
  /* detail-panel mobile sheet: see v20260920n block below */
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-meta { align-items: flex-start; text-align: left; }
}
@media (max-width: 640px) {
  header.app-bar nav a:nth-child(n+3) { display: none; }
  .cards { grid-template-columns: 1fr 1fr; padding: 10px 12px; }
  .hero, .cue, .page-foot { padding-left: 12px; padding-right: 12px; }
  .cue { margin-left: 12px; margin-right: 12px; }
  .layers-box { width: 160px; }
}
html.embed .hero,
html.embed .cards,
html.embed .cue,
html.embed .page-foot,
html.embed .rail .chart-sec,
html.embed .rail .calc-sec { display: none; }
html.embed .workspace { min-height: 100%; height: calc(100% - 48px); }
html.embed .map-pane { min-height: 100%; height: 100%; }
html.embed .rail { max-height: 100%; top: 0; }

/* ——— Decision layer (v20260920e focus-select) ——— */
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-4 button { padding: 7px 4px; font-size: 11px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-hint {
  font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sage2); margin-left: 6px;
}

.calc-stats {
  display: grid; gap: 6px; margin: 8px 0 10px;
  padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font-size: 11px;
}
.calc-stats .cs-row {
  display: flex; justify-content: space-between; gap: 10px; color: var(--muted);
}
.calc-stats .cs-row b {
  font-family: "IBM Plex Mono", monospace; font-weight: 500; color: var(--cream);
}
.calc-stats .cs-row.pos b { color: #E08A6A; }
.calc-stats .cs-row.neg b { color: var(--sage2); }

.scenario-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip-btn {
  background: var(--bg); color: var(--sage2);
  border: 1px solid rgba(143,191,169,.35); border-radius: 999px;
  padding: 5px 10px; font: inherit; font-size: 11px; font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
}
.chip-btn:hover, .chip-btn.active {
  background: rgba(61,107,90,.3); color: var(--cream); border-color: var(--sage);
}
.scenario-out {
  margin-bottom: 8px; padding: 8px 10px;
  background: rgba(61,107,90,.12); border: 1px solid rgba(143,191,169,.22);
  border-radius: 8px; font-size: 12px; line-height: 1.4; color: var(--cream);
}
.scenario-out .so-lbl { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.compare-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.compare-out {
  margin-top: 8px; padding: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font-size: 12px;
}
.compare-empty { color: var(--muted); line-height: 1.4; }
.compare-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.compare-col h4 {
  margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--sage2);
}
.compare-col .cc-rate {
  font-family: "IBM Plex Mono", monospace; font-size: 1.15rem; color: var(--cream);
}
.compare-col .cc-meta { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.35; }
.compare-delta {
  grid-column: 1 / -1; margin-top: 6px; padding-top: 8px;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--gold);
  text-align: center;
}

.detail-means {
  margin: 8px 0 0; padding: 10px;
  background: rgba(61,107,90,.14); border: 1px solid rgba(143,191,169,.25);
  border-radius: 8px; font-size: 12px; line-height: 1.45; color: var(--cream);
}
.detail-means:empty { display: none; }
.detail-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px;
}
.detail-actions .btn-ghost { margin-top: 0; }

.rankings {
  padding: 22px 22px 8px;
  border-top: 1px solid var(--line);
}
.rankings-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-bottom: 12px;
}
.rankings h2 {
  margin: 0 0 4px;
  font-family: Syne, "IBM Plex Sans", sans-serif;
  font-size: 1.15rem; font-weight: 700;
}
.rankings-sub { margin: 0; color: var(--muted); font-size: 12px; }
.btn-solid {
  background: var(--sage); color: var(--cream);
  border: 1px solid rgba(143,191,169,.4); border-radius: 8px;
  padding: 9px 14px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-solid:hover { background: #4a8070; }
.rankings-wrap {
  overflow: auto; max-height: 420px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.rankings-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.rankings-table th, .rankings-table td {
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rankings-table th {
  position: sticky; top: 0; z-index: 1;
  background: #1a222b; color: var(--muted);
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; user-select: none;
}
.rankings-table th:hover { color: var(--cream); }
.rankings-table th[aria-sort="ascending"]::after { content: " ↑"; color: var(--sage2); }
.rankings-table th[aria-sort="descending"]::after { content: " ↓"; color: var(--sage2); }
.rankings-table tbody tr { cursor: pointer; }
.rankings-table tbody tr:hover { background: rgba(143,191,169,.08); }
.rankings-table tbody tr.selected { background: rgba(61,107,90,.22); }
.rankings-table .mono { font-family: "IBM Plex Mono", monospace; }
.rankings-table .down { color: var(--sage2); }
.rankings-table .up { color: #E08A6A; }

@media (max-width: 980px) {
  .rankings { padding: 16px 12px; }
  .rankings-head { flex-direction: column; align-items: flex-start; }
  .seg-4 { grid-template-columns: repeat(2, 1fr); }
}
html.embed .rankings,
html.embed .rail .compare-sec { display: none; }


/* ——— v20260920f county drill · chart sync · dist · legend ——— */
.county-back-chip {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20,26,32,.92); color: var(--cream);
  border: 1px solid rgba(143,191,169,.45); border-radius: 999px;
  padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer;
  backdrop-filter: blur(6px);
}
.county-back-chip:hover { background: rgba(61,107,90,.35); border-color: var(--sage); }
.county-back-chip[hidden] { display: none !important; }

.show-all-chip {
  box-shadow: 0 0 0 1px rgba(143,191,169,.25), 0 6px 16px rgba(0,0,0,.35);
  font-weight: 600;
  letter-spacing: .02em;
}
.show-all-chip:not([hidden]) {
  animation: showAllIn .35s ease;
}
@keyframes showAllIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.leaflet-interactive.mr-feat-selected {
  filter: drop-shadow(0 0 8px rgba(247,244,238,.55)) drop-shadow(0 0 2px rgba(143,191,169,.8));
  transition: fill-opacity .35s ease, stroke .35s ease, filter .35s ease;
}
.leaflet-interactive.mr-feat-dimmed {
  transition: fill-opacity .35s ease, stroke-opacity .35s ease, stroke .35s ease;
}
.leaflet-interactive.mr-county {
  transition: fill-opacity .28s ease, stroke .28s ease;
}
/* State polygons under county view must not eat clicks */
.leaflet-interactive.mr-feat-passthrough {
  pointer-events: none !important;
}

.chart-sync-badge {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  margin: 0 0 8px; padding: 8px 10px;
  background: rgba(61,107,90,.14);
  border: 1px solid rgba(143,191,169,.28);
  border-radius: 8px;
  font-size: 11px; line-height: 1.3;
}
.chart-sync-badge[hidden] { display: none !important; }
.chart-sync-badge .csb-geo { color: var(--muted); max-width: 100%; }
.chart-sync-badge .csb-rate {
  font-family: "IBM Plex Mono", monospace; font-size: 13px; color: var(--cream); font-weight: 500;
}
.chart-sync-badge .csb-vs {
  font-family: "IBM Plex Mono", monospace; color: var(--gold); font-size: 10px;
}

.chart-annot {
  position: absolute; bottom: 4px; z-index: 2; pointer-events: none;
  background: rgba(20,26,32,.92); border: 1px solid rgba(143,191,169,.35);
  border-radius: 6px; padding: 3px 7px;
  font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--sage2);
  white-space: nowrap; max-width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.chart-annot[hidden] { display: none !important; }

.dist-block {
  margin: 10px 0 12px; padding: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.dist-block[hidden] { display: none !important; }
.dist-lbl {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.dist-lbl .dist-sub { letter-spacing: .04em; text-transform: none; color: var(--sage2); margin-left: 4px; }
.dist-track {
  position: relative; height: 18px; margin: 4px 0 10px;
  background: rgba(30,38,46,.9); border-radius: 4px;
  border: 1px solid var(--line);
}
.dist-range {
  position: absolute; top: 4px; height: 10px; border-radius: 3px;
  background: linear-gradient(90deg, var(--low), var(--mid), var(--high));
  opacity: .9; min-width: 4px;
}
.dist-p50 {
  position: absolute; top: 1px; width: 3px; height: 16px;
  background: var(--cream); border-radius: 1px;
  transform: translateX(-1.5px);
  box-shadow: 0 0 6px rgba(247,244,238,.45);
}
.dist-nat {
  position: absolute; top: -2px; width: 0; height: 22px;
  border-left: 1.5px dashed rgba(154,163,173,.95);
  transform: translateX(-0.75px);
}
.dist-nums {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--cream);
}
.dist-nums b { color: var(--muted); font-weight: 500; margin-right: 4px; }
.dist-nums .dn-nat { color: var(--muted); }
.dist-nums .dn-p50 { color: var(--sage2); }

.legend { min-width: 188px; max-width: 220px; }
.legend .leg-ramp {
  height: 12px; border-radius: 3px; margin: 6px 0 2px;
  border: 1px solid rgba(255,255,255,.08);
}
.legend .leg-ramp-lbls {
  display: flex; justify-content: space-between;
  font-family: "IBM Plex Mono", monospace; font-size: 10px; margin-bottom: 6px;
}
.legend .leg-marks {
  position: relative; height: 22px; margin-bottom: 4px;
}
.legend .leg-mark {
  position: absolute; top: 0; transform: translateX(-50%);
  text-align: center; pointer-events: none;
}
.legend .leg-mark .lm-tick {
  display: block; width: 2px; height: 8px; margin: 0 auto 2px;
  background: var(--cream);
}
.legend .leg-mark.nat .lm-tick { background: var(--muted); height: 10px; }
.legend .leg-mark.sel .lm-tick { background: var(--sage2); box-shadow: 0 0 4px rgba(143,191,169,.6); }
.legend .leg-mark .lm-lbl {
  font-family: "IBM Plex Mono", monospace; font-size: 9px; color: var(--muted);
  white-space: nowrap;
}
.legend .leg-mark.sel .lm-lbl { color: var(--sage2); }
.legend .leg-key {
  display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 4px 0 2px;
  font-size: 10px; color: var(--muted);
}
.legend .lk { display: inline-flex; align-items: center; gap: 4px; }
.legend .lk i {
  display: inline-block; width: 10px; height: 8px; border-radius: 2px;
}
.legend .lk-nat {
  width: 0 !important; height: 10px !important;
  border-left: 1.5px dashed var(--muted); background: transparent !important;
}
.legend .lk-sel { background: var(--sage2); }
.legend .lk-low { background: var(--low); }
.legend .lk-high { background: var(--high); }

.detail-actions {
  grid-template-columns: 1fr 1fr;
}
.detail-actions #detail-county-back:not([hidden]) {
  grid-column: 1 / -1;
}

/* Mobile rail usability */
@media (max-width: 980px) {
  .rail {
    max-height: none;
    padding-bottom: 36px;
    -webkit-overflow-scrolling: touch;
  }
  .rail-sec { margin-bottom: 16px; }
  .seg button, .chip-btn, .btn-ghost, .satellite-chip, .show-all-chip, .county-back-chip {
    min-height: 40px;
  }
  .map-overlay-actions { max-width: calc(100vw - 64px); }
  .legend {
    bottom: 12px; left: 8px; right: auto;
    max-width: min(200px, calc(100% - 24px));
    font-size: 10px; padding: 8px 10px;
  }
  .chart-sync-badge { font-size: 10px; }
  .dist-nums { font-size: 10px; gap: 4px 8px; }
}


/* ——— v20260920h PMMS zoom reset ——— */
.chart-range-row {
  display: flex; align-items: stretch; gap: 6px;
}
.chart-range-row .seg-4 { flex: 1; min-width: 0; }
.zoom-reset-btn {
  flex: 0 0 auto;
  align-self: stretch;
  background: rgba(192,163,90,.12);
  color: var(--gold);
  border: 1px solid rgba(192,163,90,.4);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit; font-size: 11px; font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
}
.zoom-reset-btn:hover {
  background: rgba(192,163,90,.22);
  color: var(--cream);
  border-color: var(--gold);
}
.zoom-reset-btn[hidden] { display: none !important; }
#pmms-chart:focus {
  outline: 1px solid rgba(143,191,169,.55);
  outline-offset: 1px;
}


/* ——— v20260920i crisp boundary strokes (500k Census CB) ——— */
.leaflet-interactive.mr-feat,
.leaflet-interactive.mr-county {
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.leaflet-interactive.mr-feat-selected.mr-county {
  filter: drop-shadow(0 0 6px rgba(247,244,238,.5)) drop-shadow(0 0 1px rgba(143,191,169,.9));
}


/* Full Median label — never under Leaflet zoom; wrap OK (v20260920m) */
.map-overlay .chip,
.chip {
  overflow: visible !important;
  max-width: min(480px, calc(100vw - 64px));
}
/* Keep overlay clear of .leaflet-control-zoom (top-left, z-index 1000) */
.leaflet-top.leaflet-left .leaflet-control-zoom {
  margin-left: 10px;
  margin-top: 10px;
}
.map-overlay {
  left: 52px !important; /* ~40px zoom + margin + gap */
}
.chip h3,
.legend .leg-title,
.overlay-hint,
#overlay-title,
.detail-head h3,
.detail-row .k,
.detail-row .v {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}
.legend {
  min-width: 200px;
  max-width: min(260px, calc(100vw - 24px));
  overflow: visible !important;
}
.legend .leg-mark .lm-lbl {
  white-space: nowrap; /* short Nat/Sel ticks OK */
}
@media (max-width: 980px) {
  .legend {
    max-width: min(240px, calc(100% - 24px));
  }
  .chip h3, #overlay-title {
    font-size: 12.5px;
    line-height: 1.35;
  }
}


/* ——— v20260920n mobile bottom sheet ——— */
.detail-sheet-handle {
  display: none;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 0 4px;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.detail-sheet-grip {
  display: block;
  width: 40px;
  height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(247,244,238,.35);
}
.detail-sheet-handle:hover .detail-sheet-grip,
.detail-sheet-handle:focus-visible .detail-sheet-grip {
  background: var(--sage2);
}

@media (max-width: 980px) {
  .map-pane {
    /* room for peek sheet without covering the whole map */
    position: relative;
  }
  .detail-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: 42vh;
    margin: 0;
    padding: 0 14px calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 -10px 36px rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 700;
    transition: max-height .28s cubic-bezier(.2,.8,.2,1);
    background: rgba(20,26,32,.97);
  }
  .detail-panel[hidden] { display: none !important; }
  .detail-panel.is-expanded {
    max-height: min(82vh, 720px);
  }
  .detail-sheet-handle { display: block; flex: 0 0 auto; }
  .detail-panel .detail-head {
    flex: 0 0 auto;
    padding-top: 2px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
  }
  .detail-panel .detail-means,
  .detail-panel .detail-cue {
    flex: 0 0 auto;
  }
  .detail-panel .detail-means {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
    /* peek: clamp long copy so map stays visible */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .detail-panel.is-expanded .detail-means {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
  .detail-panel .dist-block,
  .detail-panel .detail-rows,
  .detail-panel .detail-actions {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .detail-panel:not(.is-expanded) .dist-block,
  .detail-panel:not(.is-expanded) .detail-rows,
  .detail-panel:not(.is-expanded) .detail-actions {
    /* peek shows header + means + cue; body scrolls only when expanded */
    display: none;
  }
  .detail-panel .detail-close {
    position: relative;
    z-index: 2;
    min-width: 44px;
    min-height: 44px;
    margin: -10px -8px -10px 0;
    padding: 10px 12px;
    font-size: 26px;
    touch-action: manipulation;
  }
  /* legend lifts above peek sheet; drops when expanded or closed */
  .map-pane.mr-sheet-open:not(.mr-sheet-expanded) .legend {
    bottom: calc(42vh + 8px);
    transition: bottom .28s cubic-bezier(.2,.8,.2,1);
  }
  .map-pane.mr-sheet-expanded .legend {
    bottom: 12px;
    opacity: .5;
  }
}

@media (max-width: 640px) {
  .detail-panel {
    max-height: 44vh;
  }
  .detail-panel.is-expanded {
    max-height: min(85vh, 780px);
  }
  .map-pane.mr-sheet-open:not(.mr-sheet-expanded) .legend {
    bottom: calc(44vh + 8px);
  }
}


/* v20260922a — Copy link + PMMS WoW + pay ceiling */
.card-wow {
  display: block;
  margin-top: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: var(--muted);
}
.card-wow.up { color: #E08A6A; }
.card-wow.down { color: var(--sage2); }
.card[data-card="pmms30"],
.card[data-card="pmms15"] { min-height: 108px; }

.detail-head-actions {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-shrink: 0;
}
.btn-copy-link {
  margin-top: 0 !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  white-space: nowrap;
}
.btn-copy-link.is-copied,
.btn-copy-link-inline.is-copied {
  color: var(--sage2) !important;
  border-color: rgba(143,191,169,.45) !important;
}
.btn-copy-link-inline {
  text-transform: none;
  letter-spacing: .02em;
  font-size: 11px;
}
.filter-pay-field { margin-top: 10px; }
.filter-pay-hint { margin: 4px 0 0; font-size: 10px; line-height: 1.35; color: var(--muted); }
