/* ─────────────────────────────────────────────────────────────
   TaxCalc.ie — Layout & Component CSS
   Built entirely on tokens from tokens.css (Task 1). No hardcoded
   colors or design-scale spacing values outside the documented
   exceptions (grid fractions; slider-thumb literal #fff).
   ───────────────────────────────────────────────────────────── */

@import url('tokens.css');

/* ─────────── BASE ─────────── */
html, body { margin: 0; padding: 0; background: var(--bg); }
#root { min-height: 100vh; }

/* The browser's default `[hidden] { display: none }` rule has the same
   specificity as (and comes before) our own `display: flex`/`display: grid`
   component rules, so those component rules win the cascade and a [hidden]
   element still renders - this override guarantees data-conditional/JS
   visibility toggling (interactions.js) actually hides the element. */
[hidden] { display: none !important; }
.tc-rent-warning { display:flex; gap:var(--s-2); align-items:flex-start; padding:var(--s-3); border:calc(var(--s-1) / 2) solid #b7791f; background:#fef3c7; color:#713f12; border-radius:var(--r-sm); }
.tc-rent-warning svg { width: var(--s-6); height: var(--s-6); flex-shrink: 0; }
.tc-currency-input--warning { border-color:#b7791f; background:#fffbeb; }

/* ─────────── LAYOUT — ported verbatim from the prototype's
   <style> block (TaxCalc Refresh.html) ─────────── */

.tc-wrap { max-width: 1120px; width: 100%; margin: 0 auto; padding-left: var(--s-16); padding-right: var(--s-16); box-sizing: border-box; }

/* Landing — single screen */
.tc-landing { min-height: calc(100vh - 53px); display: flex; align-items: center; padding: var(--s-7) 0; box-sizing: border-box; }
.tc-landing-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; }
.tc-landing-h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(38px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -0.02em; color: var(--ink-900); margin: 0 0 18px; }
.tc-landing-sub { font-family: var(--font-body); font-size: 17px; line-height: 1.55; color: var(--fg-muted); margin: 0; max-width: 460px; }
.tc-app-mention { margin-top: 36px; padding-top: var(--s-7); border-top: 1px solid var(--border); }

/* Calculator */
.tc-calc-grid { display: grid; grid-template-columns: minmax(0, 560px) 1fr; gap: var(--s-8); align-items: start; }
.tc-calc-preview { align-self: stretch; }
/* Grid items default to min-width:auto, which refuses to shrink a column
   below its content's intrinsic width - without this override, a nested
   flex row (e.g. .tc-number-input) can force its column wider than the
   grid's own track, overflowing past the container instead of shrinking. */
.tc-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.tc-two-col > * { min-width: 0; }

/* Hero */
.tc-hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; }
.tc-hero-left { padding: var(--s-7); border-right: 1px solid var(--border-soft); }
.tc-hero-right { padding: var(--s-7); display: flex; align-items: center; justify-content: center; }

.tc-whatif-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); margin-top: 22px; }
.tc-y2y-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }

/* Tax allocation — where your income tax goes */
.tc-alloc-grid { display: grid; grid-template-columns: 1fr 1fr; }
.tc-alloc-row { display: flex; align-items: flex-start; gap: 14px; padding: 18px var(--s-6); }
.tc-alloc-row:nth-child(odd) { border-right: 1px solid var(--border-soft); }
.tc-alloc-row:nth-child(n+3) { border-top: 1px solid var(--border-soft); }

/* Range slider */
.tc-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: var(--r-pill); background: var(--paper-3); outline: none; margin: 6px 0; }
.tc-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
.tc-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
.tc-range:focus-visible { box-shadow: 0 0 0 3px var(--focus-ring); }

.tc-mobile-nav { display: none; }
.tc-mobile-menu { display: none; }
.tc-mobile-menu__nav a {
  display: block; padding: var(--s-3) var(--s-1);
  font-family: var(--font-body); font-size: var(--fs-15); font-weight: 500;
  color: var(--fg); text-decoration: none; border-top: 1px solid var(--border-soft);
}
.tc-mobile-menu__nav a:first-child { border-top: 0; }

/* Grid tracks collapsed to a single "1fr" column below default their auto min-width
   is the content's min-content size, not 0 - a child that can't shrink (e.g. a row of
   unbreakable labels) blows the track past the viewport instead of wrapping/shrinking.
   minmax(0, 1fr) removes that content-based floor. */
@media (max-width: 900px) {
  .tc-calc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .tc-landing-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-8); }
  .tc-landing { min-height: 0; padding: 32px 0 56px; }
  .tc-landing-sub { max-width: none; }
  .tc-landing-right { order: -1; }
}
@media (max-width: 760px) {
  .tc-wrap { padding-left: var(--s-6); padding-right: var(--s-6); }
  .tc-desktop-nav { display: none !important; }
  .tc-mobile-nav { display: inline-flex !important; }
  .tc-mobile-menu { display: block; background: var(--bg-raised); box-shadow: var(--shadow-md); }
  .tc-mobile-menu__nav { padding-top: var(--s-1); padding-bottom: var(--s-1); }
  .tc-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .tc-hero-left { border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .tc-alloc-grid { grid-template-columns: minmax(0, 1fr); }
  .tc-alloc-row:nth-child(odd) { border-right: none; }
  .tc-alloc-row:nth-child(n+2) { border-top: 1px solid var(--border-soft); }
}
@media (max-width: 560px) {
  .tc-two-col { grid-template-columns: minmax(0, 1fr); }
  .tc-whatif-stats { grid-template-columns: minmax(0, 1fr); }
  .tc-y2y-grid { grid-template-columns: minmax(0, 1fr); }
  .tc-whatif-meta { display: none; }
}

/* ─────────── BUTTONS — .tc-btn (from Button, Primitives.jsx) ─────────── */

.tc-btn {
  box-sizing: border-box;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast);
}

.tc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Variants */
.tc-btn--primary { background: var(--brand); color: var(--fg-on-brand); }
.tc-btn--primary:hover { background: var(--brand-hover); }
.tc-btn--primary:active { background: var(--brand-press); transform: translateY(1px); }

