/* Quote Builder. The look follows the Cash Flow Analyser (tool 7) and 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: what you keep (--in) and costs (--out); tax and GST stay neutral. The quote
   itself is always black on white paper, in every theme, because that is what prints.
   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 same eight themes and colours as tool 7, so a picked theme looks the same in both tools.
   --in is what you keep, --out is costs. */
: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);
  /* the quote on paper, the same in every theme */
  --doc-bg: #FFFFFF; --doc-ink: #151515; --doc-ink-2: #5B5B57; --doc-line: #DEDAD2;
}

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, input, select, textarea { 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); } }
.grid-2--tight { gap: clamp(12px, 1.4vw, 24px); }
.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; }
.mark-paper { fill: none; stroke: var(--ink-2); stroke-width: 1.2; }
/* 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; "Start your own quote" 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; will-change: transform; padding-left: 14px; }
.stage__labels span::before { content: ''; position: absolute; left: 0; top: 0.45em; width: 9px; height: 1px; background: var(--ink-3); }
.stage__labels span b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.05rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.stage__callout { position: absolute; inset: 0; pointer-events: none; }
.stage__callout svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.stage__callout line { stroke: var(--ink-2); stroke-width: 1; }
.stage__callout circle { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.stage__callout-text { position: absolute; left: 0; top: 0; margin: 0; max-width: 15rem; font-size: 0.8rem; line-height: 1.4; color: var(--ink-2); }
.stage__callout-text b { color: var(--ink); font-weight: 600; }
.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--gov { background: var(--ink-2); }
.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(320px, 92vw, 540px); }
}

/* ---------- 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); } }
.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; margin: 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; padding: 0; }
fieldset.card { min-inline-size: 0; }
fieldset.card legend { float: left; width: 100%; }
fieldset.card legend + * { clear: both; }

/* ---------- form fields ---------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; min-width: 0; }
.field label { font-size: 0.88rem; color: var(--ink); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(10px, 1.2vw, 20px); }
.field-row--3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); }
@media (max-width: 520px) { .field-row, .field-row--3 { grid-template-columns: minmax(0, 1fr); } }
.input { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--ink) 3%, transparent); transition: border-color .2s; }
.input:hover { border-color: var(--ink-3); }
.input:focus-within { border-color: var(--ink-2); }
.input input, .input select { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; padding: 0.6rem 0.75rem; outline: none; min-height: 2.75rem; font-size: 0.95rem; }
.input input[type='date'] { padding-right: 0.4rem; }
.input select { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 1.8rem; }
.input select option { background: var(--bg); color: var(--ink); }
.input:has(:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.input :focus-visible { outline: none; }
.input__pre, .input__post { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); padding-inline: 0.75rem; flex: none; }
.input__pre { padding-right: 0; }
.input__post { padding-left: 0; }
.input--short { max-width: 9rem; }
.input.is-invalid, .input:has([aria-invalid='true']) { border-color: var(--out); }
textarea { width: 100%; min-height: 4.6rem; resize: vertical; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--ink) 3%, transparent); padding: 0.6rem 0.75rem; font-size: 0.92rem; line-height: 1.5; }
textarea:hover { border-color: var(--ink-3); }
textarea:focus-visible { border-color: var(--ink-2); }
.hint { margin: 0; font-size: 0.8rem; color: var(--ink-2); line-height: 1.45; }
.hint.is-good { color: var(--ink); }
.hint.is-bad { color: var(--out); }
.check { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.92rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin: 0.18rem 0 0; flex: none; accent-color: var(--ink); cursor: pointer; }
.slider { display: grid; grid-template-columns: minmax(110px, 1fr) 3.4em; align-items: center; gap: 0.9rem; font-size: 0.9rem; color: var(--ink-2); }
.slider output { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.slider input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; 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: 20px; height: 20px; border-radius: 50%; background: var(--ink); margin-top: -9px; border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--ink); }
.slider input[type='range']::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); }

/* ---------- 01 what to charge ---------- */
.charge-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(14px, 2vw, 32px); align-items: start; }
@media (max-width: 900px) { .charge-grid { grid-template-columns: minmax(0, 1fr); } }
.form-card .field:last-child { margin-bottom: 0; }
.rate-card { position: sticky; top: calc(var(--header-h) + 1rem); }
@media (max-width: 900px) { .rate-card { position: static; } }
.rate-big { margin: 0.5rem 0 0; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.rate-big .num { font-size: clamp(3.6rem, 7vw, 6.5rem); line-height: 0.95; color: var(--in); }
.rate-big__unit { font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 2vw, 2rem); color: var(--ink-2); }
.rate-gst { margin: 0.4rem 0 0; color: var(--ink-2); font-size: 0.95rem; }
.fine { font-size: 0.8rem; margin-top: 1rem; }
.flag { margin: 1rem 0 0; padding: 0.75rem 0.9rem; border: 1px solid var(--out); border-radius: 12px; font-size: 0.9rem; color: var(--ink); }
.flag.is-calm { border-color: var(--line); color: var(--ink-2); }

