/* Pilot & Proof: the public site. Every colour, type size, radius, shadow and spacing step is a token
   from tokens.css (loaded first). This file holds layout and structure only. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--space-20); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--text-md--line-height);
  text-rendering: optimizeLegibility;
}
/* The phone menu is open: the page behind it does not scroll. */
html.menu-open, html.menu-open body { overflow: hidden; }

a { color: var(--color-text-brand); text-underline-offset: 0.2em; }
a:hover { color: var(--color-text-brand-hover); }
:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; top: var(--space-2); background: var(--color-text-primary); color: var(--color-bg-primary); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); z-index: 60; }
.skip:focus { left: var(--space-3); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.mono, .label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--text-xs--line-height);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.label { color: var(--color-text-brand); }
.muted { color: var(--color-text-secondary); }

.proof-mark { display: inline-block; width: 0.28em; height: 0.28em; background: var(--color-fg-brand); border-radius: 1px; margin-left: 0.1em; vertical-align: 0.02em; }
.amp { font-style: italic; font-weight: 300; color: var(--color-text-brand); }

/* Top bar: quiet, with a 1px rule under it. */
.site-head { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--color-border-secondary); background: var(--color-bg-primary); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); min-height: var(--space-16); padding-block: var(--space-3); }
.wordmark { color: var(--color-text-primary); text-decoration: none; font-size: var(--text-lg); line-height: var(--text-lg--line-height); font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.wordmark:hover { color: var(--color-text-primary); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin-left: auto; font-size: var(--text-sm); line-height: var(--text-sm--line-height); }
.nav a:not(.button) { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); color: var(--color-text-secondary); text-decoration: none; font-weight: 500; }
.nav a:not(.button):hover { background: var(--color-bg-tertiary); color: var(--color-text-primary); }
.nav .button { min-height: var(--space-9); }
.nav.nav-main { margin-left: var(--space-4); margin-right: auto; }
.bar-actions { display: flex; align-items: center; gap: var(--space-2); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--space-11); padding: 0 var(--space-5);
  background: var(--color-bg-brand-solid); color: var(--color-text-on-brand); border: 0; border-radius: var(--radius-md);
  font: 600 var(--text-sm)/1 var(--font-body); text-decoration: none; cursor: pointer; box-shadow: var(--shadow-xs);
}
.button:hover { background: var(--color-bg-brand-solid_hover); color: var(--color-text-on-brand); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.button.large { min-height: var(--space-12); font-size: var(--text-md); }

/* Light/dark switch, and the Pause switch for the drawings that move. */
.theme-toggle {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--space-9); padding: 0 var(--space-3);
  background: none; border: 1px solid var(--color-border-secondary); border-radius: var(--radius-md); color: var(--color-text-secondary); cursor: pointer;
  font: 500 var(--text-sm)/1 var(--font-body);
}
.theme-toggle:hover { background: var(--color-bg-tertiary); color: var(--color-text-primary); }
.theme-toggle[aria-pressed="true"] { background: var(--color-bg-tertiary); color: var(--color-text-primary); }
.motion-toggle {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--space-6); padding: 0;
  background: none; border: 0; color: var(--color-text-primary); cursor: pointer;
  font: 400 var(--text-xs)/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.motion-toggle::before { content: ""; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; }
.motion-toggle[aria-pressed="true"]::before { background: var(--color-fg-brand); border-color: var(--color-fg-brand); }
.motion-toggle:hover { color: var(--color-text-brand); }
/* Without theme.js there is nothing to switch. Without motion.js there is no Pause, and with `?still`
   or reduced motion nothing moves to be paused. On paper it means nothing. */
:root:not([data-theme]) .theme-toggle { display: none; }
:root:not([data-motion="on"], [data-motion="paused"]) .motion-toggle { display: none !important; }
@media (prefers-reduced-motion: reduce) { .motion-toggle { display: none !important; } }
@media print { .motion-toggle { display: none !important; } }

/* The phone menu: a Menu button, and a solid full-height drawer with every destination (shell.js). */
.menu-button { display: none; min-height: var(--space-9); padding: 0 var(--space-3); border: 1px solid var(--color-border-primary); border-radius: var(--radius-md); background: var(--color-bg-primary); color: var(--color-text-primary); font: 600 var(--text-sm)/1 var(--font-body); cursor: pointer; }
.drawer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--color-bg-primary); overflow-y: auto; overscroll-behavior: contain; }
.menu-button.menu-close { display: inline-flex; align-items: center; }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: var(--space-16); padding: var(--space-3) var(--gutter); border-bottom: 1px solid var(--color-border-secondary); }
.drawer-nav { display: flex; flex-direction: column; padding: var(--space-4) var(--gutter) var(--space-2); }
.drawer-nav a { padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border-secondary); color: var(--color-text-primary); text-decoration: none; font-size: var(--text-xl); line-height: var(--text-xl--line-height); font-weight: 500; }
.drawer-nav a:hover { color: var(--color-text-brand); }
.drawer-foot { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; padding: var(--space-4) var(--gutter) var(--space-10); }
@media (max-width: 899px) {
  :root.js .nav-main, :root.js .bar-actions .theme-toggle { display: none; }
  :root.js .menu-button { display: inline-flex; align-items: center; }
  .bar-actions { margin-left: auto; }
}
@media (min-width: 900px) { .drawer { display: none; } }

/* Hero: the problem, a purpose line, then the email and the one button. */
.hero { padding-block: var(--space-10) var(--space-14); border-bottom: 1px solid var(--color-border-secondary); }
.hero-copy { max-width: 720px; display: flex; flex-direction: column; gap: var(--space-4); }
.hero h1 { margin: 0; font-weight: 600; font-size: var(--text-display-md); line-height: var(--text-display-md--line-height); letter-spacing: -0.02em; text-wrap: balance; }
.lede { margin: 0; font-size: var(--text-md); line-height: var(--text-md--line-height); color: var(--color-text-secondary); max-width: 36em; text-wrap: pretty; }
.hero-form { display: flex; flex-direction: column; gap: var(--space-2); max-width: 560px; margin: 0; }
.hero-form label { font-weight: 500; font-size: var(--text-sm); line-height: var(--text-sm--line-height); }
.hero-form .row { display: flex; flex-direction: column; gap: var(--space-2); }
.hero-form input[type="email"] { width: 100%; min-height: var(--space-12); padding: 0 var(--space-4); border: 1px solid var(--color-border-primary); border-radius: var(--radius-md); background: var(--color-bg-primary); color: var(--color-text-primary); font: 400 var(--text-md)/1.4 var(--font-body); box-shadow: var(--shadow-xs); }
.hero-form [aria-invalid="true"] { border-color: var(--color-fg-brand); box-shadow: inset 0 0 0 1px var(--color-fg-brand); }
.hero-note { margin: 0; max-width: 36em; font-size: var(--text-sm); line-height: var(--text-sm--line-height); color: var(--color-text-secondary); }
.hero-alt { margin: 0; font-size: var(--text-sm); line-height: var(--text-sm--line-height); }
.text-link { color: var(--color-text-brand); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-7); }
@media (min-width: 560px) {
  .hero-form .row { flex-direction: row; }
  .hero-form .row .button { flex: none; }
}
@media (min-width: 768px) {
  .hero { padding-block: var(--space-20) var(--space-24); }
  .hero-copy { gap: var(--space-6); }
  .hero h1 { font-size: var(--text-display-lg); line-height: var(--text-display-lg--line-height); }
  .lede { font-size: var(--text-lg); line-height: var(--text-lg--line-height); }
}
@media (min-width: 1100px) {
  .hero h1 { font-size: var(--text-display-xl); line-height: var(--text-display-xl--line-height); }
}