.tc-btn--secondary { background: var(--bg-raised); color: var(--ink-800); border-color: var(--border-strong); }
.tc-btn--secondary:hover { background: var(--paper-2); }

.tc-btn--ghost { background: transparent; color: var(--brand); }
.tc-btn--ghost:hover { background: var(--paper-2); }

/* Sizes */
.tc-btn--md { font-size: var(--fs-15); padding: var(--s-3) 22px; min-height: 48px; }
.tc-btn--sm { font-size: var(--fs-13); padding: var(--s-2) 14px; min-height: 36px; }
.tc-btn--lg { font-size: 16px; padding: 15px 26px; min-height: 54px; }

.tc-btn--full { width: 100%; }

/* Icon sizing (SVG markup itself is a later task's job) */
.tc-btn__icon { width: 17px; height: 17px; }
.tc-btn--sm .tc-btn__icon { width: 15px; height: 15px; }
.tc-btn__spinner {
  width: var(--s-4);
  height: var(--s-4);
  border: 0.125rem solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tc-spin 0.7s linear infinite;
}
.tc-btn__spinner[hidden] { display: none; }

@keyframes tc-spin { to { transform: rotate(360deg); } }

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

/* ─────────── FIELDS — .tc-field (from Field, Primitives.jsx) ─────────── */

.tc-field { display: flex; flex-direction: column; gap: 6px; }
.tc-field__label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; color: var(--ink-800); }
.tc-field__error { font-family: var(--font-body); font-size: var(--fs-12); font-weight: 600; color: var(--negative-700); display: flex; align-items: center; gap: 6px; }
.tc-field__hint { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-muted); line-height: 1.45; }
.tc-field__info-link { display: inline-flex; color: var(--fg-muted); line-height: 0; }

/* ─────────── CURRENCY INPUT — .tc-currency-input (from CurrencyInput, Primitives.jsx) ─────────── */

.tc-currency-input {
  display: flex;
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  min-height: 48px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.tc-currency-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
.tc-currency-input--invalid { border-color: var(--negative-500); }

.tc-currency-input__prefix { padding: 0 var(--s-2) 0 14px; font-family: var(--font-mono); color: var(--fg-muted); font-size: var(--fs-15); }
.tc-currency-input__field { border: 0; outline: 0; flex: 1; font-family: var(--font-mono); font-size: var(--fs-16); padding: var(--s-3) 14px var(--s-3) 0; background: transparent; color: var(--ink-900); min-width: 0; font-variant-numeric: tabular-nums; text-align: left; }

/* --big modifier (hero gross-pay input) */
.tc-currency-input--big { min-height: 60px; }
.tc-currency-input--big .tc-currency-input__prefix { font-size: 22px; padding: 0 var(--s-2) 0 18px; }
.tc-currency-input--big .tc-currency-input__field { font-size: var(--fs-24); font-weight: 500; padding: var(--s-3) 18px var(--s-3) 0; }

[data-provisional-section] { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--paper-2); padding: 0 14px 14px; }
[data-provisional-section] > summary { cursor: pointer; padding: 14px 0 0; font: 600 14px var(--font-body); color: var(--ink-900); }

/* ─────────── NUMBER INPUT — .tc-number-input (from NumberInput — hours/weeks) ─────────── */
/* Same wrapper pattern as .tc-currency-input, no € prefix; trailing unit suffix instead. */

