/* Paralegaless: a formal patent drawing sheet.
   Ink line art on a bright sheet; hierarchy by line weight and lettering scale only.
   Blue = construction (guides, focus, in progress). Red pencil = blockers only. */

@font-face {
  font-family: "Overpass";
  src: url("./assets/fonts/Overpass-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Overpass Mono";
  src: url("./assets/fonts/OverpassMono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --sheet: #ffffff;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --ink-3: #5f5f5f;
  --blue: #1d5c9c;
  --blue-line: #8fc3ea;
  --blue-wash: #eef6fd;
  --red: #bf261e;
  --red-wash: #fdf1f0;
  --w-hair: 0.5px;
  --w-thin: 1px;
  --w-part: 2px;
  --w-frame: 3px;
  --lettering: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --numerals: "Overpass Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 3vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { background: var(--sheet); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--lettering);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "kern";
  overflow-x: hidden;
}
::selection { background: var(--blue-line); color: var(--ink); }
input, textarea, select { caret-color: var(--blue); }
* { scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-3); border: 3px solid var(--sheet); }
:focus-visible { outline: var(--w-part) solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration-thickness: var(--w-thin); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img, svg { display: block; }
.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; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--sheet); }
.skip-link:focus { top: 12px; }
.skip-link:hover { color: var(--sheet); }

/* Numerals and measured quantities */
.num, .mono { font-family: var(--numerals); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.numeral { font-family: var(--numerals); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Lettering scale */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: 0; text-wrap: balance; }
h1, h2 { text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
h1 { font-size: clamp(2rem, 3.6vw, 3.3rem); line-height: 1.06; }
h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); line-height: 1.15; }
h3 { font-size: 1.15rem; line-height: 1.25; }
h4, .minor { font-size: 0.78rem; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
p { margin: 0; }
.measure { max-width: 68ch; }
.quiet { color: var(--ink-3); }
.small { font-size: 0.82rem; }

/* ---------- Sheet frame: header strip and title block ---------- */
.sheet-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: clamp(12px, 3vw, 32px);
  min-height: 60px; padding: 0 var(--gutter);
  background: var(--sheet);
  border-bottom: var(--w-part) solid var(--ink);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.95rem; }
.wordmark svg { width: 26px; height: 26px; }
.sheet-nav { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 28px); margin-left: auto; }
.sheet-nav a:not(.button):not(.balance), .sheet-nav .text-button { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: none; font-size: 0.86rem; font-weight: 600; }
.sheet-nav a:not(.button):not(.balance):hover, .sheet-nav a[aria-current="page"], .sheet-nav .text-button:hover { text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: 4px; }
.sheet-label { font-family: var(--numerals); font-size: 0.72rem; color: var(--ink-3); white-space: nowrap; }
.balance { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border: var(--w-thin) solid var(--ink); font-size: 0.8rem; text-decoration: none; white-space: nowrap; }
.sheet-nav a.balance { color: var(--ink); }
.balance strong { font-family: var(--numerals); font-size: 0.95rem; }
.sheet-nav a.balance.empty { border-color: var(--red); color: var(--red); }

