/* Scenery and foreground share the viewport. Text and command controls sit
   above the scene; the lower crop of a person continues behind them. */
.has-run-hud #app > .cinematic-dialogue {
  height:100svh; height:100dvh; min-height:0; width:100%; max-width:none;
  padding:calc(16px + var(--safe-top)) 20px calc(var(--run-hud-height) + var(--safe-bottom) + 18px);
  overflow:hidden; isolation:isolate; margin:0;
}
.cinematic-dialogue .story-scene {
  z-index:0; inset:-3px; background:var(--scene-image) center/cover no-repeat;
  filter:brightness(.76) saturate(.88) blur(1.2px);
}
.cinematic-dialogue .story-depth-shade {
  position:absolute; inset:0; z-index:2; pointer-events:none;
  background:linear-gradient(180deg,#03111b40,transparent 25%,transparent 42%,#03111b35 62%,#03111bba 100%);
}
.cinematic-dialogue .story-heading { position:relative; z-index:5; justify-content:flex-end; flex:0 0 44px; }
.cinematic-dialogue .story-character {
  position:absolute; inset:0; z-index:1; display:block; min-height:0; padding:0; pointer-events:none;
}
.cinematic-dialogue .story-character:after { display:none; }
.scene-portrait-handoff,.scene-background-handoff { position:fixed; pointer-events:none; }
.scene-portrait-handoff { z-index:228; border-radius:4px; }
.scene-background-handoff { z-index:221; inset:0; background:center / cover no-repeat; }
.scene-background-handoff.is-route { z-index:-1; }
.reward-orbit { touch-action:pan-y; }
.reward-outgoing-board {
  position:absolute; z-index:0; inset:0; width:100%; height:100%;
  overflow:hidden; pointer-events:none;
}
.reward-outgoing-board .battle-view { margin-inline:auto; }
.reward-outgoing-board .battle-enemy-header { opacity:.2; }
.reward-orbit,.reward-actions { z-index:1; }
.cinematic-dialogue .story-actor { position:absolute; bottom:0; left:-8%; width:116%; height:91%; }
.cinematic-dialogue .story-actor img {
  display:block; width:100%; height:100%; object-fit:cover; object-position:50% top;
  border:0; border-radius:0; box-shadow:none;
  filter:drop-shadow(0 0 2px #d3ece529) drop-shadow(0 16px 28px #02091265);
  transform-origin:50% 100%; animation:dialogue-breathe 9s ease-in-out infinite;
}
.cinematic-dialogue [data-actor-key="ilex"] .story-actor img { object-position:72% top; }
.cinematic-dialogue [data-actor-type="ship"] .story-actor,
.cinematic-dialogue [data-actor-type="drone"] .story-actor {
  bottom:auto; top:14%; left:-5%; width:110%; height:39%;
}
.cinematic-dialogue [data-actor-type="ship"] .story-actor img,
.cinematic-dialogue [data-actor-type="drone"] .story-actor img {
  object-fit:contain; object-position:center; transform-origin:center;
  animation:dialogue-float 10s ease-in-out infinite;
}
.cinematic-dialogue [data-actor-key="culture"] .story-actor { top:22%; height:27%; width:126%; left:-13%; }
.cinematic-dialogue [data-actor-type="custom"] .story-actor { top:10%; bottom:auto; height:50%; }
.cinematic-dialogue [data-actor-type="custom"] .story-actor img {
  object-fit:contain; mask-image:radial-gradient(ellipse closest-side,#000 68%,#0009 84%,transparent 100%);
  -webkit-mask-image:radial-gradient(ellipse closest-side,#000 68%,#0009 84%,transparent 100%);
}
.cinematic-dialogue [data-actor-type="refit"] { display:grid; place-items:start center; padding-top:10dvh; }
.cinematic-dialogue .remnant-refit { width:min(40vw,175px); }
.cinematic-dialogue .remnant-refit img { width:100%; height:100%; object-fit:cover; filter:none; animation:none; }
.cinematic-dialogue .dialogue-box {
  flex:0 1 auto; z-index:4; min-height:0; max-height:calc(100dvh - var(--run-hud-height) - var(--safe-top) - var(--safe-bottom) - 86px);
  width:100%; margin: auto 0 0; padding:20px 20px 16px;
  border:1px solid #eddfbc77; border-radius:3px;
  background:linear-gradient(135deg,#eee4cdeb,#eee4cddc);
  color:#233541; box-shadow:0 12px 45px #020a1340;
  backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
  overflow:auto; overscroll-behavior:contain; scrollbar-width:thin;
}
.cinematic-dialogue .speaker-name {
  position:static; display:block; min-height:0; padding:0; margin:0 0 12px; border:0; border-radius:0;
  background:none; color:#344f59; font:600 13px/1.2 var(--font-ui,sans-serif); letter-spacing:.12em;
}
.cinematic-dialogue .dialogue-box > .dialogue-text {
  font:400 clamp(17px,2vw,21px)/1.48 var(--font-body,sans-serif); margin:0 0 14px;
  max-height:24dvh; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin;
}
.cinematic-dialogue .dialogue-response-heading { margin-top:14px; }
.cinematic-dialogue .dialogue-response-heading img { width:26px; height:26px; }
.cinematic-dialogue .dialogue-responses { margin-top:14px; }
.cinematic-dialogue .event-choices { margin-top:10px; gap:8px; }
.cinematic-dialogue .event-choice { min-height:46px; padding:10px 13px; }
.cinematic-dialogue .dialogue-footer { min-height:44px; }
.cinematic-dialogue .dialogue-progress { opacity:.72; }
.cinematic-dialogue .is-outgoing { pointer-events:none; }
@keyframes dialogue-breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.003)} }
@keyframes dialogue-float { 0%,100%{transform:translateY(0) rotate(-.15deg)} 50%{transform:translateY(-4px) rotate(.15deg)} }
@media(min-width:900px) {
  .has-run-hud #app > .cinematic-dialogue { padding-left:7vw; padding-right:7vw; padding-bottom:calc(var(--run-hud-height) + var(--safe-bottom) + 22px); }
  .cinematic-dialogue .dialogue-box { width:min(55vw,680px); padding:26px 28px 22px; }
  .cinematic-dialogue .story-actor { left:39%; width:62%; height:95%; }
  .cinematic-dialogue .story-actor img { object-fit:contain; object-position:center bottom; }
  .cinematic-dialogue [data-actor-key="ilex"] .story-actor { left:18%; width:90%; }
  .cinematic-dialogue [data-actor-key="ilex"] .story-actor img { object-fit:cover; object-position:70% top; }
  .cinematic-dialogue [data-actor-type="ship"] .story-actor,
  .cinematic-dialogue [data-actor-type="drone"] .story-actor { left:32%; top:8%; width:70%; height:58%; }
  .cinematic-dialogue [data-actor-key="culture"] .story-actor { top:14%; height:45%; }
  .cinematic-dialogue [data-actor-type="refit"] { padding-top:12dvh; padding-left:35%; }
  .cinematic-dialogue .remnant-refit { width:210px; }
  .cinematic-dialogue .story-depth-shade { background:linear-gradient(90deg,#03111b44,transparent 60%),linear-gradient(180deg,#03111b30,transparent 35%,#03111b70); }
}
@media(max-width:359px),(max-height:650px) {
  .has-run-hud #app > .cinematic-dialogue { padding-inline:12px; padding-top:calc(10px + var(--safe-top)); padding-bottom:calc(var(--run-hud-height) + var(--safe-bottom) + 10px); }
  .cinematic-dialogue .dialogue-box { padding:14px; max-height:calc(100dvh - var(--run-hud-height) - var(--safe-top) - var(--safe-bottom) - 68px); }
  .cinematic-dialogue .dialogue-box > .dialogue-text { font-size:16px; max-height:18dvh; }
  .cinematic-dialogue .event-choice { font-size:15px; min-height:42px; padding:8px 10px; }
  .cinematic-dialogue .speaker-name { margin-bottom:9px; }
  .cinematic-dialogue .dialogue-responses,.cinematic-dialogue .dialogue-response-heading { margin-top:9px; }
}
@media(min-width:700px) and (max-height:650px) {
  .has-run-hud #app > .cinematic-dialogue { padding-left:4vw; padding-right:4vw; }
  .cinematic-dialogue .dialogue-box { width:57%; }
  .cinematic-dialogue .story-character { display:block; }
  .cinematic-dialogue .story-actor { left:48%; width:52%; height:97%; }
  .cinematic-dialogue .story-actor img { object-fit:contain; object-position:center bottom; }
  .cinematic-dialogue [data-actor-type="ship"] .story-actor,.cinematic-dialogue [data-actor-type="drone"] .story-actor { left:53%; width:47%; top:14%; height:55%; }
  .cinematic-dialogue [data-actor-key="ilex"] .story-actor { left:45%; width:55%; }
  .cinematic-dialogue [data-actor-key="ilex"] .story-actor img { object-fit:cover; object-position:76% top; }
}
@media(prefers-reduced-motion:reduce) {
  .cinematic-dialogue * { animation:none!important; transition:none!important; }
}
.reduce-motion .cinematic-dialogue * { animation:none!important; transition:none!important; }
