/* Cross stitch calculator. Linen ground, indigo ink, thread red. See DESIGN.md. */

@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/young-serif-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/hanken-grotesk-latin.woff2") format("woff2");
}

:root {
  --bg: #f5f0e6;
  --surface: #fffdf8;
  --tint: #ece4d4;
  --grid: #ddd3bf;
  --grid-bold: #b9ab90;
  --border: #ddd3c1;
  --border-strong: #b8aa92;
  --ink: #1d2a44;
  --text: #33405a;
  --muted: #596070;
  --accent: #a8222c;
  --accent-hover: #8c1a23;
  --accent-ink: #fffdf8;
  --accent-soft: #f6dfdc;
  --blue: #2f5d8a;
  --focus: #2f5d8a;
  --peek-bg: #1d2a44;
  --peek-ink: #f5f0e6;
  --footer-bg: #1d2a44;
  --footer-text: #d9dde6;
  --shadow: 0 1px 2px rgb(29 42 68 / 0.06), 0 8px 24px -12px rgb(29 42 68 / 0.18);
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161c;
    --surface: #1b1e26;
    --tint: #20242e;
    --grid: #2a2f3a;
    --grid-bold: #3d4453;
    --border: #2c313c;
    --border-strong: #454c5b;
    --ink: #f1ebdf;
    --text: #d6d0c4;
    --muted: #a39d92;
    --accent: #ff8a80;
    --accent-hover: #ffa49c;
    --accent-ink: #14161c;
    --accent-soft: #3a2326;
    --blue: #8db7e3;
    --focus: #8db7e3;
    --peek-bg: #20242e;
    --peek-ink: #f1ebdf;
    --footer-bg: #0e1015;
    --footer-text: #c9c3b7;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -14px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14161c;
  --surface: #1b1e26;
  --tint: #20242e;
  --grid: #2a2f3a;
  --grid-bold: #3d4453;
  --border: #2c313c;
  --border-strong: #454c5b;
  --ink: #f1ebdf;
  --text: #d6d0c4;
  --muted: #a39d92;
  --accent: #ff8a80;
  --accent-hover: #ffa49c;
  --accent-ink: #14161c;
  --accent-soft: #3a2326;
  --blue: #8db7e3;
  --focus: #8db7e3;
  --peek-bg: #20242e;
  --peek-ink: #f1ebdf;
  --footer-bg: #0e1015;
  --footer-text: #c9c3b7;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -14px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* ---------- base ---------- */
html { scroll-padding-top: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--ink); font-family: var(--serif); font-weight: 400; line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 5vw, 52px); }
h2 { font-size: clamp(26px, 3.2vw, 32px); margin: 0 0 14px; }
h3 { font-size: 21px; margin: 28px 0 10px; }
p { text-wrap: pretty; }
strong { color: var(--ink); font-weight: 650; }
input, select, button { accent-color: var(--accent); }
button, a, select, input, summary, label.seg { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus, .skip-link:hover { top: 12px; color: var(--bg); }
.skip-link:hover { top: -60px; }
.skip-link:focus:hover { top: 12px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.005em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }
.mark-bg { fill: var(--accent); }
.mark-x { stroke: var(--accent-ink); stroke-width: 3.2; stroke-linecap: round; fill: none; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--accent); }
.theme-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--surface); }
.theme-toggle button { width: 34px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: 999px; color: var(--muted); cursor: pointer; }
.theme-toggle button svg { width: 16px; height: 16px; }
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] { background: var(--tint); color: var(--ink); }