.title-block {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  margin: 0 var(--gutter) var(--gutter); border: var(--w-part) solid var(--ink);
  font-size: 0.78rem;
}
.title-block > div { padding: 10px 12px; border-left: var(--w-thin) solid var(--ink); }
.title-block > div:first-child { border-left: 0; }
.title-block span { display: block; color: var(--ink-3); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.title-block a { color: var(--ink); }

/* ---------- Controls ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px;
  border: var(--w-part) solid var(--ink); background: var(--ink); color: var(--sheet);
  font-weight: 800; font-size: 0.86rem; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.button:hover { background: var(--blue); border-color: var(--blue); color: var(--sheet); }
.button.outline { background: transparent; color: var(--ink); }
.button.outline:hover { background: var(--blue-wash); border-color: var(--blue); color: var(--blue); }
.button.small { min-height: 34px; padding: 0 12px; font-size: 0.74rem; }
.button:disabled, .button[aria-disabled="true"] { background: var(--sheet); border-color: var(--ink-3); border-style: dashed; color: var(--ink-3); cursor: not-allowed; }
.button .numeral { font-size: 0.8em; opacity: 0.8; }
.text-link { padding: 0; border: 0; background: none; color: var(--blue); font-weight: 700; font-size: 0.8rem; text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--ink); }

/* Title-block fields: a ruled cell with its label lettered inside, as on a drawing's title block. */
.field { position: relative; display: flex; flex-direction: column; min-width: 0; border: var(--w-thin) solid var(--ink); background: var(--sheet); }
.field > span { padding: 6px 10px 0; color: var(--ink-2); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.01em; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 40px; padding: 4px 10px 8px; border: 0; background: transparent; color: var(--ink); font-size: 0.95rem; outline: 0;
}
.field textarea { resize: vertical; line-height: 1.45; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field:focus-within { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); z-index: 1; }
.field:focus-within > span { color: var(--blue); }
.field input::placeholder, .field textarea::placeholder { color: #767676; }
.field.check { flex-direction: row; align-items: center; gap: 10px; padding: 10px; }
.field.check > span { padding: 0; font-size: 0.82rem; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); }
.field.check input { width: 18px; min-height: 18px; margin: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; }
.fields > .field { margin: 0 -1px -1px 0; }
.fields > .wide { grid-column: 1 / -1; }

/* Status lettering: outlined, never filled pills. */
.status { display: inline-flex; align-items: center; min-height: 22px; padding: 1px 7px; border: var(--w-thin) solid currentColor; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.status.filed, .status.done, .status.ok { color: var(--ink); }
.status.draft, .status.progress { color: var(--blue); }
.status.action { color: var(--ink-2); border-style: dashed; }
.status.blocked { color: var(--red); }
.status.muted { color: var(--ink-3); }

/* Copy state */
.copy-state { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--ink-3); text-decoration: none; }
.copy-state::before { content: ""; flex: none; width: 7px; height: 7px; border: var(--w-thin) solid currentColor; }
.copy-state.ready { color: var(--ink); }
.copy-state.ready::before { background: var(--ink); }
a.copy-state.ready { text-decoration: underline; text-decoration-color: var(--blue-line); }
.copy-state.missing { color: var(--red); }
.attach-button { display: inline-flex; margin-top: 4px; padding: 2px 8px; border: var(--w-thin) dashed var(--red); background: var(--sheet); color: var(--red); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.attach-button:hover { background: var(--red-wash); }
.attach-button:focus-within { outline: var(--w-part) solid var(--blue); outline-offset: 2px; }
.copy-actions { display: grid; justify-items: start; gap: 5px; min-width: 170px; }
.copy-actions .attach-button { margin-top: 0; }
.translation-note { display: block; max-width: 30ch; color: var(--ink-3); font-size: 0.72rem; }
/* Misregistration: a value that disagrees with its source prints offset in red beside the entered one. */
.lookup-warning { display: block; margin-top: 4px; color: var(--red); font-size: 0.74rem; font-weight: 600; text-shadow: 1.5px 1px 0 rgba(191, 38, 30, 0.2); }

/* Tables: ruled like the SB/08's own grid. */
.table-wrap { width: 100%; overflow-x: auto; border-top: var(--w-part) solid var(--ink); border-bottom: var(--w-part) solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { padding: 8px 10px; text-align: left; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); border-bottom: var(--w-thin) solid var(--ink); white-space: nowrap; }
td { padding: 10px; border-bottom: var(--w-hair) solid var(--ink-3); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--blue-wash); }
td.num, th.num { text-align: right; }
.cell-main strong { display: block; font-weight: 700; }
.cell-main span { display: block; max-width: 44ch; color: var(--ink-3); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 28px 10px; color: var(--ink-3); font-size: 0.9rem; }

/* Toast: a note pinned to the sheet margin. */
.toast { position: fixed; right: var(--gutter); bottom: var(--gutter); z-index: 60; max-width: min(440px, calc(100vw - 32px)); padding: 12px 14px; background: var(--sheet); border: var(--w-part) solid var(--ink); font-size: 0.86rem; }

/* ---------- Landing ---------- */
.fig-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: clamp(20px, 4vw, 64px); align-items: center; min-height: calc(100vh - 62px); padding: clamp(20px, 4vw, 48px) var(--gutter); border-bottom: var(--w-part) solid var(--ink); }
.figure { position: relative; margin: 0; }
.figure svg { width: 100%; height: auto; overflow: visible; }
.figure figcaption { margin-top: 6px; font-weight: 900; letter-spacing: 0.12em; font-size: 1rem; text-align: center; }
.fig-text { display: grid; gap: 22px; align-content: center; }
.claim { display: grid; gap: 12px; }
.para { display: grid; grid-template-columns: 4.2em 1fr; gap: 8px; font-size: 1.02rem; color: var(--ink-2); }
.para .numeral { color: var(--ink); font-size: 0.82rem; padding-top: 3px; }
.ref { font-family: var(--numerals); font-weight: 600; color: var(--ink); border-bottom: var(--w-thin) dotted var(--ink-3); cursor: default; }
.ref:hover, .ref.on, .ref:focus-visible { color: var(--blue); border-bottom: var(--w-thin) solid var(--blue); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.fee-note { font-family: var(--numerals); font-size: 0.78rem; color: var(--ink-2); }

/* FIG. 1 drawing */
.part { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transition: stroke 0.25s var(--ease-out), stroke-width 0.25s var(--ease-out); }
.part.thin { stroke-width: 1; }
.part.hatch { stroke-width: 0.75; }
.flow { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.arrowhead { fill: var(--ink); stroke: none; }
.leader { fill: none; stroke: var(--ink); stroke-width: 1; transition: stroke 0.25s var(--ease-out); }
.guide { fill: none; stroke: var(--blue-line); stroke-width: 0.75; stroke-dasharray: 4 5; }
.numeral-label { font-family: var(--numerals); font-weight: 600; font-size: 17px; fill: var(--ink); transition: fill 0.25s var(--ease-out); }
.fig-lettering { font-family: var(--lettering); font-weight: 800; font-size: 11px; letter-spacing: 0.1em; fill: var(--ink-2); }
.part-group.on .part, .part-group.on .leader { stroke: var(--blue); }
.part-group.on .part { stroke-width: 2.6; }
.part-group.on .numeral-label { fill: var(--blue); }
.drawing .part, .drawing .flow, .drawing .leader { stroke-dasharray: var(--len, 1400); stroke-dashoffset: 0; }
.drawing.drawing-in .part, .drawing.drawing-in .flow, .drawing.drawing-in .leader { animation: draw 1.6s var(--ease-out) both; animation-delay: var(--delay, 0s); }
.drawing.drawing-in .numeral-label, .drawing.drawing-in .arrowhead { animation: letter 0.5s var(--ease-out) both; animation-delay: calc(var(--delay, 0s) + 0.9s); }
@keyframes draw { from { stroke-dashoffset: var(--len, 1400); } to { stroke-dashoffset: 0; } }
@keyframes letter { from { opacity: 0; } to { opacity: 1; } }

.band { padding: clamp(48px, 7vw, 104px) var(--gutter); border-bottom: var(--w-part) solid var(--ink); scroll-margin-top: 62px; }
.band-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 64px); align-items: end; margin-bottom: clamp(28px, 4vw, 48px); }
.band-head p { color: var(--ink-2); font-size: 1.05rem; }

