/* ==========================================================================
   products/nwt/css/screens.css — the Net Worth Tracker's own screen styles.

   Everything visual comes from Core's tokens. There is deliberately NO
   per-product accent and no separate identity (design specification D-31):
   all three Atlas Foundry products look identical, so a customer who owns two
   is not switching between two pieces of software.

   Nothing here redefines a token. If a value is needed that Core does not have,
   that is a conversation about Core, not a local override — an override is how
   two products drift apart one hex code at a time.
   ========================================================================== */

/* ---- The account list ----------------------------------------------------
   A list, not a table. Each row is three things the customer reads in one
   pass: what it is called, what it is worth and when that was true, and
   whether anything unusual applies to it. A data table would put the wrapper
   in a column of its own and make the row scan horizontally, which is the
   wrong shape for something read on a phone once a month. */
.nwt-account-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
  margin-top: var(--space-4, 1rem);
}

.nwt-account-row {
  display: grid;
  /* Name takes the room; the figure keeps a fixed column so the numbers line
     up down the list and can be compared without reading each one. */
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-4, 1rem);
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md, 6px);
  background: var(--surface-card);
}

.nwt-account-row__main {
  min-width: 0;
}

.nwt-account-row__main p {
  margin: 0;
  /* A provider name can be long and a phone is narrow. Wrapping is correct
     here; clipping would hide which account this is. */
  overflow-wrap: anywhere;
}

.nwt-account-row__figure {
  text-align: right;
  /* Figures in a column are compared, so they line up on the digit. */
  font-variant-numeric: tabular-nums;
}

.nwt-account-row__figure p {
  margin: 0;
}

.nwt-account-row__chips {
  display: flex;
  gap: var(--space-2, 0.5rem);
  flex-wrap: wrap;
}

/* Narrow screens: the figure moves under the name rather than squeezing both.
   The monthly ritual is something people do on a phone, so this is the layout
   that matters most, not a fallback. */
@media (max-width: 40rem) {
  .nwt-account-row {
    grid-template-columns: 1fr;
    gap: var(--space-2, 0.5rem);
  }
  .nwt-account-row__figure {
    text-align: left;
  }
}

/* ---- The snapshot grid ---------------------------------------------------
   The screen the product lives or dies on: forty rows, entered top to bottom
   without the mouse. Three columns — what it is, what it was, what it is now —
   so the eye lands on the box without reading the row. */
.nwt-snapshot {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.nwt-snapshot__group {
  margin-top: var(--space-4, 1rem);
  margin-bottom: var(--space-2, 0.5rem);
  color: var(--text-secondary);
}

.nwt-snapshot__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 9rem;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  padding: var(--space-2, 0.5rem) 0;
}

.nwt-snapshot__label p { margin: 0; overflow-wrap: anywhere; }

/* Last month's figure, greyed, to the LEFT of the box. Context for what to
   type, never an answer — which is why it is secondary text and not a value. */
.nwt-snapshot__last {
  text-align: right;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.nwt-snapshot__last p { margin: 0; }

.nwt-snapshot__field input { text-align: right; }

/* The three-month prompt sits under its own row rather than beside it, so it
   never narrows the input it is asking about. */
.nwt-snapshot__prompt {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  flex-wrap: wrap;
  padding-left: var(--space-2, 0.5rem);
}
.nwt-snapshot__prompt p { margin: 0; }

.nwt-snapshot__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
  align-items: flex-start;
}

@media (max-width: 40rem) {
  .nwt-snapshot__row {
    grid-template-columns: minmax(0, 1fr) 7.5rem;
  }
  /* The account name takes the full width and the previous figure tucks under
     it, so the input keeps its size on a phone — where the monthly ritual
     actually happens. */
  .nwt-snapshot__label { grid-column: 1 / -1; }
  .nwt-snapshot__last { text-align: left; }
}

/* ---- Allowances ----------------------------------------------------------
   A ring beside its own figures. The ring is a summary; the numbers next to it
   are the fact, and they are always present — a chart is never the only route
   to a figure. */
.nwt-allowance__figures {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
  min-width: 0;
}

/**
 * A ROW IS COLUMNS, NOT THINGS PUSHED APART.
 *
 * Reported by Jordan, 8 September 2026, of the tax-relief block: *"None of this
 * is aligned."* He was right, and `justify-content: space-between` is why. With
 * two children it puts one at each end, which happens to look like a column.
 * With THREE — a label, a figure and a note — it spreads all three across the
 * available width, so where the figure lands depends on how long that row's
 * label and note happen to be. £2,500.00, £625.00 and £3,125.00 each started
 * at a different place, in a block whose whole job is to be read down.
 *
 * Fixed tracks instead, shared by every row in the block, so the figures line
 * up on the digit whatever the words beside them are doing.
 */
.nwt-allowance__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6rem, auto);
  align-items: baseline;
  gap: var(--space-4, 1rem);
  padding: var(--space-1, 0.25rem) 0;
  border-bottom: 1px solid var(--border-hairline);
}

/* Three parts: the label, the figure, and the note explaining it. The note
   column is fixed too, or it would push the figure column about. */
.nwt-allowance__row--noted {
  grid-template-columns: minmax(0, 1fr) minmax(6rem, 9rem) minmax(0, 18rem);
}

.nwt-allowance__row > :nth-child(2) {
  text-align: right;
}

/* THE LABEL WRAPS, THE FIGURE DOES NOT. A long label — "what your statement
   says it would pay at 65, as at 1 March 2026" — was squeezing the value until
   "£11,900.00 a year" broke across two lines, which reads as two things. */
.nwt-allowance__row > .numeric {
  white-space: nowrap;
}

.nwt-allowance__row > :first-child {
  min-width: 0;
}

.nwt-allowance__row--noted > :last-child {
  color: var(--text-secondary);
}

/* Below a phone's width three columns stop fitting at all, and stacking is
   better than any of them being clipped. */
@media (max-width: 560px) {
  .nwt-allowance__row,
  .nwt-allowance__row--noted {
    grid-template-columns: minmax(0, 1fr);
    /* Stacked, so the gap is between lines rather than between columns — zero
       here puts a label directly on top of its own figure. */
    gap: var(--space-1);
  }
  .nwt-allowance__row > :nth-child(2) {
    text-align: left;
  }
}
.nwt-allowance__row:last-child { border-bottom: 0; }