.tc-number-input {
  display: flex;
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  min-height: 48px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.tc-number-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
.tc-number-input--invalid { border-color: var(--negative-500); }

.tc-number-input__field { border: 0; outline: 0; flex: 1; font-family: var(--font-mono); font-size: var(--fs-16); padding: var(--s-3) 14px var(--s-3) 0; background: transparent; color: var(--ink-900); min-width: 0; font-variant-numeric: tabular-nums; }
.tc-number-input__field--right { text-align: right; padding: var(--s-3) 6px var(--s-3) 14px; }
.tc-number-input__field::-webkit-outer-spin-button,
.tc-number-input__field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tc-number-input__field[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.tc-number-input__suffix { padding: 0 14px 0 2px; font-family: var(--font-body); font-size: var(--fs-13); color: var(--fg-muted); white-space: nowrap; }

/* ─────────── SELECT — .tc-select (from Select, Primitives.jsx) ─────────── */

.tc-select { position: relative; }
.tc-select select {
  appearance: none; -webkit-appearance: none; width: 100%;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); min-height: 48px; padding: 0 var(--s-10) 0 14px;
  font-family: var(--font-body); font-size: var(--fs-16); color: var(--ink-800); cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.tc-select select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
.tc-select--invalid select { border-color: var(--negative-500); }
.tc-select__chevron { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--fg-muted); pointer-events: none; }

/* ─────────── RADIO GROUP — .tc-radio-group (from RadioGroup, Primitives.jsx) ─────────── */
/* Segmented control built from real <input type="radio"> + <label>, checked-sibling pattern:
   <div class="tc-radio-group">
     <input type="radio" name="X" id="x-a" value="a" class="tc-radio-group__input">
     <label for="x-a" class="tc-radio-group__option">Label A</label>
     <input type="radio" name="X" id="x-b" value="b" class="tc-radio-group__input">
     <label for="x-b" class="tc-radio-group__option">Label B</label>
   </div>
   The input is visually hidden via absolute-position + 1px size (not display:none) so it stays
   keyboard/screen-reader focusable. */

.tc-radio-group { display: flex; gap: 0; background: var(--paper-2); padding: 3px; border-radius: var(--r-md); border: 1px solid var(--border); }
.tc-radio-group__input { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; }
.tc-radio-group__option {
  flex: 1; padding: 7.5px 6px; border: 0; cursor: pointer; text-align: center;
  background: transparent; color: var(--fg-muted);
  font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600;
  border-radius: var(--r-sm); transition: all var(--dur-fast); min-height: 30px;
  display: flex; align-items: center; justify-content: center;
}
.tc-radio-group__input:checked + .tc-radio-group__option {
  background: var(--bg-raised); color: var(--ink-800); box-shadow: var(--shadow-xs);
}
.tc-radio-group__input:focus-visible + .tc-radio-group__option {
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.tc-radio-group--invalid { border-color: var(--negative-500); }
.tc-radio-group--auto { width: auto; }

/* --period: the 6-option gross-pay period control (Yearly/Monthly/Fortnight/Weekly/
   Daily/Hourly) overflows a narrow phone screen at one option per flex:1 column, so
   below the mobile breakpoint it wraps into two rows of three instead of scrolling
   or shrinking text. */
@media (max-width: 560px) {
  .tc-radio-group--period { flex-wrap: wrap; gap: 3px; }
  .tc-radio-group--period .tc-radio-group__option { flex: 1 1 30%; }
}

/* ─────────── CARDS — .tc-card (from Card, Primitives.jsx) ─────────── */

.tc-card { border: 1px solid; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: var(--s-6); }
.tc-card--flush { padding: 0; }

.tc-card--default { background: var(--bg-raised); border-color: var(--border); }
.tc-card--sunken { background: var(--paper-2); border-color: var(--border); }
.tc-card--brand { background: var(--brand); border-color: var(--brand); }
.tc-card--dark { background: var(--teal-700); border-color: var(--teal-800); }

/* Calculator sections stay independently legible as the form expands. Their
   error state complements individual invalid controls so the next area that
   needs attention is visible even when a field is below the fold. */
.tc-form-section {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-top: 18px;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.tc-form-section:first-of-type { margin-top: 0; }
.tc-form-section--invalid { background: var(--negative-50); border-color: var(--negative-500); }
.tc-form-section:focus-within { box-shadow: var(--shadow-sm), 0 0 0 3px var(--focus-ring); }
.tc-form-section--invalid:focus-within { box-shadow: var(--shadow-sm), 0 0 0 3px var(--negative-500); }
.tc-form-section__title { margin: 0 0 20px; font-family: var(--font-display); font-size: var(--fs-20); font-weight: 500; color: var(--ink-900); }

/* ─────────── EYEBROW — .tc-eyebrow (from Eyebrow, Primitives.jsx) ─────────── */
/* Identical to .eyebrow already defined in tokens.css — reuse that class directly
   instead of redefining it here (see task-2-report.md for the reasoning). */

/* ─────────── WORDMARK — .tc-wordmark (from Wordmark, Primitives.jsx) ─────────── */

.tc-wordmark { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; color: var(--ink-900); line-height: 1; }
.tc-wordmark__ie { color: var(--accent-text); }

.tc-wordmark--inverse { color: var(--fg-on-brand); }
.tc-wordmark--inverse .tc-wordmark__ie { color: var(--gold-300); }

/* ─────────── HEADER / FOOTER CHROME — from Chrome.jsx (for Task 3) ─────────── */

.tc-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklch, var(--brand) 92%, black);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in oklch, var(--brand) 60%, black);
}
.tc-header__inner { display: flex; align-items: center; gap: 24px; padding-top: 13px; padding-bottom: 13px; }
.tc-header__nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.tc-header__nav a {
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: var(--fs-14); font-weight: 500;
  color: color-mix(in oklch, var(--fg-on-brand) 82%, transparent); text-decoration: none; white-space: nowrap;
}

