/* myplan: Coffee Break look. Colours and sizes come from design-reference/ and BLUEPRINT.md §4 and §18. */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "DM Serif Display";
  src: url("../assets/fonts/DMSerifDisplay-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("../assets/fonts/DMSerifDisplay-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Tokens ----------
 * Official RAHR palette (assets/Brand Colours.pdf): Indigo #260E58, Lavender #977DD1,
 * Heather #D8CBF6, Thistle #E6DCF9, Poppy #FE5E47, plus tints. See BLUEPRINT.md §4.
 */
:root {
  --purple: #260E58;           /* Indigo */
  --purple-mid: #3A226E;       /* Lavender at 18% over Indigo: cards on Indigo */
  --purple-border: #59408E;    /* Lavender at 45% over Indigo: subtle lines on Indigo */
  --purple-line: #977DD1;      /* Lavender: outlines on Indigo */
  --lavender: #D8CBF6;         /* Heather: secondary text on Indigo */
  --lavender-light: #E6DCF9;   /* Thistle: body text on Indigo */
  --eyebrow: #5C4A82;          /* Indigo 75% tint: small labels on light backgrounds */
  --coral: #FE5E47;            /* Poppy: headline accent word */
  --coral-strong: #FE5E47;     /* Poppy: primary buttons (large text only, per brand pairings) */
  --coral-strong-hover: #E54A33;
  --coral-on-purple: #D8CBF6;  /* small labels on the Indigo card use Heather */
  --page: #F3EEFB;             /* Thistle 50% tint */
  --card: #FFFFFF;
  --card-border: #E6DCF9;      /* Thistle */
  --rule: #F3EEFB;             /* Thistle 50% tint */
  --text: #260E58;             /* Indigo */
  --muted: #5C4A82;            /* Indigo 75% tint */
  --control-border: #977DD1;   /* Lavender: input outlines, 3:1 against white */
  --soft-border: #D8CBF6;      /* Heather */
  --chip-bg: #E6DCF9;          /* Thistle */
  --typical-bg: #FFD7D1;       /* Poppy 25% tint: "typical" tags and banner */
  --typical-text: #260E58;
  --typical-border: #FFAFA3;   /* Poppy 50% tint */
  --error-on-purple: #FFAFA3;  /* Poppy 50% tint */
  /* Status colours are functional signals, not brand colours. */
  --yours-bg: #E3F4EE;
  --yours-text: #0B5E45;
  --tight: #F2A33A;
  --nofit: #C62828;
  --focus: #FE5E47;
  --shadow: rgba(38, 14, 88, 0.18);

  --serif: "DM Serif Display", Georgia, serif;
  --sans: Inter, "Helvetica Neue", Arial, sans-serif;
  --radius-card: 16px;
  --radius-small: 14px;
  --max: 1180px;
  --gutter: 32px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--purple); }
a:hover { color: var(--coral-strong); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--card); color: var(--purple); padding: 10px 16px; border-radius: 999px; font-weight: 600;
}
.skip-link:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
[hidden] { display: none !important; }

/* ---------- Type helpers ---------- */
.eyebrow {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600;
  color: var(--eyebrow); margin: 0 0 10px;
}
.eyebrow.on-purple { color: var(--lavender); }
.h-display { font-family: var(--serif); font-weight: 400; color: var(--purple); margin: 0; }
.accent { font-style: italic; color: var(--coral); }
.lead { font-size: 17px; color: var(--muted); max-width: 760px; line-height: 1.6; margin: 0 0 22px; }

/* ---------- Header ---------- */
.site-header { background: var(--purple); color: #FFFFFF; }
.site-header .bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 16px; padding-bottom: 16px;
}
.logo { display: block; height: 46px; width: auto; }
.logo-link { display: block; border-radius: 6px; }
.header-start .bar { padding-top: 20px; padding-bottom: 20px; }
.header-start .logo { height: 56px; }
.header-links { display: flex; gap: 8px 28px; flex-wrap: wrap; }
.header-link {
  background: none; border: 0; color: #FFFFFF; font-size: 15px; font-weight: 500;
  padding: 10px 0; min-height: 44px; cursor: pointer; text-decoration: none;
}
.header-link:hover { color: var(--lavender); text-decoration: underline; }