.stages { display: grid; border-top: var(--w-part) solid var(--ink); }
.stage { display: grid; grid-template-columns: 6.5rem minmax(0, 0.9fr) minmax(0, 1.3fr); gap: clamp(16px, 3vw, 40px); padding: clamp(20px, 3vw, 32px) 0; border-bottom: var(--w-thin) solid var(--ink); }
.stage > .numeral { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 0.9; font-weight: 500; }
.stage h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); }
.stage h3 + p { margin-top: 8px; color: var(--ink-3); font-size: 0.9rem; }
.stage-detail { display: grid; gap: 10px; color: var(--ink-2); }
.stage .para { font-size: 0.95rem; }

.estimate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: start; }
.estimate .fields { grid-template-columns: 1fr 1fr; }
.estimate-result { border: var(--w-part) solid var(--ink); }
.estimate-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: baseline; padding: 12px 16px; border-bottom: var(--w-thin) solid var(--ink); }
.estimate-row:last-child { border-bottom: 0; }
.estimate-row .num { font-size: 1.15rem; font-weight: 600; }
.estimate-row small { display: block; color: var(--ink-3); font-size: 0.76rem; }
.estimate-row.total { background: var(--ink); color: var(--sheet); }
.estimate-row.total small { color: #cfcfcf; }
.estimate-row.total .num { font-size: 1.6rem; }
.assumption { margin-top: 10px; font-size: 0.8rem; color: var(--ink-3); }

.fee-schedule.codes td:first-child { font-family: var(--numerals); white-space: nowrap; }
.fee-schedule td.num { font-family: var(--numerals); font-size: 1rem; font-weight: 600; white-space: nowrap; }
.pricing-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 22px; }

.limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(20px, 4vw, 56px); margin: 0; padding: 0; list-style: none; border-top: var(--w-part) solid var(--ink); }
.limits li { padding: 14px 0; border-bottom: var(--w-thin) solid var(--ink); color: var(--ink-2); }
.limits strong { color: var(--ink); }

.plan-note { margin-top: 16px; }
.closing-note { margin-top: 8px; }
.title-block b { font-weight: 600; font-size: 0.8rem; }
.closing { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: clamp(24px, 5vw, 80px); align-items: center; min-height: calc(100vh - 62px); padding: clamp(24px, 5vw, 64px) var(--gutter); }
.auth-form { display: grid; gap: 18px; }
.auth-form .fields { grid-template-columns: 1fr; }
.auth-switch { font-size: 0.9rem; }
.form-error { color: var(--red); font-size: 0.86rem; font-weight: 600; min-height: 1.3em; }

/* ---------- App shell: the step figure ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-content: start; min-height: calc(100vh - 62px); }
.step-rail { position: sticky; top: 62px; align-self: start; height: calc(100vh - 62px); padding: 24px 0 24px var(--gutter); border-right: var(--w-part) solid var(--ink); }
.step-rail ol { position: relative; display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.step-rail ol::before { content: ""; position: absolute; left: 25px; top: 20px; bottom: 20px; border-left: var(--w-thin) solid var(--ink); }
.step-link { position: relative; display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 4px; width: 100%; padding: 10px 14px 10px 0; border: 0; background: none; text-align: left; color: var(--ink); }
.step-link .node { position: relative; z-index: 1; display: grid; place-items: center; width: 52px; height: 34px; background: var(--sheet); border: var(--w-part) solid var(--ink); font-family: var(--numerals); font-weight: 600; font-size: 0.9rem; }
.step-link .step-name { padding-left: 10px; font-weight: 700; font-size: 0.9rem; line-height: 1.2; }
.step-link .step-name small { display: block; margin-top: 2px; color: var(--ink-3); font-weight: 500; font-size: 0.74rem; }
.step-link[aria-current="step"] .node { background: var(--ink); color: var(--sheet); }
.step-link[aria-current="step"] .step-name { text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: 4px; }
.step-link.blocked .node { border-color: var(--red); color: var(--red); }
.step-link.blocked[aria-current="step"] .node { background: var(--red); color: var(--sheet); }
.step-link.blocked .step-name small { color: var(--red); }
.step-link.done .node::after { content: ""; position: absolute; right: -6px; top: -6px; width: 11px; height: 11px; background: var(--ink); border: var(--w-part) solid var(--sheet); border-radius: 50%; }
.step-link:hover .node { border-color: var(--blue); }
.step-link:disabled { cursor: not-allowed; color: var(--ink-3); }
.step-link:disabled .node { border-style: dashed; border-color: var(--ink-3); color: var(--ink-3); }
.rail-foot { position: absolute; left: var(--gutter); right: 16px; bottom: 24px; display: grid; gap: 6px; font-size: 0.78rem; color: var(--ink-3); }

.stage-panel { padding: clamp(20px, 3vw, 36px) var(--gutter) 72px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 24px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: var(--w-part) solid var(--ink); }
.panel-head .title { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: baseline; }
.panel-head .title > .numeral { font-size: 2.2rem; line-height: 1; font-weight: 500; }
.panel-head h1, .page-head h1 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.08; }
.panel-head p { margin-top: 6px; color: var(--ink-2); max-width: 64ch; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; padding-top: 18px; border-top: var(--w-thin) solid var(--ink); }

.matter-line { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 0 0 14px; margin-bottom: 18px; border-bottom: var(--w-thin) solid var(--ink); font-size: 0.86rem; }
.matter-line div span { display: block; color: var(--ink-3); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.matter-line strong { font-weight: 700; }

.mode-switch { display: inline-flex; border: var(--w-part) solid var(--ink); margin-bottom: 18px; }
.mode-switch button { min-height: 38px; padding: 0 16px; border: 0; border-left: var(--w-thin) solid var(--ink); background: var(--sheet); font-weight: 700; font-size: 0.82rem; }
.mode-switch button:first-child { border-left: 0; }
.mode-switch button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.intake-note { margin: 14px 0 18px; color: var(--ink-2); font-size: 0.92rem; max-width: 72ch; }
.manual-grid.fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.manual-grid textarea { font-family: var(--numerals); font-size: 0.85rem; min-height: 160px; }
.intake-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.filter-tabs { display: inline-flex; flex-wrap: wrap; border: var(--w-thin) solid var(--ink); }
.filter-tabs button { min-height: 32px; padding: 0 12px; border: 0; border-left: var(--w-thin) solid var(--ink); background: var(--sheet); font-size: 0.78rem; font-weight: 700; }
.filter-tabs button:first-child { border-left: 0; }
.filter-tabs button span { font-family: var(--numerals); font-weight: 500; margin-left: 4px; }
.filter-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.search-field { display: flex; min-width: min(260px, 100%); border: var(--w-thin) solid var(--ink); }
.search-field input { width: 100%; min-height: 32px; padding: 0 10px; border: 0; outline: 0; background: transparent; font-size: 0.84rem; }
.search-field:focus-within { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.selection-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; margin-bottom: 10px; border: var(--w-thin) solid var(--blue); background: var(--blue-wash); font-size: 0.84rem; }
.check-column { width: 36px; }
.row-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: var(--w-thin) solid var(--ink); background: var(--sheet); }
.row-button svg { width: 14px; height: 14px; }
.row-button:hover { border-color: var(--blue); color: var(--blue); }
.type-tag { font-family: var(--numerals); font-size: 0.72rem; white-space: nowrap; }

/* SB/08 editor */
.sb08-editor .minor { margin: 28px 0 10px; }
.sb08-editor > .minor:first-child { margin-top: 0; }
.field-row { padding: 14px 0; border-top: var(--w-thin) solid var(--ink); }
.field-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; font-size: 0.9rem; }
.field-row-head .text-link { margin-left: auto; }
.editor-help { margin-top: 8px; color: var(--ink-3); font-size: 0.8rem; }

