/* ── RoofStack — the floor ──────────────────────────────────────────────────
 *
 * This is a trading terminal, not a catalogue. The product is perishable — a
 * roofing lead is worth most in its first five minutes — and genuinely scarce,
 * three buyers and no more. Every rule below serves speed, freshness and
 * scarcity, in that order.
 *
 *   Rows, not cards in a grid. A feed reads top to bottom, one line per lead,
 *   so a new arrival can push the rest down and be seen doing it. A masonry of
 *   cards hides that motion, and the motion is the product.
 *
 *   Tabular figures everywhere money or a count appears, so a column of prices
 *   can be read down instead of across.
 *
 *   Status is a dot AND a word, never colour alone. The reader may be
 *   colour-blind, in direct sun, or on a five-year-old Android.
 *
 *   One accent. The buy action never competes with decoration. No gradients,
 *   no illustration, no rounded pastel anything — a roofer is not a designer
 *   and this screen is asking him for money.
 *
 * Light is primary because this is a work tool used in daylight. Dark is a
 * real theme rather than an inversion: the accent lightens so it still carries
 * on a dark ground, and both palettes are painted explicitly — nothing is left
 * to the browser's default.
 * ─────────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  --bg:            #f4f6f8;
  --surface:       #ffffff;
  --surface-2:     #f0f2f6;
  --surface-3:     #e5e9ef;
  --line:          #dde2ea;
  --line-strong:   #c3cad6;
  --ink:           #0e1218;
  --ink-2:         #4a5261;
  --ink-3:         #737c8c;

  --accent:        #1d4ed8;
  --accent-hover:  #1a44bd;
  --accent-soft:   #e8eeff;
  --accent-line:   #b9cbff;
  --accent-ink:    #ffffff;

  --urgent:        #b42318;
  --urgent-soft:   #fdecea;
  --urgent-line:   #f4c4bf;
  --good:          #12694a;
  --good-soft:     #e4f3ec;
  --good-line:     #b3ddca;
  --warn:          #8a5a00;
  --warn-soft:     #fdf3e2;
  --warn-line:     #eed9ae;
  --storm:         #6b3fa0;
  --storm-soft:    #f2ecfa;
  --storm-line:    #d9c9ef;

  --radius:    9px;
  --radius-lg: 13px;
  --shadow-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --shadow-2: 0 8px 24px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.06);
  --shadow-3: -18px 0 44px rgba(16,24,40,.16);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:          #0b0e14;
  --surface:     #141821;
  --surface-2:   #1b2029;
  --surface-3:   #242a35;
  --line:        #29303c;
  --line-strong: #3c4453;
  --ink:         #e9edf4;
  --ink-2:       #a7b0c2;
  --ink-3:       #79839a;

  --accent:      #6b9bff;
  --accent-hover:#8db0ff;
  --accent-soft: #16233f;
  --accent-line: #2c4173;
  --accent-ink:  #080d1a;

  --urgent:      #ff8f83;
  --urgent-soft: #381916;
  --urgent-line: #5c2a25;
  --good:        #5ed3a3;
  --good-soft:   #102c23;
  --good-line:   #1f4a3a;
  --warn:        #e8bb70;
  --warn-soft:   #2f2510;
  --warn-line:   #4e3d18;
  --storm:       #c4a4f0;
  --storm-soft:  #241c33;
  --storm-line:  #3d3155;

  --shadow-1: 0 1px 2px rgba(0,0,0,.5);
  --shadow-2: 0 10px 28px rgba(0,0,0,.55);
  --shadow-3: -18px 0 44px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
/* A class selector beats the user-agent [hidden] rule, so every .panel and
 * .banner would render regardless of the attribute. The one right !important. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.017em; font-weight: 650; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); font-size: .95em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px;
}
.skip:focus { left: 0; }

/* ── mode bar ─────────────────────────────────────────────────────────── */
.mode-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 7px 20px;
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 1px solid var(--warn-line);
  font-size: 13px;
}
.mode-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.mode-bar[data-mode="live"] { background: var(--good-soft); color: var(--good); border-bottom-color: var(--good-line); }
.mode-bar span:last-child { color: var(--ink-2); }

