/* Bilingual controls and responsive presentation, preserving the original scene art. */
:root{--ui-cyan:#a9f2fa;--ui-border:#427986;--ui-panel:#0a202c;--ui-text:#e1f3fa}
html{scrollbar-gutter:stable}body{min-width:280px}
button,summary,a,textarea{touch-action:manipulation}
button:focus-visible,summary:focus-visible,textarea:focus-visible{outline:2px solid var(--ui-cyan);outline-offset:4px}
.masthead{gap:24px;flex-wrap:wrap}.top-right{gap:8px;min-width:0;flex-wrap:wrap}
.language-switch{display:inline-flex;align-items:center;gap:4px;padding:4px;border:1px solid var(--ui-border);background:#061921;flex-shrink:0}
.language-switch button,.intro-actions .language-switch button{display:grid;place-items:center;min-width:44px;min-height:44px;padding:8px;border:1px solid transparent;background:transparent;color:#aac9d3;font-size:13px;font-weight:600;line-height:1.2;letter-spacing:.04em;margin:0;box-shadow:none}
.language-switch button[aria-pressed="true"],.intro-actions .language-switch button[aria-pressed="true"]{color:#041419;background:#a9eef5;border-color:#bcfaff;box-shadow:0 0 12px #3fe7fc26}
.language-switch button:hover{border-color:var(--ui-cyan);color:var(--ui-text)}
.language-switch button[aria-pressed="true"]:hover{color:#041419}
.sound-toggle{min-height:44px;padding:8px 12px}
#topStatus{max-width:176px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.brand h1{line-height:1.25;overflow-wrap:normal}
html[lang="en"] .brand h1{letter-spacing:.02em}
html[lang="en"] .stage{gap:8px;flex-wrap:wrap}
html[lang="en"] .stage small{flex-basis:100%;margin-left:0}
html[lang="en"] .drawer-handle span{writing-mode:vertical-rl;letter-spacing:.02em;font-size:12px}
html[lang="en"] .scene-briefing h3,html[lang="en"] .scene-intel h3{letter-spacing:.02em;font-size:16px}
html[lang="en"] .e-title h2{letter-spacing:.03em}
html[lang="en"] .e-title p{letter-spacing:.06em;line-height:1.5}
html[lang="en"] .e-issuer{letter-spacing:.02em;line-height:1.5}
html[lang="en"] .e-stamp b{letter-spacing:0;font-size:20px}
.theater-caption{flex-wrap:wrap;gap:8px}.theater-caption button{min-height:44px}
.input-meta{min-width:0}.input-meta>span{overflow-wrap:anywhere}
#prompt{font-size:16px;line-height:1.65}
.phase-track .phase{min-width:0}.phase-track b{overflow-wrap:anywhere}
.mobile-briefings:empty{display:none}

/* Compact controls match the live-generation status badge. */
.top-right{--header-control-width:72px}
.top-right .language-switch{gap:8px;padding:0;border:0;background:none}
.top-right .language-switch button,.top-right .sound-toggle,.top-right .mode-tag{display:grid;place-items:center;flex:0 0 var(--header-control-width);width:var(--header-control-width);height:32px;min-height:32px;min-width:0;margin:0;padding:4px;font-size:10px;line-height:1.25;letter-spacing:0;white-space:nowrap;text-align:center;border:1px solid var(--ui-border)}
.top-right .language-switch button[aria-pressed="false"]{background:#061921}
.top-right .language-switch button[aria-pressed="true"]{border-color:#bcfaff}

/* Intro copy scrolls at its natural size; controls stay outside its scroll area. */
.war-intro{height:100dvh;max-height:none;padding:0}
.war-copy{top:max(24px,env(safe-area-inset-top));left:max(24px,env(safe-area-inset-left));bottom:calc(var(--intro-controls-height,80px) + max(20px,env(safe-area-inset-bottom)) + 16px);width:min(580px,54%);max-height:none;overflow:auto;overscroll-behavior:contain;padding:8px 16px 24px 0;transform:none;scrollbar-width:thin}
.war-copy h2{font-size:clamp(24px,3vw,36px);line-height:1.3}
.war-copy p,.war-copy .war-question,.war-copy .war-directive{font-size:16px;line-height:1.7}
.war-copy .war-round,.war-copy .war-media-status{font-size:12px}
.war-copy .intel-target,.war-copy .intel-target:not(:has(.intro-char.revealed)){border-color:#cfae68;background:#533e2366;box-shadow:none;font-size:20px}
.war-copy .war-question,.war-copy .war-question:not(:has(.intro-char.revealed)){border-color:#d9b364}
.intro-actions{position:absolute;bottom:max(20px,env(safe-area-inset-bottom));left:max(24px,env(safe-area-inset-left));right:max(24px,env(safe-area-inset-right));display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.intro-actions>button{min-height:48px;padding:12px 16px;font-size:14px}
.intro-actions .skip-intro{margin-left:auto}
.briefing-reveal>h2,.briefing-reveal>p{animation:briefingLine .45s ease-out both}
.briefing-reveal>p:nth-child(n+4){animation-delay:.16s}
@keyframes briefingLine{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

/* Reports scroll rather than scaling down the whole document and its buttons. */
.settlement-overlay{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));overflow:hidden}
.settlement-sheet.electronic-settlement.fit-report,.campaign-dialog.fit-report{width:min(1040px,100%);height:auto;max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);padding:0;overflow:auto;overscroll-behavior:contain;background:#071524;scrollbar-gutter:stable;scrollbar-width:thin}
.campaign-dialog.fit-report{width:min(1040px,calc(100vw - 24px))}
.fit-report>.fit-report-content{position:relative;inset:auto;width:100%;transform:none;padding:4px}
.fit-report .e-report{padding:20px 24px}
.fit-report .e-title h2{font-size:28px;line-height:1.35}
.fit-report .e-issuer,.fit-report .e-meta,.fit-report .e-contract,.fit-report #settlementBasisNote,.fit-report .e-rule p{font-size:13px;line-height:1.6}
.fit-report .e-section{font-size:16px;margin:16px 0 12px}
.fit-report .e-evidence{gap:20px}
.fit-report .e-observed{display:block;padding:12px}
.fit-report .e-observed>b{margin-bottom:8px;font-size:16px}
.fit-report .e-observed #settlementCounts{font-size:20px;gap:8px 16px}
.fit-report .e-prompt{font-size:16px;line-height:1.65;overflow-wrap:anywhere}
.fit-report .e-rule strong,.fit-report .e-rule.e-unmatched strong{font-size:16px}
.fit-report .e-actions,.fit-report .e-pagination{flex-wrap:wrap;margin:12px 4px;gap:8px}
.fit-report .e-actions button,.fit-report .e-pagination button,.e-hint-pager button,.campaign-dialog button,.escape-dialog button{min-height:44px;padding:12px 16px;font-size:14px;white-space:normal;line-height:1.5}
.fit-report #settlementHints p{font-size:15px;line-height:1.7}
.fit-report .e-hints{padding:12px;margin-top:16px}
.e-hint-pager{flex-wrap:wrap;gap:8px;font-size:13px}
.report-close{position:sticky;top:0;z-index:2;display:block;margin:0 0 4px auto;width:44px;min-height:44px;border:1px solid var(--ui-border);background:var(--ui-panel);color:var(--ui-text);font-size:24px}
.campaign-dialog{max-height:calc(100dvh - 24px);overscroll-behavior:contain;scrollbar-width:thin}
.escape-dialog{max-height:calc(100dvh - 24px);overflow:auto}
.escape-words b,.escape-words span{letter-spacing:.02em;line-height:1.5}
#journeyDialog .journey-stats{gap:8px}#journeyDialog .journey-stats>div{font-size:14px}
#journeyDialog .guide-table{font-size:14px}
#journeyDialog .rank-schedule span,#journeyDialog .rank-schedule small{font-size:13px}

@media(max-width:1100px){
  .shell{padding:16px max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));width:100%}
  .layout{grid-template-columns:minmax(0,1fr);gap:16px}
  .masthead{padding:16px;gap:16px;margin:0 0 16px}
  .top-right{margin-left:auto;max-width:100%;gap:8px}.top-right .sound-toggle{order:0}
  .brand{min-width:0;gap:16px}.brand h1{font-size:24px}.brand small{letter-spacing:.12em;font-size:10px}
  #topStatus{display:none}.top-right .live-dot{display:none}
  .stages{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
  .stage,html[lang="en"] .stage{min-width:0;display:grid;grid-template-columns:auto 1fr;gap:4px 8px;padding:12px 8px}
  .stage small,html[lang="en"] .stage small{display:block;grid-column:1/-1;min-width:0;margin:0;font-size:12px;opacity:1}
  .stage b{font-size:12px;letter-spacing:0;overflow-wrap:anywhere}
  .scene,.scene:is([data-presentation-phase="3"],[data-presentation-phase="4"]){min-height:0;max-height:none;height:auto;aspect-ratio:16/9;background-size:cover;background-position:center}
  .scene :is(.form-image,.generated-video,.processing-video,.ending-video),.scene:is([data-presentation-phase="3"],[data-presentation-phase="4"]) :is(.form-image,.generated-video,.processing-video,.ending-video){inset:0;width:100%;height:100%;object-fit:contain}
  .scene .scene-bottom,.scene:is([data-presentation-phase="3"],[data-presentation-phase="4"]) .scene-bottom{top:auto;bottom:4%;font-size:10px;gap:12px;letter-spacing:0}
  .scene .scene-top{top:4%;font-size:10px;letter-spacing:0}
  .mobile-briefings{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 16px;align-items:start}
  .mobile-briefings:has(>.scene-drawer[hidden]){display:none}
  .mobile-briefings .scene-drawer{position:relative;inset:auto;width:100%;padding:0;transform:none;display:flex;flex-direction:column;pointer-events:auto;border:1px solid var(--ui-border);background:#0b1c29;transition:none}
  .mobile-briefings .drawer-handle,.mobile-briefings .scene-drawer-left .drawer-handle,.mobile-briefings .scene-drawer-right .drawer-handle{position:relative;inset:auto;transform:none;order:-1;flex-direction:row;justify-content:space-between;width:100%;min-height:48px;padding:12px 16px;border:0;border-radius:0;background:#102736;box-shadow:none}
  .mobile-briefings .drawer-handle span,html[lang="en"] .mobile-briefings .drawer-handle span{writing-mode:horizontal-tb;font-size:14px;letter-spacing:.04em}
  .mobile-briefings .scene-drawer section{height:auto;max-height:none;overflow:visible;padding:16px;border:0;background:none;backdrop-filter:none}
  .mobile-briefings .scene-drawer.is-collapsed section{display:none}
  .mobile-briefings .scene-briefing p,.mobile-briefings .scene-intel p,.mobile-briefings .scene-briefing #publicContract,.mobile-briefings .scene-briefing li,.mobile-briefings .scene-intel li{font-size:14px;line-height:1.7}
  .mobile-briefings .scene-drawer h3{font-size:18px;margin-top:8px}
  .mobile-briefings .scene-drawer small{font-size:10px;overflow-wrap:anywhere}
  .mobile-briefings .mission-story{font-size:14px}.mobile-briefings #knownIntelList{max-height:none}
  .console{padding:20px}.console-head h2{font-size:24px}
  .console-head p,.field-title,.status-box{font-size:14px;line-height:1.7}
  #prompt{min-height:128px;width:100%;padding:12px}
  .input-meta{font-size:12px;gap:8px}
  .phase-track{margin-top:24px}.phase-track .phase{font-size:12px;padding:12px 4px}
  #resetButton,#nextButton,#retryAnalysis{min-height:48px;font-size:14px}
  .content-notice{bottom:max(16px,env(safe-area-inset-bottom));max-height:60dvh;width:calc(100vw - 32px)}
  .content-notice>p,.content-notice>span{font-size:14px}
  .content-notice .content-notice-close{min-width:44px;min-height:44px;right:0;top:0}
  .content-notice>strong{padding-right:24px}
}
@media(max-width:600px){
  .shell{padding:12px max(12px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
  .masthead{padding:16px 12px;gap:16px}.brand{width:100%;gap:16px;padding-left:8px}
  .brand h1{font-size:23px}.brand-mark{width:32px;height:32px;font-size:24px;flex-shrink:0}
  .brand small{font-size:9px;letter-spacing:.08em}
  .top-right{width:100%;margin:0;justify-content:flex-start;letter-spacing:0}
  .top-right .mode-tag{margin-left:auto}
  .language-switch{padding:2px;gap:0}
  .language-switch button,.intro-actions .language-switch button{font-size:13px;min-width:44px;min-height:44px}
  .sound-toggle{padding:8px;font-size:12px}
  .stages{grid-template-columns:repeat(3,minmax(0,1fr))}
  .stage{min-height:68px}.stage span{font-size:22px}.stage b{font-size:11px}.stage small{font-size:11px}
  .scene .scene-top,.scene .scene-bottom{font-size:9px}.scene .scene-bottom>span:first-child{max-width:62%}
  .theater-caption{font-size:12px;line-height:1.6;padding:8px 0}.theater-caption button{padding:8px 12px;margin-left:auto}
  .theater-tools{display:grid;grid-template-columns:1fr 1fr;padding:8px 0 16px}
  .theater-tools button,.theater-tools .rejection-records-button{min-width:0;width:100%;min-height:48px;white-space:normal;font-size:13px;padding:8px;line-height:1.5}
  .theater-tools .rejection-records-button{grid-column:1/-1}
  .theater-tools>span{grid-column:1/-1;text-align:left;white-space:normal;font-size:12px}
  .mobile-briefings{grid-template-columns:minmax(0,1fr);margin-bottom:0}
  .console{padding:16px}.console-head small{font-size:9px;letter-spacing:.08em;line-height:1.6}
  .console-head h2{font-size:24px;margin:8px 0}.console-head p{margin:8px 0 16px}
  .input-meta{flex-wrap:wrap}#declarationHint{max-width:100%;flex:1 1 180px}#promptCount{margin-left:auto}
  #generateButton{width:144px!important;max-width:none;height:144px;min-height:144px;padding:0;margin:24px auto;aspect-ratio:1}
  #generateButton b{font-size:18px;max-width:116px;white-space:normal;line-height:1.3}#generateButton small{font-size:9px;letter-spacing:.05em}
  .shell>footer{gap:8px;flex-wrap:wrap;font-size:12px;line-height:1.6}
  .war-copy{top:max(20px,env(safe-area-inset-top));left:max(20px,env(safe-area-inset-left));right:20px;bottom:calc(var(--intro-controls-height,144px) + max(16px,env(safe-area-inset-bottom)) + 16px);width:auto;padding:8px 8px 20px 0}
  .war-copy h2{font-size:28px}.war-copy p{font-size:16px}.war-copy .war-eyebrow{font-size:10px;letter-spacing:.08em}
  .intro-shade{background:linear-gradient(90deg,#010910e8,#02111ac9)}
  .intro-actions{left:16px;right:16px;bottom:max(16px,env(safe-area-inset-bottom));gap:8px}
  .intro-actions>button{padding:12px 8px;font-size:12px;flex:1 1 auto}.intro-actions .language-switch{flex:none}
  .intro-actions .skip-intro{flex:1 0 100%;margin:0}
  .settlement-sheet.electronic-settlement.fit-report,.campaign-dialog.fit-report{max-height:calc(100dvh - 32px)}
  .fit-report .e-report,.campaign-dialog .e-report{padding:16px}
  .fit-report .e-title h2,.campaign-dialog .e-title h2{font-size:24px;letter-spacing:.02em}
  .fit-report .e-title p{font-size:11px;letter-spacing:.03em}
  .fit-report .e-meta{flex-wrap:wrap;gap:8px}.fit-report .e-meta>div{display:flex;gap:4px;flex-wrap:wrap}
  .fit-report .e-decision{padding:0;display:flex;flex-direction:column;gap:8px;min-height:0}
  .fit-report .e-decision>strong{font-size:22px}.fit-report .e-decision p{font-size:14px;line-height:1.6}
  .fit-report .e-stamp{position:relative;inset:auto;align-self:flex-end;transform:rotate(-4deg);margin:4px 0 12px}
  .fit-report .e-evidence{grid-template-columns:minmax(0,1fr);gap:16px}.fit-report .e-evidence figure{width:100%}.fit-report .e-evidence figcaption{font-size:12px}
  .fit-report .e-results tbody th,.fit-report .e-results td{padding:12px 8px}.fit-report .e-results tbody th{font-size:14px;line-height:1.5}
  .fit-report .e-results thead th{font-size:12px;padding:8px}.fit-report .e-results thead th:last-child{width:72px}.fit-report .e-results tbody th span{width:24px}
  .fit-report .e-rule-grid{grid-template-columns:minmax(0,1fr);gap:12px}.fit-report .e-rule+.e-rule{border-left:0;border-top:1px solid var(--ui-border);padding:12px 0 0}
  .fit-report .e-pass{flex-wrap:wrap;gap:8px;padding:12px;font-size:13px}.fit-report .e-footer{gap:8px;flex-wrap:wrap;font-size:10px}
  .fit-report .e-actions,.fit-report .e-pagination{display:grid;grid-template-columns:1fr 1fr;align-items:center;margin:12px 0;gap:8px}
  .fit-report .e-pagination>span{grid-column:1/-1;grid-row:1;text-align:center;font-size:13px}.fit-report .e-pagination .e-return{grid-column:1/-1;width:100%;margin:0}
  .fit-report #hintStatus{grid-column:1/-1;font-size:13px}
  .e-hint-pager{display:grid;grid-template-columns:1fr 1fr}.e-hint-pager>span{grid-column:1/-1;grid-row:1;text-align:center}.e-hint-pager button{padding:8px;font-size:13px}
  .campaign-dialog .guide-steps{padding-left:20px;grid-template-columns:1fr;gap:16px}.campaign-dialog .guide-steps span,.campaign-dialog .guide-note{font-size:14px}
  .guide-table,#journeyDialog .guide-table{table-layout:fixed;font-size:12px;line-height:1.5}
  .guide-table th,.guide-table td,#journeyDialog .guide-table th,#journeyDialog .guide-table td{padding:12px 4px;overflow-wrap:anywhere}
  #journeyDialog .journey-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}#journeyDialog .journey-stats>div{font-size:12px;padding:8px 4px}#journeyDialog .journey-stats strong{font-size:28px}
  #journeyDialog .journey-reward{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:16px}#journeyDialog .journey-reward>b{font-size:24px}
  #journeyDialog .rank-schedule{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#journeyDialog .rank-schedule>div{padding:12px 8px}
  .escape-words{bottom:88px;padding:8px}.escape-words b,.escape-words span{font-size:18px}
}
@media(max-height:500px) and (min-width:601px){.war-copy{width:70%;top:16px}.intro-actions{bottom:12px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
