/* The Testimonial App · design A "Conversation" (DESIGN.md, SPEC 24.1). Tokens from DESIGN.md. */
@font-face { font-family: "Cinzel"; src: url("/fonts/cinzel-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --linen: #F5F1E8; --paper: #FFFDF8; --ink: #1D2622; --ink-2: #4A5650; --line: #DDD6C8;
  --forest: #1D5443; --forest-press: #16473A; --forest-soft: #E2ECE5; --aurora: #2E8A6C; --guide: #9BE3C6;
  --warn: #B7791F; --warn-ink: #8A5A10; --danger: #B42318; --rec: #D93A3F; --focus: #0B6BCB; --off: #8C958F;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", system-ui, sans-serif;
  --brand: "Cinzel", "Trajan Pro", Georgia, serif;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --shadow-1: 0 1px 2px rgb(29 38 34 / .06), 0 2px 8px rgb(29 38 34 / .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--linen); color: var(--ink); font: 1.0625rem/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body { max-width: 30rem; margin: 0 auto; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; margin: 0; }
a { color: var(--forest); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* shell */
.screen { min-height: 100dvh; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(env(safe-area-inset-top) + 14px) 20px 10px; }
.ident { display: grid; gap: 2px; min-width: 0; }
.mark { white-space: nowrap; font-family: var(--brand); font-weight: 500; letter-spacing: .14em; font-size: .8125rem; color: var(--forest); }
.step { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.thread { flex: 1; padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.dock { position: sticky; bottom: 0; padding: 12px 20px calc(env(safe-area-inset-bottom) + 16px); background: linear-gradient(to top, var(--linen) 70%, rgb(245 241 232 / 0)); display: grid; gap: 8px; }
.indent { margin-left: 46px; }

/* voice toggle (SPEC 24.1: persistent control) */
.voicetoggle { display: inline-flex; border-radius: 999px; background: var(--forest-soft); padding: 2px; }
.voicetoggle button { border: 0; background: transparent; color: var(--forest); min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; font-size: .875rem; font-weight: 600; cursor: pointer; }
.voicetoggle button[aria-pressed="true"] { background: var(--forest); color: #fff; }

/* thread messages */
.from { display: flex; gap: 10px; align-items: flex-start; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-family: var(--brand); font-size: .9375rem; }
.from .stack { display: grid; gap: 6px; max-width: 86%; }
.bubble { background: var(--paper); border-radius: 20px 20px 20px 6px; padding: 12px 16px; box-shadow: var(--shadow-1); font-size: 1.125rem; line-height: 1.42; margin: 0; font-weight: 400; }
.bubble.lead { font-size: 1.3125rem; line-height: 1.32; font-weight: 600; letter-spacing: -.01em; }
.who { font-size: .8125rem; color: var(--ink-2); padding-left: 4px; }
.me { align-self: flex-end; max-width: 80%; background: var(--forest); color: #fff; border-radius: 20px 20px 6px 20px; padding: 10px 16px; font-size: 1.0625rem; }
.voice { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; min-height: 52px; border: 0; border-radius: 999px; background: var(--forest-soft); color: var(--forest); cursor: pointer; width: max-content; max-width: 100%; font-weight: 600; font-size: .9375rem; transition: transform .12s var(--ease); }
.voice:active { transform: scale(.96); }
.voice .pp { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--forest); display: grid; place-items: center; }
.voice .pp::before { content: ""; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.voice[aria-pressed="true"] .pp::before { border: 0; width: 10px; height: 12px; margin: 0; background: linear-gradient(90deg, #fff 35%, transparent 35% 65%, #fff 65%); }
.caption { font-size: .8125rem; color: var(--ink-2); }
.note { font-size: .875rem; color: var(--ink-2); line-height: 1.45; }
.small { font-size: .8125rem; color: var(--ink-2); }

/* buttons */
.btn { min-height: 56px; border-radius: 16px; border: 0; padding: 0 20px; font-size: 1.125rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; text-align: center; transition: transform .12s var(--ease), background-color .15s var(--ease); width: 100%; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--forest); color: #fff; }
/* V1-2: hover only on real hover devices and never on a disabled button (touch keeps :hover sticky after a tap) */
@media (hover: hover) { .btn.primary:hover:not([disabled]) { background: var(--forest-press); } }
.btn.quiet { background: transparent; color: var(--forest); min-height: 48px; font-size: 1rem; }
.btn.danger { background: transparent; color: var(--danger); min-height: 48px; font-size: 1rem; }
.btn[disabled] { background: #D3D9D5; color: var(--ink-2); cursor: not-allowed; transform: none; }
.hint { margin: 0; text-align: center; font-size: .875rem; color: var(--ink-2); }

/* choices */
.choices { display: grid; gap: 10px; }
.choice { text-align: left; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 14px 16px; min-height: 72px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 18px; cursor: pointer; transition: border-color .15s var(--ease), transform .12s var(--ease); width: 100%; }
.choice:active { transform: scale(.98); }
@media (hover: hover) { .choice:hover { border-color: var(--forest); } }
.choice b { font-size: 1.125rem; }
.choice span { grid-column: 1; font-size: .9375rem; color: var(--ink-2); }
.choice::after { content: "›"; grid-row: 1 / span 2; grid-column: 2; font-size: 1.75rem; color: var(--forest); }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--forest); background: var(--forest-soft); border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: 2px; }

/* cards */
.card { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow-1); overflow: hidden; }
.card h2 { font-size: 1.0625rem; margin: 0; padding: 14px 16px 0; }
.tips { list-style: none; margin: 0; padding: 14px 16px 16px; display: grid; gap: 10px; font-size: 1rem; }
.tips li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
.tips li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--aurora); margin: 8px 0 0 6px; }
.progress { display: flex; gap: 4px; margin-bottom: 8px; }
.progress i { height: 4px; flex: 1; border-radius: 2px; background: var(--line); }
.progress i.on { background: var(--forest); }
.diagram { display: block; width: 100%; max-width: 320px; height: auto; margin: 8px auto 0; }
.diagram text { font: 600 12px var(--sans); fill: var(--ink-2); }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px 0; }
.platforms button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-size: .9375rem; }
.platforms button[aria-pressed="true"] { border-color: var(--forest); background: var(--forest-soft); color: var(--forest); font-weight: 600; }
.breath { width: 120px; height: 120px; border-radius: 50%; margin: 12px auto; background: radial-gradient(circle, var(--guide), var(--aurora)); transform: scale(.7); }
.breath.in { transform: scale(1); transition: transform 4s ease-in-out; }
.breath.out { transform: scale(.7); transition: transform 6s ease-in-out; }

/* forms */
.check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; min-height: 52px; padding: 8px 16px; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-1); cursor: pointer; font-size: 1rem; }
.check input { width: 26px; height: 26px; accent-color: var(--forest); margin: 0; }
.field { display: grid; gap: 6px; }
.field input, .field select { min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--paper); }
.banner { background: var(--paper); color: var(--danger); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-1); font-size: .9375rem; }
.banner.ok { color: var(--forest); }
.code { font: 700 2rem/1.1 ui-monospace, Menlo, monospace; letter-spacing: .18em; text-align: center; }
.qr { display: block; width: 200px; height: 200px; margin: 8px auto; background: #fff; border-radius: 12px; padding: 8px; }

/* camera */
.cam { position: relative; background: #000; overflow: hidden; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.safezone { position: absolute; inset: 0; pointer-events: none; }
.sz-band { position: absolute; background: repeating-linear-gradient(135deg, rgb(255 255 255 / .16) 0 6px, rgb(255 255 255 / .05) 6px 12px); }
.sz-top { left: 0; right: 0; top: 0; height: 14%; border-bottom: 1px dashed rgb(255 255 255 / .7); }
.sz-bottom { left: 0; right: 0; bottom: 0; height: 28%; border-top: 1px dashed rgb(255 255 255 / .7); }
.sz-right { right: 0; top: 14%; bottom: 28%; width: 12%; border-left: 1px dashed rgb(255 255 255 / .7); }
.sz-eyes { position: absolute; left: 6%; right: 16%; top: 33.3%; border-top: 2px solid var(--guide); }
.sz-eyes span { position: absolute; right: 0; top: 4px; font-size: .75rem; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.checkcam { flex: none; border-radius: 24px; aspect-ratio: 9 / 16; height: min(34dvh, 320px); align-self: center; box-shadow: var(--shadow-1); }
.checks { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow-1); padding: 6px 16px; }
.row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); font-size: 1rem; }
.row:last-child { border: 0; }
.ok, .warn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .875rem; font-weight: 800; color: #fff; }
.ok { background: var(--aurora); } .ok::before { content: "✓"; }
.warn { background: var(--warn); } .warn::before { content: "!"; }
.row small { color: var(--ink-2); font-size: .875rem; }
.row small.fix { color: var(--warn-ink); font-weight: 700; }
.meter { width: 64px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--aurora); }

