/* ==========================================================================
   FinanceSimply — "Terminal" design system
   Ported from the Claude Design handoff (design_handoff_financesimply).
   Monochrome, hairline-ruled, data-forward. No accent hue anywhere:
   emphasis comes from inversion (white-on-ink) and border weight, never colour.

   NOTE: this file is linked LAST in <head> so it wins over the per-page
   <style> blocks that the legacy pages still carry.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */

:root,
[data-theme="light"] {
  /* Terminal palette */
  --pa: #ffffff;
  --pa2: #f5f5f5;
  --card: #ffffff;
  --ink: #0a0a0a;
  --ink2: #585858;
  --mute: #8a8a8a;
  --ru: #e7e7e7;
  --ru2: #d8d8d8;
  --shadow: 0 12px 34px rgba(0, 0, 0, .09);
  --shadow-hard: 12px 12px 0 var(--ink);
  --rule-invert: rgba(255, 255, 255, .18);

  /* Legacy aliases — keep the legacy pages' inline <style> blocks on-palette */
  --bg: var(--pa);
  --text: var(--ink);
  --muted: var(--ink2);
  --border: var(--ru);
  --primary: var(--ink);
  --primary-hover: var(--ink);
  --surface: var(--pa2);
  --pill-bg: var(--pa2);
  --card-bg: var(--card);
  --success: var(--ink);
  --success-bg: var(--pa2);
  --error: var(--ink);
  --error-bg: var(--pa2);
}

[data-theme="dark"] {
  --pa: #0a0a0a;
  --pa2: #151515;
  --card: #121212;
  --ink: #fafafa;
  --ink2: #a0a0a0;
  --mute: #6a6a6a;
  --ru: #242424;
  --ru2: #333333;
  --shadow: 0 12px 34px rgba(0, 0, 0, .5);
  --shadow-hard: 12px 12px 0 var(--ink);
  --rule-invert: rgba(0, 0, 0, .22);
}

:root {
  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-h1: clamp(38px, 7vw, 64px);
  --text-h2: clamp(28px, 4.5vw, 40px);
  --text-h3: clamp(20px, 2.6vw, 24px);
  --text-page-title: clamp(32px, 6vw, 52px);
  --text-lead: clamp(16px, 2.2vw, 18px);
  --text-body: 15px;
  --text-mono: 12px;
  --text-mono-sm: 11px;
  --text-mono-xs: 10px;

  /* Layout */
  --measure: 1180px;
  --measure-narrow: 820px;
  --gutter: clamp(16px, 4vw, 36px);
  --section-y: clamp(48px, 7vw, 80px);

  /* Radii — deliberately tight */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--pa);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* full-bleed chrome uses 50vw margins */
}

img, svg { display: block; max-width: 100%; }
input, textarea, select, button { font: inherit; }

a { color: var(--ink); text-decoration: none; transition: opacity .2s var(--ease); }
a:hover { opacity: .72; }

::selection { background: var(--ink); color: var(--pa); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink);
}
/* .98 clips: Space Grotesk's lining figures descend below the baseline, so a
   headline that wraps after a digit ("…in 3 / minutes.") collides with the
   next line. 1.05 keeps the leading tight without the overlap. */
h1 { font-size: var(--text-h1); line-height: 1.05; letter-spacing: -.03em; }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

p { line-height: 1.6; }
b, strong { font-weight: 700; }
hr { border: none; border-top: 1px solid var(--ru); margin: 32px 0; }

summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 300;
  background: var(--ink);
  color: var(--pa);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.skip-link:focus { left: 12px; opacity: 1; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. LAYOUT PRIMITIVES  (from tokens/layout.css)
   -------------------------------------------------------------------------- */

.wrapper,
.fs-wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  width: 100%;
}

/* Global chrome and banded sections break out of the wrapper to span the
   viewport. Margins (not transform) so the sticky header keeps working. */