/* bars: the rate split and the quote split */
.bars { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 1rem; padding: 0.55rem 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 1s var(--ease); }
.bar--home { background: var(--in); }
.bar--super { background: color-mix(in srgb, var(--in) 55%, var(--bg)); }
.bar--tax { background: var(--ink-2); }
.bar--gst { background: var(--ink-3); }
.bar--costs { background: color-mix(in srgb, var(--out) 60%, var(--bg)); }
.bar--materials { background: var(--out); }
.reveal:not(.is-in) .bar-row__bar i { transform: scaleX(0); }

/* ---------- 02 build the quote ---------- */
.build { display: grid; gap: clamp(14px, 2vw, 32px); }
.items-card .note { margin: -0.4rem 0 1rem; }
.items-head, .item { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 5.2rem 8rem 7.5rem 2.75rem; gap: 0.5rem; align-items: start; }
.items-head { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.items-head span:nth-child(n+3) { text-align: right; padding-right: 0.75rem; }
.items { list-style: none; margin: 0; padding: 0; }
.item { padding: 0.6rem 0; border-bottom: 1px dashed var(--line); }
.item .input input { font-size: 0.92rem; }
.item__num input { text-align: right; }
.item__amount { text-align: right; padding: 0.55rem 0.2rem 0 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item__amount b { font-weight: 500; font-size: 0.98rem; }
.item__amount small { display: block; font-family: var(--mono); font-size: 0.64rem; color: var(--ink-2); letter-spacing: 0.02em; margin-top: 0.15rem; white-space: normal; }
.item__rate { display: flex; justify-content: flex-end; gap: 0.4rem; margin-top: 0.3rem; font-size: 0.74rem; color: var(--ink-2); }
.item__rate .link-button { font-size: 0.74rem; }
.item__remove { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); transition: border-color .2s, color .2s; }
.item__remove:hover { border-color: var(--out); color: var(--ink); }
.item__remove svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.items-empty { padding: 1rem 0; color: var(--ink-2); font-size: 0.9rem; }
@media (max-width: 900px) {
  .items-head { display: none; }
  .item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 2.75rem; grid-template-areas: 'type type amount remove' 'desc desc desc desc' 'qty price price price'; row-gap: 0.45rem; padding: 0.9rem 0; }
  .item__amount { align-self: end; padding: 0 0.2rem 0.7rem 0; }
  .item__price .input { max-width: 16rem; }
  .item__rate { justify-content: flex-start; }
  .item__type { grid-area: type; } .item__desc { grid-area: desc; } .item__qty { grid-area: qty; } .item__price { grid-area: price; } .item__amount { grid-area: amount; } .item__remove { grid-area: remove; }
  .item__label { display: block !important; }
}
.item__label { display: none; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 0.25rem; }
.items-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem 2rem; flex-wrap: wrap; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.items-foot .field { margin: 0; max-width: 24rem; }
.sums { margin: 0; min-width: min(100%, 18rem); display: grid; gap: 0.35rem; }
.sums div { display: flex; justify-content: space-between; gap: 2rem; font-size: 0.92rem; color: var(--ink-2); }
.sums dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.sums__total { border-top: 1px solid var(--line); padding-top: 0.5rem; margin-top: 0.2rem; }
.sums__total dt { color: var(--ink); }
.sums__total dd { font-family: var(--serif); font-size: 1.9rem; line-height: 1; }

