/* =========================================================
   V150 · PHASE 4 · MOBILE J0–J3
   Phone-first production pass built on the V149 architecture.
   Target viewport matrix:
   320x568 · 360x800 · 375x667 · 390x844 · 412x915 · 430x932
   Scope: J0–J3 only. J4 intentionally untouched.
   ========================================================= */

/* ---------- Phone contract ---------- */
html[data-dobox-layout="phone-compact"],
html[data-dobox-layout="phone"],
html[data-dobox-layout="phone-large"]{
  --p4-gutter:clamp(10px,3.1vw,14px);
  --p4-hud-brand-h:46px;
  --p4-meta-top:56px;
  --p4-content-top:max(108px,calc(env(safe-area-inset-top) + 98px));
  --p4-bottom:max(12px,calc(env(safe-area-inset-bottom) + 8px));
  --p4-sheet-max:48svh;
  --p4-sheet-radius:18px;
  --p4-touch:48px;
  --p4-readable:calc(100vw - (2 * var(--p4-gutter)));
}

html[data-dobox-layout^="phone"] body,
html[data-dobox-layout^="phone"] #root,
html[data-dobox-layout^="phone"] .experience{
  width:100%;
  min-width:0;
  max-width:100vw;
  min-height:100svh;
  overflow:hidden;
}
html[data-dobox-layout^="phone"] .experience :is(button,[role="button"],a,summary,input,select){min-width:0;}
html[data-dobox-layout^="phone"] .experience :is(button,[role="button"]){min-height:var(--p4-touch);}
html[data-dobox-layout^="phone"] .interaction-layer{overflow:hidden;}
html[data-dobox-layout^="phone"] .world-image{inset:0!important;transform-origin:center center;}
html[data-dobox-layout^="phone"] .chapter-day0 .world-image{background-position:center top!important;}

/* One HUD geometry for J0–J3. No scene is allowed behind it. */
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand{
  top:max(7px,env(safe-area-inset-top))!important;
  left:8px!important;
  max-width:min(47vw,184px)!important;
  min-height:42px!important;
  padding:4px 8px 4px 4px!important;
  gap:7px!important;
}
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand img{width:36px!important;height:36px!important;flex:0 0 36px!important;}
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand b{font-size:10.5px!important;line-height:1.05!important;letter-spacing:.08em!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;}
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand small{font-size:6px!important;line-height:1.1!important;letter-spacing:.12em!important;}
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .sound{
  top:max(8px,env(safe-area-inset-top))!important;
  right:8px!important;
  width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;
}
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .journey-menu-trigger{
  top:max(55px,calc(env(safe-area-inset-top) + 47px))!important;
  right:8px!important;
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
}
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .scene-meta{
  top:max(56px,calc(env(safe-area-inset-top) + 48px))!important;
  left:10px!important;right:64px!important;
  width:auto!important;max-width:none!important;min-height:0!important;
  transform:none!important;
  padding:4px 8px!important;gap:7px!important;
  border-radius:999px!important;
  text-align:left!important;
  overflow:hidden!important;
}
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .scene-meta time{font-size:15px!important;flex:0 0 auto;}
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .scene-meta span{font-size:8px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}

/* Stable phone sheets. Only the body scrolls when content genuinely cannot fit. */
html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) :is(
  .narration,.airport-whisper,.shuttle-whisper,.shuttle-arrival-cue,.taxi-address-panel,.taxi-greeting-v38,
  .taxi-ride-control,.taxi-arrival-meter,.ryokan-whisper,.sato-response,.meal-sato-whisper,.meal-farewell-choice,
  .genkan-repere,.detail-slip,.bath-repere,.afterbath-culture,.yukata-guide-card,
  .d2-story-panel,.d2-aoi-panel,.d2-shop-panel,.d2-ritual-panel,.d2-prayer-panel,.v72-shelf-sheet,.v72-basket-sheet,
  .v72-counter-card,.v73-basket-drawer,.v79-tanaka-dialogue,.v79-question-panel,.v79-answer-panel,.v79-farewell-panel,.v78-return-panel,
  .v104-whisper,.v104-dialogue-stack,.v104-dialogue,.v104-optional-reply,.v104-bill-flow,.v104-cruise-ticket
){box-sizing:border-box!important;max-width:var(--p4-readable)!important;}

