/* Cash Flow Analyser. The look follows the Australian Export Scorecard (tool 10): deep page colour,
   hairline borders, Instrument Serif for display type and numbers, Figtree for text, JetBrains Mono
   for labels, pill controls and numbered sections. Only money gets colour: money in, money out.
   Everything else stays neutral in every theme. Layout scales with clamp(). */

@font-face { font-family: 'Instrument Serif'; src: url(fonts/instrument-serif.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(fonts/instrument-serif-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url(fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(fonts/jetbrains-mono.woff2) format('woff2'); font-weight: 100 800; font-style: normal; font-display: swap; }

/* ---------- themes ----------
   The eight Export Scorecard themes. Money in takes each theme's bright colour and money out its warm
   one. Saffron on black, Scan on black and Paper use a different second colour from the Scorecard,
   because their pair was too close for colour-blind readers (checked with the Machado simulation). */
:root, [data-theme='rust-volt'] { --bg: #0A0A0A; --panel: #141414; --line: #262626; --ink: #F2F2F2; --ink-2: #9A9A9A; --ink-3: #5E5E5E; --in: #D8FF3A; --out: #E5482A; color-scheme: dark; }
[data-theme='copper-jade'] { --bg: #0B0D0C; --panel: #131715; --line: #252B28; --ink: #F0F0EC; --ink-2: #9A9F9B; --ink-3: #5F6561; --in: #2ED19A; --out: #D9773A; color-scheme: dark; }
[data-theme='night-globe'] { --bg: #07090D; --panel: #0D1118; --line: #1D2531; --ink: #ECEBE6; --ink-2: #8B93A1; --ink-3: #565E6B; --in: #4D9BFF; --out: #F2B544; color-scheme: dark; }
[data-theme='scan-black'] { --bg: #050605; --panel: #0A0C0A; --line: #1E2A1F; --ink: #F2F2ED; --ink-2: #9A9D96; --ink-3: #5E625C; --in: #3AFB3B; --out: #FF4FB0; color-scheme: dark; }
[data-theme='saffron-black'] { --bg: #050505; --panel: #0B0B0A; --line: #24221D; --ink: #F2EFE8; --ink-2: #9C978C; --ink-3: #605C54; --in: #B48CFF; --out: #FF9A1F; color-scheme: dark; }
[data-theme='signal-mono'] { --bg: #000000; --panel: #0A0A0A; --line: #222222; --ink: #F5F5F0; --ink-2: #9A9A9A; --ink-3: #5A5A5A; --in: #F5F5F0; --out: #FF5F00; color-scheme: dark; }
[data-theme='paper'] { --bg: #EEE9E4; --panel: #F6F2EE; --line: #D9D1BC; --ink: #090B08; --ink-2: #5C6059; --ink-3: #8E918A; --in: #1F5FA8; --out: #B23A0B; color-scheme: light; }
[data-theme='gallery'] { --bg: #FAFAF7; --panel: #FFFFFF; --line: #E2E2DC; --ink: #111111; --ink-2: #5D5D58; --ink-3: #93938D; --in: #0E7C5A; --out: #C2410C; color-scheme: light; }

:root {
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 4.2vw, 72px);
  --maxw: clamp(320px, 92vw, 90rem);
  --radius: clamp(12px, 1vw, 18px);
  --ease: cubic-bezier(.2, .7, 0, 1);
  --header-h: clamp(58px, 5vw, 76px);
}

html { font-size: clamp(16px, 0.42vw + 10px, 24px); background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
::selection { background: var(--in); color: var(--bg); }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--ink); }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
.sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.in { color: var(--in); } .out { color: var(--out); }

/* ---------- type ---------- */
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 0.98; margin: 0; }
.display em { font-style: italic; }
.d-hero { font-size: clamp(3rem, min(6.8vw, 11.5vh), 8.5rem); }
.d-l { font-size: clamp(2.3rem, 4.6vw, 4.8rem); }
.eyebrow { font-family: var(--mono); font-size: clamp(0.68rem, 0.62rem + 0.2vw, 0.8rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.lede { font-size: clamp(1.06rem, 0.98rem + 0.4vw, 1.35rem); line-height: 1.5; color: var(--ink); max-width: 38ch; margin: 0; }
.body { color: var(--ink-2); max-width: 60ch; margin: 0; }
.note { font-size: 0.9rem; color: var(--ink-2); line-height: 1.55; margin: 0; }
.num { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 32px); }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.mt-s { margin-top: 1rem; } .mt-m { margin-top: 1.5rem; }

/* ---------- header ---------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); transition: background .4s var(--ease), border-color .4s; border-bottom: 1px solid transparent; }
.site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom-color: var(--line); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: clamp(12px, 2vw, 36px); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--serif); font-size: clamp(1.15rem, 1rem + 0.5vw, 1.55rem); white-space: nowrap; margin: 0; }
.brand i { font-style: italic; }
.brand__mark { width: 1.25em; height: 1.25em; flex: none; }
.mark-in circle { fill: var(--in); } .mark-out circle { fill: var(--out); } .mark-base { stroke: var(--ink-3); stroke-width: 1; }
/* The trail every tool carries at the top left: Saffron Creations mark / All tools / this tool.
   The mark goes to the agency's work section, All tools to the landing page. */
.sc-trail { display: inline-flex; align-items: center; gap: 0.6rem; flex: none; }
.sc-trail__home { display: inline-flex; border-radius: 5px; }
.sc-trail__home img { display: block; width: auto; height: clamp(26px, 1.55em, 34px); }
.sc-trail__sep { color: var(--ink-3); font-family: var(--mono); font-size: 0.8rem; }
.sc-trail__tools { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.sc-trail__tools:hover { color: var(--ink); }
@media (max-width: 640px) { .sc-trail__tools, .sc-trail__sep--2 { display: none; } }
.site-header__actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
@media (max-width: 520px) { .hide-s { display: none; } }
/* very small phones: the header keeps the name and theme; "Add your own numbers" sits just below in the hero */
@media (max-width: 480px) { .site-header .header-add { display: none; } }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 2.75rem; padding: 0.5em 1.2em; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 0.9rem; text-decoration: none; cursor: pointer; transition: border-color .25s, background .25s, color .25s, transform .25s var(--ease); white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(0.97); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn--sm { min-height: 2.25rem; padding: 0.3em 0.95em; font-size: 0.82rem; }
.link-button { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 0.2em; cursor: pointer; font-size: inherit; }
.link-button:hover { color: var(--ink); }
.file-input { display: none; }

/* ---------- theme menu ---------- */
.theme-menu { position: relative; }
.theme-menu__pop { position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, 86vw); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem; z-index: 60; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.theme-menu__pop .eyebrow { padding: 0.5rem 0.6rem 0.3rem; }
.theme-opt { display: flex; align-items: center; gap: 0.7rem; width: 100%; border: 0; background: transparent; padding: 0.55rem 0.6rem; border-radius: 10px; cursor: pointer; text-align: left; font-size: 0.88rem; }
.theme-opt:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.theme-opt[aria-checked='true'] { background: color-mix(in srgb, var(--ink) 11%, transparent); }
.theme-opt small { margin-left: auto; color: var(--ink-2); font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; }
.theme-sw { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.theme-sw i { width: 14px; height: 18px; display: block; }
.sw-in { background: var(--in); } .sw-out { background: var(--out); }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: calc(var(--header-h) + clamp(1.5rem, 5vh, 4rem)); padding-bottom: clamp(2.5rem, 6vw, 5rem); min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(1.5rem, 4vh, 3rem); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(16px, 3vw, 56px); align-items: center; flex: 1; }
.hero__text { display: flex; flex-direction: column; gap: clamp(1rem, 2.6vh, 1.6rem); position: relative; z-index: 2; }
.picker { display: flex; flex-direction: column; gap: 0.6rem; margin-top: clamp(0.25rem, 1vh, 0.75rem); container-type: inline-size; }
/* The eight examples in balanced rows: two columns of four where the column is narrow (phones),
   two rows of four where there is room, so no pill is cut off or left alone on a row. */
.pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
@container (min-width: 34rem) { .pills { grid-template-columns: repeat(4, auto); justify-content: start; } }
.pill { border: 1px solid var(--line); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 0.4em 0.95em; min-height: 2.4rem; font-size: 0.86rem; cursor: pointer; white-space: nowrap; text-align: center; transition: color .25s, border-color .25s, background .25s, transform .25s var(--ease); }
.pill:hover { color: var(--ink); border-color: var(--ink-2); }
.pill:active { transform: scale(0.97); }
.pill[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.theme-hint { margin: 0; font-size: 0.84rem; color: var(--ink-2); }
.theme-hint b { color: var(--ink); font-weight: 500; }
.source { display: flex; flex-direction: column; gap: 0.9rem; }
.source__text { display: flex; gap: 0.6rem; align-items: baseline; margin: 0; font-size: 0.92rem; color: var(--ink-2); max-width: 46ch; }
.source__dot { width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--in); flex: none; transform: translateY(-0.05em); animation: pulse 2.4s var(--ease) infinite; }
.source.is-yours .source__dot { animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.hero__stage { position: relative; height: clamp(320px, 64vh, 760px); min-width: 0; }
.stage__canvas { position: absolute; inset: 0; }
.stage__canvas canvas { width: 100% !important; height: 100% !important; touch-action: pan-y; }
.stage__labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stage__labels span { position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; line-height: 1.25; text-align: center; will-change: transform; }
.stage__labels span b { display: block; font-weight: 400; color: var(--ink-3); }
.stage__hud { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; pointer-events: none; }
.stage__unit { margin: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.stage__unit b { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.4vw, 2.4rem); line-height: 1; }
.no-webgl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--ink-2); font-size: 0.9rem; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.82rem; color: var(--ink-2); margin: 0; }
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.dot { width: 0.65em; height: 0.65em; border-radius: 50%; display: inline-block; flex: none; }
.dot--in { background: var(--in); } .dot--out { background: var(--out); } .dot--line { background: var(--ink); }
.dot--hollow { border: 2px solid var(--ink); background: transparent; }
.kpi-range { margin-bottom: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.8vw, 32px); margin: 0; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { border-top: 1px solid var(--line); padding-top: 1rem; min-width: 0; display: flex; flex-direction: column; }
.tile__k { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); order: 0; }
.tile__v { font-size: clamp(2.1rem, 4.2vw, 4.4rem); line-height: 1; margin: 0.4rem 0 0; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.tile__note { margin: 0.45rem 0 0; font-size: 0.84rem; color: var(--ink-2); }
.decode { font-variant-numeric: tabular-nums; }
/* phones: the 3D stage sits under the hero text */
@media (max-width: 860px) {
  .hero { min-height: 0; }
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__stage { height: clamp(300px, 88vw, 520px); }
}

/* ---------- sections ---------- */
.chapter { position: relative; padding-block: clamp(3.5rem, 6.5vw, 7rem); border-top: 1px solid var(--line); }
.ch-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(16px, 4vw, 80px); align-items: end; margin-bottom: clamp(1.75rem, 3.5vw, 3.5rem); }
@media (max-width: 860px) { .ch-head { grid-template-columns: minmax(0, 1fr); } }
/* heading with its note underneath, for a section whose content runs full width */
.ch-head--stack { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.ch-head--stack .body { max-width: 72ch; }
.ch-idx { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.1rem; }
.ch-idx span:first-child { font-family: var(--mono); font-size: 0.75rem; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 0.15em 0.7em; }
.ch-idx span + span { flex: 1; height: 1px; background: var(--line); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 1.8vw, 30px); background: transparent; min-width: 0; }
.card__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.9rem); line-height: 1.1; margin: 0 0 1rem; }

/* ---------- charts ---------- */
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chart-readout { margin: 0; font-size: 0.92rem; color: var(--ink-2); }
.chart-readout strong { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; color: var(--ink); margin-left: 0.2em; }
.chart-box { position: relative; height: clamp(16rem, 34vw, 28rem); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-2); font-size: 0.92rem; text-align: center; padding: 1rem; }
.chart-caption { display: flex; align-items: center; gap: 0.6rem; margin: 1rem 0 0; font-size: 0.84rem; color: var(--ink-2); }
.dash-key { width: 28px; height: 0; border-top: 2px dashed var(--ink); flex: none; }

/* ---------- category bars ---------- */
.bars { list-style: none; margin: 0; padding: 0; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 1rem; padding: 0.6rem 0; border-bottom: 1px dashed var(--line); font-size: 0.9rem; }
.bar-row:last-child { border-bottom: 0; }
.bar-row__name { min-width: 0; overflow-wrap: anywhere; }
.bar-row__value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row__value b { font-weight: 500; }
.bar-row__value small { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--ink-2); }
.bar-row__bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
.bar-row__bar i { display: block; height: 100%; border-radius: 999px; transform-origin: left; transform: scaleX(var(--w, 0)); transition: transform 1.2s var(--ease); }
.bars--out .bar-row__bar i { background: var(--out); } .bars--in .bar-row__bar i { background: var(--in); }
.reveal:not(.is-in) .bar-row__bar i { transform: scaleX(0); }
.bars-empty { color: var(--ink-2); font-size: 0.9rem; margin: 0; }

/* ---------- summary ---------- */
.summary-text { font-family: var(--serif); font-size: clamp(1.35rem, 0.95rem + 1.15vw, 2.3rem); line-height: 1.28; max-width: 64ch; margin: 0; color: var(--ink); }
.summary-text b { font-weight: 400; font-style: italic; }
.summary-text .in, .summary-text .out { font-style: normal; }

/* ---------- your numbers ---------- */
.steps3 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 28px); }
@media (max-width: 1000px) { .steps3 { grid-template-columns: minmax(0, 1fr); } }
.steps3 .card { display: flex; flex-direction: column; gap: 0.4rem; }
.step-n { font-family: var(--serif); font-size: clamp(2.6rem, 4vw, 3.8rem); line-height: 1; margin: 0 0 0.4rem; color: var(--ink-3); }
.steps3 .card__title { margin-bottom: 0.3rem; }
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; width: 100%; min-height: 8.5rem; margin-top: auto; padding: 1rem; border: 1.5px dashed var(--ink-3); border-radius: var(--radius); background: color-mix(in srgb, var(--ink) 3%, transparent); cursor: pointer; text-align: center; transition: border-color .25s, background .25s; }
.drop-zone b { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; }
.drop-zone span { font-size: 0.84rem; color: var(--ink-2); }
.drop-zone:hover, body.is-dragging .drop-zone { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.privacy { display: flex; gap: 1rem; align-items: flex-start; margin-top: clamp(1.25rem, 2.5vw, 2rem); padding: clamp(14px, 1.6vw, 24px); border: 1px solid var(--line); border-radius: var(--radius); }
.privacy svg { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: var(--in); stroke-width: 1.6; stroke-linecap: round; }
.privacy p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.privacy b { color: var(--ink); font-weight: 600; }
.problems { margin-top: clamp(1.25rem, 2.5vw, 2rem); padding: clamp(14px, 1.6vw, 24px); border: 1px solid var(--out); border-radius: var(--radius); }
.problems.is-ok { border-color: var(--line); }
.problems ul { margin: 0; padding-left: 1.2rem; color: var(--ink-2); font-size: 0.9rem; display: grid; gap: 0.35rem; }
.problems li b { color: var(--ink); font-weight: 500; }
.columns-help { margin-top: clamp(2rem, 4vw, 3.5rem); }
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.data-table th, .data-table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: 0; }
.data-table thead th { font-family: var(--mono); font-weight: 400; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.data-table tbody th { font-family: var(--mono); font-weight: 400; color: var(--ink); white-space: nowrap; }
.data-table td { color: var(--ink-2); }
.data-table td:last-child { white-space: nowrap; font-family: var(--mono); font-size: 0.82rem; color: var(--ink); }
.data-table td b { color: var(--ink); font-weight: 500; }
.tips { margin: 1.2rem 0 0; padding-left: 1.2rem; color: var(--ink-2); font-size: 0.9rem; display: grid; gap: 0.4rem; max-width: 80ch; }

/* ---------- show the figures, what if and the ATO line ---------- */
.table-toggle { margin-top: 1rem; }
.figures { margin-top: 0.8rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; overscroll-behavior: contain; }
.figures caption { caption-side: top; text-align: left; padding: 0.7rem 0.9rem 0.2rem; font-size: 0.8rem; color: var(--ink-2); }
.figures .data-table td { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--sans); color: var(--ink-2); }
.figures .data-table tbody th { font-family: var(--sans); }
.figures .data-table th:not(:first-child) { text-align: right; }
.whatif { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px dashed var(--line); display: grid; gap: 0.8rem; }
.whatif__controls { display: flex; flex-wrap: wrap; gap: 0.8rem 1.8rem; align-items: center; }
.slider { display: grid; grid-template-columns: 5.2em minmax(110px, 220px) 3.4em; align-items: center; gap: 0.7rem; font-size: 0.9rem; color: var(--ink-2); }
.slider output { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.slider input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
.slider input[type='range']::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
.slider input[type='range']::-moz-range-track { height: 2px; background: var(--line); }
.slider input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); margin-top: -8px; border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--ink); }
.slider input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); }
.whatif__result { margin: 0; color: var(--ink-2); max-width: 75ch; }
.whatif__result b { color: var(--ink); font-weight: 600; }
.dot--whatif { background: var(--in); border-radius: 2px; transform: rotate(45deg) scale(0.85); }
.benchmark { margin: clamp(1rem, 2vw, 1.5rem) 0 0; padding: clamp(12px, 1.4vw, 20px); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-2); font-size: 0.92rem; }
.benchmark b { color: var(--ink); font-weight: 600; }
.paste { display: grid; gap: 0.4rem; margin-top: 0.6rem; }
.paste textarea { font: inherit; font-family: var(--mono); font-size: 0.8rem; color: var(--ink); background: color-mix(in srgb, var(--ink) 3%, transparent); border: 1.5px dashed var(--ink-3); border-radius: 12px; padding: 0.7rem 0.8rem; resize: vertical; min-height: 4.2rem; width: 100%; }
.paste textarea::placeholder { color: var(--ink-2); }
.paste textarea:hover { border-color: var(--ink-2); }
.paste + .drop-zone { margin-top: 0.6rem; min-height: 6.5rem; }