.wrapper .fs-ticker,
.wrapper .header,
.wrapper .footer,
.wrapper .fs-premium,
.wrapper .fs-band {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* The wrapper already supplies the gutter — nested containers must not double it */
.wrapper .legal-content,
.wrapper .page-wrap,
.wrapper .calc-wrap,
.wrapper .survey-wrap,
.wrapper .thanks-wrap,
.wrapper .author-section,
.wrapper .hero,
.wrapper .fs-wrap,
.wrapper .fs-stats {
  padding-left: 0;
  padding-right: 0;
}

/* …but inside a full-bleed band the gutter has to come back */
.wrapper .fs-band .fs-wrap,
.wrapper .fs-band .fs-stats {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Pages whose content isn't already in a self-padding container still need to
   clear the sticky header. Containers that pad themselves opt back out. */
.wrapper > main { padding-top: var(--section-y); }
.wrapper > main:has(> .hero:first-child),
.wrapper > main:has(> .legal-content:first-child),
.wrapper > main:has(> .page-wrap:first-child),
.wrapper > main.fs-section { padding-top: 0; }

.fs-wrap-narrow { max-width: var(--measure-narrow); margin: 0 auto; }
.fs-section { padding: var(--section-y) 0; }
.fs-band { background: var(--pa2); border-top: 1px solid var(--ru); border-bottom: 1px solid var(--ru); }

.fs-navd { display: none; }
.fs-navm { display: inline-flex; }
.fs-hero { display: grid; grid-template-columns: 1fr; gap: 36px; }
.fs-stats { display: grid; grid-template-columns: repeat(2, 1fr); }
.fs-g3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.fs-prem { display: grid; grid-template-columns: 1fr; gap: 26px; }
.fs-cmp { display: grid; grid-template-columns: 1fr; gap: 18px; }
.fs-foot { display: grid; grid-template-columns: 1fr; gap: 32px; }

/* Breakpoint ladder. 600 = large phone landscape / small tablet portrait,
   780 = tablet portrait (iPad 768, iPad Air 820), 860 = the full desktop
   layout. Without the 600/780 rungs a tablet gets the phone layout, which on
   a 768px screen means single-column cards ~700px wide. */
@media (min-width: 600px) {
  .fs-stats { grid-template-columns: repeat(4, 1fr); }
  .fs-g3 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .fs-cmp { grid-template-columns: 1fr 1fr; gap: 20px; }
  .fs-foot { grid-template-columns: 1fr 1fr; gap: 32px 40px; }
}

/* 768 is iPad portrait, and the full nav does fit there — but only once the
   inter-item gap is pulled in. Measured: brand 168 + nav 515 + 16 = 699 against
   707 available, which is too little slack for a font fallback to eat. */
@media (min-width: 768px) {
  .fs-navd { display: flex; }
  .fs-navm { display: none; }
  .fs-prem { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 768px) and (max-width: 899px) {
  .nav-buttons { gap: 15px; font-size: 13.5px; }
  .fs-nav-cta { padding: 9px 12px; }
}

@media (min-width: 860px) {
  .fs-hero { grid-template-columns: 1.06fr .94fr; gap: 56px; align-items: center; }
  .fs-g3 { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .fs-cmp { grid-template-columns: 1fr 1fr; gap: 24px; }
  .fs-foot { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
}

@keyframes fs-marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes fs-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   4. CORE COMPONENTS
   -------------------------------------------------------------------------- */

/* Eyebrow — "◆ LABEL" */
.fs-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-bottom: 10px;
}

/* Status pill — the ONE pill-radius element in the brand */
.fs-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink2);
  border: 1px solid var(--ru2);
  border-radius: 100px;
  padding: 6px 12px;
}
.fs-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

/* Bracketed category tag */
.fs-tag {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink2);
}

/* Mono text link with rule underline */
.fs-link {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
  white-space: nowrap;
}

/* Section heading block */
.fs-headrow {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.fs-headrow h2 { margin: 0; }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h2);
  letter-spacing: -.02em;
  margin: 0 0 26px;
}

/* Buttons — the only button in the system */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .2s var(--ease);
}
.btn:hover { opacity: .72; }

.btn-primary,
.submit-btn,
.survey-submit,
.premium-banner-btn {
  background: var(--ink);
  color: var(--pa);
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 12px 18px;
  font-size: 13px;
  transition: opacity .2s var(--ease);
}
.btn-primary:hover, .submit-btn:hover, .survey-submit:hover { opacity: .72; }

.btn-outline,
.btn-secondary,
.btn-gold {
  background: none;
  color: var(--ink);
  border: 1px solid var(--ru2);
}

.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--ink2);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
  padding: 8px 4px;
}

.btn-sm { padding: 8px 12px; font-size: 11px; }
.btn-lg { padding: 15px 24px; font-size: 14px; }
.btn-block, .btn.full { width: 100%; }

.btn:disabled, .btn-loading { opacity: .45; cursor: default; pointer-events: none; }

/* Logo lockup */
.brand,
.logo,
.preview-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.02em;
  color: var(--ink);
}
.brand .italic, .logo .italic { font-style: normal; }
.logo-font { font-family: var(--font-display); letter-spacing: -.02em; }

.fs-monogram {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  background: var(--ink);
  color: var(--pa);
  padding: 5px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0;
}

/* Theme toggle — mono glyph, not an SVG icon */
.theme-toggle {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  border: 1px solid var(--ru2);
  border-radius: var(--radius-xs);
  padding: 6px 9px;
  color: var(--ink2);
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  transition: opacity .2s var(--ease);
}
.theme-toggle:hover { opacity: .72; }
.theme-toggle .sun, .theme-toggle .moon { display: none; }
.theme-toggle::after { content: "◐"; font-size: 13px; }
[data-theme="dark"] .theme-toggle::after { content: "◑"; }

/* --------------------------------------------------------------------------
   5. CHROME — ticker, header, mobile menu, footer
   -------------------------------------------------------------------------- */

.fs-ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--ru);
  background: var(--pa);
}
.fs-ticker__track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: fs-marq 90s linear infinite;
}
.fs-ticker__group { display: inline-flex; }
.fs-ticker__item {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .08em;
  color: var(--ink2);
  padding: 8px 0;
}
.fs-ticker__sep { margin: 0 18px; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .fs-ticker__track { animation: none; }
}

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--pa);
  border-bottom: 1px solid var(--ru);
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
}
.header__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-buttons {
  align-items: center;
  gap: clamp(18px, 2.4vw, 32px);
  font-size: 14px;
  font-weight: 500;
}
.nav-buttons a { color: var(--ink); position: relative; padding: 4px 0; }
.nav-buttons .btn-outline,
.nav-buttons .btn-ghost { border: none; padding: 4px 0; color: var(--ink2); }
.nav-buttons a.fs-nav-cta { color: var(--pa); padding: 10px 15px; }