/* ---- The superseded-edition notice (D-29) --------------------------------
   Gold, not coral. The figures still work and nothing is wrong with the
   customer's records — this is worth watching, not an emergency, and coral is
   reserved for one thing per screen. */
/* A NOTICE IS A BLOCK, NOT A LINE OF TEXT WITH A STRIPE BESIDE IT.
   This carried a left border and no padding, so every notice in the product
   had its text sitting directly on the border — on Overview, Allowances,
   Retirement, Disposals, What-ifs and Accounts. Reported three times as "text
   touching cards", the same root cause each time. */
.nwt-notice {
  border-left: 3px solid var(--accent-gold);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-canvas);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.nwt-notice > * { margin: 0; }
.nwt-notice > * + * { margin-top: var(--space-2); }
.nwt-notice .button { margin-top: var(--space-3); }

/* ---- The three withdrawal rates ------------------------------------------
   IDENTICAL CARDS. Same width, same weight, same everything, laid out in a
   grid that gives each an equal track. Any visual difference between them —
   a border, an order, a highlight — would be the product choosing one on the
   customer's behalf, which is the advice perimeter (R-5.1, R-4.1). This is a
   legal boundary expressed as a CSS rule, so nothing here may single one out. */
.nwt-rates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-4, 1rem);
  margin-top: var(--space-4, 1rem);
}

.nwt-rate {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
}

.nwt-rate__source {
  margin-top: auto;
  padding-top: var(--space-2, 0.5rem);
  color: var(--text-secondary);
}

/* ---- The standing wording (W-1) ------------------------------------------
   Never collapsed, never behind a toggle, never smaller than body text. It
   says the figures are not advice and that Atlas Foundry is not authorised to
   give any, and a customer must not have to expand anything to read it. */
.nwt-standing {
  border-left: 3px solid var(--border-hairline);
}

/* ---- A real choice, offered as a choice ----------------------------------
   Two buttons of equal weight and a paragraph explaining both. Not a toggle
   with a default, because the product has not decided and must not appear to
   have. */
.nwt-choice {
  margin-top: var(--space-4, 1rem);
  padding-top: var(--space-4, 1rem);
  border-top: 1px solid var(--border-hairline);
}

.nwt-choice__buttons {
  display: flex;
  gap: var(--space-3, 0.75rem);
  flex-wrap: wrap;
  margin-top: var(--space-3, 0.75rem);
}

/* ---- The required question on a sale (D-22) ------------------------------
   Radio buttons, all three visible, rather than a dropdown. A required
   question hidden inside a closed select is a question most people answer with
   whatever happened to be showing — and this one decides whether a figure is
   safe to copy onto a tax return. */
.nwt-disposal__question {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control, 4px);
  padding: var(--space-3, 0.75rem);
  margin: 0 0 var(--space-3, 0.75rem);
}

.nwt-disposal__answer {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-1, 0.25rem) 0;
  cursor: pointer;
}

.nwt-disposal__answer input { cursor: pointer; }

/* ---- The screen heading row ----------------------------------------------- */
.nwt-screen-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
  flex-wrap: wrap;
  margin-bottom: var(--space-4, 1rem);
}

/* ---- The series chart -----------------------------------------------------
   One measure, one hue, a table behind it. The range buttons sit with the
   title rather than under the plot, so the chart itself is one uninterrupted
   block and the controls do not read as part of the data. */
.nwt-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.75rem);
}

.nwt-chart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
  flex-wrap: wrap;
}

.nwt-chart__ranges {
  display: flex;
  gap: var(--space-1, 0.25rem);
}

/* The pressed range is marked by weight and a rule, not by colour alone. */
.nwt-chart__ranges [aria-pressed="true"] {
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent-teal);
}

.nwt-chart__plot {
  /* Wide content scrolls inside its own container so the page body never
     scrolls sideways. */
  overflow-x: auto;
}

.nwt-chart__svg {
  display: block;
  min-width: 20rem;
  /* The aspect ratio comes from the viewBox. Set here rather than as an SVG
     `height` attribute, which takes a length and rejected "auto". */
  height: auto;
}

.nwt-chart__details summary {
  cursor: pointer;
  color: var(--text-secondary);
  padding: var(--space-1, 0.25rem) 0;
}

/* A DISCLOSURE THAT KEEPS ITS CAVEATS.
 *
 * Item 19, 11 September 2026. Two screens carried long stacks of true,
 * load-bearing caveats in front of the one line that mattered — 172 words on
 * Allowances explaining a figure the tracker cannot work out, and a 98-word
 * paragraph on Retirement income explaining why a column is not summed.
 *
 * Simplifying the PRESENTATION is not the same as simplifying the data, so
 * nothing was deleted: the claim is a sentence and the reasoning is one click
 * away. This gives that disclosure the same vertical rhythm as the rest of a
 * card — the first build had the summary and its paragraph flush against each
 * other, which qa/nwt/polishRun.mjs caught at 0px.
 *
 * Uses the existing spacing tokens. Nothing here introduces a new value.
 */
.nwt-notice details > summary,
.nwt-fields details > summary {
  cursor: pointer;
  color: var(--text-secondary);
  padding: var(--space-1, 0.25rem) 0;
  text-underline-offset: 3px;
}

.nwt-notice details > summary + p,
.nwt-fields details > summary + p {
  margin-top: var(--space-2, 0.5rem);
}

.nwt-notice details > p + p,
.nwt-fields details > p + p {
  margin-top: var(--space-2, 0.5rem);
}

.nwt-chart__table-scroll {
  overflow-x: auto;
  max-height: 22rem;
  overflow-y: auto;
  margin-top: var(--space-2, 0.5rem);
}

/* ---- Allocation bars ------------------------------------------------------
   One hue for every row. Identity comes from the label beside the bar, never
   from its colour — which is what makes the number of categories unbounded and
   what makes this readable to a customer with any colour vision. */
.nwt-alloc {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
  margin-top: var(--space-4, 1rem);
}

.nwt-alloc__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4, 1rem);
}

/* The share and the amount, in fixed columns, so the percentages line up down
   the list and can be compared without reading each one. */
.nwt-alloc__figures {
  display: flex;
  align-items: baseline;
  gap: var(--space-4, 1rem);
  flex: 0 0 auto;
  white-space: nowrap;
}

/* On a phone the label and its two figures stop fitting on one line, and a
   label wrapping under its own percentage is worse than a second line. */