/* Sections: a heading, one plain purpose line, then the content. */
.section { padding-block: var(--space-14); border-bottom: 1px solid var(--color-border-secondary); }
.section.alt { background: var(--color-bg-secondary); }
@media (min-width: 768px) { .section { padding-block: var(--space-24); } }
.section-head { display: flex; flex-direction: column; gap: var(--space-3); max-width: 760px; margin-bottom: var(--space-8); }
.section h2 { margin: 0; font-weight: 600; font-size: var(--text-display-xs); line-height: var(--text-display-xs--line-height); letter-spacing: -0.015em; text-wrap: balance; }
.section h3 { margin: 0; font-weight: 600; font-size: var(--text-xl); line-height: var(--text-xl--line-height); letter-spacing: -0.01em; }
.purpose { margin: 0; font-size: var(--text-md); line-height: var(--text-md--line-height); color: var(--color-text-secondary); max-width: 40em; }
@media (min-width: 768px) {
  .section h2 { font-size: var(--text-display-md); line-height: var(--text-display-md--line-height); }
  .purpose { font-size: var(--text-lg); line-height: var(--text-lg--line-height); }
  .section-head { margin-bottom: var(--space-12); }
}

/* Plays: three short pictures of the process on a dotted surface. plays.css and plays.js draw them over
   the static frame, which is what the page shows without JS or with reduced motion. */
.play { margin: 0; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.play-stage.play-fallback { position: relative; display: flex; flex-direction: column; justify-content: center; gap: var(--space-2); min-height: 220px; padding: var(--space-5); border: 1px solid var(--color-border-secondary); border-radius: var(--radius-xl); background-color: var(--color-bg-secondary); background-image: radial-gradient(var(--color-border-secondary) 1px, transparent 1px); background-size: var(--space-4) var(--space-4); overflow: hidden; }
.play figcaption { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--text-sm--line-height); color: var(--color-text-secondary); }
.tag { display: inline-block; padding: 0 var(--space-2); border: 1px solid var(--color-border-primary); border-radius: var(--radius-full); font-family: var(--font-mono); font-size: var(--text-xs); line-height: var(--text-xs--line-height); letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-secondary); background: var(--color-bg-primary); }
.pf-card { padding: var(--space-3); border: 1px solid var(--color-border-secondary); border-radius: var(--radius-lg); background: var(--color-bg-primary); box-shadow: var(--shadow-xs); font-size: var(--text-sm); line-height: var(--text-sm--line-height); }
.pf-card b { display: block; font-weight: 600; }
.pf-card span { color: var(--color-text-secondary); }
.pf-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.pf-chip { display: inline-block; padding: 0 var(--space-2); border-radius: var(--radius-full); background: var(--color-bg-tertiary); font-size: var(--text-xs); line-height: var(--text-xs--line-height); font-weight: 500; }
.pf-chip.ok { border: 1px solid var(--color-fg-brand); color: var(--color-text-brand); background: var(--color-bg-primary); }
.pf-arrow { color: var(--color-text-tertiary); text-align: center; line-height: 1; }
.pf-line { display: block; height: 0; border-top: 2px solid var(--color-text-primary); }
.pf-line.after { border-top-style: dashed; border-top-color: var(--color-border-primary); }
.pf-bars { display: flex; align-items: flex-end; gap: var(--space-2); height: var(--space-20); }
.pf-bars i { flex: 1; border-radius: var(--radius-xs) var(--radius-xs) 0 0; background: var(--color-text-tertiary); }
.pf-bars i:nth-child(1) { height: 70%; }
.pf-bars i:nth-child(2) { height: 85%; }
.pf-bars i:nth-child(3) { height: 75%; }
.pf-bars i:nth-child(4) { height: 80%; }
.pf-bars i.future { background: none; border: 1px dashed var(--color-border-primary); height: 60%; }

/* Examples */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: var(--space-4); }
.card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); border: 1px solid var(--color-border-secondary); border-radius: var(--radius-xl); background: var(--color-bg-primary); box-shadow: var(--shadow-xs); }
.card .kicker { color: var(--color-text-tertiary); }
.card p { margin: 0; font-size: var(--text-sm); line-height: var(--text-md--line-height); color: var(--color-text-secondary); }
.card p b { color: var(--color-text-primary); font-weight: 600; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: var(--space-4); }
.step { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-4); border-top: 2px solid var(--color-border-primary); }
.step:last-child { border-top-color: var(--color-fg-brand); }
.step b { font-weight: 600; font-size: var(--text-lg); line-height: var(--text-lg--line-height); }
.step p { margin: 0; font-size: var(--text-sm); line-height: var(--text-md--line-height); color: var(--color-text-secondary); }

/* Services */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: var(--space-4); }
.pillar { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); border: 1px solid var(--color-border-secondary); border-radius: var(--radius-xl); background: var(--color-bg-primary); box-shadow: var(--shadow-xs); }
.pillar .promise { margin: 0; font-size: var(--text-md); line-height: var(--text-md--line-height); color: var(--color-text-secondary); }
.pillar ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--text-md--line-height); }
.pillar li { padding-left: var(--space-5); position: relative; }
.pillar li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--color-fg-brand); }

/* Pictures on the old case-note pages */
.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: var(--space-2); margin: var(--space-4) 0 var(--space-2); }
.figure-row .box { min-height: 74px; border: 1px solid var(--color-border-primary); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); line-height: var(--text-sm--line-height); display: flex; flex-direction: column; justify-content: center; background: var(--color-bg-primary); }
.figure-row .box.check { border-color: var(--color-fg-brand); box-shadow: inset 0 0 0 1px var(--color-fg-brand); }
.figure-row .box b { font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-5); align-content: center; height: 100%; }
.fact b { display: block; font-weight: 300; font-size: var(--text-display-xl); line-height: 1; letter-spacing: -0.04em; }
.fact span { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* Standards, About, Contact */
.rules { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border-secondary); counter-reset: rule; }
.rules li { counter-increment: rule; display: grid; grid-template-columns: var(--space-10) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border-secondary); font-size: var(--text-md); line-height: var(--text-md--line-height); }
.rules li::before { content: counter(rule); font-family: var(--font-mono); color: var(--color-text-brand); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--space-8) var(--space-16); align-items: start; }
.about p { margin: 0 0 var(--space-4); max-width: 36em; color: var(--color-text-secondary); }
.about p:first-child { font-size: var(--text-lg); line-height: var(--text-lg--line-height); color: var(--color-text-primary); }
.contact-mail { margin: 0 0 var(--space-3); font-size: var(--text-display-xs); line-height: var(--text-display-xs--line-height); font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.contact-copy { margin: 0; max-width: 36em; color: var(--color-text-secondary); }
@media (min-width: 768px) { .contact-mail { font-size: var(--text-display-sm); line-height: var(--text-display-sm--line-height); } }

/* #start: the guided intake and its plain form sit on a tinted band. */
.intake { background: var(--color-bg-secondary); border-bottom: 0; }

.site-foot { padding-block: var(--space-10) var(--space-14); border-top: 1px solid var(--color-border-secondary); font-size: var(--text-sm); line-height: var(--text-sm--line-height); color: var(--color-text-secondary); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4) var(--space-10); }
.site-foot a { color: var(--color-text-secondary); }
.site-foot a:hover { color: var(--color-text-primary); }