/* Active page marker — a 2px ink rule, never a colour change */
.nav-buttons a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--ink);
}

.fs-navrule { width: 1px; height: 16px; background: var(--ru2); display: inline-block; }

.fs-nav-cta {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-mono);
  letter-spacing: .02em;
  background: var(--ink);
  color: var(--pa);
  padding: 10px 15px;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

/* "More" dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink2);
  font-size: 14px;
  font-weight: 500;
  padding: 4px 0;
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 170px;
  background: var(--card);
  border: 1px solid var(--ru2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  z-index: 80;
}
.nav-dropdown-menu a {
  padding: 9px 11px;
  font-size: 14px;
  color: var(--ink2);
  border-radius: var(--radius-xs);
}
.nav-dropdown-menu a:hover { background: var(--pa2); opacity: 1; }

/* Burger */
.fs-burger {
  border: 1px solid var(--ru2);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fs-burger span { width: 18px; height: 2px; background: var(--ink); display: block; }

/* Mobile sheet */
.fs-mobile {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--pa);
  animation: fs-fade .2s ease;
  overflow-y: auto;
}
.fs-mobile[hidden] { display: none; }
.fs-mobile__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--ru);
}
.fs-mobile__close {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
  padding: 4px 8px;
}
.fs-mobile__nav { display: flex; flex-direction: column; padding: 8px var(--gutter) 32px; }
.fs-mobile__nav a:not(.fs-mobile__cta) {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -.02em;
  padding: 16px 0;
  border-bottom: 1px solid var(--ru);
  color: var(--ink);
}
.fs-mobile__cta {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  background: var(--ink);
  color: var(--pa);
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: none;
  cursor: pointer;
  display: block;
}

/* Footer */
.footer {
  border-top: 1px solid var(--ru);
  background: var(--pa);
  margin-top: var(--section-y);
  padding: 0;
  max-width: none;
  display: block;
  font-size: 14px;
}
.footer__grid {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 56px) var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 600px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px 40px; }
}
@media (min-width: 860px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
}
.footer__blurb {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink2);
  margin: 14px 0 16px;
  max-width: 340px;
}
.footer__coltitle {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 14px;
}
.footer__links { display: flex; flex-direction: column; gap: 11px; font-size: 14px; }
.footer__links a { color: var(--ink2); }

.footer__legal,
.legal-footer,
.guide-disclaimer,
.calc-disclaimer,
.tools-disclaimer,
.guides-disclaimer,
.author-disclaimer,
.fine-print {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--mute);
  border-top: 1px solid var(--ru);
  padding: 14px 0 0;
  background: none;
  border-radius: 0;
  margin: 14px 0 0;
}
.footer__legal b, .legal-footer b, .guide-disclaimer b,
.footer__legal strong, .legal-footer strong, .guide-disclaimer strong { color: var(--ink2); }
.footer__legal { max-width: 360px; }

.footer__base {
  border-top: 1px solid var(--ru);
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--mute);
}
.footer__base > div {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   6. HOME — hero, brief preview, stats, rail, premium band
   -------------------------------------------------------------------------- */

.hero {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter);
  text-align: left;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h1);
  line-height: 1.05;
  letter-spacing: -.03em;
  margin: 0 0 20px;
}
.hero-subtitle, .hero-sub {
  font-size: var(--text-lead);
  line-height: 1.55;
  color: var(--ink2);
  margin: 0 0 30px;
  max-width: 460px;
}

/* Subscribe form — 1.5px ink rule, mono input */
.hero-form, .fs-subscribe {
  display: flex;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 460px;
  background: var(--pa);
}
.hero-input,
.fs-subscribe input[type="email"] {
  flex: 1;
  min-width: 0;
  width: auto;
  border: none;
  border-radius: 0;
  padding: 15px 16px;
  font-size: 15px;
  font-family: var(--font-mono);
  outline: none;
  background: var(--pa);
  color: var(--ink);
}
.hero-input::placeholder, .fs-subscribe input::placeholder { color: var(--mute); }
.hero-form .btn, .fs-subscribe button {
  background: var(--ink);
  color: var(--pa);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  padding: 15px 20px;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  border-radius: 0;
}
.hero-caption {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .04em;
  color: var(--ink2);
  margin: 14px 0 0;
}
.hero-message, .pricing-message, .premium-message, .message {
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink2);
  max-width: 460px;
}
.hero-message.success, .success { color: var(--ink); font-weight: 600; }
.hero-message.error, .error, .field-error, .survey-error { color: var(--ink); font-weight: 600; }
.field-error, .survey-error { font-family: var(--font-mono); font-size: 12px; }

/* Visibility contract used by login-form.js, set-password.js and
   subscribe-page.js: hidden until the script adds .show (or sets display). */
.field-error, .survey-error { display: none; margin-top: 6px; }
.field-error.show, .survey-error.show { display: block; }

.alert {
  display: none;
  text-align: center;
  margin-bottom: 20px;
}
.alert.show { display: block; }

/* subscribe.html status blocks — the script flips display inline */
#msg-success, #msg-error, #msg-already { display: none; }

.fs-success {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fs-success__mark {
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--ink);
  color: var(--pa);
  padding: 4px 7px;
  border-radius: var(--radius-xs);
  font-size: 12px;
}

