/*
 * CIPLE Prep design system — "1c · Bold Premium": deep pine green #1E3D30 (authority: nav,
 * hero, footer), terracotta #D9723F (every CTA/accent), warm cream #F6F2EA ground. Bricolage
 * Grotesque display + Hanken Grotesk body. Mobile-first, WCAG-minded (AA text, 2px terracotta
 * focus), reduced-motion aware. Single breakpoint at 768px to desktop grids.
 */
:root {
  /* Surfaces & ink */
  --bg: #F6F2EA;          /* page (cream-50) */
  --cream-100: #EDE4D3;   /* alternating section bg */
  --cream-card: #F4ECDD;  /* taster card on green */
  --surface: #FFFFFF;     /* cards on cream */
  --surface-2: #F1E9D9;   /* zebra / subtle fill */
  --ink: #201E19;         /* primary text on light */
  --muted: #6B6255;       /* body text on light */
  --muted-2: #9C9384;     /* meta / captions */
  --line: #E4DCCC;        /* hairlines on light */
  --white: #FFFFFF;

  /* Brand — deep green (structure/authority) */
  --green-900: #1E3D30;
  --green-700: #26503C;
  --green-600: #2E5E46;   /* hover on green surfaces */
  /* On green */
  --on-green: #F6F2EA;
  --on-green-body: #BCD0C3;
  --on-green-muted: #8CAA98;
  --on-green-link: #C3D3C8;
  --hairline-green: #345043;
  --nav-fg: var(--on-green-link);  /* nav + footer link color */

  /* Accent — terracotta (all CTAs/accents) */
  --primary: #D9723F;
  --primary-dark: #B85A2C;   /* links / small terracotta text on light (AA) */
  --primary-tint: #F0B48C;   /* terracotta text on green */
  --terracotta-soft: #FBEDE4; /* selected option fill */
  --ochre: #E9B34A;          /* rare label highlight */

  /* Semantic — quiz feedback (reused app-wide) */
  --good: #2E7D57;  --good-bg: #EAF6EF;  --good-text: #1E5D40;
  --bad:  #C0492F;  --bad-bg:  #FBEDE9;  --bad-text:  #8F3120;
  --warn: #C9821E;  --warn-bg: #F7EBD2;
  --info: #26503C;  --info-bg: #EAF6EF;
  /* Readiness bands */
  --band-pass: #4FB07E;  --band-mid: #E0A23C;  --band-low: #C0492F;

  /* Type scale */
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;

  /* Spacing scale (4 / 8px grid) */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4rem;

  --radius: 17px;         /* cards */
  --radius-sm: 10px;      /* buttons / inputs */
  --radius-badge: 6px;    /* badges / key chips */
  --shadow: 0 1px 2px rgba(30,61,48,.05), 0 10px 30px -18px rgba(30,61,48,.22);
  --shadow-lift: 0 2px 4px rgba(30,61,48,.08), 0 22px 46px -26px rgba(30,61,48,.30);
  --shadow-green: 0 26px 54px -28px rgba(0,0,0,.55);          /* card on green */
  --shadow-green-card: 0 24px 50px -26px rgba(30,61,48,.75);  /* hero pricing card */

  --display: "Bricolage Grotesque", Georgia, "Times New Roman", serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Back-compat aliases so existing views/classes keep working */
  --primary-dark-alias: var(--primary-dark);
  --accent: var(--green-700);
  --accent-dark: var(--green-900);
  --accent-tint: var(--good-bg);
  --azul: var(--primary);
  --azul-dark: var(--primary-dark);
  --warm-white: var(--bg);
  --card: var(--surface);
}

* { box-sizing: border-box; }
/* The hidden attribute must win over component display rules (.row/.stepper__nav/steps use flex). */
[hidden] { display: none !important; }

/* Green backstop on both html AND body so whichever iOS Safari paints in the
   overscroll rubber-band and the safe-area insets (behind the status bar / home
   indicator) matches the green nav (top) and footer (bottom) rather than
   flashing the cream page background. The cream page surface lives on <main>,
   which wraps all page content between the green nav and green footer. */
html, body { background: var(--green-900); }
main { display: block; background: var(--bg); }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: var(--display); font-weight: 700; line-height: 1.1; color: var(--ink); letter-spacing: -.02em; }
h1 { font-size: clamp(2.35rem, 6vw, 3.9rem); margin: 0 0 .35em; letter-spacing: -.03em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); margin: 1.3em 0 .5em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.32rem); margin: 1em 0 .4em; }
a { color: var(--primary-dark); }
a:hover { color: var(--primary); }

