/* ScriptLuma — touch-device Camera Record layout (14 Nov 2026, build 21).
 *
 * Problem this file fixes (measured in Chrome mobile emulation using the
 * exact iOS bundle at 390x844 / 844x390 with iPhone safe-area insets):
 *   - Both toolbar rows were single-line + overflow-x:auto. In portrait the
 *     main row was 1519px wide inside a 374px box (75% of the controls
 *     invisible); in landscape 1141px inside 828px. "Record", "Close",
 *     "Full screen", Line spacing, Speed and Countdown were off-screen.
 *   - The overlay used inset:0 with viewport-fit=cover and ignored
 *     safe-area-inset-left/right/top, so edge controls sat under the notch
 *     and the home indicator in landscape.
 *
 * Scope: ONLY touch devices. Desktop / mouse windows keep the existing
 * compact two-row toolbar exactly as it was.
 */
@media (pointer: coarse) {

  /* 1. Respect the notch, status bar and home indicator. */
  .sl-video-overlay{
    box-sizing:border-box;
    padding-top:env(safe-area-inset-top, 0px);
    padding-left:env(safe-area-inset-left, 0px);
    padding-right:env(safe-area-inset-right, 0px);
    height:100%;
    overflow:hidden;
  }
  .sl-video-stage{flex:1 1 auto;min-height:0;width:100%}

  /* 2. One wrapping control panel. display:contents lets every group and
        button flow into the same flex box, so nothing can be clipped. */
  .sl-video-controls{
    flex:0 0 auto;
    display:flex;flex-direction:row;flex-wrap:wrap;
    align-items:center;align-content:center;justify-content:center;
    gap:5px;width:100%;box-sizing:border-box;
    padding:6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    max-height:46%;
    overflow-y:auto;overflow-x:hidden;
    overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  }
  .sl-video-main-row,
  .sl-video-controls .sl-video-settings-row{display:contents!important}
  .sl-video-main-row>*,
  .sl-video-controls .sl-video-settings-row>*{flex:0 0 auto}

  /* 3. Compact, thumb-sized controls so the panel stays short. */
  .sl-video-controls .sl-video-group{
    flex-wrap:nowrap!important;padding:3px 5px;gap:4px;border-radius:8px;
  }
  .sl-video-controls .sl-video-group-label{display:none!important}
  .sl-video-controls button,
  .sl-video-controls a{
    padding:5px 7px;font-size:10px;line-height:1.15;min-height:30px;
    white-space:nowrap;box-sizing:border-box;
  }
  .sl-video-controls .sl-video-seg{padding:2px;gap:2px}
  .sl-video-controls .sl-video-seg button{
    padding:4px 6px;font-size:9px;min-height:28px;
  }
  .sl-video-controls .sl-video-chip{padding:4px 6px;font-size:9px}
  .sl-video-controls .sl-video-focus-toggle{padding:4px 6px;font-size:9px}
  .sl-video-controls .sl-video-sl{font-size:9px;gap:3px;white-space:nowrap}
  .sl-video-controls .sl-video-sl strong{min-width:18px;font-size:9px}
  .sl-video-controls .sl-video-sl input[type=range]{width:48px;height:18px;margin:0}
  .sl-video-controls .sl-video-sound-group .sl-video-sl input[type=range]{width:48px}
  .sl-video-controls .sl-video-thickness input{width:44px}
  .sl-video-controls .sl-video-sl select,
  .sl-video-controls .sl-video-sl input[type=number]{
    padding:3px 4px;font-size:9px;
  }
  .sl-video-controls .sl-video-sl input[type=number]{width:44px}
  .sl-video-controls .sl-video-guide-colors button{
    width:14px;height:14px;min-width:14px;
  }
  .sl-video-controls .sl-video-group{gap:4px!important}

  /* 4. Landscape phones are short: never let the toolbar eat the picture. */
  @media (max-height: 520px){
    .sl-video-controls{max-height:40%;gap:4px}
    .sl-video-controls .sl-video-group{padding:2px 4px}
    .sl-video-controls button,.sl-video-controls a{min-height:28px;padding:4px 6px}
    .sl-video-controls .sl-video-seg button{min-height:26px}
  }

  /* 5. Floating hints are hidden on small screens anyway; keep the badges
        inside the safe area when they are shown. */
  .sl-video-stage /* v12/v16: the status hint stays visible — the Sound/Voice state it shows is the only feedback while scrolling */
}
