/* ==========================================================================
   Atlas Foundry — products/sa-tax/css/screens.css — Self Assessment screens

   Styling for the tax calculator's own screens.

   KNOWN: this file still contains a number of Core component blocks
   (Toast, Donut chart, Monthly ledger, Comparison Card and others). They
   were authored late in the original stylesheet, interleaved with screen
   styles, and several are load-bearing — .card in particular deliberately
   overrides three per-screen variants. Extracting them changes the
   cascade and visibly alters the app, so Stage 3 leaves them here. See
   extraction/STAGE-3-CSS-SPLIT.md.

   [Core extraction, Stage 3] Split from the single css/styles.css at ONE
   line boundary, so the two files concatenated in load order are the
   original file byte-for-byte. That is what makes the cascade provably
   unchanged: no rule moved relative to any other rule.
   ========================================================================== */
/* ---- Dashboard ------------------------------------------------------------ */
.dashboard {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dashboard__greeting {
  margin: 0;
}

.dash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.dash-banner__title {
  color: #fff;
}

.dash-banner__body {
  margin-top: var(--space-1);
  color: rgba(255, 255, 255, 0.72);
  max-width: 52ch;
}

.dash-banner .button--primary {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
}

.dash-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dash-card--span-3 { grid-column: span 3; }
.dash-card--span-4 { grid-column: span 4; }
.dash-card--span-6 { grid-column: span 6; }
.dash-card--span-12 { grid-column: span 12; }

.dash-card__label {
  margin: 0;
}

.dash-card__value {
  margin: var(--space-1) 0 0;
  color: var(--text-primary);
}

.dash-card__secondary {
  margin: 0;
}

.dash-card__empty-hint {
  margin-top: var(--space-2);
  color: var(--text-secondary);
}

.dash-ring-empty {
  margin-top: var(--space-2);
}

.poa-mini-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.poa-mini-list__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* ---- "What's next" module — fills the Dashboard's lower empty space with
   real (or onboarding) action rows instead of a flat void. -------------- */
.whats-next-card {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.next-action-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background var(--motion-fast) var(--motion-easing);
}

.next-action-row:hover {
  background: var(--surface-canvas);
}

.next-action-row__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(47, 184, 172, 0.12);
  color: var(--accent-teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.next-action-row__text {
  flex: 1 1 auto;
  min-width: 0;
}

.next-action-row__title {
  margin: 0;
  font-weight: 500;
}

/* 4px, not 2px: the title and its explanation touched (calculator UI/UX
   audit, H1, 13 September 2026). Still closer than the next row. */
.next-action-row__subtitle {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
}

.next-action-row__arrow {
  flex: 0 0 auto;
  color: var(--text-secondary);
}

/* Tablet: KPI grid drops to 2 cards per row (UX Spec §8.2) */
@media (max-width: 1199px) {
  /* kpi-card and chart-card removed 4 September 2026 — they are Core
     components and their layout now lives in core/css/components.css, so every
     package gets it. Small Business Manager had none of this. */
  .dash-card--span-3,
  .dash-card--span-4,
  .dash-card--span-6 {
    grid-column: span 6;
  }
}

/* Mobile: single column (UX Spec §8.3) */
@media (max-width: 767px) {
  .dashboard-grid {
    gap: var(--space-3);
  }
  .dash-card--span-3,
  .dash-card--span-4,
  .dash-card--span-6,
  .dash-card--span-12 {
    grid-column: span 12;
  }
  .dash-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  /* [V2.1 feedback] The banner's CTA keeps `white-space: nowrap` and
     `flex: 0 0 auto` at desktop widths, which is right there — but
     stacked into a 320px column it made the button wider than the card
     and pushed the whole page into horizontal scroll (WCAG 1.4.10).
     Measured at 320px: 206px of usable width against a 267px button.
     This was already marginal before V2.1 ("Add your first income
     entry" measured 244px, 38px over, and happened to land just inside
     the test's tolerance); the longer, more accurate labels the
     dashboard now uses took it past the line, and the longest of them
     ("Add your self-employment income") measures 301px. Letting the
     label wrap and giving the button the full column width fixes it for
     any label rather than for the ones that fit today. */
  .dash-banner .button--primary {
    white-space: normal;
    width: 100%;
  }
}

/* ---- Stepper input (number of children) ----------------------------------- */
.stepper-input {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control);
  overflow: hidden;
  width: fit-content;
}

.stepper-input__btn {
  appearance: none;
  border: none;
  background: var(--surface-canvas);
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-primary);
}

.stepper-input__btn:hover {
  background: var(--border-hairline);
}

/* Background and ink from the theme. [13 September 2026] With neither set,
   the browser drew a white box and the field inherited near-white text in dark
   mode: the number of children measured 1.08:1 and could not be read
   (calculator UI/UX audit, H5). */
.stepper-input__field {
  border: none;
  width: 56px;
  text-align: center;
  padding: var(--space-2) 0;
  background: var(--surface-card);
  color: var(--text-primary);
}

/* ---- Toggle field (Receiving Child Benefit) -------------------------------- */
.toggle-field__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.toggle-field__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-field__track {
  width: 40px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--border-hairline);
  position: relative;
  transition: background var(--motion-fast) var(--motion-easing);
  flex: 0 0 auto;
}

.toggle-field__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--motion-fast) var(--motion-easing);
}

.toggle-field__input:checked + .toggle-field__track {
  background: var(--accent-teal);
}

.toggle-field__input:checked + .toggle-field__track::after {
  transform: translateX(18px);
}

.toggle-field__input:focus-visible + .toggle-field__track {
  outline: 2px solid var(--colour-focus-ring);
  outline-offset: 2px;
}

/* ---- Setup screen ----------------------------------------------------------- */
.setup-screen {
  max-width: var(--content-measure);
}

.setup-screen__intro {
  margin-top: var(--space-2);
  color: var(--text-secondary);
}

.setup-steps {
  display: flex;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.setup-steps__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.setup-steps__number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-caption-size);
  flex: 0 0 auto;
}