/* Intake form */
form.notebook { background: var(--color-bg-primary); color: var(--color-text-primary); padding: clamp(var(--space-6), 3vw, var(--space-10)); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-7); }
/* Hidden once it is sent (intake-form.ts); display: grid would otherwise win over [hidden]. */
form.notebook[hidden] { display: none; }
/* One column that can shrink below the Turnstile widget's fixed 300px, so the fields keep the sheet's
   padding. Below 400px the padding narrows too, which keeps the widget on the sheet down to about 370px. */
@media (max-width: 760px) { form.notebook { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 400px) { form.notebook { padding-inline: var(--space-4); } }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field.wide { grid-column: 1 / -1; }
.field label, .field legend { font-weight: 500; font-size: var(--text-md); }
.field .hint { font-size: var(--text-sm); color: var(--color-text-secondary); margin-top: calc(var(--space-1) * -1); }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  font: 400 var(--text-md)/1.4 var(--font-body); color: var(--color-text-primary); background: var(--color-bg-primary);
  border: 1px solid var(--color-border-primary); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); min-height: 48px; width: 100%;
}
.field textarea { min-height: 132px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--color-fg-brand); box-shadow: inset 0 0 0 1px var(--color-fg-brand); }
.field-error { color: var(--color-text-error); font-size: var(--text-sm); min-height: 0; }
.field-error:empty { display: none; }
fieldset.field { border: 0; margin: 0; padding: 0; }
.checks { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
.check { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 44px; font-size: var(--text-md); }
.check input { width: 20px; height: 20px; accent-color: var(--color-fg-brand); }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); border-top: 1px solid var(--color-border-secondary); padding-top: var(--space-5); }
.privacy-note { font-size: var(--text-sm); color: var(--color-text-secondary); max-width: 34em; margin: 0; }
#intake-status { grid-column: 1 / -1; color: var(--color-text-error); margin: 0; }
#intake-status:empty { display: none; }
.done { background: var(--color-bg-primary); color: var(--color-text-primary); padding: clamp(var(--space-6), 3vw, var(--space-10)); }
.done h3 { font-weight: 300; font-size: clamp(var(--text-display-sm), 3vw, var(--text-display-md)); }

/* Guided intake: Claude interviews the visitor on a notebook page (client/conversation/).
   #start shows the conversation or the plain form, never both. data-mode is "form" in the markup;
   main.ts sets "conversation" when the Worker has it on, and "form" again whenever the form takes over. */
.intake[data-mode="form"] .interview,
.intake[data-mode="conversation"] .plain-form { display: none; }
.intake[data-mode="conversation"] .two-col { grid-template-columns: minmax(0, 1fr); }
.intake[data-mode="conversation"] .section-head { margin-bottom: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: calc(var(--space-0-5) * -1); padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* The page: a sheet on the band, with its own red margin line, and a red line across the top
   that grows as the interview goes on. */
.interview .page { position: relative; border: 1px solid var(--color-border-primary); background: var(--color-bg-primary); color: var(--color-text-primary); font-size: var(--text-md); line-height: 1.55; }
.interview .progress { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: var(--color-fg-brand); transition: width 0.6s ease; }
.interview .page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-4) var(--space-8) var(--space-4) var(--space-14); border-bottom: 1px solid var(--color-border-secondary); font-family: var(--font-mono); font-size: var(--text-xs); }
.interview .page-head .entry { letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-brand); }
.interview .page-head .qcount { font-weight: 700; }
.interview .page-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); letter-spacing: 0.06em; color: var(--color-text-tertiary); }
/* "Read replies aloud": a notebook tick box, like the theme switch. */
.interview .aloud { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 24px; padding: 0; border: 0; background: none; color: var(--color-text-secondary); font: inherit; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.interview .aloud::before { content: ""; width: 9px; height: 9px; border: 1.5px solid currentColor; }
.interview .aloud[aria-checked="true"]::before { background: var(--color-fg-brand); border-color: var(--color-fg-brand); }
.interview .aloud:hover { color: var(--color-text-brand); }
.interview .aloud[hidden] { display: none; }
.interview .sheet { display: grid; grid-template-columns: minmax(0, 1fr) 270px; height: clamp(420px, calc(100vh - 120px), 640px); }
.interview .column { position: relative; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--color-border-secondary); }
.interview .column::before { content: ""; position: absolute; top: 0; bottom: 0; left: 36px; width: 1px; background: var(--color-fg-brand); opacity: 0.55; pointer-events: none; }

