/* BidLens — minimal site styles. Vanilla CSS, no framework.
   Single brand colour, system fonts, generous spacing. */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-card: #ffffff;
  --fg: #16202c;
  --fg-muted: #5f6b7a;
  --fg-dim: #94a0b0;
  --border: #e4e8ee;
  --brand: #94C9A9;          /* muted teal — main brand */
  --brand-dark: #4d8b6a;
  --brand-soft: #C6ECAE;     /* tea green — light accent */
  --accent-bg: #f3f7f5;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --max-w: 1040px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);

  /* Redesign semantic tokens (design-pack reskin). The palette A/B swaps
     these per [data-theme]; these :root values are the control fallbacks so
     redesign components still render on the current teal look. */
  --rust: #BC5A3D;            /* CTA / emphasis / low score */
  --gold: #B8923A;            /* caution / mid score */
  --score-high: #2E4A39;      /* score >= 85 */
  --score-mid: #B8923A;       /* score 70-84 */
  --score-low: #BC5A3D;       /* score < 70 */
  --rule: rgba(22, 32, 44, 0.10);        /* hairline divider */
  --rule-strong: rgba(22, 32, 44, 0.18); /* card border / strong divider */
  --hard-shadow: 6px 6px 0 var(--fg);    /* offset shadow, no blur */
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* === Palette A/B variants (served via <html data-theme>) ==================
   Each remaps the same tokens the whole site already uses, so switching the
   theme reskins existing pages coherently and the redesign pages get the
   palette for free. control = no data-theme = the current teal above. */

/* Editorial paper — the pack's recommended default. */
[data-theme="paper"] {
  --bg: #F5F1EA; --bg-soft: #EBE5DA; --bg-card: #FCFAF5;
  --fg: #1A1612; --fg-muted: #3A332C; --fg-dim: #6B6258;
  --border: rgba(26, 22, 18, 0.20);
  --brand: #2E4A39; --brand-dark: #2E4A39; --brand-soft: #DCE5DE;
  --accent-bg: #EDEAE0;
  --rust: #BC5A3D; --gold: #B8923A;
  --score-high: #2E4A39; --score-mid: #B8923A; --score-low: #BC5A3D;
  --rule: rgba(26, 22, 18, 0.10); --rule-strong: rgba(26, 22, 18, 0.20);
  --hard-shadow: 8px 8px 0 var(--fg);
}

/* Whitehall blue — GOV.UK-adjacent, maximum institutional trust. */
[data-theme="whitehall"] {
  --bg: #F4F2EE; --bg-soft: #EAE8E3; --bg-card: #FFFFFF;
  --fg: #0B0C0C; --fg-muted: #383F43; --fg-dim: #626A6E;
  --border: #B1B4B6;
  --brand: #1D70B8; --brand-dark: #1D70B8; --brand-soft: #D2E2F1;
  --accent-bg: #F3F7FB;
  --rust: #D4351C; --gold: #B8923A;
  --score-high: #00703C; --score-mid: #B8923A; --score-low: #D4351C;
  --rule: rgba(11, 12, 12, 0.12); --rule-strong: rgba(11, 12, 12, 0.22);
  --hard-shadow: 6px 6px 0 var(--fg);
}

