@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #16202c;
  --muted: #5c6773;
  --line: #e3e6ec;
  --navy: #101b2e;
  --navy-soft: #172741;
  --navy-line: #253552;
  --accent: #e2792f;
  --accent-dark: #b85f1f;
  --accent-light: #fdf1e6;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --danger: #c2261d;
  --ok: #17803c;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(16, 27, 46, 0.09);
  --shadow-sm: 0 2px 10px rgba(16, 27, 46, 0.06);
  --max-width: 880px;
  --wide: 1160px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); }

/* ---- header ---------------------------------------------------------- */

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

header.site .brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

header.site .brand span { color: var(--accent); }

header.site nav { display: flex; align-items: center; gap: 4px; }

header.site nav a {
  margin-left: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

header.site nav a:hover { background: var(--bg-soft); }

header.site nav a.btn-nav {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 9px 16px;
  transition: background 0.15s ease;
}

header.site nav a.btn-nav:hover { background: var(--accent-dark); }

/* ---- hero (marketing home page) --------------------------------------- */

.hero {
  background: radial-gradient(120% 160% at 15% 0%, var(--navy-soft) 0%, var(--navy) 55%);
  color: #fff;
  padding: 72px 32px 88px;
}

.hero-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  color: #fff;
  font-size: 2.6rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.45em;
}

.hero p.lede {
  color: #c7d0de;
  font-size: 1.15rem;
  max-width: 560px;
}

.hero-cta { display: flex; align-items: center; gap: 16px; margin-top: 28px; flex-wrap: wrap; }

.hero-cta .note-inline { color: #9aa7bb; font-size: 0.9rem; }

.hero-art { width: 100%; }
.hero-art img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

/* ---- page shell -------------------------------------------------------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 64px;
}

main.wide { max-width: var(--wide); }

main.marketing { max-width: var(--wide); padding: 0 0 0; }
main.marketing .section { max-width: var(--max-width); margin: 0 auto; padding: 56px 20px; }

h1 { font-size: 1.9rem; margin: 0.2em 0 0.4em; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin-top: 2em; letter-spacing: -0.01em; }
p.lede { font-size: 1.15rem; color: var(--muted); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin: 16px 0;
}

.card.pricing {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  margin-top: -64px;
  z-index: 2;
}

/* ---- auth (login / signup / forgot / reset) ---------------------------- */

main.auth-shell {
  max-width: none;
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  padding: 48px 20px;
}

.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { margin-top: 0; }

/* ---- forms --------------------------------------------------------------- */

form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }

label { font-size: 0.9rem; font-weight: 600; }

