/* Idle entry only. Preserve active-call/chat geometry and all approved media. */
#app[data-phase="idle"]:not([data-call-active="true"]) {
  padding-bottom:0;
}
#app[data-phase="idle"]:not([data-call-active="true"]) #primary {
  height:calc(var(--rosi-entry-viewport, 100svh) - var(--rosi-header-reserve, 72px));
  min-height:240px;
}
#app[data-phase="idle"]:not([data-call-active="true"]) .presence {
  grid-template-rows:minmax(0,1fr) auto auto;
}
#app[data-phase="idle"]:not([data-call-active="true"]) .scene-body { grid-row:1; }
#app[data-phase="idle"]:not([data-call-active="true"]) #desktop-steps { grid-row:2; }
#app[data-phase="idle"]:not([data-call-active="true"]) .controls {
  grid-row:3;
  grid-template-rows:18px minmax(48px,auto);
  padding-bottom:max(12px,env(safe-area-inset-bottom));
}
#app[data-phase="idle"]:not([data-call-active="true"]) > footer {
  position:static;inset:auto;
  margin:24px clamp(24px,4vw,72px) 0;
}
/* Bound the end screen independently of the document's previous scroll position. */
#rating-dialog {
  position:fixed;
  max-height:calc(100dvh - 24px);
  overflow-y:auto;
  overscroll-behavior:contain;
  scroll-padding-block:12px;
}
@media(max-width:767px),(max-width:1024px) and (pointer:coarse) {
  #rating-dialog {height:100dvh;max-height:100dvh;box-sizing:border-box;}
}
@media(max-height:700px) {
  #rating-dialog .rating-brand {margin-bottom:6px;}
  #rating-dialog #rating-video {height:clamp(60px,17dvh,118px);min-height:60px;margin-bottom:4px;}
  #rating-dialog #rating-title {margin-bottom:6px;}
  #rating-dialog #rating-copy {margin-bottom:6px;}
  #rating-dialog .rating-gesture {margin:6px 0;padding:6px 10px;}
  #rating-dialog #rating-hint {margin:4px auto 6px;}
}
@media(max-height:520px) {
  #rating-dialog {padding-top:10px;padding-bottom:max(10px,env(safe-area-inset-bottom));}
  #rating-dialog .rating-brand {display:none;}
  #rating-dialog #rating-video {height:60px;}
  #rating-dialog #rating-title {font-size:25px;}
  #rating-dialog #rating-copy {font-size:12px;}
  #rating-dialog .rating-gesture {font-size:14px;}
}
