/* Compact touch layout for iPhone. Desktop and clean broadcast outputs are unchanged. */
@media (max-width: 932px) and (hover: none) and (pointer: coarse) {
  html, body { min-width:0!important; width:100%; min-height:100%; overflow-x:hidden!important; -webkit-text-size-adjust:100%; }
  body:not(.output-mode):not(.display-mode) { padding-bottom:env(safe-area-inset-bottom); overflow-y:auto!important; }
  button,.btn,.mini-btn,.install,.file-btn,input,select,textarea { min-height:44px!important; touch-action:manipulation; }
  input,select,textarea { font-size:16px!important; }
  button,a,select,label { -webkit-tap-highlight-color:rgba(211,251,4,.14); }

  .home-page header { height:calc(62px + env(safe-area-inset-top)); padding:env(safe-area-inset-top) 16px 0; }
  .home-page header img { width:36px; height:30px; }
  .home-page main { width:calc(100% - 28px); padding:34px 0 28px; }
  .home-page h1 { margin-top:10px; font-size:clamp(34px,11vw,50px); }
  .home-page .intro { font-size:15px; line-height:1.5; }
  .home-page .tools { gap:12px; margin-top:30px; }
  .home-page .card { min-height:0; padding:19px; border-radius:14px; }
  .home-page .number { width:34px; height:34px; }
  .home-page h2 { margin:18px 0 6px; font-size:21px; }
  .home-page .open { padding-top:18px; }
  .home-page .install-help { top:calc(70px + env(safe-area-inset-top)); right:14px; width:calc(100% - 28px); }

  .graphics-keys-page .app,.supersource-page .app { display:block; width:100%; height:auto; min-height:100dvh; }
  .graphics-keys-page .app>header,.supersource-page .app>header {
    position:sticky; top:0; z-index:30; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:8px;
    height:auto; min-height:calc(62px + env(safe-area-inset-top)); padding:calc(8px + env(safe-area-inset-top)) 12px 9px;
  }
  .graphics-keys-page .brand,.supersource-page .brand { min-width:0; }
  .graphics-keys-page .brand img,.supersource-page .brand img { width:32px; height:28px; }
  .graphics-keys-page .brand-copy,.supersource-page .brand-copy,.graphics-keys-page .header-rule,.supersource-page .header-rule,
  .graphics-keys-page .header-spacer,.supersource-page .header-spacer { display:none; }
  .graphics-keys-page .tool-nav,.supersource-page .tool-nav { min-width:0; padding:3px; }
  .graphics-keys-page .tool-link,.supersource-page .tool-link { display:none; }
  .graphics-keys-page .tool-select,.supersource-page .tool-select { width:100%; max-width:none; min-height:38px!important; }
  .graphics-keys-page .title,.supersource-page .title { display:none; }
  .graphics-keys-page .live-badge,.supersource-page .status { justify-self:end; font-size:10px; }
  .graphics-keys-page .app>header>.btn,.supersource-page .app>header>.btn { min-width:0; padding:0 10px; font-size:11px; }
  .graphics-keys-page #saveLibrary,.graphics-keys-page #openOutput,.graphics-keys-page #exportPng,
  .supersource-page #savePreset,.supersource-page #loadPreset,.supersource-page #exportPng { grid-row:2; }
  .graphics-keys-page #saveLibrary,.supersource-page #savePreset { grid-column:1; }
  .graphics-keys-page #openOutput,.supersource-page #loadPreset { grid-column:2; }
  .graphics-keys-page #exportPng,.supersource-page #exportPng { grid-column:3; }
  .graphics-keys-page main,.supersource-page main { display:flex; min-height:0; flex-direction:column; }
  .graphics-keys-page main>.center,.supersource-page main>.stage-wrap { order:-3; }
  .graphics-keys-page main>aside.left,.supersource-page main>aside.left { order:-2; }
  .graphics-keys-page main>aside.right,.supersource-page main>aside.right { order:-1; }
  .graphics-keys-page aside,.supersource-page aside { width:100%; overflow:visible; border-right:0!important; border-left:0!important; }
  .graphics-keys-page .section,.supersource-page .section { padding:15px 14px; }
  .graphics-keys-page .row,.supersource-page .field-row { gap:8px; }

  .graphics-keys-page .center { display:block; background:#090913; }
  .graphics-keys-page .preview-area { padding:12px 12px 8px; }
  .graphics-keys-page .preview-meta { margin-bottom:7px; }
  .graphics-keys-page .stage { max-height:44dvh; }
  .graphics-keys-page .transport { position:sticky; bottom:0; z-index:20; display:grid; grid-template-columns:repeat(3,1fr); gap:7px; padding:9px 12px calc(9px + env(safe-area-inset-bottom)); }
  .graphics-keys-page .transport .btn { width:100%; min-width:0; }
  .graphics-keys-page .transport-rule { display:none; }
  .graphics-keys-page .slot { min-height:56px; }
  .graphics-keys-page .output-actions { grid-template-columns:1fr; }

  .supersource-page .stage-wrap { display:block; min-height:0; padding:16px 12px 10px; }
  .supersource-page .stage-center { display:block; }
  .supersource-page .canvas-shell { width:100%; max-height:48dvh; }
  .supersource-page .canvas-shell.portrait { width:min(58vw,310px); height:auto; margin:0 auto; }
  .supersource-page .stage-footer { display:none; }
  .supersource-page .selection-actions { top:8px; transform:translate(-50%,0); }
  .supersource-page .panel-list,.supersource-page .client-list { gap:8px; }
  .supersource-page .button-row { gap:8px; }

  .library-page header,.holding-page header,.running-page .topbar,.cue-page header,.stream-page header,.time-page header {
    height:auto; min-height:calc(58px + env(safe-area-inset-top)); padding:calc(8px + env(safe-area-inset-top)) 12px 9px; gap:8px;
  }
  .library-page .shell,.holding-page main,.running-page .layout,.cue-page main,.stream-page main,.time-page main { width:calc(100% - 20px); }
  .library-page .brand span,.holding-page .brand small,.running-page .brand small,.cue-page .brand small,.stream-page .brand small { display:none; }
  .library-page .workspace-head .actions,.holding-page .header-actions,.stream-page .actions { width:100%; }
  .library-page .workspace-head .actions .btn { flex:1; }
  .holding-page .controls { display:flex; }
  .holding-page .stage-shell { order:-1; min-height:290px; }
  .running-page .clock { font-size:18px; }
  .running-page .transport { position:sticky; bottom:env(safe-area-inset-bottom); z-index:10; }
  .cue-page .status-pill,.stream-page .save { display:none; }
  .stream-page .dest-wrap { -webkit-overflow-scrolling:touch; }
}
