/* yard-calc styles, wave E redesign. Direction and measured contrast: docs/DESIGN.md.
   Every colour, size and space is a custom property below, so a second pass only edits tokens.
   System fonts only; no external fonts, images or scripts. Inline SVG and data: URIs only. */
:root {
  /* palette (light) */
  --bg: #f5f6f3; --surface: #ffffff; --surface-2: #eef2ee; --grid: rgba(29, 90, 64, 0.07);
  --ink: #17201c; --muted: #4d5a54; --line: #dde3de; --line-strong: #7d8a83;
  --brand: #1d5a40; --brand-tint: #e7f0ea; --brand-ink: #ffffff;
  --accent: #b8460f; --accent-hover: #9a3a0c; --accent-fg: #ffffff;
  --ok: #1d6b45; --ok-bg: #e6f2ea; --warn: #7a4a00; --warn-bg: #fff3d6;
  --err: #a4201b; --err-bg: #fdecea; --focus: #1f5fd1;
  --proposed-bg: #eef5f0; --proposed-line: #1d5a40;
  /* legacy names used by other modules' CSS hooks */
  --fg: var(--ink); --card: var(--surface-2); --link: var(--brand); --line-input: var(--line-strong);
  /* type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 0.78rem; --fs-sm: 0.88rem; --fs-md: 1rem; --fs-lg: 1.18rem; --fs-xl: 1.41rem; --fs-2xl: 1.76rem; --fs-3xl: 2.24rem; --fs-num: 2.6rem;
  --lh-body: 1.55; --lh-tight: 1.2;
  /* space, radius, elevation */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(23, 32, 28, 0.06), 0 1px 1px rgba(23, 32, 28, 0.04);
  --shadow-2: 0 2px 4px rgba(23, 32, 28, 0.05), 0 8px 24px rgba(23, 32, 28, 0.08);
  --gutter: 16px; --content: 760px; --wide: 1160px; --header-h: 56px;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%231d5a40'/%3E%3Cpath d='M9 7v17h16' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='square'/%3E%3Cpath d='M13.5 24v-3.5M17.5 24v-3.5M21.5 24v-3.5M9 11.5h3.5M9 15.5h3.5M9 19.5h3.5' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E");
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1311; --surface: #161d1a; --surface-2: #1d2622; --grid: rgba(143, 211, 174, 0.06);
    --ink: #e8eeea; --muted: #a7b3ad; --line: #2b3631; --line-strong: #6f7d76;
    --brand: #8fd3ae; --brand-tint: #1b2c24; --brand-ink: #0d1a12;
    --accent: #f2894a; --accent-hover: #f6a06b; --accent-fg: #1b0d03;
    --ok: #7fd1a1; --ok-bg: #15291f; --warn: #f0c062; --warn-bg: #2e2410;
    --err: #ff9b94; --err-bg: #3a1714; --focus: #7fb0ff;
    --proposed-bg: #1b2c24; --proposed-line: #8fd3ae;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%238fd3ae'/%3E%3Cpath d='M9 7v17h16' fill='none' stroke='%230d1a12' stroke-width='3' stroke-linecap='square'/%3E%3Cpath d='M13.5 24v-3.5M17.5 24v-3.5M21.5 24v-3.5M9 11.5h3.5M9 15.5h3.5M9 19.5h3.5' stroke='%230d1a12' stroke-width='1.6'/%3E%3C/svg%3E");
  }
}
@media (min-width: 768px) { :root { --gutter: 24px; --header-h: 64px; } }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 17px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs-md)/var(--lh-body) var(--font); overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 6px; background: var(--surface); padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; z-index: 30; border-radius: var(--r-sm); box-shadow: var(--shadow-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: var(--lh-tight); letter-spacing: -0.012em; color: var(--ink); }
h1 { font-size: var(--fs-2xl); font-weight: 750; margin: var(--s5) 0 var(--s2); }
h2 { font-size: var(--fs-xl); font-weight: 700; margin: var(--s7) 0 var(--s3); }
h3 { font-size: var(--fs-lg); font-weight: 650; margin: var(--s5) 0 var(--s2); }
@media (min-width: 768px) { h1 { font-size: var(--fs-3xl); margin-top: var(--s6); } }
p, li, dd { max-width: 70ch; }
.lead { color: var(--muted); font-size: var(--fs-lg); margin: 0 0 var(--s4); line-height: 1.45; }
.hint, .note { color: var(--muted); font-size: var(--fs-sm); margin: var(--s1) 0 0; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin: 0 0 var(--s2); }

/* ---------- header: mark + wordmark, calculator links (full-bleed band) ---------- */
header.site { max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: var(--s3); min-height: var(--header-h);
  background: var(--surface); box-shadow: 0 0 0 100vmax var(--surface), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax -1px); position: relative; z-index: 10; }
header.site .brand { flex: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 750; font-size: 1.06rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
header.site .brand::before { content: ""; width: 30px; height: 30px; flex: none; background: var(--mark) center / contain no-repeat; }
header.site nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
header.site nav::-webkit-scrollbar { display: none; }
header.site nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; white-space: nowrap; justify-content: flex-end; }
header.site nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; color: var(--muted); font-weight: 550; border-radius: var(--r-pill); }
header.site nav a:hover { color: var(--ink); background: var(--surface-2); }
header.site nav a[aria-current="page"] { color: var(--brand); background: var(--brand-tint); font-weight: 700; }
@media (max-width: 480px) {
  header.site { gap: var(--s2); }
  header.site .brand { font-size: var(--fs-md); gap: 8px; }
  header.site .brand::before { width: 28px; height: 28px; }
  header.site nav ul { justify-content: flex-start; }
  header.site nav a { padding: 0 10px; }
}
header.site, footer.site, main.wide { max-width: var(--wide); }

main { max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter) var(--s7); }

/* ---------- home ---------- */
.hero { position: relative; margin: 0 calc(-1 * var(--gutter)) var(--s5); padding: var(--s5) var(--gutter) var(--s5);
  background-color: var(--brand-tint); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .hero { margin: 0 0 var(--s6); padding: var(--s7) var(--s7); border: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); border-top: 0; } }
