/* CARL V7.1.2 — full-height mobile home, no legacy fixed stage. */
@media (max-width:700px) and (orientation:portrait) {
  html,body{min-height:100%;width:100%;overflow-x:clip}
  #appView:not(.hidden){
    display:flex!important;flex-direction:column!important;
    box-sizing:border-box;width:100%;max-width:100%;
    height:100dvh!important;min-height:100svh!important;
    padding:calc(env(safe-area-inset-top,0px) + 9px) 12px calc(env(safe-area-inset-bottom,0px) + 9px)!important;
    overflow:hidden;
  }
  #appView .topline{flex:0 0 auto;flex-wrap:nowrap!important;min-width:0;gap:6px!important;align-items:center}
  #appView .topline .top-left{min-width:0;flex-shrink:1}
  #appView .top-brand{font-size:clamp(20px,5.5vw,25px)!important;line-height:1.1!important}
  #appView .topline .carl-shortcuts{margin-left:auto;flex-wrap:nowrap!important;min-width:0;gap:5px!important}
  #appView .topline button{margin:0!important;padding:7px 8px!important;min-height:38px!important;font-size:clamp(9px,2.55vw,11px)!important;white-space:nowrap}
  #appView .shield{width:34px;height:34px;min-width:34px;flex-shrink:0}
  #appView .stage-grid{display:block!important;flex:1 1 0%!important;min-height:0!important;min-width:0!important;margin:0!important;width:100%;align-self:stretch!important;overflow:visible}
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open){
    width:100%!important;max-height:none!important;
    height:100%!important;min-height:0!important;
    margin:0!important;overflow:visible!important;
  }
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .core-region{
    width:clamp(190px,64vw,285px)!important;max-width:75svh;
    top:49%!important;left:50%!important;
  }
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .ambient-ring.outer{inset:-29px!important}
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .ambient-ring:not(.outer){inset:-18px!important}
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .carl-telemetry{
    display:grid!important;position:absolute!important;inset:0!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:62px minmax(0,1fr) 62px!important;
    grid-auto-rows:auto!important;gap:0 5px!important;
    align-items:stretch!important;align-content:stretch!important;
    padding:clamp(15px,2.4svh,24px) 0 clamp(18px,2.7svh,26px)!important;
    pointer-events:none!important;
  }
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .carl-telemetry-cell{
    display:flex!important;justify-content:flex-start!important;align-self:start!important;
    min-width:0;gap:3px!important;padding:5px 3px 5px 7px!important;
    text-align:left!important;border-left:1px solid #9c852e85!important;border-right:0!important;
    background:none!important;
  }
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .carl-telemetry-cell:nth-child(-n+3){grid-row:1!important}
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .carl-telemetry-cell:nth-child(n+4){grid-row:3!important;align-self:end!important}
  #appView .carl-telemetry-cell span{font-size:clamp(8px,2.1vw,10px)!important;line-height:1.35!important;letter-spacing:.035em!important}
  #appView .carl-telemetry-cell strong{font-size:clamp(9px,2.5vw,12px)!important;line-height:1.35!important;letter-spacing:0!important}
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .hold-hint{
    top:calc(49% + clamp(136px,37vw,184px))!important;bottom:auto!important;transform:translateX(-50%)!important;
  }
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .core-message{
    top:calc(49% + clamp(161px,43vw,211px))!important;bottom:auto!important;
  }
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .orbital-menu .orbit-item{top:49%!important}
  #appView .bottomline{flex:0 0 auto!important;margin:0!important;min-height:23px!important;padding:9px 0 0!important}
  /* Panels can grow and scroll; never force chat into the home height. */
  #appView:has(.stage.chat-open,.stage.settings-open,.stage.voice-open){height:auto!important;min-height:100dvh!important;overflow:visible!important}
  #appView:has(.stage.chat-open,.stage.settings-open,.stage.voice-open) .stage-grid{flex:1 0 auto!important}
  #appView .stage.chat-open,#appView .stage.settings-open,#appView .stage.voice-open{height:auto!important;min-height:max(650px,75svh)!important}
}
@media (max-width:700px) and (max-height:710px) and (orientation:portrait){
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .core-region{width:clamp(178px,57vw,230px)!important}
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .hold-hint{top:calc(49% + clamp(126px,34vw,158px))!important}
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .core-message{top:calc(49% + clamp(148px,40vw,188px))!important}
  #appView .stage:not(.chat-open):not(.settings-open):not(.voice-open) .carl-telemetry{grid-template-rows:53px minmax(0,1fr) 53px!important;padding-top:8px!important;padding-bottom:13px!important}
}
@media (max-width:359px) and (orientation:portrait){
  #appView .top-brand{font-size:19px!important}
  #appView .topline button{padding:6px 5px!important;font-size:9px!important}
  #appView .shield{width:30px;height:30px;min-width:30px}
}
@media (max-width:950px) and (max-height:520px) and (orientation:landscape){
  #appView{height:auto!important;min-height:100svh!important;overflow-y:auto!important}
  #appView .stage{min-height:390px!important}
}