/* Quiet slate — modern SaaS. */
[data-theme="slate"] {
  --bg: #F6F7F8; --bg-soft: #EDEFF1; --bg-card: #FFFFFF;
  --fg: #0E1014; --fg-muted: #434A54; --fg-dim: #6B7280;
  --border: #E2E5EA;
  --brand: #2D6CDF; --brand-dark: #2D6CDF; --brand-soft: #DBE6FB;
  --accent-bg: #F4F7FE;
  --rust: #E76F51; --gold: #B8923A;
  --score-high: #2D6CDF; --score-mid: #B8923A; --score-low: #E76F51;
  --rule: rgba(14, 16, 20, 0.10); --rule-strong: rgba(14, 16, 20, 0.18);
  --hard-shadow: 6px 6px 0 var(--fg);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.muted { color: var(--fg-muted); }
.small { font-size: 0.875rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Header / nav */
.site-header {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-weight: 600;
  font-size: 1.1rem;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-block;
  width: 28px; height: 28px;
  text-align: center; line-height: 28px;
  color: var(--brand);
  font-size: 1.4rem;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav a {
  color: var(--fg);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: center;
  line-height: 1.2;
}
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); }
.btn-block { display: block; width: 100%; }

/* Hero */
.hero {
  padding: 72px 0 56px;
  background: linear-gradient(180deg, var(--accent-bg) 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin: 0 0 18px;
  max-width: 22ch;
}
.lede {
  font-size: 1.2rem;
  color: var(--fg-muted);
  max-width: 58ch;
  margin: 0 0 28px;
}
.cta-row {
  display: flex;
  gap: 12px;
  margin: 28px 0 14px;
  flex-wrap: wrap;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 64px 24px;
}
.feature h3 { font-size: 1.15rem; margin: 8px 0 8px; }
.feature p { color: var(--fg-muted); margin: 0; }
.feature-num {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}

/* How */
.how { padding: 56px 24px; }
.how h2 { font-size: 1.8rem; margin: 0 0 24px; }
.how-steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 20px;
}
.how-steps li {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 20px 24px;
  counter-increment: step;
  position: relative;
  padding-left: 64px;
}
.how-steps li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 18px;
  background: var(--brand);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Trust */
.trust { padding: 56px 24px 96px; }
.trust h2 { font-size: 1.8rem; margin: 0 0 16px; }
.trust p { color: var(--fg-muted); max-width: 65ch; }
.trust-list { color: var(--fg-muted); padding-left: 20px; }

/* Pricing */
.pricing-hero {
  text-align: center;
  padding: 64px 24px 32px;
}
.pricing-hero h1 { font-size: 2.2rem; margin: 0 0 12px; }
.pricing-hero .lede { margin: 0 auto 24px; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 24px 24px 64px;
}
.plan {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.plan h3 { margin: 0 0 12px; font-size: 1.25rem; }
.plan-featured {
  border-color: var(--brand);
  border-width: 2px;
  transform: translateY(-6px);
}
.plan-badge {
  position: absolute;
  top: -12px; right: 16px;
  background: var(--brand);
  color: #fff;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.plan-price { margin: 4px 0 16px; }
.plan-price .amount {
  font-size: 2.4rem;
  font-weight: 700;
}
.plan-price .period { color: var(--fg-muted); }
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  flex: 1;
}
.plan-features li {
  padding: 6px 0 6px 26px;
  color: var(--fg);
  position: relative;
}
.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}
.plan-form input[type=email] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  margin-bottom: 10px;
  font-family: inherit;
}
.plan-form input[type=email]:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: var(--brand);
}
.plan-note { margin: 12px 0 0; text-align: center; }

/* FAQ */
.faq { padding: 48px 24px 80px; max-width: 760px; }
.faq h2 { font-size: 1.6rem; margin: 0 0 24px; }
.faq-item { margin-bottom: 22px; }
.faq-item h4 { margin: 0 0 6px; font-size: 1.05rem; }
.faq-item p { margin: 0; color: var(--fg-muted); }

/* Legal pages */
.legal {
  max-width: 760px;
  padding: 56px 24px 96px;
}
.legal h1 { font-size: 2rem; margin: 0 0 8px; }
.legal h2 { font-size: 1.25rem; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--fg); }
.legal ul { padding-left: 22px; }

/* Contact */
.contact-card {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0 32px;
}
.contact-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.contact-row:last-child { border-bottom: 0; }
.contact-label { color: var(--fg-muted); font-weight: 600; }