.setup-steps__item--active .setup-steps__number {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: #fff;
}

.setup-steps__item--active .setup-steps__label {
  color: var(--text-primary);
  font-weight: 600;
}

.setup-steps__item--done .setup-steps__number {
  background: var(--surface-canvas);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

/* Declaration removed 2 September 2026. It had never taken effect: .card and
   .entry-form are equally specific and came LATER in this same file, so source
   order decided and this always lost. Moving those two into
   core/css/components.css would have made it start applying — a visible change
   to a product already on sale — so the dead declaration goes instead and the
   product renders exactly as it does today. Recorded in
   products/sbm/DECISIONS.md §6 in case the effect was wanted. */
.setup-form__hint {
  color: var(--text-secondary);
}

/* ---- Rhythm inside the setup form [13 September 2026] ---------------------
   The form is a plain block inside its card, so Core's card rhythm spaces the
   form and not what is in it. Fields kept 16px below themselves and nothing
   else had any spacing, while the hint pulled itself UP by 8px to sit near its
   field. After a heading or a sentence that made it touch: "Do you have your
   2025/26 tax return to hand?" sat on its explanation, the Blind Person's
   Allowance note ran into "Marital / civil partnership status", and "I have it"
   sat on the caption beneath it (calculator UI/UX audit, H1).

   Every block now keeps 16px from the one above. Stacked margins overlap rather
   than add, so a field's own 16px is not doubled — except above a button, whose
   margin does add, so there it is taken away. A hint or caption explains the
   thing above it, so it sits at 8px: after a field, the field's 16px less 8. */
.setup-form > * + * {
  margin-top: var(--space-3);
}

/* Written out rather than grouped with :is(), so every selector starts with
   this product's own class (qa/cssOwnershipTest.mjs reads each one that way). */
.setup-form > h2 + .setup-form__hint,
.setup-form > h3 + .setup-form__hint,
.setup-form > p + .setup-form__hint,
.setup-form > p + p.text-caption,
.setup-form > button + .setup-form__hint,
.setup-form > button + p.text-caption {
  margin-top: var(--space-2);
}

.setup-form > .field + .setup-form__hint,
.setup-form > .field + p.text-caption {
  margin-top: calc(-1 * var(--space-2));
}

.setup-form > .field + button {
  margin-top: 0;
}

/* [Real user request, 17 August 2026] Prior Year step's "we found your
   recorded return" nudge — a suggestion, not a warning, so it borrows
   --colour-positive (the same teal used for "on track" states) rather
   than the coral alert-banner treatment reserved for actual problems. */
.setup-form__prior-year-nudge {
  border-top: 3px solid var(--colour-positive);
  margin-bottom: var(--space-4);
}

.setup-form__prior-year-nudge__title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.setup-form__prior-year-nudge > .button {
  margin-top: var(--space-3);
}

.setup-actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-4);
}

/* A section heading inside the setup form. The class was applied in setup.js
   and never styled, and the global reset zeroes heading margins — so "Tax in
   your code that belongs to another year" sat directly on top of the paragraph
   explaining it, with no gap at all. Reported by Jordan, 6 September 2026. */
.setup-form__section {
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

/* ---- Property: the parts of one property's card ---------------------------
   Four named parts with a rule above each, so a long card reads as sections
   rather than one run of fields. The first has no rule — it is the top. */
.property-section + .property-section {
  border-top: 1px solid var(--border-hairline);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

.property-section__title {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

/* ---- Tax Breakdown: how a section's figure is worked out -------------------
   Sits at the top of an expanded section, set apart from the figures below it
   so it reads as explanation rather than as another row. */
.breakdown-section-note {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  padding-left: var(--space-3);
  border-left: 2px solid var(--border-hairline);
  color: var(--text-secondary);
}

.breakdown-section-note__source {
  color: var(--accent-teal-text, var(--text-secondary));
}

/* ---- Setup: Review step ---------------------------------------------------- */
.setup-review {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ---- Sections, not cards inside a card -------------------------------------
   The Review step sits inside `.setup-step-card` like every other step of the
   wizard, and its four groups used to be `.card`s as well — so the last step of
   setup rendered as two concentric rounded boxes, 25px apart, where the first
   three rendered as one. Found in the 5 September 2026 UI/UX audit.

   The outer card stays: it is what makes step 4 look like steps 1-3. The groups
   inside it become what they actually are — sections, told apart by a heading
   and a rule rather than by a second border. The mapping onto the wizard steps
   you have just filled in, which is the whole point of the grouping, is
   unchanged. */
.setup-review__section + .setup-review__section {
  border-top: 1px solid var(--border-hairline);
  padding-top: var(--space-4);
}

.setup-review__heading {
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* ---- Setup: starting from another year's answers -------------------------
   The card's own sections are the Review step's (heading and rule, no second
   border); only the three buttons need a row of their own, wrapping on a phone. */
.setup-carry__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
}

/* On a phone the three buttons wrapped to three different widths, the middle
   one over two lines. One full-width button per row instead. */
@media (max-width: 767px) {
  .setup-carry__actions > .button {
    flex: 1 1 100%;
  }
}

/* ---- My Profile (consolidated post-onboarding view) ----------------------- */
.my-profile-screen {
  max-width: var(--content-measure);
}

.my-profile__section {
  margin-top: var(--space-4);
}

.my-profile__section-heading {
  margin: 0 0 var(--space-3);
}

/* ---- Tax Year screen (first screen of onboarding) ------------------------ */
.tax-year-screen__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tax-year-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--motion-easing),
    background var(--motion-fast) var(--motion-easing);
}

.tax-year-card:hover {
  border-color: var(--accent-teal);
}

.tax-year-card:has(input:checked) {
  border-color: var(--accent-teal);
  background: var(--surface-canvas);
}

/* [V17 Phase 6] Was `opacity: 0.7` on the whole card, which washed out
   its "Coming soon — not yet fully supported" caption to an effective
   2.77:1 (axe-core color-contrast) against the 4.5:1 WCAG AA minimum —
   text a low-vision user specifically needs to read, since it's the
   reason this option can't be continued past, not decorative. A dashed
   border gives the same "muted/less available" visual cue without
   reducing text contrast.
   Selector is `.tax-year-card.tax-year-card--unsupported` (specificity
   0,2,0), not a bare `.tax-year-card--unsupported` (0,1,0) — the
   element also carries the shared `.card` class, whose own
   `border: 1px solid ...` shorthand sits later in this file and, at
   equal specificity, was silently winning the cascade and resetting
   border-style back to solid. */
.tax-year-card.tax-year-card--unsupported {
  border-style: dashed;
}

.tax-year-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tax-year-card input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
  border: 1.5px solid var(--border-hairline);
  border-radius: 50%;
  background: var(--surface-card);
  cursor: pointer;
  position: relative;
  transition: background var(--motion-fast) var(--motion-easing),
    border-color var(--motion-fast) var(--motion-easing);
}

.tax-year-card input[type="radio"]:hover {
  border-color: var(--accent-teal);
}

.tax-year-card input[type="radio"]:checked {
  border-color: var(--accent-teal);
}

.tax-year-card input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-teal);
}