@media (max-width: 560px) {
  .nwt-alloc__head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
  .nwt-alloc__figures {
    width: 100%;
    justify-content: space-between;
  }
  .nwt-alloc__figures > :first-child,
  .nwt-alloc__figures > :last-child {
    min-width: 0;
    text-align: left;
  }
}

.nwt-alloc__figures > :first-child {
  min-width: 3rem;
  text-align: right;
}

.nwt-alloc__figures > :last-child {
  min-width: 8rem;
  text-align: right;
}

.nwt-alloc__track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-canvas);
  border: 1px solid var(--border-hairline);
  overflow: hidden;
  /* A bar needs air on both sides. At 4px the label, the bar and the sentence
     under it read as one block rather than as three things. */
  margin: var(--space-2, 0.5rem) 0;
}

.nwt-alloc__fill {
  height: 100%;
  background: var(--accent-teal);
  border-radius: 999px;
}

.nwt-alloc__row p { margin: 0; }

/* ---- KPI values must not break mid-figure --------------------------------
   The four-up grid gives each card a narrow track, and "+£4,031.00" was
   wrapping after the sign — leaving a lone "+" on its own line above the
   number. A figure split across two lines reads as two things. */
.kpi-card__value {
  /* Never split a figure across two lines — it reads as two figures. */
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
  /* And never let it run out of the card either: the last resort is to shrink,
     which is what `compactValue` handles in JS and this backs up for the
     figures that are long even at that size. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- A two-up pair of figures --------------------------------------------
   Distinct from .nwt-rates, which is sized for the three-rate row. Two tiles
   sharing that grid ended up in narrow columns with their labels wrapping
   across four lines. */
.nwt-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-4, 1rem);
  margin-top: var(--space-4, 1rem);
}

/* ---- Prose fills its card ------------------------------------------------
   REPORTED BY JORDAN FOUR TIMES, the last of them: *"I got bored of asking why
   text is not full width — I have seen it so often. Why is text only half or
   just halfway in each card before it starts a new line."*

   What was here capped explanatory text at 62 characters, which is the right
   measure for a page of continuous reading and the wrong one inside a card.
   A card draws a box; a paragraph that stops two-thirds of the way across that
   box does not read as a considered measure, it reads as text that failed to
   fill its container — and the product was inconsistent about it, because
   captions, table notes and figure rows ran the full width while body
   paragraphs did not. Inconsistency is what makes it look like a fault.

   So a card sets the measure, and the text fills the card. Where a genuinely
   long paragraph needs a shorter line, the answer is a narrower card, not a
   paragraph that ends early inside a wide one. */

/* ---- The allowance block --------------------------------------------------
   The ring and its headline on the left, the figures beside it — not pushed to
   opposite edges of the card with a void between them, which is what the first
   version did and why it read as unfinished. */
.nwt-allowance {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-6, 1.5rem);
  margin: var(--space-4, 1rem) 0;
}

.nwt-allowance__ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1, 0.25rem);
  text-align: center;
}

.nwt-allowance__ring p { margin: 0; }

/* The ring itself was rendering at roughly 50px, which made the percentage
   inside it cramped and the whole block read as an afterthought. */
.nwt-allowance__ring .progress-ring,
.nwt-allowance__ring svg {
  width: 8.5rem;
  height: 8.5rem;
}

.nwt-allowance__left {
  margin-top: var(--space-2, 0.5rem) !important;
}

@media (max-width: 44rem) {
  .nwt-allowance {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .nwt-allowance__figures { width: 100%; }
}

/* ---- The confidence strip -------------------------------------------------
   How much of the headline total is a figure entered this month. Sits directly
   under the four figures, because somebody about to act on the number is
   looking at the number.

   NOT A SCORE. No grade, no rating, no colour that reads as a mark out of ten.
   The bar is a proportion of money and the sentence beside it is the fact. */
.nwt-confidence {
  margin-top: var(--space-4, 1rem);
  padding-top: var(--space-4, 1rem);
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.nwt-confidence p { margin: 0; }

/* M1, 8 September 2026 audit: at 6px on a full-width card this read as a
   horizontal rule between the figures and the sentence under it rather than as
   a meter. Taller, and inset so it is plainly a bar with ends rather than a
   line running the width of the card. */
.nwt-confidence__bar {
  height: 10px;
  max-width: 22rem;
  border-radius: 999px;
  background: var(--surface-canvas);
  border: 1px solid var(--border-hairline);
  overflow: hidden;
}

.nwt-confidence__fill {
  height: 100%;
  background: var(--accent-teal);
  border-radius: 999px;
}

/* Worth watching, not an emergency — gold, and only once a figure has been
   carried for three months or more. Coral stays reserved for one thing. */
.nwt-confidence--watch .nwt-confidence__fill { background: var(--accent-gold); }

/* ---- The bridge timeline --------------------------------------------------
   Three spans on one line: working, then the gap, then the pension. The gap is
   the whole point, so it carries a pattern as well as a fill — colour is never
   the only signal. */
.nwt-bridge {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.75rem);
  margin: var(--space-4, 1rem) 0;
}

.nwt-bridge__bar {
  display: flex;
  height: 3rem;
  border-radius: var(--radius-md, 6px);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
}

.nwt-bridge__span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 var(--space-2, 0.5rem);
}

.nwt-bridge__span-label {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nwt-bridge__span--working {
  background: var(--accent-teal);
  color: #FFFFFF;
}

/* The gap: a hatch as well as a colour, so it is distinguishable without
   relying on hue at all. */
.nwt-bridge__span--gap {
  background: var(--accent-gold);
  color: #2A2100;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.14) 0 6px,
    transparent 6px 12px
  );
}

.nwt-bridge__marks {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2, 0.5rem);
}

.nwt-bridge__mark {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nwt-bridge__mark--middle { align-items: center; text-align: center; }
.nwt-bridge__mark--end { align-items: flex-end; text-align: right; }

.nwt-bridge__facts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}


/* ---- Facts nested inside an allowance ------------------------------------
   The Lifetime ISA sub-limit and the tax-year countdown belong TO the ISA
   allowance, not beside it. A LISA limit sits inside the £20,000 and showing
   it as a sibling card is the exact misunderstanding customers already have. */
.nwt-allowance__extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-4, 1rem);
  padding-top: var(--space-4, 1rem);
  margin-top: var(--space-2, 0.5rem);
  border-top: 1px solid var(--border-hairline);
}