.hero h1 { margin-top: 0; max-width: 20ch; }
.hero-art { display: none; }
.hero-art .hf { fill: var(--surface); }
@media (min-width: 900px) { .hero-art { display: block; position: absolute; right: var(--s7); top: 50%; transform: translateY(-50%); width: 320px; height: 220px; color: var(--brand); } }
.hero .lead { color: var(--ink); max-width: 46ch; margin-bottom: var(--s3); }
.trust-line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.trust-line li { display: inline-flex; align-items: center; gap: 6px; }
.trust-line li::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--ok); -webkit-mask: var(--tick) center / 16px no-repeat; mask: var(--tick) center / 16px no-repeat; }
:root { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.section-title { font-size: var(--fs-lg); margin: var(--s5) 0 var(--s3); }
.cards { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); } }
.cards li { max-width: none; }
.cards a { display: flex; flex-direction: column; height: 100%; min-height: 44px; padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; transition: box-shadow .15s, border-color .15s, transform .15s; }
.cards a:hover { border-color: var(--brand); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.cards svg { display: block; width: 64px; height: 48px; color: var(--brand); margin-bottom: var(--s3); }
.cards strong { display: block; font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--s1); color: var(--ink); }
.cards span { display: block; font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.cards .go { margin-top: auto; padding-top: var(--s3); font-size: var(--fs-sm); font-weight: 700; color: var(--brand); }
@media (max-width: 420px) { .cards a { padding: var(--s3); } .cards svg { width: 52px; height: 39px; margin-bottom: var(--s2); } .cards span:not(.go) { font-size: 0.82rem; } }
.trust { color: var(--muted); font-size: var(--fs-sm); }
.how-trust { display: grid; gap: var(--s3); margin: var(--s6) 0 0; }
@media (min-width: 768px) { .how-trust { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.how-trust > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); }
.how-trust h3 { margin: 0 0 var(--s1); font-size: var(--fs-md); }
.how-trust p { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- calculator page: head, workbench (form + result side by side on wide screens) ---------- */
.page-head { margin-bottom: var(--s3); }
.page-head h1 { margin-bottom: var(--s1); }
.page-head .lead { margin-bottom: 0; font-size: var(--fs-md); }
.trust-mini { margin: var(--s2) 0 0; font-size: var(--fs-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px var(--s3); }
.trust-mini a { color: var(--muted); }
.trust-mini > * { white-space: nowrap; }
@media (max-width: 480px) {
  .trio .with-unit input { padding-right: 2.2em; padding-left: 10px; }
  .trio .with-unit input::placeholder { color: transparent; }
  .trio .unit-suffix { right: 9px; }
}
.trust-mini > * + *::before { content: "·"; display: inline-block; margin-right: var(--s3); color: var(--line-strong); }
.page-head .eyebrow { margin: var(--s5) 0 var(--s1); }
.page-head .eyebrow + h1 { margin-top: 0; }
@media (max-width: 600px) {
  .page-head .eyebrow { display: none; }
  .page-head h1 { margin-top: var(--s3); }
  .trust-mini { gap: 0 var(--s4); }
  .trust-mini > * + *::before { display: none; }
  .start-bar .start-or { display: none; }
  .units .seg { margin-bottom: var(--s3); }
}
main.calc-page { max-width: var(--wide); }
main.calc-page > * { max-width: var(--content); margin-left: auto; margin-right: auto; }
main.calc-page > form.calc, main.calc-page > #result, main.calc-page > #errors { width: 100%; }
.result-empty { display: none; }
/* wide screens: form on the left, result on the right; the page's children stay in contract order */
@media (min-width: 1100px) {
  main.calc-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto auto 1fr; column-gap: var(--s6); align-items: start; }
  main.calc-page > * { grid-column: 1 / -1; }
  main.calc-page > .page-head { max-width: none; margin-left: 0; }
  main.calc-page > [data-mount="start"], main.calc-page > .banner, main.calc-page > form.calc, main.calc-page > #errors { grid-column: 1; max-width: none; margin-left: 0; margin-right: 0; }
  main.calc-page > #result, main.calc-page > .result-empty { grid-column: 2; grid-row: 2 / 7; max-width: none; margin: var(--s3) 0 0; }
  .result-empty { display: block; border: 2px dashed var(--line); border-radius: var(--r-lg); padding: var(--s6); color: var(--muted); text-align: center; }
  .result-empty svg { color: var(--line-strong); }
  .result-empty strong { display: block; color: var(--ink); font-size: var(--fs-lg); margin: var(--s3) 0 var(--s1); }
  #result:not([hidden]) ~ .result-empty { display: none; }
}

/* ---------- form ---------- */
form.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); margin-top: var(--s3); box-shadow: var(--shadow-1); }
@media (min-width: 768px) { form.calc { padding: var(--s5); } }
fieldset { border: 0; margin: 0 0 var(--s3); padding: 0; min-width: 0; }
legend { font-weight: 650; padding: 0; margin-bottom: var(--s2); font-size: var(--fs-sm); }
.field { margin: 0 0 var(--s3); min-width: 0; position: relative; }
label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; color: var(--ink); }
input, select, textarea { font: inherit; font-size: var(--fs-md); width: 100%; max-width: 100%; min-height: 48px; padding: 10px 12px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234d5a54' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
input[type="radio"], input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--brand); }
input[aria-invalid="true"] { border-color: var(--err); border-width: 2px; }
.err { color: var(--err); font-size: var(--fs-sm); margin: var(--s1) 0 0; font-weight: 600; }
.pair, .trio, .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 var(--s3); }
.trio { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
fieldset.row { border-top: 1px solid var(--line); padding-top: var(--s3); }
fieldset.row:first-child { border-top: 0; padding-top: 0; }
fieldset.row > legend { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); float: left; width: 100%; }
fieldset.row > legend + * { clear: both; }
/* a single area needs no "Area 1" caption on screen (kept for screen readers) */
[data-rows="areas"] > fieldset.row:only-child > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; float: none; }
fieldset.row .remove { margin-top: calc(-1 * var(--s2)); }
.input-row { display: flex; gap: var(--s2); align-items: flex-start; }
.input-row > input, .input-row > select, .input-row > .with-unit { flex: 1; min-width: 0; }
/* unit suffix inside the field (added by ui.js; the label keeps the unit for screen readers) */
.with-unit { position: relative; display: block; }
.with-unit input { padding-right: 3.6em; }
.unit-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; pointer-events: none; }
/* area row: shape diagram beside the two sizes */
.dims { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--s3); align-items: end; }
.dims .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shape-fig { margin: 0 0 var(--s3); width: 72px; height: 54px; color: var(--brand); }
.shape-fig svg { display: block; width: 72px; height: 54px; }
.shape-fig text { font: 700 11px var(--font); fill: var(--ink); }