.checklist { display: grid; border: var(--w-part) solid var(--ink); }
.checklist label { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 12px 14px; border-bottom: var(--w-thin) solid var(--ink); cursor: pointer; }
.checklist label:last-child { border-bottom: 0; }
.checklist input { width: 18px; height: 18px; margin-top: 2px; }
.checklist strong { display: block; font-size: 0.9rem; }
.checklist small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 0.8rem; }
.checklist label.fail strong, .checklist label.fail small { color: var(--red); }
.count-field { margin: 0 0 20px; }
.cert-editor .fields { grid-template-columns: 1fr 1fr; }
.charge-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 12px 14px; border: var(--w-thin) solid var(--ink); font-size: 0.92rem; }
.charge-line .num { font-weight: 600; }
.charge-line.blocked { border-color: var(--red); color: var(--red); }
.dialog-warning { min-height: 1.4em; margin-top: 14px; color: var(--red); font-weight: 600; font-size: 0.88rem; }
.dialog-warning.ok { color: var(--ink); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.two-col h4, .two-col .minor { margin-bottom: 10px; }

.packet-sheet { display: grid; grid-template-columns: auto 1fr; gap: 16px 24px; align-items: start; padding: 24px; margin-bottom: 24px; border: var(--w-frame) double var(--ink); }
.packet-sheet svg { width: 72px; height: 90px; }
.packet-sheet h3 { font-size: 1.4rem; }
.packet-sheet p { margin-top: 6px; color: var(--ink-2); }
.packet-sheet .cta-row { margin-top: 16px; }
.reference-review { margin-bottom: 28px; }
.reference-review-head, .combined-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; padding: 16px; border: var(--w-thin) solid var(--ink); }
.reference-review-head p { margin-top: 4px; color: var(--ink-2); font-size: 0.86rem; }
.reference-review-head .minor { margin: 0; }
.pdf-preview { display: block; width: 100%; height: min(68vh, 720px); min-height: 420px; border: 0; border-right: var(--w-thin) solid var(--ink); border-left: var(--w-thin) solid var(--ink); background: var(--paper); }
.combined-actions > div { display: grid; max-width: 680px; gap: 3px; }
.combined-actions small { color: var(--ink-2); font-size: 0.8rem; }
.reference-review .dialog-warning { margin: 8px 0 0; }
.next-steps { display: grid; margin: 0; padding: 0; list-style: none; border-top: var(--w-part) solid var(--ink); }
.next-steps li { display: grid; grid-template-columns: 3.4rem 1fr; gap: 10px; padding: 12px 0; border-bottom: var(--w-thin) solid var(--ink); color: var(--ink-2); }
.next-steps .numeral { color: var(--ink); }