/* The thread. Only the current message is large; earlier exchanges shrink and fade to grey. */
.interview .flow { flex: 1; overflow-y: auto; padding: var(--space-7) var(--space-9) var(--space-5) var(--space-14); scroll-behavior: smooth; }
.interview .turn { margin: 0 0 var(--space-6); }
.interview .says { margin: 0; max-width: 30em; font-weight: 300; font-size: var(--text-display-xs); line-height: 1.42; letter-spacing: -0.012em; overflow-wrap: anywhere; }
.interview .says + .says { margin-top: var(--space-2); }
.interview .reply { position: relative; margin: var(--space-3) 0 0; padding-left: var(--space-5); max-width: 32em; font-style: italic; font-weight: 300; font-size: var(--text-lg); color: var(--color-text-primary); overflow-wrap: anywhere; }
.interview .reply::before { content: "—"; position: absolute; left: 0; color: var(--color-text-tertiary); font-style: normal; }
.interview .reply .how { margin-left: var(--space-2); font-family: var(--font-mono); font-style: normal; font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-tertiary); white-space: nowrap; }
.interview .fn { margin-left: var(--space-0-5); font-family: var(--font-mono); font-style: normal; font-size: var(--text-xs); color: var(--color-text-brand); vertical-align: super; }
.interview .turn.past .says { font-size: var(--text-md); line-height: 1.5; color: var(--color-text-tertiary); }
.interview .turn.past .reply { font-size: var(--text-md); color: var(--color-text-tertiary); }
/* The fade plays once, when a turn becomes past; a theme switch recolors at once, like the rest of the page. */
.interview .turn.past .says, .interview .turn.past .reply { animation: intake-fade 0.5s ease; }
@keyframes intake-fade { from { color: var(--color-text-primary); } }
.interview .turn.past .try { display: none; }
.interview .w { animation: intake-word 0.16s ease-out both; }
@keyframes intake-word { from { opacity: 0; } to { opacity: 1; } }
.interview .caret { display: inline-block; width: 0.42em; height: 0.42em; margin-left: var(--space-1); vertical-align: 0.08em; background: var(--color-fg-brand); animation: intake-blink 0.9s steps(1) infinite; }
@keyframes intake-blink { 50% { opacity: 0; } }
.interview .thinking { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-5); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-tertiary); }
.interview .thinking i { width: 7px; height: 7px; background: var(--color-fg-brand); animation: intake-think 1s ease-in-out infinite; }
.interview .thinking i:nth-child(2) { animation-delay: 0.15s; opacity: 0.7; }
.interview .thinking i:nth-child(3) { animation-delay: 0.3s; opacity: 0.45; }
@keyframes intake-think { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
/* Suggestions are a quiet "or tap" line of text, not buttons that look like buttons. */
.interview .try { margin: var(--space-3) 0 0; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; color: var(--color-text-tertiary); animation: intake-word 0.4s ease-out both; }
.interview .try button { margin: 0 var(--space-0-5); padding: var(--space-1) 0; border: 0; background: none; color: var(--color-text-secondary); font: inherit; letter-spacing: inherit; cursor: pointer; text-decoration-line: underline; text-decoration-color: var(--color-border-secondary); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.interview .try button:hover:not(:disabled), .interview .try button.picked { color: var(--color-text-primary); text-decoration-color: var(--color-fg-brand); }
.interview .try button:disabled { cursor: default; }

/* The composer: a ruled line to write on, the square mic, and Send. They are drawn in the order they
   are in the page, so that Tab goes in the order the eye does. On a wide screen the mic comes first,
   left of the line. At the phone width below, view.ts moves it after the line. */
.interview .composer { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-9) var(--space-4) var(--space-14); border-top: 1px solid var(--color-border-secondary); }
.interview .mic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid var(--color-border-primary); background: transparent; color: var(--color-text-primary); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.interview .mic[hidden] { display: none; }
.interview .mic svg { width: 19px; height: 19px; }
.interview .mic[aria-pressed="true"] { background: var(--color-bg-brand-solid); border-color: var(--color-bg-brand-solid); color: var(--color-text-on-brand); }
.interview .line { position: relative; flex: 1; min-width: 0; min-height: 46px; display: flex; align-items: center; border-bottom: 1.5px solid var(--color-border-primary); }
.interview .line:focus-within { border-bottom-color: var(--color-fg-brand); box-shadow: 0 1.5px 0 var(--color-fg-brand); }
.interview .line textarea { flex: 1; min-width: 0; max-height: 10em; margin: 0; padding: var(--space-3) 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text-primary); font: 400 var(--text-md)/1.45 var(--font-body); resize: none; overflow-y: auto; }
.interview .line textarea::placeholder { color: var(--color-text-tertiary); opacity: 1; }
.interview .line textarea:focus-visible { outline: none; }
/* While the mic listens, a row of stipple dots replaces the ruled line. */
.interview .line .wave { position: absolute; inset: 0; display: none; align-items: center; gap: var(--space-1); }
.interview .line.listening { border-bottom-color: transparent; }
.interview .line.listening .wave { display: flex; }
.interview .line.listening textarea { visibility: hidden; }
.interview .wave i { width: 4px; height: 4px; border-radius: 50%; background: var(--stipple-ink); animation: intake-dot 1.1s ease-in-out infinite; }
@keyframes intake-dot { 0%, 100% { transform: translateY(0) scale(1); opacity: 0.5; } 50% { transform: translateY(-7px) scale(1.4); opacity: 1; } }
.interview .send { flex: none; min-height: 44px; padding: 0 var(--space-1); border: 0; background: none; color: var(--color-text-primary); font: 500 var(--text-sm) var(--font-body); cursor: pointer; }
.interview .send:hover { color: var(--color-text-brand); }
.interview .composer-note { margin: 0; padding: 0 var(--space-9) var(--space-3) var(--space-14); font-size: var(--text-sm); color: var(--color-text-error); }
.interview .composer-note:empty { display: none; }
.interview .fine { margin: 0; padding: 0 var(--space-9) var(--space-4) var(--space-14); font-size: var(--text-xs); color: var(--color-text-tertiary); }
.interview .composer-form .cf-turnstile { padding: 0 var(--space-9) 0 var(--space-14); }

/* Margin notes: what the AI has learned, in its own words, footnoted to the answers. */
.interview .margin { padding: var(--space-7) var(--space-6) var(--space-5); overflow-y: auto; }
.interview .margin h3 { margin: 0 0 var(--space-1); font-family: var(--font-mono); font-weight: 400; font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-brand); }
.interview .margin .lead { margin: 0 0 var(--space-5); font-size: var(--text-sm); color: var(--color-text-tertiary); }
.interview .mn { margin: 0 0 var(--space-4); font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.55; letter-spacing: 0.01em; color: var(--color-text-primary); overflow-wrap: anywhere; }
.interview .mn sup { margin-right: var(--space-1); color: var(--color-text-brand); }
.interview .mn.flag { color: var(--color-text-brand); }
.interview .mn .w { animation-duration: 0.2s; }

/* Off the page, on the band: the way to the plain form, and the line that hands over to it. */
.interview .plain-link { margin: var(--space-4) 0 0; font-size: var(--text-sm); }
.interview .plain-link a { color: var(--color-text-brand); }
.plain-form .handover { margin: 0 0 var(--space-6); font-weight: 300; font-size: var(--text-display-xs); line-height: 1.42; letter-spacing: -0.012em; color: var(--color-text-primary); }
.interview .plain-link a:focus-visible, .plain-form .handover:focus-visible { outline-color: var(--color-text-brand); }

@media (max-width: 900px) {
  .interview .sheet { grid-template-columns: minmax(0, 1fr); height: auto; }
  .interview .column { border-right: 0; }
  .interview .flow { max-height: 60vh; }
  .interview .margin { border-top: 1px solid var(--color-border-secondary); }
}
@media (max-width: 560px) {
  .interview .page-head, .interview .flow, .interview .composer, .interview .composer-note, .interview .fine, .interview .composer-form .cf-turnstile { padding-left: var(--space-10); padding-right: var(--space-5); }
  .interview .column::before { left: 26px; }
  .interview .says { font-size: var(--text-xl); }
  /* The ruled line gets the whole width, with the mic and Send beneath it. The mic is after the line
     in the page at this width (PHONE in view.ts, which is 560px), so nothing here reorders it. */
  .interview .composer { flex-wrap: wrap; row-gap: var(--space-3); }
  .interview .line { flex-basis: 100%; }
  .interview .send { margin-left: auto; }
}
/* Reduced motion: replies appear whole, and nothing animates. */
@media (prefers-reduced-motion: reduce) {
  .interview .w, .interview .try, .interview .caret, .interview .thinking i, .interview .wave i,
  .interview .turn.past .says, .interview .turn.past .reply { animation: none; }
  .interview .progress { transition: none; }
  .interview .flow { scroll-behavior: auto; }
}

/* Field notes: five plates written for the visitor (client/fieldnotes/), shown as a deck. On the
   homepage they take the notebook's place in #start (data-mode="notes"); /notes/<id> shows the same
   deck. A plate scales with its own width, like a slide: sizes are in cqw, with floors for phones. */
