:root {
  --bg: #14110b;
  --panel: #1c1810;
  --panel-2: #262015;
  --line: #3a3021;
  --text: #ece4d3;
  --muted: #a99a7d;
  --accent: #e0a828;
  --accent-dim: #a37814;
  --btn: #e0a828;         /* filled-button background (carries dark #201703 text) */
  --btn-dim: #a37814;     /* filled-button hover */
  --warn: #d1603a;
  --good: #8fbf4a;
  --link: #e0a828;        /* prose links — always underlined, so color is secondary */
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f4ec;
    --panel: #fffdf8;
    --panel-2: #efe9db;
    --line: #ddd2ba;
    --text: #241d10;
    --muted: #786a4e;
    --accent: #8a5f05;      /* accent-as-TEXT; 4.5:1+ on light bg/panels */
    --accent-dim: #c08f2a;
    --btn: #e0a828;         /* bright filled-button bg so dark text stays 4.5:1+ */
    --btn-dim: #c08f2a;
    --warn: #a9481f;
    --good: #486a14;        /* darkened for 4.5:1 on light panels */
    --link: #8a5f05;        /* darkened for 4.5:1 on light bg */
  }
}

* { box-sizing: border-box; }
a { color: var(--accent); }

/* ============================ Marketing pages ============================ */