/* Native dialog supplies focus containment, Escape, and focus restoration. */
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100vw); max-width: 100%; height: 100dvh; max-height: 100dvh; padding: 28px; overflow-y: auto; color: var(--ink); background: var(--sheet); border: 0; border-left: var(--w-part) solid var(--ink); }
.drawer::backdrop { background: rgba(17, 17, 17, 0.18); }
.drawer-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: var(--w-thin) solid var(--ink); background: var(--sheet); }
.drawer-close svg { width: 14px; height: 14px; }
.drawer h2 { margin: 0 44px 14px 0; font-size: 1.5rem; }
.upload-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 26px; overflow: auto; color: var(--ink); background: var(--sheet); border: var(--w-frame) double var(--ink); }
.upload-dialog::backdrop { background: rgba(17, 17, 17, 0.35); }
.upload-dialog h2 { margin: 0 44px 4px 0; }
.upload-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.upload-choice { min-height: 190px; padding: 18px; border: var(--w-thin) solid var(--ink); }
.upload-choice h3 { margin: 12px 0 4px; font-size: 1rem; }
.upload-choice p { margin-bottom: 16px; color: var(--ink-2); font-size: 0.84rem; }
.drop-zone { border-style: dashed; cursor: pointer; }
.drop-zone.dragging { color: var(--blue); border-color: var(--blue); background: var(--blue-wash); }
.detail-section { margin-top: 22px; }
.detail-section h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: var(--w-thin) solid var(--ink); border-left: var(--w-thin) solid var(--ink); }
.detail-grid > div { padding: 8px 10px; border-right: var(--w-thin) solid var(--ink); border-bottom: var(--w-thin) solid var(--ink); }
.detail-grid span { display: block; font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; }
.provenance { display: grid; gap: 10px; }
.provenance-step { display: grid; gap: 2px; padding-left: 14px; border-left: var(--w-part) solid var(--ink); font-size: 0.86rem; overflow-wrap: anywhere; }
.provenance-step small { color: var(--ink-2); }
.raw-citation { padding: 12px; border: var(--w-thin) dashed var(--ink-3); font-family: var(--numerals); font-size: 0.78rem; overflow-wrap: anywhere; }