.intake[data-mode="notes"] .interview, .intake[data-mode="notes"] .plain-form { display: none; }
.intake:not([data-mode="notes"]) .fieldnotes { display: none; }
.intake[data-mode="notes"] .two-col { grid-template-columns: minmax(0, 1fr); }
.intake[data-mode="notes"] .section-head { margin-bottom: 0; }

.fieldnotes .deck { border: 1px solid var(--color-border-primary); background: var(--color-bg-primary); color: var(--color-text-primary); padding: clamp(var(--space-3), 2vw, var(--space-6)); font-size: var(--text-md); line-height: 1.55; }
/* One plate shows at a time. A plate is at least 16:9 and grows if its words need more room. */
.fieldnotes .stage { container-type: inline-size; border: 1px solid var(--color-border-primary); background: var(--color-bg-secondary); }
.fieldnotes .plate { aspect-ratio: 16 / 9; container-type: inline-size; display: none; flex-direction: column; gap: max(2.2cqw, var(--space-3)); padding: max(4cqw, var(--space-4)) max(4.6cqw, var(--space-4)); font-size: max(1.7cqw, var(--text-sm)); line-height: 1.42; scroll-margin-top: 24px; }
.fieldnotes .plate.current { display: flex; }
.fieldnotes .plate:focus-visible { outline-offset: -4px; }
/* A plate fades in as it comes up: on screens only, so a print never catches one faded out. */
@media screen and (prefers-reduced-motion: no-preference) {
  .fieldnotes .plate.arrive { animation: notes-arrive 0.45s ease-out; }
}
@keyframes notes-arrive { from { opacity: 0; } }
.fieldnotes .ph2 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) 2cqw; font-family: var(--font-mono); font-size: max(1.45cqw, var(--text-xs)); letter-spacing: 0.08em; text-transform: uppercase; }
.fieldnotes .ph2 > :first-child { color: var(--color-text-brand); }
.fieldnotes .ph2 > :last-child { color: var(--color-text-secondary); }
.fieldnotes .pt { margin: 0; font-weight: 300; font-size: max(4.1cqw, var(--text-display-xs)); line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; overflow-wrap: anywhere; }
.fieldnotes .small { margin: 0; font-size: max(1.65cqw, var(--text-xs)); color: var(--color-text-secondary); }

/* 1 · The cover: their field, a sentence they said, the contents, and their instrument. */
.fieldnotes .cover { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 33cqw; align-items: center; gap: 4cqw; }
.fieldnotes .cover .t { margin: 0 0 2.2cqw; font-weight: 300; font-size: max(5.2cqw, var(--text-display-sm)); line-height: 1; letter-spacing: -0.035em; text-wrap: balance; overflow-wrap: anywhere; }
.fieldnotes .told { margin: 0 0 2.2cqw; padding-left: max(1.6cqw, var(--space-3)); border-left: 2px solid var(--color-border-primary); }
.fieldnotes .told b { display: block; margin-bottom: 0.6cqw; font-family: var(--font-mono); font-weight: 400; font-size: max(1.35cqw, var(--text-xs)); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-secondary); }
.fieldnotes .told q { font-style: italic; font-weight: 300; font-size: max(2.1cqw, var(--text-md)); line-height: 1.35; overflow-wrap: anywhere; }
.fieldnotes .inside { margin: 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: max(1.35cqw, var(--text-xs)); line-height: 1.9; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-secondary); }
.fieldnotes .inside span { color: var(--color-text-brand); }
/* The photographs move (stipple.ts), so the canvas reaches past its square (.drawing) by
   --specimen-bleed on every side: dots the pointer pushes past the drawing's edge stay in view.
   stipple.ts reads the bleed to place the drawing. The plate, not the canvas, takes the pointer, so
   the bleed never blocks the text beside it. The caption sits under the square, in the figure's
   flow, so a long one (the library's run to four lines on a narrow plate) makes room for itself. */
.fieldnotes .specimen { --specimen-bleed: 8%; margin: 0; }
.fieldnotes .specimen .drawing { position: relative; aspect-ratio: 1; }
.fieldnotes .specimen canvas { position: absolute; inset: calc(-1 * var(--specimen-bleed)); width: calc(100% + 2 * var(--specimen-bleed)); height: calc(100% + 2 * var(--specimen-bleed)); pointer-events: none; }
.fieldnotes .specimen figcaption { margin-top: 1.6cqw; font-family: var(--font-mono); font-size: max(1.15cqw, var(--text-xs)); color: var(--color-text-secondary); text-align: right; }
.fieldnotes .specimen .motion-toggle { display: flex; margin: 0.4cqw 0 0 auto; color: var(--color-text-secondary); font-size: max(1.15cqw, var(--text-xs)); }
.fieldnotes .specimen .motion-toggle:hover { color: var(--color-text-brand); }
.fieldnotes .specimen figcaption span { color: var(--color-text-brand); }

/* 2 · The sample: a draft of their task, stamped, with a key to its marks. */
.fieldnotes .sample { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; gap: 3cqw; margin-block: auto; }
.fieldnotes .doc { padding: max(2cqw, var(--space-4)) max(2.4cqw, var(--space-4)); border: 1px solid var(--color-border-secondary); background: var(--color-bg-primary); font-size: max(1.7cqw, var(--text-sm)); line-height: 1.42; overflow-wrap: anywhere; }
.fieldnotes .doc .dh { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-1) 1.5cqw; margin-bottom: 0.4cqw; padding-bottom: 0.9cqw; border-bottom: 2px solid var(--color-border-primary); }
.fieldnotes .doc .dh b { font-weight: 500; font-size: max(2.1cqw, var(--text-md)); }
.fieldnotes .stamp { padding: 0.2cqw 0.7cqw; border: 1px solid var(--color-fg-brand); font-family: var(--font-mono); font-size: max(1.1cqw, var(--text-xs)); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-brand); white-space: nowrap; }
.fieldnotes .doc .sh { margin: max(1.1cqw, var(--space-2)) 0 0.3cqw; font-family: var(--font-mono); font-size: max(1.3cqw, var(--text-xs)); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-secondary); }
.fieldnotes .doc p, .fieldnotes .doc ul { margin: 0; }
.fieldnotes .doc ul { padding-left: max(1.8cqw, var(--space-5)); }
.fieldnotes .doc mark { background: linear-gradient(transparent 55%, var(--color-bg-highlight) 55%, var(--color-bg-highlight) 92%, transparent 92%); color: inherit; }
.fieldnotes .src { font-family: var(--font-mono); font-size: max(1.1cqw, var(--text-xs)); color: var(--color-text-secondary); }
.fieldnotes .doc .verify { margin-top: max(1.3cqw, var(--space-3)); padding: max(0.8cqw, var(--space-2)) max(1.2cqw, var(--space-3)); border-left: 3px solid var(--color-fg-brand); background: color-mix(in srgb, var(--color-fg-brand) 6%, transparent); font-size: max(1.6cqw, var(--text-xs)); }
.fieldnotes .keys { display: flex; flex-direction: column; gap: max(1.8cqw, var(--space-3)); font-size: max(1.9cqw, var(--text-sm)); line-height: 1.4; }
.fieldnotes .keys p { position: relative; margin: 0; padding-left: max(3.4cqw, var(--space-8)); }
.fieldnotes .keys p::before { content: ""; position: absolute; left: 0; top: 0.55em; width: max(2.2cqw, 20px); height: max(1cqw, 9px); }
.fieldnotes .keys .hl::before { background: var(--color-bg-highlight); }
.fieldnotes .keys .ck::before { background: var(--color-fg-brand); }
.fieldnotes .keys .ms::before { top: 0.75em; height: 0; border-top: 2px dashed var(--color-text-secondary); }