.nwt-allowance__extra p { margin: 0; }

/* ---- Snapshot progress ----------------------------------------------------
   A forty-row grid with no marker gives no sense of how far down it you are,
   and the whole promise of the screen is that it takes two minutes. */
.nwt-snapshot__progress {
  margin-top: var(--space-4, 1rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.nwt-snapshot__progress p { margin: 0; }

.nwt-snapshot__progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-canvas);
  border: 1px solid var(--border-hairline);
  overflow: hidden;
}

.nwt-snapshot__progress-fill {
  height: 100%;
  background: var(--accent-teal);
  border-radius: 999px;
  transition: width 120ms linear;
}

@media (prefers-reduced-motion: reduce) {
  .nwt-snapshot__progress-fill { transition: none; }
}

/* ---- Tables ---------------------------------------------------------------
   Wide content scrolls inside its own container so the page body never scrolls
   sideways. */
.table-wrap {
  overflow-x: auto;
  margin-top: var(--space-4, 1rem);
}

.table-wrap .data-table {
  width: 100%;
  min-width: 40rem;
}

/* ---- What you can take away ----------------------------------------------
   One row per thing a customer might want out of the product, with the ways to
   get it beside it. An offline product can print genuinely well, and this is
   the screen where that shows. */
.nwt-takeaways {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-4, 1rem);
}

.nwt-takeaway {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
  padding: var(--space-3, 0.75rem) 0;
  border-bottom: 1px solid var(--border-hairline);
  flex-wrap: wrap;
}

.nwt-takeaway:last-child { border-bottom: 0; }
.nwt-takeaway__text { min-width: 0; }
.nwt-takeaway__text p { margin: 0; }

.nwt-takeaway__actions {
  display: flex;
  gap: var(--space-2, 0.5rem);
  flex-shrink: 0;
}

/* ---- Keeping a copy -------------------------------------------------------
   Status above the buttons, because the status is the point of the card. */
.nwt-backup {
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  border-radius: var(--radius-md, 6px);
  border-left: 3px solid var(--border-hairline);
  background: var(--surface-canvas);
  margin: var(--space-4, 1rem) 0;
}

.nwt-backup p { margin: 0; }

/* Never taken one: gold. Worth watching, not an emergency — coral stays
   reserved for one thing per screen. */
.nwt-backup--none,
.nwt-backup--stale { border-left-color: var(--accent-gold); }
.nwt-backup--ok { border-left-color: var(--accent-teal); }

.nwt-backup__actions {
  display: flex;
  gap: var(--space-3, 0.75rem);
  flex-wrap: wrap;
  margin: var(--space-4, 1rem) 0 var(--space-2, 0.5rem);
}

/* A file input styled as a button: the input itself is hidden from sight but
   still reachable by keyboard, because the label wraps it. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nwt-backup__actions label { cursor: pointer; }

/* ---- The backfill grid ----------------------------------------------------
   A month per row, an account per column. Wide by nature, so it scrolls inside
   its own container and the row header stays put. */
.nwt-backfill th[scope="row"] {
  position: sticky;
  left: 0;
  background: var(--surface-card);
  text-align: left;
  white-space: nowrap;
}

.nwt-backfill input {
  /* Wide enough for a formatted figure, because a recorded month shows one:
     "£112,400.00" is eleven characters and at 7rem the last of them was
     clipped inside a read-only box the customer cannot scroll. The grid is a
     scroller by nature, so the width costs nothing. */
  min-width: 8.5rem;
  box-sizing: border-box;
  width: 100%;
  text-align: right;
}

.nwt-backfill input:disabled {
  background: var(--surface-canvas);
  color: var(--text-secondary);
}

/* ---- Every screen is a spaced column -------------------------------------
   THE FIX FOR "CARDS ARE NOT SPACED" (Jordan, 8 September 2026). Screens
   appended their cards straight into `#app-main`, and `.card` carries no
   margin of its own, so consecutive cards touched — a long screen read as one
   column of boxes rather than as separate answers to separate questions.

   Small Business Manager hit this first and `.sbm-screen` is its answer, with
   its own comment recording the same instruction on 5 September. This is
   deliberately the same rule with the same gap, so the two products space
   identically; `product.js` wraps every route in it. */
.nwt-screen {
  max-width: var(--content-max-width);
  /* Centred, or a 1440px window leaves a third of itself empty on the right
     while the KPI row stretches to fill what is left. */
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* A card's own heading should not sit flush against the card's top padding,
   and its trailing paragraph should not sit flush against the bottom. Browser
   defaults on h2/h3/p were doing both, unevenly, depending on which element
   happened to come first. */
.nwt-screen .card > :first-child { margin-top: 0; }
.nwt-screen .card > :last-child { margin-bottom: 0; }

/* ---- First run: the welcome ----------------------------------------------
   The one screen in the product that is read rather than used, so it is given
   a reading measure and more air than a working screen gets. */
.nwt-welcome {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.nwt-welcome__hero {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nwt-welcome__eyebrow {
  margin: 0;
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
  color: var(--accent-teal-text);
}

.nwt-welcome__title {
  margin: 0;
  font-size: var(--text-display-size);
  font-weight: var(--text-display-weight);
  line-height: var(--text-display-line);
  /* 28ch, measured rather than picked: at 22ch the headline broke as three
     lines with "next" alone on the last one. */
  max-width: 28ch;
}

.nwt-welcome__lead {
  margin: 0;
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
}

/* The edition, set apart from the pitch — it is a fact about this copy of the
   software rather than a selling point, and it should read as one. */
.nwt-welcome__edition {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-3);
  border-left: 3px solid var(--accent-gold);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-line);
  color: var(--text-secondary);
}

.nwt-welcome__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

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

.nwt-welcome__section > h2 { margin: 0; }

.nwt-welcome__label {
  margin: 0;
  color: var(--accent-teal-text);
}

/* Two columns on a desktop, one on a phone. `auto-fit` rather than a fixed
   count so the four steps reflow without a media query per breakpoint. */
.nwt-welcome__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-4);
}

/* THREE ITEMS, STACKED, not gridded. In a two-column grid the third card sat
   alone beside a gap, which reads as something failing to load. These are
   three paragraphs of prose rather than three parallel options, so a column
   is also the right shape for them. */
