/* Embeds (/embed/...) and the branded supplier previews (/embed/b/...).
   Frozen copy of the site stylesheet as it was before the 2026-11 redesign,
   so a calculator already placed on someone else's page, and every supplier
   preview, looks exactly as it did when it was shared. The site itself uses
   lib/styles.css. */

/* ToolboxCalc. Each section has its own accent colour, set by a sec-* class
   on <body> (or on any element, for the home page's mixed lists), and every
   component reads --accent / --accent-soft rather than a fixed colour. */

:root {
  --ink: #16202a;
  --ink-soft: #4a5663;
  --ink-faint: #5d6773;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #e3e8ed;
  --line-strong: #cad3dc;
  --tint: #f4f6f8;
  --accent: #b04a17;
  --accent-soft: #fdf0e8;
  --accent-ink: #ffffff;
  --hero: #121a23;
  --shadow: 0 1px 2px rgba(22, 32, 42, 0.04), 0 6px 20px rgba(22, 32, 42, 0.06);
  --shadow-lift: 0 2px 4px rgba(22, 32, 42, 0.05), 0 14px 32px rgba(22, 32, 42, 0.10);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.sec-building      { --accent: #b04a17; --accent-soft: #fdf0e8; }
.sec-electrical    { --accent: #2456d3; --accent-soft: #ecf1fe; }
.sec-garden        { --accent: #1e6b38; --accent-soft: #e7f4eb; }
.sec-everyday-math { --accent: #6a3dd1; --accent-soft: #f1ecfd; }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9eef3;
    --ink-soft: #b4bfca;
    --ink-faint: #8e9aa6;
    --bg: #0f151b;
    --surface: #18212a;
    --line: #26323d;
    --line-strong: #36444f;
    --tint: #1f2a34;
    --accent: #f08a4b;
    --accent-soft: #33221a;
    --accent-ink: #111820;
    --hero: #0b1015;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 14px 32px rgba(0, 0, 0, 0.4);
  }
  .sec-building      { --accent: #f08a4b; --accent-soft: #33221a; }
  .sec-electrical    { --accent: #7aa2ff; --accent-soft: #1b2540; }
  .sec-garden        { --accent: #5fca85; --accent-soft: #16301f; }
  .sec-everyday-math { --accent: #ab8cff; --accent-soft: #261d3d; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3, .brand, .section-card strong, .tile strong, .pct-answer strong, .result strong {
  font-family: var(--display);
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { max-width: 880px; }
.icon { width: 1em; height: 1em; display: block; flex: none; }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead .wrap { max-width: 1040px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; font-size: 19px; }
.wordmark span { color: #c2531c; }
@media (prefers-color-scheme: dark) { .wordmark span { color: #f08a4b; } }
.logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #e0692b, #b8461a);
  color: #fff; font-size: 20px;
  box-shadow: 0 3px 10px rgba(194, 83, 28, 0.35);
}

.sitenav { margin-left: auto; }
.sitenav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.sitenav a {
  display: flex; align-items: center; gap: 7px;
  color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 650;
  padding: 7px 11px; border-radius: 999px;
}
.sitenav a .icon { color: var(--accent); font-size: 17px; }
.sitenav a:hover, .sitenav a:focus-visible, .sitenav a[aria-current] { background: var(--accent-soft); color: var(--ink); }

/* ---------- hero (home) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 8% 0%, rgba(240, 138, 75, 0.35), transparent 70%),
    radial-gradient(500px 280px at 92% 10%, rgba(122, 162, 255, 0.30), transparent 70%),
    radial-gradient(500px 260px at 70% 110%, rgba(95, 202, 133, 0.25), transparent 70%),
    radial-gradient(420px 220px at 20% 120%, rgba(171, 140, 255, 0.22), transparent 70%),
    var(--hero);
  color: #fff;
  padding: 64px 0 72px;
}
.hero .eyebrow { color: #ffb88a; }
.hero h1 { font-size: clamp(32px, 5.6vw, 54px); max-width: 16ch; margin-bottom: 14px; color: #fff; }
.hero .lead { color: rgba(255, 255, 255, 0.78); font-size: clamp(16.5px, 2.2vw, 19px); max-width: 60ch; }

.search {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin-top: 28px;
  background: #fff; color: #5b6672;
  border-radius: 14px; padding: 4px 6px 4px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-size: 20px;
}
.search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16.5px; color: #16202a;
  padding: 13px 4px;
}
.search:focus-within { box-shadow: 0 0 0 3px rgba(240, 138, 75, 0.6), 0 10px 30px rgba(0, 0, 0, 0.25); }

/* ---------- section cards (home) ---------- */

.section-cards {
  list-style: none; margin: -40px 0 8px; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  position: relative;
}
.section-card {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: var(--ink-soft); font-size: 14px; line-height: 1.5;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.section-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.section-card-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent); font-size: 26px; margin-bottom: 8px;
}
.section-card strong { color: var(--ink); font-size: 18px; }
.section-card em { margin-top: auto; padding-top: 8px; font-style: normal; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 6px; }

/* ---------- banner (section hubs) ---------- */

.banner { background: var(--accent-soft); border-bottom: 1px solid var(--line); padding: 4px 0 34px; }
.banner .crumbs { padding-top: 16px; }
.banner-head { display: flex; gap: 20px; align-items: flex-start; margin-top: 12px; }
.banner-icon {
  display: grid; place-items: center; flex: none;
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 38px;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent);
}
.banner h1 { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.chips span {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 650; color: var(--ink-soft);
}

/* ---------- tiles (calculator lists) ---------- */

.hub { margin: 36px 0; }
.hub h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; margin: 0 0 14px; letter-spacing: -0.01em;
}
.hub h2 a { color: inherit; text-decoration: none; }
.hub h2 a:hover { color: var(--accent); }
.hub-icon {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 19px;
}
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tiles li[hidden], [data-section][hidden], .section-cards[hidden] { display: none; }
.tile {
  display: flex; gap: 14px; align-items: flex-start; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.tile-icon {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-size: 22px;
}
.tile-text strong { display: block; color: var(--ink); font-size: 15.5px; line-height: 1.3; margin-bottom: 4px; }
.tile-text span { display: block; color: var(--ink-faint); font-size: 13.5px; line-height: 1.45; }
.no-results {
  text-align: center; color: var(--ink-soft); background: var(--surface);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; margin: 28px 0;
}

/* ---------- features (home) ---------- */

.features { margin: 52px 0 12px; }
.features h2 { font-size: clamp(22px, 3.4vw, 28px); margin: 0 0 18px; letter-spacing: -0.015em; }
.features ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-size: 22px; margin-bottom: 12px;
}
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- page head ---------- */

.crumbs { font-size: 13px; color: var(--ink-faint); padding: 20px 0 0; }
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.crumbs li:not(:last-child)::after { content: "\203A"; margin-left: 6px; color: var(--line-strong); }

.pagehead { padding: 14px 0 4px; }
.pagehead.with-icon { display: flex; gap: 18px; align-items: flex-start; }
.page-icon {
  display: grid; place-items: center; flex: none;
  width: 60px; height: 60px; border-radius: 17px; margin-top: 4px;
  background: var(--accent-soft); color: var(--accent); font-size: 32px;
}
.eyebrow { font-weight: 800; letter-spacing: 0.12em; color: var(--accent); font-size: 12px; text-transform: uppercase; margin: 0 0 6px; }
h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.1; margin: 0 0 10px; letter-spacing: -0.025em; font-weight: 800; }
.lead { font-size: 17.5px; color: var(--ink-soft); margin: 0; max-width: 62ch; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px;
  margin: 22px 0;
  box-shadow: var(--shadow-lift);
}

/* ---------- calculator form ---------- */

.calc-top { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field[hidden] { display: none; }
.field > label { font-weight: 650; font-size: 14.5px; }
.input-row { display: flex; align-items: stretch; }
.field input, .field select, .calc-top select, .pct input, .pct select {
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  min-width: 0;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input-row input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-row .unit {
  display: flex; align-items: center; padding: 0 12px;
  border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 10px 10px 0;
  background: var(--tint); color: var(--ink-faint); font-size: 13px; white-space: nowrap;
}
.input-row .unit:empty { display: none; }
.input-row input:only-child { border-radius: 10px; }
.field input:focus, .field select:focus, .calc-top select:focus, .pct input:focus, .pct select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.hint { font-size: 12.5px; color: var(--ink-faint); margin: 0; line-height: 1.45; }

.calc-top label { font-size: 13px; font-weight: 650; color: var(--ink-faint); display: flex; align-items: center; gap: 8px; }
.calc-top select { width: auto; padding: 8px 10px; font-size: 14px; }

.primary {
  margin-top: 20px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px 28px;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform .12s ease, filter .12s ease;
}
.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
@media (prefers-color-scheme: dark) { .primary { color: #10161c; } }

/* ---------- results ---------- */

.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.result { background: var(--tint); border-radius: 13px; padding: 16px; min-width: 0; }
.result strong { display: block; font-size: clamp(21px, 3.4vw, 28px); line-height: 1.15; letter-spacing: -0.02em; white-space: nowrap; }
.result strong::first-letter { text-transform: uppercase; }
.result span { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }
/* The first tile is the answer people came for. */
.results .result:first-child { background: var(--accent); }
.results .result:first-child strong, .results .result:first-child span { color: #fff; }
@media (prefers-color-scheme: dark) {
  .results .result:first-child strong, .results .result:first-child span { color: #10161c; }
}
.working { font-size: 13px; color: var(--ink-faint); margin: 14px 0 0; line-height: 1.55; font-variant-numeric: tabular-nums; }
.note { font-size: 13px; color: var(--ink-faint); margin: 12px 0 0; }

/* Verdict tiles: a limit check has to read as pass or fail at a glance. */
.results .result.pass { background: #e7f5ea; box-shadow: inset 0 0 0 1px #9ed4ae; }
.results .result.pass strong { color: #1c6b34; }
.results .result.fail { background: #fdeceb; box-shadow: inset 0 0 0 1px #edaba6; }
.results .result.fail strong { color: #a12b1e; }
@media (prefers-color-scheme: dark) {
  .results .result.pass { background: #17301f; box-shadow: inset 0 0 0 1px #2f6b42; }
  .results .result.pass strong { color: #86dba1; }
  .results .result.fail { background: #331a18; box-shadow: inset 0 0 0 1px #7a3a33; }
  .results .result.fail strong { color: #f3968b; }
}

/* ---------- percentage calculator ---------- */

.pct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pct-box { background: var(--tint); border-radius: 14px; padding: 18px; min-width: 0; }
.pct-title { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.pct-sentence { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.pct input { width: 96px; padding: 9px 10px; font-weight: 700; text-align: center; }
.pct select { width: auto; padding: 9px 10px; font-weight: 700; }
.pct-answer { margin: 16px 0 2px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pct-answer strong { font-size: clamp(30px, 5vw, 38px); line-height: 1.05; color: var(--accent); letter-spacing: -0.02em; white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.pct-dir { font-weight: 700; color: var(--ink-soft); }
.pct-work { margin: 6px 0 0; font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ---------- prose ---------- */

main .prose, .wrap > .prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 26px 14px;
  margin: 22px 0;
}
.prose h2 {
  font-size: clamp(20px, 3vw, 24px); margin: 30px 0 10px; letter-spacing: -0.015em;
  display: flex; align-items: flex-start; gap: 10px;
}
.prose h2::before { content: ""; width: 4px; height: 1.05em; margin-top: 0.12em; border-radius: 4px; background: var(--accent); flex: none; }
.prose h2:first-child { margin-top: 22px; }
.prose p { color: var(--ink-soft); margin: 0 0 14px; max-width: 70ch; }
.prose ul { color: var(--ink-soft); max-width: 70ch; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent); }
.prose abbr { text-decoration: underline dotted; cursor: help; }

.formula {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 10px 10px 0;
  font-size: 15.5px;
  color: var(--ink) !important;
  font-variant-numeric: tabular-nums;
}

/* Direct-answer block: the question as a heading, the answer in the first
   sentence. Styled to read as the answer, not as more prose. */
main .prose.answer { background: var(--accent-soft); border-color: transparent; }
.prose.answer .answer-lead {
  font-size: 18px; line-height: 1.55; color: var(--ink);
  background: var(--surface); border-radius: 12px; padding: 14px 16px; max-width: none;
}
.prose.answer .answer-lead strong { color: var(--ink); }

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto; margin: 0 0 24px; -webkit-overflow-scrolling: touch; border-radius: 12px;
  /* Edge shadows appear only while there is more table to scroll to. */
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.18), transparent) left / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.18), transparent) right / 10px 100% no-repeat scroll;
}
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.ref {
  border-collapse: separate; border-spacing: 0;
  width: 100%; font-size: 14.5px;
  background: transparent; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.table-caption {
  margin: 22px 0 8px; font-size: 12.5px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.45;
}
table.ref th, table.ref td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.ref .long { white-space: normal; min-width: 15rem; }
table.ref thead th { background: var(--accent-soft); font-size: 13px; color: var(--ink); white-space: nowrap; }
table.ref tbody tr:nth-child(even) td, table.ref tbody tr:nth-child(even) th { background: var(--tint); }
table.ref tbody tr:last-child td, table.ref tbody tr:last-child th { border-bottom: 0; }
table.ref td { color: var(--ink-soft); }
table.ref tbody th { color: var(--ink); font-weight: 650; }

/* ---------- faq ---------- */

main .prose.faq { padding-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq details:last-of-type { border-bottom: 0; }
.faq summary {
  font-weight: 680; cursor: pointer; font-size: 16px; list-style: none;
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 17px; line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--ink-soft); margin: 10px 0 0; max-width: 70ch; }

/* ---------- related ---------- */

.related ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.related a {
  display: inline-block; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 15px; font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--ink-soft); background: var(--surface);
}
.related a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- ads ---------- */

.adslot { margin: 26px 0; min-height: 90px; text-align: center; }

/* ---------- footer ---------- */

footer.sitefoot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 56px; padding: 28px 0 40px; color: var(--ink-faint); font-size: 14px; }
footer.sitefoot .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
footer.sitefoot a { color: var(--ink-faint); text-decoration: none; }
footer.sitefoot a:hover { color: var(--accent); text-decoration: underline; }
footer.sitefoot nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.disclaimer { font-size: 13px; color: var(--ink-faint); margin: 12px 0 0; max-width: 78ch; }

.contact-block { background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .section-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features ul { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .fields, .results, .pct-grid { grid-template-columns: 1fr; }
  .masthead { position: static; }
  .sitenav { margin-left: 0; width: 100%; }
  .sitenav ul { gap: 2px; }
  .sitenav a { padding: 6px 9px; font-size: 13.5px; }
  footer.sitefoot nav { margin-left: 0; }
  .masthead .wrap { gap: 8px; }
  .hero { padding: 40px 0 64px; }
  .section-cards { gap: 10px; }
  .section-card { padding: 16px; }
  .section-card span:not(.section-card-icon) { display: none; }
  .banner-head { flex-direction: column; gap: 14px; }
  .banner-icon { width: 58px; height: 58px; font-size: 30px; border-radius: 16px; }
  .pagehead.with-icon { flex-direction: column; gap: 12px; }
  .page-icon { width: 50px; height: 50px; font-size: 27px; }
  main .prose, .wrap > .prose { padding: 2px 18px 10px; }
  .card { padding: 18px; }
  .tiles { grid-template-columns: 1fr; }
}

/* Pass/fail verdicts are sentences, not numbers: smaller, and never broken
   mid-word. */
.results .result.pass strong, .results .result.fail strong { font-size: clamp(17px, 2.3vw, 20px); line-height: 1.25; white-space: normal; overflow-wrap: break-word; }
.result strong { overflow-wrap: break-word; }

@media (max-width: 620px) {
  .pct input { width: 76px; padding: 8px 6px; }
  .pct-sentence { gap: 6px; font-size: 15px; }
}

/* ---------- QA round 1: money prefix, tap targets, compact mobile header ---------- */

/* "$" goes before the number, the way prices are written. */
.input-row:has(.unit[data-unit="money"]) { flex-direction: row-reverse; justify-content: flex-end; }
.input-row:has(.unit[data-unit="money"]) input { border-radius: 0 10px 10px 0; }
.input-row .unit[data-unit="money"] { border-left: 1px solid var(--line-strong); border-right: 0; border-radius: 10px 0 0 10px; }

/* The header only sticks once it fits on one line. */
@media (max-width: 780px) {
  .masthead { position: static; }
}

@media (max-width: 620px) {
  .sitenav { overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .sitenav::-webkit-scrollbar { display: none; }
  .sitenav ul { flex-wrap: nowrap; }
  .sitenav a { padding: 10px 12px; white-space: nowrap; }
  .crumbs a { display: inline-block; padding: 10px 0; }
  .crumbs { padding-top: 8px; }
  footer.sitefoot nav a { display: inline-block; padding: 10px 4px; }
  .faq summary { padding: 6px 0; min-height: 40px; }
  #units, .calc-top select { min-height: 44px; }
}

@media (max-width: 400px) {
  .field select { font-size: 14px; }
}

.pct-wide { grid-column: 1 / -1; }

.hub-sub { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 18px 0 10px; }
.tiles-compact .tile { padding: 12px 14px; }
.tiles-compact .tile-icon { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.tiles-compact .tile-text span { display: none; }
.hub-sub[hidden], .tiles[hidden] { display: none; }

/* QA round 2 (visual) */
.prose a { overflow-wrap: anywhere; }
/* Table stripes and header are translucent so the scroll shadows behind
   them stay visible. */
table.ref thead th { background: color-mix(in srgb, var(--accent-soft) 75%, transparent); }
table.ref tbody tr:nth-child(even) td, table.ref tbody tr:nth-child(even) th { background: color-mix(in srgb, var(--tint) 70%, transparent); }
.table-scroll {
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.28), transparent) left / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.28), transparent) right / 14px 100% no-repeat scroll;
}
@media (prefers-color-scheme: dark) {
  .table-scroll {
    background:
      linear-gradient(to right, var(--surface) 30%, transparent) left / 28px 100% no-repeat local,
      linear-gradient(to left, var(--surface) 30%, transparent) right / 28px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(255,255,255,.22), transparent) left / 14px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(255,255,255,.22), transparent) right / 14px 100% no-repeat scroll;
  }
}
/* The mobile nav scrolls sideways: fade the right edge so it reads as more. */
@media (max-width: 620px) {
  .sitenav { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
}

/* /time converter: the rounding control and its caveat. */
.tconv-round { margin-top: 12px; font-size: 14px; }
/* Long durations ("1,000 h 7 min 24.2 s") wrap between words rather than
   being clipped; the hours box is wide enough to proofread 2080.1234. */
.tconv .pct-answer strong { white-space: normal; overflow: visible; }
.tconv #dh-in { width: 130px; }
.tconv-round label { font-weight: 700; color: var(--ink-soft); }
.tconv-note { margin: 14px 2px 0; font-size: 13px; color: var(--ink-faint); }

/* The link to the other language version under a page's lead. */
.langswitch { margin: 8px 0 0; font-size: 14px; font-weight: 650; }
.langswitch a { color: var(--accent); }

/* ---------- embeds ---------- */
/* /embed/<slug>/: the calculator alone, inside someone else's page. */
body.embed { background: #fff; }
body.embed main.wrap { padding: 8px 4px 4px; max-width: 720px; }
.embed-credit { margin: 10px 2px 0; font-size: 13px; color: var(--ink-faint); }
.embed-credit a { color: var(--accent); }
/* The "Add this calculator to your website" offer on each calculator page. */
.embed-offer { margin: 28px 0 8px; font-size: 14px; }
.embed-offer summary { cursor: pointer; font-weight: 650; color: var(--accent); }
.embed-offer textarea, .widget-code { width: 100%; font: 12px/1.45 ui-monospace, Consolas, monospace; padding: 10px; border: 1px solid var(--line, #d6dce3); border-radius: 8px; resize: vertical; }
/* Branded business embeds (/embed/b/<id>/<slug>/). */
.biz-head { margin: 0 2px 10px; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 750; font-size: 17px; }
.biz-demo { font-weight: 600; font-size: 14px; }   /* full white: WCAG contrast on the accent */
.biz-note.biz-under { background: #fff4e5; border-left: 4px solid #b45309; }
.biz-note { margin: 12px 2px 0; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 14px; }
.biz-cta { margin: 14px 2px 0; }
.biz-cta .btn { display: inline-block; padding: 11px 18px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.biz-demo-frame { border: 0; max-width: 720px; height: 900px; }
@media (max-width: 600px) { .biz-demo-frame { height: 1480px; } }

/* The phone result bar on calculators without their own (LIVE_ANSWER in
   lib/template.mjs); same look as the building calculators' #result-bar. */
.live-answer { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #1f2b37; color: #fff;
  font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); pointer-events: none; }
.live-answer[hidden] { display: none; }
.live-answer.slim { padding: 4px 10px; bottom: 6px; }
.live-answer span { min-width: 0; }
.live-answer button { flex: none; font: inherit; font-weight: 700; padding: 8px 12px; min-height: 44px; border-radius: 10px;
  border: 0; background: #e07a3c; color: #111820; cursor: pointer; pointer-events: auto; }
@media print { .live-answer { display: none; } }

/* /widgets/: the calculator picker, its live preview and the code to copy. */
.widget-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; }
.widget-pick label { font-weight: 650; }
.widget-pick select { min-height: 44px; padding: 8px 10px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); max-width: 100%; }
.widget-frame { display: block; width: 100%; max-width: 720px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.widget-code { display: block; max-width: 720px; margin: 10px 0 6px; }
.widget-copy { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.widget-note { color: var(--ink-faint); font-size: 14px; max-width: 70ch; }
.widget-featured h3 { margin: 22px 0 6px; }
.home-audiences { margin: 28px 0 0; }

/* ---------- The answer first ---------- */

/* The answer block: results, working and disclaimer, together. */
.answer { margin-top: 20px; }

/* One headline number; the other results read as a quiet list under it.
   Pass/fail verdicts keep their coloured tiles. Embeds keep the tile grid
   their host pages were sized for. */
body:not(.embed) .answer .results { grid-template-columns: 1fr; gap: 0; }
body:not(.embed) .answer .result:first-child { padding: 18px 20px; margin-bottom: 6px; }
body:not(.embed) .answer .result:first-child strong { font-size: clamp(34px, 6vw, 44px); }
body:not(.embed) .answer .result:not(:first-child):not(.pass):not(.fail) {
  display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 12px;
  background: transparent; border-radius: 0; padding: 11px 2px; border-bottom: 1px solid var(--line); }
body:not(.embed) .answer .result:not(:first-child):not(.pass):not(.fail) strong { font-size: 18px; text-align: right; }
body:not(.embed) .answer .result:not(:first-child):not(.pass):not(.fail) span { margin-top: 0; font-size: 14px; flex: 1; min-width: 0; }
body:not(.embed) .answer .result.pass, body:not(.embed) .answer .result.fail { margin-top: 10px; }

/* Desktop: inputs on the left, the answer beside them and kept in view. */
@media (min-width: 900px) {
  body:not(.embed) .card[data-calc]:has(> .answer) {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 28px; align-items: start; }
  body:not(.embed) .card[data-calc] > * { grid-column: 1; }
  body:not(.embed) .card[data-calc] > .answer {
    grid-column: 2; grid-row: 1 / span 6; margin-top: 0; position: sticky; top: 88px; }
}

/* Long field notes: two lines until the field is in use. */
body:not(.embed) .field .hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body:not(.embed) .field:focus-within .hint { display: block; overflow: visible; }

/* Inputs most visitors leave alone. */
.more { margin-top: 14px; border-top: 1px solid var(--line); }
.more > summary { cursor: pointer; padding: 12px 0; min-height: 44px; box-sizing: border-box; font-weight: 650; color: var(--ink-faint); list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: ' +'; }
.more[open] > summary::after { content: ' \2212'; }
.more > .fields { padding-bottom: 6px; }

/* Secondary actions as text, not competing buttons. */
.calc-example { margin: 12px 0 0; }
.text-btn { font: inherit; font-weight: 650; min-height: 44px; padding: 10px 2px; border: 0; background: transparent;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Branded supplier embeds stay in light mode. They sit on the supplier's own
   (light) page in the supplier's colours; in a dark-mode browser the dark
   tokens put dark text on the brand colour and light text on the pale
   delivery-minimum note. Same values as :root above. */
@media (prefers-color-scheme: dark) {
  body.embed.biz {
    color-scheme: light;
    --ink: #16202a;
    --ink-soft: #4a5663;
    --ink-faint: #5d6773;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --line: #e3e8ed;
    --line-strong: #cad3dc;
    --tint: #f4f6f8;
    --accent-ink: #ffffff;
    --shadow: 0 1px 2px rgba(22, 32, 42, 0.04), 0 6px 20px rgba(22, 32, 42, 0.06);
    --shadow-lift: 0 2px 4px rgba(22, 32, 42, 0.05), 0 14px 32px rgba(22, 32, 42, 0.10);
  }
  body.embed.biz .primary,
  body.embed.biz .results .result:first-child strong,
  body.embed.biz .results .result:first-child span { color: #fff; }
}