.tc-footer { border-top: 1px solid var(--border); margin-top: var(--s-16); padding: var(--s-8) 0; background: var(--paper-2); }
.tc-footer__inner { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tc-footer__links { display: flex; gap: 20px; font-family: var(--font-body); font-size: var(--fs-13); flex-wrap: wrap; }
.tc-footer__links a { color: var(--fg-muted); text-decoration: none; }

/* ─────────── DONUT CHART — .tc-donut (from DonutChart, Charts.jsx; Task 6) ─────────── */
/* SVG ring — one <circle> per segment (tax/USC/PRSI/take-home), positioned with the
   stroke-dasharray/dashoffset percentage trick (r=15.915 gives a circumference of ~100,
   so Twig's plain percentage arithmetic maps directly onto dash units — still no trig/PHP
   needed). Each circle is a real, focusable tap target so a user can select a segment to
   see what it is; see initDonutSegments() in interactions.js. */

.tc-donut { position: relative; width: 248px; height: 248px; border-radius: 50%; margin: 0 auto; }
.tc-donut__ring { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.tc-donut__seg { cursor: pointer; outline: none; transition: filter var(--dur-base) var(--ease-out), stroke-width var(--dur-base) var(--ease-out); }
.tc-donut__seg:hover { filter: brightness(1.12); }
.tc-donut__seg:focus-visible { stroke-width: 8.5; filter: brightness(1.12); }
.tc-donut__hole {
  position: absolute; inset: 42px; background: var(--bg-raised); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tc-donut__label { font-family: var(--font-body); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.14em; color: var(--fg-muted); }
.tc-donut__label--centered { max-width: 100%; text-align: center; }
.tc-donut__value { font-family: var(--font-display); font-weight: 500; font-size: 33px; color: var(--accent-figure); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ─────────── STACKED BAR — .tc-stacked-bar (from StackedBar, Charts.jsx; Task 6) ─────────── */
/* "Where each €100 goes" — segments sized relative to their own total (chart.segments),
   rendered as flex-width divs plus a legend row with swatch/label/percentage. */

.tc-stacked-bar { display: flex; height: 56px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.tc-stacked-bar__seg { display: flex; align-items: center; justify-content: center; min-width: 0; border-right: 2px solid var(--bg-raised); width: var(--bar-pct); background: var(--bar-color); }
.tc-stacked-bar__seg:last-child { border-right: none; }
.tc-stacked-bar__legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-4); }
.tc-stacked-bar__legend-item { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: var(--fs-13); color: var(--ink-800); }
.tc-stacked-bar__swatch { width: 11px; height: 11px; border-radius: 3px; background: var(--bar-color); }
.tc-stacked-bar__pct { font-family: var(--font-mono); font-size: var(--fs-13); color: var(--fg-muted); }

/* ─────────── TEXT INPUT / TEXTAREA — .tc-text-input / .tc-textarea (from TextInput/TextArea,
   Primitives.jsx; Task 7) ─────────── */
/* Same border/radius/focus pattern as .tc-currency-input / .tc-number-input, but a plain
   <input>/<textarea> rather than a wrapper div (there's no prefix/suffix chip to lay out). */

.tc-text-input, .tc-textarea {
  display: block; width: 100%; box-sizing: border-box;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: var(--s-3) 14px;
  font-family: var(--font-body); font-size: var(--fs-16); color: var(--ink-900);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.tc-text-input { min-height: 48px; }
.tc-text-input:focus, .tc-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
.tc-text-input--invalid, .tc-textarea--invalid { border-color: var(--negative-500); }
.tc-textarea { min-height: 140px; resize: vertical; line-height: 1.5; }

.tc-currency-input--compact,
.tc-text-input.tc-text-input--compact { box-sizing: border-box; width: 112px; height: 40px; min-height: 40px; border-radius: var(--r-sm); }
.tc-currency-input--compact .tc-currency-input__prefix { padding: 0 5px 0 8px; font-size: var(--fs-13); }
.tc-currency-input--compact .tc-currency-input__field { padding: 5px 8px 5px 0; font-size: var(--fs-16); text-align: right; }
.tc-text-input--compact { padding: 5px 7px; font-family: var(--font-mono); font-size: var(--fs-16); text-align: right; }
.tc-provisional-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font-family: var(--font-body); font-size: var(--fs-13); color: var(--ink-800); }
.tc-provisional-input-controls { display: inline-flex; align-items: center; gap: 4px; }
.tc-provisional-input-controls > * { flex: 0 0 auto; }
.tc-provisional-stepper { width: 40px; height: 40px; }
.tc-currency-input--changed, .tc-text-input--changed { border-color: var(--positive-500); box-shadow: 0 0 0 2px color-mix(in oklch, var(--positive-500) 28%, transparent); }

@media (max-width: 560px) {
  [data-provisional-section] { padding-left: var(--s-2); padding-right: var(--s-2); }
  .tc-provisional-input-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tc-provisional-input-controls { justify-self: end; }
}

/* ─────────── EXPLORE — .tc-explore* (collapsible + tabs; ported from the
   "Explore your result" section of Results.jsx) ─────────── */

.tc-explore__chevron { display: inline-flex; transition: transform var(--dur-base) var(--ease-out); }
[data-explore].is-open .tc-explore__chevron { transform: rotate(180deg); }

.tc-explore-tabs { display: flex; gap: 4px; padding: 0 var(--s-2); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.tc-explore-tab {
  appearance: none; background: transparent; border: 0; cursor: pointer; padding: var(--s-3) 14px; margin-bottom: -1px;
  font-family: var(--font-body); font-size: var(--fs-14); font-weight: 600; color: var(--fg-muted);
  border-bottom: 2px solid transparent; transition: color var(--dur-fast) var(--ease-out);
}
.tc-explore-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.tc-explore-tab:focus-visible { box-shadow: 0 0 0 3px var(--focus-ring); border-radius: var(--r-sm); }

/* ─────────── TOGGLE SWITCH — .tc-toggle (from the Comparison "has children" switch) ─────────── */

.tc-toggle {
  appearance: none; border: 0; cursor: pointer; width: 42px; height: 24px; border-radius: var(--r-pill);
  padding: 3px; background: var(--border-strong); display: inline-flex; transition: background var(--dur-fast) var(--ease-out);
}
.tc-toggle[aria-checked="true"] { background: var(--brand); }
.tc-toggle__thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform var(--dur-fast) var(--ease-out); }
.tc-toggle[aria-checked="true"] .tc-toggle__thumb { transform: translateX(18px); }

/* ─────────── COMPARISON CHART ─────────── */

.tc-rate-chart__viewport,
.tc-compare-chart__viewport {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: var(--s-1) 0;
  border-radius: var(--r-sm);
}
.tc-rate-chart__viewport:focus-visible,
.tc-compare-chart__viewport:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
.tc-rate-chart__plot { min-width: 560px; }
.tc-compare-chart__svg { display: block; min-width: 940px; }
.tc-compare-chart__bar {
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  stroke: transparent;
  stroke-width: 2;
  paint-order: stroke;
  transition: filter var(--dur-fast) var(--ease-out), stroke var(--dur-fast) var(--ease-out);
}
.tc-compare-chart__bar:hover { filter: brightness(1.1); }
.tc-compare-chart__bar:focus-visible:not([aria-pressed="true"]) {
  stroke: var(--info-700);
  stroke-width: 4;
}
.tc-compare-chart__bar[aria-pressed="true"] {
  stroke: var(--ink-900);
  stroke-width: 4;
}
.tc-compare-chart__bar[aria-pressed="true"]:focus-visible {
  filter: drop-shadow(0 0 2px var(--info-700));
}
.tc-compare-chart__user-marker { pointer-events: none; }
.tc-compare-chart__you-label {
  fill: var(--info-700);
  font-family: var(--font-body);
  font-size: var(--fs-13);
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--bg-raised);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.tc-compare-chart__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2) 22px;
  margin-top: var(--s-3);
}
.tc-compare-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink-800);
  font-family: var(--font-body);
  font-size: var(--fs-13);
}
.tc-compare-chart__legend-bar {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--positive-500);
}
.tc-compare-chart__legend-line {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.tc-compare-chart__legend-you { width: 24px; height: 14px; overflow: visible; }
.tc-compare-chart__details {
  min-height: 52px;
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--info-50);
  border: 1px solid var(--info-500);
  border-radius: var(--r-md);
  color: var(--info-700);
  font-family: var(--font-body);
}
.tc-compare-chart__prompt { font-size: var(--fs-14); font-weight: 600; text-align: center; }
.tc-compare-chart__details-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
}
.tc-compare-chart__details-grid > span { min-width: 0; text-align: center; }
.tc-compare-chart__details-label {
  display: block;
  margin-bottom: 2px;
  color: var(--fg-muted);
  font-size: var(--fs-12);
  font-weight: 600;
}
.tc-compare-chart__details strong {
  color: var(--info-700);
  font-family: var(--font-mono);
  font-size: var(--fs-15);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .tc-compare-chart__legend { justify-content: flex-start; }
  .tc-compare-chart__details { align-items: stretch; }
  .tc-compare-chart__details-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  .tc-compare-chart__details-grid > span { display: flex; justify-content: space-between; gap: var(--s-3); text-align: left; }
  .tc-compare-chart__details-label { margin-bottom: 0; }
}