.tax-year-card input[type="radio"]:focus-visible {
  outline: 2px solid var(--colour-focus-ring);
  outline-offset: 2px;
}

.tax-year-screen__error {
  color: var(--accent-coral);
}

/* ---- Entry screens (Income/Expense/Mileage/Employment/Savings) ----------- */
.entry-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* `.entry-screen` is a flex column, so a button that is a direct child of it
   stretched the full width of the content area — "Add employment" was a solid
   teal bar 1128px wide, which reads as unresolved layout rather than emphasis.
   Cards still fill the column; only the buttons size to their label. */
.entry-screen > .button {
  align-self: flex-start;
}

.entry-screen__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.entry-screen__total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.entry-screen__note,
.entry-screen__mileage-note {
  color: var(--text-secondary);
}

/* Declaration removed 2 September 2026. It had never taken effect: .card and
   .entry-form are equally specific and came LATER in this same file, so source
   order decided and this always lost. Moving those two into
   core/css/components.css would have made it start applying — a visible change
   to a product already on sale — so the dead declaration goes instead and the
   product renders exactly as it does today. Recorded in
   products/sbm/DECISIONS.md §6 in case the effect was wanted. */
.entry-empty {
  text-align: center;
  color: var(--text-secondary);
}

/* First outbound GOV.UK reference link added to the app (Capital
   Gains' Losses & BADR context, 18 August 2026) — no base `a` styling
   exists anywhere else, deliberately not touched here either, since
   `.button` (also an `<a>` in one case) sets its own color and a bare
   `a { color }` rule would cascade into it. Reuses `--accent-teal-text`,
   the same contrast-checked teal already used for on-card text (see
   `.dashboard__breakdown-row--reduction`), not the raw `--accent-teal`
   background colour, which fails WCAG AA as plain text. */
.inline-link {
  color: var(--accent-teal-text);
  text-decoration: underline;
}

.inline-link:hover,
.inline-link:focus-visible {
  text-decoration-thickness: 2px;
}

/* Full-width note/caption placed inside an entry-form__grid — e.g. a
   flat-rate amount readout or an eligibility caveat that shouldn't be
   squeezed into a single grid column alongside an input field. */
.entry-form__grid-note {
  grid-column: 1 / -1;
}

.entry-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* One column on a phone. [13 September 2026] This was written as a bare
   `.entry-form__grid` and never applied: core/css/components.css declares the
   two-column grid at the same specificity and loads AFTER this file, so it won
   on source order. On the employer card the start date was cut to "06/04/202"
   at 390px and the page scrolled sideways (calculator UI/UX audit, H3). Scoped
   to the main region, which outranks the Core declaration without !important. */