/* segmented controls: a track with the chosen option raised */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; margin: 0 0 var(--s3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.seg label { margin: 0; font-weight: 400; position: relative; display: block; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg-face { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px;
  color: var(--muted); text-align: center; line-height: 1.2; font-size: 0.94rem; font-weight: 550; transition: background .12s, color .12s; }
.seg label:hover .seg-face { color: var(--ink); }
.seg input:checked + .seg-face { background: var(--surface); color: var(--brand); border-color: var(--brand); font-weight: 700; box-shadow: var(--shadow-1); }
.seg input:focus-visible + .seg-face { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg .ico { flex: none; }
@media (max-width: 480px) {
  .seg-4 { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .seg-3 .seg-face { gap: 4px; padding: 6px 2px; font-size: 0.82rem; white-space: nowrap; }
  .seg-3 .seg-face .ico { width: 16px; height: 16px; }
}
.units .seg { margin-bottom: var(--s4); }

/* buttons: neutral by default; one unmistakable primary (Calculate and other submit buttons) */
button { font: inherit; font-weight: 650; min-height: 44px; min-width: 44px; padding: 8px 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .12s, border-color .12s; }
button:hover { border-color: var(--ink); background: var(--surface-2); }
button.secondary { background: var(--surface); color: var(--ink); }
button[type="submit"], button.primary-wide, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 4px 12px rgba(184,70,15,.22); }
button[type="submit"]:hover, button.primary-wide:hover, button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary-wide { width: 100%; min-height: 52px; font-size: 1.06rem; font-weight: 750; letter-spacing: 0.01em; }
@media (min-width: 600px) { button.primary-wide { width: auto; min-width: 220px; } }
button.link { background: none; border: 0; color: var(--brand); text-decoration: underline; padding: 0 2px; font-weight: 500; box-shadow: none; }
.actions { margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
button.add-row { margin: 0 0 var(--s4); border-style: dashed; color: var(--brand); }
button.add-row::before { content: "+"; font-weight: 800; margin-right: 6px; }
/* Calculate stays reachable: it sticks to the bottom of the screen while the form runs below it */
form.calc > .actions { position: sticky; bottom: 0; z-index: 4; margin: var(--s2) calc(-1 * var(--s2)) 0; padding: var(--s2); background: var(--surface); border-radius: var(--r-md); }

/* help: 44 px "?" button and inline panel */
button.help { flex: none; width: 48px; height: 48px; padding: 0; border-radius: var(--r-md); background: var(--surface); color: var(--brand); border: 1px solid var(--line); font-weight: 800; font-size: 1.06rem; }
button.help[aria-expanded="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.help-panel { margin: var(--s2) 0 0; padding: var(--s3) var(--s4); background: var(--brand-tint); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--ink); }
.help-panel p { margin: var(--s1) 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0 var(--s1); }
.chips button { border-radius: var(--r-pill); padding: 6px 18px; background: var(--surface); color: var(--brand); border: 1px solid var(--brand); }

/* More options */
details.more { margin: var(--s3) 0 0; border-top: 1px solid var(--line); padding-top: var(--s2); }
details.more > summary { min-height: 44px; display: flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 650; color: var(--brand); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before, details.fold > summary::before { content: ""; width: 8px; height: 8px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin: 0 4px 0 2px; }
details.more[open] > summary::before, details.fold[open] > summary::before { transform: rotate(45deg); }
details.more > summary .more-count { color: var(--muted); font-weight: 500; font-size: var(--fs-sm); white-space: nowrap; margin-left: auto; background: var(--surface-2); border-radius: var(--r-pill); padding: 2px 10px; }
details.more > summary .more-count:empty { display: none; }
details.more[open] > summary { margin-bottom: var(--s3); }

/* proposed values from a template or the assistant */
.is-proposed { background: var(--proposed-bg); box-shadow: inset 4px 0 0 var(--proposed-line); padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: var(--r-md); }
.check-this { display: inline-block; color: var(--proposed-line); font-weight: 700; font-size: var(--fs-xs); margin-top: var(--s1); }
.banner { background: var(--proposed-bg); box-shadow: inset 4px 0 0 var(--proposed-line); padding: var(--s3) var(--s4); border-radius: var(--r-md); margin: var(--s3) 0 0; font-weight: 600; }

/* ---------- errors ---------- */
#errors { border: 1px solid var(--err); background: var(--err-bg); border-radius: var(--r-md); padding: var(--s2) var(--s4); margin: var(--s4) 0; }
#errors h2 { font-size: var(--fs-md); margin: var(--s2) 0; color: var(--err); }
#errors a { color: var(--err); }

/* ---------- result panel ---------- */
#result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 0 var(--s4) var(--s4); margin: var(--s4) 0; overflow: hidden; }
@media (min-width: 768px) { #result { padding: 0 var(--s5) var(--s5); } }
.result-top { margin: 0 calc(-1 * var(--s4)) var(--s4); padding: var(--s4) var(--s4) var(--s4); background: var(--brand-tint); border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .result-top { margin: 0 calc(-1 * var(--s5)) var(--s4); padding: var(--s5); } }
#result h2#result-h { font-size: var(--fs-xs); font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin: 0 0 var(--s2); }
.primary-figure { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s2); line-height: 1; }
.primary-figure .pf-num { font-size: var(--fs-num); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.primary-figure .pf-unit { font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.primary-figure .pf-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; flex-basis: 100%; margin-top: 6px; line-height: 1.3; }
.headline { font-size: var(--fs-md); line-height: 1.45; font-weight: 600; margin: var(--s3) 0 0; color: var(--ink); }
.assumes { margin: var(--s3) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.assumes strong { color: var(--ink); }
.tiles { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { main.calc-page .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tiles li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); display: flex; flex-direction: column; gap: 2px; transition: background-color .3s; max-width: none; }
.tiles li.flash { background: var(--proposed-bg); }
.t-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.t-value { font-size: 1.35rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -0.01em; }
.t-unit { font-size: var(--fs-sm); color: var(--muted); }
.rec { background: var(--ok-bg); border-radius: var(--r-md); padding: var(--s2) var(--s4) var(--s2) 44px; margin: 0 0 var(--s4); position: relative; }
.rec::before { content: ""; position: absolute; left: 14px; top: 13px; width: 18px; height: 18px; background: var(--ok); -webkit-mask: var(--tick) center / 18px no-repeat; mask: var(--tick) center / 18px no-repeat; }
.rec p { margin: var(--s1) 0; font-weight: 650; color: var(--ink); }
#result h3 { font-size: var(--fs-md); margin: var(--s4) 0 var(--s2); }
#result h3 .hint { font-weight: 500; }
.shop { margin: 0 0 var(--s2); }
.shopping { list-style: none; padding: 0; margin: var(--s2) 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); }
.shopping li { padding: var(--s3) var(--s3) var(--s3) 42px; position: relative; font-weight: 600; border-top: 1px solid var(--line); max-width: none; }
.shopping li:first-child { border-top: 0; }
.shopping li::before { content: ""; position: absolute; left: 14px; top: 15px; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; margin: var(--s2) 0; font-size: var(--fs-sm); }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
table.breakdown th[scope="row"] { font-weight: 500; }
table.breakdown td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.breakdown thead th:not(:first-child) { text-align: right; }
table.breakdown tr.total th, table.breakdown tr.total td { font-weight: 750; border-top: 2px solid var(--ink); }
table.breakdown tr.sub th, table.breakdown tr.sub td { border-top: 1px solid var(--line-strong); }
table.breakdown tr.neg td { color: var(--muted); }
table.costs caption { caption-side: bottom; text-align: left; padding-top: var(--s1); color: var(--muted); font-size: var(--fs-xs); }
.num { font-weight: 650; font-variant-numeric: tabular-nums; }
details.fold { border-top: 1px solid var(--line); }
details.fold > summary, details.how > summary, details.inputs > summary { min-height: 48px; display: flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 650; color: var(--brand); list-style: none; }
details.fold > summary::-webkit-details-marker, details.how > summary::-webkit-details-marker, details.inputs > summary::-webkit-details-marker { display: none; }
details.how, details.inputs { border-top: 1px solid var(--line); }
details.how > summary::before, details.inputs > summary::before { content: ""; width: 8px; height: 8px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin: 0 4px 0 2px; }
details.how[open] > summary::before, details.inputs[open] > summary::before { transform: rotate(45deg); }
details.fold[open] > summary { margin-bottom: var(--s1); }
.result-actions { margin: var(--s4) 0 var(--s2); }
.result-actions button { flex: 1 1 auto; }
.result-actions button[data-act="edit"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.result-actions button[data-act="edit"]:hover { filter: brightness(1.1); }
details.save .actions { margin-top: 0; }
.share { margin-top: var(--s3); }
.share-row { display: flex; gap: var(--s2); }
.share-row input { flex: 1; min-width: 0; font-size: var(--fs-sm); background: var(--surface-2); }
.msg { color: var(--muted); font-size: var(--fs-sm); margin: var(--s1) 0 0; display: inline-block; }
.confirm { margin-top: var(--s3); padding: var(--s3) var(--s4); background: var(--err-bg); border: 1px solid var(--err); border-radius: var(--r-md); }
.confirm p { margin: var(--s1) 0; font-weight: 650; }
.formula li { margin: var(--s1) 0; }
#result > .note { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }

/* sticky result bar (phones, result scrolled away) */
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 6px var(--gutter); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(23,32,28,.10); font-weight: 750; font-variant-numeric: tabular-nums; }
.sticky-bar .sticky-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- explanatory sections ---------- */
main > section > h2 { padding-top: var(--s5); border-top: 1px solid var(--line); }
.steps-list { padding-left: 0; list-style: none; counter-reset: step; }
.steps-list li { counter-increment: step; position: relative; padding-left: 40px; margin: var(--s3) 0; }
.steps-list li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-weight: 750; font-size: var(--fs-sm); display: flex; align-items: center; justify-content: center; }
.measure-figs { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s4) 0; }
.measure-figs figure { margin: 0; text-align: center; font-size: var(--fs-xs); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); }
.measure-figs svg { display: block; color: var(--brand); margin: 0 auto var(--s2); }
.worked ol { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4) var(--s3) 2.2em; font-variant-numeric: tabular-nums; }
.worked ol li { margin: var(--s2) 0; }
.table-wrap { overflow-x: auto; }
.ref-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.ref-wrap table { margin: 0; min-width: 520px; }
.ref-wrap caption { text-align: left; padding: var(--s2) var(--s3); }
.ref-wrap th:first-child, .ref-wrap td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.ref-wrap thead th:first-child { background: var(--surface-2); }
.ref-wrap tbody tr:last-child td { border-bottom: 0; }
.scroll-hint { display: none; color: var(--muted); font-size: var(--fs-xs); margin: var(--s1) 0; }
@media (max-width: 600px) { .scroll-hint { display: block; } }
dl.faq { margin: 0; }
dl.faq dt { font-weight: 700; margin-top: var(--s4); }
dl.faq dd { margin: var(--s1) 0 0; color: var(--ink); }
ol.sources { padding-left: 0; list-style: none; }
.sources li { margin: 0 0 var(--s2); padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--fs-sm); max-width: none; }
.sources li strong { display: inline-block; min-width: 2.4em; color: var(--brand); }
.related { list-style: none; padding: 0; }
.related li { margin: var(--s2) 0; }
.related a, .back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.callout { border: 1px dashed var(--brand); border-radius: var(--r-md); padding: var(--s3) var(--s4); margin: var(--s5) 0; background: var(--surface); }

/* ---------- start panel (C2), assistant (C3), sign-up (C4), directory (C5): restyled hooks ---------- */
.start-panel { margin: var(--s3) 0 0; }
.start-panel .start-title { font-size: var(--fs-lg); margin: var(--s2) 0 var(--s3); }
.start-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.start-bar .start-or { color: var(--muted); font-size: var(--fs-sm); }
button.start-open { padding: 8px 16px; color: var(--brand); border-color: var(--brand); background: var(--surface); }
.start-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; margin: 0 0 var(--s3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.start-tab { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 7px; font-weight: 550; }
.start-tab[aria-selected="true"] { background: var(--surface); color: var(--brand); border-color: var(--brand); font-weight: 700; box-shadow: var(--shadow-1); }
.start-pane { margin: 0; }
.start-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
@media (min-width: 640px) { .start-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.start-item { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: var(--s2) var(--s3); box-shadow: var(--shadow-1); max-width: none; }
button.start-example { width: 100%; text-align: left; background: transparent; color: var(--brand); border: 0; padding: 6px 0; text-decoration: underline; box-shadow: none; }
.start-desc, .start-needs { margin: 0 0 var(--s1); font-size: var(--fs-sm); }
.start-needs { color: var(--muted); }
.start-summary { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s2); font-weight: 650; }
.start-summary .start-reopen { font-weight: 500; }
.start-home { margin: 0 0 var(--s5); }
.start-chips { list-style: none; padding: 0; margin: var(--s2) 0 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.start-chips li { max-width: none; }
.start-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); text-decoration: none; line-height: 1.25; font-weight: 550; }
.start-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.start-home [data-mount="assist"] { margin-bottom: var(--s3); }
body.home .start-home .start-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { body.home .start-home .start-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
body.home .start-home .start-chip { width: 100%; justify-content: center; text-align: center; font-size: var(--fs-sm); padding: 6px 10px; border-radius: var(--r-md); }
#depth-hint { margin-top: var(--s1); }

.assist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-1); }
.assist label { margin-bottom: var(--s1); }
.assist textarea { min-height: 88px; resize: vertical; }
.assist-hint { color: var(--muted); font-size: var(--fs-xs); margin: var(--s1) 0 var(--s2); }
.assist-status { margin: var(--s1) 0 0; font-size: var(--fs-sm); }
.assist-status:empty { display: none; }
.assist-out { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3) var(--s3); margin-top: var(--s3); }
.assist-title { margin: var(--s2) 0; }
.assist-note { margin: var(--s1) 0; color: var(--muted); }
.assist-review { list-style: none; padding: 0; margin: var(--s2) 0; display: grid; gap: var(--s2); }
.assist-row { box-shadow: inset 4px 0 0 var(--line-strong); background: var(--surface-2); padding: var(--s2) var(--s3) var(--s2) var(--s4); border-radius: var(--r-md); max-width: none; }
.assist-row.is-unchecked { box-shadow: inset 4px 0 0 var(--proposed-line); background: var(--proposed-bg); }
.assist-row-head { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: baseline; }
.assist-label { font-weight: 650; }
.assist-badge { color: var(--proposed-line); border: 1px solid var(--proposed-line); border-radius: var(--r-pill); padding: 0 8px; font-size: var(--fs-xs); font-weight: 750; }
.assist-edit-label { font-weight: 500; font-size: var(--fs-sm); margin-top: var(--s1); }
.assist-edit[aria-invalid="true"] { border-color: var(--err); border-width: 2px; }
.assist-value { display: block; font-weight: 750; }
.assist-quote { margin: var(--s1) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.assist-questions label { margin-top: var(--s2); }
.assist-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
button.assist-again { background: var(--surface); color: var(--ink); }
/* assistant, styled to the system (presentation only; assist-ui.js decides what is applied) */
.assist label[for$="-text"] { font-size: var(--fs-md); font-weight: 700; }
.assist textarea { min-height: 96px; line-height: 1.45; }
button.assist-go { background: var(--surface); color: var(--brand); border: 1px solid var(--brand); box-shadow: none; min-height: 48px; }
button.assist-go:hover { background: var(--brand-tint); border-color: var(--brand); }
/* loading: a small turning ring before "Reading your description..." while the button is disabled */
button.assist-go:disabled { opacity: 0.6; cursor: progress; }
button.assist-go:disabled ~ .assist-status:not(:empty) { display: flex; align-items: center; gap: var(--s2); color: var(--muted); background: none; border: 0; padding: var(--s2) 0 0; }
button.assist-go:disabled ~ .assist-status:not(:empty)::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: yc-spin .8s linear infinite; }
@keyframes yc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.assist-go:disabled ~ .assist-status:not(:empty)::before { animation: none; } }
/* unavailable / messages: a quiet notice, not an error */
.assist > .assist-status:not(:empty) { margin-top: var(--s3); padding: var(--s2) var(--s3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); }
.assist-out { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3) var(--s4) var(--s4); box-shadow: var(--shadow-1); }
.assist-title { font-size: var(--fs-md); margin: var(--s1) 0 var(--s2); }
.assist-note { font-size: var(--fs-sm); }
/* review list as a compact summary: label and quote left, value right */
.assist-review { gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.assist-row { display: grid; grid-template-columns: minmax(0, 1fr) 8.2rem; column-gap: var(--s3); row-gap: 2px; align-items: center;
  background: var(--surface); box-shadow: none; border-radius: 0; border-top: 1px solid var(--line); padding: var(--s2) var(--s3); }
.assist-row:first-child { border-top: 0; }
.assist-row.is-unchecked { background: var(--proposed-bg); box-shadow: inset 4px 0 0 var(--brand); }
.assist-row-head { grid-column: 1; grid-row: 1; font-size: var(--fs-md); }
.assist-label { font-weight: 650; }
.assist-badge { color: var(--brand); border-color: var(--brand); background: var(--surface); }
.assist-edit-label { grid-column: 2; grid-row: 1; margin: 0; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; align-self: end; }
.assist-edit { grid-column: 2; grid-row: 2; min-height: 44px; font-variant-numeric: tabular-nums; font-weight: 650; }
.assist-value { grid-column: 1 / -1; grid-row: 2; text-align: left; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.assist-value ~ .assist-quote { grid-row: 3; }
.assist-quote { grid-column: 1; grid-row: 2; align-self: start; margin: 0; font-size: var(--fs-xs); font-style: italic; }
/* suggestion chips: off = an offer (dashed), on = accepted (solid brand, tick); the label always says current and proposed */
button.assist-suggest { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; text-align: left; min-height: 44px; margin-top: var(--s1); padding: 8px 12px 8px 40px;
  position: relative; border-radius: var(--r-md); border: 1px dashed var(--brand); background: var(--surface); color: var(--ink); font-weight: 550; font-size: var(--fs-sm); line-height: 1.35; box-shadow: none; }
button.assist-suggest::before { content: "+"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--brand); color: var(--brand); font-weight: 800; font-size: 13px; line-height: 14px; text-align: center; }
button.assist-suggest:hover { background: var(--brand-tint); border-color: var(--brand); }
button.assist-suggest[aria-pressed="true"] { border: 2px solid var(--brand); background: var(--brand-tint); font-weight: 650; padding-left: 39px; }
button.assist-suggest[aria-pressed="true"]::before { content: ""; border: 0; background: var(--brand); -webkit-mask: var(--tick) center / 18px no-repeat; mask: var(--tick) center / 18px no-repeat; }
.assist-suggest ~ .assist-quote { grid-row: 3; }
/* questions for missing values: prompts that point at the field below them */
.assist-questions { margin-top: var(--s3); padding: var(--s3); background: var(--surface-2); border-radius: var(--r-md); }
.assist-questions label { display: flex; gap: var(--s2); align-items: baseline; margin: var(--s3) 0 6px; font-size: var(--fs-md); font-weight: 650; }
.assist-questions label:first-child { margin-top: 0; }
.assist-questions label::before { content: "?"; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; transform: translateY(3px); }
.assist-questions input, .assist-questions select { background: var(--surface); }
/* one primary action in the panel */
.assist-actions { align-items: stretch; }
button.assist-put { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); min-height: 48px; font-weight: 750; flex: 1 1 auto; }
button.assist-put:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.assist-again { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
@media (max-width: 480px) { .assist-row { grid-template-columns: minmax(0, 1fr) 7rem; } .assist-actions { flex-direction: column; } }

.yc-subscribe { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); margin: var(--s5) 0; box-shadow: var(--shadow-1); }
.yc-subscribe h2, .yc-subscribe h3 { margin-top: 0; border: 0; padding: 0; }
.yc-subscribe-field { margin: 0 0 var(--s3); }
.yc-subscribe-consent { display: flex; gap: var(--s2); align-items: flex-start; min-height: 44px; font-weight: 500; margin: 0 0 var(--s3); }
.yc-subscribe-consent input[type="checkbox"] { width: 24px; height: 24px; flex: none; margin: 10px 0 0; }
.yc-subscribe-msg { margin: var(--s2) 0 0; font-weight: 650; }

