/* Short phone windows, including browser chrome. Keep 44px touch targets. */
:root {
  --swarm-safe-top:env(safe-area-inset-top,0px);
  --swarm-safe-bottom:env(safe-area-inset-bottom,0px);
  --swarm-safe-left:env(safe-area-inset-left,0px);
  --swarm-safe-right:env(safe-area-inset-right,0px);
}
@media (min-width:540px) and (max-height:500px) and (orientation:landscape) {
  body > header { padding:calc(4px + var(--swarm-safe-top)) calc(12px + var(--swarm-safe-right)) 4px calc(12px + var(--swarm-safe-left)); }
  .brand { font-size:28px; }
  .nav-button { width:44px; height:44px; padding:0; justify-content:center; }
  .nav-left,.nav-right { gap:0; margin:0; }
  .desktop-label,.chevron { display:none; }
  .hamburger { display:block; }
  .hint,.tagline { display:none; }
  .bottom-shade { height:64px; }
  .bottom-left { left:calc(12px + var(--swarm-safe-left)); bottom:calc(8px + var(--swarm-safe-bottom)); }
  .bottom-left .pill .icon,.pill .depth-toggle { width:44px; min-width:44px; height:42px; }
  .sound-dock { left:calc(158px + var(--swarm-safe-left)); bottom:calc(8px + var(--swarm-safe-bottom)); height:44px; }
  .sound-dock .pill,.sound-dock .sound-toggle,.sound-dock .sound-settings { height:44px; }
  .sound-dock .sound-toggle,.sound-dock .sound-settings { width:44px; padding:0; justify-content:center; }
  #soundLabel { display:none; }
  .in-draw .sound-dock { visibility:hidden; }
  .zoom { right:calc(12px + var(--swarm-safe-right)); bottom:calc(8px + var(--swarm-safe-bottom)); gap:2px; }
  .zoom .icon { width:44px; height:44px; }
  .zoom .home { min-width:48px; padding:6px 3px; }
  .swarm-level { display:none; }
  #explorePanel,#motionPanel,#soundPanel {
    left:calc(12px + var(--swarm-safe-left)); right:auto;
    top:calc(56px + var(--swarm-safe-top)); bottom:calc(60px + var(--swarm-safe-bottom));
    width:min(320px,calc(100vw - 24px - var(--swarm-safe-left) - var(--swarm-safe-right)));
    max-height:none; padding:12px 16px;
  }
  #motionPanel,#soundPanel { overflow-y:auto; overscroll-behavior:contain; }
  #motionPanel > .panel-top,#soundPanel > .panel-top {
    position:sticky; top:-12px; z-index:2; min-height:44px; margin:-12px -16px 8px;
    padding:0 12px 0 16px; background:var(--panel); border-bottom:1px solid var(--line);
  }
  #motionPanel > .panel-top .icon,#soundPanel > .panel-top .icon { margin:0; }
  #explorePanel > .panel-top,#sparkPanel > .panel-top { margin-bottom:8px; }
  #explorePanel .eyebrow,#sparkPanel > .panel-top .eyebrow { display:none; }
  #explorePanel h2,#sparkPanel h2 { font-size:17px; }
  #exploreContent .swarm-beacons {
    position:static; transform:none; display:flex; flex-direction:column;
    width:auto; max-width:none; gap:6px; margin:0 0 12px;
  }
  #exploreContent .swarm-beacon { width:100%; min-height:44px; padding:8px 12px; flex-wrap:wrap; justify-content:flex-start; gap:4px 7px; }
  #exploreContent .swarm-beacon::before { inset:0; border-radius:10px; }
  #exploreContent .swarm-beacon-preview { position:static; flex-basis:100%; width:auto; max-width:100%; transform:none; padding:0 0 0 21px; border:0; background:none; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; visibility:visible; opacity:1; pointer-events:none; }
  #exploreContent .swarm-beacon-preview strong { font-size:11px; max-height:none; overflow:visible; }
  #exploreContent .swarm-beacon-preview small { font-size:9px; }
  #motionPanel .theme-picker { position:static; visibility:visible; margin-top:12px; gap:8px; }
  #motionPanel .theme-choice { width:44px; height:44px; }
  #sparkPanel,#sparkPanel.swarm-selection,#sparkPanel.swarm-creation,#sparkPanel.spark-panel-live {
    left:auto; right:calc(12px + var(--swarm-safe-right)); top:calc(56px + var(--swarm-safe-top));
    bottom:calc(8px + var(--swarm-safe-bottom)); width:min(360px,48vw); max-height:none; padding:12px 16px;
  }
  #drawHint { top:calc(53px + var(--swarm-safe-top)); font-size:10px; }
  #drawToolbar { bottom:calc(6px + var(--swarm-safe-bottom)); height:48px; }
  #toast { bottom:calc(62px + var(--swarm-safe-bottom)); }
}