@media (max-width: 767px) {
  .app-main .entry-form__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Employment expenses / Benefits in kind — subsection cards ------------
   Real user feedback: "Uniform and tools in not in a card unless you click
   add..." — traced to Uniform & tools being the one category (of six) whose
   empty state bypassed createDataTable's own "data-table-wrapper card"
   wrapper (see employmentEntry.js's renderCategorySection). Fixed at the
   source there, but .expense-subsection itself had NO card styling of its
   own at all — every category's visible "card" look came entirely from
   whatever was nested inside it (a data table or a form), with nothing
   boxing the section as a whole, its title included. That's also what made
   the titles read as ordinary field labels ("clunky... titles aren't
   clear") and left cards sitting flush against each other with no breathing
   room ("a bit clustered"). Making .expense-subsection itself the real card
   fixes all three: it's now always visibly boxed regardless of what's
   inside, cards get real spacing between them, and the title gets its own
   more prominent style rather than reusing the generic 12px uppercase
   .text-label used for ordinary form field labels throughout the app. */
.expense-subsection {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.expense-subsection:last-child {
  margin-bottom: 0;
}

.expense-subsection__heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.expense-subsection__title {
  font-size: var(--text-body-size);
  font-weight: 600;
  line-height: var(--text-body-line);
  color: var(--text-primary);
}

/* The data table / draft form nested inside now sit inside an already-
   boxed .expense-subsection — without this they'd each draw their own
   .card background/border/shadow too, reading as a card inside a card. */
.expense-subsection .data-table-wrapper,
.expense-subsection .entry-form {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Uniform & tools' two distinct add-entry-point buttons (flat-rate vs
   actual-cost claim), sitting below its table/empty-state inside the
   same card. */
.expense-row--add {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* ---- Mileage rate reference card ------------------------------------------ */
/* Declaration removed 2 September 2026. It had never taken effect: .card and
   .entry-form are equally specific and came LATER in this same file, so source
   order decided and this always lost. Moving those two into
   core/css/components.css would have made it start applying — a visible change
   to a product already on sale — so the dead declaration goes instead and the
   product renders exactly as it does today. Recorded in
   products/sbm/DECISIONS.md §6 in case the effect was wanted. */
.mileage-rate-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.mileage-rate-card__rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---- Employment cards ------------------------------------------------------ */
.employment-card {
  padding: var(--space-4);
}

.employment-summary {
  display: flex;
  gap: var(--space-4);
  color: var(--text-secondary);
}

/* ---- Your businesses (calculator 3.1) --------------------------------------
   The card at the head of Self-Employment Income. With one business this is
   3.0's Business setup card and none of these rules apply. */
.businesses-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.businesses-card__business {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.businesses-card__business-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* The name can be 60 characters; it wraps rather than pushing the buttons off
   a narrow screen. */
.businesses-card__business-header > .text-title {
  overflow-wrap: anywhere;
  margin: 0;
}

.businesses-card__business-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.businesses-card__name-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Capital allowances on a car, inside a vehicle's card (calculator 3.1). */
.vehicle-car-allowance {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
}

/* The picker at the head of the four entry screens, once there are two or more
   businesses. One choice, shared by all of them. */
.business-picker {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.businesses-card__add {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

/* ---- Savings & Dividends --------------------------------------------------- */
.savings-section {
  padding: var(--space-4);
}

.savings-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}





@media (max-width: 767px) {
  .comparison-card__columns {
    grid-template-columns: 1fr;
  }
}



/* ---- Reliefs & Elections screen ---------------------------------------------- */
.reliefs-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.reliefs-screen__section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* [Grid span fix] Every consumer of this class (Reliefs, Foreign Income
   x2, Savings & Dividends, Property Income, Capital Gains) passes
   `kpi-card--span-4`/`span-6` cards (kpiCard.js), which assume a
   12-column parent — the same grid Dashboard itself uses
   (`.dashboard-grid`). This was only 3 columns wide, so every span-4/6
   card overflowed the explicit grid and got forced onto its own row
   instead of sitting 3(or 2)-up as intended. Matching `.dashboard-grid`
   exactly (columns and gap) fixes all six call sites at once and keeps
   this pattern visually consistent with the Dashboard. */
.reliefs-screen__kpi-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
}

.election-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-hairline);
}

.election-row:last-child {
  border-bottom: none;
}

.election-row p {
  margin-top: var(--space-2);
  color: var(--text-secondary);
}

@media (max-width: 767px) {
  .reliefs-screen__kpi-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Tax Breakdown screen ------------------------------------------------------ */
.breakdown-screen {
  max-width: var(--content-max-width);
}

.breakdown-screen__intro {
  margin: var(--space-2) 0 var(--space-4);
  color: var(--text-secondary);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-hairline);
}

.breakdown-row:last-child {
  border-bottom: none;
}

/* The "About these figures" note under the Income Tax bands follows a nested
   list of rows, whose last row has no rule, so the note sat on the last figure
   (Tax Audit Report; calculator UI/UX audit, H1, 13 September 2026). It takes
   the rule every other row in the list has. */
.breakdown-section-body > .breakdown-section-body + .breakdown-row--note {
  border-top: 1px solid var(--border-hairline);
}

/* ---- Tax Audit Report screen (V17-012) ------------------------------------------ */
.audit-report-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.audit-report-screen__intro {
  color: var(--text-secondary);
}

/* Declaration removed 2 September 2026. It had never taken effect: .card and
   .entry-form are equally specific and came LATER in this same file, so source
   order decided and this always lost. Moving those two into
   core/css/components.css would have made it start applying — a visible change
   to a product already on sale — so the dead declaration goes instead and the
   product renders exactly as it does today. Recorded in
   products/sbm/DECISIONS.md §6 in case the effect was wanted. */
.breakdown-section-title {
  margin: var(--space-4) 0 var(--space-1);
}

.breakdown-section-title:first-of-type {
  margin-top: 0;
}

.audit-report__warnings-list {
  margin: 0;
  padding-left: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---- Year-on-Year Comparison screen (V17-011) ------------------------------------ */
.year-comparison-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.year-comparison-screen__intro {
  color: var(--text-secondary);
}

/* The per-year card grid was replaced by one table on 13 September 2026 (H6);
   see "Year-on-Year: one table" near the end of this file. */

/* ---- Payments on Account screen ------------------------------------------------ */
.poa-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.poa-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.poa-screen__grid {
  display: grid;
  /* See the note on .comparison-card__columns: a bare 1fr floors at min-content
     and overflowed the page by 47px at 768px, above the 767px stacking point. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
}

.poa-trigger-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* A title and a status chip on one line, with nowhere to go when the card
     narrows — the chip left the card by 19px at 768px. Wrapping puts it on its
     own line for the few hundred pixels where both will not fit. */
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.poa-trigger-card__amount {
  margin-top: var(--space-3);
}

/* [UI consistency review, 17 August 2026] Was `1fr 1fr`, a literal
   2-column grid, but the two cards inside (paymentsOnAccountScreen.js)
   use `.kpi-card--span-6`, which assumes the same 12-column system every
   other kpi-row in the app uses (`grid-column: span 6`). `span 6` inside
   a 2-column grid overflows, so each card was forced onto its own full-
   width row instead of sitting side by side, the exact same bug already
   found and fixed for `.reliefs-screen__kpi-row`. Matched to that fix
   exactly rather than inventing a third grid convention. */
.poa-screen__kpi-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-4);
}

/* Declaration removed 2 September 2026. It had never taken effect: .card and
   .entry-form are equally specific and came LATER in this same file, so source
   order decided and this always lost. Moving those two into
   core/css/components.css would have made it start applying — a visible change
   to a product already on sale — so the dead declaration goes instead and the
   product renders exactly as it does today. Recorded in
   products/sbm/DECISIONS.md §6 in case the effect was wanted. */
@media (max-width: 767px) {
  .poa-screen__grid,
  .poa-screen__kpi-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Child Benefit screen ------------------------------------------------------- */
.child-benefit-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.child-benefit-screen__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.child-benefit-screen__caveat {
  color: var(--text-secondary);
}

/* ---- Marriage Allowance screen --------------------------------------------------- */
.ma-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ma-eligibility-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* [UI consistency review, 17 August 2026] Same bug as .poa-screen__kpi-row
   above: a literal 3-column grid, but the three cards inside
   (marriageAllowanceScreen.js) use `.kpi-card--span-4` (12-column
   system), so each was forced onto its own row instead of sitting 3-up.
   Matched to the same 12-column convention. */
.ma-screen__kpi-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
}

.ma-reliefs-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

@media (max-width: 767px) {
  .ma-screen__kpi-row {
    grid-template-columns: 1fr;
  }
}

/* ---- VAT Tracker screen ------------------------------------------------------------ */
.vat-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.vat-top-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.vat-top-card__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.vat-screen__approximation {
  color: var(--text-secondary);
}

/* ---- Do I Need to File screen -------------------------------------------------------- */
.filing-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.filing-verdict-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filing-checks-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filing-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-hairline);
}

.filing-check-row:last-child {
  border-bottom: none;
}

/* ---- HMRC Box Mapping / Ready to File screen ----------------------------------- */
.hmrc-box-mapping-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hmrc-box-mapping-screen__intro,
.hmrc-box-mapping-screen__note {
  color: var(--text-secondary);
}

/* ---- Reduced motion (V17 Phase 6) ------------------------------------------
   No prefers-reduced-motion query existed anywhere in the app before this
   pass. Every transition/animation here is already short (120-200ms,
   see --motion-fast/--motion-base) and none are large or looping, but
   users with vestibular disorders can be sensitive even to brief
   motion — this is standard, low-risk practice, not a response to any
   specific reported problem. Effectively instant instead of removed
   entirely, so state changes (hover, focus, the toast appearing) are
   still perceptible, just without the animated transition. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* The bar chart's own text and fills moved to core/css/components.css on
   20 September 2026 (fault C-14): Core draws the chart, so Core styles it, and
   a package without the calculator no longer gets unstyled chart text. */

/* ---- Specialist Circumstances screen --------------------------------------------- */
.specialist-screen {
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.specialist-screen__intro {
  color: var(--text-secondary);
}

.specialist-guidance-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---- [V16 Phase 4] Confidence badge, tax-saving suggestions, "what
   have I missed" checklist, and the What-If comparison table. Reuse
   the same --space-* / --radius-control / card conventions as the
   rest of the Dashboard rather than introducing new tokens. ---------- */

.dashboard__confidence {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dashboard__confidence-chip-row {
  margin: 0;
}

.dashboard__explanations {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dashboard__suggestions {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.dashboard__suggestion-row {
  padding: var(--space-3);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dashboard__suggestion-title {
  font-weight: 600;
}

.dashboard__suggestion-link {
  align-self: flex-start;
  margin-top: var(--space-2);
}

.dashboard__what-have-i-missed {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dashboard__checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: 0;
}

.dashboard__checklist-row--missing {
  color: var(--text-secondary);
}

/* [Dashboard spacing fix — 16 Aug 2026] Real user feedback: "some of
   the spacing within the dashboard cards is too close." Traced to
   several Dashboard cards being built as plain stacked block elements
   (title, headline figure, caption, etc.) with no `display:flex` /
   `gap` of their own — combined with the app-wide `h1,h2,h3,h4,p {
   margin: 0 }` reset (see currencyInput.js's own note on why that
   reset exists), several cards' internal elements had genuinely ZERO
   space between them, not just a small gap that merely looked tight. */
/* The answer card at the top of Tax Breakdown — same shape as the Dashboard's
   headline so the two screens agree on what a headline figure looks like. */
.tax-breakdown__answer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  /* `.breakdown-screen` sets only a max-width — no flex, no gap — so a card
     added to it sits flush against whatever follows. The answer card was
     touching section 1. */
  margin-bottom: var(--space-4);
}

.dashboard__primary-result,
.dashboard__liability {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* [Bug fix, 17 Aug 2026] Missing display:flex meant the label/value
   pair had nothing spreading them apart, so they ran together with no
   gap ("Income Tax£9,800.00"). Latent on Dashboard itself too, its own
   liability breakdown rows live inside a collapsed-by-default
   expandable section, so this was never visibly triggered there until
   the 2025/26 summary rebuild rendered the same rows always-open. */
.dashboard__breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) 0;
}

/* [Real user feedback, 18 August 2026] Sub-components of the "Income
   Tax" row (tax on savings/dividends) and the reductions netted into it
   (Marriage Allowance, pension/Gift Aid relief, Section 24, FTCR) —
   visually distinct from the main rows without a heavy new component. */
.dashboard__breakdown-row--sub {
  padding-left: var(--space-4);
  color: var(--text-secondary);
}

.dashboard__breakdown-subheading {
  margin-top: var(--space-3);
  color: var(--text-secondary);
}

.dashboard__breakdown-row--reduction {
  /* accent-teal-text, not the raw --colour-positive/--accent-teal used
     for status chips/backgrounds — that fails WCAG AA contrast as plain
     text against a light surface (see the F-048 fix, V18 Phase A). */
  color: var(--accent-teal-text);
}

.dashboard__warnings-completeness {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dashboard__completeness {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
}

.dashboard__completeness > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dashboard__warnings {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ---- [Dashboard redesign] Hero row, section heading, and the two new
   visualisations (liability composition donut, paid-vs-due bar) — real
   user feedback: "main cards needs to be at the top with the
   supplementary cards underneath... more graphs and graphics to help
   the user understand." ------------------------------------------------ */

/* Primary result + confidence badge side by side, rather than two
   full-width stacked cards — the single most important figure on the
   page (the headline amount) now shares visual weight with the one
   qualifier that matters most for how much to trust it. */
.dashboard__hero-row {
  display: flex;
  gap: var(--space-4);
  align-items: stretch;
}

.dashboard__hero-row .dashboard__primary-result {
  flex: 2 1 0;
}

.dashboard__hero-row .dashboard__confidence {
  flex: 1 1 0;
  margin-top: 0;
}

@media (max-width: 767px) {
  .dashboard__hero-row {
    flex-direction: column;
  }
}

/* A plain divider + label between the "main, always relevant" cards
   and the "supplementary, depends what applies to you" ones below —
   the grid itself is unchanged (still `.dashboard-grid`), this is
   purely a visual/semantic break between the two calls to it. */
.dashboard__section-heading {
  /* [Uniform card spacing — 16 Aug 2026] No margin-top: the surrounding
     24px gap already comes from `.dashboard`'s own flex `gap`, same as
     every other card-to-card transition on the page — this section
     divider is marked by the border/weight below, not by extra
     whitespace on top of that shared gap. */
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-hairline);
  font-size: var(--text-body-size);
  font-weight: 600;
  color: var(--text-primary);
}

/* Simple 2-segment stacked bar — "already paid" vs "still due," out of
   the total liability — sitting directly under the headline amount so
   the person can see at a glance how much of the bill is already
   covered, without opening the liability breakdown disclosure. */
/* ---- Tax breakdown at a glance ---------------------------------------------
   The spine of the calculation as a short list, replacing the four donuts and
   then the bar that replaced them. Grouped by a hairline rather than boxed, so
   the eye runs down one column of figures to the total. */
.dashboard__glance {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-3);
}

.dashboard__glance-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) 0;
}

.dashboard__glance-group--ruled {
  border-top: 1px solid var(--border-hairline);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
}

.dashboard__glance-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}

.dashboard__glance-row .numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard__glance-row--total {
  align-items: center;
}

/* A link out, not a banner. `.dashboard__liability` is a flex column, so a
   button that is a direct child of it stretches the full width unless told
   otherwise — the same fault fixed for the entry screens' own buttons. */
.dashboard__glance-link {
  align-self: flex-start;
  margin-top: var(--space-4);
}

.dashboard__glance-note {
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.dashboard__paid-vs-due {
  margin-top: var(--space-3);
}

.dashboard__paid-vs-due-track {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface-canvas);
}

.dashboard__paid-vs-due-segment--paid {
  background: var(--accent-teal);
}

.dashboard__paid-vs-due-segment--due {
  background: var(--chart-series-blue);
}

.dashboard__paid-vs-due-legend {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.dashboard__paid-vs-due-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.dashboard__paid-vs-due-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dashboard__paid-vs-due-swatch--paid { background: var(--accent-teal); }
.dashboard__paid-vs-due-swatch--due { background: var(--chart-series-blue); }

/* The donut chart's own text, fills and compact variant moved to
   core/css/components.css on 20 September 2026 (fault C-14), with the bar
   chart's, for the same reason. Its legend and ring wrapper were already
   there. */

.dashboard__liability-pie-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  justify-content: center;
}

.dashboard__liability-pie {
  flex: 1 1 200px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.dashboard__liability-pie-heading {
  text-align: center;
}

/* ---- What-If screen ---------------------------------------------------- */

.what-if-screen__comparison {
  margin-top: var(--space-4);
  padding: var(--space-4);
}

.what-if-screen__table {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.what-if-screen__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2);
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-hairline);
}

.what-if-screen__row--header {
  border-bottom: 2px solid var(--border-hairline);
  font-weight: 600;
}

/* "Positive" is the good outcome — the adjusted scenario owes less — and it was
   coral, the loss colour, with a higher bill in teal. Swapped 13 September 2026,
   and moved onto the -text tokens, which are darkened for a light ground. */
.what-if-screen__diff--positive {
  color: var(--accent-teal-text, var(--accent-teal, #2FB8AC));
}

.what-if-screen__diff--negative {
  color: var(--accent-coral-text, var(--accent-coral, #FF6B5E));
}

/* ---- What-If screen: Saved Scenarios (Phase E) ------------------------- */

.what-if-screen__saved {
  margin-bottom: var(--space-4);
}

.what-if-screen__saved-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.what-if-screen__saved-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control, 8px);
}

.what-if-screen__saved-row__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.what-if-screen__saved-row__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.what-if-screen__saved-row__delete {
  appearance: none;
  border: none;
  background: transparent;
  color: #A82E24;
  cursor: pointer;
  font-size: var(--text-caption-size);
}

.what-if-screen__save-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-hairline);
}

.what-if-screen__save-row .text-field {
  flex: 1;
}

@media (max-width: 767px) {
  .what-if-screen__saved-row {
    grid-template-columns: 1fr;
  }
  .what-if-screen__save-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---- Welcome screen (first run / post-Reset Project) ------------------- */
.welcome-screen {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 880px;
  margin: 0 auto;
}

.welcome-hero {
  background: var(--accent-navy);
  border-radius: var(--radius-card);
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
}

.welcome-hero__mark-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #FFFFFF;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.welcome-hero__mark {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.welcome-hero__eyebrow {
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
  text-transform: uppercase;
  color: var(--accent-teal);
  margin: 0;
}

.welcome-hero__title {
  font-size: var(--text-display-size);
  font-weight: var(--text-display-weight);
  line-height: var(--text-display-line);
  color: #FFFFFF;
  margin: 0;
  max-width: 22ch;
}

.welcome-hero__body {
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
  color: #C7D3E0;
  margin: 0;
  max-width: 46ch;
}

/* The one button, and the rough-figure link under it (H8, 13 September 2026). */
.welcome-hero__actions {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.welcome-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.welcome-section__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.welcome-section__label {
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
  text-transform: uppercase;
  color: var(--accent-teal-text);
  margin: 0;
}

.welcome-section__title {
  font-size: var(--text-title-size);
  font-weight: var(--text-title-weight);
  margin: 0;
}

.welcome-section__desc {
  font-size: var(--text-body-size);
  color: var(--text-secondary);
  margin: 0;
  max-width: 60ch;
}

.welcome-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.welcome-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.welcome-step__index {
  font-size: var(--text-label-size);
  font-weight: 600;
  color: var(--accent-teal-text);
  font-variant-numeric: tabular-nums;
}

.welcome-step__title {
  font-size: var(--text-body-size);
  font-weight: 600;
  margin: 0;
}

.welcome-step__body {
  font-size: var(--text-caption-size);
  line-height: var(--text-body-line);
  color: var(--text-secondary);
  margin: 0;
}

.welcome-years {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}

.welcome-year-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.welcome-year-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.welcome-year-card__year {
  font-size: var(--text-title-size);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.welcome-year-card__body {
  font-size: var(--text-caption-size);
  line-height: var(--text-body-line);
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}

/* The year cards' two buttons and the closing "Ready to begin?" panel were
   removed on 13 September 2026 (calculator UI/UX audit, H8), and their rules
   with them. The action link also measured 3.49:1 in dark mode. */

.welcome-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-caption-size);
  color: var(--text-secondary);
  margin: 0;
}

.welcome-trust__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-teal);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .welcome-hero {
    padding: var(--space-5) var(--space-3);
  }
  .welcome-hero__title {
    font-size: 26px;
  }
}