/* 3 · One workflow, redrawn: today, and with me. My steps are dashed; a person's checks are red. */
.fieldnotes .flowx { display: grid; grid-template-columns: 13cqw minmax(0, 1fr); align-items: center; gap: 3cqw 1.5cqw; margin-block: auto; }
.fieldnotes .rl { font-family: var(--font-mono); font-size: max(1.45cqw, var(--text-xs)); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-secondary); }
.fieldnotes .flowx .row { display: flex; align-items: stretch; gap: 1cqw; }
.fieldnotes .bx { flex: 1; min-width: 0; padding: max(1.1cqw, var(--space-2)) max(1.2cqw, var(--space-3)); border: 1px solid var(--color-border-primary); background: var(--color-bg-primary); font-size: max(1.75cqw, var(--text-xs)); line-height: 1.25; overflow-wrap: anywhere; }
.fieldnotes .bx b { display: block; font-weight: 500; }
.fieldnotes .bx em { font-style: normal; color: var(--color-text-secondary); }
.fieldnotes .bx.me { border-style: dashed; }
.fieldnotes .bx.verify { border-color: var(--color-fg-brand); box-shadow: inset 0 0 0 1px var(--color-fg-brand); }
.fieldnotes .ar { flex: none; align-self: center; font-family: var(--font-mono); font-size: max(2cqw, var(--text-sm)); color: var(--color-text-secondary); }
.fieldnotes .foot { display: grid; gap: var(--space-0-5); }

/* 4 · The first protocol, ruled like the homepage's; the summary of the notes uses the same rows. */
.fieldnotes .study { flex: 1; border-top: 2px solid var(--color-fg-brand); }
.fieldnotes .study .q { margin: max(1.4cqw, var(--space-3)) 0 0.6cqw; font-weight: 300; font-size: max(2.5cqw, var(--text-lg)); line-height: 1.25; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.fieldnotes .study dl { margin: 0; }
.fieldnotes .study .row { display: grid; grid-template-columns: 14cqw minmax(0, 1fr); gap: 1.6cqw; padding: max(1.1cqw, var(--space-2)) 0; border-bottom: 1px solid var(--color-border-secondary); font-size: max(1.72cqw, var(--text-sm)); line-height: 1.4; }
.fieldnotes .study dt { padding-top: 0.25cqw; font-family: var(--font-mono); font-size: max(1.35cqw, var(--text-xs)); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-secondary); }
.fieldnotes .study dd { margin: 0; overflow-wrap: anywhere; }
.fieldnotes .summary dd { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* 5 · The next step: two choices, then a name, an email and consent, on the plate itself. */
.fieldnotes .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: max(2.4cqw, var(--space-3)); margin-block: auto; }
.fieldnotes .choice { display: flex; flex-direction: column; gap: 1cqw; margin: 0; padding: max(2.4cqw, var(--space-4)); border: 1px solid var(--color-border-primary); background: var(--color-bg-primary); color: var(--color-text-primary); font: inherit; text-align: left; }
.fieldnotes .choice.primary { border-color: var(--color-fg-brand); box-shadow: inset 0 0 0 1px var(--color-fg-brand); }
.fieldnotes button.choice { cursor: pointer; }
.fieldnotes button.choice:hover:not(:disabled) { border-color: var(--color-fg-brand); }
.fieldnotes button.choice:disabled { cursor: default; }
/* Once a choice is picked, the red goes with it. */
.fieldnotes .choices:has([aria-pressed="true"]) .choice { border-color: var(--color-border-secondary); box-shadow: none; }
.fieldnotes .choices .choice[aria-pressed="true"] { border-color: var(--color-fg-brand); box-shadow: inset 0 0 0 2px var(--color-fg-brand); }
.fieldnotes .choice b { font-weight: 400; font-size: max(2.6cqw, var(--text-lg)); line-height: 1.1; letter-spacing: -0.02em; }
.fieldnotes .choice span { font-size: max(1.7cqw, var(--text-sm)); line-height: 1.4; color: var(--color-text-secondary); }
.fieldnotes .choice i, .fieldnotes .choice .act { margin-top: auto; font-style: normal; font-family: var(--font-mono); font-size: max(1.35cqw, var(--text-xs)); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-brand); }
.fieldnotes .contact { display: grid; gap: var(--space-3); padding-top: max(1.6cqw, var(--space-4)); border-top: 1px solid var(--color-border-secondary); font-size: var(--text-md); line-height: 1.4; }
.fieldnotes .contact[hidden] { display: none; }
.fieldnotes .contact p { margin: 0; }
.fieldnotes .contact-lead { font-size: var(--text-sm); color: var(--color-text-secondary); }
.fieldnotes .contact-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.fieldnotes .contact-send { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3) var(--space-4); }
.fieldnotes .contact-field { display: flex; flex-direction: column; gap: var(--space-2); font-weight: 500; font-size: var(--text-sm); }
.fieldnotes .contact-field input { width: 100%; min-height: 48px; padding: var(--space-3) var(--space-3); border: 1px solid var(--color-border-primary); border-radius: var(--radius-md); background: var(--color-bg-primary); color: var(--color-text-primary); font: 400 var(--text-md)/1.4 var(--font-body); }
.fieldnotes .contact [aria-invalid="true"] { border-color: var(--color-fg-brand); box-shadow: inset 0 0 0 1px var(--color-fg-brand); }
.fieldnotes .contact .check { min-height: 32px; font-size: var(--text-sm); }
.fieldnotes .contact-status { color: var(--color-text-error); font-size: var(--text-sm); }
.fieldnotes .contact-status:empty, .fieldnotes .contact-done:empty { display: none; }
.fieldnotes .contact-done { margin: 0; font-size: max(1.9cqw, var(--text-md)); }
.fieldnotes .sign { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) 2cqw; font-size: max(1.5cqw, var(--text-xs)); color: var(--color-text-secondary); }