/* BriefPreview — the only user of --shadow-hard */
.fs-brief {
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-hard);
  background: var(--card);
}
.fs-brief__bar {
  background: var(--ink);
  color: var(--pa);
  padding: 13px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .06em;
}
.fs-brief__body { padding: 6px 18px 16px; background: var(--card); }
.fs-brief__meta {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .08em;
  color: var(--ink2);
  padding: 14px 0;
  border-bottom: 1px solid var(--ru);
}
.fs-brief__story { padding: 14px 0; border-bottom: 1px solid var(--ru); }
.fs-brief__story:last-child { border-bottom: none; }
.fs-brief__tag {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  color: var(--ink2);
  margin-bottom: 5px;
}
.fs-brief__h { font-weight: 600; font-size: 15px; letter-spacing: -.01em; margin-bottom: 3px; }
.fs-brief__b { font-size: 13px; color: var(--ink2); line-height: 1.45; }

/* Stat band */
.fs-stats { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.fs-stat { padding: 26px 20px; border-right: 1px solid var(--ru); }
.fs-stat:last-child { border-right: none; }
.fs-stat__n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 32px);
  letter-spacing: -.02em;
}
.fs-stat__l {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-top: 4px;
}

/* Issue rail — horizontal scroll, never a grid */
.fs-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  margin: 0 calc(-1 * var(--gutter));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  scrollbar-width: thin;
}
.fs-issue {
  scroll-snap-align: start;
  flex: 0 0 300px;
  border: 1px solid var(--ru);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card);
}
.fs-issue__bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ru);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .06em;
  color: var(--ink2);
}
.fs-issue__body { padding: 18px 16px; }
.fs-issue__h {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 8px 0;
}
.fs-issue__b { font-size: 13px; color: var(--ink2); line-height: 1.5; }

/* Premium band — the only inverted section on a page */
.fs-premium,
.premium-section {
  background: var(--ink);
  color: var(--pa);
  border-radius: 0;
  border: none;
  padding: 0;
  text-align: left;
  margin: 0;
}
.fs-premium__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(44px, 6vw, 64px) var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}
@media (min-width: 780px) {
  .fs-premium__inner { grid-template-columns: 1fr auto; align-items: center; }
}
.fs-premium__eyebrow, .premium-badge {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: 12px;
}
.fs-premium h2, .premium-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 38px);
  letter-spacing: -.02em;
  margin: 0 0 12px;
  color: var(--pa);
}
.fs-premium p, .premium-text {
  font-size: 15px;
  opacity: .72;
  margin: 0 0 20px;
  max-width: 540px;
  color: var(--pa);
}
.fs-premium__feats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  opacity: .85;
}
.premium-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -.03em;
  color: var(--pa);
  margin: 0 0 18px;
}
/* Inverse button — sits on the ink band */
.fs-premium .btn,
.premium-section .btn,
.btn-inverse {
  border: 1.5px solid var(--pa);
  color: var(--pa);
  background: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  padding: 15px 26px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Premium banner (dashboard/archive strip) */
.premium-banner {
  background: var(--ink);
  color: var(--pa);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.premium-banner-icon { display: none; }
/* Headings carry an explicit ink colour from the base rules, so every text
   node on this inverted band has to be flipped back. */
.premium-banner h1, .premium-banner h2, .premium-banner h3,
.premium-banner h4, .premium-banner p, .premium-banner span,
.premium-banner div, .premium-banner li { color: var(--pa); }
.premium-banner-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.02em;
}
.premium-banner-info { font-size: 14px; opacity: .72; }
.premium-banner .premium-banner-btn { background: var(--pa); color: var(--ink); border: none; }

/* --------------------------------------------------------------------------
   7. CARDS — guides, tools, features
   -------------------------------------------------------------------------- */

.card,
.guide-card,
.tool-card,
.newsletter-card,
.form-card,
.calc-card,
.survey-card,
.preview-card {
  border: 1px solid var(--ru);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: none;
  padding: 22px;
  display: block;
  color: var(--ink);
}

.guide-card, .tool-card { display: flex; flex-direction: column; }
.guide-card:hover, .tool-card:hover, .card-link:hover { opacity: .72; }

/* The design gives the card a deliberate gap between the mono tag and the
   title, so the tile reads as label-then-headline rather than a stacked list. */
.guide-card > .fs-tag, .tool-card > .fs-tag { margin-bottom: 26px; }
.guide-card .card-meta, .tool-card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Legacy emoji icons are out of the system — mono glyphs only */
.guide-card-icon, .tool-card-icon, .feature-icon, .empty-icon, .archive-empty-icon { display: none; }

.guide-card-title, .tool-card-title, .card-title, .feature-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -.02em;
  line-height: 1.12;
  margin: 0 0 10px;
  color: var(--ink);
}
.guide-card-desc, .tool-card-desc, .card-text, .card-content {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink2);
  margin: 0;
}
.card-meta {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--ink2);
  margin-top: auto;
  padding-top: 14px;
}
/* .soon sits on the card itself — style only the badge, or the whole tile
   turns mono. */
.tool-card-soon {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink2);
  border: 1px solid var(--ru2);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  background: none;
  display: inline-block;
  margin-bottom: 20px;
}
.tool-card.soon { opacity: .55; pointer-events: none; }