/* One pension provider / charity entry (V2.0 feedback, Phase 4). */
/* [V2.1 feedback] A pension entry is now a minimisable card of its own,
   like an employment card, so the separator treatment it used to need
   between stacked entries has gone with it. Remove moved into the card
   header at the same time, which is why the full-width-button fix that
   used to live here is no longer needed. Gift Aid donations still use
   `.relief-entry` in its plain form. */
.relief-entry {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.relief-entry__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.relief-entry__note { margin: 0; }

/* Keeps a minor, destructive action from stretching to the full card
   width and reading as the primary one. */
.relief-entry > .button,
.relief-entry__body > .button {
  align-self: flex-start;
}

/* Month-by-month record on the printed audit report (V2.0 Phase 4). */
.audit-report__month-heading {
  margin: var(--space-4) 0 var(--space-2);
  display: block;
}

.audit-report__table {
  display: flex;
  flex-direction: column;
}

.audit-report__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-hairline);
}

.audit-report__row--total {
  font-weight: 600;
  border-bottom: none;
  border-top: 1px solid var(--hairline-strong, var(--border-hairline));
}

/* Commercial-property hint on Property Income (V2.0 feedback, Phase 3). */
.property-commercial-hint {
  border-left: 3px solid var(--accent-gold);
}

/* One savings / dividend entry (V2.1 feedback). A block, not a grid row:
   it hosts a full monthly ledger, which a narrow grid cell cannot. */