.nwt-welcome__expect {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nwt-welcome__step,
.nwt-welcome__expect-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.nwt-welcome__step > h3,
.nwt-welcome__step > p,
.nwt-welcome__expect-item > h3,
.nwt-welcome__expect-item > p { margin: 0; }

.nwt-welcome__step-index {
  font-variant-numeric: tabular-nums;
  font-size: var(--text-caption-size);
  font-weight: 700;
  letter-spacing: var(--text-label-tracking);
  color: var(--accent-teal-text);
}

.nwt-welcome__todo { display: flex; flex-direction: column; gap: var(--space-3); }
.nwt-welcome__todo > * { margin: 0; }

.nwt-welcome__todo-list {
  margin: 0;
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nwt-welcome__todo-list li::marker {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.nwt-welcome__todo-list p { margin: 0; }
.nwt-welcome__todo .button { align-self: flex-start; }

.nwt-welcome__trust {
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-card);
  background: var(--surface-canvas);
  border: 1px solid var(--border-hairline);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-line);
  color: var(--text-secondary);
  text-align: center;
}

/* ---- First run: about you ------------------------------------------------ */
.nwt-setup {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: var(--content-max-width);
}

.nwt-setup .card > :first-child { margin-top: 0; }
.nwt-setup .card > :last-child { margin-bottom: 0; }

.nwt-setup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-2);
}

/* ---- The getting-started checklist ---------------------------------------
   A row per step: a mark, the text, and the way to do it. The mark is a fixed
   column so the labels line up whether or not a step is done — a list whose
   text shifts left as items complete reads as though it is rearranging
   itself. */
.nwt-start { display: flex; flex-direction: column; gap: var(--space-3); }
.nwt-start > h2, .nwt-start > p { margin: 0; }

.nwt-start__count {
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.nwt-start__step {
  display: grid;
  /* A FIXED ACTION COLUMN, because each row is its own grid and an `auto`
     third column sized itself to each button's own label — so "Add it" and
     "Take a snapshot" ended at different distances from the card edge and the
     list looked ragged. A fixed width right-aligns every button to the same
     edge, which is what makes a checklist scan as a column. */
  grid-template-columns: 1.75rem 1fr 11rem;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-hairline);
}

.nwt-start__mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}

/* Done is a tick AND a colour AND, for anyone who gets neither, the words
   "— done" in the label (CLAUDE.md §21: status never rests on colour alone). */
.nwt-start__step.is-done .nwt-start__mark {
  border-color: var(--colour-positive);
  background: var(--colour-positive);
  color: var(--surface-card);
}

.nwt-start__step.is-done .nwt-start__text p:first-child {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.nwt-start__text { display: flex; flex-direction: column; gap: var(--space-1); }
.nwt-start__text p { margin: 0; }

.nwt-start__step .button {
  white-space: nowrap;
  justify-self: end;
}

.nwt-start__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border-top: 1px solid var(--border-hairline);
  padding-top: var(--space-3);
}

.nwt-start__footer p { margin: 0; }

/* Stacking, not squeezing. Below about 34rem the three-column step row puts
   the action button on a line of its own rather than crushing the text. */
@media (max-width: 34rem) {
  .nwt-start__step { grid-template-columns: 1.75rem 1fr; }
  .nwt-start__step .button { grid-column: 2; justify-self: start; }
  .nwt-welcome__hero { padding: var(--space-4); }
}

/* ---- Cards that are a stack of fields ------------------------------------
   A field, then the sentence explaining it, then the next field. `.field`
   carries no margin of its own and a browser's default paragraph margin
   collapsed against it unevenly — so on the About-you card the note under the
   date of birth ("It is kept on this computer like everything else") ran
   straight into the label of the field beneath it with no gap at all.

   Set here rather than on `.card` generally, because several NWT cards are
   flex containers using `gap`, and adding margins to their children would
   space them twice. */
/* The explanation belongs to the field above it, so it sits closer to that
   field than the next field does — proximity is what says which one it is
   about. */


/* ==========================================================================
   The 8 September 2026 design pass — Debts, Property, What-ifs, Import.
   ========================================================================== */

/* ---- A percentage typed into a box that shows the % ----------------------
   The suffix sits inside the field's border so the unit belongs to the input
   rather than floating beside it. */
.nwt-rate-input {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.nwt-rate-input .text-field {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.nwt-rate-input__suffix {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-hairline);
  border-left: 0;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--surface-canvas);
  color: var(--text-secondary);
}

/* ---- What you owe --------------------------------------------------------
   The payoff cell holds two lines — a date and the working behind it — so it
   is a column rather than a single run of text. */
.nwt-debt-table__payoff {
  display: table-cell;
}

.nwt-debt-table__payoff span {
  display: block;
}

.nwt-debt-table__actions {
  white-space: nowrap;
  text-align: right;
}

.nwt-debt-table__actions .button + .button {
  margin-left: var(--space-2);
}

/* ---- What-ifs: two columns, neither of them the answer -------------------
   THE HIGHLIGHT IS DELIBERATELY ABSENT. Core's comparisonCard applies a
   `--recommended` modifier to one column; the design specification forbids
   exactly that visual emphasis, because marking one side IS the ranking the
   perimeter turns on (DECISIONS §5.2). Both columns are identical: same
   border, same background, same weight. */
.nwt-compare__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-4);
}

.nwt-compare__column {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  background: var(--surface-canvas);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nwt-compare__title {
  margin: 0;
  color: var(--text-secondary);
}

.nwt-compare__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-hairline);
}

.nwt-compare__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.nwt-compare__row span { margin: 0; }
.nwt-compare__note { color: var(--text-secondary); }

.nwt-compare__sentence {
  margin: 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;
}

/* ---- Import: where am I in this ------------------------------------------
   Five steps, repeated at the head of each card, so a long screen never
   leaves somebody unsure whether anything has been written yet. */
.nwt-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.nwt-steps__step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-caption-size);
}

.nwt-steps__mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.nwt-steps__step.is-done .nwt-steps__mark {
  background: var(--colour-positive);
  border-color: var(--colour-positive);
  color: var(--surface-card);
}

/* The current step is named as well as coloured — a step strip whose only
   signal is a tint tells a colour-blind reader nothing (CLAUDE.md §21). */
.nwt-steps__step.is-current {
  color: var(--text-primary);
  font-weight: 600;
}