.guides-grid, .tools-grid, .newsletters-grid, .features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  .guides-grid, .tools-grid, .newsletters-grid, .features { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (min-width: 860px) {
  .guides-grid, .tools-grid, .newsletters-grid, .features { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}

.features > div {
  border: 1px solid var(--ru);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink2);
}

/* Filter chips */
.filter-tabs, .toggle-group, .controls-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--ru);
  padding-top: 20px;
  margin-bottom: 22px;
}
.filter-btn, .toggle-btn, .sort-btn, .pagination-btn {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--ru2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  background: none;
  color: var(--ink2);
  transition: opacity .2s var(--ease);
}
.filter-btn:hover, .toggle-btn:hover, .sort-btn:hover { opacity: .72; }
.filter-btn.active, .toggle-btn.active, .sort-btn.active {
  background: var(--ink);
  color: var(--pa);
  border-color: var(--ink);
}

/* Segmented control (pricing monthly/annual) */
.fs-seg {
  display: inline-flex;
  border: 1px solid var(--ru2);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.fs-seg button {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 14px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink2);
}
.fs-seg button.active { background: var(--ink); color: var(--pa); }

/* Guides carousel (embla) on the homepage */
.gc-outer { position: relative; display: flex; align-items: center; gap: 10px; }
.gc-embla { overflow: hidden; flex: 1; }
.gc-embla__container { display: flex; gap: 18px; }
.gc-embla__slide { flex: 0 0 86%; min-width: 0; }
@media (min-width: 640px) { .gc-embla__slide { flex: 0 0 46%; } }
@media (min-width: 960px) { .gc-embla__slide { flex: 0 0 31.5%; } }
.gc-btn {
  font-family: var(--font-mono);
  border: 1px solid var(--ru2);
  border-radius: var(--radius-xs);
  background: var(--pa);
  color: var(--ink2);
  width: 34px; height: 34px;
  cursor: pointer;
  flex: none;
  display: none;
}
@media (min-width: 768px) { .gc-btn { display: block; } }
.gc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  gap: 14px;
  flex-wrap: wrap;
}
.gc-counter { font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--ink2); }
.gc-viewall { font-family: var(--font-mono); font-size: var(--text-mono); border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }

/* --------------------------------------------------------------------------
   8. FAQ — native <details>, works without JS
   -------------------------------------------------------------------------- */

.faq, .faq-list { border-top: 1px solid var(--ru2); }

.faq-item {
  border-bottom: 1px solid var(--ru2);
  border-top: none;
  border-left: none;
  border-right: none;
  background: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.faq-item > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  color: var(--ink);
  background: none;
}
.faq-item > summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1;
  color: var(--ink2);
  transition: transform .2s var(--ease);
  flex: none;
  /* the legacy pages paint an SVG chevron on this same pseudo-element —
     the system uses a mono glyph, so clear it */
  background-image: none;
  width: auto;
  height: auto;
}
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-answer, .faq-item > p, .faq-item > div {
  padding: 0 4px 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink2);
  margin: 0;
}

/* --------------------------------------------------------------------------
   9. PROSE / LEGAL / GUIDE ARTICLES
   -------------------------------------------------------------------------- */

.legal-content,
.page-wrap,
.calc-wrap,
.survey-wrap,
.thanks-wrap,
.author-section {
  max-width: var(--measure-narrow);
  margin: 0 auto;
  padding: var(--section-y) var(--gutter);
}

.legal-content h1, .page-title, .archive-title, .dashboard-title, .pricing-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-page-title);
  letter-spacing: -.03em;
  line-height: 1.06;
  margin: 0 0 16px;
}
.page-subtitle, .archive-subtitle, .dashboard-subtitle, .pricing-subtitle,
.guide-lead, .guides-lead, .calc-lead, .tools-lead, .survey-lead, .author-lead, .subtitle, .tagline {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink2);
  margin: 0 0 26px;
  max-width: 620px;
}

.legal-content h2, .guide-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin: 36px 0 12px;
}
.legal-content h3, .guide-section h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -.01em;
  margin: 24px 0 10px;
}
.legal-content p, .guide-section p, .guide-section li, .legal-content li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink2);
}
/* :not(.btn) — a descendant selector would otherwise outrank .btn-primary and
   paint button labels ink-on-ink. */
.legal-content a:not(.btn), .guide-section a:not(.btn) {
  color: var(--ink);
  border-bottom: 1px solid var(--ru2);
}

.guide-section { margin-bottom: 32px; }

.updated, .source, .source-list, .guide-source-note, .guides-source-note, .tools-source-note {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  line-height: 1.7;
  color: var(--ink2);
  background: none;
  border: none;
  border-top: 1px solid var(--ru);
  border-radius: 0;
  padding: 12px 0 0;
  margin: 0 0 26px;
}

/* Callout — hairline block, no coloured left bar */
.guide-highlight,
.highlight,
.author-highlight,
.calc-warning,
.guide-warning,
.alert,
.compliance-notice,
.compliance-pre {
  background: var(--pa2);
  border: 1px solid var(--ru);
  border-left: 1px solid var(--ru);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink2);
  text-align: left;
  max-width: none;
}
.compliance-notice strong, .alert strong, .guide-highlight strong { color: var(--ink); font-weight: 700; }