/* [V2.1 feedback] A savings/dividend entry is now a minimisable card of
   its own, matching an employment card. The previous block-with-a-rule
   treatment (and the three-column .savings-row grid before it) is gone:
   the card provides its own separation, and the minimise header needs
   somewhere to sit. */
.savings-entry {
  margin-bottom: var(--space-3);
}

.savings-entry__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Shared by every minimisable entry card — savings sources, properties
   and pension providers. Keeps them apart in a stack. */
.collapsible-entry + .collapsible-entry {
  margin-top: var(--space-3);
}

/* A field whose value the app works out rather than the person typing
   it — the mileage reimbursement derived from a pence-per-mile rate
   (V2.1 feedback). Styled as a read-out, not an input, so it does not
   look like a second place to change the same number. */
.field__derived {
  margin: 0;
  padding: var(--space-2) 0;
  color: var(--text-primary);
  font-weight: 600;
}

/* Signpost from self-employment Mileage to Employment (PAYE), for the
   employee who came here looking for Mileage Allowance Relief. */
.mileage-signpost .button {
  align-self: flex-start;
  margin-top: var(--space-2);
}

.mileage-signpost {
  display: flex;
  flex-direction: column;
}

/* [V2.1 feedback, fourth round] One card per property, holding
   everything about it — the Employment (PAYE) shape. Replaces the
   `.property-ledger-card` block, which styled a second card that sat
   below a table of the same properties. */