/* ---------- intro ---------- */
.intro { padding: 44px 0 26px; max-width: 760px; }
.intro p { margin-top: 14px; font-size: 18px; color: var(--text); max-width: 64ch; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

/* ---------- tool ---------- */
.tool { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 64px; }
.tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs [role="tab"] {
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 12px 18px 13px; font-size: 16px; font-weight: 600; color: var(--muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; position: relative; white-space: nowrap;
}
.tabs [role="tab"]:hover { color: var(--ink); background: var(--bg); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }

.tool-body { display: grid; grid-template-columns: 360px minmax(0, 1fr); }
.inputs { padding: 22px 22px 26px; border-right: 1px solid var(--border); display: grid; gap: 22px; align-content: start; }
.group { border: 0; padding: 0; display: grid; gap: 14px; min-width: 0; }
.group[hidden], [hidden] { display: none !important; }
.group legend { font-family: var(--serif); color: var(--ink); font-size: 19px; padding: 0; margin-bottom: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.field label, .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.help { font-size: 14px; color: var(--muted); line-height: 1.45; }
.error { font-size: 14px; color: var(--accent); font-weight: 600; line-height: 1.4; }

input[type="number"], input[type="text"], select {
  width: 100%; min-height: 44px; padding: 9px 12px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 16px; font-variant-numeric: tabular-nums;
}
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, select:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[aria-invalid="true"] { border-color: var(--accent); background: var(--accent-soft); }
input::placeholder { color: var(--muted); opacity: 1; }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit input { padding-right: 76px; }
.unit-tag { position: absolute; right: 12px; font-size: 14px; color: var(--muted); pointer-events: none; }

.segs { display: inline-flex; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 3px; gap: 3px; width: max-content; max-width: 100%; }
.segs-wide { width: 100%; }
.segs-wide .seg { flex: 1; }
.seg { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 6px; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg input:hover + span { color: var(--ink); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(29 42 68 / 0.12), 0 0 0 1px var(--border); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { appearance: none; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 600; min-height: 36px; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

.floss-head { display: grid; grid-template-columns: 20px minmax(0, 1.3fr) minmax(0, 1fr) 40px; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: -6px; }
.floss-rows { list-style: none; padding: 0; display: grid; gap: 8px; }
.floss-row { display: grid; grid-template-columns: 20px minmax(0, 1.3fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.icon-btn { width: 40px; height: 44px; display: grid; place-items: center; border: 1px solid transparent; background: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.icon-btn:hover { color: var(--accent); border-color: var(--border); }

.sym { width: 16px; height: 16px; flex: none; }
.sym * { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.sym .fill { fill: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; font-size: 15px; font-weight: 650; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-quiet { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink); color: var(--ink); }
#add-colour { justify-self: start; }

/* Phone summary bar: hidden on wide screens. */
.peek { display: none; }
@media (max-width: 1020px) {
  html { scroll-padding-bottom: 64px; }
  .peek {
    display: flex; align-items: center; gap: 10px;
    position: sticky; bottom: 0; z-index: 3;
    padding: 10px 16px; background: var(--peek-bg); color: var(--peek-ink); border-top: 2px solid var(--accent); text-decoration: none;
    font-variant-numeric: tabular-nums;
  }
  .peek:hover { color: var(--peek-ink); }
  .peek-label { font-size: 13px; font-weight: 600; opacity: 0.8; }
  .peek-value { font-family: var(--serif); font-size: 20px; }
  .peek-go { margin-left: auto; font-size: 14px; font-weight: 650; border: 1px solid currentColor; border-radius: 999px; padding: 4px 12px; }
}

/* ---------- output ---------- */
.output { padding: 22px 24px 26px; min-width: 0; }
.out-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "fig lead" "fig stats"; grid-template-rows: auto 1fr; column-gap: 26px; align-items: start; }
.out-grid > .diagram { grid-area: fig; }
.out-lead { grid-area: lead; }
.out-stats { grid-area: stats; }
.out-grid-solo { grid-template-columns: 1fr; grid-template-areas: "lead" "stats"; }
.stale-note { font-size: 14px; font-weight: 600; color: var(--ink); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 14px; }
.output.is-stale .lead-value, .output.is-stale .stats, .output.is-stale .diagram, .output.is-stale .key { opacity: 0.45; }
.peek.is-stale .peek-value { opacity: 0.5; text-decoration: line-through; }
.lead { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.lead-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.lead-value { font-family: var(--serif); color: var(--ink); font-size: clamp(34px, 4vw, 44px); line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.lead-value .unit { font-family: var(--sans); font-size: 18px; font-weight: 600; color: var(--muted); }
.lead-note { margin-top: 8px; font-size: 15px; color: var(--text); line-height: 1.5; }
.stats { display: grid; gap: 0; }
.stat { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.stat:last-child { border-bottom: 0; }
.stat dt { font-size: 14px; color: var(--muted); font-weight: 600; line-height: 1.4; }
.stat dd { margin: 0; color: var(--ink); font-weight: 650; font-size: 16px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.stat-note { display: block; font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 2px; }

.diagram { margin: 0; }
.diagram svg { width: 100%; height: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.diagram figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; line-height: 1.4; }
.legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; vertical-align: -1px; }
.swatch-design { background: var(--accent-soft); border: 2px solid var(--accent); }
.swatch-fabric { background: var(--tint); border: 1px solid var(--grid-bold); }
.swatch-hoop { border: 2px dashed var(--blue); border-radius: 50%; }
.swatch-dim { height: 2px; width: 14px; border-radius: 0; background: var(--ink); }
.d-fabric { fill: var(--tint); stroke: var(--grid-bold); stroke-width: 1; }
.d-grid { stroke: var(--grid); stroke-width: 0.5; }
.d-label { fill: var(--ink); font-family: var(--sans); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.d-label-small { font-size: 13.5px; }
@media (max-width: 480px) { .d-label { font-size: 19px; } .d-label-small { font-size: 16px; } }
.d-label-hoop { fill: var(--blue); }
.d-design { fill: var(--accent-soft); opacity: 0.85; }
.d-tens { stroke: var(--accent); stroke-width: 0.8; opacity: 0.6; fill: none; }
.d-design-edge { fill: none; stroke: var(--accent); stroke-width: 2; }
.d-hoop { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-dasharray: 7 5; }
.d-dim { stroke: var(--ink); stroke-width: 1.4; fill: none; }

.out-floss { max-width: 720px; }
.key-wrap { overflow-x: auto; margin-top: 8px; }
.key { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.key caption { text-align: left; font-size: 14px; color: var(--muted); padding: 8px 0; caption-side: top; }
.key th, .key td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; font-size: 15px; }
.key thead th { font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--ink); }
.key tbody th { color: var(--ink); font-weight: 600; }
.key tfoot th, .key tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); color: var(--ink); font-weight: 650; }
.key td:first-child { width: 28px; }
.num { text-align: right !important; white-space: nowrap; }
.empty { margin-top: 14px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--text); font-size: 15px; }
.assume { margin-top: 16px; font-size: 14px; color: var(--muted); line-height: 1.55; max-width: 70ch; }
.assume strong { color: var(--ink); }

.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); position: relative; }
.toast-undo { appearance: none; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px 6px; margin-left: 6px; text-decoration: underline; text-underline-offset: 3px; }
.toast-undo:hover { color: var(--accent-hover); }
.toast { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--accent-soft); padding: 8px 12px; border-radius: var(--radius-sm); }

/* ---------- content ---------- */
.content { width: min(680px, 100% - 32px); margin-inline: auto; padding-bottom: 72px; }
.content > section, .content > .faq, .content > .related { margin-bottom: 56px; }
.content p + p, .content p + .table-wrap, .content .table-wrap + p, .content p + ul, .content p + .example, .content .example + p { margin-top: 14px; }
.band { background: var(--tint); border-radius: var(--radius); padding: 30px 28px; margin-inline: -28px; }
.steps { padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; margin-top: 4px; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.example { margin-top: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.example ol { margin-top: 8px; padding-left: 22px; display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.data caption { text-align: left; padding: 12px 14px 4px; font-size: 14px; color: var(--muted); font-weight: 600; }
.data th, .data td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.data thead th { color: var(--ink); font-size: 14px; font-weight: 650; border-bottom: 2px solid var(--border-strong); }
.data tbody th { color: var(--ink); font-weight: 600; }
.data tbody tr:last-child th, .data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:nth-child(10n) th, .data tbody tr:nth-child(10n) td { border-bottom-color: var(--grid-bold); }
.data.wide th, .data.wide td { padding: 8px 10px; }

.band .table-wrap { border: 0; border-radius: 0; background: transparent; }
.band .data caption { padding-left: 0; }
.band .data th, .band .data td { border-bottom-color: var(--border-strong); }
.link-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.link-list a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; height: 100%; transition: border-color 0.15s ease-out, transform 0.15s ease-out; }
.link-list a:hover { border-color: var(--accent); transform: translateY(-1px); }
.link-title { color: var(--ink); font-weight: 650; }
.link-note { color: var(--muted); font-size: 14px; line-height: 1.45; }

.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 650; color: var(--ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s ease-out; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .answer { padding: 0 0 18px; }

.legal-body { padding-top: 44px; }
.legal-body h1 { margin-bottom: 8px; }
.legal-body h2 { margin-top: 36px; font-size: 24px; }
.legal-body p, .legal-body ul { margin-top: 12px; }
.legal-body ul { padding-left: 22px; }
.not-found { padding-top: 64px; }
.not-found p { margin-top: 14px; }

/* ---------- footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 36px 0; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.site-footer .brand { color: #f5f0e6; }
.site-footer .mark-bg { fill: #f5f0e6; }
.site-footer .mark-x { stroke: #1d2a44; }
.site-footer p { margin-top: 8px; font-size: 14px; }
.site-footer a { color: #f5f0e6; }
.site-footer nav { display: flex; gap: 20px; font-size: 15px; }

/* ---------- small screens ---------- */
@media (max-width: 1020px) {
  .tool-body { grid-template-columns: 1fr; }
  .inputs { border-right: 0; border-bottom: 1px solid var(--border); }
  .group { max-width: 560px; }
}
@media (pointer: coarse) {
  .chip { min-height: 44px; padding: 10px 14px; }
  .theme-toggle button { width: 44px; height: 40px; }
  .seg span { min-height: 42px; }
}
@media (max-width: 760px) {
  .out-grid { grid-template-columns: 1fr; grid-template-areas: "lead" "fig" "stats"; row-gap: 18px; }
  .nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .band { margin-inline: -16px; padding: 24px 16px; border-radius: 0; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .intro { padding: 28px 0 20px; }
  .intro p { font-size: 17px; }
  .inputs, .output { padding: 18px 16px 22px; }
  .tabs { padding: 6px 6px 0; }
  .tabs [role="tab"] { padding: 12px 12px 13px; font-size: 15px; }
  .tool-actions { padding: 12px 16px; }
  .toast { margin-left: 0; width: 100%; }
  .tool-actions .btn { flex: 1 1 auto; padding: 10px 12px; font-size: 14px; }
  .stat { grid-template-columns: 1fr; gap: 2px; }
  .floss-row, .floss-head { grid-template-columns: 18px minmax(0, 1fr) 96px 40px; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .tabs, .tool-actions, .inputs, .skip-link, .related, .faq summary::after { display: none !important; }
  body { background: #fff; color: #000; }
  .tool { box-shadow: none; border: 0; }
  .tool-body { grid-template-columns: 1fr; }
}
