/* Type steps and radii are documented in DESIGN.md. Add a step there before
   introducing a new font-size or border-radius value here. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --sunken: #f1f5f9;
  --ink: #0f172a;
  --ink-body: #334155;
  --ink-muted: #475569;
  --accent: #0369a1;
  --accent-hover: #075985;
  --accent-soft: #e0f2fe;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --navy: #0f172a;
  --navy-soft: #94a3b8;
  --navy-line: #1e293b;

  --sig-listing-bg: #e0f2fe;
  --sig-listing-ink: #075985;
  --sig-rating-bg: #fef3c7;
  --sig-rating-ink: #92400e;
  --sig-inspection-bg: #d1fae5;
  --sig-inspection-ink: #065f46;
  --sig-pending-bg: #ede9fe;
  --sig-pending-ink: #5b21b6;

  --live: #059669;
  --link-on-dark: #7dd3fc;
  --status-ok-bg: #d1fae5;
  --status-ok-ink: #065f46;

  --font: Archivo, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --unit: 8px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shell: 1200px;

  /* Published hygiene scores 0-5. This is the only scale on the site that
     carries meaning through colour; anything that is not a numeric score
     (Pass, Awaiting Inspection) is shown uncoloured on purpose. */
  --rating-0: #a11212;
  --rating-1: #b8431a;
  --rating-2: #9c6207;
  --rating-3: #8a6d10;
  --rating-4: #3f7a3a;
  --rating-5: #1f6b3a;
  --rating-status: #17527d;
  --accent-soft-hover: #cfeafd;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-body);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button:disabled { cursor: not-allowed; }
/* Disabled buttons get an explicit, measured colour pair (#475569 on #f1f5f9,
   7.2:1) instead of fading the accent fill, which dropped to about 2.8:1. */
.button:disabled, .button:disabled:hover {
  background: var(--sunken); color: var(--ink-muted); border-color: var(--border-strong); transform: none;
}
a { color: inherit; }
img, svg { max-width: 100%; }

.shell { width: min(var(--shell), calc(100% - 48px)); margin-inline: auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }

h1, h2, h3, h4 { color: var(--ink); font-family: var(--font); margin: 0; }
h1 { font-size: clamp(2.4rem, 4.6vw, 3.9rem); font-weight: 800; line-height: 1.04; letter-spacing: -0.033em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.024em; }
h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.011em; line-height: 1.35; }