input, select {
  font-size: 1rem;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  width: 100%;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

button {
  font-size: 1rem;
  padding: 12px 20px;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.05s ease;
}

button:hover { background: var(--accent-dark); }
button:active { transform: translateY(1px); }
button.secondary { background: transparent; color: var(--accent-dark); border: 1px solid var(--line); }
button.secondary:hover { background: var(--bg-soft); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.error { color: var(--danger); font-size: 0.95rem; min-height: 1.2em; }
.ok { color: var(--ok); font-size: 0.95rem; }
.note { color: var(--muted); font-size: 0.9rem; }

.price {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.92rem; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }

@media (max-width: 640px) {
  th, td { white-space: normal; }
}

.pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- marketing page sections -------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.step { }
.step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.callout {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 20px 24px;
}

footer.site {
  background: var(--navy);
  color: #a9b4c6;
  font-size: 0.88rem;
  padding: 32px 20px 40px;
}
footer.site .footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
}
footer.site a { color: #d7dee8; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 420px; margin: 0 auto; }
  .steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  header.site { padding: 14px 16px; }
  main { padding: 16px 16px 48px; }
  main.marketing .section { padding: 40px 16px; }
  .hero { padding: 48px 16px 56px; }
  .hero h1 { font-size: 1.9rem; }
  h1 { font-size: 1.5rem; }
  .price { font-size: 1.8rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  header.site nav a { margin-left: 8px; font-size: 0.85rem; padding: 6px 8px; }
  header.site nav a.btn-nav { padding: 8px 12px; }
  .card.pricing { margin-top: -36px; padding: 20px; }
}

/* ---- public county previews (/coverage, /county/<id>, home proof line) ---- */

a.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 9px;
  transition: background 0.15s ease;
}
a.btn:hover { background: var(--accent-dark); }

[hidden] { display: none !important; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge.live, .badge.cited { background: #e5f4ea; color: var(--ok); }
.badge.partial { background: var(--accent-light); color: var(--accent-dark); }
.badge.none { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.badge.closed { background: #fbe9e7; color: var(--danger); }

main.county { max-width: 980px; }

.county-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.proof-headline {
  font-size: 2.2rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0.35em 0 0.3em;
}

.claim-box {
  border: 1px solid #f3c9a6;
  background: var(--accent-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0 8px;
}
.claim-box .claim-line { margin: 0 0 14px; font-size: 1.08rem; }
.claim-box .note { margin: 10px 0 0; }

.county-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  margin-top: 8px;
}
.county-grid .card { margin: 8px 0; min-width: 0; }
.card-title { font-size: 1rem; margin: 0 0 14px; }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 150px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.bar-num { font-weight: 700; font-size: 0.95rem; }
.bar-track { flex: 1; width: 100%; max-width: 52px; display: flex; align-items: flex-end; margin: 4px 0; }
.bar { width: 100%; background: var(--accent); border-radius: 6px 6px 2px 2px; }
.bar.empty { background: var(--line); }
.bar-label { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

table.sample th, table.sample td { white-space: normal; }
table.sample td:nth-child(3) { white-space: nowrap; }
table.sample .pill { padding: 2px 8px; font-size: 0.72rem; }
table.sample td.masked { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.02em; }

/* coverage list */
.coverage-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 20px 0 12px; }
.coverage-tools label { display: flex; flex-direction: column; gap: 4px; }
.coverage-tools select, .coverage-tools input[type="search"] { width: auto; min-width: 180px; }
.coverage-tools label.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 10px; }
.coverage-tools label.check input { width: auto; }

table.coverage-table td { vertical-align: middle; }
table.coverage-table td a { font-weight: 600; text-decoration: none; }
table.coverage-table td a:hover { text-decoration: underline; }
table.coverage-table .sub { display: block; color: var(--muted); font-size: 0.8rem; white-space: normal; max-width: 56ch; }
table.coverage-table .badge { white-space: nowrap; }
table.coverage-table td:first-child { white-space: normal; }
table.coverage-table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.coverage-table td.hot { color: var(--accent-dark); font-weight: 700; }
button.sort {
  background: none; color: inherit; padding: 0; font: inherit; font-weight: 600;
  text-transform: inherit; letter-spacing: inherit; border-radius: 0;
}
button.sort:hover { background: none; color: var(--ink); }
button.sort[aria-sort="descending"]::after { content: " \2193"; }
button.sort[aria-sort="ascending"]::after { content: " \2191"; }

/* home page proof line */
.hero-proof { color: #c7d0de; font-size: 0.98rem; margin: 22px 0 0; max-width: 560px; }
.hero-proof strong { color: #fff; }
.hero-proof a { color: #ffd2ad; }

/* subscribe gate in /app */
.gate-proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 12px 0 16px; padding: 12px 0; }
.gate-proof .proof-headline { font-size: 1.2rem; font-weight: 700; margin: 0 0 10px; }

@media (max-width: 760px) {
  .county-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  header.site nav a.nav-wide { display: none; }
}

@media (max-width: 640px) {
  .proof-headline { font-size: 1.6rem; }
  .claim-box { padding: 16px; }
  .claim-box a.btn { display: block; text-align: center; }
  .coverage-tools label:not(.check) { flex: 1 1 140px; }
  .coverage-tools select, .coverage-tools input[type="search"] { min-width: 0; width: 100%; }
  table.coverage-table th, table.coverage-table td { padding: 10px 6px; }
  table.coverage-table .badge { padding: 2px 8px; font-size: 0.68rem; letter-spacing: 0; }
  table.sample th, table.sample td { padding: 8px 6px; font-size: 0.85rem; }
}
.hero-cta a.hero-link { color: #ffd2ad; font-weight: 600; }
.hero-areas { color: #9aa7bb; font-size: 0.9rem; margin: 14px 0 0; }

/* coverage: numeric headers stay on one line; short labels on a phone */
table.coverage-table th.num { white-space: nowrap; }
table.coverage-table th .short { display: none; }
@media (max-width: 480px) {
  table.coverage-table th .long { display: none; }
  table.coverage-table th .short { display: inline; }
}
.coverage-tools select, .coverage-tools input[type="search"] { height: 46px; }
.county-filter { border: 1px solid #f3c9a6; background: var(--accent-light); border-radius: var(--radius);
                 padding: 12px 16px; margin: 0 0 12px; }
.county-filter p { margin: 0; }

/* short pages (a county 404, an empty filter) keep the footer at the bottom */
body:has(> footer.site) { min-height: 100vh; display: flex; flex-direction: column; }
body:has(> footer.site) > main { flex: 1 0 auto; width: 100%; }
.legal-line { margin: 0; }

/* ---- 2026-10-01: rendered-review fixes ----------------------------------- */

/* An error under a button (the pay page's #subscribe-err, the wallet's) gets room
   instead of sitting against the button. Those two also show the dry-run note
   (their class becomes "note"), so they are named by id as well. */
button + .error, #subscribe-err, #wallet-err { margin-top: 12px; }

/* County page: the current week's bar is partial. The "so far" slot exists on every
   bar so the four labels stay on one baseline. */
.bar-sofar { color: var(--muted); font-size: 0.72rem; font-style: italic; line-height: 1.4; height: 1.4em; white-space: nowrap; }
.bar-col.partial .bar { background: repeating-linear-gradient(135deg, var(--accent) 0 6px, #eea36b 6px 12px); }

/* County page: no citations in 30 days, so no "Claim" button. */
.claim-box.quiet { background: var(--bg-soft); border-color: var(--line); }
a.btn.secondary { background: #fff; color: var(--accent-dark); border: 1px solid var(--line); }
a.btn.secondary:hover { background: var(--bg-soft); }

/* Sign-up territory picker: a search box that filters the select. */
fieldset.territory-pick { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.territory-pick legend { font-size: 0.9rem; font-weight: 600; padding: 0; margin-bottom: 2px; }
fieldset.territory-pick .note { margin: 0; }
.sr-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- 2026-10-01: nationwide pages ---------------------------------------- */

/* home: pricing */
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 8px 0 12px; }
.price-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--bg-soft); min-width: 0; }
.price-tile p { margin: 6px 0 0; }
.price .per { font-size: 1rem; color: var(--muted); font-weight: 500; }

/* "tell me when it is covered / picks up" */
.request-form label { display: block; font-weight: 600; }
.request-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.request-row input { flex: 1 1 200px; min-width: 0; }
.request-row button { flex: 0 0 auto; }
.request-form .error { margin-top: 8px; }
.request-done { margin: 0; font-weight: 600; color: var(--ok); }
.state-offer { margin: 12px 0 0; }

/* state page */
main.state-page { max-width: var(--max-width); }
.source-list { list-style: none; margin: 0; padding: 0; }
.source-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.source-list li:first-child { border-top: 0; }
.source-list .sub, table.coverage-table .sub { display: block; color: var(--muted); font-size: 0.82rem; }
.county-list { list-style: none; margin: 8px 0 0; padding: 0; columns: 3 180px; column-gap: 20px; }
.county-list li { padding: 3px 0; break-inside: avoid; overflow-wrap: anywhere; }
.badge.quiet { text-transform: none; }

/* /app */
.sub-list { list-style: none; margin: 0 0 14px; padding: 0; }
.sub-item { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.sub-item:first-child { border-top: 0; }
.sub-item .sub-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.sub-item .sub-status { color: var(--muted); }
.sub-item.active .sub-status { color: var(--ok); }
.sub-item.past_due .sub-status { color: var(--danger); font-weight: 600; }
.sub-item.canceled { opacity: 0.65; }
.sheet-tools { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.sheet-tools label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; min-width: 0; }
.sheet-tools select { width: 100%; }
#wallet-packs { display: flex; gap: 8px; flex-wrap: wrap; }
#add-btn + .error, #manage-btn + .error { margin-top: 12px; }
.callout { background: var(--accent-light); border: 1px solid #f3c9a6; border-radius: var(--radius); padding: 12px 16px; }

/* admin */
tr.row-error td { background: #fbe9e7; }
tr.row-stale td { background: var(--bg-soft); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
#sources-table .sub { display: block; color: var(--muted); font-size: 0.8rem; }

@media (max-width: 640px) {
  .price-grid { grid-template-columns: minmax(0, 1fr); }
  .county-list { columns: 2 140px; }
}

/* /app sheet and signals: address and reason wrap so no column is cut off at desktop width */
#sheet-table td:nth-child(3), #sheet-table td:nth-child(5),
#signals-table td:nth-child(3), #signals-table td:nth-child(5) { white-space: normal; min-width: 150px; }

/* Phones: each lead is a small card instead of a table that scrolls sideways off the screen */
@media (max-width: 640px) {
  #sheet-table, #signals-table, #sheet-table tbody, #signals-table tbody { display: block; }
  #sheet-table thead, #signals-table thead { display: none; }
  #sheet-table tr, #signals-table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  #sheet-table td, #signals-table td { display: block; border: 0; padding: 2px 0; white-space: normal; min-width: 0; }
  #sheet-table td:nth-child(2), #signals-table td:nth-child(2) { font-weight: 600; }
  #sheet-table td:nth-child(4), #signals-table td:nth-child(4) { color: var(--muted); font-size: 0.85rem; }
  #sheet-table td .btn, #sheet-table td button, #signals-table td button { margin-top: 6px; }
}

/* Admin sources table: 14 columns scroll sideways inside their box, but the long source label wraps so the first screen shows more of them */
#sources-table td:first-child { white-space: normal; min-width: 210px; max-width: 260px; }
#sources-table .sub { white-space: normal; }
#sources-table th, #sources-table td { padding: 8px 8px; font-size: 0.85rem; }

/* The leads table: long business names and reasons wrap so the Mail button column is never pushed out of view. */
#sheet-table td, #signals-table td { white-space: normal; }
#sheet-table td:last-child { white-space: nowrap; }
@media (max-width: 640px) { #sheet-table td:last-child { white-space: normal; } }
#sheet-table td:nth-child(4), #signals-table td:nth-child(4) { white-space: nowrap; }