[data-mount="directory-card"] { margin: 0 0 var(--s5); }
a.directory-card { display: block; padding: var(--s4) var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); text-decoration: none; color: var(--ink); min-height: 44px; }
a.directory-card:hover { border-color: var(--brand); box-shadow: var(--shadow-2); }
a.directory-card strong { color: var(--brand); display: block; font-size: var(--fs-lg); }
[data-mount="directory-links"] ul { padding-left: 1.2em; }
[data-mount="directory-links"] a { display: inline-flex; align-items: center; min-height: 44px; }
/* directory pages (generated by C5) on the same components */
main:not(.calc-page):not(.wide) > ul:not(.cards):not(.related) > li { margin: var(--s2) 0; }
main:not(.calc-page):not(.wide) > ul > li > ul { margin-top: var(--s1); }

/* ---------- footer (full-bleed band) ---------- */
footer.site { max-width: var(--content); margin: 0 auto; padding: var(--s5) var(--gutter) 96px; color: var(--muted); font-size: var(--fs-sm);
  background: var(--surface-2); box-shadow: 0 0 0 100vmax var(--surface-2); clip-path: inset(0 -100vmax); border-top: 1px solid var(--line); }
footer.site ul { list-style: none; padding: 0; margin: 0 0 var(--s2); display: flex; flex-wrap: wrap; gap: 0 var(--s2); }
footer.site ul a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 6px; color: var(--ink); font-weight: 600; }
footer.site .foot-trust { margin: 0 0 var(--s3); }
footer.site .foot-trust p { margin: 0 0 var(--s1); padding-left: 24px; position: relative; color: var(--ink); }
footer.site .foot-trust p::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; background: var(--ok); -webkit-mask: var(--tick) center / 16px no-repeat; mask: var(--tick) center / 16px no-repeat; }
footer.site .foot-trust a { color: var(--brand); font-weight: 600; }
footer.site p[data-footer-note] { margin: var(--s2) 0 0; }
footer.site .foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--ink); margin: 0 0 var(--s3); }
footer.site .foot-brand::before { content: ""; width: 24px; height: 24px; background: var(--mark) center / contain no-repeat; }