.property-card {
  margin-bottom: var(--space-3);
}

.property-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}


/* Which return the calculator is actually for, on the welcome screen. Quieter
   than the hero copy above it but not hidden — it is the sentence that stops
   somebody buying the wrong year. */
.welcome-hero__year {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent-teal);
  background: var(--surface-canvas);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  color: var(--text-primary);
  font-size: var(--text-body-size);
  line-height: 1.5;
  max-width: 60ch;
}

/* ---- The audit report's disclaimer ---------------------------------------
   The second of the two rules approved on 5 September 2026 (DECISIONS.md §6),
   inert since the calculator first shipped for the same source-order reason as
   the danger zone above.

   A caution-coloured left edge on the disclaimer that sits under a full tax
   computation. The edge marks it as something to read rather than the closing
   furniture of the page — which is exactly what it is, on the screen where
   somebody is most likely to believe the figures are final. */
.audit-report-screen__disclaimer {
  border-left: 3px solid var(--accent-gold);
}

/* The estimate's headline. The existing display size, one step up, because
   it is the only figure on the screen. No new colour or family. */
.sa-estimate__figure {
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.1;
  margin: var(--space-1) 0 var(--space-2);
}

/**
 * The caveats panel.
 *
 * Defined here rather than borrowing `.nwt-notice`, which is what the first
 * cut used — that class lives only in the tracker's stylesheet, which this
 * package does not ship, so the block would have rendered unstyled in the
 * calculator and nothing would have said so. Built from the existing surface,
 * hairline and radius tokens; no new values.
 */
.sa-estimate__caveats {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  background: var(--surface-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
}

.sa-estimate__caveats > * { margin: 0; }
.sa-estimate__caveats > * + * { margin-top: var(--space-2); }

/**
 * The Section 24 working.
 *
 * The binding row is emphasised, and it also says "this one" in its label —
 * the platform's rule that a status is a word and not only a colour applies
 * to a table row as much as to a chip.
 */
.property-s24 {
  margin-top: var(--space-3);
}

.property-s24__binding {
  font-weight: 600;
  background: var(--surface-canvas);
}

/**
 * The take-home waterfall.
 *
 * Label, bar, amount — the bar between two readable things rather than
 * instead of them, so it prints and reads without colour. Tones are the
 * existing accents; no new palette.
 */
.waterfall { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) 0; }

