/* ------------------------------------------------------------------
   Tokens. Chart colors come from a palette validated for color-vision
   deficiency on a dark surface. Text never wears a series color.
   ------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --page: #f4f3ef;
  --surface-1: #fcfcfb;
  --surface-2: #efeee9;
  --border: #e2e0d9;
  --grid: #e8e6df;
  --text-primary: #1b1b1a;
  --text-secondary: #52514e;
  --text-muted: #7a7974;

  --series-1: #2a78d6; /* blue   */
  --series-2: #eb6834; /* orange */
  --series-3: #1baf7a; /* aqua   */
  --series-4: #eda100; /* yellow */
  --neutral-mark: #c9c7bf;

  --good: #0f7a0f;
  --warning: #b77d00;
  --critical: #d03b3b;

  --radius: 12px;
  --gap: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text-primary);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 24px;
  /* Clear the notch / status bar when opened from the home screen. */
  padding-top: max(14px, env(safe-area-inset-top));
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  background: rgba(252, 252, 251, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-icon { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { color: var(--text-muted); font-size: 13px; }

.status { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-secondary); }
.badge {
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-secondary); font-size: 11px; letter-spacing: 0.02em; white-space: nowrap;
}
.refresh { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.refresh-ring { width: 18px; height: 18px; transform: rotate(-90deg); }
.refresh-ring circle { fill: none; stroke-width: 3; }
.refresh-ring .track { stroke: var(--border); }
.refresh-ring .prog { stroke: var(--series-1); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.refresh-btn {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 10px; cursor: pointer; font-size: 12px; white-space: nowrap;
}
.refresh-btn:hover { border-color: var(--text-muted); }

/* Header and tabs stay pinned together, so the tabs never scroll away. */
.pinned { position: sticky; top: 0; z-index: 20; background: rgba(252, 252, 251, 0.96); backdrop-filter: blur(8px); }
.pinned .topbar { position: static; }

/* ---------- Nav ---------- */
.nav {
  display: flex; gap: 4px; padding: 10px 24px 0; overflow-x: auto;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--text-secondary); text-decoration: none; white-space: nowrap;
  padding: 10px 14px; border-bottom: 2px solid transparent; font-weight: 500;
}
.nav a:hover { color: var(--text-primary); }
.nav a[aria-current="page"] { color: var(--text-primary); border-bottom-color: var(--series-1); }

/* ---------- Layout ---------- */
main { padding: 24px; max-width: 1320px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.view-head h1 { font-size: 22px; margin: 0; font-weight: 650; }
.view-head p { margin: 4px 0 0; color: var(--text-secondary); }

.grid { display: grid; gap: var(--gap); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: var(--gap); }
.two-col { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.two-col-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .brand-sub { display: none; }
  .status { width: 100%; flex-wrap: wrap; gap: 8px 10px; }
  .status .refresh-btn { margin-left: auto; }
}
@media (max-width: 900px) {
  .two-col, .two-col-even { grid-template-columns: minmax(0, 1fr); }
  main { padding: 16px; }
  .topbar { padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
  .nav { padding: 6px 12px 0; }
}

.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: 0 1px 2px rgba(30, 28, 20, 0.04);
  animation: rise 0.5s cubic-bezier(.2,.7,.2,1) both;
}
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.18s; }
.card:nth-child(5) { animation-delay: 0.24s; }
.card h2 { font-size: 14px; margin: 0 0 4px; font-weight: 600; }
.card .sub { color: var(--text-muted); font-size: 12px; margin: 0 0 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Stat tiles ---------- */
.tile { padding: 16px 18px; position: relative; overflow: hidden; }
.tile .label { color: var(--text-secondary); font-size: 12px; }
.tile .value { font-size: 30px; font-weight: 650; letter-spacing: -0.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .note { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.tile .delta { font-size: 12px; margin-top: 2px; color: var(--text-secondary); }
.tile .delta .up { color: var(--good); }
.tile .delta .down { color: var(--critical); }
.tile.flash::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--series-1);
  animation: flash 1.4s ease-out both; pointer-events: none;
}
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Bars (HTML) ---------- */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.bar-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .meta { color: var(--text-muted); font-size: 12px; }
.bar-row .num { font-variant-numeric: tabular-nums; color: var(--text-secondary); text-align: right; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-fill {
  height: 100%; width: 0; border-radius: 0 4px 4px 0; background: var(--series-1);
  transition: width 1.1s cubic-bezier(.2,.7,.2,1);
}
.clickable { cursor: pointer; border-radius: 8px; padding: 6px 8px; margin: -6px -8px; }
.clickable:hover { background: var(--surface-2); }

/* ---------- Seat map ---------- */
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-head h2 { margin-bottom: 4px; }
.pager { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pager-btn {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-1);
  font-size: 20px; line-height: 1; display: grid; place-items: center; padding: 0 0 2px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.pager-btn:hover { background: var(--surface-2); border-color: var(--text-muted); }
.pager-btn:active { transform: scale(0.92); }
.pager-btn:focus-visible, .pip:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.pager-count { font-size: 12px; color: var(--text-secondary); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.seatmap-wrap { overflow: hidden; touch-action: pan-y; }
.pips { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.pip { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--neutral-mark); cursor: pointer; transition: width 0.25s, background 0.25s; }
.pip.on { width: 22px; border-radius: 4px; background: var(--series-1); }
.slide-in-right { animation: slideR 0.45s cubic-bezier(.2,.7,.2,1) both; }
.slide-in-left { animation: slideL 0.45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes slideR { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slideL { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.seatmap { max-height: 640px; }
.seatmap { width: 100%; height: auto; display: block; margin: 0 auto; }
.seat { fill: var(--surface-1); stroke: var(--neutral-mark); stroke-width: 0.6; transition: fill 0.4s ease; }
.seat.sold { fill: var(--series-1); stroke: none; }
.seat.comp { fill: var(--series-3); stroke: none; }
.seat.hold { fill: var(--series-4); stroke: none; }
.seat.pop { animation: pop 0.9s ease-out both; }
@keyframes pop { 0% { transform: scale(2.2); } 100% { transform: scale(1); } }
.seat { transform-box: fill-box; transform-origin: center; }
.stage { fill: var(--surface-2); }
.svg-label { fill: var(--text-muted); font-size: 9px; letter-spacing: 0.08em; font-family: var(--font); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-secondary); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; vertical-align: 3px; width: 16px; }
.legend b { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- SVG charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart .direct-label { fill: var(--text-secondary); font-size: 12px; font-family: var(--font); font-weight: 500; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.primary { stroke-width: 3; }
.chart .draw { animation: draw 1.6s cubic-bezier(.3,.6,.2,1) both; }
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
.chart .today-line { stroke: var(--text-muted); stroke-dasharray: 3 4; }
.chart .crosshair { stroke: var(--text-secondary); stroke-width: 1; }
.chart .dot { stroke: var(--surface-1); stroke-width: 2; }
.chart .grow { transform-box: fill-box; transform-origin: bottom; animation: grow 0.9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.heat-cell { transition: opacity 0.2s; animation: fade 0.6s ease both; }
.heat-cell:hover { opacity: 0.8; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-size: 12px; }
td.r, th.r { text-align: right; }
td .muted { color: var(--text-muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: #ffffff; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(30, 28, 20, 0.14);
  opacity: 0; transition: opacity 0.12s; max-width: 260px;
}
.tooltip.show { opacity: 1; }
.tooltip .t-title { font-weight: 600; margin-bottom: 4px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 14px; color: var(--text-secondary); }
.tooltip .t-row b { color: var(--text-primary); font-weight: 600; }
.tooltip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

.callout { border-left: 3px solid var(--series-1); padding: 8px 12px; background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text-secondary); font-size: 13px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); font-size: 11px; }

footer { color: var(--text-muted); font-size: 12px; text-align: center; padding: 24px 24px max(24px, env(safe-area-inset-bottom)); }

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

/* ---------- Daily sales report ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--text-primary); background: var(--surface-2);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip.on i { background: var(--good); }
.chip.ahead i { background: var(--good); }
.chip.ahead { background: #e6f4e6; }
.chip.behind { background: #fdf1d8; }
.chip.behind i { background: #fab219; }
.chip.risk { background: #fae3e3; }
.chip.risk i { background: var(--critical); }
.chip.cross { background: #e5eefb; color: #1c5cab; font-weight: 600; }

.watch { margin-bottom: var(--gap); border-color: #f0d9d9; }
.watch-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) auto 170px; gap: 6px 16px; align-items: center;
  width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--border);
  padding: 12px 6px; cursor: pointer; border-radius: 8px;
}
.watch-row:first-child { border-top: 0; }
.watch-row:hover { background: var(--surface-2); }
.watch-row .name { font-weight: 600; }
.watch-row .meta, .r-row .meta, .r-sold .meta { color: var(--text-muted); font-size: 12px; }
.w-when { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--text-secondary); font-size: 13px; }
.w-nums { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

.report-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.seg button[aria-selected="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 2px rgba(30,28,20,.12); font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.toggle input { accent-color: var(--series-1); width: 16px; height: 16px; }

.report { font-variant-numeric: tabular-nums; }
.r-row {
  display: grid; grid-template-columns: 128px minmax(0, 1.5fr) minmax(150px, 1fr) 90px 100px 200px;
  gap: 12px; align-items: center; padding: 9px 8px; border-bottom: 1px solid var(--border);
}
.report.enter .r-row:not(.r-head) { animation: fade 0.45s ease both; }
.r-row .r { text-align: right; }
.r-head { color: var(--text-muted); font-size: 12px; font-weight: 500; border-bottom-color: var(--neutral-mark); padding-top: 0; }
.r-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sold { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.r-row .bar-track { height: 6px; }
.r-row.past { color: var(--text-secondary); background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(30,28,20,.025) 8px 16px); }
.r-row.past .bar-fill { background: var(--neutral-mark); }
.r-row.flagged { background: linear-gradient(90deg, rgba(208,59,59,.06), transparent 40%); }
.r-row.found { animation: found 2s ease-out both; }
@keyframes found { 0%, 30% { background: #dbe8fb; } 100% { background: transparent; } }
.bump { display: inline-block; color: var(--good); font-weight: 600; animation: bump 1.2s ease-out both; }
@keyframes bump { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.r-section { padding: 14px 8px 6px; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; display: flex; gap: 10px; align-items: center; }
.r-section .pill { text-transform: none; letter-spacing: 0; font-weight: 500; }
.r-today { position: relative; margin: 14px 0 4px; text-align: left; }
.r-today::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--series-1); }
.r-today span { position: relative; background: var(--series-1); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-left: 8px; }
.r-week { padding: 14px 8px 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.report-foot { margin-top: 12px; font-size: 13px; color: var(--text-secondary); }
.link { background: none; border: 0; padding: 0; color: #1c5cab; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 900px) {
  .watch-row { grid-template-columns: minmax(0, 1fr) auto; }
  .watch-row .w-status { grid-column: 1 / -1; }
  .w-nums { grid-column: 1 / -1; text-align: left; }
  .w-nums br { display: none; }
  .w-nums .meta::before { content: " · "; }
  .r-head { display: none; }
  .r-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 6px; }
  .r-row .c-date { grid-column: 1 / -1; font-size: 12px; color: var(--text-secondary); display: flex; gap: 6px; }
  .r-row .c-date .meta::before { content: "· "; }
  .r-row .c-show { grid-column: 1; }
  .r-row .name { white-space: normal; }
  .r-row .c-pace { grid-column: 2; grid-row: 2; text-align: right; }
  .r-row .c-sold { grid-column: 1 / -1; }
  .r-row .c-24 { grid-column: 1; text-align: left; font-size: 13px; }
  .r-row .c-24::before { content: "Last 24 hrs: "; color: var(--text-muted); }
  .r-row.past .c-24::before { content: ""; }
  .r-row .c-rev { grid-column: 2; display: flex; gap: 6px; font-size: 13px; }
  .r-row .c-rev .meta::before { content: "· "; }
}

.why { color: var(--text-secondary); font-size: 12px; margin-top: 3px; }
.c-pace .why { white-space: normal; }
.rules { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-muted); }
.rules b { color: var(--text-secondary); font-weight: 600; }

/* ---------- Market switcher ---------- */
.market { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.market select {
  font: inherit; font-size: 12px; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; cursor: pointer;
}

/* ---------- County & ZIP (market) ---------- */
.geo-hero { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.hero-main {
  display: flex; align-items: center; gap: 22px; padding: 22px 26px;
  background: linear-gradient(135deg, #1c5cab, #2a78d6 60%, #3987e5); color: #fff; border: 0;
}
.hero-num { font-size: 78px; font-weight: 750; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-text { font-size: 18px; line-height: 1.35; opacity: 0.95; }
.hero-text b { font-weight: 700; }
.hero-stat { padding: 16px 18px; }
.hero-stat .label { color: var(--text-secondary); font-size: 12px; }
.hs-big { font-size: 32px; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.hero-stat .note { color: var(--text-muted); font-size: 12px; }

.map-card { margin-bottom: var(--gap); }
.map-frame { height: 540px; border-radius: 10px; overflow: hidden; background: #e9f0f8; position: relative; }
.geo-map { width: 100%; height: 100%; display: block; }
.geo-map .state { stroke: #fff; stroke-width: 0.5; vector-effect: non-scaling-stroke; transition: fill 0.6s ease; }
.geo-map .county {
  stroke: #fff; stroke-width: 0.8; vector-effect: non-scaling-stroke; cursor: pointer;
  transition: fill 0.7s ease, opacity 0.2s;
}
.geo-map .county:hover { opacity: 0.82; }
.geo-map .county.selected { stroke: #1b1b1a; stroke-width: 2.5; }
.geo-map.national .state { stroke-width: 0.8; cursor: default; }
.map-labels { pointer-events: none; transition: opacity 0.25s; }
.map-labels text {
  fill: #1b1b1a; font-family: var(--font); font-weight: 600;
  paint-order: stroke; stroke: rgba(255,255,255,0.92); stroke-linejoin: round;
}
.map-labels text.v { font-weight: 750; }
.map-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.map-legend .ramp { display: flex; }
.map-legend .ramp i { width: 22px; height: 10px; }
.map-legend .ramp i:first-child { border-radius: 3px 0 0 3px; }
.map-legend .ramp i:last-child { border-radius: 0 3px 3px 0; }
.map-legend .no-data { margin-left: 12px; }
.map-legend .no-data i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.rank { display: inline-block; width: 22px; color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.bar-row.sel { background: #dbe8fb; }

.zip-board { display: flex; flex-direction: column; }
.zip-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--border); animation: rise 0.45s cubic-bezier(.2,.7,.2,1) both;
}
.zip-row:last-child { border-bottom: 0; }
.zip-rank { font-size: 26px; font-weight: 750; color: #9ec5f4; text-align: center; font-variant-numeric: tabular-nums; }
.zip-row:nth-child(1) .zip-rank { color: #1c5cab; }
.zip-row:nth-child(2) .zip-rank { color: #2a78d6; }
.zip-row:nth-child(3) .zip-rank { color: #5d98e8; }
.zip-code { font-size: 22px; font-weight: 750; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.zip-main .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.zip-main .bar-track { height: 6px; }
.zip-nums { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.zip-nums b { font-size: 20px; font-weight: 700; }
.zip-nums .meta { font-size: 11px; color: var(--text-muted); }

@media (max-width: 900px) {
  .geo-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-main { grid-column: 1 / -1; padding: 18px; gap: 16px; }
  .hero-num { font-size: 56px; }
  .hero-text { font-size: 15px; }
  .hero-stat:last-child { grid-column: 1 / -1; }
  .map-frame { height: 380px; }
  .map-card .card-head { flex-direction: column; }
  .map-card .seg { width: 100%; }
}

/* ---------- Scheduled refresh label ---------- */
.sched-dot { color: var(--series-1); font-size: 14px; line-height: 1; }

/* ---------- House plan ---------- */
.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: var(--gap); overflow: hidden;
}
.stat { padding: 12px 16px; border-left: 1px solid var(--border); position: relative; min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .label { font-size: 12px; color: var(--text-secondary); }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .note { font-size: 12px; color: var(--text-muted); }
@media (max-width: 700px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-left: 0; border-top: 1px solid var(--border); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--border); }
}
.cols { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .cols, .cols.even { grid-template-columns: minmax(0, 1fr); } }
.mt { margin-top: var(--gap); }
.kv { display: grid; grid-template-columns: auto auto; gap: 3px 14px; font-size: 13px; color: var(--text-secondary); justify-content: start; }
.kv b { color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.zone-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--grid); }
.zone-row:first-child { border-top: 0; }
.zone-row .name { font-weight: 600; }
.zone-row .num { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 13px; text-align: right; }
.zone-track { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; display: flex; }
.zone-track i { display: block; height: 100%; }
.seat.in { fill: var(--series-1); stroke: none; }
.seat.due { fill: #bcd4f3; stroke: none; }
.trig {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: none; border: 0; border-top: 1px solid var(--border); padding: 10px 8px;
}
.trig:first-child { border-top: 0; }
.trig:hover { background: var(--surface-2); }
.trig.sel { background: #eef4fc; box-shadow: inset 3px 0 0 var(--series-1); }
.trig .name { font-weight: 600; }
.trig .meta { font-size: 12px; color: var(--text-muted); }
@media (max-width: 600px) {
  .trig { grid-template-columns: minmax(0, 1fr); }
  .trig .t-chip { grid-row: 1; }
}

/* Phones: stack each zone's name over its numbers so they can't overlap. */
.pill { white-space: nowrap; }
@media (max-width: 600px) {
  .zone-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .zone-row .num { text-align: left; }
}
@media (max-width: 600px) {
  .bar-row .name { white-space: normal; }
}