/* ---------- drop overlay and toast ---------- */
.drop-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 2px dashed var(--ink-2); margin: 12px; border-radius: var(--radius); pointer-events: none; }
.drop-overlay[hidden] { display: none; }
.toast { position: fixed; left: 50%; bottom: clamp(12px, 3vw, 28px); z-index: 80; transform: translate(-50%, 1rem); max-width: min(560px, calc(100vw - 32px)); margin: 0; padding: 0.75rem 1.1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 0.88rem; text-align: center; opacity: 0; pointer-events: none; transition: opacity .35s, transform .45s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--out); color: #000; border-radius: 18px; }

/* ---------- footer ---------- */
.site-footer { position: relative; border-top: 1px solid var(--line); padding-top: clamp(3rem, 6vw, 6rem); overflow: hidden; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 80px); }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: minmax(0, 1fr); } }
.footer-note { max-width: 52ch; }
.site-footer h3 { font-family: var(--mono); font-weight: 400; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer ul a { text-decoration: none; color: var(--ink-2); font-size: 0.92rem; }
.site-footer ul a:hover { color: var(--ink); }
.site-footer__base { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem 1.6rem; flex-wrap: wrap; padding-block: 1.6rem; margin-top: clamp(2rem, 4vw, 4rem); border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--ink-2); position: relative; z-index: 1; }
.site-footer__base p { margin: 0; }
.credit a { color: var(--ink); text-decoration-thickness: 1px; }
.share-line { display: flex; gap: 0.6rem; align-items: center; }
.site-footer__word { font-family: var(--serif); font-size: clamp(5rem, 22vw, 22rem); line-height: 1; letter-spacing: -0.03em; white-space: nowrap; color: transparent; background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 22%, var(--bg)) 10%, color-mix(in srgb, var(--ink) 4%, var(--bg)) 95%); -webkit-background-clip: text; background-clip: text; text-align: center; margin-top: 1rem; padding: 0 0.1em 0.06em; pointer-events: none; user-select: none; }
.noscript { color: var(--ink-2); padding: 24px; text-align: center; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.split-line { display: block; overflow: hidden; padding: 0.08em 0.16em 0.22em; margin: -0.08em -0.16em -0.22em; }
.split-line > span { display: inline-block; transform: translateY(130%); transition: transform 1.1s var(--ease); }
.split-line + .split-line > span { transition-delay: .11s; }
.reveal-lines.is-in .split-line > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .split-line > span { transform: none; }
}
/* ---------- print or save as PDF ----------
   app.js switches a dark theme to Paper before printing, so the colours here are the theme's. */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { background: var(--bg) !important; }
  .site-header, .skip-link, .hero__stage, .hero .eyebrow:first-child, .lede, .picker, .source .row, .theme-hint,
  #your-numbers, .toast, .drop-overlay, .site-footer__grid, .site-footer__word, .share-line, .no-print, .table-toggle,
  .ch-idx, .ch-head .body, .whatif__controls, .whatif:not(.is-active) { display: none !important; }
  .print-only { display: block; }
  .container { max-width: none; padding-inline: 0; }
  .hero { min-height: 0; padding: 0 0 6mm; gap: 6mm; }
  .hero__grid { display: block; }
  .d-hero { font-size: 26pt; }
  .tile__v { font-size: 22pt; }
  /* spacing tightened so the plumber example fits on three A4 pages */
  .chapter { padding-block: 3mm; border-top: 0; }
  .ch-head { margin-bottom: 3mm; display: block; break-after: avoid; page-break-after: avoid; } /* a heading moves to the next page with its content */
  .card__title { margin-bottom: 2mm; }
  .bar-row { padding: 1.2mm 0; gap: 1mm 1rem; }
  .bar-row__bar { height: 6px; }
  .d-l { font-size: 20pt; }
  .card { break-inside: avoid; }
  /* app.js draws the charts at their A4 print size (6.5 cm high); this scales them to the paper's
     real width, keeping their shape, and the box grows with them so nothing below is drawn over. */
  .chart-box { height: auto; }
  .chart-box canvas { width: 100% !important; height: auto !important; }
  /* Chrome's PDFs give tabular figures no text, so copied figures came out blank: plain figures here.
     Figtree swaps "$" for a glyph with no text from weight 550, so the what-if figure prints at 500. */
  body, body * { font-variant-numeric: normal !important; }
  .whatif__result b { font-weight: 500; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .split-line > span { transform: none !important; }
  .bar-row__bar i { transform: scaleX(var(--w)) !important; }
  .summary-text { font-size: 13pt; max-width: none; }
  .site-footer { border: 0; padding-top: 0; }
  .site-footer__base { margin-top: 2mm; padding-block: 2mm; }
}