.nwt-steps__step.is-current .nwt-steps__mark {
  border-color: var(--accent-teal);
  border-width: 2px;
  color: var(--accent-teal-text);
}

.nwt-import-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.nwt-import-subhead {
  margin: var(--space-4) 0 var(--space-2);
}

.nwt-import-skipped {
  margin: 0;
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* ---- Import: a figure that clashes with one you already have -------------
   Side by side, both readable, with the chosen one marked in words on its own
   button ("Using this") as well as by its outline. */
.nwt-clash {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.nwt-clash > p { margin: 0; }

.nwt-clash__sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.nwt-clash__side {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control);
  background: var(--surface-canvas);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

.nwt-clash__side p { margin: 0; }

.nwt-clash__side.is-chosen {
  border-color: var(--accent-teal);
  border-width: 2px;
  padding: calc(var(--space-3) - 1px);
}

/* The ownership line belongs to the heading above it, not to the figures
   below — it was sitting hard against the top of the KPI row. */
.nwt-screen-head + .text-caption {
  margin: 0 0 var(--space-4);
}

/* The step strip repeated further down a card needs air above it — the last
   preview ran the skipped-rows note straight into the step 5 markers. */
.nwt-steps:not(:first-child) {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-hairline);
}

/* A previous figure two months or more behind. The one row that is genuinely
   stale, marked — where every row used to be. */
/* THE TEXT VERSION OF THE CAUTION COLOUR (19 September 2026). The bare gold is
   a fill colour: as text on a white card it fails the 4.5:1 contrast minimum,
   which the accessibility scan caught once property and debt rows — often
   months behind — put this label on the Snapshot. Core's --status-caution-text
   is the gold meant for words, and the dark theme redefines it. */
.nwt-snapshot__stale {
  color: var(--status-caution-text);
}

/* The plan's three assumptions, side by side rather than three full-width
   boxes stacked down a page — they are read together and changed together. */
.nwt-assumptions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
  align-items: start;
}

.nwt-assumptions .field { margin: 0; }

/* Row actions in a data table: kept together, pushed to the end, and never
   wrapping mid-word onto two lines. */
.nwt-account-actions {
  white-space: nowrap;
  text-align: right;
}

.nwt-account-actions .button + .button {
  margin-left: var(--space-2);
}

/* A closed account stays in the list — closing is not deleting — but recedes,
   with the word "Closed" in its status chip doing the actual telling.

   NO `.data-table` IN THIS SELECTOR, and that is the point. `.data-table` is
   Core's, and a product stylesheet is not allowed to style Core's chrome —
   qa/cssOwnershipTest.mjs enforces it, because a package that does NOT include
   this product would ship that chrome unstyled. This rule sat here from
   8 September 2026 and failed that check, which is the SIXTH step in the QA
   chain, so the chain could not run past it at all for a day.

   `is-closed` is set only by this product's accounts screen and nowhere else in
   the codebase, so dropping the Core class changes nothing about what this
   matches. Core's own `.data-table td` rule sets padding and no colour, so
   there is nothing for the lower specificity to lose to. */
tr.is-closed td:not(.nwt-account-actions) {
  color: var(--text-secondary);
}

.nwt-contrib-note {
  color: var(--text-secondary);
}

/* A backfill cell that is already recorded. Read-only rather than disabled, so
   it stays reachable by keyboard and its value still reaches a screen reader —
   a disabled input is skipped entirely, and on a grid of forty a keyboard user
   could not tell a recorded month from a missing one. */
.nwt-backfill input.is-recorded {
  background: var(--surface-canvas);
  color: var(--text-secondary);
  border-style: dashed;
  cursor: default;
}

/* ---- Flow spacing inside a card ------------------------------------------
   REPORTED BY JORDAN THREE TIMES: "text is touching cards", "text is still
   touching cards", and on 8 September "I dont want text touching a card, i
   want things clearly separated".

   IT KEPT COMING BACK BECAUSE IT WAS FIXED ONE PAIR AT A TIME. What stood
   here was a list of eleven block classes and the things that may follow
   them — so a card whose children happened to be two plain paragraphs, or a
   heading and a list, or a button and a note, was still unspaced, and every
   new card started the cycle again.

   THE CAUSE IS ONE LINE IN CORE: `h1, h2, h3, h4, p { margin: 0 }`
   (core/css/core.css). That is right for a design system whose containers set
   their own rhythm, and it means a card laid out as a plain block has NO
   spacing between its children at all. Nothing was touching because a rule was
   wrong; it was touching because no rule existed.

   So this sets the rhythm once, for every child of every card on every screen,
   including cards not written yet. */
.nwt-screen .card > * + * {
  margin-top: var(--space-4);
}

/* Cards that lay themselves out as a flex column already carry their own gap,
   and a margin as well would space their children twice. Listed rather than
   detected, because CSS cannot ask what an element's display is — and kept
   short deliberately: a new card should be a plain block unless it has a
   reason not to be. */
.nwt-screen .kpi-card > * + *,
.nwt-screen .nwt-rate > * + *,
.nwt-screen .nwt-snapshot__actions > * + *,
.nwt-screen .nwt-welcome__step > * + *,
.nwt-screen .nwt-welcome__expect-item > * + *,
.nwt-screen .nwt-welcome__todo > * + * {
  margin-top: 0;
}

/* A caption or a note EXPLAINS the thing above it, so it sits closer to that
   thing than the next block does. Proximity is what says which block a
   sentence is about, and a uniform gap says nothing. */
.nwt-screen .card > :is(h2, h3, h4) + p,
.nwt-screen .card > p + p.text-caption,
.nwt-screen .card > p.text-label + p,
.nwt-screen .card > .field + p.text-caption {
  margin-top: var(--space-2);
}

/* A note belonging to the pair of tiles above it, and one explaining the table
   above it, are both closer to what they describe than to what follows. */
.nwt-screen .card > .nwt-pair + p.text-caption {
  margin-top: var(--space-2);
}

/* Items in a list are separate statements, not a paragraph with line breaks. */
.nwt-screen .card li + li {
  margin-top: var(--space-2);
}

/* Blocks nested one level down carry the same rhythm — a note inside a choice
   block, or inside a row of a list, is still a note that must not touch what
   is above it. */
.nwt-screen .nwt-choice > * + *,
.nwt-screen .nwt-account-row__main > * + *,
.nwt-screen .nwt-allowance__extra > * + * {
  margin-top: var(--space-2);
}

