:root {
  --ink: #0f1714;
  --ink-2: #16211d;
  --ink-3: #1e2c27;
  --line: rgba(239, 231, 216, 0.14);
  --line-2: rgba(239, 231, 216, 0.26);
  --bone: #efe7d8;
  --bone-2: #c9c0ae;
  --mute: #8e978f;
  --amber: #d9a35b;
  --amber-2: #f0c27e;
  --amber-dim: rgba(217, 163, 91, 0.14);
  --sage: #8fa89a;
  --rust: #d07a5b;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --bar: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--bone); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: var(--amber-2); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber-2); outline-offset: 3px; border-radius: 6px; }

.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em; border: 1px solid var(--line-2);
  padding: 0.85em 1.4em; border-radius: 999px; cursor: pointer; font-weight: 600; letter-spacing: 0.01em;
  background: transparent; transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-amber { background: var(--amber); color: #1c140a; border-color: var(--amber); }
.btn-amber:hover { background: var(--amber-2); }
.btn-ghost:hover { border-color: var(--bone); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn-chip {
  display: inline-flex; align-items: center; gap: 0.4em; cursor: pointer; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--line-2); background: transparent; padding: 0.42em 0.9em; border-radius: 999px;
  transition: border-color 0.2s, background 0.2s;
}
.btn-chip:hover { border-color: var(--amber); }
.btn-chip.danger { color: var(--rust); }
.btn-link { background: none; border: 0; color: var(--amber-2); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ---------- opening ---------- */
.opening { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; overflow: hidden; background: var(--ink); }
.opening-bg {
  position: absolute; inset: -4%; background: var(--img) center 60% / cover no-repeat;
  animation: kenburns 28s var(--ease) both; filter: saturate(0.9) contrast(1.05);
}
@keyframes kenburns { from { transform: scale(1.14) translate(1.5%, 1%); opacity: 0; } 8% { opacity: 1; } to { transform: scale(1) translate(0, 0); } }
.opening-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 23, 20, 0.92) 0%, rgba(15, 23, 20, 0.55) 46%, rgba(15, 23, 20, 0.05) 75%),
    linear-gradient(0deg, rgba(15, 23, 20, 0.95) 0%, rgba(15, 23, 20, 0) 45%);
}
.opening::before, .opening::after { content: ""; position: absolute; left: 0; right: 0; height: 7vh; background: #0a0f0d; z-index: 3; animation: letterbox 1.6s var(--ease) 0.2s both; }
.opening::before { top: 0; transform-origin: top; }
.opening::after { bottom: 0; transform-origin: bottom; }
@keyframes letterbox { from { transform: scaleY(7); } to { transform: scaleY(1); } }
.opening-inner { position: relative; z-index: 2; padding: 0 clamp(1.5rem, 7vw, 7rem) calc(7vh + 4rem); max-width: 860px; }
.credit { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.32em; font-size: 0.72rem; color: var(--amber-2); margin: 0; }
.open-title { font-family: var(--serif); font-weight: 400; font-size: clamp(4.5rem, 14vw, 11rem); line-height: 0.86; margin: 0.15em 0 0.12em; letter-spacing: -0.02em; }
.open-title span { font-size: 0.42em; vertical-align: 0.9em; color: var(--bone-2); font-style: italic; }
.open-title em { color: var(--bone); }
.open-lede { max-width: 30rem; color: var(--bone-2); font-size: 1.08rem; margin: 1.6rem 0 2rem; }
.open-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.open-fine { font-size: 0.78rem; color: var(--mute); margin-top: 2.4rem; }
.open-fine a { color: inherit; }
.open-crisis { position: absolute; z-index: 4; right: clamp(1rem, 4vw, 3rem); bottom: calc(7vh + 1.2rem); margin: 0; font-size: 0.78rem; color: var(--bone-2); max-width: 19rem; text-align: right; }
.c1, .c2, .c3, .c4, .c5, .c6 { animation: rise 1.4s var(--ease) both; }
.c1 { animation-delay: 1.1s; } .c2 { animation-delay: 1.7s; } .c3 { animation-delay: 2.5s; }
.c4 { animation-delay: 3.0s; } .c5 { animation-delay: 3.4s; } .c6 { animation-delay: 3.8s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.opening.leaving { animation: fadeout 0.9s var(--ease) forwards; }
@keyframes fadeout { to { opacity: 0; transform: scale(1.04); } }

/* ---------- app frame ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.bar { position: fixed; left: 0; right: 0; z-index: 30; height: var(--bar); display: flex; align-items: center; gap: 1rem; padding: 0 clamp(0.8rem, 3vw, 2rem); background: rgba(10, 15, 13, 0.92); backdrop-filter: blur(10px); }
.bar-top { top: 0; border-bottom: 1px solid var(--line); }
.bar-bottom { bottom: 0; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); height: calc(var(--bar) + env(safe-area-inset-bottom)); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; background: none; border: 0; cursor: pointer; color: var(--amber); padding: 0; }
.brand span { color: var(--bone); font-family: var(--serif); font-size: 1.25rem; }
.brand em { color: var(--amber-2); }
.timecode { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; color: var(--mute); margin-left: auto; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timecode b { color: var(--amber-2); font-weight: 500; }
.bar-actions { display: flex; align-items: center; gap: 0.8rem; }
.saved { font-family: var(--mono); font-size: 0.68rem; color: var(--sage); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0; transition: opacity 0.4s; }
.saved.on { opacity: 1; }
.filmstrip { flex: 1; display: flex; gap: 3px; height: 22px; align-items: center; padding: 0 1rem; min-width: 0; }
.filmstrip i { flex: 1; height: 14px; border-radius: 2px; background: var(--ink-3); position: relative; transition: background 0.4s, height 0.3s; }
.filmstrip i.done { background: rgba(143, 168, 154, 0.55); }
.filmstrip i.partial { background: rgba(217, 163, 91, 0.35); }
.filmstrip i.cur { background: var(--amber); height: 22px; }
.filmstrip i.act { margin-left: 7px; }
.bar-bottom .btn { padding: 0.65em 1.2em; flex-shrink: 0; }

.stage { flex: 1; padding: calc(var(--bar) + clamp(2rem, 6vh, 5rem)) clamp(1.2rem, 5vw, 5rem) calc(var(--bar) + 4rem); outline: none; }

/* ---------- scene ---------- */
.scene { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 6rem); max-width: 1320px; margin: 0 auto; }
.scene-head { position: sticky; top: calc(var(--bar) + 3rem); align-self: start; }
.scene-meta { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber-2); display: flex; gap: 1rem; flex-wrap: wrap; }
.scene-meta span + span { color: var(--mute); }
.scene-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 5.4vw, 4.8rem); line-height: 0.98; margin: 0.4em 0 0.35em; letter-spacing: -0.015em; text-wrap: balance; }
.scene-intro { color: var(--bone-2); font-size: 1.04rem; max-width: 30rem; margin: 0; }
.scene-form { margin-top: 1.4rem; font-size: 0.8rem; color: var(--mute); border-left: 2px solid var(--amber); padding-left: 0.8rem; }
.scene-body { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.6rem 1.4rem; align-content: start; }
.scene-body > * { grid-column: span 6; }
.scene-body > .half { grid-column: span 3; }
.scene-body > .third { grid-column: span 2; }