/* ─────────── CONTACT INFO BOX — .tc-info-box (tax-advice callout; Task 7) ─────────── */

.tc-info-box {
  background: var(--info-50); border: 1px solid var(--info-500); border-radius: var(--r-md);
  padding: 16px 18px; font-family: var(--font-body); font-size: var(--fs-14); line-height: 1.55; color: var(--info-700);
}
.tc-info-box strong { color: var(--info-700); }
.tc-info-box a { color: var(--info-700); text-decoration: underline; font-weight: 600; }

/* ─────────── PREVIOUS-YEAR RESULT HANDOFF ─────────── */

.tc-previous-year-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-5);
  padding: var(--s-4);
  background: var(--info-50);
  border: 1px solid var(--info-500);
  border-radius: var(--r-md);
  color: var(--info-700);
  font-family: var(--font-body);
}
.tc-previous-year-action > div { display: grid; gap: var(--s-1); }
.tc-previous-year-action strong { color: var(--ink-900); font-size: var(--fs-14); }
.tc-previous-year-action span { color: var(--fg-muted); font-size: var(--fs-13); line-height: var(--lh-base); }
.tc-previous-year-action .tc-btn:focus-visible { box-shadow: 0 0 0 3px var(--focus-ring); }
@media (max-width: 560px) {
  .tc-previous-year-action { align-items: stretch; flex-direction: column; }
  .tc-previous-year-action .tc-btn { width: 100%; }
}

/* ─────────── RESULT PAGE HEADER & PROVISIONAL-BUDGET FORM ─────────── */

.tc-wrap--result { padding-top: var(--s-7); padding-bottom: var(--s-16); }
.tc-back-link { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--fg-muted); font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; margin-bottom: var(--s-5); background: transparent; border: 0; padding: 0; cursor: pointer; }
.tc-page-title { margin: var(--s-8) 0 var(--s-7); }
.tc-page-title__eyebrow { margin-bottom: var(--s-3); }

.tc-provisional-notice { margin: 0 0 var(--s-6); }
.tc-provisional-notice__title { margin: var(--s-1) 0 0; font-size: var(--fs-24); }
.tc-provisional-notice__blurb { margin: var(--s-2) 0 0; color: var(--fg-muted); font-size: var(--fs-14); max-width: 690px; }
.tc-provisional-form { margin: var(--s-6) 0; }
.tc-provisional-form__head { display: flex; justify-content: space-between; gap: var(--s-4); align-items: flex-start; flex-wrap: wrap; }
.tc-provisional-form__title { margin: 0; font-size: var(--fs-24); }
.tc-provisional-form__summary { cursor: pointer; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-24); padding: var(--s-5) var(--s-6); }
/* Used on the collapsible examples-page card only: that <details> carries
   tc-card--flush (zero padding of its own) so the <summary>'s own padding
   above is the only inset around the collapsed title, instead of stacking
   with .tc-card's padding. This rule reinstates the same inset .tc-card
   would have given the form's contents once it's expanded. */
.tc-provisional-form__body { padding: 0 var(--s-6) var(--s-6); }
.tc-provisional-form__blurb { margin: var(--s-2) 0 0; color: var(--fg-muted); font-size: var(--fs-14); max-width: 690px; }
.tc-provisional-form__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.tc-provisional-form__action-btn { display: inline-flex; align-items: center; padding: var(--s-2) 11px; border: 1px solid var(--border); background: var(--paper-2); border-radius: var(--r-sm); color: var(--ink-800); font: 600 var(--fs-13) var(--font-body); text-decoration: none; cursor: pointer; }
.tc-provisional-form__action-btn--danger { border-color: var(--negative-500); background: var(--negative-50); color: var(--negative-700); }
.tc-provisional-form__sections { display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.tc-provisional-form__section-body { display: grid; gap: var(--s-3); padding-top: var(--s-4); }
.tc-provisional-stepper-btn { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--paper-2); cursor: pointer; font-size: var(--fs-18); line-height: 1; }
.tc-provisional-form__submit { margin-top: var(--s-6); }

/* ─────────── HERO SECTION ─────────── */

.tc-hero { position: relative; overflow: hidden; }
.tc-hero__info-link {
  position: absolute; top: var(--s-4); right: var(--s-4); z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--s-8); height: var(--s-8); border-radius: var(--r-pill);
  background: transparent; border: 1px solid var(--border); color: var(--fg-muted); text-decoration: none;
}
.tc-hero__figure { font-size: var(--fs-48); color: var(--accent-figure); line-height: 1.05; margin-top: var(--s-3); }
.tc-hero__subtext { margin: var(--s-3) 0 0; color: var(--fg-muted); font-size: var(--fs-15); line-height: 1.5; }
.tc-hero__breakdown-link {
  margin-top: var(--s-4); display: inline-flex; align-items: center; gap: var(--s-2);
  background: transparent; border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--ink-800); font-family: var(--font-body); font-size: var(--fs-14); font-weight: 600;
  padding: var(--s-2) var(--s-4); text-decoration: none;
}
.tc-hero__stats-row { display: flex; gap: var(--s-7); margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--border-soft); }
.tc-hero__stat-value { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-24); margin-top: var(--s-1); color: var(--stat-color, var(--ink-900)); }

.tc-hero__changes { border-top: 1px solid var(--border-soft); }
.tc-hero__changes-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); background: transparent; border: 0; padding: var(--s-4) var(--s-6); cursor: pointer; text-align: left; }
.tc-hero__changes-toggle-label { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.tc-hero__changes-count { font-family: var(--font-body); font-size: var(--fs-14); color: var(--fg-muted); line-height: 1.5; }
.tc-hero__change-row { display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-5) var(--s-6); }
.tc-hero__change-row--divided { border-top: 1px solid var(--border-soft); }
.tc-hero__change-icon { flex-shrink: 0; width: var(--s-10); height: var(--s-10); border-radius: var(--r-md); background: var(--brand-soft); display: inline-flex; align-items: center; justify-content: center; color: var(--brand); margin-top: 2px; }
.tc-hero__change-title { font-family: var(--font-body); font-size: var(--fs-16); font-weight: 600; color: var(--ink-900); line-height: 1.4; font-variant-numeric: tabular-nums; }
.tc-hero__change-body { font-family: var(--font-body); font-size: var(--fs-14); color: var(--fg-muted); line-height: 1.55; margin-top: var(--s-1); max-width: 640px; }