body.marketing {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand { font-size: 18px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.topbar nav { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.topbar nav a { color: var(--text); text-decoration: none; }
.topbar nav a:hover { color: var(--accent); }

.btn {
  display: inline-block; font: inherit; font-size: 14px; font-weight: 650;
  padding: 9px 16px; border-radius: 7px; border: 1px solid var(--btn);
  background: var(--btn); color: #201703; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--btn-dim); border-color: var(--btn-dim); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--panel-2); }
.btn:disabled { opacity: 0.55; cursor: default; }

.hero { padding: 60px 0 30px; text-align: center; }
.hero h1 { font-size: 42px; line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.01em; }
.hero .lede { font-size: 19px; color: var(--muted); max-width: 680px; margin: 0 auto 12px; }
.hero .urgency { display: inline-block; margin-top: 14px; padding: 6px 14px; border-radius: 999px;
  background: #3a2a10; color: #f0c07a; border: 1px solid #6b4e18; font-size: 13.5px; font-weight: 600; }
.hero .cta-row { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { padding: 40px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 26px; margin: 0 0 8px; }
.section .sub { color: var(--muted); margin: 0 0 24px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; font-size: 14px; color: var(--muted); }
.feature .tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; }
.feature .tag.free { color: var(--good); }

.pricing { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 620px; margin: 0 auto; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; text-align: center; }
.plan.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan .name { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.plan .price { font-size: 38px; font-weight: 800; margin: 8px 0 2px; }
.plan .price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan .save { font-size: 13px; color: var(--good); margin-bottom: 14px; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 20px; text-align: left; font-size: 14px; display: grid; gap: 8px; }
.plan ul li::before { content: "✓ "; color: var(--good); font-weight: 700; }
.plan .btn { width: 100%; }

.demo-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.demo-map { height: 380px; }
.demo-hint { padding: 10px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
#demoResult { padding: 0; }

footer.site {
  border-top: 1px solid var(--line); padding: 28px 0; margin-top: 20px;
  font-size: 12.5px; color: var(--muted);
}
footer.site a { color: var(--muted); }
.disclaimer { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 10px; }

/* auth / dialog */
dialog {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text);
  padding: 24px; max-width: 380px; width: 92%;
}
dialog::backdrop { background: rgba(0,0,0,0.6); }
dialog h3 { margin: 0 0 6px; }
dialog p { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
dialog input[type=email] { width: 100%; }
.dialog-msg { font-size: 13px; margin-top: 12px; }
.dialog-msg.ok { color: var(--good); }
.dialog-msg.err { color: var(--warn); }

input, select, button, textarea {
  font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.legal { max-width: 760px; }
.legal h1 { font-size: 30px; }
.legal h2 { font-size: 19px; margin-top: 28px; }
.legal p, .legal li { color: var(--text); font-size: 15px; }
.legal .muted { color: var(--muted); font-size: 13px; }

/* ============================ App (map product) ========================= */

body.app {
  margin: 0; display: grid; grid-template-columns: 400px 1fr; height: 100vh;
  background: var(--bg); color: var(--text); overflow: hidden;
}
#sidebar { display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); min-height: 0; }
#sidebar header { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
#sidebar header .brand { font-size: 15px; }
#accountBtn { font-size: 12px; padding: 5px 9px; }

.tabbar { display: flex; border-bottom: 1px solid var(--line); }
.tabbar button { flex: 1; border: none; border-radius: 0; background: var(--panel); color: var(--muted); padding: 10px; cursor: pointer; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.tabbar button.active { color: var(--accent); border-bottom: 2px solid var(--accent); }

.tabpane { flex: 1; min-height: 0; overflow-y: auto; display: none; }
.tabpane.active { display: flex; flex-direction: column; }

#summary { margin: 0; padding: 10px 16px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }

#filters { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
#filters label { display: grid; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
#filters .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#filters .checks { display: grid; gap: 6px; }
#filters .checks label { display: flex; align-items: center; gap: 7px; font-size: 12px; text-transform: none; letter-spacing: normal; color: var(--text); cursor: pointer; }
#filters .checks input { width: auto; padding: 0; accent-color: var(--accent); }
#filters button[type=submit] { background: var(--btn); color: #201703; border-color: var(--btn); font-weight: 650; cursor: pointer; }

#results { overflow-y: auto; flex: 1; min-height: 0; }
.card { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.card:hover, .card.active { background: var(--panel-2); }
.card-head { display: flex; align-items: baseline; gap: 9px; }
.score { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: var(--accent); min-width: 26px; }
.where { font-size: 13px; font-weight: 600; }
.serial { font-size: 11px; color: var(--muted); margin-left: auto; }
.metrics { margin-top: 5px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.metrics strong { color: var(--text); font-weight: 600; }
.tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.tag.good { color: var(--good); border-color: var(--accent-dim); }
.tag.bad { color: var(--warn); border-color: var(--warn); }
.empty { padding: 26px 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* paywall overlay in the feed */
.paywall { padding: 30px 18px; text-align: center; }
.paywall h3 { margin: 0 0 8px; color: var(--accent); }
.paywall p { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }

/* watchlist + account panes */
.pane-pad { padding: 14px 16px; }
.pane-pad h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.wl-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.wl-item .del { background: none; border: none; color: var(--warn); cursor: pointer; padding: 2px 6px; }
.wl-form { display: grid; gap: 8px; margin-top: 12px; }
.account-row { font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.account-row .k { color: var(--muted); }
.status-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.status-pill.active, .status-pill.trialing { background: #2f4212; color: #bfe27a; }
.status-pill.none, .status-pill.canceled, .status-pill.past_due { background: #4a2a12; color: #eaa05a; }

#map { height: 100vh; background: var(--panel-2); }
.mine-dot { font-size: 13px; line-height: 16px; text-align: center; filter: drop-shadow(0 0 1px #000); }
.leaflet-popup-content { font-size: 12.5px; line-height: 1.5; }
.leaflet-popup-content b { font-size: 13px; }

/* ---- Inspector panel (shared shape with the deploy app) ---- */
#inspector { position: absolute; inset: 0; background: var(--panel); overflow-y: auto; padding: 0 0 24px; z-index: 5; }
.insp-head { position: sticky; top: 0; background: var(--panel); padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.insp-back { background: none; border: none; color: var(--muted); font-size: 12px; padding: 0 0 8px; cursor: pointer; }
.insp-back:hover { color: var(--accent); }
.verdict { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; }
.verdict.looks-open { background: #2f4212; color: #bfe27a; }
.verdict.claimed { background: #4a2a12; color: #eaa05a; }
.verdict.withdrawn { background: #5a1512; color: #ff9e80; }
.verdict.withdrawn-overlay { background: #4a3312; color: #e6b45a; }
.verdict.not-federal { background: #3a3021; color: #cdbb95; }
.verdict.unknown { background: #2a2a2a; color: #bbb; }
.warning { margin: 10px 16px 0; padding: 8px 11px; font-size: 12px; line-height: 1.45; color: #f0c07a; background: #3a2a10; border: 1px solid #6b4e18; border-radius: 6px; }
.insp-section.wd-hit { background: #2a1512; }
.insp-section.wd-pending { background: #2e2610; }
.wd-type { font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.insp-headline { margin: 9px 0 2px; font-size: 13.5px; line-height: 1.5; }
.insp-coords { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.insp-section { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.insp-section h3 { margin: 0 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.crow { display: flex; gap: 8px; font-size: 12.5px; padding: 3px 0; align-items: baseline; }
.crow .k { color: var(--muted); min-width: 92px; flex: none; }
.crow .v { color: var(--text); }
.crow .v.hit { color: var(--warn); }
.crow .v.clear { color: var(--good); }
.crow .v.unknown { color: var(--muted); font-style: italic; }
.plss-legal { font-size: 15px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.plss-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.insp-section a { display: inline-block; margin-top: 6px; font-size: 12.5px; color: var(--accent); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.checklist li { font-size: 12px; line-height: 1.45; color: var(--text); padding-left: 22px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border: 1.5px solid var(--accent-dim); border-radius: 3px; }
.caveat { margin: 10px 16px 0; font-size: 11px; line-height: 1.5; color: var(--muted); border-left: 2px solid var(--accent-dim); padding-left: 10px; }

@media (max-width: 820px) {
  body.app { grid-template-columns: 1fr; grid-template-rows: 55vh 45vh; }
  #map { height: 100%; }
  .features, .pricing { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}

/* ===================== Accessibility & shared additions ================== */

/* Skip link — first focusable element on every public page */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--btn); color: #201703; padding: 8px 14px; border-radius: 7px;
  font-weight: 650; text-decoration: none; transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

/* Prose links are underlined so they're distinguishable without relying on color
   (WCAG 1.4.1). Nav/buttons/tabs are exempt — they read as controls by shape. */
.legal a, .faq a, .prose a, footer.site a, .breadcrumb a,
.hero .lede a, .section .sub a, .disclaimer a, .statebody a {
  color: var(--link); text-decoration: underline; text-underline-offset: 2px;
}
.legal a:hover, .faq a:hover, .prose a:hover, footer.site a:hover,
.disclaimer a:hover, .statebody a:hover { color: var(--accent); }

footer.site a { color: var(--text); }        /* readable footer links (was muted) */
footer.site .disclaimer a { color: var(--link); }

/* Respect reduced-motion for all animation/transition/scroll behavior */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
}
html { scroll-behavior: smooth; }

/* Visually-hidden helper for screen-reader-only labels/headings */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Stronger, consistent focus ring on interactive elements + links */
a:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* ============================ Marketing v2 =============================== */

/* Trust / stats bar under the hero */
.statbar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; margin: 34px 0 6px;
}
.statbar .cell { background: var(--panel); padding: 16px 14px; text-align: center; }
.statbar .k { font-size: 26px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.statbar .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-top: 6px; }

/* Section intro helpers */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.section.tight { padding: 32px 0; }
.center { text-align: center; }

/* "Why now" / wedge callout band */
.wedge {
  border: 1px solid var(--accent-dim); border-left: 4px solid var(--accent);
  background: var(--panel); border-radius: 10px; padding: 20px 22px; margin: 8px 0;
}
.wedge h3 { margin: 0 0 8px; font-size: 18px; color: var(--accent); }
.wedge p { margin: 0; color: var(--text); font-size: 15px; }

/* Numbered steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.step .n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--btn); color: #201703; font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; font-size: 15px; }
.step p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* Comparison table */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.cmp { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; }
table.cmp th, table.cmp td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.cmp thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--panel); }
table.cmp thead th.us { color: var(--accent); }
table.cmp td.us { background: var(--panel-2); color: var(--text); font-weight: 600; }
table.cmp tbody th { font-weight: 600; color: var(--text); white-space: nowrap; }
table.cmp tbody tr:last-child th, table.cmp tbody tr:last-child td { border-bottom: none; }
.yes { color: var(--good); font-weight: 700; }
.no { color: var(--muted); }

/* FAQ (native details/summary — no JS, works without script) */
.faq { display: grid; gap: 10px; max-width: 760px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.faq summary {
  cursor: pointer; padding: 14px 16px; font-weight: 650; font-size: 15px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; font-weight: 700; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .faq-body { padding: 12px 16px 16px; color: var(--text); font-size: 14.5px; }
.faq .faq-body p { margin: 0 0 10px; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* Final CTA band */
.cta-band { text-align: center; padding: 44px 0; border-top: 1px solid var(--line); }
.cta-band h2 { font-size: 26px; margin: 0 0 10px; }
.cta-band p { color: var(--muted); margin: 0 0 20px; }

/* ======================= Programmatic state pages ======================= */

.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.state-hero { padding: 34px 0 24px; }
.state-hero h1 { font-size: 34px; line-height: 1.12; margin: 6px 0 12px; }
.state-hero .lede { font-size: 17px; color: var(--muted); max-width: 640px; }
.state-live {
  display: inline-flex; align-items: baseline; gap: 8px; margin-top: 16px; padding: 10px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: 14px;
}
.state-live .num { font-size: 20px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.statebody { max-width: 720px; }
.statebody h2 { font-size: 20px; margin: 28px 0 10px; }
.statebody p, .statebody li { font-size: 15px; color: var(--text); }
.statgrid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.statgrid a {
  font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text); text-decoration: none;
}
.statgrid a:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 820px) {
  .statbar { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
}
