/* Fit the picker and preview to the window instead of stretching to the fleet. */
.page-content[data-ui-route="mirroring"] .page-head { margin-bottom:14px; gap:12px; }
.page-content[data-ui-route="mirroring"] .page-head h1 { font-size:30px; letter-spacing:-.035em; }
.page-content[data-ui-route="mirroring"] .page-head p { margin-top:6px; font-size:13px; line-height:1.5; }
.page-content[data-ui-route="mirroring"] .mirror-layout {
  --screen-panel-height:clamp(350px,calc(100dvh - 210px),760px);
  gap:12px;
  align-items:start;
}
.page-content[data-ui-route="mirroring"] .mirror-picker {
  height:var(--screen-panel-height);
  min-height:0;
  max-height:none;
  min-width:0;
  overflow:hidden;
}
.page-content[data-ui-route="mirroring"] .mirror-picker .panel-head { flex:none; padding:12px; }
.page-content[data-ui-route="mirroring"] .picker-search { flex:none; padding:0 10px 10px; gap:8px; }
.page-content[data-ui-route="mirroring"] .picker-search .input-shell,
.page-content[data-ui-route="mirroring"] .picker-search select { min-height:36px; height:36px; }
.page-content[data-ui-route="mirroring"] .mirror-status-legend { flex:none; padding:9px 11px; gap:6px; }
.page-content[data-ui-route="mirroring"] .mirror-device-list { flex:1 1 0; min-height:0; max-height:none; overflow-y:auto; overscroll-behavior-y:contain; }
.page-content[data-ui-route="mirroring"] .mirror-device { min-height:48px; padding:8px 10px; }
.page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) {
  --screen-preview-ratio:.6;
  height:var(--screen-panel-height);
  min-height:0;
  min-width:0;
  display:flex;
  flex-direction:column;
}
.page-content[data-ui-route="mirroring"] .mirror-theater.apollo-photo-mode { --screen-preview-ratio:1.44668; }
.page-content[data-ui-route="mirroring"] .mirror-theater.apollo-8-pro-s-mode { --screen-preview-ratio:1; }
.page-content[data-ui-route="mirroring"] .mirror-theater:has(.screen-hardware.landscape) { --screen-preview-ratio:1.66667; }
.page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-viewport {
  height:auto;
  min-height:0;
  flex:1 1 0;
}
.page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-device-stage { inset:10px; }
.page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-toolbar { flex:none; padding:10px 12px; gap:10px; }
.page-content[data-ui-route="mirroring"] #mirror-current { flex:1; min-width:0; }
.page-content[data-ui-route="mirroring"] #mirror-current > div { min-width:0; }
.page-content[data-ui-route="mirroring"] #mirror-current strong,
.page-content[data-ui-route="mirroring"] #mirror-current small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-controls { flex:none; min-height:48px; padding:7px 12px; }
.page-content[data-ui-route="mirroring"] .mirror-controls > div { flex-wrap:wrap; }
@media (max-width:1100px) {
  .page-content[data-ui-route="mirroring"] #mirror-current { flex-wrap:wrap; gap:6px; }
  .page-content[data-ui-route="mirroring"] #mirror-current .mirror-state-chip { margin-left:0; }
  .page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-toolbar { flex-wrap:wrap; }
}
@media (max-width:900px) {
  .page-content[data-ui-route="mirroring"] .mirror-layout { grid-template-columns:minmax(0,1fr); }
  .page-content[data-ui-route="mirroring"] .mirror-picker { height:auto; max-height:280px; }
  .page-content[data-ui-route="mirroring"] .mirror-picker .panel-head { padding:10px 12px; }
  .page-content[data-ui-route="mirroring"] .picker-search { flex-direction:row; }
  .page-content[data-ui-route="mirroring"] .picker-search .input-shell { flex:1; min-width:0; }
  .page-content[data-ui-route="mirroring"] .picker-search select { flex:0 1 155px; min-width:0; width:auto; max-width:42%; }
  .page-content[data-ui-route="mirroring"] .mirror-status-legend { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .page-content[data-ui-route="mirroring"] .mirror-legend-entry { min-width:0; font-size:10px; gap:5px; }
  .page-content[data-ui-route="mirroring"] .mirror-legend-entry > span { min-width:0; }
  .page-content[data-ui-route="mirroring"] .mirror-device-list { flex:1 1 auto; min-height:48px; max-height:120px; }
  .page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) { height:auto; }
  .page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-viewport {
    flex:none;
    aspect-ratio:var(--screen-preview-ratio);
    height:auto;
    max-height:min(620px,calc(100dvh - 180px));
  }
}
@media (max-width:560px) {
  .page-content[data-ui-route="mirroring"] .page-head h1 { font-size:27px; }
  .page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-toolbar { align-items:flex-start; gap:6px; padding:9px 10px; }
  .page-content[data-ui-route="mirroring"] #mirror-current { flex-basis:100%; }
  .page-content[data-ui-route="mirroring"] .mirror-toolbar > .mirror-stream-state { margin-left:0; max-width:100%; }
  .page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-controls { padding:7px 8px; gap:6px; }
  .page-content[data-ui-route="mirroring"] .mirror-controls > span { display:none; }
  .page-content[data-ui-route="mirroring"] .mirror-controls > div { width:100%; justify-content:space-between; gap:3px; }
  .page-content[data-ui-route="mirroring"] .mirror-controls .control-divider { margin:0 2px; }
  .page-content[data-ui-route="mirroring"] .mirror-theater:not(:fullscreen) .mirror-device-stage { inset:8px; }
}