/* recording */
.rec { background: #000; color: #fff; }
.recwrap { position: relative; height: 100dvh; }
.recwrap .cam { position: absolute; inset: 0; }
.cue { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 8px); background: rgb(12 20 17 / .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 22px; padding: 12px 16px 14px; display: grid; gap: 6px; }
.cue .meta { display: flex; justify-content: space-between; align-items: center; font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.recdot { display: inline-flex; align-items: center; gap: 6px; }
.recdot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: pulse 2s var(--ease) infinite; }
.recdot.paused::before { animation: none; background: #fff; }
@keyframes pulse { 50% { opacity: .35; } }
.cue .words { font-size: 1.5rem; line-height: 1.22; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.cue .full { font-size: 1.0625rem; line-height: 1.35; color: rgb(255 255 255 / .9); margin: 0; }
.cue .speaking { font-size: .8125rem; color: var(--guide); font-weight: 600; }
.qbar { display: flex; gap: 3px; padding-top: 4px; }
.qbar i { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .3); }
.qbar i.done { background: var(--guide); }
.qbar i.current { background: #fff; }
.holdmsg { position: absolute; left: 50%; top: 46%; translate: -50% -50%; text-align: center; background: rgb(14 22 19 / .7); border-radius: 20px; padding: 16px 22px; font-size: 1.125rem; }
.holdmsg b { display: block; font-size: 2.5rem; font-variant-numeric: tabular-nums; }
.controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px calc(env(safe-area-inset-bottom) + 18px); background: linear-gradient(to top, rgb(0 0 0 / .78), rgb(0 0 0 / 0)); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.controls .btn { padding: 0 12px; font-size: 1.0625rem; }
.controls .wide { grid-column: 1 / -1; }
.btn.again { background: rgb(0 0 0 / .5); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .55); color: #fff; }
.btn.next { background: #fff; color: var(--forest); }
.btn.next[disabled] { background: rgb(0 0 0 / .35); color: rgb(255 255 255 / .85); outline: 1.5px dashed rgb(255 255 255 / .7); outline-offset: -3px; }
.pausebtn { position: absolute; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 104px); min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: rgb(0 0 0 / .5); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .55); color: #fff; font-size: .9375rem; font-weight: 600; cursor: pointer; }
/* voice switch while recording (SPEC 23.3): sits opposite Pause, same dark glass treatment */
.voicetoggle.onrec { position: absolute; left: 12px; bottom: calc(env(safe-area-inset-bottom) + 104px); background: rgb(0 0 0 / .5); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .55); }
.voicetoggle.onrec button { color: #fff; }
.voicetoggle.onrec button[aria-pressed="true"] { background: #fff; color: var(--forest); }
.sheetvoice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 8px; font-weight: 600; }
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 160px); background: var(--paper); color: var(--ink); border-radius: 14px; padding: 12px 16px; font-size: .9375rem; font-weight: 600; box-shadow: 0 6px 24px rgb(0 0 0 / .3); }
.offline { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 190px); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--paper); color: var(--ink); border-radius: 24px 24px 0 0; padding: 20px 20px calc(env(safe-area-inset-bottom) + 20px); display: grid; gap: 8px; box-shadow: 0 -6px 24px rgb(0 0 0 / .3); }
.sheet h2 { margin: 0 0 4px; font-size: 1.25rem; }
.discreet { position: absolute; left: 12px; top: calc(env(safe-area-inset-top) + 8px); background: rgb(12 20 17 / .7); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; gap: 12px; }