.waterfall__row {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) minmax(0, 7rem);
  gap: var(--space-3);
  align-items: center;
}

/* 4px between a row's name and the line explaining it, which touched (H1,
   13 September 2026). */
.waterfall__label { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.waterfall__amount { text-align: right; font-variant-numeric: tabular-nums; }

.waterfall__track {
  background: var(--surface-canvas);
  border-radius: var(--radius-control);
  height: 1.4rem;
  overflow: hidden;
}

.waterfall__bar { height: 100%; border-radius: var(--radius-control); }
.waterfall__bar--untaxed { background: var(--accent-teal); opacity: 0.35; }
.waterfall__bar--tax { background: var(--accent-teal-button); }
.waterfall__bar--credit { background: var(--accent-gold); }
.waterfall__bar--left { background: var(--accent-navy); }

.waterfall__row--left { border-top: 1px solid var(--border-hairline); padding-top: var(--space-2); }

/* One column on a narrow screen: a 14rem label column and a bar cannot both
   survive at 390px, and the bar is the part that can go. */
@media (max-width: 640px) {
  .waterfall__row { grid-template-columns: minmax(0, 1fr) minmax(0, 6rem); }
  .waterfall__track { display: none; }
}

/* ==========================================================================
   Calculator UI/UX audit, High findings — 13 September 2026
   Jordan: "I dont want text touching a card… numbers not aligning in columns
   and tables. That looks unprofessional."
   ========================================================================== */

/* ---- Property: rhythm inside each part of a property's card (H1) ----------
   A `.property-section` is a plain block inside the card, so Core's card
   rhythm spaces the section and not its contents. The toggle sat on its note,
   the note on the monthly ledger, the ledger on the fields below it. Every block
   now keeps 16px from the one above; a note explaining the thing above it, and
   the section's own title, keep 8px. Stacked margins overlap, so a field's own
   16px is not doubled. */
.property-section > * + * {
  margin-top: var(--space-3);
}

.property-section > .property-section__title + *,
.property-section > label + p,
.property-section > .toggle-row + p {
  margin-top: var(--space-2);
}

/* ---- Tax Breakdown: a card never sits on the section below it (H1) --------
   `.breakdown-screen` is a plain block, so "Where your income goes" touched
   section 1. The answer card already kept 24px below itself; every card on the
   screen now does. */
.breakdown-screen > .card {
  margin-bottom: var(--space-4);
}

/* ---- An entry form's save, confirmed (H7) ---------------------------------
   Drawn by entrySaveFeedback.js into the table's own header, beside the Add
   button the person's focus returns to. The row the save made is tinted for a
   few seconds, with a rule on its leading edge so the mark is not colour alone.
   The tint is the one the dashboard's action icons already use. */
.entry-saved-header {
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.entry-saved-note {
  flex: 1 1 16rem;
  margin: 0;
  color: var(--text-primary);
  font-weight: 500;
}

/* On the row, not its cells: the actions cell is display:flex, so it is not a
   real table cell and a cell background left it untinted. `:nth-child(n)`
   matches the specificity of Core's alternate-row tint, which this file
   follows, so the saved tint wins on odd rows too. */
tbody > tr.entry-row--saved:nth-child(n) {
  background: rgba(47, 184, 172, 0.12);
}

.entry-row--saved > td:first-child {
  box-shadow: inset 3px 0 0 var(--accent-teal);
}

/* ---- Setup steps on a phone (H3) ------------------------------------------
   Four numbered steps with their names did not fit 390px: "Review" ran off the
   screen and the page scrolled sideways by 74px. On a phone the other steps
   show their number only, the current step keeps its name, and the row wraps
   if it still has to. The hidden names stay available to screen readers, and
   the current step is marked aria-current in setup.js. */
@media (max-width: 767px) {
  .setup-steps {
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
  }

  .setup-steps__item:not(.setup-steps__item--active) .setup-steps__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ---- Year-on-Year: one table, a column per year (H6) ----------------------
   Replaces a card per year. Labels once on the left, each year's figures
   right-aligned in its own column, so a row reads straight across. A narrow
   screen scrolls the table inside its card rather than the page. */
/* `position: relative` makes this box the containing block for the table's
   screen-reader-only caption and "No figure" labels, which are absolutely
   positioned. Without it their containing block lay outside this box, its
   overflow did not clip them, and at 390px the whole page scrolled sideways by
   161px. */
.year-comparison__scroll {
  position: relative;
  overflow-x: auto;
}

.year-comparison__table thead th {
  vertical-align: bottom;
}

.year-comparison__year,
.year-comparison__source {
  display: block;
}

.year-comparison__year {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.year-comparison__source {
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
}

.year-comparison__table tbody th {
  min-width: 9rem;
  padding: var(--space-3) var(--space-2);
  text-align: left;
  font-weight: 400;
}

.year-comparison__table td {
  white-space: nowrap;
}

.year-comparison__total > th,
.year-comparison__total > td {
  font-weight: 600;
}

.year-comparison__none {
  color: var(--text-secondary);
}

/* ---- Welcome: one way to start (H8) ---------------------------------------
   The rough figure is a link under the one button, in the hero's own quieter
   ink (#C7D3E0 on navy, the body copy's colour, about 10:1), underlined so it
   reads as a link. The hero is navy in both themes. */
.welcome-hero__secondary {
  appearance: none;
  border: none;
  background: transparent;
  padding: var(--space-1) var(--space-2);
  font: inherit;
  font-size: var(--text-body-size);
  color: #C7D3E0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.welcome-hero__secondary:hover,
.welcome-hero__secondary:focus-visible {
  color: #FFFFFF;
}

/* The bundle's note (SBM audit H12): a plain card, so Core's card rhythm
   spaces it. The rule on its edge marks it as guidance, not a warning. */
.welcome-bundle {
  border-left: 3px solid var(--accent-teal);
}

.welcome-bundle__title {
  font-size: var(--text-title-size);
  font-weight: var(--text-title-weight);
}

.welcome-bundle__body {
  color: var(--text-secondary);
  max-width: 64ch;
}