/* Visible keyboard focus everywhere — 2px terracotta, on-brand */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.container { max-width: 1180px; margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-8); }
.container--wide { max-width: 1180px; }
.container--narrow { max-width: 820px; }

/* Small uppercase eyebrow label */
.eyebrow { display: inline-block; font-size: var(--text-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); }

/* Standard page header */
.page-head { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin: 0 0 var(--space-5); }
.page-head h1 { margin: 0; }
.page-head__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-left: auto; }

/* ============================ NAV (sticky, green) ============================ */
.topbar { background: var(--green-900); color: var(--nav-fg); position: sticky; top: 0; z-index: 50; }
.topbar__inner { max-width: 1180px; margin: 0 auto; padding: var(--space-3) var(--space-6); display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.topbar a { color: var(--nav-fg); text-decoration: none; }
/* Base for the brand lockup wherever it appears (topbar anchor + auth-page <span>s); the
   flex gap is what separates the "A2" logo from the wordmark. */
.topbar__brand { display: inline-flex; align-items: center; }
.topbar a.topbar__brand { gap: 11px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--on-green); letter-spacing: -.02em; }
.topbar__logo { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; font-family: var(--display); font-weight: 800; font-size: .95rem; letter-spacing: 0; }
.topbar__nav { display: flex; gap: var(--space-5); margin-left: auto; flex-wrap: wrap; align-items: center; font-weight: 500; }
.topbar__nav a { padding: .2rem 0; border-bottom: 2px solid transparent; }
.topbar__nav a:hover { color: var(--on-green); border-bottom-color: var(--primary); }
.topbar__nav a[aria-current="page"] { color: var(--on-green); font-weight: 700; border-bottom-color: var(--primary); }
.topbar__nav form.button_to { margin: 0; }
/* Ghost button (Sign out) on the dark bar */
.topbar__nav .btn--ghost { color: var(--on-green); border-color: rgba(255,255,255,.45); background: transparent; }
.topbar__nav .btn--ghost:hover { background: rgba(255,255,255,.12); color: var(--on-green); }
/* CTA button in the nav — needs to out-specify `.topbar a` / `.topbar__nav a`
   (both 0,1,1), which would otherwise steal the .btn white text and padding. */
.topbar__nav a.btn { color: var(--white); padding: .5rem .95rem; border-bottom: 0; }
.topbar__nav a.btn:hover { color: var(--white); border-bottom: 0; background: var(--primary); filter: brightness(.94); }
/* Hamburger toggle — hidden on desktop, shown on mobile */
.topbar__toggle { display: none; margin-left: var(--space-3); position: relative; z-index: 62; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--on-green); cursor: pointer; }
.topbar__toggle:hover { background: rgba(255,255,255,.1); }
.topbar__toggle svg { width: 1.5rem; height: 1.5rem; }
.topbar__toggle-icon--close { display: none; }
.topbar__toggle[aria-expanded="true"] .topbar__toggle-icon--open { display: none; }
.topbar__toggle[aria-expanded="true"] .topbar__toggle-icon--close { display: inline-flex; }

/* Account dropdown (topbar, signed-in) */
.topbar__account { position: relative; display: inline-flex; }
.topbar__account-trigger { display: inline-flex; align-items: center; gap: .3rem; }
.topbar__account-caret { width: 1rem; height: 1rem; transition: transform .15s ease; }
.topbar__account-trigger[aria-expanded="true"] .topbar__account-caret { transform: rotate(180deg); }
.topbar__account-menu { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); padding: var(--space-2); z-index: 60; display: flex; flex-direction: column; gap: 2px; }
.topbar__account-menu[hidden] { display: none; }
.topbar__account-email { padding: .4rem .7rem .55rem; font-size: var(--text-sm); color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; }
.topbar__account-menu form.button_to { margin: 0; }
.topbar__account-item { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 500; border-radius: 8px; cursor: pointer; }
.topbar__account-item:hover { background: var(--surface-2); color: var(--ink); }
/* The link item ("Exam & plan") must out-specify .topbar__nav a (color/border/padding). */
.topbar__nav a.topbar__account-item { padding: .55rem .7rem; border-bottom: 0; color: var(--ink); font-weight: 500; }
.topbar__nav a.topbar__account-item:hover { color: var(--ink); background: var(--surface-2); border-bottom: 0; }

