/* How it works: a sticky index, chapters that answer the buyer's questions in order, the step log, the workrooms. */

.hiw { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.hiw .sticky-aside .label { display: block; margin-bottom: 8px; }
.hiw .index a { font-size: .92rem; color: var(--fg); padding: 6px 12px; }
.hiw .index a.is-current, .hiw .index a:hover { background: var(--butter); font-weight: 700; }
.chapters { display: grid; gap: 0; }
.chapter { padding: clamp(24px, 3vw, 40px) 0; border-top: 1px solid var(--rule); scroll-margin-top: 90px; }
.chapter:first-child { border-top: 0; padding-top: 0; }
.chapter .q { font-family: var(--ui); font-size: .8rem; color: var(--muted); margin: 0 0 8px; }
.chapter h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); margin-bottom: 12px; }
.chapter .two { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start; }
.chapter .two > * { min-width: 0; }
.chapter figure.shot { margin: 0; background: #fff; border-radius: 12px; padding: 6px; box-shadow: var(--shadow); }
.chapter figure.shot img { width: 100%; height: auto; border-radius: 8px; display: block; }
.chapter figure.shot figcaption { font-family: var(--ui); font-size: .78rem; color: var(--ink-2); padding: 8px 6px 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chapter .with-uwee { display: grid; grid-template-columns: 1fr 140px; gap: 16px; align-items: end; }
.chapter .with-uwee .uwee { width: 140px; }
@media (max-width: 1000px) { .hiw { grid-template-columns: 1fr; } .hiw .sticky-aside { position: static; } .hiw .index { display: flex; flex-wrap: wrap; gap: 6px; } }
@media (max-width: 860px) { .chapter .two { grid-template-columns: 1fr; } .chapter .with-uwee { grid-template-columns: 1fr 110px; } .chapter .with-uwee .uwee { width: 110px; } }

/* the paste-a-URL explainer */
.url-field { display: grid; gap: 6px; margin: 16px 0; }
.url-field label { font-weight: 700; }
.url-field .field { display: flex; gap: 8px; }
.url-field input { flex: 1; min-width: 0; min-height: 48px; border-radius: 999px; border: 1.5px solid var(--rule); padding: 0 18px; font: inherit; background: #fff; }
.url-field .notice { margin-top: 2px; }
.runlog { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 4px; }
.runlog li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 8px 10px; border-radius: 10px; opacity: .8; }
.runlog li.is-on { opacity: 1; background: var(--card); box-shadow: inset 4px 0 0 var(--amber); }
/* Build nine (the editor's row BeMXr6-RAUE-): the numbers take the draft loop's circles. The page's script (js/how.js) draws
   these rows with a bare span.n, so this mirrors the shared .sx-num (sections.css) declaration for declaration; once the
   script prints class="n sx-num", these two rules can go. Same on /demos, which prints the run log too. */
.runlog li .n { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; box-sizing: border-box; background: var(--card, #fff); border: 1px solid var(--rule, rgba(21, 23, 28, .12)); color: var(--fg, var(--ink)); font-family: var(--display); font-size: 1.05rem; font-weight: 700; line-height: 1; letter-spacing: 0; }
.runlog li.is-on .n { background: var(--amber); border-color: var(--amber); color: var(--navy); }
.runlog li b { font-family: var(--head); }
.runlog li p { margin: 2px 0 0; font-size: .92rem; color: var(--muted); } /* P3 (R09): every caption shows, so the card never grows as the run plays */
.runlog-count { font-family: var(--ui); font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
/* FIX-P3 (rule 11): the Uwee a caption names stands at the end of its step */
.runlog li.has-who { grid-template-columns: 48px 1fr 64px; align-items: center; }
.runlog li.has-who .n { align-self: start; }
.runlog .rl-who { width: 64px !important; height: 76px; display: flex; align-items: flex-end; justify-content: center; }
.runlog .rl-who img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.runlog .rl-who .shadow { display: none; }
/* FIX-P3 r2 (rule 7): demos' Filler is the lying-down still (landscape, used nowhere else), so its cell is wider to stay legible */
.runlog li.has-who:has(img[src$="filler-lie.webp"]) { grid-template-columns: 48px 1fr 104px; }
.runlog li.has-who:has(img[src$="filler-lie.webp"]) .rl-who { width: 104px !important; }
@media (max-width: 860px) { .runlog li.has-who:has(img[src$="filler-lie.webp"]) { grid-template-columns: 48px 1fr 84px; } .runlog li.has-who:has(img[src$="filler-lie.webp"]) .rl-who { width: 84px !important; } }

/* the step log */
.steplog { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: start; }
.steplog .steps li { cursor: pointer; border-radius: 12px; padding: 10px 12px; transition: background-color .2s var(--ease); }
.steplog .steps li.is-on { background: var(--card); }
.steplog .steps li { grid-template-columns: 52px 1fr; }
.steplog .steps li .n { width: 48px; height: 48px; font-size: .8rem; }
/* FIX-P3 (K09): the five panes share one cell; the shown one is visible, the card stretches to the tallest step */
.steplog .stage { display: grid; }
.steplog .stage > .pane { grid-area: 1 / 1; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: stretch; visibility: hidden; }
.steplog .stage > .pane.is-on { visibility: visible; }
.steplog .stage .owner { display: grid; gap: 6px; justify-items: center; text-align: center; align-self: start; }
.steplog .stage .owner .uwee { width: 120px; }
.steplog .stage .draft, .steplog .stage .client-record { grid-column: 2; }
.steplog .stage .draft { width: 100%; max-width: 440px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.steplog .stage .draft .sig { margin-top: 0; } /* the last line already carries 16px of padding above it */
/* FIX-P3 r2 (rule 9): the card still stretches to the tallest step (the log line never moves), but a shorter step spreads
   its spare height evenly between its lines instead of leaving one empty band above the signature line */
.steplog .stage .draft > .line { margin-top: auto; }
.steplog .stage .draft > span.line:last-of-type { padding-bottom: 16px; }
.steplog .stage .client-record { width: 100%; max-width: 440px; min-height: 0; }
.steplog .stage .client-record { display: flex; flex-direction: column; gap: 10px; }
.steplog .stage .client-record > :not(:first-child) { margin-top: auto; } /* FIX-P3 r2 (rule 9): same even spread on step 1 */
.steplog .logline { font-family: var(--ui); font-size: .8rem; color: var(--muted); margin: 1.5em 0 0; min-height: 3em; } /* K09: a line of space above the log line, the same on all five steps */
@media (max-width: 860px) {
  .steplog { grid-template-columns: 1fr; }
  .steplog .stage > .pane { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 12px; }
  .steplog .stage .owner { grid-template-columns: 72px 1fr; justify-items: start; text-align: left; align-items: center; gap: 10px; }
  .steplog .stage .owner .uwee { width: 72px !important; } /* JINN.figure writes an inline width; on the phone the owner sits beside the caption, never over it (G8) */
  .steplog .stage .draft, .steplog .stage .client-record { grid-column: 1; max-width: none; }
  .status-list { grid-template-columns: 1fr 1fr; gap: 6px; }
  .status-list li { padding: 8px 10px; font-size: .92rem; }
  table.plain.crossing td:nth-child(1) { font-weight: 700; }
  table.plain.crossing td:nth-child(1)::before { display: none; }
  table.plain.crossing td:nth-child(2)::before, table.plain.crossing td:nth-child(3)::before { display: inline; margin-right: 6px; }
}

/* verdict rows */
.verdicts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.verdicts li { display: grid; grid-template-columns: 148px 1fr; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--card); }
/* Build nine (Sarah dXvRtWidAddB, ZKhZgKmmZNRB): the verdict words about four points larger (.78rem, 12.5px, to 16.5px) and
   bold. A shared part: every page that prints ul.verdicts takes it (twelve; lane-B status). The word column widens from
   120px to 148px so "Named Failures" (141px) stays on one line. */
.verdicts .v { font-family: var(--ui); font-size: calc(.78rem + 4px); font-weight: 700; line-height: 1.3; padding: 3px 8px; border-radius: 6px; justify-self: start; }
.verdicts .v-ok { background: #d7efe3; color: #15503a; }
.verdicts .v-look { background: #fdeccb; color: #6b4a06; }
.verdicts .v-edit { background: #f8d5d2; color: #7a1f17; }
.verdicts p { margin: 0; }

/* four steps, voice */
.four { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; counter-reset: f; }
.four li { background: var(--card); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.four li b { font-family: var(--head); }
.four li p { margin: 0; font-size: .92rem; color: var(--muted); }
@media (max-width: 600px) { .four { grid-template-columns: 1fr; } }

/* roles */
.roles { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }

/* status list */
.status-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.status-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--card); }
.status-list li a { font-weight: 700; }

/* connection */
.channels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 18px; }
table.plain.crossing td { padding-block: 9px; }
table.plain.crossing td:nth-child(2) { font-weight: 700; white-space: nowrap; }
@media (max-width: 860px) { table.plain.crossing td:nth-child(2) { white-space: normal; } }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tools code { font-family: var(--mono); font-size: .85rem; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; }

/* workrooms: one room at a time */
.rooms .tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.rooms .tab { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--card); cursor: pointer; font-weight: 600; font-size: .95rem; scroll-margin-top: 110px; }
.rooms .tab[aria-selected="true"] { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.rooms .stage-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 28px; align-items: start; }
.rooms .stage-grid > * { min-width: 0; }
.rooms .plate video { display: none; }
.rooms .plate.is-acting video { display: block; }
.rooms .side h3 { font-size: 1.6rem; margin: 8px 0 6px; }
.rooms .side .crew { display: flex; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.rooms .side .crew .uwee { width: 64px; }
.rooms .side .io { font-size: .95rem; display: grid; gap: 6px; margin: 14px 0; }
.rooms .side .io b { font-family: var(--head); }
.rooms .side .btn { margin-top: 6px; }
@media (max-width: 860px) {
  .rooms .tabs { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .rooms .tab { flex: 0 0 auto; scroll-snap-align: start; }
  .rooms .stage-grid { grid-template-columns: 1fr; }
}

.close h2 { color: var(--paper); }
.close .lede { color: var(--on-dark); }

/* a quoted line from the crew, as text */
.quote { font-family: var(--serif-accent); font-style: italic; font-size: 1.15rem; line-height: 1.35; color: var(--amber-ink); margin: 14px 0 4px; }
.quote + .small { margin-top: 0; }

/* the demo doors */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; } /* R09: both doors keep one height */
.demo-grid > * { min-width: 0; }
.demo-card { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 28px); display: grid; gap: 12px; align-content: start; }
.demo-card h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-card .soon { font-family: var(--ui); font-size: .78rem; color: var(--muted); }
.demo-card figure { margin: 8px 0 0; }
.demo-card figure img { width: 100%; height: auto; border-radius: 10px; display: block; border: 1px solid var(--rule); }
.demo-card figcaption { font-family: var(--ui); font-size: .78rem; color: var(--ink-2); padding-top: 6px; }
.demo-card .url-field { margin: 4px 0 0; }
.demo-card .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
@media (max-width: 860px) { .demo-grid { grid-template-columns: 1fr; } }

/* phone, last so it wins */
@media (max-width: 860px) {
  .status-list { grid-template-columns: 1fr 1fr; gap: 6px; }
  .status-list li { padding: 8px 10px; font-size: .9rem; flex-direction: column; align-items: start; gap: 4px; }
  .status-list li a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; } /* SWEEP: 44 px under a thumb */
  .four li { padding: 10px 12px; }
  .chapter .two { gap: 16px; }
  .verdicts li { grid-template-columns: 124px 1fr; } /* build nine: the larger bold words; "Competitors" fits, two-word labels take two lines */
  .runlog li { padding: 6px 8px; }
  .url-field .field { flex-direction: column; }
}
@media (max-width: 860px) {
  #voice figure.shot { display: none; } /* the voice page screenshot stays on wider screens; the four steps carry the answer on a phone */
  .hiw .host .uwee { width: min(260px, 100%); }
}

/* learning modes, step 5: three plain cells, Auto shown as locked */
.learn-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.learn-modes div { background: var(--card); border-radius: 12px; padding: 12px 14px; }
.learn-modes dt { font-family: var(--head); font-weight: 700; }
.learn-modes dd { margin: 4px 0 0; font-size: .95rem; color: var(--muted); }
@media (max-width: 600px) { .learn-modes { grid-template-columns: 1fr; } }

/* P3 (R07/R09): each demo door names its Uwee beside its own still */
/* the audit picture follows its text; the card keeps the shared height (R09), and any spare room sits at the foot */
.crewrow { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.crewrow .uwee { width: 84px; height: 112px; }
.crewrow .uwee img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.crewrow p { margin: 0; font-size: 1.05rem; }
.crewrow p span { display: block; font-family: var(--ui); font-size: .85rem; font-weight: 700; color: var(--muted); }

/* P3 (D06): what you get back, the finished record shown large on butter */
.after-band { padding-block: clamp(48px, 7vw, 96px); }
.after-band .grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.after-band h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
.record-parts { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.record-parts li { background: var(--paper); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.record-parts li b { font-family: var(--head); font-size: 1.05rem; }
.record-parts li span { font-size: .9rem; color: var(--muted); }
/* r5 regression repair (D06 wins; G16 kept): the band is paper now, so the four parts carry the butter as filled cards (G16: butter stays in cards) and keep their pop */
#after .record-parts li { background: var(--butter); box-shadow: 0 6px 16px rgba(17,22,39,.10); }
#after .record-parts li span { color: var(--ink-2); }
.record-shot { margin: 0; background: #fff; border-radius: 16px; padding: 10px; box-shadow: 0 24px 60px rgba(17,22,39,.22); transform: rotate(-1deg); }
.record-shot img { width: 100%; height: auto; display: block; border-radius: 10px; }
.record-shot figcaption { font-family: var(--ui); font-size: .8rem; color: var(--ink-2); padding: 10px 4px 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 860px) { .after-band .grid { grid-template-columns: 1fr; } .record-parts { grid-template-columns: 1fr; } .record-shot { transform: none; } }

/* P3 (K10): the claim check runs as tall as the answer beside it */
.chapter .two--check { align-items: stretch; }
.chapter .two--check figure.shot { align-self: start; }
/* P3 (K11): the four steps in a row, the voice page at full chapter width, the learning loop below */
.four--row { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.chapter figure.shot--wide { max-width: 900px; }
.learn-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 24px; align-items: start; margin-top: 28px; }
.learn-row h3 { margin-top: 0; }
.learn-row .learn-modes { grid-template-columns: 1fr; margin-top: 0; }
@media (max-width: 1000px) { .four--row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .learn-row { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .four--row { grid-template-columns: 1fr; } }


/* FIX-P3 (R07): canon Pip (orange, blue crocheted overalls) pinning a source card, an alpha cutout used nowhere else (rule 7) */
.crewrow .uwee--pin { width: 104px; height: 112px; }
.crewrow:has(.uwee--pin) { grid-template-columns: 104px 1fr; }
.section-head .quiet-line { margin: 6px 0 0; }

/* FIX-P3 (K09): every step owner sits in the same square, whatever the still's shape, so no step is taller because of its Uwee */
.steplog .stage .owner .uwee { height: 120px; display: flex; align-items: flex-end; justify-content: center; }
.steplog .stage .owner .uwee img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
@media (max-width: 860px) { .steplog .stage .owner .uwee { height: 72px; } }