/* upload + review */
.bar2 { height: 8px; border-radius: 4px; background: var(--forest-soft); overflow: hidden; }
.bar2 i { display: block; height: 100%; width: 0; background: var(--forest); transition: width .2s linear; }
.review video { width: 100%; aspect-ratio: 9 / 16; max-height: 60dvh; background: #000; border-radius: 20px; object-fit: contain; }
.chapters { display: flex; flex-wrap: wrap; gap: 8px; }
.chapters button { min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-variant-numeric: tabular-nums; font-size: .9375rem; }
.filelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.filelist li { background: var(--paper); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-1); display: grid; gap: 6px; font-size: .9375rem; word-break: break-word; }

/* consent (SPEC 25: one card, three switches) */
.consent { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow-1); padding: 4px 0; border: 0; margin: 0; }
.consent legend { padding: 14px 16px 4px; font-weight: 700; font-size: 1rem; float: left; width: 100%; }
.tick { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; border-top: 1px solid var(--line); font-size: 1rem; cursor: pointer; clear: both; }
.tick input { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; position: relative; cursor: pointer; margin: 0; flex: none; box-shadow: inset 0 0 0 1.5px var(--off); background: #E4E7E3; transition: background-color .2s var(--ease); }
.tick input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .2); transition: translate .2s var(--ease); }
.tick input:checked { background: var(--forest); box-shadow: none; }
.tick input:checked::after { translate: 20px 0; }