/* ============================ Cards ============================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow); margin: var(--space-4) 0; }
.card--flush { padding: 0; overflow: hidden; }
.card--plain { box-shadow: none; }
.card__icon { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--green-900); color: var(--primary-tint); margin-bottom: var(--space-3); }
.card__icon svg { width: 1.35rem; height: 1.35rem; }
a.card--link, .card--link { text-decoration: none; color: inherit; display: block; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.card--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--primary); }

/* On-green surface: cards/panels sitting on a green section */
.on-green { background: var(--green-900); color: var(--on-green); }
.on-green h1, .on-green h2, .on-green h3 { color: var(--on-green); }
.on-green .muted, .on-green p { color: var(--on-green-body); }

.grid { display: grid; gap: var(--space-4); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ============================ Buttons ============================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; background: var(--primary); color: var(--white); border: 0; border-radius: var(--radius-sm); padding: .85rem 1.4rem; font-family: inherit; font-size: 1rem; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; transition: background .12s ease, transform .06s ease, filter .12s ease; }
.btn:hover { background: var(--primary); filter: brightness(.94); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.1em; height: 1.1em; }
/* Solid green secondary (e.g. exam submit) */
.btn--accent { background: var(--green-700); }
.btn--accent:hover { background: var(--green-900); filter: none; }
/* Secondary on light: bordered green */
.btn--ghost { background: transparent; color: var(--green-900); border: 1.5px solid var(--green-900); }
.btn--ghost:hover { background: rgba(30,61,48,.06); color: var(--green-900); filter: none; }
.btn--small { padding: .5rem .9rem; font-size: var(--text-sm); }
.btn--block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ============================ Forms ============================ */
label { display: block; font-weight: 600; margin: var(--space-3) 0 var(--space-1); }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: .8rem .85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 1rem; font-family: inherit; background: var(--surface); color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--terracotta-soft); }
.field--error input, input[aria-invalid="true"] { border-color: var(--bad); }
.field--error input:focus { box-shadow: 0 0 0 3px var(--bad-bg); }
textarea { min-height: 8rem; resize: vertical; }
.field { margin-bottom: var(--space-3); }
.hint { color: var(--muted); font-size: var(--text-sm); }

/* Auth card (fallback for simple auth pages) */
.auth { max-width: 460px; }
.auth h1 { font-size: clamp(1.7rem, 3vw, 2.1rem); }
.auth .card { margin-top: var(--space-4); }
.auth__alt { margin-top: var(--space-4); }

/* ============================ Options / answer buttons ============================ */
/* Shared practice-item control: taster, in-app runner, and results review all emit
   `.option` with a native radio + a <strong> letter. Radio is hidden but focusable. */
