/* Vector Pace design system. Tokens first; see docs/design/brief.md for the reasoning. */
:root {
  --bg: #f7f9fa;
  --surface: #ffffff;
  --surface-2: #eef3f5;
  --text: #152b35;
  --muted: #4b5f68;
  --border: #dde6e9;
  --rule: #c3d0d5;
  --action: #2457c5;
  --action-hover: #1b449e;
  --action-soft: #e8eefb;
  --accent: #2457c5;
  --focus: #2457c5;
  --success: #2e7666;
  --success-bg: #e5f2ee;
  --warning: #855400;
  --warning-bg: #fbf1dc;
  --error: #b3261e;
  --error-bg: #fbe9e7;

  --font-head: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-doc: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Georgia, serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --measure: 68ch;
  --page: 1200px;
  --radius: 8px;
  --shadow-doc: 0 1px 2px rgba(21, 43, 53, .06), 0 12px 32px -18px rgba(21, 43, 53, .35);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* component display rules must never reveal a hidden element */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 var(--s4); font-weight: 700; color: var(--text); }
h1 { font-size: clamp(2rem, 4.2vw, 2.75rem); line-height: 1.12; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); margin-top: var(--s7); }
h3 { font-size: 1.2rem; margin-top: var(--s5); }
p, ul, ol, dl, table { margin: 0 0 var(--s4); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--text); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }
.small { font-size: 0.9rem; color: var(--muted); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose li { margin-bottom: var(--s2); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { margin-bottom: var(--s2); }
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 720px) { .wrap { padding: 0 var(--s5); } }

/* Skip link and staging bar */
.skip { position: absolute; left: var(--s4); top: -100px; background: var(--surface); padding: var(--s2) var(--s4); z-index: 10; border: 2px solid var(--focus); }
.skip:focus { top: var(--s2); }
.staging-bar { background: var(--warning-bg); color: var(--warning); font-size: 0.85rem; text-align: center; padding: var(--s1) var(--s4); border-bottom: 1px solid #e8d7ad; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); padding-top: var(--s3); padding-bottom: var(--s3); }
.wordmark { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: var(--s2); }
.wm-mark { width: 22px; height: 22px; display: inline-block; background:
  linear-gradient(135deg, transparent 46%, var(--action) 46%, var(--action) 62%, transparent 62%),
  linear-gradient(var(--text), var(--text)) left bottom / 100% 3px no-repeat; }
.primary-nav ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s4); margin: 0; padding: 0; }
.primary-nav a:not(.btn) { color: var(--text); text-decoration: none; padding: var(--s2) 0; display: inline-block; border-bottom: 2px solid transparent; }
.primary-nav a:not(.btn):hover { border-bottom-color: var(--rule); }
.primary-nav a[aria-current]:not(.btn) { border-bottom-color: var(--action); }

/* Breadcrumbs */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; padding: var(--s4) 0 0; margin: 0; font-size: 0.9rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; padding: 0 var(--s2); color: var(--rule); }
.breadcrumbs a { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; background: var(--action); color: #fff; border: 2px solid var(--action); padding: 10px 18px; border-radius: var(--radius); font-weight: 600; text-decoration: none; font-size: 1rem; line-height: 1.3; cursor: pointer; font-family: inherit; min-height: 44px; }
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--text); }
.btn-secondary:hover { background: var(--text); color: #fff; border-color: var(--text); }
.btn-small { padding: 6px 14px; min-height: 36px; font-size: 0.95rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0; }

/* Sections */
.section { padding-top: var(--s7); padding-bottom: var(--s7); }
.section + .section { border-top: 1px solid var(--border); }
.page-head { padding: var(--s6) 0 var(--s5); }
.page-head .lede { margin-bottom: 0; }
.kicker { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s3); }

/* Badges: what kind of thing a resource is */
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; vertical-align: middle; white-space: nowrap; }
.badge-working-tool { color: var(--success); background: var(--success-bg); }
.badge-demonstration { color: var(--warning); background: var(--warning-bg); }
.badge-template { color: var(--accent); background: var(--action-soft); }
.badge-service { color: var(--text); background: var(--surface-2); }

/* Home split hero: copy + a real output sample */
.split { display: grid; gap: var(--s6); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: var(--s7); } }