/* Status pages (success / cancel) */
.status-page {
  max-width: 640px;
  padding: 96px 24px;
  text-align: center;
}
.status-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0 auto 18px;
}
.status-ok {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.status-cancel {
  background: var(--bg-soft);
  color: var(--fg-muted);
}
.status-page h1 { font-size: 2rem; margin: 8px 0 12px; }
.status-page .cta-row { justify-content: center; }

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin: 20px 0;
}
.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 48px 0 24px;
  margin-top: 64px;
}
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.footer-cols a {
  display: block;
  padding: 4px 0;
  color: var(--fg);
}
.footer-cols a:hover { color: var(--brand-dark); }
.footer-brand { font-weight: 600; margin-bottom: 4px; }
.footer-heading {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* Mobile */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 2rem; }
  .features { grid-template-columns: 1fr; padding: 48px 24px; gap: 28px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-featured { transform: none; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .site-nav { gap: 14px; }
  .site-nav a:not(.btn) { display: none; }
}

/* ============================================================ */
/* Account / subscriber dashboard                                */
/* ============================================================ */

.account-section { padding: 48px 0 80px; }
.account-header { align-items: flex-end; margin-bottom: 28px; flex-wrap: wrap; }
.account-header h1 { margin: 0 0 6px 0; font-size: 1.75rem; }

.profile-list { list-style: none; padding: 0; margin: 0 0 32px; }
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.profile-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.profile-card-head h2 { margin: 0; font-size: 1.15rem; }
.profile-cap {
  margin: 8px 0;
  font-size: 0.95rem;
  line-height: 1.5;
}
.profile-meta { margin-bottom: 14px; }
.profile-actions { display: flex; gap: 8px; }
.profile-actions .inline-form { display: inline; }

.account-side {
  margin-top: 32px;
  padding: 18px 22px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.account-side .h3 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.account-side-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.account-side-list a { color: var(--fg); }
.account-side-list a:hover { color: var(--brand-dark); }

/* Login / logout nav helper */
.nav-inline-form { display: inline; }
.link-button {
  background: none; border: none; padding: 0;
  font: inherit; color: inherit; cursor: pointer;
}
.link-button:hover { color: var(--brand-dark); }

/* Form layout */
.account-form-wrap { max-width: 720px; }
.account-form { margin-top: 20px; }
.form-row { margin-bottom: 22px; }
.form-row-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-row label, .form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.form-sublabel {
  display: block;
  font-weight: 500;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=number],
.form-row textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
}
.form-row textarea { resize: vertical; min-height: 88px; }
.form-row input:focus, .form-row textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
.form-hint {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 4px 0 8px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 14px;
}
.checkbox-grid-tight {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 12px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
}
.radio-row {
  display: flex; gap: 18px; flex-wrap: wrap;
}
.radio-row label {
  font-weight: 400;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
}

.form-disclose {
  margin: 28px 0;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.form-disclose > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-dark);
  padding: 4px 0;
  list-style-position: outside;
}
.form-disclose > summary:hover { text-decoration: underline; }
.form-disclose[open] > summary { margin-bottom: 16px; }

.form-actions {
  display: flex; gap: 10px; align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.alert {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.alert ul { margin: 0; padding-left: 22px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-warn  { background: #fff7ed; color: #9a3412; }
.alert-ok    { background: var(--accent-bg); color: var(--brand-dark); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger-bg); }

.account-login { max-width: 480px; }

@media (max-width: 720px) {
  .form-row-pair { grid-template-columns: 1fr; }
  .checkbox-grid, .checkbox-grid-tight { grid-template-columns: 1fr 1fr; }
  .account-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* Form required-field marker — small asterisk in brand colour. */
.required-mark {
  color: var(--brand-dark);
  font-weight: 700;
  margin-left: 2px;
}

/* ============================================================ */
/* Try-it (sample digest) page                                   */
/* ============================================================ */

.try-it {
  max-width: 720px;
  padding: 56px 24px 80px;
}
.try-it h1 { font-size: 2rem; margin: 0 0 12px; }
.try-it .lede { margin-bottom: 32px; }
.try-it-form { margin-top: 24px; }

.sample-picker {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
}
.sample-picker legend {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
  padding: 0;
}
/* Sample picker — radio is visually hidden and placed BEFORE its
   label so we can drive the card's selected state with the
   adjacent-sibling selector `input:checked + label`. That selector
   has worked everywhere since the 90s; :has() is added as belt-and-
   braces for completeness but the sibling form is what actually
   ensures the selected-state styles persist after click. */
.sample-option {
  display: block;
  cursor: pointer;
  margin-bottom: 10px;
}
.sample-option-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  background: var(--bg);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.sample-option:hover .sample-option-card {
  border-color: var(--brand);
  background: var(--bg-soft);
}
/* Selected — primary path (sibling) and modern :has() fallback.
   Brand-dark border is the unmistakable signal; the background stays
   the same soft grey as the hover state. Brand-palette tints are
   reserved for content states (digest section strips, score pills)
   rather than form-picker chrome. */
.sample-radio:checked + .sample-option .sample-option-card,
.sample-option:has(.sample-radio:checked) .sample-option-card {
  border-color: var(--brand-dark);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}
.sample-option-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sample-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  line-height: 1.3;
}
.sample-pitch {
  font-size: 0.92rem;
  color: var(--fg-muted);
  line-height: 1.4;
}
.sample-option-toggle {
  font-size: 0.82rem;
  color: var(--brand-dark);
  margin-top: 2px;
}
/* When selected, the toggle should read like "additional info below" */
.sample-radio:checked + .sample-option .sample-option-toggle,
.sample-option:has(.sample-radio:checked) .sample-option-toggle {
  visibility: hidden;
}

/* Capability text revealed when the option is selected. Hidden by
   default so the picker stays scannable. When shown, paragraphs sit
   slightly indented and use a smaller, lighter type than the head. */
.sample-option-full {
  display: none;
  margin-top: 14px;
  padding: 14px 0 4px 14px;
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  margin-left: 2px;
}
.sample-option-full p {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0 0 10px 0;
}
.sample-option-full p:last-child { margin-bottom: 0; }
.sample-radio:checked + .sample-option .sample-option-full,
.sample-option:has(.sample-radio:checked) .sample-option-full {
  display: block;
}

/* ---- admin (operator-only /admin) -------------------------------------- */
.container.narrow { max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 16px; max-width: 420px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--bg-soft);
}
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--fg); line-height: 1.1; }
.stat-label { font-size: 0.85rem; color: var(--fg-muted); margin-top: 2px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--fg-muted); font-weight: 600; }
.admin-table tbody tr:hover { background: var(--bg-soft); }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-ok { background: var(--brand-soft); color: var(--brand-dark); }
.badge-muted { background: var(--bg-soft); color: var(--fg-muted); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0; }
.kv dt { color: var(--fg-muted); font-size: 0.9rem; }
.kv dd { margin: 0; }