.option { position: relative; display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 11px; padding: 13px 15px; margin: var(--space-2) 0; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.35; cursor: pointer; transition: border-color .12s ease, background .12s ease, opacity .12s ease; }
.option:hover { border-color: var(--primary); background: var(--terracotta-soft); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.option:has(input:checked) { border-color: var(--primary); background: var(--terracotta-soft); }
/* Letter → key chip */
.option strong { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: var(--radius-badge); background: var(--cream-100); color: var(--muted); font-weight: 800; font-size: 12.5px; flex: none; }
/* Graded states (results review + taster JS) */
.option--correct { border-color: var(--good); background: var(--good-bg); color: var(--good-text); }
.option--correct strong { background: var(--good); color: #fff; }
.option--correct::after { content: "✓"; margin-left: auto; font-weight: 800; color: var(--good); }
.option--wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad-text); }
.option--wrong strong { background: var(--bad); color: #fff; }
.option--wrong::after { content: "✗"; margin-left: auto; font-weight: 800; color: var(--bad); }
.option--dim { opacity: .5; }
.option--locked { cursor: default; }
.option--locked:hover { border-color: var(--line); background: var(--surface); }
.option--locked.option--correct:hover { border-color: var(--good); background: var(--good-bg); }
.option--locked.option--wrong:hover { border-color: var(--bad); background: var(--bad-bg); }

/* ============================ Pills / badges / chips ============================ */
.pill { display: inline-block; font-size: var(--text-xs); font-weight: 700; padding: .28rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill--good { background: var(--good-bg); color: var(--good-text); border-color: transparent; }
.pill--bad { background: var(--bad-bg); color: var(--bad-text); border-color: transparent; }
.pill--warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill--accent { background: var(--good-bg); color: var(--good-text); border-color: transparent; }
.pill--primary { background: var(--terracotta-soft); color: var(--primary-dark); border-color: transparent; }
.pill--green { background: var(--green-900); color: var(--on-green); border-color: transparent; }
.pill--badge { border-radius: var(--radius-badge); text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }

/* Category chip (blog) */
.chip { display: inline-block; padding: 8px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.chip--active, .chip:hover { background: var(--green-900); color: var(--on-green); border-color: transparent; }

/* ============================ Flashes & notices ============================ */
.flash { padding: .8rem 1.05rem; border-radius: var(--radius-sm); margin: var(--space-2) 0; border: 1px solid transparent; font-weight: 500; }
.flash--notice { background: var(--good-bg); color: var(--good-text); }
.flash--alert { background: var(--bad-bg); color: var(--bad-text); }
.flash--info { background: var(--info-bg); color: var(--info); }
.notice--info { background: var(--info-bg); color: var(--green-700); border: 1px solid var(--good-bg); padding: .8rem 1.05rem; border-radius: var(--radius-sm); margin: var(--space-2) 0; }

/* Notice / stimulus blocks */
.notice-text { background: var(--surface); border: 2px dashed var(--primary); border-radius: 12px; padding: var(--space-4); text-align: center; }
.notice-text strong { font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; color: var(--green-900); }
.notice-text p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.passage { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: var(--space-4) var(--space-5); font-size: 1.05rem; line-height: 1.62; white-space: pre-wrap; }

/* ============================ Meters / component bars ============================ */
.meter { position: relative; background: var(--cream-100); border-radius: 999px; height: 12px; overflow: visible; }
.meter__fill { background: var(--primary); height: 12px; border-radius: 999px; }
.meter__fill--pass { background: var(--band-pass); }
.meter__fill--mid { background: var(--band-mid); }
.meter__fill--low { background: var(--band-low); }
/* Marker lines (25% floor red, 55% pass green-900) */
.meter__mark { position: absolute; top: -3px; height: 18px; width: 2px; }
.meter__mark--floor { background: var(--bad); }
.meter__mark--pass { background: var(--green-900); }
/* clip only the fill so markers can overhang */
.meter { overflow: hidden; }
.meter--marked { overflow: visible; }

.stat { font-family: var(--display); font-weight: 800; font-size: 2.4rem; color: var(--ink); line-height: 1; }
.muted { color: var(--muted); }
.right { text-align: right; }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ============================ Tables ============================ */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .55rem; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
th { font-weight: 700; color: var(--muted); }
tbody tr:hover { background: var(--surface-2); }

audio { width: 100%; margin: var(--space-2) 0; }

/* ============================ Readiness ring (dashboard) ============================ */
.ring { flex: none; width: 132px; height: 132px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--band-pass) 0 var(--ring-pct, 0%), var(--hairline-green) var(--ring-pct, 0%) 100%); }
.ring__hole { width: 100px; height: 100px; border-radius: 999px; background: var(--green-900); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring__num { font-family: var(--display); font-weight: 800; font-size: 2rem; color: var(--on-green); line-height: 1; }
.ring__label { font-size: 11px; color: var(--on-green-muted); margin-top: 3px; }

/* ============================ Hero ============================ */
.hero { text-align: center; padding: var(--space-7) 0 var(--space-5); }
.hero h1 { max-width: 18ch; margin-inline: auto; }
.hero__sub { color: var(--muted); font-size: var(--text-lg); max-width: 46rem; margin: var(--space-3) auto var(--space-5); }
.hero__cta { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.startcard { text-align: center; border: 1px solid var(--line); background: linear-gradient(180deg, var(--terracotta-soft), var(--surface)); }
.startcard .card__icon { margin-inline: auto; }

/* Green hero band (home) */
.hero-band { background: var(--green-900); color: var(--on-green); }
.hero-band__inner { max-width: 1180px; margin: 0 auto; padding: clamp(2.5rem, 5vw, 4.5rem) var(--space-6); }
.hero-split { display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: center; }
.hero-split__intro h1 { margin: 0 0 var(--space-3); color: var(--on-green); }
.hero-split__intro .hero__sub { margin: 0 0 var(--space-4); color: var(--on-green-body); max-width: 30rem; }
.hero__points { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.hero-split__aside .hero__points { margin-top: 0; }
.hero__points li { display: flex; align-items: center; gap: .5rem; color: var(--on-green-muted); font-weight: 500; font-size: 13.5px; }
.hero__points svg { width: 1.05rem; height: 1.05rem; color: var(--band-pass); flex: none; }
@media (min-width: 768px) {
  .hero-split { grid-template-columns: 1.05fr .95fr; gap: 52px; }
}
/* Small screens: lead with the quiz, push the CTA and points below it */
@media (max-width: 767px) {
  .hero-split { row-gap: 0; }
  .hero-split__intro { display: contents; }
  .hero-split > .quiz { margin-top: var(--space-2); }
  .hero-split__aside { order: 1; margin-top: var(--space-5); }
}

/* ============================ Differentiators ============================ */
.diff-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.diff-head h2 { margin: 0; max-width: 560px; }
.diffcard__num { width: 42px; height: 42px; border-radius: 10px; background: var(--green-900); color: var(--primary-tint); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; margin-bottom: 14px; }

/* Section wrappers */
.section { max-width: 1180px; margin: 0 auto; padding: var(--space-8) var(--space-6); }
.section--cream { background: var(--cream-100); border-top: 1px solid var(--line); }

/* ============================ Pricing ============================ */
.pricing-head { text-align: center; padding: var(--space-7) 0 var(--space-5); }
.pricing-head h1 { margin: 0 0 var(--space-3); }
.pricing-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); max-width: 1180px; margin: 0 auto; align-items: stretch; }
@media (min-width: 768px) { .pricing-grid { grid-template-columns: repeat(var(--pricing-cols, 3), 1fr); } }
.pricing-card { position: relative; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 30px; margin: 0; box-shadow: none; }
.pricing-card--featured { background: var(--green-900); border-color: transparent; box-shadow: var(--shadow-green-card); color: var(--on-green); }
@media (min-width: 768px) { .pricing-card--featured { transform: translateY(-8px); } }
.pricing-card--featured .pricing-card__name { color: var(--ochre); }
.pricing-card--featured .pricing-card__price, .pricing-card--featured .pricing-card__price .muted { color: var(--on-green); }
.pricing-card--featured .pricing-card__features li { color: var(--on-green-body); }
.pricing-card__features li.is-hero-feature,
.pricing-card--featured .pricing-card__features li.is-hero-feature { color: var(--ochre); }
.pricing-card--featured .pricing-card__features svg { color: var(--primary-tint); }
.pricing-card--featured .pricing-card__blurb { color: var(--on-green-muted); }
.pricing-card__badge { position: absolute; top: -11px; left: 26px; }
.pricing-card__name { margin: 0 0 var(--space-2); font-size: 14px; font-weight: 800; text-transform: none; color: var(--green-900); }
.pricing-card__price { font-family: var(--display); font-weight: 700; font-size: 2.4rem; line-height: 1.05; margin-bottom: 4px; color: var(--ink); }
.pricing-card__price .muted { font-family: var(--body); font-size: var(--text-base); }
.pricing-card__blurb { font-size: 12.5px; color: var(--muted-2); margin: 0 0 18px; min-height: 1.2em; }
.pricing-card__features { list-style: none; padding: 0; margin: var(--space-2) 0 var(--space-5); display: grid; gap: 10px; flex: 1; }
.pricing-card__features li { display: flex; gap: .5rem; align-items: flex-start; font-size: 14px; color: var(--muted); }
.pricing-card__features svg { width: 1.05rem; height: 1.05rem; color: var(--good); flex: none; margin-top: .15rem; }
.pricing-card .btn { margin-top: auto; }
.pricing-note { text-align: center; font-size: 13px; color: var(--muted-2); margin: var(--space-5) 0 0; }

/* Auto-renewing subscription disclosure (required in-app by App Store 3.1.2(c)). Deliberately
   quiet: it sits under the plan cards and must not compete with them, so it borrows the small-label
   heading and hairline-separated rows used by the plan cards and the FAQ rather than a display h2. */
.subterms { max-width: 820px; margin: var(--space-6) auto 0; padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.subterms__title { margin: 0 0 var(--space-3); font-size: 14px; font-weight: 800; color: var(--green-900); }
.subterms__plans { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.subterms__plans li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); line-height: 1.55; }
.subterms__plans li:last-child { border-bottom: 0; }
.subterms__plans strong { color: var(--ink); font-weight: 700; }
.subterms p { margin: 0 0 var(--space-3); font-size: 13px; line-height: 1.6; color: var(--muted-2); }
.subterms__links { margin: 0; font-size: 13px; font-weight: 600; }
.subterms__links a { text-decoration: none; }
.subterms__links a:hover { text-decoration: underline; }
.subterms__sep { color: var(--line); margin: 0 .35rem; }

/* Comparison table */
.ptable { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ptable th, .ptable td { border-bottom: 1px solid var(--line); padding: 13px 22px; font-size: 13.5px; }
.ptable thead th { background: var(--green-900); color: var(--on-green); font-weight: 700; font-size: 13px; }
.ptable thead th.is-hero { color: var(--ochre); }
.ptable tbody tr:nth-child(even) { background: var(--surface-2); }
.ptable tbody tr:hover { background: var(--surface-2); }
.ptable td { text-align: center; color: var(--muted); }
.ptable td:first-child, .ptable th:first-child { text-align: left; color: var(--ink); font-weight: 600; }
.ptable td.is-hero { font-weight: 700; color: var(--green-900); }
.ptable td:first-child.is-hero-feature { color: var(--warn); font-weight: 700; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq__item { padding: 20px 4px; border-bottom: 1px solid var(--line); }
.faq__item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.faq__item p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* ============================ Taster quiz (home) ============================ */
.quiz { margin: 0; padding: 26px; background: var(--cream-card); border: 0; box-shadow: var(--shadow-green); border-radius: 18px; }
.quiz__how { font-size: var(--text-sm); font-weight: 700; color: var(--muted-2); margin: 0; }
.quiz__prompt { font-weight: 700; font-size: 1rem; margin: var(--space-3) 0 var(--space-3); color: var(--ink); }
.quiz__step .notice-text { margin-bottom: var(--space-3); }
.quiz__result { text-align: center; }
.quiz__result .card__icon { margin-inline: auto; }
.quiz__result .stat { font-size: 2.1rem; }
.quiz__result p.muted { max-width: none; }
.quiz__foot { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ============================ Steppers / segmented progress ============================ */
.stepper__progress { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.stepper__dots { display: flex; gap: .35rem; flex: 1; }
.stepper__dot { flex: 1; height: 5px; border-radius: 3px; background: var(--hairline-green); }
.stepper__dot--done { background: var(--good); }
.stepper__dot--active { background: var(--primary); }
.stepper__label { font-weight: 600; color: var(--muted); font-size: var(--text-sm); }
.stepper__nav { display: flex; gap: var(--space-3); align-items: center; margin-top: var(--space-4); }
.task-intro { color: var(--muted); margin: 0 0 var(--space-4); }

/* 3-segment onboarding progress on light */
.segbar { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; }
.segbar__label { font-size: 12.5px; font-weight: 700; color: var(--muted-2); }
.segbar__track { flex: 1; display: flex; gap: 5px; }
.segbar__seg { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.segbar__seg--done { background: var(--good); }
.segbar__seg--active { background: var(--primary); }

/* ============================ Split auth / onboarding panel ============================ */
.authsplit { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lift); margin: var(--space-6) 0; min-height: 520px; }
@media (min-width: 768px) { .authsplit { grid-template-columns: .82fr 1.18fr; } }
.authsplit__panel { background: var(--green-900); color: var(--on-green); padding: 38px 32px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-6); }
.authsplit__panel h2 { color: var(--on-green); font-size: 1.85rem; margin: 0 0 14px; }
.authsplit__panel p { color: var(--on-green-body); margin: 0; font-size: 15px; line-height: 1.6; }
.authsplit__points { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--on-green-muted); font-weight: 600; }
.authsplit__pane { background: var(--bg); padding: 40px 44px; display: flex; flex-direction: column; }
.authsplit__pane .field:first-of-type label { margin-top: 0; }

/* Provider (OAuth) buttons */
.provider-btns { display: flex; flex-direction: column; gap: 11px; }
.provider-btns form.button_to { margin: 0; width: 100%; }
.provider-btn { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; padding: 13px; border-radius: 11px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; font-size: 15px; cursor: pointer; font-family: inherit; transition: filter .12s ease, box-shadow .12s ease; }
.provider-btn:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); filter: brightness(.98); }
.provider-btn--apple { border-color: var(--ink); background: var(--ink); color: #fff; }
.provider-btn--apple:hover { filter: brightness(1.15); }
.provider-btn__logo { flex: 0 0 auto; display: block; }
.provider-caption { text-align: center; color: var(--muted); font-size: var(--text-sm); margin: 9px 0 0; }
/* Inline "link" button (e.g. resend a sign-in code) that reads as text inside a paragraph */
.inline-form { display: inline; }
.linklike { display: inline; background: none; border: 0; padding: 0; font: inherit; color: var(--green-900); font-weight: 600; text-decoration: underline; cursor: pointer; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or-divider span { font-size: 12px; color: var(--muted-2); font-weight: 600; }

/* Onboarding single-select option list */
.survey-options { display: flex; flex-direction: column; gap: 10px; max-width: 440px; }

/* ============================ In-app session bar ============================ */
.sessionbar { background: var(--green-900); color: var(--on-green); border-radius: var(--radius); padding: 16px 22px; margin: 0 0 var(--space-5); position: sticky; top: 56px; z-index: 30; }
.sessionbar__exit { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.08); color: var(--on-green-link); text-decoration: none; }
.sessionbar__exit:hover { background: rgba(255,255,255,.16); color: var(--on-green); }
.sessionbar .stepper__progress { margin: 0; }
.sessionbar .stepper__label { color: var(--on-green-body); }
.sessionbar__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sessionbar__title { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--on-green); }
.sessionbar__title b { color: var(--primary-tint); font-weight: 700; }
.sessionbar__meta { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--on-green-body); font-weight: 600; }

/* ============================ Blog ============================ */
.blog-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
@media (min-width: 768px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.blog-head { margin-bottom: var(--space-5); }
.blog-head p { max-width: 42rem; }
.blog-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: var(--space-4); }
.blog-card { display: flex; flex-direction: column; gap: var(--space-2); height: 100%; padding: 22px; }
.blog-card__date { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; }
.blog-card__cat { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--primary-dark); }
.blog-card__title { font-size: 1.15rem; margin: .2rem 0; line-height: 1.22; }
.blog-card__title a { text-decoration: none; color: var(--ink); }
.blog-card--link:hover .blog-card__title a { color: var(--primary-dark); }
.blog-card__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: var(--space-2); }
/* Featured horizontal card */
.blog-featured { display: block; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); text-decoration: none; color: inherit; margin-bottom: var(--space-6); }
.blog-featured__body { padding: 34px 32px; display: flex; flex-direction: column; justify-content: center; }
.blog-featured__body h2 { margin: 12px 0; font-size: 1.7rem; line-height: 1.14; }
/* Author avatar */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; background: var(--green-900); color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.avatar--lg { width: 52px; height: 52px; font-size: 18px; }