/* Document / output preview: looks like the thing the visitor will send */
figure { margin: 0; }
.doc { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--text); border-radius: 2px; padding: var(--s5); box-shadow: 0 1px 0 var(--border), 0 8px 24px -16px rgba(28,35,33,.35); }
.doc-title { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: var(--s3); margin-bottom: var(--s4); }
.doc-title strong { font-family: var(--font-head); font-size: 1.1rem; }
.doc-meta { font-size: 0.85rem; color: var(--muted); }
.doc caption { text-align: left; font-weight: 600; padding-bottom: var(--s2); }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; container-type: inline-size; }
/* Each table wrapper is a size container, so a table adapts to the column it sits in, not to the viewport. */
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid var(--text); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tfoot td, tfoot th { border-bottom: none; font-weight: 600; }
tr.total td, tr.total th { border-top: 2px solid var(--text); font-weight: 700; font-size: 1.05rem; }

/* Resource list (hub) — rows, not equal icon cards */
.resource-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.resource { display: grid; gap: var(--s3) var(--s6); padding: var(--s5) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 860px) { .resource { grid-template-columns: 1.1fr 1fr; } }
.resource h3 { margin-top: 0; }
.resource h3 a { color: var(--text); }
.resource .sample { font-size: 0.85rem; }
.unreleased { color: var(--muted); }
.status-note { font-size: 0.9rem; color: var(--muted); }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; max-width: var(--measure); }
.steps li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: var(--s5); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border: 2px solid var(--text); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); }

/* Two-column facts */
.facts { display: grid; gap: var(--s5); }
@media (min-width: 760px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s5); }
.facts h3 { margin-top: 0; }