.scene.enter .scene-head > * { animation: rise 0.9s var(--ease) both; }
.scene.enter .scene-head > *:nth-child(2) { animation-delay: 0.08s; }
.scene.enter .scene-head > *:nth-child(3) { animation-delay: 0.16s; }
.scene.enter .scene-head > *:nth-child(4) { animation-delay: 0.22s; }
.scene.enter .scene-body > * { animation: rise 0.8s var(--ease) both; animation-delay: calc(0.18s + var(--i, 0) * 0.045s); }
.scene.exit { animation: sceneout 0.38s var(--ease) forwards; }
.scene.exit.back { animation-name: sceneoutback; }
@keyframes sceneout { to { opacity: 0; transform: translateX(-30px); filter: blur(4px); } }
@keyframes sceneoutback { to { opacity: 0; transform: translateX(30px); filter: blur(4px); } }

/* NA switch */
.na-switch { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1.1rem; border: 1px dashed var(--line-2); border-radius: var(--radius); cursor: pointer; }
.na-switch input { width: 1.1rem; height: 1.1rem; accent-color: var(--amber); }
.na-switch.on { border-style: solid; border-color: var(--amber); background: var(--amber-dim); }
.na-blank { color: var(--mute); font-style: italic; padding: 2rem 0; font-family: var(--serif); font-size: 1.6rem; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.field > label, .field > .lbl { font-size: 0.86rem; font-weight: 600; color: var(--bone); letter-spacing: 0.01em; }
.req-dot { color: var(--amber); margin-left: 0.25em; }
.hint { font-size: 0.8rem; color: var(--mute); margin: -0.2rem 0 0; }
.err { font-size: 0.8rem; color: var(--rust); display: none; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid textarea, .field.invalid .chips { border-color: var(--rust); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="month"], input[type="number"], textarea, select {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line); color: var(--bone); border-radius: 10px;
  padding: 0.8rem 0.9rem; font: inherit; font-size: 1rem; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  color-scheme: dark;
}
textarea { resize: vertical; min-height: 3.2rem; line-height: 1.5; }
input:hover, textarea:hover, select:hover { border-color: var(--line-2); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber); background: var(--ink-3); box-shadow: 0 0 0 4px var(--amber-dim); }
::placeholder { color: #5f6a64; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; border: 1px solid transparent; border-radius: 12px; }
.chips.col { flex-direction: column; align-items: flex-start; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chip span {
  display: inline-flex; align-items: center; gap: 0.5em; padding: 0.55em 1em; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 0.92rem; transition: all 0.2s var(--ease); user-select: none;
}
.chip span::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50%; border: 1.5px solid var(--mute); transition: all 0.2s; }
.chip.sq span::before { border-radius: 2px; }
.chip:hover span { border-color: var(--bone-2); }
.chip input:checked + span { background: var(--amber); color: #1c140a; border-color: var(--amber); font-weight: 600; }
.chip input:checked + span::before { background: #1c140a; border-color: #1c140a; }
.chip input:focus-visible + span { outline: 2px solid var(--amber-2); outline-offset: 3px; }
.select-all { font-size: 0.78rem; }

.subhead { font-family: var(--serif); font-size: 1.7rem; margin: 0.6rem 0 -0.6rem; color: var(--bone); }
.subhead:first-child { margin-top: 0; }

.callout { padding: 1rem 1.2rem; border-radius: var(--radius); font-size: 0.92rem; color: var(--bone-2); border: 1px solid var(--line); background: var(--ink-2); }
.callout.amber { border-color: rgba(217, 163, 91, 0.5); background: var(--amber-dim); color: var(--bone); }
.callout.rust { border-color: rgba(208, 122, 91, 0.6); background: rgba(208, 122, 91, 0.12); color: var(--bone); }

.ft-agebadge { display: flex; align-items: flex-end; justify-content: flex-end; }
.ft-agebadge .badge { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.6rem 1rem; border-radius: 12px; border: 1px solid var(--line); width: 100%; min-height: 3.2rem; justify-content: center; }
.badge b { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; line-height: 1; color: var(--amber-2); }
.badge small { color: var(--mute); font-size: 0.78rem; }

/* rules list */
.rules { list-style: none; margin: 0; padding: 0; counter-reset: r; display: grid; gap: 0; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 3rem 1fr; gap: 0.2rem 1rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.rules li::before { content: counter(r, decimal-leading-zero); font-family: var(--mono); font-size: 0.76rem; color: var(--amber); grid-row: span 2; padding-top: 0.25rem; }
.rules b { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.rules span { color: var(--bone-2); font-size: 0.94rem; }

/* repeat tables */
.repeat { display: grid; gap: 0.8rem; }
.row {
  position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)) 2.2rem; gap: 0.6rem; align-items: end;
  padding: 1rem; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); animation: rise 0.5s var(--ease) both;
}
.row.stacked { grid-template-columns: repeat(2, minmax(0, 1fr)) 2.2rem; }
.row.stacked .cell.wide { grid-column: span 2; }
.row .cell { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.row .cell.wide { grid-column: span 2; }
.row .cell label { font-size: 0.72rem; color: var(--mute); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.row input, .row select { padding: 0.6rem 0.7rem; font-size: 0.94rem; background: var(--ink); }
.row-del { align-self: start; justify-self: end; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--mute); grid-column: -2; grid-row: 1; }
.row-del:hover { color: var(--rust); border-color: var(--rust); }
.row-n { position: absolute; top: -0.6rem; left: 1rem; font-family: var(--mono); font-size: 0.66rem; background: var(--ink); padding: 0 0.4rem; color: var(--amber); letter-spacing: 0.12em; }
.add-row { justify-self: start; border-style: dashed; }
.empty-rows { padding: 1.4rem; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--mute); font-size: 0.9rem; }

/* timeline */
.timeline { position: relative; display: flex; height: 3.6rem; margin-bottom: 0.6rem; border-radius: 10px; overflow: hidden; background: var(--ink-2); border: 1px solid var(--line); }
.timeline .seg { position: relative; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #1c140a; font-weight: 600; overflow: hidden; white-space: nowrap; padding: 0 0.4rem; border-right: 2px solid var(--ink); min-width: 4px; transition: flex-grow 0.6s var(--ease); }
.timeline .seg span { overflow: hidden; text-overflow: ellipsis; }
.timeline-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.66rem; color: var(--mute); margin-top: -0.3rem; }
.timeline-empty { color: var(--mute); font-size: 0.82rem; margin: auto; }

/* milestones */
.ms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1.2rem; }
.ms { display: grid; grid-template-columns: 1fr 7.5rem; gap: 0.5rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.ms > span { font-size: 0.94rem; }
.ms input { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
.ms-q { grid-column: span 2; display: flex; gap: 0.4rem; }
.ms-q button { font-size: 0.7rem; padding: 0.25em 0.7em; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; color: var(--mute); }
.ms-q button.on { border-color: var(--amber); color: var(--amber-2); }

/* symptoms */
.sx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.sx { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; background: var(--ink-2); display: flex; flex-direction: column; gap: 0.6rem; transition: border-color 0.3s; }
.sx.yes { border-color: var(--amber); }
.sx b { font-weight: 600; font-size: 0.95rem; }
.sx .chips .chip span { padding: 0.35em 0.8em; font-size: 0.82rem; }
.sx-detail { grid-column: span 3; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--amber); background: var(--amber-dim); animation: rise 0.5s var(--ease) both; }
.sx-detail h4 { grid-column: span 2; margin: 0; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.sx-detail label { font-size: 0.72rem; color: var(--bone-2); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; display: flex; flex-direction: column; gap: 0.3rem; }

/* cross-cutting */
.ccm-progress { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 0.72rem; color: var(--mute); letter-spacing: 0.1em; text-transform: uppercase; }
.ccm-domain { font-family: var(--mono); font-size: 0.7rem; color: var(--amber); letter-spacing: 0.18em; text-transform: uppercase; margin: 1.2rem 0 0.2rem; }
.ccm-item { padding: 1.1rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.8rem; }
.ccm-q { display: grid; grid-template-columns: 2.2rem 1fr; font-size: 1.02rem; }
.ccm-q i { font-style: normal; font-family: var(--mono); color: var(--mute); font-size: 0.82rem; padding-top: 0.15rem; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; margin-left: 2.2rem; }
.scale.yn { grid-template-columns: repeat(3, minmax(0, 8rem)); }
.scale label { position: relative; cursor: pointer; }
.scale input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.scale span { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.1rem; min-height: 3.6rem; padding: 0.4rem; border-radius: 10px; border: 1px solid var(--line); transition: all 0.2s var(--ease); }
.scale span b { font-family: var(--serif); font-size: 1.4rem; font-weight: 400; line-height: 1; }
.scale span small { font-size: 0.66rem; color: var(--mute); line-height: 1.15; }
.scale label:hover span { border-color: var(--bone-2); }
.scale input:checked + span { background: var(--amber); border-color: var(--amber); color: #1c140a; }
.scale input:checked + span small { color: #3a2a14; }
.scale input:focus-visible + span { outline: 2px solid var(--amber-2); outline-offset: 2px; }
.ccm-copy { font-size: 0.72rem; color: var(--mute); }

/* docs */
.doc { position: relative; background: var(--bone); color: #2a2620; border-radius: 4px; padding: clamp(1.4rem, 3vw, 2.4rem); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7); font-size: 0.96rem; line-height: 1.65; }
.doc::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 30%); pointer-events: none; border-radius: inherit; }
.doc h4 { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; margin: 1.2em 0 0.2em; color: #1b1915; }
.doc h4:first-child { margin-top: 0; }
.doc p { margin: 0 0 0.9em; }
.doc ul { margin: 0 0 0.9em; padding-left: 1.2em; }
.doc li { margin-bottom: 0.35em; }
.doc strong { color: #14120f; }
.doc a { color: #8a5a1c; }
.doc-alert { background: #2a2620; color: var(--bone); padding: 0.7rem 1rem; border-radius: 6px; }
.doc-alert strong { color: var(--amber-2); }
.doc-fine { font-size: 0.82rem; color: #6b6458; font-family: var(--mono); letter-spacing: 0.04em; }
.doc-letterhead { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: #7d7466; border-bottom: 1px solid #cfc5b3; padding-bottom: 0.7rem; margin-bottom: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ack { display: flex; gap: 0.8rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; transition: all 0.2s; }
.ack input { width: 1.15rem; height: 1.15rem; accent-color: var(--amber); margin-top: 0.15rem; flex-shrink: 0; }
.ack.on { border-color: var(--sage); background: rgba(143, 168, 154, 0.1); }
.ack .btn-link { font-size: 0.86rem; }

/* signatures */
.vault { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.pad-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--ink-2); display: grid; gap: 0.7rem; }
.pad-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.pad-card header b { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.pad-card header small { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.pad-wrap { position: relative; background: #f5efe3; border-radius: 8px; height: 150px; overflow: hidden; touch-action: none; }
.pad-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.pad-wrap::after { content: "Sign here"; position: absolute; left: 1rem; right: 1rem; bottom: 1.8rem; border-bottom: 1px solid #b6ad9c; font-size: 0.66rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: #9d9483; padding-bottom: 0.2rem; pointer-events: none; }
.pad-tools { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.ink { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line-2); cursor: pointer; }
.ink.on { border-color: var(--amber-2); box-shadow: 0 0 0 2px var(--ink-2), 0 0 0 4px var(--amber); }
.pad-tools .spacer { flex: 1; }
.typed-sig { font-family: var(--serif); font-style: italic; }

.signs { display: grid; gap: 0.7rem; }
.signs-note { font-size: 0.82rem; color: var(--mute); margin: 0; }
.sign-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); transition: border-color 0.3s; }
.sign-row.signed { border-color: var(--sage); }
.sign-row.needed { border-color: rgba(208, 122, 91, 0.6); }
.sign-who b { display: block; font-size: 1rem; }
.sign-who small { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.sign-who small em { color: var(--amber); font-style: normal; }
.sign-stamp { display: flex; align-items: center; gap: 0.8rem; }
.sign-stamp img { height: 48px; background: #f5efe3; border-radius: 6px; padding: 2px 6px; animation: stamp 0.5s var(--ease) both; }
@keyframes stamp { from { transform: scale(1.4) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.sign-stamp time { font-family: var(--mono); font-size: 0.7rem; color: var(--sage); }

/* records */
.recs { display: grid; gap: 0.5rem; }
.rec { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.rec > span { font-size: 0.94rem; }
.rec .chips .chip span { padding: 0.32em 0.75em; font-size: 0.78rem; }
.status-list { display: grid; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.pill { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.25em 0.7em; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line-2); color: var(--mute); }
.pill.ok { color: var(--sage); border-color: var(--sage); }
.pill.warn { color: var(--rust); border-color: rgba(208, 122, 91, 0.6); }
.pill.na { color: var(--bone-2); }

/* review */
.review-hero { display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center; padding: 1.4rem; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); }
.ring { --p: 0; width: 108px; height: 108px; border-radius: 50%; background: conic-gradient(var(--amber) calc(var(--p) * 1%), var(--ink-3) 0); display: grid; place-items: center; }
.ring b { width: 84px; height: 84px; border-radius: 50%; background: var(--ink-2); display: grid; place-items: center; font-family: var(--serif); font-size: 2rem; font-weight: 400; }
.review-hero h3 { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; margin: 0 0 0.3rem; }
.review-hero p { margin: 0; color: var(--bone-2); font-size: 0.92rem; }
.review-list { list-style: none; margin: 0; padding: 0; }
.review-list li { display: grid; grid-template-columns: 3rem 1fr auto auto; gap: 1rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.review-list .n { font-family: var(--mono); font-size: 0.7rem; color: var(--mute); }
.review-list .t { font-size: 0.95rem; }
.review-list .t small { display: block; color: var(--mute); font-size: 0.76rem; }
.review-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.deliver { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.deliver > div { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.88rem; color: var(--bone-2); }
.deliver b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.25rem; color: var(--bone); margin-bottom: 0.3rem; }
.ccm-summary { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.ccm-summary th, .ccm-summary td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); }
.ccm-summary th { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
.ccm-summary td.score { font-family: var(--mono); }
.flag { color: var(--amber-2); font-weight: 600; }

/* ---------- chapter card ---------- */
.chapter { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #0a0f0d; animation: chapterin 0.6s var(--ease) both; cursor: pointer; }
.chapter-bg { position: absolute; inset: 0; background: var(--img) center / cover no-repeat; opacity: 0.32; animation: kenburns 9s var(--ease) both; filter: saturate(0.7); }
.chapter::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 20%, rgba(10, 15, 13, 0.9) 80%); }
.chapter-inner { position: relative; z-index: 2; text-align: center; padding: 2rem; }
.chapter-n { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.5em; text-transform: uppercase; color: var(--amber-2); margin: 0; animation: rise 1s var(--ease) 0.2s both; }
.chapter-title { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(3.4rem, 10vw, 8rem); line-height: 0.95; margin: 0.25em 0; animation: rise 1.2s var(--ease) 0.45s both; }
.chapter-sub { color: var(--bone-2); margin: 0 0 2.4rem; animation: rise 1s var(--ease) 0.8s both; letter-spacing: 0.08em; }
.chapter-skip { animation: rise 1s var(--ease) 1.1s both; }
.chapter.leaving { animation: fadeout 0.6s var(--ease) forwards; }
@keyframes chapterin { from { opacity: 0; } }

/* ---------- reel drawer ---------- */
.reel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 70; background: var(--ink-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; animation: drawer 0.45s var(--ease) both; box-shadow: -40px 0 80px rgba(0, 0, 0, 0.5); }
@keyframes drawer { from { transform: translateX(100%); } }
.reel-head { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); }
.reel-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; margin: 0; }
.reel-list { list-style: none; margin: 0; padding: 0.6rem 0; overflow-y: auto; flex: 1; }
.reel-list .act-h { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); padding: 1rem 1.4rem 0.4rem; }
.reel-list button { width: 100%; display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 0.6rem; align-items: center; text-align: left; background: none; border: 0; cursor: pointer; padding: 0.55rem 1.4rem; font-size: 0.92rem; }
.reel-list button:hover { background: var(--ink-3); }
.reel-list button.cur { background: var(--amber-dim); }
.reel-list .n { font-family: var(--mono); font-size: 0.7rem; color: var(--mute); }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--ink-3); border: 1px solid var(--line-2); }
.dot.done { background: var(--sage); border-color: var(--sage); }
.dot.partial { background: var(--amber); border-color: var(--amber); }
.reel-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- modal ---------- */
.docmodal { border: 0; padding: 0; background: transparent; max-width: min(820px, 94vw); width: 100%; max-height: 88vh; color: inherit; }
.docmodal::backdrop { background: rgba(5, 8, 7, 0.78); backdrop-filter: blur(4px); }
.docmodal-inner { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: 88vh; }
.docmodal header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); gap: 1rem; }
.docmodal h2 { font-family: var(--serif); font-weight: 400; margin: 0; font-size: 1.6rem; }
.docmodal .doc-body { overflow-y: auto; padding: 1.4rem; }
.docmodal .doc-body .doc { box-shadow: none; }

/* ---------- crisis ---------- */
.crisis { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar) + 1rem); z-index: 40; width: min(720px, 94vw); display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: var(--radius); background: #3a1d14; border: 1px solid var(--rust); animation: rise 0.6s var(--ease) both; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.crisis p { margin: 0; font-size: 0.9rem; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .scene { grid-template-columns: 1fr; gap: 1.6rem; }
  .scene-head { position: static; }
  .sx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-detail { grid-column: span 2; }
  .deliver { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .scene-body > .half, .scene-body > .third { grid-column: span 6; }
  .row, .row.stacked { grid-template-columns: 1fr 2.2rem; }
  .row .cell, .row .cell.wide, .row.stacked .cell.wide { grid-column: 1; }
  .row-del { grid-column: 2; }
  .ms-grid { grid-template-columns: 1fr; }
  .sx-grid { grid-template-columns: 1fr; }
  .sx-detail { grid-column: span 1; grid-template-columns: 1fr; }
  .sx-detail h4 { grid-column: span 1; }
  .scale { margin-left: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .scale span small { display: none; }
  .timecode { display: none; }
  .filmstrip { padding: 0 0.4rem; }
  .brand span { font-size: 1.05rem; }
  .review-list li { grid-template-columns: 2rem 1fr auto; }
  .review-list li .btn-chip { grid-column: 2 / -1; justify-self: start; }
  .open-crisis { position: relative; right: auto; bottom: auto; text-align: left; padding: 0 1.5rem; margin-bottom: calc(7vh + 1rem); z-index: 2; }
  .opening { align-content: end; }
  .opening-inner { padding-bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .grain { animation: none; }
}

/* ---------- print ---------- */
.print-root { display: none; }
@media print {
  @page { size: letter; margin: 0.6in 0.6in 0.7in; }
  html, body { background: #fff !important; color: #111 !important; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; font-family: Georgia, "Times New Roman", serif; font-size: 10.5pt; line-height: 1.45; color: #111; }
  .pr-form { break-before: page; }
  .pr-form:first-child { break-before: auto; }
  .pr-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1.5pt solid #111; padding-bottom: 6pt; margin-bottom: 10pt; font-family: Helvetica, Arial, sans-serif; font-size: 8pt; }
  .pr-head b { font-size: 10pt; display: block; }
  .pr-form h2 { font-size: 15pt; margin: 0 0 2pt; text-transform: uppercase; letter-spacing: 0.04em; }
  .pr-form h3 { font-size: 11pt; margin: 12pt 0 4pt; border-bottom: 0.5pt solid #999; padding-bottom: 2pt; }
  .pr-client { font-family: Helvetica, Arial, sans-serif; font-size: 9pt; margin-bottom: 10pt; }
  .pr-kv { display: grid; grid-template-columns: 2.3in 1fr; gap: 2pt 10pt; font-size: 9.5pt; margin-bottom: 4pt; }
  .pr-kv dt { color: #444; }
  .pr-kv dd { margin: 0; border-bottom: 0.5pt solid #bbb; min-height: 12pt; white-space: pre-wrap; }
  .print-root table { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 4pt 0 8pt; }
  .print-root th, .print-root td { border: 0.5pt solid #777; padding: 3pt 5pt; text-align: left; vertical-align: top; }
  .print-root th { background: #eee; }
  .pr-doc { font-size: 10pt; }
  .pr-doc h4 { font-size: 10.5pt; margin: 8pt 0 2pt; }
  .pr-doc ul { margin: 2pt 0 6pt; }
  .pr-sigs td img { height: 34pt; }
  .pr-foot { font-family: Helvetica, Arial, sans-serif; font-size: 7.5pt; color: #555; margin-top: 12pt; }
  .pr-na { font-style: italic; color: #333; }
}
