/* D235 what the phone dock's sheets hold (phone/dock.js moves the controls in), plus landscape. Every
   control in a sheet is at least 44 px; nothing inside floats, so a sheet is one scrolling column. */

/* NAV: throttle, WARP and BROKER, then zoom. */
.sheet-nav { display: grid; gap: 8px; }
.sheet-nav .throttle { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sheet-nav .throttle button { min-height: 48px; min-width: 0; font-size: 13px; }
.sheet-nav .warp-ctl { min-height: 48px; width: 100%; }
.sheet-nav .warp-ctl[hidden] { display: none !important; }
.sheet-nav .zoom-ctl { position: static; display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 6px; transform: none; }
.sheet-nav .zoom-ctl button { width: auto; min-width: 44px; height: 48px; }

/* GUNS: the rack, flat in the sheet. ARM and LEAD share a row, then the target row, then the mounts. */
.sheet-guns .weapon-rack {
  position: static !important; left: auto; right: auto; bottom: auto; width: auto; transform: none; margin: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; background: none; border: 0; box-shadow: none; padding: 0;
}
.sheet-guns .weapon-rack[hidden] { display: none !important; }
.sheet-guns .weapon-rack-head { grid-column: 1; grid-row: 1; display: flex; align-items: center; }
.sheet-guns .weapon-rack-head > span { display: none; }
.sheet-guns .weapon-arm { min-height: 44px; min-width: 96px; font-size: 12px; }
.sheet-guns .weapon-lead { grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.sheet-guns .weapon-lead button { min-width: 44px; min-height: 44px; font-size: 16px; }
.sheet-guns .weapon-target-row { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 44px minmax(0, 1fr) 44px 44px 44px; }
.sheet-guns .weapon-target-label { display: none; }
.sheet-guns .weapon-target-row button { min-height: 44px; min-width: 44px; }
.sheet-guns #weaponSlots { grid-column: 1 / -1; grid-row: 3; }
.sheet-guns .weapon-card, .sheet-guns .weapon-fire { min-height: 88px; }
.sheet-guns .weapon-auto, .sheet-guns .weapon-target-btn { min-height: 44px; min-width: 44px; }

/* ABIL: the hotbar as one row of big slots. */
.sheet-abil .ability-bar { position: static; display: block; max-width: none; }
.sheet-abil .ability-bar[hidden] { display: none !important; }
.sheet-abil .hb-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-abil .ability-bar .hb-slot, .sheet-abil .ability-bar .hb-open { width: 56px !important; height: 56px !important; }
.sheet-abil .ability-bar .hb-open { width: 44px !important; }
.sheet-abil .ability-bar .hb-ring { width: 56px; height: 56px; }
.sheet-abil .ability-bar .hb-icon { inset: 5px; width: 46px; height: 46px; }

/* MENU: panes, HAUL, every top-bar button, then the way back to the Tavern. */
.sheet-menu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sheet-menu > * { min-width: 0; }
/* The MENU is one level, like the design: the desktop's SHIP/WORK/PILOT/FLIGHT/COMMS accordion is
   unwrapped (dock.js opens those groups in the sheet), so every tool is a single tap in the same grid
   instead of a second screen nested inside the sheet. */
.sheet-menu #hudTools, .sheet-menu .hud-tools-group, .sheet-menu .hud-tools-items { display: contents; }
.sheet-menu .hud-tools-group > summary { display: none; }
.sheet-menu .hud-tools-items .hud-btn { justify-content: center; min-height: 48px !important; padding: 4px 6px; text-align: center; }
.sheet-menu .dots { display: contents; }
.sheet-menu .dots button { width: auto; height: 44px; border-radius: 0; border: 1px solid var(--line); }
.sheet-menu .dots button::after { position: static; content: attr(aria-label); width: auto; height: auto; margin: 0; background: none; font-size: 12px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.sheet-menu .dots button.on { border-color: var(--cyan); }
.sheet-menu .dots button.on::after { color: var(--cyan); box-shadow: none; background: none; }
.sheet-menu .hud-btn { display: inline-flex !important; align-items: center; justify-content: center; min-height: 48px !important; padding: 4px; font-size: 11px; letter-spacing: 0.08em; }
.sheet-menu .hud-btn[hidden] { display: none !important; }
.sheet-menu .hud-btn kbd { display: none; }
.sheet-menu .haul-bar { position: static; display: block; transform: none; }
.sheet-menu .haul-bar .notice-btn { width: 100%; min-height: 48px; }
body.phoneUi .haul-tray { position: fixed; left: 10px; right: 10px; width: auto; bottom: calc(var(--dock) + 8px); max-height: calc(50 * var(--vh)); z-index: 40; }
/* The desk is the only panel on screen when it is open, so its CLOSE is the way back: a thumb-sized
   target, not the 22 px desktop header button. */
body.phoneUi .haul-tray .notice-clear { min-height: 44px; min-width: 44px; }
.sheet-menu .signin { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line); font-size: 11px; }
.sheet-menu .signin[hidden] { display: none; }
.sheet-menu .phone-back { color: #f3e6c4; border: 1px solid #5a4d33; text-decoration: none; letter-spacing: 0.1em; position: static; grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 0; font-size: 12px; }

/* Landscape phone: the dock stays at the bottom; sheets open bottom-left over the flight column (which
   steps aside while one is open) so the ship and the minimap stay in view; messages sit under the map. */
@media (max-height: 500px) and (orientation: landscape) {
  body.phoneUi { --dock: calc(52px + env(safe-area-inset-bottom, 0px)); --lane: 108px; }
  body.phoneUi .phone-sheet { right: auto; width: min(440px, 54%); max-height: calc(100% - var(--hud) - var(--dock) - 6px); }
  body.phoneUi:not([data-phone-sheet=""]) .space-top { visibility: hidden; }
  body.phoneUi .space-top { right: auto; width: min(300px, 36%); }
  body.phoneUi .hail, body.phoneUi .coach, body.phoneUi .radio-toast { left: auto; right: 10px; width: min(400px, 46%); }
  body.phoneUi .toasts { left: auto; right: 10px; width: min(360px, 42%); }
  body.phoneUi .notice-tray, body.phoneUi .haul-tray { left: auto; width: min(420px, 56%); }
  body.phoneUi .minimap { top: 6px; }
}