.plain-list { list-style: none; padding: 0; margin: 0 0 16px; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }

.row-form { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.danger-heading { color: var(--danger); margin-top: 36px; }

/* === Redesign signature components (see templates/_components.html) =========
   Square corners, 1px hairlines, hard offset shadows — never soft blur.
   Fonts use --serif/--mono tokens; until the redesign pages load the web
   fonts these fall back to system serif/mono, so components render anywhere. */

/* Lens glyph — the brand mark ◐ */
.lens-glyph {
  display: inline-block;
  width: var(--lens-size, 20px);
  height: var(--lens-size, 20px);
  border-radius: 50%;
  border: 1.5px solid var(--fg);
  background: conic-gradient(var(--fg) 0 50%, transparent 50%);
  vertical-align: middle;
}

/* Score dial — circular SVG ring + tabular number */
.score-dial {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--dial-size, 56px);
  height: var(--dial-size, 56px);
  line-height: 1;
}
.score-dial svg { position: absolute; inset: 0; }
.score-dial__track { stroke: var(--rule-strong); stroke-width: 2; }
.score-dial__arc {
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 600ms ease-out;
}
.score-dial--high .score-dial__arc { stroke: var(--score-high); }
.score-dial--mid  .score-dial__arc { stroke: var(--score-mid); }
.score-dial--low  .score-dial__arc { stroke: var(--score-low); }
.score-dial__num {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: calc(var(--dial-size, 56px) * 0.32);
  color: var(--fg);
}
.score-dial__label {
  font-family: var(--mono);
  font-size: calc(var(--dial-size, 56px) * 0.13);
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  margin-top: 1px;
}
@media (prefers-reduced-motion: reduce) {
  .score-dial__arc { transition: none; }
}

/* Source badge */
.source-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--score-high);
  border: 1px solid var(--rule-strong);
  padding: 3px 7px;
}

/* Segmented control */
.seg { display: inline-flex; border: 1px solid var(--rule-strong); }
.seg__opt {
  position: relative;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 9px 16px;
  cursor: pointer;
  border-right: 1px solid var(--rule-strong);
  color: var(--fg-muted);
}
.seg__opt:last-child { border-right: 0; }
.seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg__opt.is-active { background: var(--fg); color: var(--bg); }

/* Toggle chip */
.chip {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--fg-muted);
  cursor: pointer;
}
.chip.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip__sign { margin-right: 6px; opacity: 0.7; }