.sent { background: var(--forest-soft); border-radius: 20px; padding: 14px 16px; display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; }
.next-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 1rem; }

/* orientation overlay */
.turn { position: fixed; inset: 0; background: var(--linen); color: var(--ink); display: none; place-items: center; text-align: center; padding: 24px; z-index: 10; font-size: 1.25rem; font-weight: 600; }
@media (orientation: landscape) and (max-height: 500px) { .turn.on { display: grid; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 370px) { html, body { font-size: 1rem; } .bubble { font-size: 1.0625rem; } .bubble.lead { font-size: 1.25rem; } .cue .words { font-size: 1.375rem; } }

/* print page */
.print { max-width: 46rem; padding: 24px; background: #fff; }
.print h1 { font-size: 1.5rem; margin: 0 0 4px; }
.print h2 { font-size: 1.0625rem; margin: 16px 0 6px; }
.print .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.print ol, .print ul { margin: 0; padding-left: 20px; font-size: .9375rem; }
.print .qrbox { text-align: center; }
.print .qr { width: 160px; height: 160px; }
.helperq { display: grid; gap: 6px; padding: 16px; }
.helperq .purpose { color: var(--ink-2); font-size: .9375rem; }
.helperq ul { margin: 0; padding-left: 20px; font-size: .9375rem; }
.print .purpose { display: block; color: var(--ink-2); font-size: .875em; }
/* SPEC 22.1 / C1 22-12: prints as ONE A4 page (e2e asserts the PDF page count) */
@media print {
  @page { size: A4; margin: 10mm 12mm; }
  html, body { background: #fff; max-width: none; font-size: 9.4pt; line-height: 1.34; }
  .noprint { display: none !important; }
  .print { padding: 0; max-width: none; }
  .print h1 { font-size: 14pt; margin: 0 0 2px; }
  .print h2 { font-size: 10pt; margin: 8px 0 3px; }
  .print p { margin: 0 0 4px; }
  .print ol, .print ul { font-size: 9.4pt; padding-left: 14px; }
  .print li { margin: 0 0 2px; break-inside: avoid; }
  .print .cols { grid-template-columns: 1fr 1fr; gap: 6mm; }
  .print .qr { width: 36mm; height: 36mm; }
}
@media (max-width: 560px) { .print .cols { grid-template-columns: 1fr; } }