/* ---------- Account and admin ---------- */
.page { padding: clamp(20px, 3vw, 40px) var(--gutter) 72px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; padding-bottom: 18px; margin-bottom: 28px; border-bottom: var(--w-part) solid var(--ink); }
.page-head p { margin-top: 6px; color: var(--ink-2); }
.section { margin-bottom: clamp(40px, 5vw, 60px); scroll-margin-top: 80px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.section-head p { color: var(--ink-3); font-size: 0.86rem; margin-top: 4px; }
.split { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.6fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.statement { display: grid; border: var(--w-part) solid var(--ink); }
.statement > div { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 12px 14px; border-bottom: var(--w-thin) solid var(--ink); }
.statement > div:last-child { border-bottom: 0; }
.statement small { display: block; color: var(--ink-3); font-size: 0.76rem; }
.statement .num { font-size: 1.25rem; font-weight: 600; }
.statement .lead .num { font-size: 2rem; }
.statement .lead.empty .num { color: var(--red); }
.buy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.qty { display: inline-flex; border: var(--w-thin) solid var(--ink); }
.qty button { width: 34px; min-height: 34px; border: 0; background: var(--sheet); font-family: var(--numerals); font-weight: 600; }
.qty button:hover { background: var(--blue-wash); }
.qty output { display: grid; place-items: center; min-width: 38px; border-left: var(--w-thin) solid var(--ink); border-right: var(--w-thin) solid var(--ink); font-family: var(--numerals); font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sub { display: block; color: var(--ink-3); font-size: 0.74rem; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: var(--w-part) solid var(--ink); overflow: hidden; margin-bottom: 28px; }
.stat-strip > div { padding: 12px 14px; border-right: var(--w-thin) solid var(--ink); border-bottom: var(--w-thin) solid var(--ink); margin: 0 -1px -1px 0; }
.stat-strip span { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.stat-strip strong { display: block; font-family: var(--numerals); font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-strip small { display: block; color: var(--ink-3); font-size: 0.74rem; }
.analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 10px 0 30px; }
.analysis-card { border-top: var(--w-part) solid var(--ink); border-bottom: var(--w-thin) solid var(--ink); }
.analysis-card h3 { padding: 10px 0 8px; font-size: 0.86rem; }
.analysis-card dl { margin: 0; }
.analysis-card dl > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 0; border-top: var(--w-hair) solid var(--ink-3); }
.analysis-card dt { color: var(--ink-2); font-size: 0.78rem; }
.analysis-card dd { margin: 0; font-family: var(--numerals); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.chart-frame { position: relative; border: var(--w-part) solid var(--ink); padding: 14px 14px 6px; margin-bottom: 28px; }
.chart { width: 100%; height: 180px; overflow: visible; }
.chart .bar { fill: var(--ink); }
.chart .bar:hover, .chart .bar:focus { fill: var(--blue); outline: 0; }
.chart .axis { stroke: var(--ink); stroke-width: 1; }
.chart .gridline { stroke: var(--blue-line); stroke-width: 0.75; stroke-dasharray: 3 4; }
.chart text { font-family: var(--numerals); font-size: 10px; fill: var(--ink-3); }
.chart-tip { position: absolute; pointer-events: none; padding: 4px 8px; background: var(--sheet); border: var(--w-thin) solid var(--ink); font-family: var(--numerals); font-size: 0.74rem; white-space: nowrap; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.customer-detail { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; border: var(--w-part) solid var(--ink); padding: 18px; }
.customer-detail h3 { margin-bottom: 4px; overflow-wrap: anywhere; }
.adjust-form { display: grid; gap: 12px; margin: 18px 0; padding: 14px; border: var(--w-thin) dashed var(--ink); }
.adjust-form .fields { grid-template-columns: 1fr 1fr; }
tr.selected td { background: var(--blue-wash); }
tbody tr[data-customer] { cursor: pointer; }
.delta-plus { color: var(--ink); }
.delta-minus { color: var(--ink); }
.notice { padding: 12px 14px; border: var(--w-thin) solid var(--blue); background: var(--blue-wash); font-size: 0.86rem; color: var(--ink-2); margin-bottom: 18px; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .fig-hero { grid-template-columns: 1fr; min-height: 0; }
  .band-head, .estimate, .split, .admin-grid, .two-col { grid-template-columns: 1fr; }
  .customer-detail { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .analysis-grid { grid-template-columns: 1fr; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .step-rail { position: sticky; top: 60px; z-index: 10; height: auto; padding: 8px var(--gutter); background: var(--sheet); border-right: 0; border-bottom: var(--w-part) solid var(--ink); overflow-x: auto; }
  .step-rail ol { display: flex; gap: 6px; }
  .step-rail ol::before { left: 20px; right: 20px; top: 17px; bottom: auto; border-left: 0; border-top: var(--w-thin) solid var(--ink); }
  .step-link { grid-template-columns: auto; gap: 2px; padding: 0 4px; justify-items: center; }
  .step-link .step-name { padding: 0; font-size: 0.72rem; text-align: center; white-space: nowrap; }
  .step-link .step-name small, .rail-foot { display: none; }
  .stage { grid-template-columns: 4rem 1fr; }
  .stage > .stage-detail { grid-column: 2; }
  .manual-grid.fields { grid-template-columns: 1fr 1fr; }
  .title-block { grid-template-columns: 1fr 1fr; }
  .title-block > div:nth-child(3) { border-left: 0; }
  .title-block > div:nth-child(n+3) { border-top: var(--w-thin) solid var(--ink); }
  .limits { grid-template-columns: 1fr; }
  .closing { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .sheet-header { flex-wrap: wrap; gap: 8px 14px; padding-top: 10px; padding-bottom: 10px; }
  .sheet-nav { width: 100%; margin-left: 0; justify-content: space-between; }
  .sheet-nav .hide-sm { display: none; }
  .sheet-label { margin-left: auto; }
  .auth { grid-template-columns: 1fr; }
  .manual-grid.fields, .estimate .fields, .adjust-form .fields { grid-template-columns: 1fr; }
  .para { grid-template-columns: 3.4em 1fr; }
  .panel-head .title { grid-template-columns: 1fr; gap: 4px; }
  .detail-grid { grid-template-columns: 1fr; }
  .packet-sheet { grid-template-columns: 1fr; }
  .upload-choices { grid-template-columns: 1fr; }
}
.fig-text h1 span { display: block; }
.two-col .spaced { margin-top: 24px; }
details summary { cursor: pointer; margin-bottom: 10px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.customer-detail h4 { margin: 18px 0 8px; }
.customer-detail h4.spaced { margin-top: 22px; }
.qty svg { width: 12px; height: 12px; margin: auto; }
@media (max-width: 1000px) { .refs-table .col-source { display: none; } }
/* Phones: each reference becomes a stacked entry instead of a scrolling table row. */
@media (max-width: 700px) {
  .refs-table thead { display: none; }
  .refs-table tbody tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) 34px; column-gap: 8px; padding: 10px 0; border-bottom: var(--w-hair) solid var(--ink-3); }
  .refs-table td { padding: 2px 0; border: 0; }
  .refs-table td:nth-child(1) { grid-row: 1 / span 4; }
  .refs-table td:nth-child(2) { grid-column: 2; }
  .refs-table td:nth-child(7) { grid-column: 3; grid-row: 1; }
  .refs-table td:nth-child(3), .refs-table td:nth-child(5), .refs-table td:nth-child(6) { grid-column: 2; }
  .refs-table .cell-main span { white-space: normal; }
  .cert-editor .fields { grid-template-columns: 1fr; }
}
td.mono { white-space: nowrap; }
.fig-label { display: block; margin-top: 14px; font-weight: 800; letter-spacing: 0.12em; font-size: 0.8rem; }
.step-rail .fig-label { margin-left: 4px; }
.chart-frame .fig-label { text-align: center; margin-top: 2px; }
@media (max-width: 700px) { .col-joined, .col-plan { display: none; } .step-rail .fig-label { display: none; } }

/* ---------- Left pane: sections of Account and Admin ---------- */
.side-pane { position: sticky; top: 62px; align-self: start; height: calc(100vh - 62px); padding: 24px 16px 24px var(--gutter); border-right: var(--w-part) solid var(--ink); }
.side-title { margin: 4px 0 12px; color: var(--ink-3); }
.side-nav { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; border-top: var(--w-thin) solid var(--ink); }
.side-nav a { display: block; padding: 10px 12px; border-bottom: var(--w-thin) solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.92rem; }
.side-nav a:hover { background: var(--blue-wash); color: var(--blue); }
.side-nav a[aria-current="page"] { background: var(--ink); color: var(--sheet); }
.side-pane .rail-foot { display: grid; gap: 12px; justify-items: start; overflow-wrap: anywhere; }
.section-minor { margin-bottom: 10px; }
.chart-note { margin: -4px 0 10px; }
.profile-form { max-width: 560px; }
@media (max-width: 860px) {
  .side-pane { position: sticky; top: 60px; z-index: 10; height: auto; padding: 8px var(--gutter); background: var(--sheet); border-right: 0; border-bottom: var(--w-part) solid var(--ink); overflow-x: auto; }
  .side-title, .side-pane .rail-foot { display: none; }
  .side-nav { display: flex; gap: 0; border-top: 0; border-left: var(--w-thin) solid var(--ink); width: max-content; }
  .side-nav a { padding: 8px 12px; border: var(--w-thin) solid var(--ink); border-left: 0; white-space: nowrap; font-size: 0.82rem; }
}
@media (max-width: 620px) { td.mono { white-space: normal; } }

/* Fee calculator (stage 40) */
.fee-fields { grid-template-columns: 1fr 1fr; }
.fee-breakdown { display: grid; margin-top: 12px; border: var(--w-part) solid var(--ink); }
.fee-breakdown > div { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 10px 12px; border-bottom: var(--w-thin) solid var(--ink); font-size: 0.88rem; }
.fee-breakdown > div:last-child { border-bottom: 0; }
.fee-breakdown small { display: block; color: var(--ink-3); font-size: 0.74rem; }
.fee-breakdown .total { background: var(--ink); color: var(--sheet); }
.fee-breakdown .total small { color: #cfcfcf; }
.fee-breakdown .num { font-weight: 600; }
@media (max-width: 620px) { .fee-fields { grid-template-columns: 1fr; } }

/* Family detection and suggested references (stage 20) */
.family-panel { margin-bottom: 22px; border: var(--w-part) solid var(--ink); }
.family-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 14px 16px; }
.family-head p { margin-top: 4px; max-width: 78ch; }
#familyResult { padding: 0 16px 16px; }
.family-members { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 0.86rem; }
.family-members .sub { flex-basis: 100%; }
.family-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.family-actions .button { margin-left: auto; }
.family-table { max-height: 420px; overflow-y: auto; }
.family-table td { font-size: 0.8rem; }

/* Feedback program (account) */
.feedback-status { max-width: 520px; margin-bottom: 22px; }
.feedback-form { display: grid; gap: 14px; max-width: 720px; margin-bottom: 26px; padding: 18px; border: var(--w-thin) dashed var(--ink); }
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 0; padding: 0; border: 0; }
.rating legend { width: 100%; margin-bottom: 8px; font-weight: 700; font-size: 0.9rem; }
.rating label { position: relative; }
.rating input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rating span { display: grid; place-items: center; width: 44px; height: 40px; border: var(--w-thin) solid var(--ink); margin-left: -1px; font-family: var(--numerals); font-weight: 600; }
.rating input:checked + span { background: var(--ink); color: var(--sheet); }
.rating input:focus-visible + span { outline: var(--w-part) solid var(--blue); outline-offset: 2px; }
.spaced-top { margin-top: 8px; }

/* Landing: trust sections */
.made-by { font-size: 0.86rem; color: var(--ink-2); max-width: 60ch; }
.sample { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.sample-sheet { margin: 0; padding: 14px; border: var(--w-frame) double var(--ink); background: var(--sheet); }
.sample-sheet img { width: 100%; height: auto; border: var(--w-thin) solid var(--ink-3); }
.sample-sheet figcaption { margin-top: 10px; text-align: center; font-weight: 800; letter-spacing: 0.12em; font-size: 0.8rem; }
.deliverables { display: grid; margin: 0; padding: 0; list-style: none; border-top: var(--w-part) solid var(--ink); }
.deliverables li { display: grid; grid-template-columns: 3.4rem 1fr; gap: 10px; padding: 16px 0; border-bottom: var(--w-thin) solid var(--ink); color: var(--ink-2); }
.deliverables strong { color: var(--ink); }
.founder { display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.founder-card { border: var(--w-part) solid var(--ink); }
.founder-name { padding: 16px; border-bottom: var(--w-part) solid var(--ink); font-size: 1.35rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.founder-name span { font-size: 1rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.founder-facts { margin: 0; }
.founder-facts > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 12px; padding: 12px 16px; border-bottom: var(--w-thin) solid var(--ink); }
.founder-facts > div:last-child { border-bottom: 0; }
.founder-facts dt { color: var(--ink-3); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 2px; }
.founder-facts dd { margin: 0; }
h3.minor { margin-bottom: 10px; }
.limits.single { grid-template-columns: 1fr; }
.faq { border-top: var(--w-part) solid var(--ink); }
.faq details { border-bottom: var(--w-thin) solid var(--ink); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 700; font-size: 1.02rem; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; margin-top: 6px; border-right: var(--w-part) solid var(--ink); border-bottom: var(--w-part) solid var(--ink); transform: rotate(45deg); transition: transform 0.2s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { max-width: 72ch; padding: 0 0 16px; color: var(--ink-2); }
.contact-form { display: grid; gap: 14px; max-width: 820px; }
.contact-form .fields { grid-template-columns: 1fr 1fr; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error.ok { color: var(--ink); }
.title-block .disclaimer { grid-column: 1 / -1; margin: 0; padding: 12px; border-top: var(--w-thin) solid var(--ink); color: var(--ink-2); font-size: 0.78rem; }
@media (max-width: 1100px) { .sample, .founder { grid-template-columns: 1fr; } .sample-sheet { max-width: 620px; } }
@media (max-width: 620px) { .contact-form .fields { grid-template-columns: 1fr; } .founder-facts > div { grid-template-columns: 1fr; gap: 2px; } }

/* Message threads (account and admin) */
.threads { display: grid; gap: 16px; margin-top: 24px; }
.thread { border: var(--w-part) solid var(--ink); padding: 14px; }
.thread header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.post { padding: 10px 0; border-top: var(--w-thin) solid var(--ink-3); }
.post p { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post.operator { padding: 10px 12px; background: var(--blue-wash); }
.reply-form { display: grid; gap: 8px; margin-top: 10px; justify-items: start; }
.reply-form .field { width: 100%; }
.side-nav .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; background: var(--red); color: var(--sheet); font-family: var(--numerals); font-size: 0.72rem; }
.form-source { border-top: 0; }
.attach-button.ink { border-style: solid; border-color: var(--ink); color: var(--ink); }
.attach-button.ink:hover { background: var(--blue-wash); border-color: var(--blue); color: var(--blue); }

/* Manual */
pre.raw-citation { margin: 14px 0; overflow-x: auto; }

/* Email confirmation, data export and account closure */
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px; padding: 10px var(--gutter); background: var(--blue-wash); border-bottom: var(--w-thin) solid var(--blue); font-size: 0.86rem; color: var(--ink-2); }
.verify-banner strong { color: var(--ink); }
.section-minor.spaced { margin-top: 34px; }
.button.outline.danger { border-color: var(--red); color: var(--red); }
.button.outline.danger:hover { background: var(--red-wash); border-color: var(--red); color: var(--red); }
#emailState { max-width: 72ch; }

/* Legal documents: long-form reading rhythm, since margins are reset globally */
[data-legal] .section-minor { margin: 32px 0 10px; }
[data-legal] p + p, [data-legal] p + .limits, [data-legal] p + .next-steps, [data-legal] .limits + p { margin-top: 12px; }
[data-legal] .limits.single li { padding: 10px 0; }
[data-legal] .page-head { margin-bottom: 8px; }
/* The plan note carries a sentence, not a label: let it wrap instead of clipping */
#planNote { max-width: 46ch; white-space: normal; overflow: visible; text-overflow: clip; }

/* Stage 10: dropping reference PDFs you already have */
.reference-drop { display: grid; gap: 4px; padding: 18px; margin-top: -1px; border: var(--w-thin) dashed var(--ink); background: var(--sheet); text-align: left; }
.reference-drop span { color: var(--ink-2); font-size: 0.84rem; }
.reference-drop:hover, .reference-drop:focus-visible { border-color: var(--blue); color: var(--blue); }
.drop-report { margin-top: 8px; font-size: 0.84rem; color: var(--ink-2); }
.statement .empty .num { color: var(--red); }
.notice.working { border-style: dashed; }

/* Stage 50: the form and the copies, side by side */
.packet-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: clamp(16px, 2vw, 28px); margin-bottom: 18px; }
.packet-panel { display: grid; grid-template-rows: auto 1fr auto; border: var(--w-part) solid var(--ink); }
.packet-panel header { padding: 14px 16px; border-bottom: var(--w-thin) solid var(--ink); }
.packet-panel header h3 { font-size: 1.05rem; }
.packet-panel header p { margin-top: 4px; color: var(--ink-2); }
.packet-panel .pdf-preview { height: min(52vh, 560px); border: 0; border-top: 0; }
.packet-panel footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-top: var(--w-thin) solid var(--ink); }
.packet-panel .empty-state { align-self: center; text-align: center; }

/* Landing: the other pages of the sample form */
.sample-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.sample-strip a { display: grid; gap: 6px; text-decoration: none; color: var(--ink-2); font-size: 0.76rem; }
.sample-strip img { width: 100%; height: 190px; object-fit: cover; object-position: top; border: var(--w-thin) solid var(--ink-3); }
.sample-strip a:hover img { border-color: var(--blue); }
.abstract-text { max-height: 220px; overflow-y: auto; padding: 10px 12px; border: var(--w-thin) solid var(--ink-3); font-size: 0.86rem; color: var(--ink-2); white-space: pre-wrap; }
.signer-picker select { font-weight: 600; }

/* Stage 50: the form as a card, since it cannot be previewed outside Adobe */
.form-card { display: grid; justify-items: center; align-content: center; gap: 10px; padding: 28px 20px; text-align: center; }
.form-card svg { width: 64px; height: 80px; color: var(--ink); }
.form-card strong { display: block; font-size: 1.15rem; }
.form-card span { display: block; color: var(--ink-2); font-size: 0.84rem; }
.form-card .small { max-width: 34ch; }

/* Manual: the stages as the spine of the page */
.manual-stages { list-style: none; margin: 0 0 clamp(40px, 5vw, 60px); padding: 0; }
.manual-stages .stage h2 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); text-transform: none; letter-spacing: 0; }
.manual-stages .stage > div p { margin-top: 8px; color: var(--ink-3); font-size: 0.9rem; }
.manual-stages .stage-detail p { color: var(--ink-2); }
.manual-stages .stage-detail p + p { margin-top: 10px; }
.manual-stages .sample-sheet { margin-top: 14px; }

/* Review improvements: readable controls and navigation at compact widths. */
.workspace-status { margin-bottom: 20px; padding: 10px 12px; border-left: 3px solid var(--blue); background: var(--blue-wash); color: var(--ink-2); font-size: 0.875rem; }
.sheet-nav { flex-wrap: wrap; }
.sheet-nav a:not(.button), .sheet-nav .text-button, .text-link { min-height: 28px; display: inline-flex; align-items: center; }
.field > span { font-size: 0.8125rem; }
.field input, .field textarea, .field select { font-size: 1rem; }
.field:has([aria-invalid="true"]) { border-color: var(--red); }
@media (max-width: 860px) {
  .sheet-header { position: relative; }
  .step-rail { top: 0; }
  .step-rail ol { min-width: max-content; }
  .step-rail .fig-label { display: none; }
  .step-link { min-width: 70px; min-height: 56px; }
}
@media (pointer: coarse) {
  .button.small, .text-link, .attach-button, .mode-switch button, .filter-tabs button, .sheet-nav a:not(.button), .sheet-nav .text-button { min-height: 44px; }
  .drawer-close { width: 44px; height: 44px; }
}
@media (max-width: 620px) {
  .sheet-nav { justify-content: flex-start; gap: 8px 16px; }
  .mode-switch { max-width: 100%; }
  .panel-actions, .intake-actions { min-width: 0; }
  .button { white-space: normal; text-align: center; padding-block: 10px; }
}