/* ── topbar ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding-top: 8px; padding-bottom: 8px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 17px; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none; flex: none;
}
.brand-mark { width: 21px; height: 21px; color: var(--accent); }

.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: var(--radius); }
.tab {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 7px 13px; border-radius: 7px; cursor: pointer;
  font-size: 14px; font-weight: 560; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tab-count {
  background: var(--accent); color: var(--accent-ink);
  border-radius: 20px; padding: 1px 7px; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.live-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px 4px 9px;
  background: var(--surface-2); white-space: nowrap;
}
.live-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.live-status[data-state="live"] { color: var(--good); border-color: var(--good-line); background: var(--good-soft); }
.live-status[data-state="live"] .dot { background: var(--good); animation: pulse 2.2s ease-in-out infinite; }
.live-status[data-state="paused"] { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.live-status[data-state="paused"] .dot { background: var(--warn); }
.live-status[data-state="offline"] { color: var(--urgent); border-color: var(--urgent-line); background: var(--urgent-soft); }
.live-status[data-state="offline"] .dot { background: var(--urgent); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

.auth-slot { display: flex; align-items: center; gap: 8px; }
.who { display: none; flex-direction: column; line-height: 1.25; font-size: 12.5px; color: var(--ink-3); max-width: 190px; }
.who b { color: var(--ink); font-size: 13.5px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1080px) { .who { display: flex; } }

.btn {
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 9px 15px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-quiet { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-quiet:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; }

.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2);
  padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.cart-btn svg { width: 18px; height: 18px; }
.cart-btn-text { display: none; }
@media (min-width: 720px) { .cart-btn-text { display: inline; } }
.cart-count {
  background: var(--surface-3); color: var(--ink-2);
  border-radius: 20px; min-width: 22px; text-align: center; padding: 1px 7px; font-size: 12.5px;
}
.cart-total { color: var(--ink); }
.cart-btn.has-items { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.cart-btn.has-items .cart-count { background: var(--accent); color: var(--accent-ink); }
.cart-btn.has-items .cart-total { color: var(--accent); }

/* ── hero + ticker ────────────────────────────────────────────────────── */
.hero {
  display: grid; gap: 20px; padding: 26px 0 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 940px) { .hero { grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); align-items: end; } }
.hero-tight { padding-bottom: 12px; }
.hero h1 { font-size: clamp(22px, 3.4vw, 31px); line-height: 1.15; margin-bottom: 9px; }
.hero-copy p { color: var(--ink-2); font-size: 15px; max-width: 62ch; }
.hero-copy strong { color: var(--ink); }