/* Callout / CTA */
.cta-band { background: var(--text); color: #e6edf0; padding: var(--s6); border-radius: var(--radius); margin: var(--s7) 0; }
.cta-band h2 { color: #fff; margin-top: 0; }
.cta-band p { max-width: var(--measure); }
.cta-band a:not(.btn) { color: #fff; }
.note { border-left: 4px solid var(--rule); padding: var(--s3) var(--s4); background: var(--surface-2); max-width: var(--measure); }
.note-warn { border-left-color: var(--warning); background: var(--warning-bg); }
.placeholder { background: var(--warning-bg); color: var(--warning); padding: 0 4px; border: 1px dashed var(--warning); font-size: 0.95em; }

/* Forms */
form .field { margin-bottom: var(--s4); }
label, .label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: var(--s1); }
.hint { display: block; font-size: 0.875rem; color: var(--muted); font-weight: 400; margin-bottom: var(--s1); }
input[type=text], input[type=email], input[type=number], input[type=tel], input[type=url], input[type=date], select, textarea {
  width: 100%; max-width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid #73858d; border-radius: 4px; padding: 9px 10px; min-height: 44px;
}
input[type=number] { font-variant-numeric: tabular-nums; }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.error-msg { color: var(--error); font-weight: 600; font-size: 0.9rem; margin-top: var(--s1); }
.error-summary { border: 3px solid var(--error); background: var(--error-bg); padding: var(--s4); margin-bottom: var(--s5); border-radius: var(--radius); }
.error-summary h2 { margin-top: 0; font-size: 1.15rem; }
.success-box { border: 3px solid var(--success); background: var(--success-bg); padding: var(--s4); border-radius: var(--radius); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); margin: 0 0 var(--s4); background: var(--surface); min-width: 0; }
legend { font-weight: 700; padding: 0 var(--s2); font-family: var(--font-head); }
.check { display: flex; gap: var(--s2); align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
.grid-2 { display: grid; gap: 0 var(--s4); }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 0 var(--s3); grid-template-columns: 1fr 1fr; }
@media (min-width: 560px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: var(--s8); padding: var(--s7) 0 var(--s6); font-size: 0.95rem; }
.footer-grid { display: grid; gap: var(--s5); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr repeat(4, 1fr); } }
.footer-legal { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--border); }
.footer-legal p { margin: 0; overflow-wrap: anywhere; }
.footer-h { font-size: 1rem; margin: 0 0 var(--s3); font-family: var(--font-body); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.wordmark-footer { margin-bottom: var(--s2); }

/* Print: outputs print as clean documents */
@media print {
  .site-header, .site-footer, .breadcrumbs, .staging-bar, .no-print, .skip { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .doc { border: none; box-shadow: none; padding: 0; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.mt0 { margin-top: 0; }
.btn-on-dark { background: transparent; color: #fff; border-color: #fff; }
.btn-on-dark:hover { background: #fff; color: var(--text); border-color: #fff; }
.split > *, .facts > *, .resource > * { min-width: 0; }
td.basis, th.basis { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { th, td { padding: var(--s2); } .doc { padding: var(--s4); } }
caption { text-align: left; font-weight: 600; padding-bottom: var(--s2); color: var(--muted); }
.badge { font-family: var(--font-body); }

/* ---- P2: tools ---------------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tool { display: grid; gap: var(--s6); align-items: start; margin-top: var(--s4); }
.tool > * { min-width: 0; }
@media (min-width: 64rem) {
  .tool { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .tool-result { position: sticky; top: 1rem; }
}
.tool-form fieldset { margin-bottom: 1.25rem; min-width: 0; }
fieldset { min-width: 0; }
.tool-form .field { margin-bottom: 0.75rem; }
.unit { color: var(--muted); font-weight: 400; }
.panel-table { width: 100%; }
.panel-table th, .panel-table td { padding: 0.25rem 0.35rem; vertical-align: middle; }
.panel-table td:first-child { min-width: 8rem; }
.panel-table input { width: 100%; min-width: 3.5rem; }
.radio-row { display: flex; gap: 1.25rem; flex-wrap: wrap; padding-top: 0.35rem; }
.radio-row .check { margin: 0; }
#wrap-result.stale table, #wrap-result.stale #result-area { opacity: 0.35; }
#wrap-result.stale #result-h { color: var(--error); }
@media print {
  .tool { display: block; }
  .tool-form, .section, .cta-band, noscript { display: none !important; }
  .tool-result { position: static; }
}
.table-scroll { position: relative; }
@media (max-width: 40rem) {
  .panel-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .panel-table, .panel-table tbody { display: block; }
  .panel-table tr { display: grid; grid-template-columns: 1fr 1fr 4.5rem; gap: var(--s2); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
  .panel-table td { display: block; padding: 0; border: 0; }
  .panel-table td:first-child { grid-column: 1 / -1; }
  .panel-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
  .panel-table td:last-child { grid-column: 1 / -1; }
  .panel-table input { min-width: 0; }
}
.breadcrumbs ol { row-gap: var(--s1); }
.breadcrumbs a { display: inline-block; min-height: 24px; line-height: 24px; }

/* ---- P3 lead: document previews and proposal generator ---- */
.inline-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.inline-row select { flex: 1 1 14rem; width: auto; }
.small-h { font-size: 1.1rem; }
.muted { color: var(--muted); font-style: italic; }
.doc-preview { font-size: 0.95rem; }
.doc-preview .doc-h0 { font-size: 1.35rem; margin: 0 0 var(--s3); }
.doc-preview .doc-h1 { font-size: 1.1rem; margin: var(--s5) 0 var(--s2); }
.doc-preview .doc-h2 { font-size: 1rem; margin: var(--s4) 0 var(--s1); }
.doc-preview p, .doc-preview ul { margin: 0 0 var(--s2); }
.doc-preview.stale > * { opacity: 0.35; }
/* Six inputs never fit the form column as table columns: at 1440px the unit price was scrolled out of sight.
   Every schedule line is a card at every width, labelled from data-label. */
.schedule-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.schedule-table, .schedule-table tbody { display: block; }
.schedule-table tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s2) var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.schedule-table td { display: block; padding: 0; border: 0; min-width: 0; }
.schedule-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.schedule-table td:nth-child(2), .schedule-table td:nth-child(3) { grid-column: span 2; }
.schedule-table td:last-child { grid-column: span 2; align-self: end; justify-self: end; }
.schedule-table input { min-width: 0; width: 100%; }
@media (max-width: 40rem) {
  .schedule-table td:nth-child(2), .schedule-table td:nth-child(3), .schedule-table td:last-child { grid-column: 1 / -1; }
  .schedule-table td:last-child { justify-self: start; }
}
/* Document previews sit in a narrow column: tighter cells so the amount column stays in view. */
.doc-preview table { font-size: 0.875rem; }
.doc-preview th, .doc-preview td { padding: var(--s1) var(--s2); overflow-wrap: break-word; }
.doc-preview thead th { letter-spacing: 0; font-size: 0.75rem; }
/* A wide document table in a narrow preview column stacks each row into "label  value" lines instead of hiding
   columns behind a horizontal scroll. Empty cells (the blank columns of a total row) are dropped. */
@container (max-width: 34rem) {
  .doc-table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc-table.stack, .doc-table.stack tbody, .doc-table.stack tr { display: block; }
  .doc-table.stack tr { padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
  .doc-table.stack tr.total { border-top: 2px solid var(--text); border-bottom: 0; }
  .doc-table.stack td { display: grid; grid-template-columns: minmax(5.5rem, 35%) minmax(0, 1fr); gap: var(--s2); padding: 2px 0; border: 0; text-align: left; }
  .doc-table.stack td:empty { display: none; }
  .doc-table.stack td[data-label]::before { content: attr(data-label); font-size: 0.8rem; font-weight: 600; color: var(--muted); }
}
@media print {
  .doc-preview { font-size: 10.5pt; }
  .doc-preview.stale > * { opacity: 1; }
}
@media (min-width: 64rem) {
  .tool-result .doc-preview { max-height: calc(100vh - 10rem); overflow-y: auto; }
}
.loc-card { margin-bottom: var(--s4); }
.loc-card .span-all { grid-column: 1 / -1; }
.confirm-box { border: 2px solid var(--accent); border-radius: 4px; padding: var(--s3) var(--s4); margin: 0 0 var(--s4); background: var(--surface); }
.confirm-box ul { margin: var(--s2) 0 0; padding-left: 1.2rem; }
.confirm-box li { margin-bottom: var(--s1); }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.field select, .field input { max-width: 100%; }
.loc-card .span-2 { grid-column: span 2; }
.download-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.download-list li { max-width: 40rem; }
.download-list .btn { margin-bottom: var(--s1); }
.doc-inline { max-width: 48rem; }
/* ---- P3 lane: window-graphics-quote-software ---- */
.win-rows { width: 100%; }
.win-rows th, .win-rows td { padding: 0.25rem 0.35rem; vertical-align: middle; }
.win-rows td:first-child { min-width: 9rem; }
.win-rows input { width: 100%; min-width: 3.75rem; }
.win-summary { margin-bottom: var(--s2); }
.win-film { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.win-flag { display: inline-block; font-size: 0.8rem; font-weight: 600; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; margin-left: 2px; white-space: nowrap; }
#win-result.stale #result-h { color: var(--error); }
.win-stack th, .win-stack td { padding: var(--s2); }
.win-stack .win-flag { display: table; margin: 4px 0 0; padding: 1px 6px; }
/* Pane groups have six fields, too many for one table row in the form column: each group is a small
   card at every width (name and film on the first line, sizes, quantity and Remove on the second). */
.win-groups thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.win-groups, .win-groups tbody { display: block; }
.win-groups tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: var(--s2); padding: var(--s3) 0; border-bottom: 1px solid var(--rule);
  grid-template-areas: "name name name film film film" "w w h h q rm"; }
.win-groups td { display: block; padding: 0; border: 0; min-width: 0; }
.win-groups td:first-child { min-width: 0; grid-area: name; }
.win-groups td:nth-child(2) { grid-area: w; }
.win-groups td:nth-child(3) { grid-area: h; }
.win-groups td:nth-child(4) { grid-area: q; }
.win-groups td:nth-child(5) { grid-area: film; }
.win-groups td:nth-child(6) { grid-area: rm; align-self: end; }
.win-groups input, .win-groups select { min-width: 0; }
.win-groups td[data-label]::before, .win-films td[data-label]::before, .win-stack td[data-label]::before { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.win-groups td[data-label]::before { content: attr(data-label); }
@media (max-width: 40rem) {
  .win-groups tr { grid-template-columns: 1fr 1fr 4.5rem; grid-template-areas: "name name name" "w h q" "film film film" "rm rm rm"; }
  .win-groups td:nth-child(6) { align-self: start; }
  .win-films thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .win-films, .win-films tbody { display: block; }
  .win-films tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
  .win-films td { display: block; padding: 0; border: 0; min-width: 0; }
  .win-films td:first-child, .win-films td:last-child { grid-column: 1 / -1; min-width: 0; }
  .win-films td[data-label]::before { content: attr(data-label); }
  .win-films input { min-width: 0; }
  .win-lines caption { display: block; }
  /* Breakdown lines: item and amount on one line, the working underneath. */
  .win-lines thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .win-lines, .win-lines tbody, .win-lines tfoot { display: block; }
  .win-lines tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
  .win-lines td, .win-lines th { display: block; padding: 0; border: 0; }
  .win-lines tbody td:nth-child(1) { grid-area: 1 / 1; }
  .win-lines tbody td:nth-child(3) { grid-area: 1 / 2; }
  .win-lines tbody td.basis { grid-area: 2 / 1 / 3 / 3; text-align: left; font-size: 0.85rem; }
  .win-lines tr.total { border-top: 2px solid var(--text); }
  .win-lines tr.total td, .win-lines tr.total th { border-top: 0; }
}
/* ---- end P3 lane: window-graphics-quote-software ---- */
/* ---- P3 lane: maintenance-report-automation ---- */
.mr-tool { display: grid; gap: var(--s6); margin-top: var(--s4); }
.mr-tool > * { min-width: 0; }
.mr-grid-3 { grid-template-columns: 1fr; }
@media (min-width: 560px) { .mr-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
.mr-scale { display: grid; gap: var(--s2) var(--s4); margin: 0 0 var(--s3); }
@media (min-width: 720px) { .mr-scale { grid-template-columns: 1fr 1fr; } }
.mr-scale dt { font-weight: 700; }
.mr-scale dd { margin: 0; font-size: 0.95rem; color: var(--muted); }
.mr-signs-h { font-size: 1.25rem; margin: var(--s5) 0 var(--s2); }
.sign-card { margin-bottom: var(--s4); }
.sign-grid { display: grid; gap: 0 var(--s4); grid-template-columns: minmax(0, 1fr); }
.sign-grid > * { min-width: 0; }
@media (min-width: 36rem) {
  .sign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sign-grid .sign-wide, .sign-grid .sign-remove { grid-column: 1 / -1; }
}
@media (min-width: 60rem) {
  .sign-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sign-grid .sign-wide { grid-column: span 2; }
}
.sign-card textarea { min-height: 4.5rem; }
.sign-safety { display: flex; align-items: flex-start; align-self: start; min-height: 44px; }
@media (min-width: 36rem) { .sign-safety { padding-top: 1.6rem; } }
.sign-remove { margin-bottom: 0.75rem; }
.mr-result .doc-h { font-size: 1.1rem; margin: 0; }
.mr-result h3 { font-size: 1.05rem; margin: var(--s5) 0 var(--s2); }
.mr-result h3.mr-doc-title { font-size: 1.3rem; }
.mr-missing { border: 2px solid var(--warning); background: var(--warning-bg); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.mr-result .mr-missing h3 { margin-top: 0; }
.mr-missing ul { margin-bottom: 0; }
.mr-missing.is-complete { border-color: var(--success); background: var(--success-bg); }
.mr-missing.is-complete ul { display: none; }
.mr-header { display: grid; gap: var(--s1) var(--s4); grid-template-columns: minmax(0, 1fr); margin-bottom: var(--s3); }
@media (min-width: 40rem) { .mr-header { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mr-header div, .mr-signoff div { display: flex; flex-wrap: wrap; gap: 0 var(--s2); }
.mr-header dt, .mr-signoff dt { font-weight: 700; }
.mr-header dt::after, .mr-signoff dt::after { content: ":"; }
.mr-header dd, .mr-signoff dd { margin: 0; overflow-wrap: anywhere; }
.mr-signoff dd { flex: 1 1 12rem; border-bottom: 1px solid var(--text); min-height: 1.6em; }
.mr-signoff div { margin-bottom: var(--s3); max-width: 32rem; }
.mr-headline { font-weight: 700; }
.mr-summary { max-width: 32rem; }
.mr-flag { color: var(--error); }
.mr-statement { font-style: italic; border-top: 1px solid var(--rule); padding-top: var(--s3); }
.mr-stack td { overflow-wrap: anywhere; }
#mr-report.stale table, #mr-report.stale .mr-headline, #mr-report.stale dl { opacity: 0.35; }
#mr-report.stale #report-h { color: var(--error); }
@media (max-width: 48rem) {
  .mr-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mr-stack, .mr-stack tbody, .mr-stack tr, .mr-stack td { display: block; }
  .mr-stack tr { padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
  .mr-stack td { border: 0; padding: 2px 0; }
  .mr-stack td[data-label]::before { content: attr(data-label); display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
}
@media print {
  .mr-tool { display: block; }
  .mr-tool .tool-form { display: none !important; }
  .mr-missing, .mr-stack tr { break-inside: avoid; }
}
/* Billable-area table: stacks whenever its column is narrow (phones, and the two-column tool layout at ~1024px). */
@container (max-width: 30rem) {
  .win-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .win-stack, .win-stack tbody { display: block; }
  .win-stack td[data-label]::before { content: attr(data-label); }
  .win-stack tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s1) var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
  .win-stack td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; }
  .win-stack td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .win-stack caption { display: block; }
}
/* Very narrow columns (320px phones): tighter cells so three-column tables fit without a sideways scroll. */
@container (max-width: 20rem) {
  table { font-size: 0.875rem; }
  th, td { padding: var(--s1) var(--s2) var(--s1) 0; overflow-wrap: break-word; }
  th:last-child, td:last-child { padding-right: 0; }
  thead th { font-size: 0.72rem; letter-spacing: 0; }
  td.basis { overflow-wrap: anywhere; }
  /* Any headed document table stacks here, not only the wide ones. */
  .doc-table:has(thead) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc-table:has(thead), .doc-table:has(thead) tbody, .doc-table:has(thead) tr { display: block; }
  .doc-table:has(thead) tr { padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
  .doc-table:has(thead) td { display: grid; grid-template-columns: minmax(5.5rem, 35%) minmax(0, 1fr); gap: var(--s2); padding: 2px 0; border: 0; text-align: left; }
  .doc-table:has(thead) td:empty { display: none; }
  .doc-table:has(thead) td[data-label]::before { content: attr(data-label); font-size: 0.8rem; font-weight: 600; color: var(--muted); }
}
/* Phones and the one-column layout: the form is long, so a link straight to the live result. Hidden when the result sits beside the form. */
.jump-link { display: inline-block; margin-top: var(--s3); min-height: 24px; line-height: 24px; font-weight: 600; }
@media (min-width: 64rem) { .jump-link { display: none; } }
/* ---- P6: contact page — next steps before the form, editable context, optional details ---- */
.contact-layout { display: grid; gap: var(--s5) var(--s7); align-items: start; }
.contact-layout > * { min-width: 0; }
@media (min-width: 900px) { .contact-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); } }
.next-steps { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4) var(--s5); }
.next-steps h2 { font-size: 1.15rem; margin-bottom: var(--s3); }
.next-list { padding-left: 1.25rem; margin-bottom: var(--s3); }
.next-list li { margin-bottom: var(--s2); }
.context-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); background: var(--surface); border-radius: var(--radius); padding: var(--s2) var(--s4); margin-bottom: var(--s4); }
.context-line p { margin: 0; }
.context-key { font-size: 0.85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-right: var(--s1); }
.link-btn { background: none; border: 0; padding: var(--s1) 0; min-height: 24px; color: var(--accent); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.more-details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0 var(--s4); margin-bottom: var(--s4); }
.more-details summary { cursor: pointer; font-weight: 600; padding: var(--s3) 0; min-height: 44px; }
.more-details[open] summary { margin-bottom: var(--s2); }

/* ---- P7: operations identity — compact header, homepage sequence, service blocks, tool result access ---- */
h1, h2, h3, h4 { letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 1.25rem + 2.6vw, 3.25rem); line-height: 1.08; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem); line-height: 1.15; }
.h-small { font-size: 1.15rem; }
.kicker { color: var(--muted); letter-spacing: 0.08em; font-size: 0.8rem; }
.lede { font-size: 1.15rem; }

/* Header: wordmark, one commercial action and the menu on one row at every width. */
.site-header { position: relative; z-index: 5; }
.header-inner { flex-wrap: nowrap; min-height: 64px; padding-top: var(--s2); padding-bottom: var(--s2); }
.wordmark { font-family: var(--font-body); font-size: 1.15rem; letter-spacing: -0.01em; white-space: nowrap; }
.wm-mark { background:
  linear-gradient(135deg, transparent 46%, var(--action) 46%, var(--action) 62%, transparent 62%),
  linear-gradient(var(--text), var(--text)) left bottom / 100% 3px no-repeat; }
.header-inner { gap: var(--s3); }
.wordmark { margin-right: auto; }
.header-cta { white-space: nowrap; }
.menu-button { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; min-width: 44px; padding: 0 var(--s3);
  background: var(--surface); color: var(--text); border: 1px solid var(--rule); border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; }
.menu-button:hover { border-color: var(--text); }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-open .menu-icon { background: transparent; }
.menu-open .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-icon::after { top: 0; transform: rotate(-45deg); }
.primary-nav ul { flex-wrap: nowrap; gap: var(--s1) var(--s5); }
.primary-nav a:not(.btn) { font-weight: 500; white-space: nowrap; }
@media (min-width: 900px) {
  .header-inner { gap: var(--s6); }
  .wordmark { margin-right: 0; }
  .primary-nav { margin-left: auto; }
  .menu-button { display: none; }
}
@media (max-width: 899px) {
  /* Order on phones: wordmark, Contact, Menu; the menu panel opens underneath. */
  .header-inner { flex-wrap: wrap; gap: 0 var(--s2); }
  .header-cta { order: 1; }
  .menu-button { order: 2; }
  .primary-nav { order: 3; flex-basis: 100%; width: 100%; }
  /* Without JavaScript the links stay in view as a scrollable row; with it they sit behind the menu button. */
  .primary-nav ul { overflow-x: auto; padding-bottom: var(--s1); }
  .has-menu .primary-nav { display: none; }
  .has-menu.menu-open .primary-nav { display: block; border-top: 1px solid var(--border); margin-top: var(--s2); }
  .has-menu .primary-nav ul { flex-direction: column; align-items: stretch; overflow: visible; padding: var(--s1) 0 var(--s2); gap: 0; }
  .has-menu .primary-nav li { margin: 0; }
  .has-menu .primary-nav a:not(.btn) { display: block; padding: var(--s3) var(--s2); border-bottom: 1px solid var(--border); }
  .has-menu .primary-nav li:last-child a { border-bottom: 0; }
  .has-menu .primary-nav a[aria-current]:not(.btn) { border-bottom-color: var(--border); box-shadow: inset 3px 0 0 var(--action); padding-left: var(--s4); }
}
/* Phones: the label is visually hidden but stays the button's accessible name, so one row always fits. */
@media (max-width: 419px) {
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .menu-button { padding: 0; justify-content: center; }
  .header-cta { padding-left: var(--s3); padding-right: var(--s3); min-height: 44px; }
}
@media (max-width: 340px) { .wordmark { font-size: 1.02rem; } .wm-mark { width: 18px; height: 18px; } }
.breadcrumbs ol { padding-top: var(--s3); }

/* Buttons: one solid action colour, quiet secondary. */
.btn { border-radius: var(--radius); font-weight: 600; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--rule); }
.btn-secondary:hover { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn-on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-on-dark-solid { background: #fff; color: var(--text); border-color: #fff; }
.btn-on-dark-solid:hover { background: var(--action-soft); color: var(--text); border-color: var(--action-soft); }

/* Document previews keep a document feel; the interface around them does not. */
.doc { border-radius: 4px; border: 1px solid var(--border); border-top: 3px solid var(--text); box-shadow: var(--shadow-doc); }
.doc-title strong, .doc-preview .doc-h0, .doc-preview .doc-h1, .doc-preview .doc-h2, .mr-result h3.mr-doc-title { font-family: var(--font-doc); }
legend { font-family: var(--font-body); }
.steps li::before { font-family: var(--font-body); border-color: var(--rule); color: var(--text); background: var(--surface); }

/* Homepage hero: short promise left, the annotated sample quote right (directly below on phones). */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; gap: var(--s6); padding-top: var(--s6); padding-bottom: var(--s7); align-items: center; }
.hero-grid > * { min-width: 0; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s8); padding-top: var(--s8); padding-bottom: var(--s8); } }
.hero h1 { max-width: 15ch; margin-bottom: var(--s4); }
.hero-lede { font-size: 1.15rem; color: var(--muted); max-width: 44ch; margin-bottom: 0; }
.hero-actions { margin: var(--s5) 0 0; }
.sample-quote { margin: 0; }
.sample-quote table { font-size: 0.95rem; }
.sample-quote figcaption { margin-top: var(--s4); border-top: 1px solid var(--border); padding-top: var(--s3); font-size: 0.9rem; color: var(--muted); }
.sample-note { margin-bottom: var(--s2); font-weight: 600; color: var(--text); }
.annotations { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.annotations li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--s2); align-items: start; }
.note-pin { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--action); color: #fff;
  font: 700 0.72rem/1 var(--font-body); vertical-align: 1px; margin-left: 2px; }
.annotations .note-pin { margin: 1px 0 0; }

/* Homepage bands: each section has its own job and its own shape. */
.band { padding-top: var(--s8); padding-bottom: var(--s2); }
.band-lede { color: var(--muted); max-width: 60ch; font-size: 1.1rem; }
.band-foot { margin-top: var(--s5); font-weight: 600; }
.task-list { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; gap: var(--s4); }
@media (min-width: 860px) { .task-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); } }
.task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s5); display: flex; flex-direction: column; }
.task h3 { margin: 0 0 var(--s2); font-size: 1.2rem; }
.task > p:not(.task-step) { color: var(--muted); }
.task-step { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--action); margin-bottom: var(--s2); }
.task-links { list-style: none; padding: var(--s3) 0 0; margin: auto 0 0; border-top: 1px solid var(--border); display: grid; gap: var(--s2); }
.task-links a { font-weight: 600; }
.flow { list-style: none; padding: 0; margin: var(--s5) 0; display: grid; gap: var(--s4); }
@media (min-width: 760px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.flow-step { border-top: 2px solid var(--text); padding-top: var(--s3); }
.flow-step h3 { margin: var(--s2) 0 var(--s1); font-size: 1.05rem; }
.flow-step p { color: var(--muted); margin: 0; }
.flow-n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--action); }
.compare { display: grid; gap: var(--s4); margin-top: var(--s6); }
@media (min-width: 760px) { .compare { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.compare-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s5); }
.compare-col h3 { margin-top: 0; font-size: 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.compare-col ul { padding-left: 1.2rem; margin-bottom: var(--s3); }
.compare-col li { margin-bottom: var(--s2); }
.compare-col p { margin: 0; font-weight: 600; }
.deliver { display: grid; gap: var(--s6); }
@media (min-width: 900px) { .deliver { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s8); } }
.steps-compact li { margin-bottom: var(--s4); }
.checkable { background: var(--surface-2); border-radius: var(--radius); padding: var(--s5); }
.checkable ul { padding-left: 1.2rem; margin: 0; }
.checkable li { margin-bottom: var(--s2); }
.cta-band { background: var(--text); color: #e6edf0; border-radius: var(--radius); padding: var(--s6) var(--s5); }
@media (min-width: 720px) { .cta-band { padding: var(--s7); } }

/* Hub and directory rows */
.resource { padding: var(--s5) 0; }
.resource h3 { font-size: 1.15rem; }
.sample { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.sample table { margin: 0; }

/* Service: deliverables as labelled blocks, not a three-column table. */
.deliverables { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s4); }
@media (min-width: 760px) { .deliverables { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.deliverable { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4) var(--s5); }
.deliverable h3 { margin: 0 0 var(--s3); font-size: 1.15rem; }
.deliverable dl { margin: 0; display: grid; gap: var(--s3); }
.deliverable dt { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.deliverable dd { margin: 0; }

/* Tools: exports and the commercial invitation sit together under the result. */
.result-actions { margin-top: var(--s4); }
.result-actions .btn-row { margin: 0 0 var(--s3); }
.result-cta { border-top: 1px solid var(--border); padding-top: var(--s3); margin: 0; font-size: 0.95rem; }
.result-cta strong { display: block; }
.result-cta span { color: var(--muted); display: block; margin: 2px 0 var(--s1); }
.result-cta a { font-weight: 600; }
.edit-link { display: inline-block; margin: var(--s3) 0 0; min-height: 24px; line-height: 24px; font-weight: 600; }
@media (min-width: 64rem) { .edit-link { display: none; } }
.input-group-h { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: var(--s5) 0 var(--s2); }
.input-group-h:first-of-type { margin-top: var(--s2); }

/* Phones: a slim bar keeps the current figure in view while editing a long form. */
.result-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; background: var(--text); color: #fff;
  padding: var(--s2) var(--s4); padding-bottom: max(var(--s2), env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  box-shadow: 0 -4px 16px -8px rgba(21,43,53,.5); transition: transform .2s ease; }
.result-bar p { margin: 0; font-size: 0.95rem; min-width: 0; }
.result-bar [data-summary-value] { font-weight: 700; font-variant-numeric: tabular-nums; }
.result-bar a { color: #fff; font-weight: 700; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.result-bar.is-stale { background: var(--error); }
.result-bar.is-hidden { transform: translateY(110%); visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .result-bar { transition: none; } }
@media (min-width: 64rem) { .result-bar { display: none; } }
@media (max-width: 63.99rem) { body.has-result-bar .site-footer { padding-bottom: calc(var(--s6) + 64px); } }
/* A focused field is never left underneath the bar. */
@media (max-width: 63.99rem) { html:has(body.has-result-bar) { scroll-padding-bottom: 96px; } }
@media print { .result-bar, .result-cta, .edit-link, .menu-button { display: none !important; } }

/* Maintenance: a priority 1 sign needs a date a person sets. */
.mr-decide { color: var(--error); font-weight: 700; }

/* Headings wrap evenly instead of leaving one word on the last line. */
h1, h2, h3 { text-wrap: balance; }
/* Large text settings (200%) on phones: long words break instead of pushing the page sideways. */
h1, h2, h3, label, legend, dt { overflow-wrap: break-word; }
.sample td.num { white-space: normal; }
/* Radio buttons and checkboxes meet the 24px target size on their own, not only through their labels. */
input[type="radio"], input[type="checkbox"] { width: 24px; height: 24px; min-height: 24px; flex: none; }