/* Under the stage: Back and Next, the strip of thumbnails, then the private link and the PDF. */
.fieldnotes .controls { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin: var(--space-4) 0 var(--space-3); }
.fieldnotes .controls button, .fieldnotes .keep .save { flex: none; min-height: 44px; padding: 0 var(--space-4); border: 1px solid var(--color-border-primary); background: transparent; color: var(--color-text-primary); font: 500 var(--text-sm) var(--font-body); cursor: pointer; }
.fieldnotes .controls button:hover:not([aria-disabled="true"]), .fieldnotes .keep .save:hover { border-color: var(--color-fg-brand); color: var(--color-text-brand); }
.fieldnotes .controls button[aria-disabled="true"] { opacity: 0.35; cursor: default; }
/* Next, when the next plate is in: the deck's one strong button (deck.ts). */
.fieldnotes .controls button.go { border-color: var(--color-bg-brand-solid); background: var(--color-bg-brand-solid); color: var(--color-text-on-brand); }
.fieldnotes .controls button.go:hover { border-color: var(--color-bg-brand-solid_hover); background: var(--color-bg-brand-solid_hover); color: var(--color-text-on-brand); }
.fieldnotes .count { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-secondary); text-align: center; }
.fieldnotes .strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.fieldnotes .thumb { position: relative; aspect-ratio: 16 / 9; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--space-2) var(--space-2); overflow: hidden; border: 1px solid var(--color-border-secondary); background: var(--color-bg-secondary); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fieldnotes .thumb:disabled { cursor: default; }
.fieldnotes .thumb[aria-current="true"] { border-color: var(--color-fg-brand); box-shadow: inset 0 0 0 1px var(--color-fg-brand); }
.fieldnotes .thumb .tl, .fieldnotes .thumb .wait { position: relative; z-index: 1; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-secondary); white-space: nowrap; }
.fieldnotes .thumb .wait, .fieldnotes .thumb:not([data-state="ready"]) .art, .fieldnotes .thumb[data-state="writing"] .tl { display: none; }
.fieldnotes .thumb[data-state="writing"] .wait { display: block; }
.fieldnotes .thumb[data-state="writing"]::after { content: ""; position: absolute; left: 7px; right: 7px; top: 45%; height: 2px; background: linear-gradient(90deg, var(--color-fg-brand) 0 30%, var(--color-border-secondary) 30%); background-size: 200% 100%; animation: notes-writing 1.1s linear infinite; }
@keyframes notes-writing { from { background-position: 100% 0; } to { background-position: 0 0; } }
.fieldnotes .art { position: absolute; inset: 8px 8px 24px; }
.fieldnotes .doc-art { border: 1px solid var(--color-border-secondary); background: repeating-linear-gradient(var(--color-bg-primary) 0 5px, var(--color-border-secondary) 5px 6px); }
.fieldnotes .doc-art::after { content: ""; position: absolute; left: 6px; top: 7px; width: 45%; height: 4px; background: var(--color-bg-highlight); }
.fieldnotes .flow-art { background: linear-gradient(var(--color-text-primary), var(--color-text-primary)) 0 30% / 24% 1px no-repeat, linear-gradient(var(--color-text-primary), var(--color-text-primary)) 50% 30% / 24% 1px no-repeat, linear-gradient(var(--color-fg-brand), var(--color-fg-brand)) 100% 70% / 24% 2px no-repeat, linear-gradient(var(--color-text-primary), var(--color-text-primary)) 0 70% / 24% 1px no-repeat; }
.fieldnotes .rows-art { border-top: 2px solid var(--color-fg-brand); background: repeating-linear-gradient(transparent 0 8px, var(--color-border-secondary) 8px 9px); }
.fieldnotes .btn-art { background: linear-gradient(var(--color-bg-primary), var(--color-bg-primary)) 0 50% / 46% 60% no-repeat, linear-gradient(var(--color-bg-primary), var(--color-bg-primary)) 100% 50% / 46% 60% no-repeat; outline: 1px solid var(--color-border-secondary); outline-offset: -1px; }
.fieldnotes .thumb canvas.art { inset: 6px 8px 22px auto; height: calc(100% - 28px); aspect-ratio: 1; }
.fieldnotes .keep { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3) var(--space-6); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border-secondary); }
.fieldnotes .keep[hidden] { display: none; }
.fieldnotes .keep p { margin: 0; }
.fieldnotes .keep .where { font-size: var(--text-md); overflow-wrap: anywhere; }
.fieldnotes .keep .where .mono { margin-right: var(--space-2); color: var(--color-text-brand); }
.fieldnotes .keep .fine { margin-top: var(--space-0-5); font-size: var(--text-sm); color: var(--color-text-tertiary); }

/* Narrow plates stack their columns. */
@container (max-width: 600px) {
  .fieldnotes .cover, .fieldnotes .sample, .fieldnotes .flowx, .fieldnotes .choices, .fieldnotes .contact-fields { grid-template-columns: minmax(0, 1fr); }
  .fieldnotes .specimen { justify-self: center; width: min(100%, 240px); margin-bottom: 0.6em; }
  .fieldnotes .specimen figcaption { margin-top: var(--space-2); text-align: center; }
  .fieldnotes .specimen .motion-toggle { margin-inline: auto; }
  .fieldnotes .flowx { gap: var(--space-2); }
  .fieldnotes .flowx .row { flex-direction: column; gap: var(--space-0-5); }
  .fieldnotes .flowx .row + .rl { margin-top: var(--space-3); }
  .fieldnotes .ar { transform: rotate(90deg); }
  .fieldnotes .study .row { grid-template-columns: minmax(0, 1fr); gap: var(--space-0-5); }
}
/* On a phone the thumbnails are numbers. */
@media (max-width: 560px) {
  .fieldnotes .thumb { aspect-ratio: auto; min-height: 44px; justify-content: center; align-items: center; }
  .fieldnotes .thumb .tn, .fieldnotes .thumb .art, .fieldnotes .thumb[data-state] .wait { display: none; }
  .fieldnotes .thumb[data-state] .tl { display: inline; }
  .fieldnotes .thumb[data-state="writing"]::after { top: auto; bottom: 6px; }
  .fieldnotes .controls button { padding: 0 var(--space-3); }
}
@media (prefers-reduced-motion: reduce) {
  .fieldnotes .thumb[data-state="writing"]::after { animation: none; }
}

/* The private notes page (/notes/<id>): the same deck, on a page of its own. */
.notes-page h1 { margin: 0 0 var(--space-5); font-weight: 400; }
.notes-page .notes-wait { margin: 0; }
.notes-missing { max-width: 38em; }
.notes-missing h2 { margin-bottom: var(--space-5); }

/* Case-note pages: one notebook entry, with section names in the margin column. */
.casefile .back { display: inline-block; margin-bottom: var(--space-7); color: var(--color-text-secondary); text-decoration: none; }
.casefile .back:hover { color: var(--color-text-brand); }
.casefile h1 { margin: 0; font-weight: 300; font-size: clamp(var(--text-display-md), 5.4vw, var(--text-display-xl)); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.case-meta { margin: 0 0 clamp(var(--space-5), 3vw, var(--space-8)); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 0 var(--space-8); border-top: 2px solid var(--color-border-primary); }
.case-meta div { padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border-secondary); }
.case-meta dt { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-secondary); }
.case-meta dd { margin: var(--space-1) 0 0; }
.entry-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: var(--space-3) var(--space-10); padding: var(--space-7) 0; border-bottom: 1px solid var(--color-border-secondary); }
@media (max-width: 760px) { .entry-row { grid-template-columns: 1fr; } }
.casefile .entry-row h2 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; line-height: 1.6; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-brand); }
.entry-row p, .entry-row ul { margin: 0 0 var(--space-4); max-width: 38em; }
.entry-row ul { padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.entry-row ul ul { margin: var(--space-3) 0 0; }
.entry-row li { padding-left: var(--space-5); position: relative; }
.entry-row li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border: 1.5px solid var(--color-border-primary); }
.entry-row > div > :last-child { margin-bottom: 0; }
.entry-row .facts { height: auto; margin-bottom: var(--space-5); }
.case-next { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4) var(--space-8); padding-top: var(--space-8); }