/* Tag chip (non-interactive) */
.tag-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--rule);
  padding: 2px 6px;
  margin: 2px 4px 2px 0;
}

/* Tender card */
.tender-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  padding: 20px 22px;
}
.tender-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tender-card__id, .tender-card__deadline {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
}
.tender-card__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.tender-card__summary { color: var(--fg-muted); margin: 0 0 10px; max-width: 60ch; }
.tender-card__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.tender-card__value {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--fg);
}

/* === Redesign home pages (.rd) =============================================
   Scoped wrapper so the editorial visual system — square corners, serif
   display, mono labels, hard offset shadows — never leaks onto control
   pages. Colours come from the active [data-theme] palette. */

.rd { font-family: var(--sans); color: var(--fg); }
.rd ::selection { background: var(--fg); color: var(--bg); }
.rd .wrap { max-width: 1200px; margin: 0 auto; padding: 0 56px; }
.rd section { border: 0; }
.rd h1, .rd h2, .rd h3, .rd .serif { font-family: var(--serif); font-weight: 400; }

/* Eyebrow / mono labels */
.rd-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-muted);
}
.rd-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--score-high);
  box-shadow: 0 0 0 0 var(--score-high); animation: rd-pulse 2.4s infinite;
}
@keyframes rd-pulse {
  0% { box-shadow: 0 0 0 0 rgba(46,74,57,0.4); }
  70% { box-shadow: 0 0 0 7px rgba(46,74,57,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,74,57,0); }
}
@media (prefers-reduced-motion: reduce) { .rd-dot { animation: none; } }

/* Buttons */
.rd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 15px 26px; border: 1px solid var(--fg);
  cursor: pointer; text-decoration: none; background: transparent; color: var(--fg);
}
.rd-btn:hover { text-decoration: none; opacity: 0.9; }
.rd-btn--primary { background: var(--fg); color: var(--bg); }
.rd-btn--rust { background: var(--rust); color: #fff; border-color: var(--rust); }

/* Display headline */
.rd-display {
  font-size: clamp(48px, 7vw, 96px); line-height: 1.02; letter-spacing: -0.025em;
  margin: 18px 0 20px;
}
.rd-display em { font-style: italic; color: var(--score-high); }
.rd-sub { font-size: 18px; line-height: 1.55; color: var(--fg-muted); max-width: 52ch; }
.rd-micro { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--fg-dim); margin-top: 18px; }

/* Hero */
.rd-hero { padding: 72px 0 64px; }
.rd-hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: start; }
.rd-cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* Digest preview card (the framed product on the right of the hero) */
.rd-preview {
  border: 1px solid var(--rule-strong); background: var(--bg-card);
  box-shadow: var(--hard-shadow);
}
.rd-preview__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-dim);
}
.rd-preview__title { padding: 16px 18px 6px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.rd-preview__row { display: grid; grid-template-columns: 1fr auto; gap: 14px;
  padding: 14px 18px; border-top: 1px solid var(--rule); align-items: center; }
.rd-preview__row h4 { font-family: var(--serif); font-weight: 400; font-size: 18px;
  line-height: 1.2; margin: 4px 0 2px; }
.rd-preview__meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--fg-dim); text-transform: uppercase; }
.rd-preview__foot { display: flex; justify-content: space-between; padding: 12px 18px;
  border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); }

/* Generic section rhythm */
.rd-band { padding: 64px 0; border-top: 1px solid var(--rule); }
.rd-band--soft { background: var(--bg-soft); }
.rd-band--ink { background: var(--fg); color: var(--bg); }
.rd-band--ink .rd-display em { color: #7FB186; }
.rd-h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 8px; }
.rd-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-muted); margin-bottom: 12px; }

/* Provenance strip */
.rd-prov { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.rd-prov__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-dim); }

/* Stats strip */
.rd-stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.rd-stat { padding: 8px 24px; border-left: 1px solid var(--rule); }
.rd-stat:first-child { border-left: 0; padding-left: 0; }
.rd-stat__num { font-family: var(--serif); font-size: 56px; line-height: 1;
  font-variant-numeric: tabular-nums; }
.rd-stat__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-muted); margin-top: 8px; }

/* Steps */
.rd-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.rd-step__num { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; color: var(--rust); }
.rd-step h3 { font-size: 24px; margin: 12px 0 8px; border-top: 1px solid var(--rule); padding-top: 14px; }
.rd-step p { color: var(--fg-muted); max-width: 36ch; }

