/* D235 phone screens: station, craft, cargo, outfit, comms, journal, fleet, deck/crew, gear/locker,
   chart and login. The head of every sheet stays pinned with a 44 px ×, tabs and row actions are full
   targets, and checkbox labels are 44 px rows. Every rule sits under the phone query. */
@media (pointer: coarse), (max-width: 879px) {
  .sheet-head { position: sticky; top: -16px; z-index: 3; margin: -16px -16px 10px; padding: 12px 16px 8px; background: rgba(5, 11, 18, 0.98); border-bottom: 1px solid var(--line); }
  .close, .sheet-head .close { display: block; min-width: 44px; min-height: 44px; }
  .sheet button, .sheet [role=tab], .radar-panel button, .railPane button { min-height: 44px; }
  .sheet [role=tab], .sheet .tab, .station-tabs button, .cargo-tabs button { min-width: 44px; }
  input, select, textarea { min-height: 44px; }
  input[type=checkbox], input[type=radio] { min-width: 22px; min-height: 22px; }
  label:has(> input[type=checkbox]), label:has(> input[type=radio]) { display: flex; align-items: center; gap: 8px; min-height: 44px; }

  /* Deck: the tool buttons become one 44 px row that scrolls sideways; the × is pinned top-right. */
  .deck-shell .deck-head { position: relative; padding-right: 52px; }
  .deck-head-actions { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; max-width: 100%; }
  .deck-head-actions::-webkit-scrollbar { display: none; }
  .deck-tool, .deck-open { flex: none; min-height: 44px; min-width: 44px; padding: 4px 9px; font-size: 11px; }
  .deck-head .close { position: absolute; top: 0; right: 0; min-width: 44px; min-height: 44px; }
  .deck-shell button, .deck-shell .deck-head-actions button { min-height: 44px !important; }
  .crew-post-chip { min-width: 44px; }
  .sys { grid-template-columns: 48px 1fr 34px 44px 44px; }
  .sys button { width: 44px; height: 44px; }

  /* Station sites (caves are their own pass). */
  .site-tools .site-btn, .site-x { min-height: 44px; min-width: 44px; }
}

/* Landscape phone: sheets use the full height and scroll; the login form scrolls clear of SOUND. */
@media (max-height: 500px) and (orientation: landscape) {
  .sheet { padding: 6px; }
  .sheet-card, .deck-shell { max-height: calc(100 * var(--vh) - 12px); }
  .login-gate .sheet-card { max-height: calc(100 * var(--vh) - 70px); overflow-y: auto; }
}