/* CTA box */
.guide-cta-box, .author-cta-box, .calc-cta, .tools-cta, .guides-cta, .thanks-cta {
  border: 1px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 28px;
  text-align: center;
  margin: 40px 0;
}
.guide-cta-box h3, .author-cta-box h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
  margin: 0 0 8px;
}
.guide-cta-box p, .author-cta-box p { font-size: 15px; color: var(--ink2); margin: 0 0 20px; }

/* Related links */
.guide-related, .calc-related {
  border-top: 1px solid var(--ru);
  padding-top: 28px;
  margin-top: 8px;
}
.guide-related h3, .calc-related h3 {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--mute);
  margin: 0 0 14px;
}
.guide-related ul, .calc-related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.guide-related a, .calc-related a { font-size: 15px; color: var(--ink); border-bottom: none; }

/* Tables */
table,
.bonus-table, .compare-table, .sdlt-table, .ni-table, .tax-table,
.limits-table, .allowance-table, .calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 20px 0;
}
th, td {
  border: 1px solid var(--ru);
  padding: 10px 12px;
  text-align: left;
  line-height: 1.5;
  color: var(--ink2);
}
th {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--pa2);
  font-weight: 400;
}
td b, td strong, .winner, .total-row { color: var(--ink); font-weight: 700; }

/* Rate tables have a hard minimum width — three money columns cannot fit a
   360px phone. Left alone they either crush cells to ~55px (one word per line)
   or push the layout viewport wider than the screen, and body's overflow-x:
   hidden then makes the cut-off column unreachable. Every table therefore sits
   in its own scroll container. */
.calc-table-wrap, .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  margin: 20px 0;
  max-width: 100%;
  /* Lea Verou scrolling shadows. The cover gradients are attachment: local so
     they travel with the content and uncover the shadow only once there is
     something to scroll back to; the shadows are attachment: scroll so they
     stay pinned to the edges. */
  background-image:
    linear-gradient(to right, var(--card), var(--card)),
    linear-gradient(to left, var(--card), var(--card)),
    linear-gradient(to right, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0)),
    linear-gradient(to left, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0));
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-repeat: no-repeat;
  background-size: 24px 100%, 24px 100%, 18px 100%, 18px 100%;
  background-attachment: local, local, scroll, scroll;
}
[data-theme="dark"] .calc-table-wrap,
[data-theme="dark"] .table-wrap {
  background-image:
    linear-gradient(to right, var(--card), var(--card)),
    linear-gradient(to left, var(--card), var(--card)),
    linear-gradient(to right, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0)),
    linear-gradient(to left, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0));
}
.calc-table-wrap > table, .table-wrap > table { margin: 0; min-width: 440px; }
.table-wrap > table.tw-wide { min-width: 560px; }

/* On a phone the table is always narrower than its content, and a column cut
   off at the container edge reads as a rendering fault rather than an
   invitation to swipe. Sticky so the hint stays put while the table moves. */
@media (max-width: 460px) {
  .calc-table-wrap::after, .table-wrap::after {
    content: "◂ swipe the table to see every column ▸";
    display: block;
    position: sticky;
    left: 0;
    width: min(100%, 92vw);
    padding-top: 8px;
    font-family: var(--font-mono);
    font-size: var(--text-mono-xs);
    letter-spacing: .04em;
    color: var(--mute);
  }
}

/* Timeline / steps */
.timeline { display: flex; flex-direction: column; gap: 0; margin: 24px 0; }
.timeline-step { display: flex; gap: 16px; border-top: 1px solid var(--ru); padding: 20px 0; }
.timeline-num {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 700;
  color: var(--pa);
  background: var(--ink);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  height: fit-content;
  flex: none;
}
.timeline-title { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -.01em; margin-bottom: 4px; }
.timeline-desc, .timeline-body { font-size: 14px; color: var(--ink2); line-height: 1.6; }

/* Story blocks (how-it-works / archive previews) */
.story { border-top: 1px solid var(--ru); padding: 22px 0; }
.story-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-bottom: 8px;
}
.bullets, .preview-bullets { padding-left: 20px; margin: 8px 0 0; }
.bullets li, .preview-bullets li { font-size: 14px; line-height: 1.65; color: var(--ink2); margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   10. FORMS, PLANS, CALCULATORS
   -------------------------------------------------------------------------- */

.form-group { margin-bottom: 18px; }
.form-label, .survey-row .q {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-bottom: 8px;
}
.form-input, .plan-input, input[type="text"], input[type="email"],
input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  border: 1px solid var(--ru2);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--pa);
  color: var(--ink);
  outline: none;
}
.form-input:focus, .plan-input:focus, input:focus, select:focus, textarea:focus { border-color: var(--ink); }
input[type="checkbox"], input[type="radio"] { width: auto; }

.hint, .form-footer, .login-footer, .already {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.6;
}

/* Pricing plans */
.plans { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 700px) { .plans { grid-template-columns: 1fr 1fr; gap: 24px; } }

.plan {
  border: 1px solid var(--ru);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: none;
}
.plan.premium, .plan-premium, .plan.inverse {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--pa);
}
.plan.premium *, .plan-premium *, .plan.inverse * { color: var(--pa); }
.plan.premium .plan-input, .plan-premium .plan-input {
  background: transparent;
  border-color: var(--rule-invert);
  color: var(--pa);
}
.plan.premium .btn, .plan-premium .btn { border: 1.5px solid var(--pa); color: var(--pa); background: none; }
.plan.premium hr, .plan-premium hr { border-top-color: var(--rule-invert); }