/* Methodology score breakdown */
.rd-method { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.rd-method__panel { border: 1px solid var(--rule-strong); background: var(--bg-card); padding: 28px; }
.rd-signal { margin-bottom: 16px; }
.rd-signal__head { display: flex; justify-content: space-between; font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.04em; color: var(--fg-muted); margin-bottom: 6px; }
.rd-signal__num { color: var(--fg); font-variant-numeric: tabular-nums; }
.rd-bar { height: 8px; background: var(--rule); }
.rd-bar__fill { height: 100%; background: var(--score-high); }
.rd-method__total { display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--rule-strong); margin-top: 8px; padding-top: 14px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }

/* Trust cards (auto-fit so 3 or 4 cards both lay out cleanly) */
.rd-trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.rd-tcard { border: 1px solid var(--rule-strong); padding: 22px; }
.rd-tcard h4 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0 0 6px; }
.rd-tcard p { color: var(--fg-muted); font-size: 14px; margin: 0; }

/* Volume sparkline */
.rd-spark { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.rd-spark__bar { flex: 1; background: var(--score-high); min-height: 4px; opacity: 0.85; }

/* Closing CTA capture */
.rd-capture { display: flex; gap: 0; max-width: 520px; border: 1px solid currentColor; }
.rd-capture input { flex: 1; border: 0; background: transparent; color: inherit;
  font-family: var(--sans); font-size: 16px; padding: 15px 18px; }
.rd-capture input::placeholder { color: currentColor; opacity: 0.55; }
.rd-capture input:focus { outline: none; }

/* Risk-reversal row (conversion home) */
.rd-risk { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 18px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; color: var(--fg-muted); }
.rd-risk span::before { content: "✓ "; color: var(--score-high); }

/* Trust logo bar (typographic placeholders) */
.rd-logos { display: flex; gap: 36px; flex-wrap: wrap; align-items: center; }
.rd-logos span { font-family: var(--serif); font-size: 20px; color: var(--fg-muted); opacity: 0.85; }

/* Problem-agitation numbers */
.rd-agitate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.rd-agitate__num { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--rust); }
.rd-agitate__label { color: var(--fg-muted); margin-top: 10px; max-width: 28ch; }

/* Testimonial + win card */
.rd-testi { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.rd-quote { font-family: var(--serif); font-size: 30px; line-height: 1.25; }
.rd-quote__attr { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-muted); margin-top: 18px; }
.rd-win { border: 1px solid var(--rule-strong); box-shadow: var(--hard-shadow);
  background: var(--bg-card); padding: 24px; }
.rd-win__label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-dim); }

/* Cost comparison table */
.rd-table { width: 100%; border-collapse: collapse; }
.rd-table th, .rd-table td { text-align: left; padding: 14px 18px; border-top: 1px solid var(--rule);
  font-size: 15px; }
.rd-table thead th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-muted); border-top: 0; }
.rd-table .rd-col-ink { background: var(--fg); color: var(--bg); }
.rd-table .rd-col-ink-h { background: var(--fg); color: var(--bg); }

/* FAQ */
.rd-faq { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
.rd-faq h4 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0 0 8px; }
.rd-faq p { color: var(--fg-muted); margin: 0; max-width: 48ch; }

/* Sticky CTA bar + exit-intent (boosters; hidden by default, shown by flag) */
.rd-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--fg); color: var(--bg);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 12px 20px;
}
.rd-sticky .rd-pill { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--score-high); color: #fff; padding: 4px 9px; }

/* Try-it page */
.rd-try-stats { display: flex; gap: 40px; margin-top: 28px; flex-wrap: wrap; }
.rd-try-stats .rd-stat__num { font-family: var(--serif); font-size: 40px; line-height: 1; }
.rd-persona-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.rd-persona {
  display: block; border: 1px solid var(--rule-strong); background: var(--bg-card);
  padding: 18px 18px 16px; cursor: pointer; height: 100%;
}
.rd-persona:hover { border-color: var(--fg-muted); }
.rd-persona__name { display: block; font-family: var(--serif); font-size: 20px; line-height: 1.15; }
.rd-persona__pitch { display: block; color: var(--fg-muted); font-size: 14px; margin: 6px 0 10px; }
.rd-persona__tags { display: block; margin-bottom: 8px; }
.rd-persona__regions { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-dim); }
.rd-persona-radio:checked + .rd-persona { border-color: var(--fg); box-shadow: var(--hard-shadow); }
.rd-persona-radio:focus-visible + .rd-persona { outline: 2px solid var(--fg); outline-offset: 2px; }
.rd-try-send { display: flex; gap: 0; margin-top: 14px; max-width: 620px; border: 1px solid var(--fg); }
.rd-try-email { flex: 1; border: 0; background: transparent; color: var(--fg);
  font-family: var(--sans); font-size: 16px; padding: 15px 18px; }
