/* © 2026 VuTruWonders. All rights reserved. Copying, redistributing or reusing this code, content or design without written permission is prohibited. */
/* ===== Mobile layout (<= 700px) =====
   Top: one scrollable button strip, then the tab strip. Bottom: a button dock above a bottom sheet.
   Nothing is positioned on top of anything else; spacing follows --sh (sheet) and --dk (dock),
   which js/mobile.js keeps up to date. */
#phd,#tools>summary{display:none}
@media(max-width:700px){
  :root{--sh:38dvh;--dk:84px;--gap:8px}

  /* top strip */
  header{left:8px!important;right:8px!important;top:calc(6px + env(safe-area-inset-top,0px))!important;height:40px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;pointer-events:auto;gap:6px!important;flex-wrap:nowrap;align-items:center}
  header::-webkit-scrollbar{display:none}
  header>*{flex:0 0 auto;white-space:nowrap}
  header button{min-height:36px;font-size:12px!important;padding:0 12px!important}
  #lgl a{width:36px;height:36px}
  nav{top:calc(52px + env(safe-area-inset-top,0px));padding:4px 8px;gap:4px;scrollbar-width:none;z-index:3}
  nav button{height:38px;min-width:44px;white-space:nowrap}

  /* small sky view, top right, below the tab strip */
  #sky{top:calc(106px + env(safe-area-inset-top,0px))!important;bottom:auto!important;right:8px!important;width:104px;padding:5px;font-size:9.5px;line-height:1.25;border-radius:10px}
  #sky canvas{width:92px;height:92px}
  body:has(#tl2.open) #sky{top:calc(152px + env(safe-area-inset-top,0px))!important}
  #tl2{top:calc(104px + env(safe-area-inset-top,0px))!important;left:8px;right:8px}
  #hud{left:8px!important;top:calc(150px + env(safe-area-inset-top,0px))!important;max-width:calc(100vw - 136px)}
  #ev{top:calc(100px + env(safe-area-inset-top,0px))!important}

  /* bottom sheet */
  #panel{left:8px!important;right:8px!important;top:auto!important;bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;width:auto!important;max-height:var(--sheet-h,38dvh);padding:0 12px 12px!important;border-radius:18px!important;overflow-y:auto;overscroll-behavior:contain;z-index:4}
  body[data-sheet="tall"]{--sheet-h:78dvh}
  body[data-sheet="mid"]{--sheet-h:38dvh}
  body[data-sheet="low"]{--sheet-h:132px}
  #phd{display:flex;position:sticky;top:0;z-index:3;width:calc(100% + 24px);margin:0 -12px 2px;padding:10px 0 8px;justify-content:center;border:0;border-radius:18px 18px 0 0;background:rgba(14,19,46,.97);cursor:pointer;min-height:30px;flex:0 0 auto}
  #phd i{display:block;width:44px;height:5px;border-radius:5px;background:rgba(255,255,255,.35)}
  #brand{order:-1;margin:0 0 6px!important;font-size:12px!important;padding:5px 12px!important}
  #r1{order:0}
  #txt{order:1;min-height:0!important;margin-top:6px;padding-top:6px}
  #tools{order:2;flex:0 0 auto;margin-top:6px;border-top:1px solid var(--line)}
  #panel #info{flex:0 0 auto!important;height:auto!important;min-height:0!important;overflow:visible!important;font-size:14px}
  #panel .row{font-size:13px;gap:8px;margin:6px 0}
  #panel .row label{min-width:104px}
  #tools>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;cursor:pointer;list-style:none;font-size:14px;font-weight:600;color:var(--ink)}
  #tools>summary::-webkit-details-marker{display:none}
  #tools>summary::after{content:'▾';color:var(--mute);transition:transform .2s}
  #tools[open]>summary::after{transform:rotate(180deg)}
  #tools .th{margin-left:auto;font-size:11px;font-weight:400;color:var(--mute)}
  #tools>summary small{display:none}
  #tools:not([open])>:not(summary){display:none}

  /* button dock directly above the sheet */
  #ctl{left:8px!important;right:8px!important;top:auto!important;bottom:calc(var(--sh) + 16px + env(safe-area-inset-bottom,0px))!important;flex-direction:column;align-items:stretch;gap:6px;z-index:5}
  #ctl .cr{display:flex;gap:6px;flex-wrap:wrap;align-items:center;pointer-events:none}
  #ctl .cr:first-child{justify-content:flex-end}
  #ctl button{min-height:38px;font-size:12.5px!important;padding:0 11px!important}
  #ctl #play{min-width:0!important}
  #chb,#msb,#nbb,#skb,#gdb,#atb{padding:0 10px!important}
  #bot{position:relative!important;left:auto!important;bottom:auto!important;margin-right:auto;pointer-events:none;align-self:flex-end}
  #bot #nv{pointer-events:auto}
  #nv svg{width:38px;height:43px}
  #bub{position:absolute;left:0;bottom:calc(100% + 6px);width:max-content;max-width:calc(100vw - 24px);margin:0!important;font-size:13px;pointer-events:none}
  body.fs nav{top:env(safe-area-inset-top,0px)}
  body.fs #ctl{top:auto!important;bottom:calc(10px + env(safe-area-inset-bottom,0px))!important}

  #ghint{bottom:auto!important;top:calc(108px + env(safe-area-inset-top,0px));font-size:12px;padding:7px 14px;max-width:calc(100vw - 24px);text-align:center}
  #hb,#sb{left:50%!important;bottom:calc(var(--sh) + var(--dk) + 26px)!important;max-width:calc(100vw - 16px);flex-wrap:wrap;justify-content:center}
  #pp,#gd,#sm,#hm,#dpop{max-height:88dvh}
}
