/* ============================================================
   SOS+SAFER Puller — modern centered design
   ============================================================ */

/* :root variables are now REMAPPED onto the design-system tokens loaded
   from tokens.css. All existing styles.css rules that reference --bg /
   --text / --accent / etc. automatically adopt the P2 Verified palette
   (cream bg, navy ink, verified-green accent) without per-rule rewriting.
   Original values kept on the right as `/* was: ... */` for reference. */
:root {
  --bg: var(--vs-bg);                   /* was: #f9fafb (light slate) */
  --bg-elev: var(--vs-surface);          /* was: #ffffff */
  --border: var(--vs-line);              /* was: #e5e7eb */
  --border-strong: var(--vs-line-strong); /* was: #d1d5db */
  --text: var(--vs-ink);                 /* was: #111827 */
  --text-muted: var(--vs-ink-2);         /* was: #6b7280 */
  --text-subtle: var(--vs-ink-muted);    /* was: #9ca3af */
  --accent: var(--vs-ink);               /* was: var(--vs-ink) (blue) — primary CTA is INK in P2 Verified */
  --accent-hover: var(--vs-ink-2);       /* was: var(--vs-ink-2) */
  --accent-bg: var(--vs-accent-soft);    /* was: #eff6ff */
  --success: var(--vs-verified);         /* was: #15803d — now the brand "verified" green */
  --success-bg: var(--vs-verified-soft); /* was: #f0fdf4 */
  --warn: #d97706;                       /* keep — design system has no amber token */
  --warn-bg: #fffbeb;                    /* keep */
  --danger: var(--vs-danger);            /* was: #dc2626 */
  --danger-bg: var(--vs-danger-soft);    /* was: #fef2f2 */
  --radius: var(--vs-radius);            /* was: 10px → 6px (more refined) */
  --radius-sm: var(--vs-radius-sm);      /* was: 6px → 4px */
  --shadow-sm: var(--vs-shadow-sm);
  --shadow-md: var(--vs-shadow);
  --shadow-lg: 0 10px 25px rgba(14,27,44,0.08), 0 2px 6px rgba(14,27,44,0.04);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  /* IBM Plex Sans is the new UI face per design system; the rest of the
     stack kept as fallbacks while Plex loads via Google Fonts. */
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

/* ============================================================
   HONEY PACKAGE — site-wide nav + footer (2026-05-28).
   Replit's redesign palette: warm greens + amber accents on a
   soft cream + green-gradient backdrop. The legacy .topbar /
   .site-foot rules below are kept for backwards compatibility
   while pages migrate over.
   ============================================================ */
header.hp-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 20px 40px;
  max-width: 1100px; margin: 0 auto;
  border-bottom: 1px solid #E2EDE7;
}
.hp-logo {
  display: flex; align-items: center; gap: 12px;
  font-weight: 900; font-size: 23px; letter-spacing: -0.02em;
  text-decoration: none; color: #0F1F16;
  transition: filter .15s, transform .15s;
}
.hp-logo:hover {
  text-decoration: none;
  filter: brightness(1.08) drop-shadow(0 4px 14px rgba(11,125,86,.35));
}
.hp-logo-mk {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, #0e7a52, #14a06a);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 19px;
  box-shadow: 0 6px 16px -6px rgba(11,125,86,.6);
  transition: box-shadow .15s;
}
.hp-logo:hover .hp-logo-mk {
  box-shadow: 0 10px 24px -8px rgba(11,125,86,.7);
}
.hp-logo-beta {
  font-size: 10px; font-weight: 800; letter-spacing: 0.14em;
  color: #B7791F; background: #FDF7E6;
  border: 1px solid #F2E2A8;
  padding: 3px 9px; border-radius: 999px;
  align-self: center;
}
.hp-navright { display: flex; align-items: center; gap: 18px; }
.hp-search-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14.5px; font-weight: 800; color: #0F1F16;
  padding: 10px 4px; text-decoration: none;
  transition: color .12s;
}
.hp-search-link:hover { color: #0B7D56; }
.hp-invite {
  font-size: 13.5px; font-weight: 800; color: #0B7D56;
  background: #E8F7EF; border: 1px solid #C5E8D6;
  padding: 8px 16px; border-radius: 999px;
  text-decoration: none; transition: all .12s;
}
.hp-invite:hover { background: #d6f0e1; border-color: #9fd9bb; }
.hp-signin {
  font-size: 14px; font-weight: 800; color: #0B7D56;
  background: #fff; border: 1.5px solid #C5E8D6;
  border-radius: 11px; padding: 10px 20px;
  white-space: nowrap; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15,31,22,.04);
  transition: all .12s;
}
.hp-signin:hover { border-color: #12A672; }

.hp-foot { margin-top: 24px; background: rgba(255,255,255,0.5); }
/* Single-row footer: trust strip | nav links | contact email. The old
   .hp-fwrap (second row) was merged into .hp-frow so the footer is now
   one horizontal band. */
.hp-frow {
  max-width: 1200px; margin: 0 auto; padding: 14px 36px;
  display: flex; align-items: center; gap: 18px 28px;
  border-top: 1px solid #E2EDE7;
  flex-wrap: wrap;
}
.hp-flinks {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: 8px 22px;
  font-size: 13px; font-weight: 700;
  flex: 1 1 auto;
}
.hp-flinks a { color: #37473e; text-decoration: none; transition: color .12s; }
.hp-flinks a:hover { color: #0B7D56; }
.hp-bugbtn {
  display: inline-flex; align-items: center; gap: 7px;
  color: #0B7D56 !important;
  background: #E8F7EF; border: 1px solid #C5E8D6;
  border-radius: 9px; padding: 5px 11px; font-weight: 800;
}
.hp-fleft {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: #67766d;
  font-weight: 600; letter-spacing: 0.02em;
  flex-shrink: 0;
}
.hp-lock-i { color: #12A672; }
.hp-fright { font-size: 13.5px; color: #0B7D56; font-weight: 800; flex-shrink: 0; }
.hp-fright a { color: inherit; text-decoration: none; }
.hp-fright a:hover { text-decoration: underline; }

/* Clean mint-tinted body background for every page. The old fixed gold
   "burned-circle" radial (background-attachment:fixed) is gone — JT 2026-06-02:
   it "stayed in place" on scroll and read as a burned beige ring. Warm/beige
   now lives in the landing's section colours, not as a pinned global glow. */
body {
  background:
    radial-gradient(74% 50% at 50% -8%, #F7F2E6 0%, rgba(247,242,230,0) 60%),
    #F3EEE3 !important;
  color: #0F1F16;
}

/* Sticky footer on every NON-landing page. Short pages (logged-in search,
   settings, an empty result) were leaving the footer floating mid-page with
   bare paper below it (JT 2026-06-02). Make the body a full-height flex column
   so <main> grows to fill and the footer is pinned to the bottom. Scoped with
   :not(:has(.hp-mktg-hero)) so the landing's scroll-snap layout is untouched. */
html:not(:has(.hp-mktg-hero)) body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html:not(:has(.hp-mktg-hero)) body > main {
  flex: 1 0 auto;
}

@media (max-width: 640px) {
  header.hp-nav { padding: 16px 20px; gap: 12px; }
  .hp-logo { font-size: 18px; gap: 8px; }
  .hp-logo-mk { width: 36px; height: 36px; font-size: 16px; border-radius: 11px; }
  .hp-navright { gap: 8px; }
  .hp-search-link span { display: none; }
  .hp-invite, .hp-signin { padding: 7px 12px; font-size: 12.5px; }
  .hp-flinks { gap: 6px 16px; font-size: 12px; }
  .hp-frow { padding: 12px 20px; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
}

/* === Top nav (legacy navy — kept for any template still referencing) === */
header.topbar {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 20px 36px;
  display: flex;
  align-items: center;
  gap: 40px;
}

/* JT 2026-05-28 — slim 3-column header: left spacer / centered logo /
   right actions. Logo lives dead-center, right side carries only Invite
   + usage chip + user pill (or Sign in when anonymous). Everything else
   moved to the site footer. */
header.topbar.topbar-3col {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  padding: 18px 36px;
}
.tb-left { /* visual balancer, intentionally empty */ }
.brand-center {
  justify-self: center;
  align-self: center;
  margin: 0;
}
.tb-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
  align-self: center;
}
.tb-right .nav-invite {
  font-size: 13.5px;
  font-weight: 700;
  color: #15803d;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  transition: background 0.12s, border-color 0.12s;
  letter-spacing: -0.005em;
}
.tb-right .nav-invite:hover {
  background: #dcfce7;
  border-color: #86efac;
}
.tb-right .nav-signin {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--vs-bg, #F4EFE6);
  background: var(--vs-ink, #0E1B2C);
  text-decoration: none;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--vs-ink, #0E1B2C);
  transition: opacity 0.12s, transform 0.08s;
}
.tb-right .nav-signin:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
/* Tighter BETA badge — sits closer to the wordmark */
.topbar-3col .brand-sub {
  margin-left: 6px;
  font-size: 9.5px;
  letter-spacing: 2px;
}
@media (max-width: 720px) {
  header.topbar.topbar-3col {
    grid-template-columns: auto 1fr auto;
    padding: 14px 16px;
    gap: 10px;
  }
  .tb-left { display: none; }
  .brand-center { justify-self: start; }
  .tb-right { gap: 8px; }
  .tb-right .nav-invite { font-size: 12px; padding: 5px 10px; }
}

/* ============================================================
   User-menu dropdown — name + caret in nav opens a small popover
   with personal links (History / Settings / Invite / Feedback /
   Sign out). Click outside or Esc to close.
   ============================================================ */
.user-menu {
  position: relative;
  display: inline-block;
}
.user-pill-btn {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.user-pill-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.user-pill-btn .user-pill-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
}
.user-pill-btn .user-pill-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.user-pill-btn .user-pill-caret {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 2px;
  transition: transform 0.18s;
}
.user-menu.open .user-pill-caret { transform: rotate(180deg); color: var(--text); }
.user-menu.open .user-pill-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 27, 44, 0.08);
}

.user-menu-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.16), 0 4px 12px rgba(15,23,42,0.08);
  padding: 8px 6px;
  display: none;
  z-index: 8000;
}
.user-menu.open .user-menu-pop { display: block; animation: umpop 0.14s ease-out; }
@keyframes umpop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-menu-email {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-subtle);
  padding: 4px 12px 8px;
  word-break: break-all;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  letter-spacing: 0.005em;
}
.user-menu-pop a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.user-menu-pop a:hover { background: #f1f5f9; color: var(--accent); }
.user-menu-pop .umi {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
}
.user-menu-pop a.umi-out { color: #b91c1c; }
.user-menu-pop a.umi-out:hover { background: #fef2f2; color: #991b1b; }

/* ============================================================
   Site footer — secondary links in small print so the top nav
   stays clean. JT 2026-05-28: "we can have some of the items on
   the bottom in smaller PRINT like Blog History Pricing Settings
   feedback states counties — if anyone wants to click through
   and read everything then they can but I dont want to overcrowd
   the top unnecessarily."
   ============================================================ */
.site-foot {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 40px 36px 28px;
  margin-top: 60px;
  color: var(--text-muted);
}
.sf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 32px;
  max-width: 880px;
  margin: 0 auto 28px;
}
.sf-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sf-col-h {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 6px;
}
.sf-col a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 0;
  transition: color 0.12s;
}
.sf-col a:hover { color: var(--accent); }
.sf-bottom {
  max-width: 880px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-subtle);
  flex-wrap: wrap;
  gap: 12px;
}
.sf-bottom .sf-trust { letter-spacing: 0.02em; }
@media (max-width: 640px) {
  .site-foot { padding: 32px 20px 22px; margin-top: 40px; }
  .sf-grid { grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
  .sf-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}
/* === Modernized brand identity ===
   JT 2026-05-27 polish: larger logo, glow-on-hover (no underline),
   "BETA" lighter & frameless. */
.brand,
.brand:hover,
.brand:focus,
.brand:visited,
.brand:active {
  /* text-decoration: none on every state — browsers default to underline on
     :hover for anchor tags, which fights the glow effect AND looks broken
     against gradient-clipped text. JT 2026-05-27 reported the underline
     was still appearing on hover. */
  text-decoration: none;
}
.brand {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: filter 0.22s ease, transform 0.12s ease;
  padding: 2px 0;
  line-height: 1.25;
}
.brand:hover {
  filter: drop-shadow(0 0 8px rgba(15, 23, 42, 0.18));
  transform: translateY(-0.5px);
}
.brand:focus-visible {
  outline: 0;
  filter: drop-shadow(0 0 10px rgba(15, 23, 42, 0.28));
}
/* New SVG lockup — L04 Brackets, replaces the typographic wordmark below.
   Old .brand-verify / .brand-sos rules kept for any template that still
   references them, but the topbar now uses the SVG. */
.brand-lockup {
  display: block;
  height: 48px;
  width: auto;
  transition: filter 0.2s ease;
}
@media (max-width: 640px) {
  .brand-lockup { height: 38px; }
}
.brand:hover .brand-lockup {
  filter: drop-shadow(0 0 8px rgba(14, 27, 44, 0.22));
}

/* Typographic wordmark — "Verify" in Inter + "SOS" in JetBrains Mono.
   The font contrast IS the logo identity (no separate icon needed).
   JT 2026-05-28: bumped up + tightened so it reads as ONE confident
   brand, not three little words. Verify and SOS now sized to feel
   like a single wordmark with a font-shift in the middle. */
.brand-verify {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", system-ui, sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.032em;
  color: #0f172a;
  line-height: 1.05;
  padding-bottom: 3px;
}
.brand-sos {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: #f59e0b;
  margin-left: 1px;      /* tight kerning — reads as one wordmark */
  line-height: 1.05;
  padding-bottom: 3px;
}
.brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 2.4px;
  padding: 0;
  border: 0;
  background: transparent;
  margin-left: 10px;
  align-self: center;
  position: relative;
  top: -1px;
}

nav.topnav {
  display: flex;
  gap: 0;             /* dividers + per-link padding provide spacing */
  margin-left: auto;
  align-items: center;
}
/* Topnav sizing 2026-05-28 — bumped to 15px / 11px padding for legibility
   (processor team will use this all day; small + thin links read as
   "incomplete product"). Vertical dividers got darker + taller so the
   nav clearly breaks into groups. High-use tabs (Search, History,
   Settings) get bolder weight. */
nav.topnav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  position: relative;
  transition: color 0.14s ease;
}
nav.topnav a:hover {
  color: var(--text);
  background: transparent;
}
nav.topnav a.active {
  color: var(--accent);
  background: transparent;
}
/* Vertical separator between adjacent nav links — taller, slightly darker,
   so the nav reads as "click here · click here · click here" instead of
   one long blur. Skipped for sign-in CTA so the pill button stays distinct. */
nav.topnav > a:not(:first-of-type):not(.nav-signin)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: rgba(14, 27, 44, 0.18);
}

/* High-use tabs get heavier weight so they read first. */
nav.topnav a[href$="/search"],
nav.topnav a[href$="/"],
nav.topnav a[href*="history"],
nav.topnav a[href*="settings"] {
  font-weight: 700;
  color: var(--text);
}

/* Invite (⚡) — subtle green accent so it stands out as a positive CTA
   without screaming. */
nav.topnav a.nav-invite {
  color: #15803d;
  font-weight: 700;
}
nav.topnav a.nav-invite:hover {
  color: #14532d;
  background: transparent;
}

/* Feedback gets the accent color tint — same baseline padding, no bg block. */
nav.topnav a.nav-feedback {
  color: var(--accent);
  font-weight: 700;
}
nav.topnav a.nav-feedback:hover {
  color: var(--accent-hover);
  background: transparent;
}
/* "Report an issue" — quieter than the rest until hovered. */
nav.topnav a.nav-issue {
  color: var(--text-subtle);
  font-size: 14px;
  font-weight: 500;
}
nav.topnav a.nav-issue:hover {
  color: var(--text);
  background: transparent;
}
/* Sign-in CTA — ink-filled pill, sits apart from the divided nav links.
   Uses the design-system tokens DIRECTLY with hardcoded fallback values
   (defensive against tokens.css cache miss / load order issues) and
   !important to short-circuit any other rule that might null out the
   background on the topbar. Previous version using var(--text) + #fff
   went invisible in production — likely because var(--text) wasn't
   resolving when styles.css loaded before tokens.css in some CDN
   states. This form can't fail. */
nav.topnav a.nav-signin {
  display: inline-block !important;
  background: var(--vs-ink, #0E1B2C) !important;
  color: var(--vs-bg, #F4EFE6) !important;
  padding: 9px 22px !important;
  border-radius: 999px !important;
  font-weight: 700;
  font-size: 14px;
  margin-left: 16px;
  border: 1px solid var(--vs-ink, #0E1B2C);
  transition: background 0.14s, color 0.14s, transform 0.12s;
}
nav.topnav a.nav-signin:hover {
  background: var(--vs-bg, #F4EFE6) !important;
  color: var(--vs-ink, #0E1B2C) !important;
  transform: translateY(-1px);
}

/* ============================================================
   Usage chip — current-month pull counter in the nav.
   Five tier colors so a glance tells the processor where they stand:
     ok       (0-79%)   neutral gray
     warn     (80-89%)  amber tint
     near     (90-99%)  orange
     over     (100%+)   red
     unlimited (BETA)   green — flat $25/mo, no cap
   Clickable through to /account/settings (the future Billing tab).
   ============================================================ */
.usage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-right: 10px;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  cursor: pointer;
}
.usage-chip:hover {
  background: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}
.usage-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.usage-chip-n {
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
}
.usage-chip-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.usage-chip-pct {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15,23,42,0.06);
  color: var(--text-muted);
}

/* Tier overrides — color the dot + pct chip. Background tints are
   subtle so the chip doesn't shout. */
.usage-chip.usage-tier-unlimited {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: #bbf7d0;
}
.usage-chip.usage-tier-unlimited .usage-chip-dot { background: #16a34a; }
.usage-chip.usage-tier-unlimited .usage-chip-n { color: #14532d; }

.usage-chip.usage-tier-ok .usage-chip-dot { background: #16a34a; }

.usage-chip.usage-tier-warn {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
  color: #78350f;
}
.usage-chip.usage-tier-warn .usage-chip-dot { background: #d97706; }
.usage-chip.usage-tier-warn .usage-chip-n { color: #78350f; }
.usage-chip.usage-tier-warn .usage-chip-pct { background: rgba(120,53,15,0.12); color: #78350f; }

.usage-chip.usage-tier-near {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fb923c;
  color: #7c2d12;
}
.usage-chip.usage-tier-near .usage-chip-dot { background: #ea580c; }
.usage-chip.usage-tier-near .usage-chip-n { color: #7c2d12; }
.usage-chip.usage-tier-near .usage-chip-pct { background: rgba(124,45,18,0.14); color: #7c2d12; }

.usage-chip.usage-tier-over {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fca5a5;
  color: #7f1d1d;
  animation: usage-pulse 2.4s ease-in-out infinite;
}
.usage-chip.usage-tier-over .usage-chip-dot { background: #dc2626; }
.usage-chip.usage-tier-over .usage-chip-n { color: #7f1d1d; }
.usage-chip.usage-tier-over .usage-chip-pct { background: rgba(127,29,29,0.16); color: #7f1d1d; }
@keyframes usage-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.0); }
  50% { box-shadow: 0 0 0 4px rgba(220,38,38,0.18); }
}

/* ============================================================
   Enrichment strip — NPI + USA Spending panels, moved to bottom
   of the results page on 2026-05-28. They're supporting signal,
   not decision-driving, so they sit below the SOS/SAFER picker
   instead of pushing it down. Eyebrow makes it clear they're an
   aside, not the main event.
   ============================================================ */
.enrichment-strip {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}
.enrich-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.enrich-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.enrich-note {
  font-size: 13px;
  color: var(--text-subtle);
  font-style: italic;
}
.enrich-panel { margin-bottom: 12px; }
.enrich-panel:last-child { margin-bottom: 0; }
.enrich-panel h2 {
  font-size: 18px !important;
  font-weight: 800 !important;
  margin: 0 0 4px !important;
  display: flex !important;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   Onboarding tour — 3-step modal that fires on first login.
   Designed for non-technical users: big type, clear arrows,
   keyboard-navigable (← → Esc). Backdrop click also skips.
   ============================================================ */
.ob-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 14, 12, 0.62);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; padding: 24px;
  opacity: 0; transition: opacity 0.18s ease;
}
.ob-backdrop.ob-open { opacity: 1; }
.ob-backdrop.ob-closing { opacity: 0; pointer-events: none; }

/* First-login tour — cards swap a deep colour per step (set by JS: ob-theme-1..4),
   the landing's Ink-Reveal cue. CSS vars (--obf fg, --oba accent, --obs surface,
   --obb border) drive every child so each theme lives in one place. */
.ob-card {
  --obf: #e9f3ec; --oba: #74e0b0;
  --obs: rgba(255,255,255,0.07); --obb: rgba(255,255,255,0.17);
  background: #103a2c; color: var(--obf);
  border-radius: 20px;
  max-width: 580px; width: 100%; max-height: 90vh; overflow-y: auto;
  padding: 34px 38px 26px;
  box-shadow: 0 30px 70px rgba(8,14,12,0.5);
  position: relative;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.16,1,0.3,1), background 0.35s ease;
}
.ob-backdrop.ob-open .ob-card { transform: translateY(0) scale(1); }
.ob-theme-1 { background:#103a2c; --obf:#e9f3ec; --oba:#74e0b0; }   /* deep green */
.ob-theme-2 { background:#152238; --obf:#e7ecf6; --oba:#7aa6f0; }   /* navy */
.ob-theme-3 { background:#2e1419; --obf:#f6e7ea; --oba:#e0908f; }   /* maroon */
.ob-theme-4 { background:#0f1a18; --obf:#e9f3ee; --oba:#5fe0b8; }   /* dark ink */

.ob-close {
  position: absolute; top: 16px; right: 18px;
  background: var(--obs); border: 0;
  font-size: 15px; color: var(--obf); opacity: .65;
  cursor: pointer; width: 30px; height: 30px; border-radius: 50%;
  line-height: 1; transition: opacity .14s;
}
.ob-close:hover { opacity: 1; }

.ob-eyebrow {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--oba); margin-bottom: 14px;
}
.ob-h {
  font-size: 27px; font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.1; color: var(--obf); margin: 0 0 14px;
}
.ob-p { font-size: 15.5px; line-height: 1.55; color: var(--obf); opacity: 0.92; margin: 0 0 16px; }
.ob-code {
  background: var(--obs); border: 1px solid var(--obb); padding: 3px 9px; border-radius: 6px;
  font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; font-weight: 600; color: var(--obf);
}

.ob-step { display: none; }
.ob-step.ob-step-active { display: block; animation: ob-fade .35s ease; }
@keyframes ob-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 1 · source chips */
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.ob-chip {
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
  padding: 7px 14px; border-radius: 999px;
  background: var(--obs); border: 1px solid var(--obb); color: var(--obf);
}
.ob-chip-on {
  background: color-mix(in srgb, var(--oba) 20%, transparent);
  border-color: color-mix(in srgb, var(--oba) 50%, transparent);
}
.ob-chip-on::before { content: "\2713 "; color: var(--oba); font-weight: 800; }

/* 2 · examples */
.ob-examples { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.ob-examples code {
  font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; font-weight: 600;
  background: var(--obs); border: 1px solid var(--obb); color: var(--obf);
  padding: 8px 13px; border-radius: 9px;
}

/* shared note card (tip / beta) */
.ob-note, .ob-beta {
  font-size: 13.5px; line-height: 1.55; color: var(--obf); opacity: 0.95;
  background: var(--obs); border: 1px solid var(--obb); border-left: 3px solid var(--oba);
  padding: 12px 15px; border-radius: 10px; margin: 6px 0 0;
}
.ob-note strong, .ob-beta strong { color: var(--oba); }

/* 3 · quick actions */
.ob-actions-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 11px; }
.ob-actions-list li { font-size: 14.5px; line-height: 1.5; color: var(--obf); opacity: 0.95; display: flex; gap: 14px; align-items: flex-start; }
.ob-actions-list li .ob-act-d { flex: 1; }
.ob-kbd {
  flex-shrink: 0; min-width: 150px; box-sizing: border-box; white-space: nowrap; align-self: flex-start;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 700;
  background: color-mix(in srgb, var(--oba) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--oba) 45%, transparent);
  color: var(--oba); padding: 6px 12px; border-radius: 7px; text-align: center;
}

/* 4 · nav list */
.ob-nav-list { list-style: none; padding: 0; margin: 16px 0 12px; font-size: 14.5px; color: var(--obf); opacity: 0.92; }
.ob-nav-list li { padding: 7px 0; border-bottom: 1px solid var(--obb); }
.ob-nav-list li:last-child { border-bottom: 0; }
.ob-nav-list strong { color: var(--oba); font-weight: 700; }

.ob-foot { font-size: 12.5px; color: var(--obf); opacity: 0.68; margin: 16px 0 0; }

/* actions bar */
.ob-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--obb);
  gap: 14px; flex-wrap: wrap;
}
.ob-dots { display: flex; gap: 7px; align-items: center; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--obb); transition: background .18s, transform .18s; }
.ob-dot-active { background: var(--oba); transform: scale(1.4); }
.ob-btns { display: flex; align-items: center; gap: 8px; }
.ob-skip { background: transparent; border: 0; color: var(--obf); opacity: 0.6; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 9px 12px; border-radius: 9px; }
.ob-skip:hover { opacity: 1; }
.ob-back { background: transparent; color: var(--obf); border: 1px solid var(--obb); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; cursor: pointer; }
.ob-back:hover { border-color: var(--obf); }
.ob-next, .ob-done {
  background: var(--oba); color: #0c1a14; border: 0;
  padding: 11px 22px; border-radius: 999px; font-size: 14px; font-weight: 800;
  cursor: pointer; transition: transform .08s, filter .14s;
}
.ob-next:hover, .ob-done:hover { transform: translateY(-1px); filter: brightness(1.06); }

@media (max-width: 640px) {
  .ob-card { padding: 26px 22px 20px; }
  .ob-h { font-size: 22px; }
  .ob-actions { flex-direction: column-reverse; align-items: stretch; }
  .ob-btns { justify-content: space-between; }
  .ob-kbd { min-width: 132px; padding: 5px 9px; }
  .ob-actions-list li { gap: 11px; }
}
/* Deployed-version chip — fixed bottom-right corner of every page.
   Low-profile but always visible so JT can verify which commit is live. */
.ver-chip {
  position: fixed;
  bottom: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
  z-index: 50;
  transition: color 0.14s, border-color 0.14s, transform 0.1s;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}
.ver-chip:hover {
  color: var(--text);
  border-color: #94a3b8;
  transform: translateY(-1px);
}
.ver-chip .ver-label {
  font-weight: 700;
  color: var(--text);
}
.ver-chip .ver-sep {
  color: var(--text-subtle);
  opacity: 0.6;
}
.ver-chip .ver-sha {
  font-family: ui-monospace, Menlo, "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0;
}
/* Hide chip when printing — it's not part of any document */
@media print {
  .ver-chip { display: none !important; }
}

/* Legacy bug-link styling (vestigial — kept in case any old template uses it) */
nav.topnav a.bug-link {
  color: var(--text-muted);
  background: transparent;
  border: 0;
  margin-left: 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  opacity: 0.7;
}
nav.topnav a.bug-link:hover { opacity: 1; color: var(--text); }
.bug-icon { font-size: 13px; }
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  margin-left: 8px;
  font-size: 12.5px;
  color: var(--text);
}
.user-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 2px #dcfce7;
}
.user-pill-email {
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-pill-name {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-pill-out {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.user-pill-out:hover { color: var(--danger); }

/* === Bug-report modal === */
.bug-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 200;
  padding: 24px;
}
.bug-modal-backdrop.open { display: flex; }
.bug-modal {
  background: #fff; width: 600px; max-width: 100%;
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 90vh;
}
.bug-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-bottom: 1px solid #fecaca;
}
.bug-modal-header h2 { margin: 0; font-size: 16px; color: #7f1d1d; font-weight: 700; }
.bug-modal-close {
  background: transparent; border: 0; font-size: 18px; cursor: pointer; color: #7f1d1d;
  padding: 4px 10px; border-radius: 4px;
}
.bug-modal-close:hover { background: rgba(127,29,29,0.1); }
.bug-modal-body { padding: 18px 22px; overflow-y: auto; }
.bug-modal-intro { font-size: 13px; color: #475569; line-height: 1.55; margin: 0 0 14px; }
.bug-modal-intro strong { color: #0f172a; }
.bug-field { display: block; margin-bottom: 12px; }
.bug-field > span {
  display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 4px;
}
.bug-field input, .bug-field textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 13px; font-family: inherit; line-height: 1.5; box-sizing: border-box;
}
.bug-field input:focus, .bug-field textarea:focus {
  outline: 0; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(14,27,44,0.15);
}
.bug-modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; background: #f8fafc; border-top: 1px solid #e2e8f0;
}
.bug-modal-actions button { padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; border: 0; }
.bug-modal-actions .btn-primary { background: #dc2626; color: #fff; }
.bug-modal-actions .btn-primary:hover { background: #b91c1c; }
.bug-modal-actions .btn-secondary { background: #fff; color: #475569; border: 1px solid #cbd5e1; }
.bug-modal-actions .btn-secondary:hover { background: #f1f5f9; }

/* === Main layout === */
main { max-width: 980px; margin: 0 auto; padding: 28px; }
.page-narrow { max-width: 720px; }
.page-wide { max-width: 1100px; }

/* ===================================================================
   MODERNIZED HOME PAGE — Speed Lookup
   ================================================================ */
.hero-modern {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 48px;
}
.hero-h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0 0 10px;
  text-align: center;
  background: linear-gradient(180deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tag {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 auto 22px;
  text-align: center;
  max-width: 580px;
}

/* Source chips — explains what each public source actually is so users
   know what they're getting. Muted chips for sources that are usually
   irrelevant (NPI for non-healthcare, USA Spending for SMB). */
.sources-section {
  margin: 36px auto 12px;
  max-width: 720px;
  padding: 0 12px;
}
.sources-title {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 0 auto;
  max-width: 600px;
}
.src-chip {
  font-size: 11.5px;
  color: #334155;
  background: #fff;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  line-height: 1.35;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  letter-spacing: 0.3px;
}
.src-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.src-chip strong { color: #0f172a; font-weight: 700; }
.src-chip:hover strong { color: var(--accent); }
.src-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.src-chip.active strong { color: #fff; }
.src-chip-muted {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
  opacity: 0.85;
}
.src-chip-muted strong { color: #475569; }

/* Detail panel below the chips — shows the full explanation when a chip
   is clicked. Stays hidden until needed so the layout is clean by default. */
.chip-detail {
  max-width: 600px;
  margin: 10px auto 0;
  padding: 10px 14px;
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  color: #1e3a8a;
  line-height: 1.5;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.18s, max-height 0.18s, margin-top 0.18s, padding 0.18s;
}
.chip-detail.show {
  opacity: 1;
  max-height: 80px;
  padding: 10px 14px;
  margin-top: 10px;
}

/* Compact single-line trust footer pinned to the very bottom of the page. */
.trust-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  margin-top: 48px;
}
.trust-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  opacity: 0.85;
}
.trust-mini:hover { opacity: 1; color: var(--text); }

/* Anonymous-user CTA banner — sits above the search panel on home page.
   Hidden when logged in (via Jinja `is_logged_in` flag). */
.anon-cta {
  background: var(--vs-surface);
  border: 1px solid var(--vs-line);
  border-radius: var(--vs-radius);
  padding: 14px 20px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 720px;
}
.anon-cta-text {
  flex: 1;
  font-size: 13.5px;
  color: var(--vs-ink-2);
  line-height: 1.5;
  min-width: 240px;
}
.anon-cta-text strong { color: var(--vs-ink); }
/* Sign-up primary CTA — solid ink pill */
.anon-cta-btn {
  background: var(--vs-ink);
  color: var(--vs-bg);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--vs-radius-pill);
  border: 1px solid var(--vs-ink);
  transition: background 0.12s, color 0.12s, transform 0.08s;
  white-space: nowrap;
}
.anon-cta-btn:hover {
  background: var(--vs-bg);
  color: var(--vs-ink);
  transform: translateY(-1px);
}
/* Sign-in secondary CTA — outlined hairline pill, matching the new
   design system. Previously rendered as bare text and blended into
   the surrounding ink copy on the cream panel — only the hover
   underline made it pop. Now reads as a proper button at rest. */
.anon-cta-link {
  display: inline-block;
  color: var(--vs-ink);
  background: transparent;
  border: 1px solid var(--vs-ink);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--vs-radius-pill);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.anon-cta-link:hover {
  background: var(--vs-ink);
  color: var(--vs-bg);
  text-decoration: none;
}

.search-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 1px 3px rgba(15,23,42,0.04),
    0 8px 24px rgba(15,23,42,0.06);
  padding: 0;
  overflow: hidden;
}

.search-tabs-modern {
  display: flex;
  gap: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 6px 6px 0;
}
.tab-btn-modern {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px 10px 0 0;
  transition: all 0.14s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn-modern:hover { color: var(--text); }
.tab-btn-modern.active {
  background: #fff;
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab-icon { font-size: 15px; }

.search-form-modern {
  padding: 26px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.field-grow { flex-grow: 2; }
.field-block { display: block; width: 100%; }
.field-block > input,
.field-block > select,
.field-block > textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
}

/* 2nd-state block — checkbox row above; revealed input below.
   Input now matches the main company-name input visually (no colored
   wrapper, same border/padding/font). Status badge sits inline next to it. */
.alt-state-block {
  padding: 0;
  background: transparent;
  border: 0;
}
.alt-state-input {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.alt-state-input input[type="text"] {
  width: 100%;
  text-transform: uppercase;
  font-size: 14px;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.alt-state-input input[type="text"]:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,27,44,0.12);
}
.alt-state-status {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.alt-state-status.ok { color: var(--success); }
.alt-state-status.warn { color: #b45309; }
.alt-state-status.err { color: var(--danger); }
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.field-label .req { color: #dc2626; }
.field-hint {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 400;
  margin-left: 4px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="url"],
.field select {
  width: 100%;
  padding: 12px 13px;
  /* Clearly-visible box on the white auth card — the old var(--border) was too
     faint to see until focus (JT 2026-06-02). Darker border + faint fill. */
  border: 1.5px solid #b3c1b9;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #f6f9f7;
  color: var(--text);
  transition: border-color 0.14s, box-shadow 0.14s;
  appearance: none;
}
.field input::placeholder { color: var(--text-subtle); }
.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field input[type="tel"]:focus,
.field input[type="number"]:focus,
.field input[type="url"]:focus,
.field select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,27,44,0.12);
}
.state-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px;
  padding-right: 34px !important;
}

.check-row-modern {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: -4px;
}
.check-row-modern input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.manual-state-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.55;
}
.manual-state-warning strong { color: #422006; }

/* Primary action — bolder, taller, more prominent. JT 2026-05-28:
   "make the search button bold since its the most commonly used one". */
.submit-btn-modern {
  background: var(--vs-ink);
  color: #fff;
  border: 0;
  padding: 17px 26px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.01em;
  transition: transform 0.08s, box-shadow 0.14s, background 0.18s;
  box-shadow: 0 2px 8px rgba(14, 27, 44, 0.32), 0 4px 18px rgba(14, 27, 44, 0.18);
  margin-top: 8px;
  width: 100%;
  text-transform: none;
}
.submit-btn-modern:hover {
  transform: translateY(-1px);
  background: var(--vs-ink-2);
  box-shadow: 0 4px 14px rgba(14, 27, 44, 0.42), 0 8px 28px rgba(14, 27, 44, 0.24);
}
.submit-btn-modern:active { transform: translateY(0); }
.submit-btn-modern:disabled {
  background: #94a3b8;
  cursor: wait;
  box-shadow: none;
  transform: none;
}
.btn-arrow { transition: transform 0.14s; }
.submit-btn-modern:hover .btn-arrow { transform: translateX(3px); }

.btn-link {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
}
.btn-link:hover { text-decoration: underline; }

.error-banner {
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  color: #7f1d1d;
  padding: 11px 16px;
  margin: 0 28px;
  margin-top: 18px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  font-weight: 500;
}

.owner-help {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 6px 0 4px;
  padding: 11px 14px;
  background: var(--bg);
  border-radius: 8px;
}
.owner-help .ok { color: var(--success); }
.owner-help .med { color: var(--warn); }
.owner-help .low { color: var(--danger); }

.results-header-modern {
  padding: 18px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.results-header-modern .back-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.results-header-modern .back-link:hover { text-decoration: underline; }

.empty-state-modern {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  font-size: 15px;
}
.empty-state-modern a { color: var(--accent); font-weight: 600; text-decoration: none; }
.empty-state-modern a:hover { text-decoration: underline; }

/* === Hero (home page — legacy, kept for non-home pages that still reference it) === */
.hero {
  text-align: center;
  padding: 64px 0 32px;
}
.hero h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}
.hero .tagline {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 36px;
}

/* === Hero search === */
.hero-search {
  max-width: 620px;
  margin: 0 auto;
}
.hero-search .search-tabs {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 20px;
  font-size: 13px;
}
.hero-search .tab-btn {
  background: transparent;
  border: none;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.hero-search .tab-btn.active {
  background: var(--text);
  color: white;
}
.hero-search .input-wrap {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 4px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.hero-search .input-wrap:focus-within {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.hero-search input[type="text"] {
  width: 100%;
  font-size: 18px;
  padding: 16px 80px 16px 20px;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  font-family: inherit;
}
.hero-search input[type="text"]::placeholder { color: var(--text-subtle); }
.hero-search .submit-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.hero-search .submit-btn:hover { background: var(--accent-hover); }
.hero-search .submit-btn:disabled { background: var(--text-muted); cursor: wait; }
.hero-search .parse-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  min-height: 18px;
  text-align: left;
  padding-left: 4px;
}
.hero-search .parse-hint.ok { color: var(--success); }
.hero-search .parse-hint code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
}
.hero-search .checkbox-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.hero-search .checkbox-row input { width: 14px; height: 14px; cursor: pointer; }
.hero-search .dropdown-fallback {
  margin-top: 14px;
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
}
.hero-search .dropdown-fallback summary { cursor: pointer; display: inline; }
.hero-search .dropdown-fallback select {
  margin-top: 10px;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 360px;
  font-family: inherit;
}

/* === Recent pulls (home below hero) === */
.recent-section { margin-top: 56px; }
.recent-section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin: 0 0 14px;
  font-weight: 600;
}
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.1s, transform 0.05s;
}
.recent-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.recent-item .date { font-size: 11px; color: var(--text-muted); font-family: ui-monospace, Menlo, monospace; }
.recent-item .company { font-weight: 600; color: var(--text); }
.recent-item .state-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.recent-item .arrow { color: var(--text-subtle); font-size: 16px; }

/* === Generic content sections === */
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
/* Base H2 — bumped from 16/600 to 20/800 so section heads across the app
   read as actual headings, not metadata. Override per-component when
   needed (the results-grid section h2 + panel h2 stay at their tuned
   sizes; this lifts every other H2 the app didn't already style). */
h2 { font-size: 20px; font-weight: 800; margin: 26px 0 14px; color: var(--text); letter-spacing: -0.015em; line-height: 1.2; }
/* "📥 Auto-downloaded" / "⚠ Address cross-reference" / "Owners…" — pull
   them to a clear top-of-section weight. */
.success h2,
.success-card h2 { font-size: 22px; margin: 0 0 12px; }
.success { padding: 20px 22px; }
h3 { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 24px 0 8px; }
p { margin: 0 0 12px; color: var(--text); }
.hint, .subtitle { color: var(--text-muted); font-size: 13px; }
.empty { color: var(--text-subtle); font-style: italic; font-size: 13px; }

/* Empty-results card — replaces the curt "No matches." with a helpful,
   actionable next-step block so a brand-new processor isn't left
   wondering what to do next. */
.empty-results {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.empty-results .empty-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.empty-results .empty-body { flex: 1; min-width: 0; font-size: 14px; color: #78350f; }
.empty-results .empty-body strong { color: #451a03; font-size: 15px; font-weight: 800; display: block; margin-bottom: 4px; }
.empty-results .empty-body p { margin: 6px 0 4px; color: #92400e; }
.empty-results .empty-body ul { margin: 4px 0 8px 18px; padding: 0; color: #78350f; }
.empty-results .empty-body ul li { padding: 2px 0; }
.empty-results .empty-actions { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(120, 53, 15, 0.18); }
.empty-results .empty-actions a { color: #b45309; font-weight: 600; text-decoration: underline; }
.empty-results .empty-sep { margin: 0 8px; color: #b45309; }
.hint-inline { font-weight: normal; font-size: 11px; color: var(--text-subtle); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* === Buttons === */
button, .btn {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button.primary, .btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); }
button.secondary, .btn.secondary {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border-strong);
}
button.secondary:hover, .btn.secondary:hover { background: var(--bg); }
button:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary { /* legacy */
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--border-strong);
  padding: 8px 16px; border-radius: var(--radius-sm); text-decoration: none; font-size: 13px; font-weight: 600;
}

/* === Results page === */
/* Sticky confirm header — keeps the Pull documents CTA visible while the
   user scrolls through long match lists. Pinned to the top under the
   topbar so it's always one click away. */
.confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
  box-shadow: 0 6px 12px -8px rgba(14, 27, 44, 0.18);
}
.confirm-header h1 { margin: 0 0 4px; font-size: 22px; }
.big-pull-btn {
  background: var(--vs-verified);
  color: var(--vs-bg);
  border: 1px solid var(--vs-verified);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.005em;
  padding: 14px 26px;
  white-space: nowrap;
  border-radius: var(--vs-radius-pill);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(31, 122, 77, 0.32);
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
  min-width: 200px;
}
.big-pull-btn:hover {
  background: #166534;
  border-color: #166534;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(31, 122, 77, 0.42);
}
.big-pull-btn:active { transform: translateY(0); }
.big-pull-btn:disabled {
  background: var(--text-muted);
  border-color: var(--text-muted);
  cursor: wait;
  box-shadow: none;
  transform: none;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;             /* bumped from 20 → 28 for stronger column distinction */
  margin-top: 0;
}
.results-grid section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
/* Column-specific accents — left edge stripe makes the columns read
   as obviously different sources at a glance. SOS = navy, DOT = blue. */
.results-grid .results-col-sos {
  border-left: 4px solid var(--vs-ink, #0E1B2C);
}
.results-grid .results-col-dot {
  border-left: 4px solid #3b82f6;
}
/* Section heads — bumped from 13/muted-caps to 16/ink-caps with an
   icon + 2px underline so SECRETARY OF STATE vs FMCSA SAFER columns
   scan from across the room. Processors should see them as headlines. */
.results-grid section h2 {
  font-size: 16px;
  margin: 0 0 18px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}
.results-grid section h2 .rg-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.results-grid section h2 .rg-title-text { flex: 1; min-width: 0; }
.results-grid section h2 .rg-state {
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.results-col-dot h2 .rg-icon { font-size: 24px; }
.results-col-dot h2 { border-bottom-color: #bfdbfe; }
.results-col-sos h2 { border-bottom-color: rgba(14,27,44,0.18); }

/* Inline "Skip SOS" toggle — sits at the right edge of the header so
   it reads as "X this section out" rather than wasting a match-row slot. */
.skip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.skip-toggle:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #78350f;
}
.skip-toggle input[type="radio"] {
  margin: 0;
  accent-color: var(--text-muted);
  width: 13px;
  height: 13px;
}
.skip-toggle:has(input:checked) {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #78350f;
}
.skip-toggle:has(input:checked) input { accent-color: #d97706; }

.match-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  background: var(--bg-elev);
  transition: all 0.1s;
  position: relative;
}
/* JT 2026-05-28: stronger separation between match rows. The 1px border
   on each card wasn't reading as "these are distinct options". Add a
   thin hairline above each row (except the first) to make the break
   obvious without doubling up borders. */
.match-option + .match-option::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(15,23,42,0.10) 50%, transparent 100%);
}
.match-option:hover { border-color: var(--accent); }
.match-option.autopick { background: var(--success-bg); border-color: var(--success); }
.match-option.state-match:not(.autopick) { background: var(--accent-bg); border-color: var(--accent); }
/* Inactive carrier / dissolved entity — visible BEFORE click. */
.match-option.inactive-match {
  background: #fef2f2;
  border-color: #fca5a5;
  opacity: 0.92;
}
.match-option.inactive-match:hover { border-color: #ef4444; }
.match-option.inactive-match strong {
  color: #991b1b;
  text-decoration: line-through;
  text-decoration-color: rgba(153, 27, 27, 0.4);
}
.inactive-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  background: #dc2626;
  color: #fff;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.6px;
  margin-right: 6px;
  vertical-align: 2px;
  text-transform: uppercase;
}
/* Status-unknown badge — shown when FMCSA returned a record with neither
   allowedToOperate nor commonAuthorityStatus set. Visually distinct from
   the red inactive-badge so users can tell apart "known inactive" vs
   "we don't have confirmed status, verify before relying on it". */
.unknown-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  background: #f59e0b;
  color: #fff;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.6px;
  margin-right: 6px;
  vertical-align: 2px;
  text-transform: uppercase;
}
.cross-ref-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: #e0f2fe;
  color: #0c4a6e;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #7dd3fc;
  letter-spacing: 0.3px;
  margin-right: 6px;
  vertical-align: 2px;
}
.match-option input[type="radio"] { margin-top: 3px; accent-color: var(--accent); }
/* Match name = the headline of each row. Bumped from 14px/600 to
   16px/800 so the entity name reads as the primary scan-target. */
.match-body strong { display: block; font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; line-height: 1.25; }
/* Location pill — always shown on every match row so two near-identical
   matches (e.g. two active DOTs for the same carrier) are easy to tell
   apart at a glance. */
.loc-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  padding: 3px 11px;
  border-radius: 999px;
  margin: 6px 6px 4px 0;
  letter-spacing: 0.005em;
  border: 1px solid #e2e8f0;
}
.loc-pill-match {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #bfdbfe;
}

.auto-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: var(--success);
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.state-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.match-body .id, .match-body .status {
  display: inline-block;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 5px;
  margin: 6px 6px 0 0;
  font-weight: 600;
}
/* "Active" / "Good Standing" statuses pop — same chip shape but green
   so processors land on the right entity by status, not by name match. */
.match-body .status {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.match-body .yib {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 999px;
  margin: 6px 6px 0 0;
}
.match-body .addr { font-size: 13px; color: var(--text-muted); margin-top: 8px; line-height: 1.45; }
.source-link { font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 6px; display: inline-block; }

.actions {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* === Banners (OFAC etc) === */
.ofac-hit, .ofac-clear, .manual-help, .error {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13px;
}
.ofac-hit {
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  color: #7f1d1d;
}
.ofac-hit ul { margin: 6px 0 0 18px; font-size: 12px; }
.ofac-clear {
  background: var(--success-bg);
  border-left: 4px solid var(--success);
  color: var(--success);
  font-weight: 600;
}
.manual-help {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn);
  color: #92400e;
}
.error {
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  color: #7f1d1d;
}

.manual-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #fcd34d;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

/* === Done page === */
.success-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.success-card .pdf-name { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.success-card .pdf-link {
  background: var(--accent);
  color: white;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.success-card .pdf-link:hover { background: var(--accent-hover); text-decoration: none; }

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.panel h2 { margin-top: 0; font-size: 14px; }
.panel.warn { background: var(--warn-bg); border-color: #fcd34d; }
.panel.warn h2 { color: #92400e; }

/* UCC panel — three states: clear (green), warn (amber), neutral (gray) */
.ucc-panel { padding: 14px 18px; }
.ucc-panel-clear { background: #f0fdf4; border-color: #bbf7d0; }
.ucc-panel-clear h2 { color: #15803d; }
.ucc-panel-warn { background: #fffbeb; border-color: #fcd34d; }
.ucc-panel-warn h2 { color: #92400e; }
.ucc-panel-neutral { background: #f8fafc; border-color: #cbd5e1; }
.ucc-panel-neutral h2 { color: #334155; }
.ucc-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ucc-panel h2 { margin: 0; font-size: 14px; font-weight: 700; }
.ucc-verify-link {
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  opacity: 0.85;
  white-space: nowrap;
}
.ucc-verify-link:hover { opacity: 1; }

/* Business presence panel layout — phone/email/address/services grid */
.bp-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 8px 0 4px;
}
.bp-meta-cell {
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.bp-meta-cell-wide { grid-column: 1 / -1; }
.bp-meta-lbl {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.bp-meta-val {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  font-weight: 600;
}
.bp-meta-val a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.bp-meta-val a:hover { text-decoration: underline; }
.bp-nav-cats { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 500; }
.bp-cat-pill {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* Business presence inclusion control — auto-include vs confirm */
.bp-include {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.bp-include-auto {
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #86efac;
  color: #14532d;
}
.bp-include-auto .bp-include-icon {
  font-size: 22px;
  line-height: 1;
  background: #16a34a;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.bp-include-confirm {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  color: #78350f;
}
.bp-include-confirm label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  margin: 0;
  width: 100%;
}
.bp-include-confirm input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: #d97706;
  flex-shrink: 0;
  cursor: pointer;
}
.bp-include-body { flex: 1; min-width: 0; }
.bp-include-body strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.005em;
  margin-bottom: 3px;
}
.bp-include-auto .bp-include-body strong { color: #14532d; }
.bp-include-confirm .bp-include-body strong { color: #78350f; }
.bp-include-body span {
  display: block;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 500;
}
.bp-include-auto .bp-include-body span { color: #166534; }
.bp-include-confirm .bp-include-body span { color: #92400e; }

/* === Tables === */
.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}
.history-table th, .history-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.history-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.history-table tr:last-child td { border-bottom: none; }
.history-table.compact td, .history-table.compact th { padding: 8px 12px; font-size: 12px; }

/* === Confidence pills === */
.conf-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.conf-pill.conf-high { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.conf-pill.conf-med  { background: var(--warn-bg); color: var(--warn); border: 1px solid #fcd34d; }
.conf-pill.conf-low  { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
tr.conf-low td { opacity: 0.7; }
strong.ok { color: var(--success); }
strong.med { color: var(--warn); }
strong.low { color: var(--danger); }

/* === Forms === */
.search-form {
  background: var(--bg-elev);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}
.search-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
}
.search-form input[type="text"],
.search-form input[type="search"],
.search-form select {
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: white;
  font-family: inherit;
}
.search-form input[type="text"]:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: 12px; }
.form-row label { flex: 1; }

/* === Spinner === */
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Misc legacy === */
.cross-ref-panel { background: var(--accent-bg); border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 20px; margin: 18px 0; }
.cross-ref-panel h2 { margin-top: 0; color: var(--accent); }
.cross-ref-panel a { color: var(--accent); font-weight: 600; }

.stats-row { display: none; }  /* removed from home page */
.parse-hint code { background: var(--bg); padding: 1px 5px; border-radius: 3px; }

/* Action buttons existing on other pages */
.actions { margin-top: 24px; display: flex; gap: 10px; justify-content: flex-end; }

/* ───────────────────────────────────────────────────────────────
   MOBILE — phones (≤640px wide)
   Collapses the desktop layout to a stacked, thumb-friendly mode.
   Added 2026-05-28 — desktop topbar with 7 nav items + user pill
   was wrapping into a 3-row mess on phones.
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* TOPBAR — stack brand on top, scroll-wrap nav below */
  header.topbar {
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 12px;
  }
  .brand-verify { font-size: 22px; }
  .brand-sos    { font-size: 20px; }
  .brand-sub    { font-size: 9px; letter-spacing: 1.8px; }

  nav.topnav {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;     /* horizontal scroll for long nav */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  nav.topnav::-webkit-scrollbar { display: none; }
  nav.topnav a {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  /* Vertical dividers between nav links break on horizontal scroll —
     hide them on mobile; the spacing alone separates the links visually. */
  nav.topnav > a:not(:first-of-type):not(.nav-signin)::before {
    display: none;
  }
  nav.topnav a.nav-signin {
    padding: 6px 14px;
    font-size: 12px;
    margin-left: 8px;
  }

  /* User pill — smaller on phones */
  .user-pill {
    padding: 4px 10px;
    font-size: 11px;
  }
  .user-pill-name {
    max-width: 80px;
    font-size: 11px;
  }

  /* HERO + MAIN content — tighter padding, smaller h1 */
  main { padding: 18px 16px; }
  .hero-h1 { font-size: 28px !important; }
  .hero-tag { font-size: 13px; }

  /* Search panel — pull padding in */
  .search-panel { padding: 18px 16px; }
  .submit-btn-modern {
    padding: 14px 20px;
    font-size: 15px;
  }

  /* Pricing cards — stack vertically (already handled by .pricing-grid
     media query at 700px, but reinforce for safety) */
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
    padding: 0 12px;
  }
  .pricing-h1 { font-size: 28px; }

  /* Results-page cards stack */
  .results-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  /* Confirm-matches header — stack the headline + Pull-documents CTA */
  .confirm-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px;
  }
  .big-pull-btn { width: 100%; }

  /* Version chip — smaller and pinned in the corner */
  .ver-chip {
    bottom: 8px;
    right: 8px;
    padding: 3px 9px;
    font-size: 10px;
  }
  .ver-chip .ver-sha { font-size: 9.5px; }

  /* Modals — fit phone screens */
  .ft-modal, .bug-modal {
    margin: 16px;
    max-width: calc(100% - 32px);
  }
}

/* ─── Tablet (641-920px) — keep desktop layout but tighter spacing ─── */
@media (min-width: 641px) and (max-width: 920px) {
  header.topbar { padding: 16px 24px; gap: 24px; }
  main { padding: 24px 20px; }
  .brand-verify { font-size: 24px; }
  .brand-sos    { font-size: 22px; }
}