.rd-try-email:focus { outline: none; }
.rd-error { border: 1px solid var(--rust); color: var(--rust); padding: 12px 16px;
  font-family: var(--mono); font-size: 13px; margin-bottom: 20px; }

/* Pricing page (P2) */
.rd-hero--narrow { padding: 64px 0 40px; }
.rd-hero--narrow .rd-display { font-size: clamp(40px, 5.5vw, 72px); }

/* Billing-period segmented control (annual segment stubbed-disabled) */
.rd-billing { display: inline-flex; margin: 28px 0 0; border: 1px solid var(--fg); }
.rd-seg {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 11px 20px; background: transparent;
  color: var(--fg); border: 0; cursor: pointer;
}
.rd-seg + .rd-seg { border-left: 1px solid var(--fg); }
.rd-seg.is-active { background: var(--fg); color: var(--bg); }
.rd-seg.is-disabled { color: var(--fg-dim); cursor: not-allowed; }
.rd-seg__tag { font-size: 10px; opacity: 0.8; margin-left: 6px; }

/* Plan cards */
.rd-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.rd-plan {
  position: relative; border: 1px solid var(--rule-strong); background: var(--bg-card);
  padding: 30px 26px; display: flex; flex-direction: column; height: 100%;
}
.rd-plan--featured { border-color: var(--fg); box-shadow: var(--hard-shadow); }
.rd-plan__badge {
  position: absolute; top: -1px; right: -1px; background: var(--fg); color: var(--bg);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 5px 10px;
}
.rd-plan__name { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 6px; }
.rd-plan__price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 18px; }
.rd-plan__amount { font-family: var(--serif); font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.rd-plan__period { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); text-transform: uppercase; }
.rd-plan__features { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; }
.rd-plan__features li { font-size: 15px; color: var(--fg-muted); padding-left: 20px; position: relative; }
.rd-plan__features li::before { content: "\2713"; position: absolute; left: 0; color: var(--score-high); }
.rd-plan__features strong { color: var(--fg); }
.rd-plan__form { margin-top: auto; display: grid; gap: 10px; }
.rd-plan__form input[type=email] {
  border: 1px solid var(--rule-strong); background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 15px; padding: 12px 14px;
}
.rd-plan__form input[type=email]:focus { outline: none; border-color: var(--fg); }
.rd-btn--block { display: flex; justify-content: center; width: 100%; }

/* Comparison table */
.rd-compare-wrap { overflow-x: auto; margin: 32px 0 8px; }
.rd-compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.rd-compare th, .rd-compare td {
  text-align: center; padding: 13px 16px; border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.rd-compare thead th { font-family: var(--serif); font-weight: 400; font-size: 19px; border-bottom: 1px solid var(--rule-strong); }
.rd-compare tbody th[scope=row], .rd-compare th[scope=col]:first-child { text-align: left; }
.rd-compare tbody th { font-weight: 600; color: var(--fg); }
.rd-compare td { color: var(--fg-muted); }
.rd-compare__price { display: block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--fg-dim); margin-top: 3px; }

@media (max-width: 900px) {
  .rd .wrap { padding: 0 22px; }
  .rd-hero__grid, .rd-method, .rd-testi { grid-template-columns: 1fr; gap: 36px; }
  .rd-steps, .rd-trust, .rd-agitate, .rd-faq { grid-template-columns: 1fr; gap: 28px; }
  .rd-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .rd-stat { border-left: 0; padding: 0; }
  .rd-persona-grid { grid-template-columns: 1fr; }
  .rd-try-send { flex-direction: column; }
  .rd-plans { grid-template-columns: 1fr; }
}
