/* Portrait-only: leave the live room visible above the conversation, not a duplicate still. */
@media (orientation:portrait){
 #sanctuary-view[data-phone-dorm]:is([data-scene=cyber],[data-scene=agandar]) #sanctuary-side-companion-r27.room-hub-workspace{
   --dorm-conversation-glimpse:clamp(72px,15dvh,132px);
   --dorm-sheet-max:calc(100dvh - var(--dorm-sheet-gap) - max(8px,env(safe-area-inset-top,0px)) - 52px - var(--dorm-conversation-glimpse));
 }
}
/* The summoned companion uses a readable, nearly full-width sheet on phones.
   The dorm dock above keeps its own sizing; desktop retains the anchored bubble. */
@media (pointer:coarse) and (max-width:1024px){
 body>#ar-azeroth-cameo #ar-azeroth-bubble[data-mode="conversation"]:not([hidden]),
 body>#ar-agandar-guest #ar-agandar-dialogue:not([hidden]){
  position:fixed!important;
  inset:auto max(10px,env(safe-area-inset-right,0px)) max(12px,3vw,env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))!important;
  width:auto!important;max-width:min(94vw,1050px)!important;max-height:calc(100dvh - max(32px,8vw) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;
  margin-inline:auto!important;padding:clamp(14px,3.4vw,34px)!important;overflow:auto!important;box-sizing:border-box;
  font-size:clamp(16px,4.05vw,40px)!important;line-height:1.55!important;
 }
 body>#ar-azeroth-cameo #ar-azeroth-bubble[data-mode="conversation"] :is(.ar-azeroth-response,.ar-azeroth-scene,.ar-azeroth-player-reply),
 body>#ar-agandar-guest #ar-agandar-dialogue .ar-agandar-dialogue-content{
  font-size:clamp(16px,4.05vw,40px)!important;
 }
 body>#ar-azeroth-cameo #ar-azeroth-bubble[data-mode="conversation"] .ar-azeroth-choices{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(6px,1.5vw,16px);
 }
 body>#ar-azeroth-cameo #ar-azeroth-bubble[data-mode="conversation"] :is(.ar-azeroth-choices,.ar-azeroth-bubble-actions) button,
 body>#ar-agandar-guest #ar-agandar-dialogue .ar-agandar-dialogue-actions button{
  min-width:0!important;min-height:clamp(44px,10.6vw,106px)!important;font-size:clamp(14px,3.65vw,36px)!important;white-space:normal!important;overflow-wrap:anywhere;
 }
}

@media (pointer:coarse) and (max-width:1024px){
 body>#ar-azeroth-cameo #ar-azeroth-bubble[data-mode="conversation"] h3,
 body>#ar-agandar-guest #ar-agandar-dialogue .ar-agandar-dialogue-head strong{
  font-size:clamp(18px,4.6vw,46px)!important;
 }
}

/* Fit the existing 980px layout to the narrowest phone without shrinking the
   companion's dialogue or choice targets below a readable physical size. */
@media (pointer:coarse) and (max-device-width:350px) and (orientation:portrait){
 body>#ar-azeroth-cameo #ar-azeroth-bubble[data-mode="conversation"]:not([hidden]),
 body>#ar-agandar-guest #ar-agandar-dialogue:not([hidden]),
 body>#ar-azeroth-cameo #ar-azeroth-bubble[data-mode="conversation"] :is(.ar-azeroth-response,.ar-azeroth-scene,.ar-azeroth-player-reply),
 body>#ar-agandar-guest #ar-agandar-dialogue .ar-agandar-dialogue-content{
  font-size:clamp(16px,5vw,52px)!important;
 }
 body>#ar-azeroth-cameo #ar-azeroth-bubble[data-mode="conversation"] :is(.ar-azeroth-choices,.ar-azeroth-bubble-actions) button,
 body>#ar-agandar-guest #ar-agandar-dialogue .ar-agandar-dialogue-actions button{
  min-height:clamp(44px,14vw,145px)!important;font-size:clamp(14px,4.36vw,46px)!important;
 }
}