/* Controls sitting on the inverted card invert too, or they vanish into it */
.plan.premium .toggle-group, .plan-premium .toggle-group { border-top-color: var(--rule-invert); }
.plan.premium .toggle-btn, .plan-premium .toggle-btn { border-color: var(--rule-invert); }
.plan.premium .toggle-btn.active, .plan-premium .toggle-btn.active {
  background: var(--pa);
  color: var(--ink);
  border-color: var(--pa);
}

.plan-header, .plan-tag {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink2);
}
.plan-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -.03em;
  line-height: 1;
}
.plan-desc, .plan-label { font-size: 14px; line-height: 1.55; color: var(--ink2); margin: 0; }
.benefits, .plan ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.benefits li, .plan ul li {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--ink2);
  line-height: 1.5;
}
/* Feature lists carry a mono check glyph, per the iconography rules */
.benefits li::before, .plan ul li::before { content: "✓ "; }

/* subscribe.html's FAQ uses h3/p rather than details/summary */
.faq > h2 { font-size: 26px; margin: 0 0 20px; }
.faq .faq-item > h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  margin: 0;
  padding: 18px 4px 0;
}

/* Calculators */
.calc-card, .calc-section { margin-bottom: 24px; }
.calc-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ru);
}
/* 220px truncates the longest option ("England, Wales, or Northern Ireland"),
   so the control grows with the room available. */
@media (min-width: 640px) { .calc-row { grid-template-columns: 1fr minmax(220px, 260px); align-items: center; gap: 16px; } }
.calc-row label {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink2);
}

.calc-result {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 22px;
  margin: 24px 0;
  background: var(--card);
}
.stat { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--ru); align-items: baseline; }
.stat:last-child { border-bottom: none; }
.label {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink2);
}
.value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.02em;
  color: var(--ink);
}

/* Survey */
.survey-row { border-bottom: 1px solid var(--ru); padding: 18px 0; }
.survey-radios { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.survey-radios label { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink2); }

/* --------------------------------------------------------------------------
   11. ARCHIVE / DASHBOARD / AUTH
   -------------------------------------------------------------------------- */

.archive-header, .dashboard-section, .page-section { margin-bottom: 32px; }
.archive-stats, .count, .date-pill, .premium-badge, .account-email, .user-email {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: .06em;
  color: var(--ink2);
}
.archive-list { display: flex; flex-direction: column; border-top: 1px solid var(--ru); }
.archive-item { border-bottom: 1px solid var(--ru); padding: 20px 0; display: block; }
.archive-item-date, .newsletter-date {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-bottom: 6px;
}
.archive-item-title, .newsletter-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}
.archive-item-preview { font-size: 14px; color: var(--ink2); line-height: 1.55; }

.newsletter-frame { border: 1px solid var(--ru); border-radius: var(--radius-md); overflow: hidden; }
.newsletter-header { border-bottom: 1px solid var(--ru); padding: 14px 18px; }
.newsletter-content { padding: 18px; }

.empty-state, .archive-empty, .loading {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink2);
  font-family: var(--font-mono);
  font-size: 13px;
}

.pagination { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 32px 0; }
.pagination-dots { font-family: var(--font-mono); color: var(--mute); }

.back-link, .back-btn {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--ink2);
  display: inline-block;
  margin-bottom: 20px;
}

.search-box { position: relative; margin-bottom: 20px; }
.search-icon { display: none; }

/* --------------------------------------------------------------------------
   12. COOKIE CONSENT
   -------------------------------------------------------------------------- */

.fs-consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  padding: 0 clamp(12px, 3vw, 20px) clamp(12px, 3vw, 20px);
}
.fs-consent[hidden] { display: none; }
.fs-consent__card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--ru2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.fs-consent__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.fs-consent__body { font-size: 13px; line-height: 1.55; color: var(--ink2); margin: 0 0 14px; }
.fs-consent__body a { border-bottom: 1px solid var(--ink2); }
.fs-consent__row { display: flex; gap: 10px; }
.fs-consent__row .btn { flex: 1; }

/* --------------------------------------------------------------------------
   13. LEGACY MARKUP — bring pre-Terminal blocks onto the system
   -------------------------------------------------------------------------- */

.preview-card-wrapper { max-width: 560px; margin: 0 auto; }
.preview-card { padding: 0; overflow: hidden; }
.preview-header { border-bottom: 1px solid var(--ru); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.preview-date {
  font-family: var(--font-mono);
  font-size: var(--text-mono-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink2);
}
.preview-body { padding: 6px 18px 16px; }
.preview-story { padding: 14px 0; border-bottom: 1px solid var(--ru); }
.preview-story:last-child { border-bottom: none; }
.preview-story-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -.01em; margin-bottom: 6px; }
.preview-footer {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--ink2);
  border-top: 1px solid var(--ru);
  padding: 12px 18px;
}
.preview-logo { font-size: 15px; }

.divider { border-top: 1px solid var(--ru); margin: 32px 0; }

/* --------------------------------------------------------------------------
   14. RESPONSIVE HARDENING
   Device-shape rules rather than page rules: what changes here is driven by
   the input device (finger vs mouse), the screen's short edge, and the
   viewport height — not by which page is being rendered.
   -------------------------------------------------------------------------- */