/* Blog article */
.blog-breadcrumb { font-size: var(--text-sm); margin-bottom: var(--space-5); }
.blog-breadcrumb a { text-decoration: none; }
.blog-breadcrumb a:hover { text-decoration: underline; }
.blog-article { max-width: 720px; margin: 0 auto; }
.blog-article__header { margin-bottom: var(--space-5); }
.blog-article__meta { font-size: var(--text-sm); display: flex; gap: var(--space-2); flex-wrap: wrap; color: var(--muted-2); }
.blog-article__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); }

/* Long-form prose (rendered markdown) */
.prose { font-size: 1.06rem; line-height: 1.72; color: #2A2420; }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.02em; margin: 1.6em 0 .5em; }
.prose h3 { font-family: var(--display); font-weight: 700; font-size: 1.28rem; margin: 1.4em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose blockquote { margin: 1.3em 0; padding: 1em 1.3em; border-left: 3px solid var(--primary); background: var(--terracotta-soft); color: var(--primary-dark); border-radius: 0 12px 12px 0; font-weight: 600; }
.prose blockquote p { margin: 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--green-900); color: var(--on-green); padding: var(--space-4); border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { margin: 1.3em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* Inline practice CTA (green card inside articles / blog footer) */
/* Answers: the short answer that opens every /answers page. Visually the lede, but its own
   class because it is also the exact string published into FAQPage on the topic hub. */
.answer-lede { font-size: 1.16rem; line-height: 1.6; color: var(--ink); font-weight: 500; margin: 0 0 var(--space-4); padding-left: var(--space-4); border-left: 3px solid var(--primary); }

.blog-cta { margin-top: var(--space-6); text-align: center; background: var(--green-900); color: var(--on-green); border: 0; }
.blog-cta h2, .blog-cta h3 { color: var(--on-green); margin-top: 0; }
.blog-cta p { color: var(--on-green-body); }

/* ============================ Footer (green) ============================ */
/* No top margin: the footer sits flush against whatever precedes it — seamless green
   when a green CTA band closes the page (home/pricing/blog), and directly after a
   cream section's own bottom padding elsewhere. A stray margin here shows the page
   background as a divider strip between two green blocks. */
.sitefooter { background: var(--green-900); color: var(--nav-fg); }
.sitefooter__inner { max-width: 1180px; margin: 0 auto; padding: var(--space-7) var(--space-6) var(--space-5); display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 768px) { .sitefooter__inner { grid-template-columns: 1.6fr 1.1fr 1fr 1fr; gap: var(--space-5); } }
.sitefooter__name { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--on-green); }
.sitefooter__logo { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; font-family: var(--display); font-weight: 800; font-size: 13px; }
.sitefooter__brand p { margin: var(--space-2) 0 0; max-width: 24rem; }
.sitefooter .muted { color: var(--on-green-muted); }
.sitefooter__col h4 { font-family: var(--body); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--on-green-muted); margin: 0 0 var(--space-3); font-weight: 700; }
.sitefooter__col nav { display: flex; flex-direction: column; gap: var(--space-2); }
.sitefooter__col a { color: var(--nav-fg); text-decoration: none; font-size: var(--text-sm); line-height: 1.35; }
.sitefooter__col a:hover { text-decoration: underline; color: var(--on-green); }
.sitefooter__legal { max-width: 1180px; margin: 0 auto; padding: var(--space-4) var(--space-6) var(--space-6); border-top: 1px solid var(--hairline-green); font-size: var(--text-xs); }
.sitefooter__legal .muted { color: var(--on-green-muted); }

/* ============================ Mobile ============================ */
@media (max-width: 767px) {
  .container { padding: var(--space-5) var(--space-4) var(--space-7); }
  .topbar__inner { padding: var(--space-3) var(--space-4); }
  body.nav-locked { overflow: hidden; }
  /* Nav collapses to a fixed overlay (out of flow), so push the toggle to the right edge. */
  .topbar__toggle { display: inline-flex; margin-left: auto; }
  /* Only the header brand link sits above the fixed nav overlay — not the auth/onboarding
     page brand <span>s (same class), which would otherwise bleed through the open menu. */
  .topbar a.topbar__brand { position: relative; z-index: 62; }
  /* Nav links collapse into a full-screen green overlay */
  .topbar__nav {
    position: fixed; inset: 0; z-index: 60;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 0; margin: 0; padding: 76px var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
    background: var(--green-900); overflow-y: auto;
    transform: translateX(100%); visibility: hidden;
    transition: transform .22s ease, visibility .22s;
  }
  .topbar__nav.is-open { transform: translateX(0); visibility: visible; }
  .topbar__nav > a, .topbar__nav .topbar__cta, .topbar__nav form.button_to {
    width: 100%; min-height: 56px; display: flex; align-items: center;
    font-size: 20px; border-bottom: 1px solid var(--hairline-green); padding: 0;
  }
  .topbar__nav > a:hover { border-bottom-color: var(--hairline-green); color: var(--on-green); }
  .topbar__nav .topbar__cta, .topbar__nav form.button_to .btn {
    justify-content: center; min-height: 52px; margin-top: var(--space-4);
    border-bottom: 0; font-size: 16px;
  }
  .topbar__nav form.button_to { border-bottom: 0; }
  .topbar__nav .btn--ghost { width: 100%; }
  /* Account links render flat in the overlay — no accordion, no indent. The account
     Stimulus controller still toggles [hidden], but the trigger is hidden and the menu
     is forced visible below, so that state is inert on mobile. */
  /* Block (not the desktop inline-flex) so the menu fills the row instead of shrinking to content */
  .topbar__account { display: block; width: 100%; position: static; }
  .topbar__account-trigger { display: none; }
  .topbar__account-email { display: none; }
  .topbar__account-menu {
    flex-direction: column; gap: 0;
    position: static; min-width: 0; background: transparent;
    border: 0; box-shadow: none; padding: 0;
  }
  /* Force the menu open on mobile — !important is required to beat the global reset
     `[hidden] { display: none !important }`; the .topbar__account scope keeps it scoped. */
  .topbar__account .topbar__account-menu[hidden] { display: flex !important; }
  .topbar__account-menu form.button_to { width: 100%; margin: 0; border-bottom: 0; }
  /* Match the top-level overlay link rows (.topbar__nav > a): flush, full-width, bordered,
     same muted --nav-fg default brightening to --on-green on hover — one cohesive list. */
  .topbar__account-item,
  .topbar__nav a.topbar__account-item {
    width: 100%; min-height: 56px; display: flex; align-items: center;
    padding: 0; font-size: 20px; font-weight: 500; color: var(--nav-fg);
    background: transparent;
    border: 0; border-bottom: 1px solid var(--hairline-green); border-radius: 0;
  }
  .topbar__account-item:hover,
  .topbar__nav a.topbar__account-item:hover { background: transparent; color: var(--on-green); }
  .section { padding: var(--space-7) var(--space-4); }
  .diff-head { flex-direction: column; align-items: flex-start; }
  .authsplit__pane { padding: 28px 24px; }
  .sessionbar { position: static; }
  .hero-band__inner { padding-left: var(--space-4); padding-right: var(--space-4); }
  /* Pricing: lead with the hero (most-chosen) plan on small screens */
  .pricing-card--featured { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