/* Step tracker */
.steps { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.step {
  font-size: 14px; padding: 8px 14px; border-radius: 999px; min-height: 40px;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--purple-border); background: transparent; color: var(--lavender);
}
.step.is-done { background: var(--purple-mid); border-color: var(--purple-mid); cursor: pointer; }
.step.is-done:hover { border-color: var(--lavender); color: #FFFFFF; }
.step.is-current { background: #FFFFFF; border-color: #FFFFFF; color: var(--purple); font-weight: 600; }
.step:disabled { cursor: default; }

/* Save status + plan menu */
.header-tools { display: flex; align-items: center; gap: 14px; }
.save-status { font-size: 13px; color: var(--lavender); display: inline-flex; gap: 6px; align-items: center; }
.save-status.is-warning { color: var(--error-on-purple); }
.menu { position: relative; }
.menu-button {
  background: transparent; color: #FFFFFF; border: 1px solid var(--purple-line); border-radius: 999px;
  padding: 8px 14px; min-height: 44px; font-size: 14px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.menu-button:hover { border-color: #FFFFFF; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 240px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 6px;
  box-shadow: 0 12px 30px var(--shadow); list-style: none; margin: 0;
}
.menu-item {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px;
  padding: 11px 12px; min-height: 44px; color: var(--text); font-size: 15px; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--page); }
.menu-item small { display: block; color: var(--muted); font-size: 13px; }
.menu-item.is-danger { color: var(--nofit); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 600; padding: 12px 24px; min-height: 48px; border-radius: 999px;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
}
/* White on Poppy is approved for large type only, so primary buttons use 19px bold (WCAG large text). */
.btn-primary { background: var(--coral-strong); color: #FFFFFF; font-size: 19px; font-weight: 700; }
.btn-primary:hover { background: var(--coral-strong-hover); color: #FFFFFF; }
.btn-secondary { background: #FFFFFF; color: var(--purple); border-color: var(--soft-border); }
.btn-secondary:hover { border-color: var(--purple); color: var(--purple); }
.btn-danger { background: var(--nofit); color: #FFFFFF; }
.btn-danger:hover { background: #A51F1F; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px; }
.link-button {
  background: none; border: 0; padding: 8px 4px; min-height: 44px; cursor: pointer;
  color: inherit; text-decoration: underline; text-underline-offset: 3px; font-size: inherit;
}
.chip {
  font-size: 14px; padding: 8px 14px; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--soft-border); background: #FFFFFF; color: var(--purple); cursor: pointer;
}
.chip:hover { border-color: var(--purple); }

.nav-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- Cards, tags, banners ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 24px;
}
.card-title { font-weight: 600; font-size: 17px; margin: 0 0 12px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.tag-typical { background: var(--typical-bg); color: var(--typical-text); }
.tag-yours { background: var(--yours-bg); color: var(--yours-text); }
.tag-engine { background: var(--chip-bg); color: var(--purple); }
.banner {
  background: var(--typical-bg); border: 1px solid var(--typical-border); border-radius: 12px;
  padding: 12px 16px; font-size: 14px; color: var(--typical-text); margin-bottom: 24px;
}
.note { font-size: 14px; color: var(--muted); background: var(--page); border-radius: 12px; padding: 12px 14px; }

/* Form controls on white */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: 14px; font-weight: 500; }
.input {
  width: 100%; font-size: 15px; padding: 9px 12px; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--control-border); background: #FFFFFF; color: var(--text);
}

/* ---------- Start screen ---------- */
.hero { background: var(--purple); color: #FFFFFF; }
.hero-inner { display: flex; gap: 48px; flex-wrap: wrap; align-items: flex-start; padding-top: 64px; padding-bottom: 88px; }
.hero-copy { flex: 999 1 520px; min-width: 0; }
.hero-copy .eyebrow { margin-bottom: 16px; }
.hero-title { font-family: var(--serif); font-weight: 400; font-size: 64px; line-height: 1.05; margin: 0 0 24px; color: #FFFFFF; }
.hero-slogan { margin: 0 0 12px; font-size: 24px; line-height: 1.4; font-weight: 500; color: #FFFFFF; max-width: 620px; }
.hero-text { margin: 0 0 28px; font-size: 19px; line-height: 1.6; color: var(--lavender-light); max-width: 620px; }
.privacy-line { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--lavender); }

.start-card {
  flex: 1 1 380px; min-width: 0; background: var(--purple-mid); border: 1px solid var(--purple-border);
  border-radius: 16px; padding: 28px;
}
.start-card .kicker {
  font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 600;
  color: var(--coral-on-purple); margin: 0 0 14px;
}
.start-card h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 18px; }
.start-card .q-label { display: block; font-size: 14px; font-weight: 500; margin: 0 0 8px; padding: 0; }
.start-card fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.start-card .optional { font-weight: 400; color: var(--lavender); }

.toggle-group { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle {
  font-size: 14px; padding: 10px 16px; min-height: 44px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--purple-line); background: transparent; color: #FFFFFF;
}
.toggle[aria-pressed="true"] { background: #FFFFFF; color: var(--purple); border-color: #FFFFFF; font-weight: 600; }
.toggle:hover { border-color: #FFFFFF; }

.input-dark {
  width: 100%; font-size: 15px; padding: 10px 12px; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--purple-line); background: var(--purple); color: #FFFFFF; margin-bottom: 18px;
}
.input-dark::placeholder { color: var(--purple-line); }
.input-dark.is-invalid { border-color: var(--error-on-purple); }
.field-error { color: var(--error-on-purple); font-size: 14px; margin: -10px 0 16px; }

.radio-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.radio-card {
  display: flex; gap: 10px; align-items: center; font-size: 15px; padding: 10px 12px; min-height: 44px;
  border-radius: 10px; border: 1px solid var(--purple-border); cursor: pointer;
}
.radio-card:hover { border-color: var(--purple-line); }
.radio-card:has(input:checked) { background: var(--purple); border-color: #FFFFFF; }
.radio-card input { width: 18px; height: 18px; margin: 0; accent-color: var(--coral-strong); flex: none; }
.radio-card .hint { display: block; font-size: 13px; color: var(--lavender); }

.resume-box {
  background: var(--purple); border: 1px solid var(--purple-line); border-radius: 12px; padding: 14px; margin-bottom: 18px;
  font-size: 14px; color: var(--lavender-light);
}
.resume-box strong { color: #FFFFFF; }
.resume-detail { display: block; margin-top: 4px; color: var(--lavender); font-size: 13px; }
.start-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-on-purple { background: transparent; color: #FFFFFF; border-color: var(--purple-line); }
.btn-on-purple:hover { border-color: #FFFFFF; color: #FFFFFF; }

.start-links { text-align: center; margin-top: 10px; font-size: 14px; color: var(--lavender); }
.start-links .link-button { color: var(--lavender); }
.start-links .link-button:hover { color: #FFFFFF; }
.shared-note {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--purple-border);
  font-size: 13px; color: var(--lavender); line-height: 1.5;
}
.shared-note svg { flex: none; margin-top: 1px; }

.stages-overview { padding-top: 56px; padding-bottom: 64px; }
.stages-overview .eyebrow { margin-bottom: 20px; }
.stage-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.stage-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-small); padding: 18px; }
.stage-card .num { font-family: var(--serif); font-size: 30px; color: var(--purple); line-height: 1.2; }
.stage-card h3 { font-weight: 600; font-size: 16px; margin: 6px 0 4px; }
.stage-card p { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0; }
.stage-card .time { font-size: 13px; color: var(--eyebrow); margin-top: 10px; }

.how-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; list-style: none; margin: 24px 0 0; padding: 0; }
.how-tile { background: var(--chip-bg); border-radius: var(--radius-small); padding: 18px 20px; }
.how-tile h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; color: var(--purple); }
.how-tile p { font-size: 14px; line-height: 1.5; margin: 0; color: var(--text); }
.how-tile-handy { background: var(--card); border: 1px dashed var(--control-border); }

/* ---------- Stage screens ---------- */
.stage-main { padding-top: 40px; padding-bottom: 64px; }
.stage-title { font-size: 44px; line-height: 1.15; margin-bottom: 10px; }

/* ---------- Stage forms ---------- */
.stack { display: grid; gap: 18px; }
.form-card .card-title { font-size: 19px; color: var(--purple); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-intro { color: var(--muted); font-size: 15px; margin: -4px 0 16px; max-width: 760px; }
.sub { font-size: 14px; font-weight: 600; color: var(--purple); margin: 18px 0 10px; }
.form-card .sub:first-of-type { margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 20px; }
.field .field-label { color: var(--text); }
.optional { font-weight: 400; color: var(--muted); }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-wrap { position: relative; flex: 1; min-width: 0; }
.input-wrap .input { width: 100%; }
.input-wrap.has-pre .input { padding-left: 26px; }
.input-wrap.has-post .input { padding-right: 44px; }
.adorn { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
.adorn-pre { left: 12px; }
.adorn-post { right: 12px; }
.input[aria-invalid="true"] { border-color: var(--nofit); box-shadow: 0 0 0 1px var(--nofit); }
.is-readonly .input { background: var(--rule); color: var(--muted); border-color: var(--card-border); }
.tag-slot { flex: none; min-width: 96px; }
.help { font-size: 13px; color: var(--muted); margin: 2px 0 0; line-height: 1.5; }
.muted { color: var(--muted); }
.textarea { resize: vertical; min-height: 64px; line-height: 1.5; padding: 10px 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip-small { font-size: 13px; padding: 6px 12px; min-height: 36px; background: var(--rule); border-color: var(--card-border); }
.chip-small:hover { background: #FFFFFF; }
.tag-from2026 { background: var(--chip-bg); color: var(--purple); }
.note-hst { margin: 0; }
.link-button.inline { min-height: 0; padding: 0; color: var(--purple); font-weight: 600; }
.is-highlight { outline: 3px solid var(--coral); outline-offset: 6px; border-radius: 12px; transition: outline-color 0.3s; }

.table-wrap { overflow-x: auto; }
.source-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.source-table th, .source-table td { padding: 7px 8px; border-top: 1px solid var(--rule); text-align: left; }
.source-table thead th { font-size: 13px; color: var(--eyebrow); font-weight: 600; border-top: 0; }
.source-table th[scope="row"] { font-weight: 400; }
.source-table td { width: 120px; }
.input-small { width: 90px; min-height: 40px; padding: 6px 10px; text-align: right; }
.count-pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; margin: 0 0 8px; }
.count-pill.is-match { background: var(--yours-bg); color: var(--yours-text); }
.count-pill.is-off { background: #FDEBCF; color: #7A3E06; }
.calc-line { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-top: 8px; background: var(--rule); border-radius: 12px; }

.per-deal-row + .per-deal-row { border-top: 1px solid var(--rule); margin-top: 8px; }

.glance-card { border: 2px solid var(--purple); }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.glance-item { background: var(--rule); border-radius: 12px; padding: 12px 14px; }
.glance-value { font-size: 20px; font-weight: 600; color: var(--purple); }

.range { width: 100%; accent-color: var(--coral); min-height: 32px; }
.range-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.range-ends span:nth-child(2) { font-weight: 600; color: var(--purple); }

.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Protected-time week grid (Stage 2) */
.slot-grid { display: grid; grid-template-columns: 92px repeat(7, minmax(0, 1fr)); gap: 6px; align-items: stretch; max-width: 620px; }
.slot-corner { display: block; }
.slot-day {
  font-size: 13px; font-weight: 600; min-height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--purple);
}
.slot-day:hover { border-color: var(--control-border); }
.slot-day[aria-pressed="true"] { background: var(--chip-bg); }
.slot-part { font-size: 13px; font-weight: 600; color: var(--purple); display: flex; flex-direction: column; justify-content: center; }
.slot-hint { font-size: 11px; font-weight: 400; color: var(--muted); }
.slot {
  min-height: 44px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--control-border); background: #FFFFFF;
}
.slot:hover { border-color: var(--purple); }
.slot[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); }
@media (max-width: 640px) {
  .slot-grid { grid-template-columns: 70px repeat(7, minmax(0, 1fr)); gap: 4px; }
  .slot-hint { display: none; }
  .slot-day { font-size: 12px; padding: 0; }
}
.pill-toggle {
  font-size: 14px; padding: 8px 16px; min-height: 44px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--control-border); background: #FFFFFF; color: var(--purple);
}
.pill-toggle[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: #FFFFFF; font-weight: 600; }
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }

.mix { display: grid; gap: 6px; }
.mix-row { display: grid; grid-template-columns: 90px 1fr 56px; gap: 14px; align-items: center; }
.mix-row label { font-weight: 500; }
.mix-row output { font-weight: 600; text-align: right; color: var(--purple); font-size: 17px; }

.headline-input { font-family: var(--serif); font-size: 22px; color: var(--purple); }
.headline-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

.switch { display: inline-flex; gap: 10px; align-items: center; min-height: 44px; margin-bottom: 8px; cursor: pointer; font-size: 15px; }
.switch input { width: 20px; height: 20px; accent-color: var(--purple); }

.actual-2026 { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.actual-2026 strong { color: var(--purple); }
.compare-line { flex-wrap: wrap; margin: 0 0 8px; font-size: 14px; }

/* Number checks */
.field-warn {
  margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: #FDEBCF; color: #5A2D04; border-left: 4px solid var(--tight);
}
.totals-row { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; padding: 12px 8px 4px; border-top: 2px solid var(--card-border); }
.totals-label { font-size: 14px; font-weight: 600; margin-right: auto; }
.totals-row .count-pill { margin: 0; font-size: 14px; }
.checks-card { border: 2px solid var(--tight); }
.checks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: #FDEBCF; border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #5A2D04; }
.checks-list .chip { flex: none; }

.disclosure { color: var(--purple); font-weight: 600; font-size: 15px; padding-left: 0; }
.sub-intro { margin: -4px 0 12px; }
.grid-wide-labels { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---------- Stage 3 results ---------- */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.plan-main, .plan-side { display: grid; gap: 18px; min-width: 0; }
@media (max-width: 900px) { .plan-layout { grid-template-columns: minmax(0, 1fr); } }
.floor-line { margin-top: 14px; background: #FFFFFF; border: 1px dashed var(--control-border); border-radius: 14px; padding: 14px 18px; font-size: 15px; }
.floor-line p { margin: 0; }
.plan-main [data-region="plans"] > .plan-card + .plan-card, .floor-line + .plan-card { margin-top: 14px; }
.chain { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.chain li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.chain-op { font-weight: 700; color: var(--coral); font-size: 18px; line-height: 1.2; text-align: center; }
.chain-line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.chain-line strong { color: var(--purple); white-space: nowrap; }
.chain-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.two-up > [data-region] > .card { height: 100%; }
.plan-card.is-target { border: 2px solid var(--purple); }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.plan-eyebrow { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; color: var(--eyebrow); margin: 0 0 12px; }
.plan-head .plan-eyebrow { margin: 0; }
.status-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.status-fits { background: var(--yours-bg); color: var(--yours-text); }
.status-tight { background: #FDEBCF; color: #7A3E06; }
.status-nofit { background: #FDE2E2; color: #8E1B1B; }
.plan-amount { font-family: var(--serif); font-size: 40px; color: var(--purple); margin-bottom: 14px; line-height: 1.2; }
.plan-amount span { font-family: var(--sans); font-size: 15px; color: var(--muted); }
.plan-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 15px; }
.plan-row span:first-child { color: var(--muted); }
.plan-row .strong { font-weight: 600; }
.stat-box { margin-top: 14px; background: var(--rule); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 600; color: var(--purple); }
.stat-sub { font-size: 13px; color: var(--muted); }
.cushion { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.cushion strong { color: var(--purple); }
.plan-warning, .flag { background: var(--typical-bg); color: var(--typical-text); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 12px 0 0; }
.plan-empty { color: var(--muted); margin: 8px 0 16px; }

.capacity-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.light { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.light-fits { background: #2E9E78; }
.light-tight { background: var(--tight); }
.light-nofit { background: var(--nofit); }
.capacity-status { font-size: 20px; font-weight: 600; }
.status-text-fits { color: var(--yours-text); }
.status-text-tight { color: #7A3E06; }
.status-text-nofit { color: #8E1B1B; }
/* Named "capacity-meter" so it can't clash with the header's ".bar" row. */
.capacity-meter { height: 12px; border-radius: 999px; background: var(--rule); overflow: hidden; margin-bottom: 10px; }
.capacity-meter-fill { height: 12px; }
.meter-fits { background: #2E9E78; }
.meter-tight { background: var(--tight); }
.meter-nofit { background: var(--nofit); }
.levers-label { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.stat-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat-tile { background: var(--rule); border-radius: 12px; padding: 14px; }

/* ---------- Stage 4: lead engines ---------- */
.engines-layout { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.alloc-card { flex: 1 1 360px; min-width: 0; }
.engine-grid { flex: 999 1 560px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.alloc-table td.num-cell, .alloc-table th.num-cell { width: 56px; padding-left: 4px; padding-right: 4px; text-align: right; }
.alloc-table td.num-cell { color: var(--muted); }
.alloc-table .input-small { width: 60px; }
.source-name { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.alloc-table th[scope="row"] .help { display: block; font-weight: 400; }
.alloc-table .field-warn { font-weight: 400; }
.alloc-table .sub-row td { border-top: 0; padding-top: 0; width: auto; }
.alloc-table .sub-row .field { margin: 0 0 6px; }
.banner-inline { margin: 0 0 12px; }

.engine-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.engine-card .field { margin-bottom: 4px; }
.engine-eyebrow { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; color: var(--eyebrow); margin: 0; }
.engine-title { font-weight: 600; font-size: 18px; color: var(--purple); margin: 0; }
.engine-name { font-weight: 600; font-size: 17px; color: var(--purple); }
.engine-out { background: var(--rule); border-radius: 12px; padding: 14px; }
.engine-big { font-family: var(--serif); font-size: 30px; color: var(--purple); line-height: 1.15; margin: 2px 0; }
.engine-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--card-border); }
.engine-figure { font-size: 17px; font-weight: 600; color: var(--purple); }
.engine-build { margin: 6px 0 0; font-size: 12px; }
.engine-card .note { margin: 4px 0 0; font-size: 13px; }
.engine-card .rhythm { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.remove-engine { align-self: flex-start; font-size: 14px; color: var(--muted); padding-left: 0; }
.engine-add { border: 2px dashed var(--soft-border); border-radius: 16px; padding: 20px; }
.engine-add h3 { margin: 0 0 4px; font-size: 16px; color: var(--purple); }

.stat-box-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.plan-now-card { border: 2px solid var(--purple); }
.change-note { background: var(--chip-bg); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 4px 0 0; }
.budget-auto { margin-bottom: 8px; }

/* ---------- Stage 5: commit ---------- */
.small-link { font-size: 13px; min-height: 32px; padding: 4px 0; color: var(--muted); align-self: flex-start; }
.score-table { display: grid; gap: 8px; }
.score-head, .score-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 96px; gap: 10px; align-items: center; }
.score-head { font-size: 13px; font-weight: 600; color: var(--eyebrow); }
.score-head span:last-child { display: none; }
.protected-summary { background: var(--rule); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.block-card { border: 1px solid var(--card-border); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.block-top { display: grid; grid-template-columns: 70px minmax(0, 160px) auto minmax(0, 160px) 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.block-top .remove-engine { justify-self: end; }
.block-label { font-weight: 600; font-size: 14px; }
.day-toggle { min-width: 52px; padding: 8px 10px; }
.add-block { margin: 2px 0 6px; }
.blocks-total { margin-top: 6px; }
.launch-start { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.launch-start .input { width: auto; }
.launch-chips { margin: 0 0 14px; }
.launch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.launch-month { border: 1px solid var(--card-border); border-radius: 14px; padding: 12px 14px 4px; margin: 0; min-width: 0; }
.launch-month legend { font-weight: 600; color: var(--purple); padding: 0 6px; }
.launch-item { margin-bottom: 14px; }
.launch-item .field-label { display: block; font-size: 13px; margin-bottom: 4px; }
.launch-text, .goal-text { min-height: 64px; }
.due-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.due-label { font-size: 13px; font-weight: 600; color: var(--purple); white-space: nowrap; }
.due-row .input { flex: 1; min-width: 0; }

@media (max-width: 640px) {
  .score-head { display: none; }
  .score-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .score-row .tag-slot { display: none; }
  .block-top { grid-template-columns: 1fr 1fr; }
  .block-top .block-label { grid-column: 1; }
  .block-top .remove-engine { grid-column: 2; grid-row: 1; }
  .block-top .muted { display: none; }
}

/* Outside agents: optional RAHR fee comparison (Stage 3) */
.rahr-compare { margin-top: 10px; }
.disclosure.quiet { font-weight: 400; color: var(--muted); font-size: 14px; }
.compare-card { margin-top: 6px; }

/* ---------- Closing screen ---------- */
.next-list { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }
.closing-actions { gap: 10px; }
.shared-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.shared-card p { margin: 0; }
.two-up > div > .card { height: 100%; }
.nps-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.nps-pill { padding: 8px 0; min-width: 0; border-radius: 10px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 15px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--purple); }
.coming-soon { font-size: 13px; color: var(--muted); margin: 6px 0 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 640px) { .nps-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Review page ---------- */
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.review-head .card-title { margin: 0; }
.review-list { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.review-list dt { color: var(--muted); }
.review-list dd { margin: 0; color: var(--text); }
.review-headline { border: 2px solid var(--purple); }
.review-quote { font-family: var(--serif); font-size: 26px; line-height: 1.3; color: var(--purple); margin: 0; }
.review-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
@media (max-width: 640px) { .review-list { grid-template-columns: 1fr; } .review-list dd { margin-bottom: 6px; } }

/* ---------- Dialog ---------- */
.dialog {
  border: 0; border-radius: 16px; padding: 0; max-width: 460px; width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(38, 14, 88, 0.3); color: var(--text);
}
.dialog::backdrop { background: rgba(38, 14, 88, 0.55); }
.dialog-body { padding: 26px; }
.dialog h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--purple); margin: 0 0 10px; }
.dialog p { margin: 0 0 12px; color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: #FFFFFF; padding: 12px 20px; border-radius: 999px; font-size: 15px;
  box-shadow: 0 10px 30px rgba(38, 14, 88, 0.3); max-width: calc(100% - 32px); text-align: center;
}

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .header-stage .bar { justify-content: flex-start; }
  .header-stage nav { order: 3; width: 100%; }
  .header-tools { margin-left: auto; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .hero-inner { padding-top: 36px; padding-bottom: 48px; gap: 32px; }
  .hero-title { font-size: 44px; }
  .hero-slogan { font-size: 20px; }
  .hero-text { font-size: 17px; }
  .start-card { padding: 20px; }
  .stage-title { font-size: 34px; }
  .step .step-name { display: none; }
  .step.is-current .step-name { display: inline; }
  .save-status .save-text { display: none; }
  .nav-row .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