.eyebrow {
  display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--accent); margin-bottom: 14px;
}
.lead { font-size: clamp(1.125rem, 1.4vw, 1.2rem); line-height: 1.55; color: var(--ink-muted); }
.lead.compact { font-size: 1.125rem; }
.fine { font-size: 0.875rem; color: var(--ink-muted); }
.text-link { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.text-link:hover { color: var(--accent-hover); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 22px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 650; font-size: 0.9375rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.small { min-height: 38px; padding: 8px 16px; font-size: 0.875rem; }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.button.ghost:hover { background: var(--surface); border-color: var(--ink-muted); color: var(--ink); }
.button.full { width: 100%; }
.button.on-dark { background: #fff; color: var(--navy); }
.button.on-dark:hover { background: var(--accent-soft); }

/* ---------- nav ---------- */
.nav {
  height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 32px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.nav.shell { width: 100%; max-width: none; padding-inline: max(24px, calc((100% - var(--shell)) / 2)); }
.nav nav { display: flex; gap: 30px; }
.nav nav a {
  text-decoration: none; color: var(--ink-muted); font-weight: 550; font-size: 0.9375rem;
  transition: color .16s ease;
}
.nav nav a:hover { color: var(--ink); }
.brand {
  display: flex; align-items: center; gap: 9px; color: var(--ink);
  font-weight: 800; font-size: 1.125rem; letter-spacing: -0.021em; text-decoration: none;
}
.pulse-dot {
  position: relative; display: inline-grid; place-items: center;
  width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex: none;
}
.pulse-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid var(--accent); opacity: 0.32;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.account-link {
  width: 40px; height: 40px; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface);
  color: var(--ink-muted); transition: border-color .16s ease, color .16s ease;
}
.account-link:hover { border-color: var(--accent); color: var(--accent); }
.account-link.signed-in { background: var(--accent); border-color: var(--accent); color: #fff; }
.account-link svg { width: 19px; height: 19px; fill: currentColor; }

/* ---------- hero ---------- */
.hero { padding: 76px 0 68px; }
.hero-layout { display: grid; grid-template-columns: 1fr 0.85fr; gap: 64px; align-items: center; }
.hero-copy h1 { max-width: 15ch; }
.hero-copy .lead { margin-top: 20px; max-width: 52ch; }
.hero-actions { display: flex; align-items: center; gap: 18px; margin: 32px 0 16px; flex-wrap: wrap; }

/* live monitor panel */
.monitor {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.monitor-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--sunken);
}
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; animation: live-pulse 2.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.monitor-meta { font-size: 0.75rem; color: var(--ink-muted); }

.monitor-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-bottom: 1px solid var(--border); }
.monitor-stats > div { padding: 16px 18px; }
.monitor-stats > div + div { border-left: 1px solid var(--border); }
.monitor-stats dt { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-muted); }
.monitor-stats dd { margin: 4px 0 0; font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }

.monitor-feed { padding: 6px 0; min-height: 180px; }
.feed-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 18px; align-items: baseline; }
.feed-row + .feed-row { border-top: 1px solid var(--border); }
.feed-name { font-weight: 650; color: var(--ink); font-size: 0.9375rem; line-height: 1.3; }
.feed-meta { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--ink-muted); }
.monitor-foot { padding: 13px 18px; border-top: 1px solid var(--border); background: var(--sunken); font-size: 0.8125rem; color: var(--ink-muted); }

/* signal type badge — label carries the meaning, colour only reinforces it */
.sig-badge {
  display: inline-flex; align-items: center; flex: none; border-radius: 4px;
  padding: 3px 8px; font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.055em; white-space: nowrap;
  background: var(--sunken); color: var(--ink-muted);
}
.sig-badge[data-type="new_listing"] { background: var(--sig-listing-bg); color: var(--sig-listing-ink); }
.sig-badge[data-type="rating_change"] { background: var(--sig-rating-bg); color: var(--sig-rating-ink); }
.sig-badge[data-type="new_inspection"] { background: var(--sig-inspection-bg); color: var(--sig-inspection-ink); }
.sig-badge[data-type="rating_pending"] { background: var(--sig-pending-bg); color: var(--sig-pending-ink); }

/* ---------- trust band ---------- */
.trade-band { background: var(--surface); border-block: 1px solid var(--border); }
.trade-band .shell { display: flex; align-items: center; gap: 16px 32px; flex-wrap: wrap; padding: 22px 0; }
.trade-band .label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-muted); }
.trade-band .verticals { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.trade-band .verticals strong {
  font-size: 0.875rem; font-weight: 600; color: var(--ink);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
}

/* ---------- sections ---------- */
.section { padding: 88px 0; }
.section-head { max-width: 62ch; margin-bottom: 44px; }
.section-head p { color: var(--ink-muted); font-size: 1.125rem; margin: 12px 0 0; }

.line-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.line-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; display: grid; gap: 12px; align-content: start;
}
.line-no {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-hover);
  font-family: var(--mono); font-size: 0.8125rem; font-weight: 700;
}
.line-item p { margin: 0; color: var(--ink-muted); font-size: 0.9375rem; }