/* --- 14a. Touch targets -----------------------------------------------------
   The mono type scale gives links a ~17–30px hit box, well under the 44px
   that WCAG 2.5.8 / iOS HIG ask for. Grow the hit area only for coarse
   pointers so the desktop rhythm is untouched. */
@media (pointer: coarse) {
  .theme-toggle,
  .fs-burger,
  .fs-mobile__close,
  .gc-btn {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
  }

  /* .nav-buttons a is deliberately absent: .is-active::after is pinned to the
     link box, so growing the box drops the active rule away from the word.
     Those links already sit in a 57px header row. */
  .brand, .logo,
  .nav-dropdown > summary,
  .nav-dropdown-menu a,
  .footer__links a,
  .guide-related a,
  .calc-related a,
  .legal-footer a,
  nav[aria-label="breadcrumb"] a,
  .back-link,
  .back-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  /* Standalone rule-underlined links ("View all 23 guides →"). The border is
     the design, so the box cannot grow — extend the hit area with an overlay
     instead and leave the visuals untouched. */
  .fs-link, .gc-viewall { position: relative; }
  .fs-link::after, .gc-viewall::after {
    content: "";
    position: absolute;
    inset: -11px -4px;
  }
  /* Stacked link lists would gain 44px per row on top of their own gap, which
     doubles the footer height — fold the gap into the taller hit box instead. */
  .footer__links,
  .guide-related ul,
  .calc-related ul { gap: 0; }

  .btn, .btn-primary, .submit-btn, .survey-submit,
  .filter-btn, .toggle-btn, .sort-btn, .pagination-btn,
  .fs-seg button, .fs-nav-cta { min-height: 44px; }
  .btn-sm { min-height: 38px; }

  /* A 13px checkbox is not a finger-sized target; the label carries the rest. */
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; flex: none; }
  .survey-radios label,
  label:has(> input[type="checkbox"]),
  label:has(> input[type="radio"]) { display: flex; align-items: center; min-height: 44px; }
}

/* --- 14b. iOS focus zoom ----------------------------------------------------
   Safari on iOS zooms the whole page when a focused field's text is under
   16px, then leaves it zoomed — the page is left scrolled sideways and the
   submit button off-screen. Only the rendered size matters, so this applies
   below the tablet breakpoint rather than everywhere. */
@media (max-width: 859px) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
  select, textarea,
  .form-input, .plan-input, .hero-input, .fs-subscribe input[type="email"] {
    /* !important because several legacy pages still set 15px from their own
       <style> block, which outranks these element selectors. */
    font-size: 16px !important;
  }
}

/* --- 14c. Small-screen legibility -------------------------------------------
   10–11px mono is a deliberate part of the design at desk distance; on a phone
   held at arm's length it is below the readable floor. Lift the mono scale on
   narrow screens only — the tokens keep the desktop rendering identical. */
@media (max-width: 599px) {
  :root {
    --text-mono: 13px;
    --text-mono-sm: 12.5px;
    --text-mono-xs: 12px;
  }
  .footer__legal,
  .legal-footer,
  .guide-disclaimer,
  .calc-disclaimer,
  .tools-disclaimer,
  .guides-disclaimer,
  .author-disclaimer,
  .fine-print { font-size: 12px; }
  .fs-brief__b, .fs-issue__b { font-size: 14px; }
}

/* --- 14d. Narrow phones (320–360) -------------------------------------------
   Below ~360px the two-up rows in the chrome run out of room before the type
   does, so they stack rather than shrink. */
@media (max-width: 360px) {
  .hero-form, .fs-subscribe { flex-direction: column; }
  .hero-form .btn, .fs-subscribe button { padding: 14px 18px; }
  .hero-input, .fs-subscribe input[type="email"] { border-bottom: 1.5px solid var(--ink); }
  .fs-brief__bar, .fs-issue__bar, .preview-header { flex-wrap: wrap; gap: 4px; }
  .fs-stat { padding: 20px 14px; }
  .premium-banner { padding: 18px 16px; }
  .fs-consent__row { flex-direction: column; }
}

/* --- 14e. Short viewports ---------------------------------------------------
   A phone in landscape has ~330–430px of height. The mobile sheet's 26px
   display type puts the CTA below the fold, and the hero's clamped padding
   still assumes a portrait screen. */
@media (max-height: 500px) and (orientation: landscape) {
  .fs-mobile__nav a:not(.fs-mobile__cta) { font-size: 19px; padding: 10px 0; }
  .fs-mobile__cta { margin-top: 14px; padding: 12px; }
  .hero { padding-top: 24px; padding-bottom: 24px; }
  .fs-section { padding: 32px 0; }
  .fs-ticker { display: none; }
}

/* --- 14f. Large desktops ----------------------------------------------------
   1180px on a 1440px-plus screen leaves the content marooned in the middle.
   Widen the measure a step rather than letting the margins grow without
   limit; the prose measure stays fixed so line length never suffers. */
@media (min-width: 1600px) {
  :root { --measure: 1320px; }
}

/* --- 14g. Motion ------------------------------------------------------------
   The ticker was already handled; the fade-in and every hover/scroll
   transition were not. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .fs-mobile { animation: none; }
}