/* ---------- DAY 0 ---------- */
html[data-dobox-layout^="phone"] .chapter-day0 .narration{
  right:var(--p4-gutter)!important;left:var(--p4-gutter)!important;
  bottom:var(--p4-bottom)!important;width:auto!important;
  max-height:min(54svh,430px)!important;overflow:auto!important;overscroll-behavior:contain;
}
html[data-dobox-layout^="phone"] .chapter-day0 .narration>div{padding:14px 8px 13px 14px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .narration h2{font-size:clamp(30px,9vw,38px)!important;line-height:1.01!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .narration p{font-size:13px!important;line-height:1.43!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .narration blockquote{font-size:16px!important;line-height:1.35!important;margin-top:12px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .quiet-action{position:sticky;bottom:0;min-height:54px!important;margin-top:11px!important;padding:10px 15px!important;background:rgba(6,28,39,.93)!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .letter-object{right:5%!important;bottom:max(7%,calc(env(safe-area-inset-bottom) + 40px))!important;width:min(76vw,330px)!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .letter-object span{font-size:15px!important;line-height:1.25!important;}

html[data-dobox-layout^="phone"] .chapter-day0 .letter-focus{
  padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom))!important;
  align-items:center!important;
}
html[data-dobox-layout^="phone"] .chapter-day0 .paper-letter{
  width:100%!important;max-width:calc(100vw - 16px)!important;
  max-height:calc(100svh - max(16px,env(safe-area-inset-top) + env(safe-area-inset-bottom)))!important;
  padding:16px 14px 10px!important;border-radius:16px!important;overflow:hidden!important;
}
html[data-dobox-layout^="phone"] .chapter-day0 .paper-letter header{flex:0 0 auto;}
html[data-dobox-layout^="phone"] .chapter-day0 .paper-letter header b{width:42px!important;height:42px!important;font-size:17px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .paper-letter h2{flex:0 0 auto;font-size:clamp(38px,12vw,52px)!important;line-height:.98!important;margin:4px 0 7px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .letter-scroll{min-height:0!important;max-height:none!important;flex:1 1 auto!important;padding:0 4px 16px!important;font-size:17px!important;line-height:1.38!important;overflow:auto!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .letter-scroll p{margin:0 0 12px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .paper-letter footer{flex:0 0 auto;margin:0!important;padding:8px 0 max(2px,env(safe-area-inset-bottom))!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .paper-letter footer button{min-height:52px!important;padding:9px 13px!important;font-size:13px!important;}

/* J0 object scenes: keep instructions, object and action in one reachable vertical flow. */
html[data-dobox-layout^="phone"] .chapter-day0 .object-focus{
  inset:var(--p4-content-top) var(--p4-gutter) var(--p4-bottom)!important;
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  gap:10px!important;padding:0 0 6px!important;overflow-y:auto!important;overflow-x:hidden!important;
  overscroll-behavior:contain;scrollbar-gutter:stable both-edges;
}
html[data-dobox-layout^="phone"] .chapter-day0 .focus-copy{
  flex:0 0 auto!important;padding:10px 12px!important;border-radius:0 14px 14px 0;
  background:linear-gradient(90deg,rgba(4,24,33,.82),rgba(4,24,33,.18))!important;
}
html[data-dobox-layout^="phone"] .chapter-day0 .focus-copy h2{font-size:clamp(27px,8.4vw,35px)!important;line-height:1.02!important;margin:5px 0!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .focus-copy p{font-size:12.5px!important;line-height:1.38!important;margin-top:7px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .primary.inline{
  position:sticky!important;z-index:4;bottom:0!important;left:auto!important;
  flex:0 0 auto!important;width:100%!important;min-height:54px!important;margin:0!important;
  padding:11px 14px!important;font-size:13px!important;background:rgba(7,29,38,.94)!important;backdrop-filter:blur(8px);
}
html[data-dobox-layout^="phone"] .chapter-day0 .ticket-personalize{flex:0 0 auto!important;width:100%!important;margin:0!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .ticket-personalize label{right:7%!important;left:7%!important;bottom:14%!important;padding:6px 10px 4px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .ticket-personalize input{font-size:clamp(24px,7vw,30px)!important;min-height:40px;}

html[data-dobox-layout^="phone"] .chapter-day0 .passport-book{flex:0 0 auto!important;width:min(100%,430px)!important;margin-inline:auto;}
html[data-dobox-layout^="phone"] .chapter-day0 .passport-name{right:4%!important;bottom:19%!important;width:44%!important;padding:4px 5px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .passport-name strong{font-size:clamp(21px,7vw,28px)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-dobox-layout^="phone"] .chapter-day0 .passport-questions{display:flex!important;flex-direction:column!important;gap:8px!important;flex:0 0 auto!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .passport-questions fieldset{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:7px!important;margin:0!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .passport-questions button{min-height:50px!important;padding:9px 10px!important;font-size:12px!important;}

html[data-dobox-layout^="phone"] .chapter-day0 .support-demo{flex:0 0 auto!important;padding:14px 12px!important;border-radius:16px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .support-demo span{font-size:clamp(52px,17vw,72px)!important;line-height:1!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .support-demo small{font-size:13px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .support-demo p{font-size:12px!important;line-height:1.38!important;margin-top:10px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .choice-row{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:7px!important;flex:0 0 auto!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .choice-row button{min-height:72px!important;padding:9px 10px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .choice-row b{font-size:15px!important;line-height:1.18!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .choice-row small{font-size:10px!important;line-height:1.28!important;}

html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px!important;flex:0 0 auto!important;
}
html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects button{width:auto!important;min-height:210px!important;padding:8px!important;border-radius:16px;}
html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects img{width:92%!important;height:min(19svh,145px)!important;max-height:145px!important;object-fit:contain!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects b{font-size:18px!important;line-height:1.1!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects small{font-size:9.5px!important;line-height:1.25!important;}

html[data-dobox-layout^="phone"] .chapter-day0 .drag-scene{flex:0 0 auto!important;min-height:clamp(300px,44svh,390px)!important;touch-action:none;}
html[data-dobox-layout^="phone"] .chapter-day0 .drag-destination{top:3%!important;right:2%!important;width:47%!important;height:34%!important;min-height:100px;}
html[data-dobox-layout^="phone"] .chapter-day0 .drag-piece{bottom:2%!important;left:1%!important;width:54%!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .drag-piece img{max-height:min(24svh,190px)!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .drag-piece strong{font-size:17px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .drag-piece small{font-size:22px!important;}

html[data-dobox-layout^="phone"] .chapter-day0 .packing-focus{
  inset:var(--p4-content-top) var(--p4-gutter) var(--p4-bottom)!important;
  padding:0 0 64px!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;
}
html[data-dobox-layout^="phone"] .chapter-day0 .packing-copy{position:relative!important;top:auto!important;left:auto!important;width:100%!important;padding:10px 12px!important;border-radius:0 14px 14px 0;}
html[data-dobox-layout^="phone"] .chapter-day0 .packing-copy h2{font-size:clamp(27px,8.5vw,35px)!important;line-height:1.02!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .packing-copy p{font-size:12.5px!important;line-height:1.38!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .packing-table{position:relative!important;inset:auto!important;height:clamp(310px,46svh,430px)!important;min-height:310px!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .suitcase-open{top:1%!important;right:0!important;width:min(72%,310px)!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .packing-drag{position:absolute!important;inset:0!important;}
html[data-dobox-layout^="phone"] .chapter-day0 .packing-focus>.inline{position:sticky!important;bottom:0!important;left:auto!important;width:100%!important;z-index:5;}

/* ---------- DAY 1–3 refinement on top of V141 ---------- */
html[data-dobox-layout^="phone"] .chapter-day1 :is(.taxi-human-choice,.sato-human-choice,.meal-human-choice),
html[data-dobox-layout^="phone"] .chapter-day2 :is(.d2-food-choices,.d2-offering-choices,.d2-wish-choices),
html[data-dobox-layout^="phone"] .v104-d3-scene :is(.v104-choice-row,.v104-optional-reply>div){gap:7px!important;}

/* Any lower sheet must leave the persistent CTA / system safe zone reachable. */
html[data-dobox-layout^="phone"] .chapter-day1 :is(.machine-screen,.taxi-address-panel,.taxi-greeting-v38,.taxi-ride-control,.taxi-arrival-meter,.sato-response,.meal-farewell-choice,.bath-repere,.afterbath-culture,.yukata-guide-card),
html[data-dobox-layout^="phone"] .chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel,.v72-shelf-sheet,.v72-basket-sheet,.v72-counter-card,.v73-basket-drawer,.v79-tanaka-dialogue,.v79-question-panel,.v79-answer-panel,.v79-farewell-panel,.v78-return-panel),
html[data-dobox-layout^="phone"] .v104-d3-scene :is(.v104-whisper,.v104-dialogue-stack,.v104-dialogue,.v104-optional-reply,.v104-bill-flow,.v104-cruise-ticket){
  overscroll-behavior:contain;
}

/* Mei is present in the world without eating the whole phone. */
html[data-dobox-layout^="phone"] .chapter-day1 .mei-speech{grid-template-columns:clamp(72px,23vw,98px) minmax(0,1fr)!important;max-height:min(47svh,390px)!important;overflow:auto!important;}
html[data-dobox-layout^="phone"] .chapter-day1 .mei-speech img{width:100%!important;max-height:min(32svh,220px)!important;object-fit:contain!important;align-self:end;}
html[data-dobox-layout^="phone"] .chapter-day1 .mei-speech>div{min-width:0!important;padding:11px 10px!important;}
html[data-dobox-layout^="phone"] .chapter-day1 .mei-speech p{font-size:clamp(15px,4.4vw,18px)!important;line-height:1.32!important;}

/* Culture is optional: never sit over a required bottom action. */
html[data-dobox-layout^="phone"] :is(.chapter-day1,.chapter-day2,.chapter-day3) :is(.repere-tab,.v104-culture-note,.cultural-insight){z-index:12;}
html[data-dobox-layout^="phone"] .v104-d3-scene .v104-culture-note{max-height:min(30svh,235px)!important;width:min(62vw,240px)!important;}

/* D3 owns an internal scene HUD; keep it below the product HUD and clip long place names. */
html[data-dobox-layout^="phone"] .v104-d3-scene .v104-hud{
  top:var(--p4-content-top)!important;left:var(--p4-gutter)!important;right:64px!important;
  width:auto!important;max-width:none!important;transform:none!important;overflow:hidden!important;
}
html[data-dobox-layout^="phone"] .v104-d3-scene .v104-hud :is(span,b){white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}

/* ---------- Compact phones <= 374 CSS px ---------- */
html[data-dobox-layout="phone-compact"]{
  --p4-gutter:9px;
  --p4-content-top:max(104px,calc(env(safe-area-inset-top) + 94px));
  --p4-sheet-max:45svh;
}
html[data-dobox-layout="phone-compact"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand{max-width:148px!important;}
html[data-dobox-layout="phone-compact"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand small{display:none!important;}
html[data-dobox-layout="phone-compact"] .chapter-day0 .focus-copy h2{font-size:27px!important;}
html[data-dobox-layout="phone-compact"] .chapter-day0 .choice-row,
html[data-dobox-layout="phone-compact"] .chapter-day0 .transport-objects,
html[data-dobox-layout="phone-compact"] .chapter-day1 :is(.taxi-human-choice,.sato-human-choice,.meal-human-choice),
html[data-dobox-layout="phone-compact"] .chapter-day2 :is(.d2-food-choices,.d2-offering-choices,.d2-wish-choices,.v72-shelf-products,.v73-product-grid),
html[data-dobox-layout="phone-compact"] .v104-d3-scene :is(.v104-choice-row,.v104-optional-reply>div,.v104-menu-list,.v104-menu-drinks){grid-template-columns:1fr!important;}
html[data-dobox-layout="phone-compact"] .chapter-day0 .transport-objects button{min-height:154px!important;display:grid!important;grid-template-columns:38% minmax(0,1fr)!important;grid-template-rows:auto auto!important;text-align:left!important;align-content:center!important;column-gap:7px!important;}
html[data-dobox-layout="phone-compact"] .chapter-day0 .transport-objects img{grid-row:1/3;width:100%!important;height:88px!important;}
html[data-dobox-layout="phone-compact"] .chapter-day0 .transport-objects b{font-size:16px!important;}
html[data-dobox-layout="phone-compact"] .chapter-day0 .letter-object{width:min(82vw,290px)!important;}
html[data-dobox-layout="phone-compact"] .v104-d3-scene .v104-mei-presence>.v104-whisper{right:23vw!important;}

/* ---------- Short screens: 568/667-ish heights ---------- */
@media (max-width:600px) and (max-height:700px){
  html[data-dobox-layout^="phone"]{
    --p4-content-top:max(98px,calc(env(safe-area-inset-top) + 90px));
    --p4-sheet-max:43svh;
  }
  html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand{max-width:145px!important;}
  html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand small{display:none!important;}
  html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .scene-meta{top:max(51px,calc(env(safe-area-inset-top) + 45px))!important;}
  html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .journey-menu-trigger{top:max(50px,calc(env(safe-area-inset-top) + 44px))!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .object-focus,
  html[data-dobox-layout^="phone"] .chapter-day0 .packing-focus{inset:var(--p4-content-top) var(--p4-gutter) var(--p4-bottom)!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .focus-copy{padding:8px 10px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .focus-copy h2{font-size:26px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .focus-copy p{font-size:11.5px!important;line-height:1.32!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .support-demo{padding:10px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .support-demo span{font-size:50px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects button{min-height:160px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects img{height:92px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .drag-scene{min-height:280px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .packing-table{height:300px!important;min-height:300px!important;}
  html[data-dobox-layout^="phone"] .chapter-day1 .machine-screen{top:var(--p4-content-top)!important;max-height:calc(100svh - var(--p4-content-top) - var(--p4-bottom))!important;}
  html[data-dobox-layout^="phone"] .chapter-day1 :is(.sato-response,.meal-sato-whisper,.meal-farewell-choice,.bath-repere,.afterbath-culture,.yukata-guide-card),
  html[data-dobox-layout^="phone"] .chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel,.v72-shelf-sheet,.v72-basket-sheet,.v72-counter-card,.v73-basket-drawer,.v79-tanaka-dialogue,.v79-question-panel,.v79-answer-panel,.v79-farewell-panel,.v78-return-panel),
  html[data-dobox-layout^="phone"] .v104-d3-scene :is(.v104-whisper,.v104-dialogue-stack,.v104-dialogue,.v104-optional-reply,.v104-bill-flow,.v104-cruise-ticket){max-height:42svh!important;overflow:auto!important;}
}

/* ---------- Large phones 431–600: use room without becoming tablet ---------- */
html[data-dobox-layout="phone-large"] .chapter-day0 .object-focus,
html[data-dobox-layout="phone-large"] .chapter-day0 .packing-focus{right:14px!important;left:14px!important;}
html[data-dobox-layout="phone-large"] .chapter-day0 .transport-objects button{min-height:225px!important;}
html[data-dobox-layout="phone-large"] .chapter-day0 .passport-book{width:min(92%,470px)!important;}
html[data-dobox-layout="phone-large"] .chapter-day1 .mei-speech{grid-template-columns:105px minmax(0,1fr)!important;}

/* Landscape phone is not a stretched portrait composition. Keep action reachable. */
@media (max-width:900px) and (orientation:landscape) and (max-height:500px){
  html[data-dobox-layout^="phone"]{--p4-content-top:max(62px,calc(env(safe-area-inset-top) + 56px));--p4-gutter:10px;}
  html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand{max-width:130px!important;}
  html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .brand small{display:none!important;}
  html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .scene-meta{top:8px!important;left:145px!important;right:110px!important;}
  html[data-dobox-layout^="phone"] :is(.chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3) .journey-menu-trigger{top:8px!important;right:56px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .object-focus{display:grid!important;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)!important;grid-template-rows:1fr auto!important;gap:9px!important;overflow:auto!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .focus-copy{grid-column:1!important;grid-row:1!important;align-self:start!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 :is(.ticket-personalize,.passport-book,.support-demo,.transport-objects,.drag-scene){grid-column:2!important;grid-row:1 / 3!important;align-self:center!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 :is(.passport-questions,.choice-row){grid-column:1!important;grid-row:2!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .primary.inline{grid-column:1!important;grid-row:2!important;position:relative!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects button{min-height:130px!important;}
  html[data-dobox-layout^="phone"] .chapter-day0 .transport-objects img{height:72px!important;}
}

/* Fallback for layout.js failure: preserve phone usability. */
@media (max-width:600px){
  .chapter-day0,.chapter-day1,.chapter-day2,.chapter-day3{max-width:100vw;overflow:hidden;}
}