/* ─────────── EXPLORE — SHARED PANEL PRIMITIVES (reused by every sub-panel) ─────────── */

.tc-panel-eyebrow-block { margin-bottom: var(--s-4); }
.tc-panel-heading { margin: var(--s-1) 0 0; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-20); color: var(--ink-900); }
.tc-panel-intro { margin: 0 0 var(--s-6); font-family: var(--font-body); font-size: var(--fs-14); color: var(--fg-muted); line-height: 1.55; max-width: 680px; }
.tc-panel-intro--full-width { max-width: none; }
.tc-panel-intro--ink { color: var(--ink-800); }

.tc-stat-card { background: var(--paper-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); }
.tc-stat-card__value { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-28); margin-top: var(--s-2); }
.tc-stat-card__value--accent { color: var(--accent-figure); }
.tc-stat-card__value--positive { color: var(--positive-700); }
.tc-stat-card__value--ink { color: var(--ink-900); }
.tc-stat-card__caption { font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-subtle); margin-top: var(--s-1); }

.tc-meta-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: var(--fs-11); color: var(--fg-subtle); margin-top: var(--s-1); }

/* ─────────── EXPLORE — SHELL & PENSION WHAT-IF PANEL ─────────── */

.tc-explore-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); background: transparent; border: 0; padding: var(--s-5) var(--s-6); cursor: pointer; text-align: left; }
.tc-explore-toggle__text { display: flex; flex-direction: column; gap: 3px; }
.tc-explore-toggle__title { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-20); color: var(--ink-900); }
.tc-explore-toggle__subtitle { font-family: var(--font-body); font-size: var(--fs-14); color: var(--fg-muted); }
.tc-explore-body { padding: var(--s-6); }

.tc-whatif__meta-label { font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; color: var(--ink-800); }
.tc-whatif__meta-value { font-family: var(--font-mono); font-size: var(--fs-18); font-weight: 600; color: var(--ink-900); }
.tc-whatif__meta-unit { font-size: var(--fs-12); color: var(--fg-muted); font-weight: 400; }
.tc-whatif__row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s-2); }
.tc-whatif__ceiling-note { margin: var(--s-2) 0 0; font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-muted); line-height: 1.5; }
.tc-whatif__note { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); background: var(--positive-50); border-radius: var(--r-md); font-family: var(--font-body); font-size: var(--fs-14); color: var(--positive-700); line-height: 1.5; }
.tc-whatif__reset-link { margin-top: var(--s-4); display: inline-flex; align-items: center; gap: var(--s-2); background: transparent; border: 0; cursor: pointer; color: var(--brand); font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; padding: 0; }

/* ─────────── EXPLORE — ALLOCATION PANEL ─────────── */

.tc-alloc-panel__frame { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.tc-alloc-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-alloc-row__head { display: grid; grid-template-columns: 1fr auto; column-gap: var(--s-3); align-items: start; margin-bottom: var(--s-2); }
.tc-alloc-row__label { font-family: var(--font-body); font-size: var(--fs-14); font-weight: 600; color: var(--ink-800); }
.tc-alloc-row__amount { font-family: var(--font-mono); font-size: var(--fs-14); font-weight: 600; color: var(--ink-900); white-space: nowrap; }
.tc-alloc-row__bar-track { flex: 1; height: var(--s-2); background: var(--paper-2); border-radius: var(--r-pill); overflow: hidden; }
.tc-alloc-row__bar { display: flex; align-items: center; gap: var(--s-3); }
.tc-alloc-row__bar-fill { width: var(--bar-pct); height: 100%; background: var(--bar-color); border-radius: var(--r-pill); }
.tc-alloc-row__bar-pct { font-family: var(--font-mono); font-size: var(--fs-12); color: var(--fg-muted); width: 42px; text-align: right; }
.tc-alloc-footnote { margin-top: var(--s-3); font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-subtle); }
.tc-alloc-footnote a { color: var(--brand); }

/* ─────────── EXPLORE — COMPARE PANEL ─────────── */

.tc-compare-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-5); padding: var(--s-4); background: var(--paper-2); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--s-6); }
.tc-compare-controls__label { font-family: var(--font-body); font-size: var(--fs-12); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.tc-compare-controls__has-children-label { font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; color: var(--ink-800); }
.tc-compare-footnote { margin-top: var(--s-4); font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-subtle); }

/* ─────────── EXPLORE — YEAR-ON-YEAR PANEL ─────────── */

.tc-y2y-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); }
.tc-y2y-card--current { border-color: var(--brand); background: var(--brand-soft); }
.tc-y2y-card--delta { display: flex; flex-direction: column; justify-content: center; }
.tc-y2y-card__value { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-30); margin-top: var(--s-2); color: var(--stat-color, var(--ink-700)); }
.tc-y2y-card__caption { font-family: var(--font-body); font-size: var(--fs-13); color: var(--fg-subtle); margin-top: var(--s-1); }
.tc-y2y-card__caption--muted { color: var(--fg-muted); }
.tc-y2y-footnote { margin-top: var(--s-4); font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-subtle); }

.tc-statutory-table__frame { margin-top: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.tc-statutory-table__caption { padding: var(--s-3) var(--s-4); background: var(--paper-2); font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; color: var(--ink-800); }
.tc-statutory-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: var(--fs-13); }
.tc-statutory-table__head-row { color: var(--fg-muted); text-align: right; }
.tc-statutory-table__th { padding: var(--s-2) var(--s-4); font-weight: 600; }
.tc-statutory-table__th--label { text-align: left; }
.tc-statutory-table__row-label { padding: var(--s-2) var(--s-4); border-top: 1px solid var(--border-soft); color: var(--ink-800); }
.tc-statutory-table__cell { padding: var(--s-2) var(--s-4); border-top: 1px solid var(--border-soft); text-align: right; font-family: var(--font-mono); }
.tc-statutory-table__cell--current { color: var(--stat-color, var(--ink-900)); }
.tc-statutory-table__total-row { background: var(--paper-2); font-weight: 600; }
.tc-statutory-table__total-row .tc-statutory-table__row-label,
.tc-statutory-table__total-row .tc-statutory-table__cell { border-top: 1px solid var(--border); }