/* Print. Field notes print on their own: one plate to a landscape page (the "notes" pages, so
   other pages keep the printer's own orientation), always in the light theme (the dark tokens are
   for screens), with nothing of the page around them and none of the deck's controls. A plate
   still being written has nothing to print and is left out. stipple.ts redraws the instruments
   in the light ink as printing starts.
   The rules that clear the page apply only while the field notes are showing: on the homepage,
   data-mode="notes" on #start, and on /notes/<id>, the notes page. After a plate-5 hand-over to the
   plain form (data-mode="form") the deck is still in the page but hidden, and the page then prints
   as itself, form and all, instead of as one blank page. */
@page notes { size: landscape; margin: 12mm; }
@media print {
  html:has(:is(.intake[data-mode="notes"], .notes-page) .fieldnotes .deck) body::before,
  html:has(:is(.intake[data-mode="notes"], .notes-page) .fieldnotes .deck) :is(.skip, .site-head, .site-foot, main > :not(:has(.fieldnotes .deck))),
  :is(.intake[data-mode="notes"], .notes-page) :has(> .fieldnotes .deck) > :not(.fieldnotes),
  .fieldnotes .controls, .fieldnotes .strip, .fieldnotes .keep, .fieldnotes .contact, .fieldnotes .contact-done { display: none !important; }
  html:has(:is(.intake[data-mode="notes"], .notes-page) .fieldnotes .deck) :is(main > *, main .wrap) { margin: 0; padding: 0; max-width: none; border: 0; background: none; }
  .fieldnotes .deck, .fieldnotes .stage { display: block; padding: 0; border: 0; background: none; }
  .fieldnotes .plate { page: notes; display: flex; border: 1px solid var(--color-border-primary); background-color: var(--color-bg-secondary); break-inside: avoid; animation: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fieldnotes .plate + .plate { break-before: page; }
  .fieldnotes .plate:empty { display: none; }
}

/* Free AI Snapshot (public/snapshot.html, client/snapshot.ts): the form on the band, then the result
   on a sheet: three opportunities, each with its estimate, and the assessment's quote. */
#snapshot-status { grid-column: 1 / -1; color: var(--color-text-error); margin: 0; }
#snapshot-status:empty { display: none; }
.snapshot-result { background: var(--color-bg-primary); color: var(--color-text-primary); padding: clamp(var(--space-6), 3vw, var(--space-10)); display: flex; flex-direction: column; gap: var(--space-8); }
.snapshot-result h3 { margin: 0; font-weight: 300; font-size: clamp(var(--text-display-sm), 3vw, var(--text-display-md)); text-wrap: balance; }
.snapshot-result p { margin: 0; max-width: 40em; }
.opportunities { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: var(--space-6) var(--space-8); border-top: 2px solid var(--color-border-primary); padding-top: var(--space-6); }
.opportunity { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.opportunity h4 { margin: 0; font-size: var(--text-xl); font-weight: 500; }
.opportunity .estimate { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-text-brand); font-variant-numeric: tabular-nums; }
.opportunity dl { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-md); }
.opportunity dt { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-tertiary); }
.opportunity dd { margin: 0; }
.quote-box { border: 1px solid var(--color-border-primary); background: var(--color-bg-primary); padding: clamp(var(--space-5), 2.5vw, var(--space-7)); display: flex; flex-direction: column; gap: var(--space-4); }
.quote-box .price { font-size: clamp(var(--text-display-sm), 4vw, var(--text-display-lg)); font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.quote-lines { margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); color: var(--color-text-secondary); display: flex; flex-direction: column; gap: var(--space-1); }
.quote-lines li { display: flex; justify-content: space-between; gap: var(--space-4); font-variant-numeric: tabular-nums; }
.snapshot-caveat { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* Policy pages (/privacy, /privacy/archive): the case-note layout, with numbered clauses and tables. */
.policy .entry-row .cl, .policy .entry-row .sub { position: relative; }
.policy .entry-row .cl { padding-left: 3.2em; }
.policy .entry-row .sub { padding-left: 5.4em; margin-top: calc(var(--space-2) * -1); }
.policy .entry-row .cl .n, .policy .entry-row .sub .n { position: absolute; font-family: var(--font-mono); font-size: 0.86em; color: var(--color-text-secondary); padding-top: 0.12em; }
.policy .entry-row .cl .n { left: 0; }
.policy .entry-row .sub .n { left: 3.2em; }
.policy .table-scroll { overflow-x: auto; margin: 0 0 var(--space-5); max-width: 46em; }
.policy table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.5; }
.policy th { text-align: left; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-secondary); border-bottom: 2px solid var(--color-border-primary); padding: var(--space-2) var(--space-4) var(--space-2) 0; }
.policy td { vertical-align: top; border-bottom: 1px solid var(--color-border-secondary); padding: var(--space-3) var(--space-4) var(--space-3) 0; min-width: 9em; }
.draft-banner { margin: 0 0 clamp(var(--space-5), 3vw, var(--space-8)); padding: var(--space-4) var(--space-5); border: 2px solid var(--color-fg-brand); background: var(--color-bg-secondary); max-width: 46em; }
mark.draft-flag { background: var(--color-bg-highlight); color: inherit; padding: 0 var(--space-0-5); }
mark.draft-flag::before { content: attr(data-flag); display: block; width: fit-content; margin: var(--space-0-5) 0; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-brand); }

/* Radii (GA346): cards and sheets, then controls. */
.interview .page, .fieldnotes .deck, .fieldnotes .stage, .quote-box, .snapshot-result, form.notebook, .done, .draft-banner { border-radius: var(--radius-xl); }
.interview .mic, .fieldnotes .controls button, .fieldnotes .keep .save, .fieldnotes .choice, .fieldnotes .bx, .fieldnotes .thumb, .fieldnotes .doc { border-radius: var(--radius-md); }
.interview .page, .fieldnotes .deck, .quote-box { border-color: var(--color-border-secondary); }
.interview .page, .fieldnotes .deck { box-shadow: var(--shadow-sm); }


/* Home: the hero holds the notes play beside the copy on desktop; How it works holds the steps play full width. */
.hero-play { margin-top: var(--space-8); min-width: 0; }
.play-fallback .tag { align-self: flex-start; }
#how .play { margin-bottom: var(--space-8); }
@media (min-width: 1024px) {
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
  .hero-play { margin-top: 0; }
  .hero-grid h1 { font-size: var(--text-display-lg); line-height: var(--text-display-lg--line-height); }
}

/* Inner pages (lane C) */
.not-found .lede { max-width: 56ch; }
.not-found-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); margin-top: var(--space-6); }
.opportunity .estimate-note { font-size: var(--text-xs); color: var(--color-text-tertiary); }
.site-foot .credit { flex-basis: 100%; color: var(--color-text-tertiary); }