/* ---------- 03 the quote on paper ---------- */
.doc-tools { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem 1.2rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg__btn { border: 0; background: transparent; border-radius: 999px; padding: 0.45em 1.1em; min-height: 2.4rem; cursor: pointer; color: var(--ink-2); font-size: 0.88rem; transition: background .25s, color .25s; }
.seg__btn:hover { color: var(--ink); }
.seg__btn[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.pdf-help { margin-bottom: clamp(1rem, 2vw, 1.6rem); }
.doc-wrap { display: flex; justify-content: center; }
.doc { width: 100%; max-width: 54rem; background: var(--doc-bg); color: var(--doc-ink); border-radius: 4px; padding: clamp(18px, 4.5vw, 64px); box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent); font-size: clamp(0.78rem, 0.7rem + 0.3vw, 0.92rem); line-height: 1.5; }
/* Plain figures on the quote: Chrome's PDFs lost some tabular digits (3, 4, 6 and 9) when text was copied out. */
.doc, .doc * { font-variant-numeric: normal; }
.doc p { margin: 0; }
.doc__head { display: flex; justify-content: space-between; gap: 1.5rem 2rem; flex-wrap: wrap; padding-bottom: 1.4em; border-bottom: 2px solid var(--doc-ink); }
.doc__from { display: flex; gap: 1em; align-items: flex-start; min-width: 0; flex: 1 1 18rem; }
.doc__logo { max-width: 7em; max-height: 4.5em; object-fit: contain; flex: none; }
.doc__biz { font-family: var(--serif); font-size: 1.9em; line-height: 1.05; }
.doc__meta { color: var(--doc-ink-2); margin-top: 0.4em !important; overflow-wrap: anywhere; }
.doc__title { text-align: right; flex: 0 1 auto; margin-left: auto; }
.doc__kind { font-family: var(--serif); font-style: italic; font-size: 2.8em; line-height: 0.95; }
.doc__ids { display: grid; grid-template-columns: auto auto; gap: 0.15em 1em; margin: 0.6em 0 0; justify-content: end; }
.doc__ids dt { color: var(--doc-ink-2); font-family: var(--mono); font-size: 0.78em; letter-spacing: 0.06em; text-transform: uppercase; align-self: center; }
.doc__ids dd { margin: 0; text-align: right; }
.doc__for { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1em 2em; padding: 1.3em 0; }
.doc__label { font-family: var(--mono); font-size: 0.74em; letter-spacing: 0.1em; text-transform: uppercase; color: var(--doc-ink-2); margin-bottom: 0.3em !important; }
.doc__job { font-family: var(--serif); font-weight: 400; font-size: 1.55em; line-height: 1.15; margin: 0.2em 0 0.9em; }
.doc__items { width: 100%; border-collapse: collapse; }
.doc__items th { font-family: var(--mono); font-weight: 400; font-size: 0.74em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--doc-ink-2); text-align: left; padding: 0 0.6em 0.6em 0; border-bottom: 1px solid var(--doc-ink); }
.doc__items td { padding: 0.65em 0.6em 0.65em 0; border-bottom: 1px solid var(--doc-line); vertical-align: top; }
.doc__items th:nth-child(n+2), .doc__items td:nth-child(n+2) { text-align: right; white-space: nowrap; }
.doc__items th:last-child, .doc__items td:last-child { padding-right: 0; }
.doc__items td small { display: block; color: var(--doc-ink-2); font-size: 0.86em; }
.doc__totals { display: flex; justify-content: flex-end; margin-top: 1em; }
.doc__totals dl { margin: 0; min-width: min(100%, 19em); display: grid; gap: 0.3em; }
.doc__totals div { display: flex; justify-content: space-between; gap: 2em; }
.doc__totals dt { color: var(--doc-ink-2); }
.doc__totals dd { margin: 0; }
.doc__grand { border-top: 2px solid var(--doc-ink); padding-top: 0.45em; margin-top: 0.2em; align-items: baseline; }
.doc__grand dt { color: var(--doc-ink) !important; font-weight: 600; }
.doc__grand dd { font-family: var(--serif); font-size: 2.1em; line-height: 1; }
.doc__notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2em 2em; margin-top: 2em; padding-top: 1.2em; border-top: 1px solid var(--doc-line); }
.doc__notes p + p { margin-top: 0.3em; }
.doc__notes .doc__wide { grid-column: 1 / -1; }
.doc__text { white-space: pre-line; overflow-wrap: anywhere; }
.doc__foot { margin-top: 2em; padding-top: 0.9em; border-top: 1px solid var(--doc-line); color: var(--doc-ink-2); font-size: 0.86em; display: flex; justify-content: space-between; gap: 0.5em 1.5em; flex-wrap: wrap; }
.doc .is-missing { color: #74716A; font-style: italic; }
@media (max-width: 560px) {
  .doc__for, .doc__notes { grid-template-columns: minmax(0, 1fr); }
  .doc__title { text-align: left; margin-left: 0; }
  .doc__ids { justify-content: start; }
  .doc__ids dd { text-align: left; }
  .doc__items .doc__each { display: none; }
}
.checks { margin-top: clamp(1.25rem, 2.5vw, 2rem); padding: clamp(14px, 1.6vw, 24px); border: 1px solid var(--out); border-radius: var(--radius); }
.checks.is-ok { border-color: var(--line); }
.checks .card__title { font-size: clamp(1.15rem, 1rem + 0.5vw, 1.5rem); margin-bottom: 0.6rem; }
.checks ul { margin: 0; padding-left: 1.2rem; color: var(--ink-2); font-size: 0.92rem; display: grid; gap: 0.35rem; }
.checks li b { color: var(--ink); font-weight: 500; }

/* ---------- 04 is it worth it ---------- */
.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 { font-style: normal; }
.advice { list-style: none; margin: clamp(1.4rem, 3vw, 2.4rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: clamp(12px, 1.6vw, 24px); }
.advice li { border-top: 1px solid var(--line); padding-top: 0.9rem; color: var(--ink-2); font-size: 0.95rem; }
.advice li b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 0.25rem; }
.advice li.is-warn { border-top-color: var(--out); }
.advice li.is-good { border-top-color: var(--in); }

/* ---------- 05 keep quoting ---------- */
.saved { list-style: none; margin: 1rem 0 0; padding: 0; }
.saved li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 1rem; padding: 0.8rem 0; border-bottom: 1px dashed var(--line); }
.saved li:last-child { border-bottom: 0; }
.saved__name { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.saved__name b { font-weight: 500; }
.saved__name small { display: block; color: var(--ink-2); font-size: 0.82rem; }
.saved__total { font-family: var(--serif); font-size: 1.35rem; white-space: nowrap; margin: 0; text-align: right; }
.saved__actions { grid-column: 1 / -1; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tips { margin: 0; padding-left: 1.2rem; color: var(--ink-2); font-size: 0.9rem; display: grid; gap: 0.6rem; max-width: 80ch; }
.tips b { color: var(--ink); font-weight: 500; }
.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; }

/* ---------- figures table and toast ---------- */
.table-toggle { margin-top: 1.2rem; }
.figures { margin-top: 0.8rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; overscroll-behavior: contain; max-width: 40rem; }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.data-table caption { caption-side: top; text-align: left; padding: 0.7rem 0.9rem 0.2rem; font-size: 0.8rem; color: var(--ink-2); }
.data-table th, .data-table td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; }
.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-weight: 400; color: var(--ink); }
.data-table td { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.data-table thead th:not(:first-child) { text-align: right; }
.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, 24vw, 24rem); 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; }
.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 ----------
   Only the quote prints, black on white, whatever the theme. */
@media print {
  @page { size: A4; margin: 14mm; }
  :root { color-scheme: light !important; }
  html, body { background: #FFFFFF !important; color: #000000; }
  .skip-link, .site-header, .hero, .chapter:not(#quote), .site-footer, .toast, #quote .ch-idx, #quote .ch-head, .doc-tools, .pdf-help, .checks { display: none !important; }
  #quote { padding: 0; border: 0; }
  #quote .container { max-width: none; padding: 0; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .doc-wrap { display: block; }
  .doc { max-width: none; box-shadow: none; padding: 0; border-radius: 0; font-size: 10pt; }
  .doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc__items tr { break-inside: avoid; }
  .doc__notes, .doc__totals { break-inside: avoid; }
  .doc .is-missing { display: none; }
  .doc__items .doc__each { display: table-cell; }
}

/* 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; }