/* ─────────── EXPLORE — EFFECTIVE RATE CHART ─────────── */

.tc-rate-chart__bars { display: flex; align-items: flex-end; gap: 5px; height: 200px; padding: var(--s-2) 2px 0; border-bottom: 1px solid var(--border); }
.tc-rate-chart__bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.tc-rate-chart__bar-value { font-family: var(--font-mono); font-size: 9px; margin-bottom: var(--s-1); color: var(--stat-color, var(--fg-muted)); }
.tc-rate-chart__bar-fill { width: 100%; max-width: var(--s-6); height: var(--bar-height); min-height: 2px; background: var(--bar-color); border-radius: 3px 3px 0 0; }
.tc-rate-chart__x-labels { display: flex; gap: 5px; margin-top: var(--s-2); }
.tc-rate-chart__x-label { flex: 1; text-align: center; font-family: var(--font-mono); font-size: var(--fs-11); color: var(--stat-color, var(--fg-subtle)); font-weight: var(--stat-weight, 400); }
.tc-rate-chart__footnote { margin-top: var(--s-4); font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-subtle); line-height: 1.5; }

/* ─────────── EXPLORE — JOINT ALLOCATION PANEL ─────────── */

.tc-alloc-sliders { display: flex; flex-direction: column; gap: var(--s-5); margin-bottom: var(--s-6); }
.tc-alloc-slider__row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s-2); }
.tc-alloc-slider__label { font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; color: var(--ink-800); }
.tc-alloc-slider__value { font-family: var(--font-mono); font-size: var(--fs-15); font-weight: 600; color: var(--ink-900); }

.tc-joint-alloc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.tc-joint-alloc-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); }
.tc-joint-alloc-card__value { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-24); margin-top: var(--s-2); color: var(--accent-figure); }
.tc-joint-alloc-card__caption { font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-subtle); margin-top: var(--s-1); }
.tc-joint-alloc-card__detail-list { margin-top: var(--s-3); display: flex; flex-direction: column; gap: 5px; font-family: var(--font-mono); font-size: var(--fs-13); }
.tc-joint-alloc-card__detail-row { display: flex; justify-content: space-between; }
.tc-joint-alloc-card__detail-label { color: var(--fg-muted); }
.tc-joint-alloc-card__detail-value { color: var(--stat-color, var(--ink-800)); }

.tc-joint-alloc-summary { margin-top: var(--s-4); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4); background: var(--paper-2); border-radius: var(--r-md); }
.tc-joint-alloc-summary__label { font-family: var(--font-body); font-size: var(--fs-13); color: var(--ink-800); }
.tc-joint-alloc-summary__value { font-family: var(--font-mono); font-size: var(--fs-16); font-weight: 600; color: var(--ink-900); }

.tc-joint-alloc-warning { margin-top: var(--s-4); display: flex; gap: var(--s-3); padding: var(--s-4); background: var(--warn-50); border: 1px solid var(--warn-500); border-radius: var(--r-md); }
.tc-joint-alloc-warning__icon { color: var(--warn-700); flex-shrink: 0; margin-top: 1px; }
.tc-joint-alloc-warning__text { margin: 0; font-family: var(--font-body); font-size: var(--fs-13); line-height: 1.55; color: var(--warn-700); }
.tc-joint-alloc-reset-link { margin-top: var(--s-4); display: inline-flex; align-items: center; gap: var(--s-2); background: transparent; border: 0; cursor: pointer; color: var(--brand); font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; padding: 0; }
.tc-joint-alloc-footnote { margin-top: var(--s-4); font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-subtle); line-height: 1.5; }

/* ─────────── BREAKDOWN TABLE — cells without an existing component class ─────────── */
.tc-breakdown-footnote { margin-top: var(--s-4); padding: 0 var(--s-6); font-family: var(--font-body); font-size: var(--fs-12); color: var(--fg-subtle); line-height: 1.5; }

.tc-breakdown-table__wrap { margin-top: var(--s-6); }
.tc-breakdown-table__caption { padding: var(--s-5) var(--s-6) var(--s-4); border-bottom: 1px solid var(--border-soft); }
.tc-breakdown-table__caption-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-20); color: var(--ink-900); }
.tc-breakdown-table__scroll { overflow-x: auto; }
/* .tc-breakdown-table--legacy: this <table> is a separate, inline-markup table (not the
   BreakdownTable.jsx-driven .tc-breakdown-table component above) — it gets its own class
   rather than adopting .tc-breakdown-table directly, because that class's bare `th`/`td`
   descendant selectors and `tbody tr:nth-child(even)` zebra-striping have higher specificity
   than the single-class selectors below and would silently override the negative/positive/
   muted cell colors and add unwanted row striping. Deviation from the task brief's literal
   Step 2 mapping (which named `.tc-breakdown-table`) — see task-8-report.md. */
.tc-breakdown-table--legacy { width: 100%; min-width: 520px; border-collapse: collapse; font-family: var(--font-body); font-size: var(--fs-14); }
.tc-breakdown-table__th { text-align: left; padding: var(--s-3) var(--s-4); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); border-bottom: 1px solid var(--border-strong); }
.tc-breakdown-table__th--numeric { text-align: right; }

.tc-breakdown-table__row-toggle { width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; padding: var(--s-3) var(--s-4); font: inherit; color: inherit; display: inline-flex; align-items: center; gap: var(--s-2); }
.tc-breakdown-table__row-label-content { display: flex; align-items: center; }
.tc-breakdown-table__row-toggle--with-link { flex: none; width: auto; padding-right: 0; }
.tc-breakdown-table__row-label { padding: 0; border-bottom: 1px solid var(--border-soft); color: var(--ink-800); }
.tc-breakdown-table__row-label--indent { padding: var(--s-3) var(--s-4) var(--s-3) var(--s-10); border-bottom: 1px solid var(--border-soft); color: var(--ink-800); }
.tc-breakdown-table__row-label--indent-text { padding-left: var(--s-10); display: inline-block; padding-top: var(--s-3); padding-bottom: var(--s-3); }