/* ---------- signal cards ---------- */
.signal-stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.signal-chit {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: grid; gap: 10px; align-content: start;
  transition: border-color .16s ease;
}
.signal-chit:hover { border-color: var(--border-strong); }
.chit-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signal-chit h3 { font-size: 1.125rem; }
.signal-chit .muted { font-size: 0.875rem; margin: 0; }
.rating-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 3px 9px; font-family: var(--mono); font-size: 0.8125rem; font-weight: 700; color: var(--ink);
}
.rating-chip small { font-family: var(--font); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.signal-rating { margin: 0; }
.signal-chit a {
  color: var(--accent); font-weight: 600; font-size: 0.875rem; text-decoration: none;
  border-bottom: 1px solid transparent; justify-self: start;
}
.signal-chit a:hover { border-bottom-color: currentColor; }
.empty {
  grid-column: 1 / -1; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; color: var(--ink-muted); background: var(--surface);
}

/* ---------- dark value strip ---------- */
.counter-strip { background: var(--navy); color: #e2e8f0; }
.counter-strip .split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.counter-strip h2 { color: #fff; }
.counter-strip p { color: var(--navy-soft); font-size: 1.125rem; }
.memo-card { background: var(--navy-line); border: 1px solid #334155; border-radius: var(--radius); padding: 28px; }
.memo-card strong { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--navy-soft); }
.memo-card blockquote { margin: 14px 0 20px; font-size: 1.375rem; line-height: 1.4; color: #fff; font-weight: 600; }
.memo-card a { color: var(--link-on-dark); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }

/* ---------- signup ---------- */
.intake-wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: start; }
.intake-docket {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.intake-docket fieldset, .intake-docket .full, .intake-docket .form-status, .intake-docket > .check { grid-column: 1 / -1; }
.intake-docket fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0; }
.intake-docket legend { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); padding: 0 6px; }
.intake-docket label, .checkout-profile label { display: flex; flex-direction: column; gap: 6px; font-weight: 650; font-size: 0.875rem; color: var(--ink); }
.intake-docket .check, .checkout-profile .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 0.875rem; color: var(--ink-body); }
.intake-docket input, .intake-docket select, .checkout-profile input {
  width: 100%; min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--surface); color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.intake-docket input:focus, .intake-docket select:focus, .checkout-profile input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.14);
}
::placeholder { color: #94a3b8; opacity: 1; }
.check input { width: auto; min-height: 0; margin-top: 0.28em; accent-color: var(--accent); }
.form-status { min-height: 1.5em; color: var(--accent-hover); font-weight: 600; font-size: 0.875rem; margin: 0; }

/* ---------- footer ---------- */
.footer { background: var(--navy); color: var(--navy-soft); padding: 36px 0 44px; }
.footer.shell {
  width: 100%; max-width: none; padding-inline: max(24px, calc((100% - var(--shell)) / 2));
  display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center;
}
.footer .brand { color: #fff; }
.footer p { font-size: 0.8125rem; margin: 0; line-height: 1.5; }
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer a { color: var(--navy-soft); font-size: 0.875rem; text-decoration: none; }
.footer a:hover { color: #fff; }

/* ---------- pricing ---------- */
.page-hero { padding: 72px 0 8px; }
.page-hero h1 { max-width: 18ch; }
.page-hero .lead { margin-top: 18px; max-width: 60ch; }

.rate-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin: 44px 0 56px; overflow: hidden;
}
.rate-row {
  display: grid; grid-template-columns: 1.1fr 1.7fr 0.8fr auto; gap: 28px; align-items: center;
  padding: 24px 28px;
}
.rate-row + .rate-row { border-top: 1px solid var(--border); }
.rate-row.featured { background: var(--accent-soft); }
.rate-plan { font-size: 1.125rem; font-weight: 750; color: var(--ink); letter-spacing: -0.015em; }
.rate-badge {
  display: inline-block; margin-top: 7px; border-radius: 4px; padding: 3px 8px;
  background: var(--accent); color: #fff;
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.055em;
}
.rate-includes { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; color: var(--ink-muted); font-size: 0.9375rem; }
.rate-includes li { display: flex; gap: 9px; align-items: baseline; }
.rate-includes li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); flex: none; transform: translateY(-2px); }
.rate-price { font-size: 1.875rem; font-weight: 750; color: var(--ink); letter-spacing: -0.03em; text-align: right; font-variant-numeric: tabular-nums; }
.rate-price span { display: block; font-size: 0.75rem; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.checkout-profile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; margin-bottom: 80px;
}
.checkout-profile h2 { font-size: 1.5rem; }
.checkout-profile > p { margin: 8px 0 0; }
.inline-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 22px 0 18px; }