/* ---------- design pass 2 (persona step audit, DESIGN-FINDINGS) ---------- */
/* one disclosure component: a chevron row with a hairline above, ink text, brand chevron */
details.more > summary, details.fold > summary, details.how > summary, details.inputs > summary {
  min-height: 48px; padding: 4px 0; color: var(--ink); font-weight: 650; }
details.more > summary::before, details.fold > summary::before, details.how > summary::before, details.inputs > summary::before { color: var(--brand); }
details.more > summary:hover, details.fold > summary:hover, details.how > summary:hover, details.inputs > summary:hover { color: var(--brand); }
details.more > summary .more-count { display: none; }
/* help: a square joined to the right edge of its field, in the field's own colours */
.input-row { gap: 0; }
.input-row > input, .input-row > select, .input-row > .with-unit > input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
button.help { width: 48px; height: 48px; border-radius: 0 var(--r-md) var(--r-md) 0; margin-left: -1px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font-size: var(--fs-md); }
button.help:hover { background: var(--brand-tint); color: var(--brand); border-color: var(--line-strong); }
button.help[aria-expanded="true"] { background: var(--brand-tint); color: var(--brand); border-color: var(--brand); }
.help-panel { border: 1px solid var(--line); background: var(--surface-2); }
/* proposed values (example sizes, assistant values): calm brand tint with a clear label, not a warning */
.check-this { color: var(--brand); font-weight: 700; }
.check-this::before { content: "● "; font-size: 0.7em; vertical-align: 1px; }
.banner { font-weight: 550; }
/* result tiles: no stranded tile */
.tiles li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .tiles:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles:has(> li:nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tiles:has(> li:nth-child(5):last-child) > li { grid-column: span 2; }
  .tiles:has(> li:nth-child(5):last-child) > li:nth-child(n+4) { grid-column: span 3; }
  .tiles:has(> li:nth-child(3):last-child) > li:last-child { grid-column: auto; }
}
@media (min-width: 1100px) {
  main.calc-page .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  main.calc-page .tiles > li { grid-column: auto !important; }
  main.calc-page .tiles > li:last-child:nth-child(odd) { grid-column: 1 / -1 !important; }
}
/* action hierarchy: Calculate is the only filled button; result actions are outlined */
button.outline { background: var(--surface); color: var(--brand); border: 1px solid var(--brand); }
button.outline:hover { background: var(--brand-tint); }
.result-actions button[data-act="edit"] { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.result-actions button[data-act="edit"]:hover { background: var(--brand-tint); filter: none; }
.actions.stack { flex-direction: column; align-items: stretch; }
.actions.stack button { min-height: 48px; }
.shop button[data-act="copy-list"] { min-height: 44px; }
/* copy feedback */
.msg { display: block; }
.msg:empty { display: none; }
.msg-ok { color: var(--ok); background: var(--ok-bg); border-radius: var(--r-sm); padding: 6px 10px; font-weight: 650; margin-top: var(--s2); }
.msg-ok::before { content: "✓ "; }
.msg-fail { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); margin-top: var(--s2); }
.msg-fail textarea { margin-top: var(--s2); font-size: var(--fs-sm); min-height: 0; }
/* lower result sections and the explanation keep their distance */
#result .shop, #result table.costs { margin-bottom: var(--s4); }
#result + .result-empty + * , main.calc-page > [data-mount="subscribe"] { margin-top: var(--s5); }
/* phone: tighter vertical rhythm, same tap sizes; the header shows the mark alone so all four links fit */
@media (max-width: 480px) {
  header.site .brand { font-size: 0; gap: 0; min-width: 44px; justify-content: flex-start; }
  header.site .brand::before { width: 30px; height: 30px; }
  header.site nav a { padding: 0 9px; font-size: 0.94rem; }
  header.site nav ul { justify-content: space-between; }
  h1 { font-size: 1.6rem; }
  .page-head .lead { font-size: var(--fs-sm); line-height: 1.45; }
  form.calc { padding: var(--s3); margin-top: var(--s2); }
  .field { margin-bottom: 10px; }
  label { margin-bottom: 4px; }
  .units .seg { margin-bottom: var(--s2); }
  .seg { margin-bottom: var(--s2); }
  button.add-row { margin-bottom: var(--s3); }
  .start-panel { margin-top: var(--s2); }
  #result { padding: 0 var(--s3) var(--s3); }
  .result-top { margin: 0 calc(-1 * var(--s3)) var(--s3); padding: var(--s3); }
  .primary-figure .pf-num { font-size: 2.3rem; }
  .tiles { gap: 6px; margin-bottom: var(--s3); }
  .tiles li { padding: var(--s2) var(--s3); }
  .t-value { font-size: 1.2rem; }
  .rec { margin-bottom: var(--s3); }
  .shopping li { padding: 10px 10px 10px 40px; }
  .shopping li::before { top: 13px; }
  #result h3 { margin: var(--s3) 0 var(--s1); }
  .headline { font-size: 0.94rem; margin-top: var(--s2); }
  .assumes { margin-top: var(--s2); }
  details.more > summary, details.fold > summary, details.how > summary, details.inputs > summary { min-height: 44px; padding: 0; }
  .rec { padding-top: 6px; padding-bottom: 6px; }
  .rec::before { top: 11px; }
  #result > .note { margin-top: var(--s3); padding-top: var(--s2); }
  .result-actions { margin: var(--s3) 0 var(--s1); }
}
/* home: examples grouped under their calculator (start-panel.js) */
.start-groups { display: grid; gap: var(--s3); margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .start-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.start-group { max-width: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); }
.start-group-name { margin: 0 0 var(--s2); font-size: var(--fs-xs); font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.start-group .start-chips { display: grid !important; grid-template-columns: 1fr !important; gap: var(--s2); margin: 0; }
.start-group .start-chip { width: 100%; justify-content: flex-start !important; text-align: left !important; border-radius: var(--r-md) !important; }
button.start-more { margin-top: var(--s3); }
/* directory pages (generator template) */
.dir-grid { list-style: none; padding: 0; display: grid; gap: var(--s3); }
@media (min-width: 700px) { .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dir-card { max-width: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-1); }
.dir-card h3 { margin: 0 0 var(--s2); }
.dir-card ul { list-style: none; padding: 0; margin: 0; }
.dir-card li { margin: var(--s1) 0; }
.dir-card li a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.dir-facts { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.dir-facts > li { max-width: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.dir-facts .note, .dir-card .note { display: block; margin-top: var(--s1); font-size: var(--fs-xs); }
.dir-notice { background: var(--brand-tint); border-radius: var(--r-md); padding: var(--s3) var(--s4); color: var(--ink); }

/* ---------- fine-tune after re-audit (audit4) ---------- */
/* nothing sticky inside the form: Calculate stays where it is (it is on the first screen) */
form.calc > .actions { position: static; margin: var(--s2) 0 0; padding: 0; background: none; }
/* while the result bar shows, reserve its height so nothing scrolled into view lands under it */
html.has-sticky-bar { scroll-padding-bottom: 80px; }
html.has-sticky-bar body { padding-bottom: 64px; }
/* proposed values: tint the field itself; no inner padding that would narrow the input */
.is-proposed { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.is-proposed input, .is-proposed select { background: var(--proposed-bg); border-color: var(--brand); }
.seg.is-proposed { background: var(--surface-2); padding: 4px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--brand); }
.check-this { display: block; font-size: var(--fs-xs); line-height: 1.3; margin-top: 4px; }
/* result tiles on phones: three tiles in one row, five as three plus two */
@media (max-width: 639px) {
  .tiles:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles:has(> li:nth-child(3):last-child) > li { grid-column: auto; }
  .tiles:has(> li:nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tiles:has(> li:nth-child(5):last-child) > li { grid-column: span 2; }
  .tiles:has(> li:nth-child(5):last-child) > li:nth-child(n+4) { grid-column: span 3; }
  .tiles:has(> li:nth-child(3):last-child) .t-label { font-size: 0.7rem; letter-spacing: 0.02em; }
}
/* spacing between action groups inside "Share and save" */
details.save .share + .actions, details.save .actions + .share { margin-top: var(--s4); }
details.save .actions.stack + .confirm { margin-top: var(--s3); }
/* quantity fact and price comparison as two different boxes */
.rec-cost { background: var(--surface-2); border: 1px solid var(--line); padding-left: var(--s4); }
.rec-cost::before { display: none; }
#result h4 { font-size: var(--fs-sm); margin: var(--s3) 0 var(--s1); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
/* "See the sources" is a full 44 px target */
.trust-mini a { display: inline-flex; align-items: center; min-height: 44px; }
.trust-mini { align-items: center; margin-top: 2px; }
fieldset.row .remove { margin-top: 0; }
/* phones: concrete's bag size and price each take a full row so the option text is not cut */
@media (max-width: 600px) { .pair-wide { grid-template-columns: 1fr; } }
@media (max-width: 480px) { details.more .grid, details.more .pair { grid-template-columns: 1fr; } }

/* ---------- home: cubic yard calculator (form, result band, hand-off links); same tokens and components ---------- */
.yd-tool { margin: 0 0 var(--s5); }
.yd-tool > form.calc { margin-top: 0; }
.yd-tool .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#yd-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 0 var(--s4) var(--s4); margin: var(--s4) 0 0; overflow: hidden; }
#yd-result h2 { font-size: var(--fs-xs); font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin: 0 0 var(--s2); }
#yd-result h3 { font-size: var(--fs-md); margin: var(--s4) 0 0; }
#yd-result .headline { margin: var(--s2) 0 0; font-weight: 600; }
#yd-result .assumes { margin: var(--s1) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.handoff-notes { margin: var(--s3) 0 0; padding-left: 1.2em; font-size: var(--fs-sm); color: var(--ink); }
.handoff-notes li { margin: var(--s1) 0 0; }
#yd-result > .note { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.handoff { list-style: none; padding: 0; margin: var(--s2) 0 0; display: grid; grid-template-columns: 1fr; gap: var(--s2); }
@media (min-width: 480px) { .handoff { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.handoff li { max-width: none; margin: 0; }
.handoff a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 6px 12px; border: 1px solid var(--brand);
  border-radius: var(--r-md); background: var(--surface); color: var(--brand); font-weight: 700; text-decoration: none; line-height: 1.25; }
.handoff a:hover { background: var(--brand-tint); }
.yd-empty { display: none; }
@media (min-width: 900px) {
  .yd-tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s6); align-items: start; }
  #yd-result { margin: 0; }
  .yd-empty { display: block; border: 2px dashed var(--line); border-radius: var(--r-lg); padding: var(--s6); color: var(--muted); text-align: center; }
  .yd-empty strong { display: block; color: var(--ink); font-size: var(--fs-lg); margin: 0 0 var(--s1); }
  #yd-result:not([hidden]) ~ .yd-empty { display: none; }
}
.home-text { max-width: var(--content); }

/* ---------- print: one clean page with name, date, inputs, result, assumptions, estimate-only line ---------- */
@media print {
  @page { size: auto; margin: 14mm; }
  header.site nav, footer.site ul, footer.site .foot-trust, form.calc, [data-mount="start"], [data-mount="subscribe"], [data-mount="directory-links"], .banner, .result-empty,
  .actions, .confirm, .share-row button, .skip, #errors, .sticky-bar, .no-print, .help, .shop button, main > section:not(#result), .trust-mini, .eyebrow, .callout,
  details.save > summary, details.save .actions, details.save .msg, details.other-bags, details.how, .primary-figure .pf-label { display: none !important; }
  html { font-size: 10.5pt; }
  body { color: #000; background: #fff; }
  header.site { box-shadow: none; clip-path: none; background: #fff; min-height: 0; padding: 0 0 4mm; border-bottom: 1px solid #000; max-width: none; }
  footer.site { max-width: none; padding-left: 0; padding-right: 0; }
  header.site .brand { font-size: 12pt !important; gap: 8px !important; }
  main, main.calc-page { display: block !important; max-width: none; padding: 0; }
  .page-head .lead { font-size: 10pt; }
  h1 { font-size: 16pt; margin: 4mm 0 2mm; }
  #result { border: 1px solid #000; box-shadow: none; max-height: none; overflow: visible; position: static; padding: 0 4mm 4mm; margin: 2mm 0; }
  .result-top { background: #fff; margin: 0 -4mm 3mm; padding: 3mm 4mm; border-bottom: 1px solid #000; }
  .primary-figure .pf-num { font-size: 22pt; }
  .tiles { grid-template-columns: repeat(4, 1fr) !important; }
  .tiles li { border: 1px solid #999; background: #fff; grid-column: auto !important; padding: 2mm; }
  .rec, .shopping, .msg-ok { background: #fff; }
  details.save, details.fold, details.inputs { border: 0; }
  details.save[open] .share, details.save .share { display: block; }
  details.fold > summary, details.inputs > summary { min-height: 0; padding: 2mm 0 1mm; }
  details.fold > summary::before, details.inputs > summary::before { display: none; }
  .share-row input { border: 0; padding: 0; font-size: 8.5pt; background: #fff; min-height: 0; }
  thead { display: table-header-group; }
  tr, li { break-inside: avoid; }
  #result[data-printed]::after { content: "Printed " attr(data-printed); display: block; margin-top: 3mm; font-size: 8.5pt; }
  /* fit one page */
  html { font-size: 9.5pt; }
  details.inputs ul { columns: 2; column-gap: 8mm; margin: 0; font-size: 8.5pt; }
  details.inputs li { margin: 0; }
  .tiles { gap: 2mm; margin-bottom: 3mm; }
  .tiles li { padding: 1.5mm 2mm; }
  .rec { padding: 1mm 3mm 1mm 28px; margin-bottom: 2mm; }
  .rec::before { top: 2mm; }
  .shopping { margin: 1mm 0 2mm; }
  .shopping li { padding: 1.5mm 2mm 1.5mm 26px; }
  .shopping li::before { top: 2mm; left: 6px; width: 12px; height: 12px; }
  #result h3 { margin: 2mm 0 1mm; }
  table.costs td, table.costs th { padding: 1mm 2mm; }
  footer.site { display: none !important; } /* the result carries the estimate-only line */
  main.calc-page .tiles:has(> li:nth-child(5):last-child) { grid-template-columns: repeat(5, 1fr) !important; }
  main.calc-page .tiles:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr) !important; }
  .result-top { padding: 2mm 4mm; }
  .headline { margin-top: 1mm; }
  footer.site { box-shadow: none; clip-path: none; background: #fff; border: 0; padding: 2mm 0 0; }
  a { color: #000; text-decoration: none; }
}