.nwt-date-field__problem {
  color: var(--colour-attention);
}

.nwt-date-field input[aria-invalid="true"] {
  border-color: var(--colour-attention);
}

/* ---- The report builder --------------------------------------------------
   The picker chooses what goes in; the document below is what prints. */
.nwt-report-picker__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.nwt-report-picker__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control);
  cursor: pointer;
}

.nwt-report-picker__item p { margin: 0; }
.nwt-report-picker__item input { margin-top: 4px; }

.nwt-report {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.nwt-report__head { border-left: 3px solid var(--accent-teal); }

/* The picker is a control, not part of the document. It comes off the page,
   the way the navigation and the header already do. */
@media print {
  .nwt-report-picker { display: none !important; }
  .nwt-report .card { break-inside: avoid; box-shadow: none; }
}

/* ==========================================================================
   The 8 September 2026 UI/UX audit.
   ========================================================================== */

/* ---- H1: four full-width KPI cards are a screen and a half on a phone ----
   Overview measured 3,958px tall at 390px, and "Progress to target" — which is
   arguably the point of the product — sat below two full scrolls. Two-up puts
   all four in view, which is what a phone needs from a summary. */
@media (max-width: 640px) {
  /**
   * ON A PHONE A KPI CARD IS A ROW, NOT A TILE.
   *
   * The audit's first fix put the four cards two across, because four
   * full-width tiles made Overview 3,958px tall and "Progress to target" sat
   * below two full scrolls. That solved the height and created something
   * worse: at 390px a two-column track leaves 96px of content, and
   * "£335,780.00" needs 137px — so the product's headline figure rendered as
   * "£335,7…". A truncated money figure is worse than any amount of scrolling.
   *
   * Full width restores the figure. The height comes back out by laying the
   * card as a row instead of a stack: the label on the left, the figure
   * right-aligned beside it, and the explanation underneath spanning both.
   * That is about the same height as the two-up grid was, and every figure is
   * whole.
   */
  .nwt-screen .kpi-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .nwt-screen .kpi-grid > .card {
    grid-column: 1 / -1 !important;
    padding: var(--space-3);
    min-width: 0;
  }

  .nwt-screen .kpi-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: var(--space-3);
    row-gap: var(--space-1);
  }

  .nwt-screen .kpi-card__top {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .nwt-screen .kpi-card__value {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    /* The display size is set for a card a third of a screen wide. */
    font-size: var(--text-title-size);
    line-height: var(--text-title-line);
  }

  .nwt-screen .kpi-card__secondary,
  .nwt-screen .kpi-card__meaning {
    grid-column: 1 / -1;
    min-width: 0;
  }

  /* A display-size figure is set for a card a third of a screen wide. On a
     phone the rate tiles hold one each, and £650,000.00 ran past the edge. */
  .nwt-screen .nwt-rate .text-display,
  .nwt-screen .nwt-allowance__figures .text-display {
    font-size: var(--text-title-size);
    line-height: var(--text-title-line);
  }
}

/* The column itself is what keeps a line readable on a wide screen — 1100px of
   card, less its padding, is a comfortable measure at body size. The paragraphs
   inside it are not narrowed again; that was the fault above. */
@media (min-width: 1200px) {
  .nwt-screen {
    max-width: min(1100px, 100%);
  }
}

/* ---- M3: the donut's unused track vanishes in dark mode -----------------
   The ring showed the used portion clearly and the remainder not at all, so a
   10% ring and a 90% ring looked much the same at a glance. */
:root[data-theme="dark"] .progress-ring__track,
:root[data-theme="dark"] .nwt-allowance__ring circle:first-of-type {
  stroke: var(--border-hairline);
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .progress-ring__track,
  :root:not([data-theme="light"]) .nwt-allowance__ring circle:first-of-type {
    stroke: var(--border-hairline);
    opacity: 1;
  }
}

/* ---- L2: snapshot inputs were 110px with space to their left ------------
   The monthly ritual is typed into these boxes; on a phone they should be the
   largest thing on the row, not the smallest. */
@media (max-width: 640px) {
  .nwt-snapshot__row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .nwt-snapshot__field input {
    width: 100%;
    font-size: 1.05rem;
    padding-block: var(--space-3);
  }

  .nwt-snapshot__last {
    text-align: left;
  }
}

/* What an overpayment buys, said in months rather than pounds — the only lever
   on the debts screen a customer controls. */
.nwt-debt-table__overpay {
  color: var(--accent-teal-text);
}

/* ---- What comes next, while setting up ----------------------------------
   At the foot of a setup screen, after the work rather than in front of it. */
.nwt-next {
  border-left: 3px solid var(--accent-teal);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.nwt-next > * { margin: 0; }
.nwt-next .button { align-self: flex-start; margin-top: var(--space-2); }
.nwt-next .text-label { color: var(--accent-teal-text); }

/* The one chart in the product that draws something that has not happened. The
   shaded band underneath is what the customer would have paid in; everything
   above it is what the assumption adds. */
.nwt-projection .nwt-chart__svg {
  background: transparent;
}

/* ---- #3 and #4: what a figure means, beside the figure ------------------
   Reported by Jordan, 8 September 2026: "Every card and every screen. There
   needs to be more information or tooltips explaining what is being shown and
   how. I find it confusing so would someone who actually bought this."

   A caption under a KPI card, in the card, so the explanation travels with the
   number rather than living in a paragraph three cards away. */
.kpi-card__meaning {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-line);
}

/* ==========================================================================
   The 8 September 2026 finish pass.

   Jordan: *"I can see some numbers not aligning in columns and tables. That
   looks unprofessional."*
   ========================================================================== */

/* ---- Money lines up on the digit, or it is not a column ------------------
   Core's `.numeric` gives tabular figures — every digit the same width — and
   the screens apply it correctly to every money column in the product. What it
   does NOT do is align them, so £9,280.00 and £186,400.00 both started at the
   left edge of their cell and ended in different places. Tabular figures make
   a right-aligned column line up perfectly and do nothing at all for a
   left-aligned one, which is why this looked wrong despite the class being
   there.

   Right-aligned, header included, so the word "Balance" sits over the last
   digit of the balances beneath it. Core has `.data-table--right` for exactly
   this and a `thead th` rule that outranks it; the same collision is avoided
   here by naming `th.numeric` explicitly. */
.nwt-screen .data-table th.numeric,
.nwt-screen .data-table td.numeric,
.nwt-report .data-table th.numeric,
.nwt-report .data-table td.numeric {
  text-align: right;
}

/* ROW LABELS READ LIKE THE FIRST COLUMN OF ANY OTHER TABLE (19 September 2026).
   The tables added by the audit's work — Month in review, Projection, Compare
   scenarios, the assumptions card — label each row with a <th scope="row">, so
   a screen reader announces which row a figure belongs to. Core styles a th as
   a centred, heavy column heading, which made those labels float in the middle
   of the table in bold. Left-aligned at body weight they read as what they
   are; the total row keeps its weight. */
.nwt-screen .data-table tbody th[scope="row"],
.nwt-report .data-table tbody th[scope="row"] {
  text-align: left;
  font-weight: inherit;
}
.nwt-screen .data-table tbody tr.data-table__total th[scope="row"],
.nwt-screen .data-table tbody tr.data-table__total td {
  font-weight: 600;
}

/* A cell holding an input is a column of boxes, and those align on the box
   rather than on the digit — the figure inside is already right-aligned. */
.nwt-screen .data-table td.numeric input {
  text-align: right;
}

/* Two figures on one line inside a cell — "£186,400.00" over "your share, 50%:
   £93,200.00" — are two lines, not a wrapped sentence. */
.nwt-screen .data-table td.numeric span {
  display: block;
}

/* ---- The backfill grid's inputs -----------------------------------------
   A 7rem minimum inside a cell padded by `--space-2` on each side made the
   input wider than the cell it sits in, by three or four pixels — enough for
   the box to sit over the column rule beside it. */
.nwt-backfill td {
  padding-left: var(--space-1);
  padding-right: var(--space-1);
}

/* ---- A note directly under the line it explains --------------------------
   Nested one or more levels inside a card — a picker row, a list item, the
   previous-figure cell on the snapshot grid — two paragraphs sat with their
   boxes touching. Line height alone separates them by less than a word space,
   which is what makes a label and its note read as one run-on line.

   Four pixels, not sixteen: this is a pair, and the pair has to stay a pair.
   The card-level rule above is more specific, so a caption that is a direct
   child of a card keeps its larger gap. */
.nwt-screen p + p,
.nwt-report p + p {
  margin-top: var(--space-1);
}

/* A subtotal row in the reachable/locked ledger: it is a sum of the rows above
   it, so it is separated from them by a rule rather than by shading, which the
   striped table already uses for something else. */
.nwt-screen .data-table tr.nwt-split__subtotal td {
  border-top: 1px solid var(--border-hairline);
}

/* The confidence line's own heading: a name on the left, the figure on the
   right. Without it the two ran together as "Entered this month58%". */
.nwt-confidence__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ==========================================================================
   The statement — a document rather than a screenshot of one.

   Jordan, 8 September 2026: *"I have just realised you're just printing the
   page. Is there no way of producing a professional statement?"* The mechanism
   is the browser's own print-to-PDF, which is what Small Business Manager uses
   for its invoices; what was missing is that SBM builds a document and prints
   only that, while this printed the application with its furniture hidden.
   ========================================================================== */

.nwt-print-root { display: none; }

.nwt-doc {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-7, 2.5rem) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* The letterhead: what this is, and when it was true. */
.nwt-doc__head {
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.nwt-doc__head > * { margin: 0; }

.nwt-doc__head .text-title {
  font-size: var(--text-display-size);
  font-weight: var(--text-display-weight);
  line-height: var(--text-display-line);
}

/* A section of the document is a heading and its figures, separated by air and
   a rule rather than by a box — a boxed card inside a printed statement reads
   as a screenshot of software, which is exactly what this is not. */
.nwt-doc__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  break-inside: avoid;
}

.nwt-doc__section > * { margin: 0; }

.nwt-doc__section > .text-title {
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-hairline);
}