/* ---------- legal / status ---------- */
.legal { max-width: 74ch; padding: 64px 0 96px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 20px; }
.legal h2 { font-size: 1.375rem; margin-top: 2.2em; margin-bottom: 0.5em; }
.legal p, .legal li { color: var(--ink-body); }
.legal a { color: var(--accent); font-weight: 600; }
.status-body .footer { display: none; }
.status-page {
  min-height: calc(100vh - 72px); display: grid; place-content: center; justify-items: center;
  text-align: center; max-width: 620px; padding-bottom: 72px;
}
.status-page h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 14px; }
.pulse-mark {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px; border-radius: 999px;
  padding: 7px 15px; background: var(--accent-soft); color: var(--accent-hover);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}

/* ---------- account dashboard ---------- */
.account-page { padding: 52px 0 96px; }
.account-hero { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; margin-bottom: 32px; }
.account-hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.account-hero .lead { margin-top: 12px; }
.account-summary {
  min-width: 240px; display: grid; gap: 6px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.875rem;
}
.status-pill {
  width: fit-content; display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 11px;
  background: var(--status-ok-bg); color: var(--status-ok-ink); font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.status-pill.inactive { background: var(--sunken); color: var(--ink-muted); }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr); gap: 22px; align-items: start; }
.account-sidebar { display: grid; gap: 20px; }
.account-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.account-card h2 { font-size: 1.25rem; margin-bottom: 10px; }
.account-card .muted { font-size: 0.9375rem; }
.account-main { padding: 30px; }
.card-heading { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.account-form, #data-rights { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.account-form label, #data-rights label { display: flex; flex-direction: column; gap: 6px; font-weight: 650; font-size: 0.875rem; color: var(--ink); }
.account-form small, #data-rights small { color: var(--ink-muted); font-weight: 400; font-size: 0.8125rem; }
.account-form input, .account-form select, #data-rights select, #data-rights textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--surface); color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
#data-rights textarea { min-height: 92px; padding-top: 10px; }
.account-form input:focus, .account-form select:focus, #data-rights select:focus, #data-rights textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.14);
}
.account-form input:disabled { background: var(--sunken); color: var(--ink-muted); }
.signal-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; margin: 0; }
.signal-options legend { grid-column: 1 / -1; font-weight: 700; margin-bottom: 10px; font-size: 0.9375rem; color: var(--ink); }
.option-card {
  display: grid !important; grid-template-columns: auto 1fr; gap: 11px !important; align-items: start;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px;
  font-weight: 400 !important; cursor: pointer; transition: border-color .16s ease;
}
.option-card:hover { border-color: var(--accent); }
.option-card input { width: auto; min-height: 0; margin-top: 4px; accent-color: var(--accent); }
.option-card span { display: grid; gap: 3px; }
.option-card strong { color: var(--ink); font-size: 0.9375rem; }
.option-card small { line-height: 1.45; color: var(--ink-muted); }
.account-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.security-note { background: var(--sunken); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-layout { grid-template-columns: 1fr; gap: 44px; }
  .hero-copy h1, .hero-copy .lead { max-width: none; }
  .counter-strip .split, .intake-wrap { grid-template-columns: 1fr; gap: 36px; }
  .line-sheet, .signal-stack { grid-template-columns: repeat(2, 1fr); }
  .account-hero, .account-grid { grid-template-columns: 1fr; }
  .account-summary { min-width: 0; }
}

