/* P5-117 STORM TIME ON A DESK (R-1013-28). JD 2026-10-13 8:46 PM, verbatim:
   "it should look more like a desktop view and not a phone view."
   JD 11:35 PM: "Yes, I approve. Build them all and load them all."
   Mockup: outbox/2026-10-14_mock_3-storm.html (designer, synthetic data).
   The five phone tabs become five titled group cards side by side - HOME,
   CONVOY, PROBLEMS, ROLL-OUT, TEAM - at 1180 px and wider, three across from
   900 to 1179 px. The SHOP / STORM switch and EN/ES share one row. Map and
   Due stay as two doors above the columns (the tab bar's other words are
   the columns now). Under 900 px nothing here applies: the phone keeps its
   tabs. Same data, same routes, same hashes; no script, no stored change.
   Named storm-wide.css because web/storm-desk.css is P5-16's operator queue.
   Linked BEFORE desk.css (P5-7 DK-2 keeps desk.css last), so every selector
   here carries one more element (html) than desk.css's, and the few desk.css
   rules that use :has() or ids are beaten with !important.
   No words here (no `content:` text). Glove floors: nothing under 18 px,
   nothing to tap under 44 px. Colours are the storm-look / mockup values. */

@media (min-width: 900px) {

  /* ---- the page: one row of SHOP / STORM + EN/ES, then the rest -------- */
  html body.storm:not(.fleet) .st-phone {
    flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 0 12px;
  }
  html body.storm:not(.fleet) .st-phone > * { flex: 1 1 100%; min-width: 0; order: 2; }
  html body.storm:not(.fleet) .st-phone > .st-modes { order: 0; flex: 0 1 auto; margin-left: auto; }
  html body.storm:not(.fleet) .st-phone > .st-head { order: 1; flex: 0 0 auto; border-bottom: 0; padding: 12px 0; }
  html body.storm:not(.fleet) .st-phone > .st-nav { order: 3; }
  html body.storm:not(.fleet) .st-phone > main#st-main { order: 4; }

  /* SHOP / STORM: one segmented pair, word and state on one line */
  html body.storm:not(.fleet) .st-modes { display: flex; gap: 0; padding: 12px 0; grid-template-columns: none; }
  html body.storm:not(.fleet) .st-mode {
    flex-direction: row; gap: 10px; min-height: 56px; padding: 0 18px; border-radius: 0; white-space: nowrap;
  }
  html body.storm:not(.fleet) .st-mode .s { margin-top: 0; }
  html body.storm:not(.fleet) .st-modes > .st-mode:first-child { border-radius: 12px 0 0 12px; }
  html body.storm:not(.fleet) .st-modes > .st-mode:last-child { border-radius: 0 12px 12px 0; }
  html body.storm:not(.fleet) .st-modes > .st-mode:only-child { border-radius: 12px; }
  html body.storm:not(.fleet) .st-modes > .st-mode + .st-mode { border-left-width: 0; }
  html body.storm:not(.fleet) .st-modes > .st-mode[hidden] + .st-mode { border-left-width: 2px; border-radius: 12px; }

  /* ---- the tab bar: its five column words are the columns now; Map and
     Due (and Ready to roll, when storm-rollout.js shows it) stay as doors */
  html body.storm:not(.fleet) .st-nav {
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
    padding: 8px 0; border-top: 0; border-bottom: 0; grid-template-columns: none;
  }
  html body.storm:not(.fleet) .st-nav a[data-tab="home"],
  html body.storm:not(.fleet) .st-nav a[data-tab="convoy"],
  html body.storm:not(.fleet) .st-nav a[data-tab="probs"],
  html body.storm:not(.fleet) .st-nav a[data-tab="rn"],
  html body.storm:not(.fleet) .st-nav a[data-tab="team"] { display: none; }
  html body.storm:not(.fleet) .st-nav a {
    flex: 0 0 auto; min-width: 140px; min-height: 56px; padding: 0 18px; font-size: 18px;
    letter-spacing: .06em; border: 2px solid #7A8AA0; border-left: 6px solid #0091FF; border-radius: 14px; box-shadow: none;
  }
  html body.storm:not(.fleet) .st-nav a.on { border-color: #0091FF; color: #FFF; }

  /* ---- the work: titled group cards ------------------------------------ */
  html body.storm:not(.fleet) main#st-main {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
    align-items: start; align-content: start; padding: 8px 0 16px;
  }
  html body.storm:not(.fleet) #st-main > * { grid-column: 1 / -1; order: 0; }
  /* the five columns show at once, whatever the hash says (storm.css [hidden] is !important) */
  html body.storm:not(.fleet) #st-main > #st-screen-home,
  html body.storm:not(.fleet) #st-main > #st-screen-convoy,
  html body.storm:not(.fleet) #st-main > #st-screen-probs,
  html body.storm:not(.fleet) #st-main > #st-screen-rn,
  html body.storm:not(.fleet) #st-main > #st-screen-team,
  html body.storm:not(.fleet) #st-main > #st-screen-home[hidden],
  html body.storm:not(.fleet) #st-main > #st-screen-convoy[hidden],
  html body.storm:not(.fleet) #st-main > #st-screen-probs[hidden],
  html body.storm:not(.fleet) #st-main > #st-screen-rn[hidden],
  html body.storm:not(.fleet) #st-main > #st-screen-team[hidden] {
    display: block !important; grid-column: auto !important; grid-row: auto !important;
  }
  html body.storm:not(.fleet) #st-main > .st-screen {
    --oh-c: #0091FF; min-width: 0; margin: 0; box-sizing: border-box;
    background: #10161F; border: 1px solid #1C2634; border-top: 4px solid var(--oh-c); border-radius: 14px; padding: 4px 12px 12px;
  }
  html body.storm:not(.fleet) #st-main > #st-screen-home { order: 1; --oh-c: #FFB020; }
  html body.storm:not(.fleet) #st-main > #st-screen-convoy { order: 2; --oh-c: #19E6FF; }
  html body.storm:not(.fleet) #st-main > #st-screen-probs { order: 3; --oh-c: #FF7070; }
  html body.storm:not(.fleet) #st-main > #st-screen-rn { order: 4; --oh-c: #3DDC84; }
  html body.storm:not(.fleet) #st-main > #st-screen-team { order: 5; --oh-c: #B58AFF; }
  /* Ready to roll and Due open full width above the columns when their door is tapped */
  html body.storm:not(.fleet) #st-main > #st-screen-roll,
  html body.storm:not(.fleet) #st-main > #st-screen-due { order: 0; grid-column: 1 / -1; --oh-c: #7A8AA0; }
  /* the card title: the section's own heading, office style */
  html body.storm:not(.fleet) #st-main > .st-screen > h2:first-child {
    margin: 12px 2px 10px; font: 800 18px/1.2 -apple-system, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: .14em; text-transform: uppercase; color: #A3ACB9;
  }

  /* HOME: the doors one under another */
  html body.storm:not(.fleet) #st-main > #st-screen-home,
  html body.storm:not(.fleet) #st-main > #st-screen-home[hidden] {
    display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; padding-top: 12px;
  }
  html body.storm:not(.fleet) #st-screen-home > * { margin: 0; min-width: 0; }
  html body.storm:not(.fleet) #st-screen-home .st-tile { min-height: 56px; }

  /* CONVOY: the group line, then BEHIND / STOPPED / problem cards, then the
     count line of the rest - the phone's cards, not P5-7's wide table */
  html body.storm:not(.fleet) #st-screen-convoy .dk-convoy { display: none; }
  html body.storm:not(.fleet) #st-screen-convoy #st-behind,
  html body.storm:not(.fleet) #st-screen-convoy #st-stopped,
  html body.storm:not(.fleet) #st-screen-convoy #st-problem,
  html body.storm:not(.fleet) #st-screen-convoy #st-rest { display: block; }
  html body.storm:not(.fleet) #st-screen-convoy #st-rest-grid:not([hidden]) { display: grid; }
  html body.storm:not(.fleet) #st-screen-convoy .st-okgrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  html body.storm:not(.fleet) #st-screen-convoy .st-u .id { min-width: 0; }
  html body.storm:not(.fleet) #st-screen-convoy .st-rest-toggle { min-height: 56px; font-size: 18px; }

  /* PROBLEMS: one column inside its card (P5-7's three-way split was for a full-width tab) */
  html body.storm:not(.fleet) #st-main #st-probs { columns: auto !important; column-count: auto !important; }
  html body.storm:not(.fleet) #st-main #st-probs > h2 { break-before: auto !important; -webkit-column-break-before: auto !important; }

  /* a word too long for the column wraps inside it (inherited; storm.css's
     no-mid-word rules on unit numbers still win where they are set) */
  html body.storm:not(.fleet) #st-main > .st-screen { overflow-wrap: break-word; }
  html body.storm:not(.fleet) #st-main > .st-screen .st-grid2,
  html body.storm:not(.fleet) #st-main > .st-screen .st-facts { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1180px) {
  /* five across: HOME | CONVOY | PROBLEMS | ROLL-OUT | TEAM */
  html body.storm:not(.fleet) main#st-main { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  html body.storm:not(.fleet) #st-main > #st-screen-home,
  html body.storm:not(.fleet) #st-main > #st-screen-convoy,
  html body.storm:not(.fleet) #st-main > #st-screen-probs,
  html body.storm:not(.fleet) #st-main > #st-screen-rn,
  html body.storm:not(.fleet) #st-main > #st-screen-team { min-height: calc(100vh - 360px); }
}