.ticker {
  margin: 0; display: grid; gap: 1px;
  grid-template-columns: repeat(2, minmax(0,1fr));
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (min-width: 560px) { .ticker { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.tick { background: var(--surface); padding: 11px 13px; }
.tick dt { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.tick dd { margin: 2px 0 0; font-size: 24px; font-weight: 680; letter-spacing: -.02em; }
.tick-urgent dd { color: var(--urgent); }

/* ── filters ──────────────────────────────────────────────────────────── */
.controls { padding: 4px 0 14px; }
.filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span {
  font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
  display: flex; gap: 6px; align-items: baseline;
}
.field > span b { color: var(--ink); font-size: 12px; }
.field select, .field input {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 9px; font-size: 14px; min-width: 130px; color: var(--ink);
}
.field-narrow select, .field-narrow input { min-width: 82px; }
.field-range input { min-width: 130px; padding: 0; background: none; border: 0; accent-color: var(--accent); }
.field-search { flex: 1 1 260px; }
.field-search input { width: 100%; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); padding-bottom: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.filters .btn { margin-bottom: 1px; }

/* ── the "n new leads" bar ────────────────────────────────────────────
 * Sticky under the topbar, the way X and Gmail hold new items back rather
 * than shoving the list under a reading cursor. */
.newbar-slot { position: sticky; top: 68px; z-index: 30; height: 0; display: flex; justify-content: center; }
.newbar {
  transform: translateY(4px);
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 22px; padding: 9px 17px;
  font-size: 14px; font-weight: 640; cursor: pointer;
  box-shadow: var(--shadow-2);
  animation: dropIn .22s ease-out;
}
.newbar:hover { background: var(--accent-hover); }
.newbar-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.newbar-arrow svg { width: 15px; height: 15px; display: block; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(4px); } }

/* ── banners ──────────────────────────────────────────────────────────── */
.banner {
  border-radius: var(--radius); padding: 11px 14px; font-size: 14px;
  margin: 0 0 12px; display: flex; align-items: center; gap: 9px;
}
.banner .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.banner-error { background: var(--urgent-soft); color: var(--urgent); border: 1px solid var(--urgent-line); }
.banner-warn  { background: var(--warn-soft);  color: var(--warn);  border: 1px solid var(--warn-line); }
.banner-quiet { background: var(--surface-2);  color: var(--ink-2); border: 1px solid var(--line); }
.banner-good  { background: var(--good-soft);  color: var(--good);  border: 1px solid var(--good-line); }

/* ── the board ────────────────────────────────────────────────────────── */
.board { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }

.skeletons { display: flex; flex-direction: column; gap: 8px; }
.skel {
  height: 104px; border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 220% 100%; animation: shimmer 1.5s linear infinite;
  border: 1px solid var(--line);
}
@keyframes shimmer { from { background-position: 100% 0 } to { background-position: -100% 0 } }

.row {
  position: relative;
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  cursor: pointer;
  /* No transition here on purpose. A transition on a colour whose value comes
   * from a custom property pins the colour it was painted with: swap
   * --surface for the dark theme and every row stays white until something
   * forces a repaint. Verified in Chrome with both `background` and
   * `background-color`.
   *
   * Border and shadow are on the same footing — both are var-driven — so the
   * row transitions nothing at all. Hover feedback is instant, which on a
   * board somebody is scanning at speed is the better answer anyway. */
}
@media (min-width: 900px) {
  .row { grid-template-columns: 92px minmax(0,1fr) 300px; align-items: center; gap: 16px; }
}
.row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.row.is-urgent { border-left-color: var(--urgent); }
.row.is-selected { border-color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }
.row.is-incart { border-left-color: var(--accent); }
.row.is-dead { opacity: .55; cursor: default; }
.row.is-dead:hover { box-shadow: none; }

/* Arrival: the new row slides down out of the top edge and flashes once.
 * This is the single most important animation on the page — it is the thing
 * that makes the board feel alive rather than polled. */
.row.is-new { animation: rowIn .42s cubic-bezier(.2,.7,.3,1); }
@keyframes rowIn {
  0%   { opacity: 0; transform: translateY(-18px) scaleY(.92); }
  60%  { opacity: 1; transform: translateY(0) scaleY(1); }
  100% { opacity: 1; transform: none; }
}
.row.is-flash::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg);
  background: var(--accent); opacity: .13; pointer-events: none;
  animation: flashOut 1.9s ease-out forwards;
}
@keyframes flashOut { to { opacity: 0 } }

/* Departure: a sold-out lead collapses rather than blinking out between
 * frames, so a buyer sees the slot go instead of finding it missing. */
.row.is-going {
  animation: rowOut .5s ease-in forwards;
  pointer-events: none; overflow: hidden;
}
@keyframes rowOut {
  0%   { opacity: 1; }
  35%  { opacity: .8; transform: translateX(-6px); }
  100% { opacity: 0; transform: translateX(28px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -8px; border-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .row.is-new, .row.is-going, .newbar { animation: none; }
  .row.is-flash::after { display: none; }
  .live-status .dot, .newbar-dot { animation: none !important; }
}

/* left rail: when, and how good */
.row-rail { display: flex; align-items: center; gap: 12px; }
@media (min-width: 900px) { .row-rail { flex-direction: column; align-items: flex-start; gap: 6px; } }
.row-when { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.score {
  display: flex; align-items: baseline; gap: 5px;
  border-radius: 7px; padding: 3px 8px; border: 1px solid var(--line);
  background: var(--surface-2);
}
.score-val { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.score-lab { font-size: 10.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.score.hi  { background: var(--good-soft); border-color: var(--good-line); }
.score.hi .score-val { color: var(--good); }
.score.mid { background: var(--warn-soft); border-color: var(--warn-line); }
.score.mid .score-val { color: var(--warn); }
.score.lo  { background: var(--surface-2); }
.score.lo .score-val { color: var(--ink-2); }
.score-prov { font-size: 10px; color: var(--ink-3); }

/* middle: where and what */
.row-body { min-width: 0; }
.row-city {
  font-size: 17px; font-weight: 660; letter-spacing: -.015em;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.row-city .zip { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.row-who { font-size: 13px; color: var(--ink-2); margin-top: 1px; display: flex; gap: 10px; flex-wrap: wrap; }
.row-who .masked { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }

.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.chip {
  font-size: 12px; font-weight: 570; padding: 2.5px 8px; border-radius: 5px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip-strong { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.chip-urgent {
  background: var(--urgent-soft); color: var(--urgent); border-color: var(--urgent-line);
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11px;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip-urgent .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-owner { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }

/* the enrichment line — the hail is the headline */
.enrich { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.enrich span { white-space: nowrap; }
.enrich b { color: var(--ink); font-weight: 640; }
.enrich-pending { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.enrich-pending .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }

.storm {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--storm-soft); color: var(--storm); border: 1px solid var(--storm-line);
  border-radius: 5px; padding: 2.5px 8px; font-size: 12px; font-weight: 620;
  margin-top: 8px; margin-right: 8px;
}
.storm .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.storm.is-strong { background: var(--urgent-soft); color: var(--urgent); border-color: var(--urgent-line); }
.storm-note { font-size: 11.5px; color: var(--ink-3); }

/* right: scarcity and price */
.row-buy { display: flex; flex-direction: column; gap: 8px; }
.slots { display: flex; align-items: center; gap: 9px; }
.slot-pips { display: flex; gap: 4px; }
.pip {
  width: 22px; height: 8px; border-radius: 3px;
  background: var(--good); border: 1px solid var(--good-line);
  /* Same reason as .row: no colour transition on a var-driven background, or
   * a pip painted green in light mode stays green on a dark board. */
  transition: transform .35s;
}
.pip.taken { background: var(--surface-3); border-color: var(--line-strong); }
.pip.just-taken { animation: pipGo .55s ease-out; }
@keyframes pipGo {
  0% { transform: scaleX(1); background: var(--urgent); border-color: var(--urgent); }
  100% { transform: scaleX(1); }
}
.slots-lab { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slots-lab b { color: var(--ink); font-weight: 660; }

.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.price { font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.price-note { font-size: 11.5px; color: var(--ink-3); }

.row-actions { display: flex; gap: 8px; align-items: stretch; }
.pick {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius); padding: 9px 12px; font-weight: 640; font-size: 14px; cursor: pointer;
}
.pick:hover { background: var(--accent-hover); }
.pick.is-on { background: var(--surface); color: var(--accent); }
.pick.is-incart { background: var(--good-soft); color: var(--good); border-color: var(--good-line); cursor: default; }
.pick .tick-mark { width: 15px; height: 15px; }
.excl {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--radius); padding: 9px 11px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.excl:hover { color: var(--ink); border-color: var(--line-strong); }

.sold-out {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 620; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 12px;
}
.sold-out .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.sold-out.is-gone { background: var(--urgent-soft); color: var(--urgent); border-color: var(--urgent-line); }
.sold-out.is-gone .dot { background: currentColor; }

.board-more { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 28px; }
.board-count { font-size: 13px; color: var(--ink-3); }

/* ── selection tray ───────────────────────────────────────────────────── */
.tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--surface); border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 28px rgba(16,24,40,.12);
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  animation: trayIn .18s ease-out;
}
:root[data-theme="dark"] .tray { box-shadow: 0 -8px 28px rgba(0,0,0,.6); }
@keyframes trayIn { from { transform: translateY(100%) } to { transform: none } }
.tray-inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tray-left { display: flex; flex-direction: column; min-width: 0; }
.tray-left strong { font-size: 15px; }
.tray-sub { font-size: 12.5px; color: var(--ink-3); }
.tray-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tray-total { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }

/* ── empties ──────────────────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 44px 20px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty h3 { font-size: 17px; }
.empty p { color: var(--ink-2); max-width: 52ch; font-size: 14px; }
.empty-sm { padding: 30px 16px; }

/* ── panels ───────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(10,14,20,.5); z-index: 60; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(520px, 100%); background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  animation: panelIn .22s ease-out;
}
.panel-sm { width: min(420px, 100%); }
@keyframes panelIn { from { transform: translateX(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line); flex: none;
}
.panel-head h2 { font-size: 18px; }
.panel-body, .checkout, .receipt { padding: 18px; overflow-y: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.panel-foot { border-top: 1px solid var(--line); padding: 14px 18px max(14px, env(safe-area-inset-bottom)); flex: none; background: var(--surface); }
.totals { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.totals strong { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.fineprint { font-size: 12px; color: var(--ink-3); margin-top: 9px; }

.cart-lines { display: flex; flex-direction: column; gap: 10px; }
.cart-line { border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; background: var(--surface); }
.cart-line.unavailable { opacity: .68; background: var(--surface-2); }
.cart-line-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cart-line-city { font-weight: 640; font-size: 15px; }
.cart-line-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.cart-line-price { font-size: 16px; font-weight: 680; }
.cart-line-ctl { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button {
  border: 0; background: var(--surface); color: var(--ink-2);
  padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.rm { border: 0; background: none; color: var(--ink-3); font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.rm:hover { color: var(--urgent); }
.line-reason { margin-top: 8px; font-size: 12.5px; color: var(--warn); }

.linkback { border: 0; background: none; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13.5px; padding: 0 0 12px; }
.linkback svg { width: 16px; height: 16px; }
.checkout-h { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 8px; }
.summary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface); font-size: 14px; }
.li-main { display: flex; flex-direction: column; min-width: 0; }
.li-sub { font-size: 12px; color: var(--ink-3); }
.li-price { font-weight: 660; white-space: nowrap; }
.summary-failed .li-price { font-weight: 500; color: var(--warn); font-size: 12.5px; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.summary-total strong { font-size: 21px; font-weight: 700; }
.mode-note { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin: 14px 0 0; }
.mode-note code { font-family: var(--mono); background: var(--surface); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
.pay-element { min-height: 60px; }
.pay-loading { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-3); padding: 14px 0; }
.spinner {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg) } }

.receipt-head { margin-bottom: 14px; }
.receipt-head h3 { font-size: 19px; margin-bottom: 6px; }
.receipt-head p { color: var(--ink-2); font-size: 14px; }
.receipt-math { margin-top: 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.receipt-math .num { color: var(--ink); font-weight: 640; }

/* ── auth form ────────────────────────────────────────────────────────── */
.field-block { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field-block > span { font-size: 12.5px; font-weight: 620; color: var(--ink-2); }
.field-block > span em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.field-block input {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 10px 11px; font-size: 15px; width: 100%;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switcher { margin-top: 14px; font-size: 13.5px; color: var(--ink-2); text-align: center; }

/* ── the back office ──────────────────────────────────────────────────── */
.office-controls {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px 13px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.statusfilter { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 3px; }
.sf {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.sf .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sf .n { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.sf[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sf[aria-pressed="true"] .n { color: var(--accent-ink); opacity: .8; }
.office-actions { margin-left: auto; display: flex; gap: 8px; padding-bottom: 3px; }

.prefs, .receipts {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px; margin-bottom: 14px;
}
.prefs h3, .receipts h3 { font-size: 16px; margin-bottom: 12px; }
.switchrow { display: flex; gap: 11px; align-items: flex-start; padding: 9px 0; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.switchrow input { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 2px; flex: none; }
.switchrow strong { color: var(--ink); font-weight: 640; display: block; }
.prefs-row { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 0 0 28px; }

.receipt-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; margin-bottom: 9px; }
.receipt-row-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.receipt-row-id { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.receipt-row-amt { font-weight: 680; font-size: 16px; }
.receipt-row-lines { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650;
  border-radius: 5px; padding: 2px 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.good { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.bad  { background: var(--urgent-soft); color: var(--urgent); border-color: var(--urgent-line); }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

.owned-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 40px; }
.owned {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: 14px 15px;
}
.owned[data-status="won"]  { border-left-color: var(--good); }
.owned[data-status="lost"] { border-left-color: var(--ink-3); opacity: .8; }
.owned[data-status="contacted"], .owned[data-status="quoted"] { border-left-color: var(--accent); }
.owned-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.owned-title { font-size: 17px; font-weight: 660; letter-spacing: -.015em; }
.owned-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.owned-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.callrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 11px 0 0; }
.callbtn {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius); padding: 8px 13px; font-weight: 650; font-size: 15px;
}
.callbtn.secondary { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.callbtn svg { width: 16px; height: 16px; }

.detail-grid {
  display: grid; gap: 1px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.detail { background: var(--surface); padding: 9px 11px; }
.detail dt { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.detail dd { margin: 3px 0 0; font-size: 14px; }

.statusbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.statusbar-lab { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-right: 3px; }
.stbtn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: 7px; padding: 6px 11px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.stbtn .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stbtn:hover { color: var(--ink); border-color: var(--line-strong); }
.stbtn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.stbtn[aria-pressed="true"][data-status="won"] { background: var(--good); border-color: var(--good); color: #fff; }
.stbtn[aria-pressed="true"][data-status="lost"] { background: var(--ink-3); border-color: var(--ink-3); color: #fff; }
:root[data-theme="dark"] .stbtn[aria-pressed="true"] { color: var(--bg); }

.notewrap { margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.notewrap textarea {
  flex: 1 1 260px; min-height: 40px; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 8px 10px; font: inherit; font-size: 13.5px; color: var(--ink);
}
.saved-note { font-size: 12px; color: var(--good); }

.consent { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.consent summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 620; color: var(--ink-2); }
.consent summary::marker { color: var(--ink-3); }
.consent-body { padding: 0 12px 12px; }
.consent-quote { font-size: 13.5px; padding: 10px 12px; background: var(--surface); border-left: 3px solid var(--line-strong); border-radius: 0 6px 6px 0; }
.consent-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

.points { margin: 11px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.points li { margin-bottom: 4px; }

/* ── footer ───────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 22px 0 34px; background: var(--surface); }
.footer p { font-size: 12.5px; color: var(--ink-3); max-width: 78ch; }
.footer strong { color: var(--ink-2); }
.footer-meta { margin-top: 8px; font-family: var(--mono); font-size: 11.5px; }

/* ── phone ────────────────────────────────────────────────────────────── */
@media (max-width: 899px) {
  .newbar-slot { top: 62px; }
  .row { padding: 12px; }
  .row-rail { justify-content: space-between; }
  .row-buy { border-top: 1px solid var(--line); padding-top: 10px; }
  .price-line { align-items: center; }
  .tray-inner { gap: 10px; }
  .tray-right { width: 100%; }
  .tray-right .btn-primary { flex: 1 1 auto; }
  .filters { gap: 9px; }
  .field select, .field input { min-width: 110px; }
  .office-actions { margin-left: 0; width: 100%; }
  .office-actions .btn { flex: 1 1 auto; }
  /* The tray covers the bottom of the list; give the board room to clear it. */
  body.has-tray .board-more { padding-bottom: 96px; }
}
@media (max-width: 520px) {
  .topbar-inner { min-height: 54px; }
  .tabs { order: 3; width: 100%; }
  .tab { flex: 1 1 auto; justify-content: center; }
  .hero { padding-top: 18px; }
  .row-city { font-size: 16px; }
}

/* Payment method is the strongest commercial signal the form collects, and
 * `insurance` is a storm-damage claim — the biggest ticket on the board. It
 * shares the storm colour with the hail badge because it is usually the same
 * situation seen from the other side. */
.chip-claim {
  background: var(--storm-soft); color: var(--storm); border-color: var(--storm-line);
  font-weight: 660; display: inline-flex; align-items: center; gap: 5px;
}
.chip-claim .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* What the homeowner typed into the form. Set apart from our own summary
 * lines, because it is the only sentence on the screen that is theirs. */
.saidit {
  margin-top: 11px; padding: 10px 12px; font-size: 14px;
  background: var(--surface-2); border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.saidit-lab {
  display: block; font-size: 11px; font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px;
}

/* A lead this buyer has already paid for. Present, but not for sale to him
 * again — the row still shows the other slots going. */
.pick.is-owned {
  background: var(--surface-2); color: var(--ink-2); border-color: var(--line);
  cursor: pointer; font-weight: 600;
}
.pick.is-owned:hover { color: var(--ink); border-color: var(--line-strong); }

/* What the job was actually worth, asked for only once a lead is marked won —
 * the one number that turns "I bought 40 leads" into "they paid for
 * themselves". */
.wonval { display: flex; align-items: center; gap: 7px; }
.wonval > span {
  font-size: 11px; font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.wonval input {
  width: 110px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 8px 10px; font-size: 14px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