.tc-breakdown-table__cell { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-14); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border-soft); color: var(--ink-800); }
.tc-breakdown-table__cell--negative { color: var(--negative-700); }
.tc-breakdown-table__cell--positive { color: var(--positive-700); }
.tc-breakdown-table__cell--muted { color: var(--fg-muted); }

/* Tints the single column matching the pay period the user actually entered
   (--hl-2 = Annual .. --hl-5 = Weekly, see ResultPresenter::PERIOD_VIEWS) so the
   results table acknowledges how they get paid, without hiding the other three. */
.tc-breakdown-table--hl-2 th:nth-child(2), .tc-breakdown-table--hl-2 td:nth-child(2),
.tc-breakdown-table--hl-3 th:nth-child(3), .tc-breakdown-table--hl-3 td:nth-child(3),
.tc-breakdown-table--hl-4 th:nth-child(4), .tc-breakdown-table--hl-4 td:nth-child(4),
.tc-breakdown-table--hl-5 th:nth-child(5), .tc-breakdown-table--hl-5 td:nth-child(5) {
  background: var(--brand-soft);
}
.tc-breakdown-table--hl-2 th:nth-child(2),
.tc-breakdown-table--hl-3 th:nth-child(3),
.tc-breakdown-table--hl-4 th:nth-child(4),
.tc-breakdown-table--hl-5 th:nth-child(5) {
  color: var(--brand);
}

.tc-breakdown-table__detail-row { background: var(--paper-2); }
.tc-breakdown-table__detail-cell { padding: var(--s-2) var(--s-4) var(--s-2) var(--s-10); border-bottom: 1px solid var(--border-soft); color: var(--fg-muted); font-size: var(--fs-13); }
.tc-breakdown-table__credit-link { display: inline-flex; flex: none; align-items: center; margin-left: var(--s-1); color: var(--fg-muted); line-height: 0; text-decoration: none; vertical-align: middle; }
.tc-breakdown-table__credit-link:hover { color: var(--brand); }
.tc-breakdown-table__credit-link:focus-visible { box-shadow: 0 0 0 var(--s-1) var(--focus-ring); border-radius: var(--r-sm); }
.tc-breakdown-table__detail-cell--amount { text-align: right; font-family: var(--font-mono); font-size: var(--fs-13); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border-soft); color: var(--ink-700); }
.tc-breakdown-table__detail-cell--amount.tc-breakdown-table__detail-cell--sub { color: var(--fg-subtle); }
.tc-breakdown-table__detail-cell--amount.tc-breakdown-table__detail-cell--positive { color: var(--positive-700); }
.tc-breakdown-table__detail-cell--amount.tc-breakdown-table__detail-cell--negative { color: var(--negative-700); }

.tc-breakdown-table__grand-total-row { background: var(--brand-soft); }
.tc-breakdown-table__grand-total-cell { text-align: right; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-18); padding: var(--s-4); border-top: 2px solid var(--ink-800); color: var(--ink-900); }
.tc-breakdown-table__grand-total-cell--label { text-align: left; padding-left: var(--s-10); }
/* The Take-home row's toggle button supplies its own padding (matching
   .tc-breakdown-table__row-toggle above), so the cell's own padding must be
   zeroed - same pattern as .tc-breakdown-table__row-label for the PRSI row. */
.tc-breakdown-table__grand-total-cell--toggle { padding: 0; }
.tc-breakdown-table__row-toggle--grand-total { padding: var(--s-4) var(--s-4) var(--s-4) var(--s-10); }

.tc-breakdown-table__footer-cell { padding: var(--s-4); font-family: var(--font-body); font-size: var(--fs-13); color: var(--fg-muted); }
.tc-breakdown-table__footer-stat { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-800); font-weight: 600; }

/* ─────────── MY FUTURE FUND ─────────── */

.tc-mff-wrap { margin-top: var(--s-6); }
.tc-mff-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-2); }
.tc-mff-link { font-family: var(--font-body); font-size: var(--fs-13); font-weight: 600; color: var(--brand); text-decoration: none; }
.tc-mff-blurb { margin: 0 0 var(--s-5); font-family: var(--font-body); font-size: var(--fs-14); line-height: 1.55; color: var(--fg-muted); max-width: 640px; }
.tc-mff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; }
.tc-mff-box { background: var(--bg-raised); padding: var(--s-4); }
.tc-mff-box--highlight { background: var(--brand-soft); }
.tc-mff-box__value { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-24); color: var(--ink-900); margin-top: var(--s-1); }

/* ─────────── STACKED BAR & PAGE FOOTER ─────────── */

.tc-stacked-bar-wrap { margin-top: var(--s-6); }
.tc-stacked-bar-wrap__heading { margin: 0 0 var(--s-4); font-size: var(--fs-18); }
.tc-result-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; padding-bottom: var(--s-2); margin-top: var(--s-6); }
.tc-estimate-note { display: flex; gap: var(--s-3); margin-top: var(--s-2); }
.tc-estimate-note__icon { flex-shrink: 0; margin-top: 1px; }
.tc-result-budget-callout {
  display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-3); padding: var(--s-4) var(--s-5);
  background: var(--info-50); border: 1px solid var(--info-500); border-radius: var(--r-md); color: var(--info-700);
  font-family: var(--font-body); font-size: var(--fs-14); font-weight: 600; line-height: 1.4; text-decoration: none;
}
.tc-result-budget-callout:hover { background: var(--brand-soft); text-decoration: underline; }
.tc-result-budget-callout:focus-visible { outline: 2px solid var(--info-700); outline-offset: 2px; }
.tc-result-budget-callout__icon, .tc-result-budget-callout__chevron { flex: 0 0 auto; }
.tc-result-budget-callout__text { min-width: 0; }
.tc-result-budget-callout__chevron { margin-left: auto; }