@media (max-width: 760px) {
  .nav nav { display: none; }
  /* The wordmark drops a step so the header still fits at 375px alongside
     the account control and the sign-up button. */
  .brand { font-size: 1rem; }
  .rate-row { grid-template-columns: 1fr; gap: 14px; text-align: left; }
  .rate-price { text-align: left; }
  .inline-fields { grid-template-columns: 1fr; }
  .footer.shell { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer nav { justify-content: center; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 32px); }
  .nav.shell { padding-inline: 16px; }
  .section { padding: 60px 0; }
  .hero { padding: 48px 0 52px; }
  .line-sheet, .signal-stack, .intake-docket, .form-grid, .signal-options { grid-template-columns: 1fr; }
  .intake-docket > * { grid-column: 1 !important; }
  .form-grid .wide { grid-column: auto; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button, .hero-actions .text-link { width: 100%; text-align: center; }
  .account-actions { flex-direction: column; }
  .account-actions .button { width: 100%; }
  .footer.shell { padding-inline: 16px; }
  .monitor-stats { grid-template-columns: 1fr; }
  .monitor-stats > div + div { border-left: 0; border-top: 1px solid var(--border); }
}

/* Touch targets: standalone links need a 44px-tall hit area on small screens. */
@media (max-width: 760px), (pointer: coarse) {
  .text-link, .signal-chit a, .memo-card a, .footer a, .auth-links a, .button.small, .brand {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .account-link { width: 44px; height: 44px; }
}

/* Cookie consent banner: shown only until the visitor makes a choice. */
.consent-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -6px 24px rgb(15 23 42 / 0.10);
  padding: 20px 0 max(20px, env(safe-area-inset-bottom));
}
.consent-banner[hidden] { display: none; }
.consent-inner {
  width: min(var(--shell), calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.consent-copy { flex: 1 1 460px; min-width: 0; }
.consent-title { font-size: 1rem; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.consent-copy p { margin: 0; font-size: 0.875rem; line-height: 1.55; color: var(--ink-body); }
.consent-copy a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.consent-actions { display: flex; gap: 10px; flex-shrink: 0; }

@media (max-width: 620px) {
  .consent-inner { width: calc(100% - 32px); gap: 16px; }
  .consent-actions { width: 100%; }
  .consent-actions .button { flex: 1; justify-content: center; }
}

/* ---------- ticker ---------- */
.ticker-section { border-block: 1px solid var(--border); background: var(--surface); padding: 26px 0 22px; }
.ticker-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ticker-heading {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink-muted);
}
.ticker-toggle {
  min-height: 32px; padding: 4px 14px; background: transparent; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 650; color: var(--ink-muted);
  transition: border-color .16s ease, color .16s ease;
}
.ticker-toggle:hover { border-color: var(--ink-muted); color: var(--ink); }

.ticker { overflow: hidden; position: relative; }
/* Fade the tape into the page edges rather than cutting entries dead. */
.ticker::before, .ticker::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 56px; z-index: 2; pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(to right, var(--surface), transparent); }
.ticker::after { right: 0; background: linear-gradient(to left, var(--surface), transparent); }

.ticker-track { display: flex; width: max-content; --ticker-duration: 60s; }
.ticker[data-ready="true"] .ticker-track {
  animation: ticker-scroll var(--ticker-duration) linear infinite;
}
.ticker[data-state="paused"] .ticker-track,
.ticker-track:hover,
.ticker-track:focus-within { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
.ticker-run { display: flex; flex: none; }

.ticker-item {
  display: flex; flex-direction: column; gap: 5px; flex: none;
  min-width: 232px; padding: 12px 22px; border-right: 1px solid var(--border);
  text-decoration: none; color: inherit;
  border-left: 3px solid transparent;
  transition: background-color .16s ease;
}
.ticker-item:hover { background: var(--sunken); }
/* A published rating changed: the reason someone watches this feed. */
.ticker-item.is-change { border-left-color: var(--accent); background: var(--accent-soft); }
.ticker-item.is-change:hover { background: var(--accent-soft-hover); }

.ticker-name { font-size: 0.9375rem; font-weight: 650; color: var(--ink); white-space: nowrap; }
.ticker-meta { font-size: 0.8125rem; color: var(--ink-muted); white-space: nowrap; }
.ticker-rating { display: flex; align-items: center; gap: 8px; }

.ticker-stars { display: inline-flex; gap: 2px; flex: none; }
.ticker-stars svg { width: 14px; height: 14px; display: block; }
.ticker-stars svg.is-filled path { fill: currentColor; }
.ticker-stars svg.is-empty path { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0.42; }

.ticker-score {
  display: inline-grid; place-items: center; flex: none;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: var(--radius-xs);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 0.8125rem; font-weight: 700; color: #fff;
}
.ticker-change {
  font-size: 0.75rem; font-weight: 700; color: var(--ink-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ticker-change.is-down { color: var(--rating-0); }
.ticker-change.is-up { color: var(--rating-5); }

/* Not a 0-5 score, so no stars and no place on the colour scale: the status
   spans the row in a neutral, informational blue instead. */
.ticker-status {
  display: block; padding: 3px 9px; border-radius: var(--radius-xs);
  background: var(--rating-status); color: #fff;
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}

.ticker-stars { color: var(--ink); }
.ticker-rating .ticker-score.is-0 { background: var(--rating-0); }
.ticker-rating .ticker-score.is-1 { background: var(--rating-1); }
.ticker-rating .ticker-score.is-2 { background: var(--rating-2); }
.ticker-rating .ticker-score.is-3 { background: var(--rating-3); }
.ticker-rating .ticker-score.is-4 { background: var(--rating-4); }
.ticker-rating .ticker-score.is-5 { background: var(--rating-5); }

@media (prefers-reduced-motion: reduce) {
  .ticker[data-ready="true"] .ticker-track { animation: none; }
  .ticker { overflow-x: auto; }
}

/* ---------- autocomplete combobox ---------- */
.combo-field { display: flex; flex-direction: column; gap: 6px; }
.combo-label { font-weight: 600; font-size: 0.9375rem; color: var(--ink); }
.combo-shell { position: relative; }
.combo-input { width: 100%; }
.combo-hint { margin: 0; font-size: 0.8125rem; color: var(--ink-muted); }

.combo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.combo-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--sunken);
  font-size: 0.8125rem; font-weight: 600; color: var(--ink);
}
.combo-chip-remove {
  width: 20px; height: 20px; display: grid; place-items: center; flex: none;
  border: 0; border-radius: var(--radius-xs); background: transparent; cursor: pointer;
  color: var(--ink-muted); font-size: 1rem; line-height: 1;
}
.combo-chip-remove::before { content: "\00d7"; }
.combo-chip-remove:hover { background: var(--border); color: var(--ink); }

.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 4px; list-style: none; max-height: 244px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgb(15 23 42 / 0.10);
}
.combo-option { padding: 9px 10px; border-radius: var(--radius-xs); font-size: 0.9375rem; cursor: pointer; }
.combo-option:hover, .combo-option.is-active { background: var(--sunken); }
.combo-option.is-active { box-shadow: inset 2px 0 0 var(--ink); }

@media (max-width: 620px) {
  .ticker-item { padding: 10px 16px; }
  .ticker::before, .ticker::after { width: 24px; }
}

/* The pause control is the WCAG 2.2.2 mechanism for the moving tape, so it has
   to stay comfortably tappable on touch devices. */
@media (max-width: 760px), (pointer: coarse) {
  .ticker-toggle { min-height: 44px; padding-inline: 18px; }
}

/* Billing interval switch on the pricing page. */
.interval-toggle {
  display: inline-flex; gap: 0; margin: 24px 0 0; padding: 4px; border: 1px solid var(--border-strong);
  border-radius: 999px; background: var(--surface);
}
.interval-toggle label {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 20px;
  border-radius: 999px; font-weight: 650; font-size: 0.9375rem; color: var(--ink-body); cursor: pointer;
}
.interval-toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.interval-toggle label:has(input:checked) { background: var(--accent); color: #fff; }
.interval-toggle label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.pricing-note { margin: 14px 0 0; }

/* Plan-limit notices after saving the account form. */
.form-notices { margin: 10px 0 0; padding: 12px 16px 12px 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--sunken); color: var(--ink-body); font-size: 0.875rem; }
.form-notices li + li { margin-top: 6px; }

/* In-page confirmation replacing window.confirm. */
.confirm-panel { margin-top: 14px; padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--sunken); }
.confirm-panel p { margin: 0 0 12px; color: var(--ink); }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.status-page .confirm-actions { justify-content: center; margin-top: 8px; }
.account-card .button + .button { margin-top: 10px; }
