/* QA14 retains brass and ink; decisions and boards own the available screen. */
body.chapter-v5 #game[data-timed=true]:not([data-mode=ending]) .dialogue { max-height: calc(100svh - 128px); margin-top:auto; }
body.chapter-v5 #game[data-compact=true] .visual { position:relative; inset:auto; height:96px; min-height:96px; max-height:96px; margin:0; aspect-ratio:auto; }
body.chapter-v5 #game[data-compact=true] .visual #scene { object-fit:cover; }
body.chapter-v5 #game[data-compact=true] .dialogue { max-height:none; flex:1; margin:8px auto 0; }
body.chapter-v5 #game[data-compact=true] .dialogue-body { padding-right:4px; }
body.chapter-v5 #game[data-compact=true] .reading-avatar { width:44px; height:44px; }
body.chapter-v5 #game[data-compact=true] .reading-heading { gap:8px; }
body.chapter-v5 #game[data-compact=true] .reading-line,body.chapter-v5 #game[data-compact=true] .reading-dialogue,body.chapter-v5 #game[data-compact=true] .exchange-lines p { font-size:16px; line-height:1.4; margin:8px 0; }
body.chapter-v5 #game[data-compact=true] .reading-speech, body.chapter-v5 #game[data-compact=true] .reading-narration { margin-bottom:8px; }
body.chapter-v5 #game[data-compact=true] .choices { gap:8px; margin-top:12px; }
body.chapter-v5 #game[data-compact=true] .choices button { min-height:48px; padding:10px 12px; font-size:16px; line-height:1.35; }
body.chapter-v5 #game[data-timed=true] .choices button small { display:none; }
body.chapter-v5 #game[data-timed=true] .choices button[data-preview=true] small { display:block; font-size:13px; margin-top:6px; }
body.chapter-v5 #game[data-timed=true] .choices button[data-preview=true] { outline:2px solid #f3e2bc; outline-offset:2px; }
.decision-clock-tools { display:flex; gap:12px; align-items:center; justify-content:space-between; margin-top:10px; }
.decision-clock-tools .text-link { display:flex; align-items:center; gap:6px; min-height:44px; font-size:14px; padding:6px; }
.decision-clock-tools .game-icon { width:20px; height:20px; }
.world-timer { display:flex; align-items:center; gap:8px; color:#f3e2bc; }
.world-timer-ring { display:block; width:32px; height:32px; border-radius:50%; background:conic-gradient(#dec18a calc(var(--remaining,1) * 360deg),#584756 0); mask:radial-gradient(circle,transparent 48%,#140f1b 51%); }
.world-timer[data-world=board] .world-timer-ring { border-radius:6px; }
.world-timer .decision-time { margin:0; font-size:14px; white-space:nowrap; }
.more-options { font-size:14px; color:#f3e2bc; margin:8px 0 0; }
.timeout-banner { padding:8px 12px; background:#493b24; color:#f3e2bc; font-size:14px; line-height:1.4; }
body.chapter-v5 #game[data-mode=agreements],body.chapter-v5 #game[data-mode=matrix] { height:auto; min-height:100svh; overflow:visible; padding-bottom:calc(var(--board-footer-height,150px) + 24px); }
html:has(#game[data-mode=agreements]:not([hidden])),html:has(#game[data-mode=matrix]:not([hidden])) { scroll-padding-bottom:180px; }
body.chapter-v5 #game[data-mode=agreements] .dialogue,body.chapter-v5 #game[data-mode=matrix] .dialogue { overflow:visible; max-height:none; flex:none; filter:none; transform:none; }
body.chapter-v5 #game[data-mode=agreements] .dialogue-body,body.chapter-v5 #game[data-mode=matrix] .dialogue-body { overflow:visible; padding-right:0; }
body.chapter-v5 #game[data-mode=agreements] .actions,body.chapter-v5 #game[data-mode=matrix] .actions { position:fixed; bottom:0; left:0; width:100%; margin:0; padding:10px 16px; background:#191121; border-top:1px solid #b69a60; z-index:12; display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.board-progress { margin-right:auto; color:#f3e2bc; font-size:15px; }
.matrix-task { border:1px solid #9a805c; padding:16px; margin:12px 0; }
.matrix-task legend { padding:0 6px; color:#f3e2bc; font-weight:600; font-size:16px; }
.matrix-radios { display:flex; flex-wrap:wrap; gap:8px; }
.matrix-chip { display:flex; align-items:center; gap:8px; min-height:44px; min-width:44px; padding:8px 12px; border:1px solid #8c765b; background:#291f33; cursor:pointer; }
.matrix-chip:has(input:checked) { background:#dec18a; color:#211829; border-color:#f3e2bc; }
.matrix-chip img { width:36px; height:36px; object-fit:cover; border-radius:50%; }
.matrix-chip input { width:18px; height:18px; accent-color:#8c6d39; flex:none; }
.matrix-chip:hover,.agreement-card:hover { border-color:#f3e2bc; }
.matrix-chip:active,.agreement-card:active { transform:translateY(1px); }
.matrix-chip:focus-within { outline:2px solid #f3e2bc; outline-offset:2px; }
.journey-card,.resume-card,.chapter-hook { position:fixed; inset:0; width:100%; height:100svh; z-index:100; border:0; border-radius:0; background:#191121; color:#eee5df; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:24px; gap:20px; animation:qa14-arrive 180ms ease-out; }
.journey-card strong,.resume-card strong,.chapter-hook strong { font:600 clamp(28px,5vw,54px)/1.2 Fraunces,Georgia,serif; color:#dec18a; }
.journey-card span,.resume-card span,.chapter-hook span { max-width:60ch; font-size:18px; line-height:1.5; }
.team-reaction { position:fixed; right:20px; top:calc(var(--header-overlay,90px) + 8px); z-index:30; padding:12px 16px; border:1px solid #dec18a; background:#291f33; color:#f3e2bc; font-size:15px; animation:qa14-arrive 150ms ease-out; }
.journey-card[data-reduced=true],.resume-card[data-reduced=true],.chapter-hook[data-reduced=true],.team-reaction[data-reduced=true] { animation:none; }
.saved-progress { display:block; font-size:11px; color:#c9bed0; margin-top:4px; }
.fast-exchange-line { animation:qa14-arrive 250ms ease-out both; animation-delay:var(--line-delay,0ms); }
.chapter-hook span { white-space:pre-line; }
.continue-subtitle { display:block; font-size:13px; font-weight:400; margin-top:4px; }
.secret-moments { margin-top:24px; }
.secret-moment { padding:12px 0; border-bottom:1px solid #9a805c; }
.secret-moment strong { color:#dec18a; }
.cup-changed { animation:cup-change 300ms ease-out; }
@keyframes cup-change { from { opacity:.5; transform:translateY(3px); } to { opacity:1; transform:translateY(0); } }
@keyframes qa14-arrive { from { opacity:0; } to { opacity:1; } }
@media(max-width:760px) {
 body.chapter-v5 #game[data-compact=true] .dialogue { width:calc(100% - 16px); padding:12px 12px 8px; }
 body.chapter-v5 #game[data-compact=true] .speaker-row { display:none; }
 body.chapter-v5 #game[data-compact=true] .reading-role { display:none; }
 body.chapter-v5 #game[data-compact=true] .reading-heading { margin:0; }
 body.chapter-v5 #game[data-compact=true] #content p { margin:8px 0; }
 body.chapter-v5 #game[data-compact=true] .hud-hint { display:none; }
 body.chapter-v5 #game[data-compact=true] .foot { font-size:11px; padding:4px 12px; }
 body.chapter-v5 #game[data-mode=agreements] .actions .text-link { width:100%; min-height:44px; padding:4px; }
 body.chapter-v5 #panel[open][data-kind=time-onboarding] { width:100%; max-height:100svh; height:100svh; overflow-y:auto; display:block; margin:0; padding:20px 16px 100px; }
 body.chapter-v5 #panel[data-kind=time-onboarding] #panel-content { overflow:visible; max-height:none; }
 body.chapter-v5 #panel[data-kind=time-onboarding] .panel-bottom { position:fixed; bottom:0; left:0; width:100%; background:#191121; padding:12px 16px; z-index:4; }
 .team-reaction { right:8px; left:8px; top:calc(var(--header-overlay,90px) + 8px); font-size:14px; }
 .matrix-task { padding:12px; }
}
@media(prefers-reduced-motion:reduce) { .journey-card,.resume-card,.chapter-hook,.team-reaction,.cup-changed,.fast-exchange-line { animation:none; } }
html[data-motion=reduce] .cup-changed,html[data-motion=reduce] .fast-exchange-line { animation:none; }

body.chapter-v5 #game[data-compact=true] .exchange-lines > div:first-child { padding-right:56px; }

.reaction-portrait { display:inline-block; width:44px; height:44px; background-repeat:no-repeat; border-radius:50%; flex:none; }
.team-reaction { display:flex; align-items:center; gap:10px; }
.resume-card strong { max-width:60ch; font-size:22px; line-height:1.5; }
body.chapter-v5 #panel[data-kind=time-onboarding] { filter:none; transform:none; }
body.chapter-v5 #panel[data-kind=time-onboarding] .panel-bottom{z-index:20;box-sizing:border-box}
body.chapter-v5 #panel[data-kind=time-onboarding] #panel-content{position:relative;z-index:0}
body.chapter-v5 #panel[data-kind=time-onboarding] .mode-choice[aria-pressed=true]{color:var(--cream)!important}
body.chapter-v5 #panel[data-kind=time-onboarding] .mode-choice[aria-pressed=true] span{color:#e6d9e5}
@media(max-width:760px){
 body.chapter-v5 #panel[open][data-kind=time-onboarding]{display:flex;flex-direction:column;width:100vw;max-width:100vw;height:100svh;max-height:100svh;overflow:hidden;box-sizing:border-box;padding-bottom:12px}
 body.chapter-v5 #panel[data-kind=time-onboarding] .panel-top{flex:0 0 auto}
 body.chapter-v5 #panel[data-kind=time-onboarding] #panel-content{min-height:0;overflow-y:auto;overflow-x:hidden;flex:1 1 auto}
 body.chapter-v5 #panel[data-kind=time-onboarding] .panel-bottom{position:static;flex:0 0 auto;width:100%;max-width:100%;box-sizing:border-box}
}

body.chapter-v5 #game[data-compact=true] #content .decision-instruction { font-size:13px; line-height:1.35; margin:8px 0; color:#d5c6cd; }

/* Decision composition: question and responses have independent space. */
.decision-pane[hidden]{display:none}
body.chapter-v5 #game[data-deciding=true]{height:auto;min-height:100svh;overflow:visible}
body.chapter-v5 #game[data-deciding=true]:not([hidden]) .visual{margin-top:0;aspect-ratio:auto}
body.chapter-v5 #game[data-deciding=true] .topbar{position:absolute;inset:0 0 auto;background:linear-gradient(180deg,#181222e0,#18122275 60%,transparent)!important}
body.chapter-v5 #game[data-deciding=true] .visual{position:relative;inset:auto;width:100%;height:clamp(200px,32svh,310px);min-height:0;max-height:none;flex:none;margin:0;aspect-ratio:auto}
body.chapter-v5 #game[data-deciding=true] .visual #scene{object-fit:cover}
body.chapter-v5 #game[data-deciding=true] .cast{inset:12px 0 0!important}
body.chapter-v5 #game[data-deciding=true] .portrait{height:100%;min-height:0;max-height:100%;bottom:0}
body.chapter-v5 #game[data-deciding=true] .dialogue{width:min(1180px,calc(100% - 64px));margin:22px auto 0;padding:0!important;border:0!important;border-image:none!important;background:#181222!important;filter:none;transform:none;max-height:none;overflow:visible;flex:1}
body.chapter-v5 #game[data-deciding=true] .dialogue::before,body.chapter-v5 #game[data-deciding=true] .dialogue::after{display:none!important}
body.chapter-v5 #game[data-deciding=true] .dialogue-body{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:52px;overflow:visible;max-height:none;padding:0;align-items:start}
body.chapter-v5 #game[data-deciding=true] .speaker-row{display:none}
body.chapter-v5 #game[data-deciding=true] #content{border-top:1px solid #897342;padding:18px 46px 4px 0;max-height:calc(62svh - 70px);overflow-y:auto;scrollbar-gutter:stable}
body.chapter-v5 #game[data-deciding=true] #content .notebook-hint{display:none}
body.chapter-v5 #game[data-deciding=true] #content .exchange-lines>div>p{padding-right:48px}
body.chapter-v5 #game[data-deciding=true] .exchange-lines>div:first-child{padding-right:0}
body.chapter-v5 #game[data-deciding=true] .reading-speech{display:grid;grid-template-columns:60px minmax(0,1fr);gap:4px 14px}
body.chapter-v5 #game[data-deciding=true] .reading-speech-copy{display:contents}
body.chapter-v5 #game[data-deciding=true] .reading-avatar{width:60px;height:60px;margin:0;grid-row:1 / span 2}
body.chapter-v5 #game[data-deciding=true] .reading-dialogue{grid-column:1 / -1;font-size:var(--font);line-height:1.5;margin:14px 0 0}
body.chapter-v5 #game[data-deciding=true] .reading-role{display:block;grid-column:2;margin:0}
body.chapter-v5 #game[data-deciding=true] .reading-speaker{font-size:21px}
body.chapter-v5 #game[data-deciding=true] .reading-speaker:focus{outline:none}
body.chapter-v5 #game[data-deciding=true] .reading-speaker .speaker-link{min-height:0;padding:0;background:none;border:0;box-shadow:none}
body.chapter-v5 #game[data-deciding=true] #evidence-actions{position:absolute;top:22px;right:calc(60% + 12px);z-index:3}
body.chapter-v5 #game[data-deciding=true] #evidence-actions button{width:40px;height:44px;min-width:40px;min-height:44px;padding:8px!important}
body.chapter-v5 #game[data-deciding=true] .notebook-hint{font-size:13px;margin:10px 0}
body.chapter-v5 #game[data-deciding=true] .decision-title{font:600 28px/1.2 Fraunces,Georgia,serif;color:#e2c685;margin:0 0 16px}
body.chapter-v5 #game[data-deciding=true] .choices{display:grid;grid-template-columns:1fr;gap:12px;margin:0;max-width:none!important}
body.chapter-v5 #game[data-deciding=true] .choices button{display:grid;grid-template-columns:18px minmax(0,1fr);gap:6px 14px;align-items:center;min-height:76px;padding:16px 20px!important;border:1px solid #897342!important;border-image:none!important;border-radius:2px!important;background:#241a30!important;box-shadow:inset 0 0 0 5px #181222,inset 0 0 0 6px #89734230!important;font-size:var(--font);line-height:1.35;transform:none;filter:none;transition:background 160ms ease,border-color 160ms ease}
body.chapter-v5 #game[data-deciding=true] .choices button small,body.chapter-v5 #game[data-deciding=true] .choice-reason{grid-column:2;margin:0;font-size:15px;line-height:1.3;color:#c5b8ce}
body.chapter-v5 #game[data-deciding=true] .decision-diamond{color:#b99b60;font-size:20px}
body.chapter-v5 #game[data-deciding=true] .choice-body{display:flex;justify-content:space-between;gap:10px;align-items:center}
body.chapter-v5 #game[data-deciding=true] .choices button:not(:disabled):hover,body.chapter-v5 #game[data-deciding=true] .choices button:not(:disabled):focus-visible{background:#33243d!important;border-color:#e2c685!important;filter:none;transform:none}
body.chapter-v5 #game[data-deciding=true] .choices button:focus-visible{outline:2px solid #eee7db;outline-offset:3px}
body.chapter-v5 #game[data-deciding=true] .choices button[data-preview=true],body.chapter-v5 #game[data-deciding=true] .choices button[data-preview=true]:not(:disabled):hover,body.chapter-v5 #game[data-deciding=true] .choices button[data-preview=true]:not(:disabled):focus-visible{background:#e2c685!important;color:#181222;border-color:#f3deb0!important;box-shadow:inset 0 0 0 5px #e2c685,inset 0 0 0 6px #6b5123!important;outline:none}
body.chapter-v5 #game[data-deciding=true] .choices button[data-preview=true] small,body.chapter-v5 #game[data-deciding=true] .choices button[data-preview=true] .decision-diamond{color:#493649}
body.chapter-v5 #game[data-deciding=true] .choices button[data-preview=true] .hud-cost{color:#493649}
body.chapter-v5 #game[data-deciding=true] .choices button[data-preview=true] .hud-cost img{filter:brightness(.35)}
body.chapter-v5 #game[data-deciding=true] .choices button:disabled{opacity:.7}
body.chapter-v5 #game[data-deciding=true] .actions:empty{display:none}
body.chapter-v5 #game[data-deciding=true] .decision-clock-tools{margin:0 0 6px}
body.chapter-v5 #game[data-deciding=true] .decision-instruction,body.chapter-v5 #game[data-deciding=true] .timed-notice{font-size:13px;line-height:1.35;margin:4px 0 12px;color:#c5b8ce}
@media(max-width:760px){
 body.chapter-v5 #game[data-deciding=true] .visual{height:clamp(110px,22svh,185px)}
 body.chapter-v5 #game[data-deciding=true] .dialogue{width:calc(100% - 32px);margin:10px auto 0;padding:0!important}
 body.chapter-v5 #game[data-deciding=true] .dialogue-body{grid-template-columns:1fr;gap:14px;align-content:start}
 body.chapter-v5 #game[data-deciding=true] #content{padding:10px 0 0;max-height:28svh}
 body.chapter-v5 #game[data-deciding=true] .reading-speech{grid-template-columns:40px minmax(0,1fr);gap:2px 10px}
 body.chapter-v5 #game[data-deciding=true] .reading-avatar{width:40px;height:40px;margin:0}
 body.chapter-v5 #game[data-deciding=true] .reading-dialogue{font-size:max(16px,calc(var(--font) - 3px));line-height:1.4;margin:8px 0 0}
 body.chapter-v5 #game[data-deciding=true] .reading-speaker{font-size:18px;padding-right:46px}
 body.chapter-v5 #game[data-deciding=true] .reading-role{font-size:13px}
 body.chapter-v5 #game[data-deciding=true] #evidence-actions{top:12px;right:0}
 body.chapter-v5 #game[data-deciding=true] .decision-title{font-size:23px;margin-bottom:10px}
 body.chapter-v5 #game[data-deciding=true] .choices{gap:9px}
 body.chapter-v5 #game[data-deciding=true] .choices button{padding:12px 14px!important;min-height:60px;font-size:max(16px,calc(var(--font) - 2px));grid-template-columns:14px minmax(0,1fr);gap:6px 10px}
 body.chapter-v5 #game[data-deciding=true] .choices button small{display:none}
 body.chapter-v5 #game[data-deciding=true] .choices button[data-preview=true] small{display:block}
 body.chapter-v5 #game[data-deciding=true] .foot{padding:6px 16px;font-size:11px}
}
@media(max-height:650px) and (max-width:760px){
 body.chapter-v5 #game[data-deciding=true] .visual{height:100px}
 body.chapter-v5 #game[data-deciding=true] .dialogue-body{gap:10px}
 body.chapter-v5 #game[data-deciding=true] #content{max-height:25svh}
 body.chapter-v5 #game[data-deciding=true] .decision-title{font-size:21px;margin-bottom:8px}
 body.chapter-v5 #game[data-deciding=true] .choices button{padding:9px 12px!important;min-height:48px;font-size:16px}
}
@media(prefers-reduced-motion:reduce){body.chapter-v5 #game[data-deciding=true] .choices button{transition:none}}
html[data-motion=reduce] body.chapter-v5 #game[data-deciding=true] .choices button{transition:none}
.next-chapter{margin:24px 0 12px;padding:20px 0;border-top:1px solid #897342;border-bottom:1px solid #897342}
.next-chapter h3{font:600 24px/1.3 Fraunces,Georgia,serif;color:#e2c685;margin:8px 0}
.next-chapter p{margin:6px 0;max-width:65ch}
.board-access{position:absolute;right:24px;top:calc(var(--scene-bottom,300px) - 70px);z-index:9;display:flex;align-items:center;gap:10px;min-height:44px;padding:10px 16px!important;border:1px solid #e2c685;background:#21182deb;color:#f3e2bc;box-shadow:inset 0 0 0 3px #181222;animation:board-access-in 220ms cubic-bezier(.16,1,.3,1) both}
.board-access[hidden]{display:none}
.board-access .game-icon{width:24px;height:24px}
.board-access:hover{background:#39263f;border-color:#f3deb0}
.board-access:focus-visible{outline:3px solid #f3deb0;outline-offset:3px}
body.chapter-v5 #panel[data-kind=production-board]{width:min(1120px,96vw);max-height:92svh;filter:none;transform:none}
body.chapter-v5 #panel[data-kind=production-board] #panel-content{overflow:auto;max-height:calc(92svh - 190px);margin:16px 0}
body.chapter-v5 #panel[data-kind=production-board] #production-board{position:static!important;inset:auto!important;float:none;width:100%!important;max-width:none;max-height:none!important;margin:0;overflow:visible}
body.chapter-v5 #panel[data-kind=production-board] .board-head{display:none}
body.chapter-v5 #panel[data-kind=production-board] .board-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 18px}
body.chapter-v5 #panel[data-kind=production-board] .board-tabs button{min-height:44px;padding:8px 14px;flex:0 0 auto;white-space:nowrap}
body.chapter-v5 #panel[data-kind=production-board] .task-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
body.chapter-v5 #panel[data-kind=production-board] .board-note{min-width:0;overflow-wrap:anywhere;font-size:16px}
body.chapter-v5 #panel[data-kind=production-board] .board-note p,body.chapter-v5 #panel[data-kind=production-board] .board-caption{font-size:15px;line-height:1.4}
@keyframes board-access-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:760px){
 .board-access{right:12px;top:calc(var(--scene-bottom,185px) - 52px);gap:6px;font-size:14px;padding:8px 12px!important}
 body.chapter-v5 #panel[data-kind=production-board]{width:calc(100% - 16px);padding:16px 12px}
 body.chapter-v5 #panel[data-kind=production-board] .task-columns{grid-template-columns:1fr;gap:14px}
 body.chapter-v5 #panel[data-kind=production-board] .board-tabs button{padding:8px 10px;font-size:14px}
 body.chapter-v5 #panel[data-kind=production-board] #panel-content{max-height:calc(92svh - 170px)}
}
@media(prefers-reduced-motion:reduce){.board-access{animation:none}}
html[data-motion=reduce] .board-access{animation:none}
body.chapter-v5 #game[data-mode=agreements] .dialogue,body.chapter-v5 #game[data-mode=matrix] .dialogue{z-index:5}
body.chapter-v5 #game[data-deciding=true][data-timed=true] .choices button small{display:block;font-size:14px;line-height:1.3}
@media(max-height:650px) and (max-width:760px){
 body.chapter-v5 #game[data-deciding=true][data-timed=true] #content{max-height:16svh}
 body.chapter-v5 #game[data-deciding=true][data-timed=true] .choices{gap:6px}
 body.chapter-v5 #game[data-deciding=true][data-timed=true] .choices button{padding:6px 10px!important;gap:3px 8px}
 body.chapter-v5 #game[data-deciding=true][data-timed=true] .choices button small{font-size:13px;line-height:1.25}
}