.nwt-doc .table-wrap { margin-top: 0; }
.nwt-doc .data-table { min-width: 0; }
.nwt-doc .data-table tbody tr:nth-child(odd) { background: transparent; }
.nwt-doc .data-table td,
.nwt-doc .data-table th { border-bottom: 1px solid var(--border-hairline); }

@media print {
  /* Only the document prints. Everything else is the application, and nobody
     wants a sidebar on their net worth statement. */
  body > *:not(.nwt-print-root) { display: none !important; }
  .nwt-print-root { display: block !important; }

  .nwt-doc {
    color: #000;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* The margin the page no longer provides, in millimetres because this is
       paper. */
    padding: 18mm 16mm;
    box-sizing: border-box;
  }

  /* ---- The browser's own header and footer -------------------------------
   *
   * Raised by Jordan on an earlier list — the file:/// path along the bottom of
   * an exported PDF — and answered then with "that is the browser's print
   * chrome and cannot be changed". HALF RIGHT, AND THE WRONG HALF WAS THE
   * CONCLUSION: a page cannot switch those lines off, but Chrome and Edge draw
   * them INSIDE the `@page` margin, so a margin of zero leaves them nowhere to
   * go. Small Business Manager has done this since its invoices shipped.
   *
   * NOT VERIFIED IN EVERY BROWSER, and said honestly rather than assumed:
   * Firefox and Safari may still show theirs, where the customer can untick
   * "Headers and footers" in the print dialog.
   */
  @page { margin: 0; }
}

.nwt-doc__foot {
  border-top: 1px solid var(--border-hairline);
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.nwt-doc__foot > * { margin: 0; }

/**
 * The one figure the Retirement screen exists to give.
 *
 * Larger than a KPI card's value because it is not one of several — it is the
 * answer, and everything below it is either where it came from or what happens
 * to it later. No new colour, type family or spacing unit: it is the existing
 * display size stepped up one, on the existing ink.
 */
.nwt-answer {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  margin-bottom: var(--space-1);
}

/* ---- What the GOV.UK summary reader found, or could not ------------------
   THE ANSWER NEEDS AIR AROUND IT. The notice and the notes beneath it were
   bare paragraphs with nothing between them, so a failure arrived as one
   block of grey text under the file box — which is how a customer comes to
   say the button did nothing. */
.nwt-sp-read { margin-top: var(--space-3); }
.nwt-sp-read > * + * { margin-top: var(--space-3); }
.nwt-sp-read > .nwt-allowance__row + .nwt-allowance__row { margin-top: var(--space-1); }
