/* R64 | One decision surface per beat. These rules style actual relocated
   controls (mountHanCriticalDock), never cloned or hidden target layers.
   Long reading material may scroll; REQUIRED actions never live in it. */
.screen[data-han-critical-dock] .han-critical-dock {
 position:absolute;z-index:32;bottom:max(14px,env(safe-area-inset-bottom));right:clamp(12px,3vw,46px);
 width:min(485px,calc(100% - 24px));display:flex;flex-direction:column;align-items:stretch;gap:9px;
 pointer-events:auto;isolation:isolate;
}
.screen[data-han-critical-dock] .han-critical-dock__choices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;min-width:0}
.screen[data-han-critical-dock] .han-critical-dock__choices:has(> :only-child){grid-template-columns:minmax(0,1fr)}
.screen[data-han-critical-dock] .han-critical-dock__choices > button{
 position:static;display:flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:48px;
 padding:9px 12px;margin:0;text-align:center;line-height:1.25;border-radius:14px;
 border:1px solid rgba(239,199,148,.72);background:rgba(63,38,27,.96);color:#fff0d8;
 font:500 13px/1.3 var(--sans);box-shadow:0 4px 15px rgba(12,8,6,.35);touch-action:manipulation;
}
.screen[data-han-critical-dock] .han-critical-dock__choices > button:is(:focus-visible,:hover){background:#805337;outline-offset:2px}
.screen[data-han-critical-dock] .han-critical-dock .journey-toolbar{
 position:static;transform:none;inset:auto;width:100%;max-width:100%;height:auto;min-height:44px;
 display:flex;justify-content:flex-start;align-items:center;gap:8px;padding:0;margin:0;pointer-events:auto;
}
.screen[data-han-critical-dock] .han-critical-dock .journey-toolbar>button{
 position:static;transform:none;min-height:44px;min-width:90px;padding:7px 13px;
 display:inline-flex;justify-content:center;align-items:center;flex:0 1 auto;
}
/* The speech lives outside the decision dock, with the photograph clear between. */
@media(max-width:950px), (max-height:580px){
 .screen[data-han-critical-dock] .stage-body{
  position:absolute;top:calc(env(safe-area-inset-top) + 78px);bottom:auto;
  left:12px;right:auto;transform:none;width:min(430px,calc(100% - 24px));max-width:none;
  height:auto;max-height:calc(100dvh - 230px);display:block;pointer-events:none;
 }
 .screen[data-han-critical-dock] .stage-body>.dialogue-housing{
  min-width:0;min-height:0;max-width:100%;max-height:calc(100dvh - 230px);width:100%;
  flex:0 0 auto;pointer-events:auto;
 }
 .screen[data-han-critical-dock] .stage-body>.dialogue-housing>.dialogue-inner{
  max-height:calc(100dvh - 235px);min-height:0;padding:11px 13px;overflow-y:auto;
 }
 .screen[data-han-critical-dock] .han-critical-dock {bottom:max(10px,env(safe-area-inset-bottom));}
}
/* On a narrow phone, conversation at the top; action choices always within
   the visible bottom 110px. No invisible 'scroll to continue' requirement. */
@media(max-width:700px) and (orientation:portrait){
 .screen[data-han-critical-dock] .stage-body{
  top:calc(env(safe-area-inset-top) + 77px);
  max-height:min(32dvh,195px);
 }
 .screen[data-han-critical-dock] .stage-body>.dialogue-housing,
 .screen[data-han-critical-dock] .stage-body>.dialogue-housing>.dialogue-inner{
  min-height:0;max-height:min(32dvh,195px);
 }
 .screen[data-han-critical-dock] .han-critical-dock{left:10px;right:10px;width:auto;gap:7px}
 .screen[data-han-critical-dock] .han-critical-dock__choices>button{font-size:12px;min-height:51px;padding:8px 7px}
 .screen[data-han-critical-dock] .han-critical-dock .journey-toolbar{min-height:42px}
 .screen[data-han-critical-dock] .han-critical-dock .journey-toolbar>button{min-height:42px}
}
/* Short landscape needs *more horizontal composition*, not a taller scroll. */
@media(orientation:landscape) and (max-height:520px){
 .screen[data-han-critical-dock] .stage-body{
  top:calc(env(safe-area-inset-top) + 70px);left:14px;right:auto;
  width:min(345px,43vw);max-height:calc(100dvh - 92px);
 }
 .screen[data-han-critical-dock] .stage-body>.dialogue-housing,
 .screen[data-han-critical-dock] .stage-body>.dialogue-housing>.dialogue-inner{
  max-height:calc(100dvh - 92px);
 }
 .screen[data-han-critical-dock] .han-critical-dock{
  left:auto;right:12px;bottom:max(8px,env(safe-area-inset-bottom));
  width:min(445px,53vw);gap:6px;
 }
 .screen[data-han-critical-dock] .han-critical-dock__choices>button{
  min-height:48px;padding:7px 9px;font-size:12px;
 }
 .screen[data-han-critical-dock] .han-critical-dock .journey-toolbar{min-height:40px}
 .screen[data-han-critical-dock] .han-critical-dock .journey-toolbar>button{min-height:40px}
}
/* Optional shop details are allowed to expand, but returning to the gifts is
   always separately visible and never placed inside the scrollable catalog. */
.screen[data-han-critical-dock="shop-explore"] .han-critical-dock {width:min(325px,calc(100% - 24px))}
.screen[data-han-critical-dock="shop-explore"] .han-critical-dock__choices {display:block}
.screen[data-han-critical-dock="shop-explore"] .stage-body{
 top:calc(env(safe-area-inset-top) + 78px);bottom:auto;max-height:min(35dvh,250px);
}
.screen[data-han-critical-dock="shop-explore"] .stage-body>.dialogue-housing,
.screen[data-han-critical-dock="shop-explore"] .stage-body>.dialogue-housing>.dialogue-inner{
 max-height:min(35dvh,250px);
}
/* Landscape dinner: audio/translation left and visitor response at the bottom
   right; no reply panel covering dishes in the photographic center. */
@media(orientation:landscape) and (max-height:520px) and (min-width:701px){
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame{
  position:absolute;inset:0;pointer-events:none;display:block;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame>.pilot-conversation{
  position:absolute;top:calc(env(safe-area-inset-top) + 75px);bottom:auto;left:14px;right:auto;
  width:min(350px,42vw);max-height:calc(100dvh - 102px);pointer-events:auto;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame>.han-cinematic-replies{
  position:absolute;left:auto;right:10px;top:auto;bottom:max(7px,env(safe-area-inset-bottom));
  width:min(415px,52vw);max-height:100px;pointer-events:auto;
 }
}

/* Scene 6 greeting previously inherited a high-specificity bottom position.
   One active line at the top, one optional introduction at the bottom. */
@media(max-width:700px) and (orientation:portrait){
 .scene67-screen[data-scene67="6"][data-scene67-step="salon"][data-han-critical-dock] .scene67-body{
  top:calc(env(safe-area-inset-top) + 77px);bottom:auto;max-height:min(37dvh,220px);
  left:12px;right:12px;width:auto;display:block;transform:none;
 }
 .scene67-screen[data-scene67="6"][data-scene67-step="salon"][data-han-critical-dock] .scene67-body>.dialogue-housing,
 .scene67-screen[data-scene67="6"][data-scene67-step="salon"][data-han-critical-dock] .scene67-body>.dialogue-housing>.dialogue-inner{
  max-height:min(37dvh,220px);min-height:0;
 }
}
/* Intentional secondary choice: same physical button styling as the positive
   choice; declining is not a disabled-looking fake button. */
.journey-screen[data-han-critical-dock="dessert"] .han-critical-dock__choices>button[data-flow-action="decline-dessert"]{
 border:1px solid rgba(239,199,148,.65);border-radius:14px;
 background:rgba(54,37,27,.94);font:500 13px/1.3 var(--sans);
 color:#fff0d8;text-decoration:none;margin:0;min-height:48px;
}
@media(orientation:landscape) and (max-height:520px) and (min-width:701px){
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame>.han-cinematic-replies{
  display:grid;grid-template-columns:minmax(0,1fr) 156px;align-items:end;gap:7px;
  max-height:none;height:auto;overflow:visible;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] .han-cinematic-replies>.pilot-replies{
  width:100%;min-width:0;align-self:end;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame .pilot-replies>.reply{
  min-height:54px;padding:6px 9px;font-size:12px;line-height:1.2;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] .han-cinematic-replies>.han-answer-composer[data-phase="choose"]{
  display:flex;align-items:flex-end;min-width:0;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] .han-cinematic-replies .han-compose-dock{
  display:flex;gap:6px;align-items:center;margin:0;width:100%;min-height:52px;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] .han-cinematic-replies .han-compose-dock>button{
  flex:1 1 0;min-width:0;min-height:44px;padding:6px 4px;font-size:12px;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame>.han-cinematic-replies:has(.han-answer-composer[data-phase="selected"]){
  display:block;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] .han-answer-composer[data-phase="selected"]{
  display:grid;grid-template-columns:minmax(0,1fr) 156px;gap:8px;align-items:center;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] .han-answer-composer[data-phase="selected"] .han-compose-slip{
  padding:5px 8px;max-height:82px;min-width:0;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] .han-answer-composer[data-phase="selected"] .han-compose-send-hint{
  display:none;
 }
}
@media(orientation:landscape) and (max-height:520px) and (min-width:701px){
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame .han-cinematic-replies .pilot-replies>.reply{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;
  min-height:61px;max-height:80px;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame .pilot-replies .han-response-ko,
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame .pilot-replies .han-response-primary{
  flex:0 0 auto;width:100%;white-space:normal;line-height:1.25;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame .han-cinematic-replies .han-compose-dock{
  display:flex;grid-template-columns:none;flex-wrap:nowrap;min-width:0;max-width:100%;
 }
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame .han-cinematic-replies .han-compose-back,
 .pilot-screen[data-pilot-scene="8"][data-pilot-step="meal-welcome"] #han-cinematic-frame .han-cinematic-replies .han-compose-send{
  flex:1 1 0;min-width:0;max-width:calc(50% - 3px);width:auto;padding:6px 3px;font-size:12px;
 }
}