/* Reset to default, at the bottom of the theme menu (clears the theme saved for every tool) */
.theme-reset { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; width: 100%; margin-top: 0.35rem; padding: 0.7rem 0.6rem 0.45rem; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; min-height: 2.5rem; }
.theme-reset:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.theme-reset small { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }

/* The big footer word goes back to the top (smoothly), and brightens a little on hover */
@property --word-a { syntax: '<percentage>'; inherits: false; initial-value: 22%; }
@property --word-b { syntax: '<percentage>'; inherits: false; initial-value: 4%; }
.site-footer a.site-footer__word, .site-footer button.site-footer__word {
  display: block; width: 100%; border: 0; color: transparent; text-decoration: none; cursor: pointer; pointer-events: auto;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) var(--word-a), var(--bg)) 10%, color-mix(in srgb, var(--ink) var(--word-b), var(--bg)) 95%);
  -webkit-background-clip: text; background-clip: text; transition: --word-a .45s ease, --word-b .45s ease;
}
.site-footer .site-footer__word:hover, .site-footer .site-footer__word:focus-visible { --word-a: 44%; --word-b: 14%; }
.site-footer .site-footer__word:focus-visible { outline-offset: -0.08em; border-radius: 0.1em; }

/* The copy status takes no room until it has something to say, so Copy link sits on the right edge */
.share-line { gap: 0; }
.share-line span:not(:empty) { margin-left: 0.6rem; }
