/* Phone layer, missions templates. Everything inside @media (max-width: 767px). See docs/processes/mobile-layer.md */
@media (max-width: 767px) {
  /* ── /missions hub: chapter bar stays under the header, one thumb tap to any chapter ── */
  body #story-missions { padding-top: 0.5rem; }
  body .ms-chapnav {
    position: sticky; top: 56px; z-index: 20; display: flex; flex-wrap: nowrap; gap: 2px;
    margin: 0 -1rem 0.9rem; padding: 4px;
    background: color-mix(in srgb, #07070e 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  body .ms-chapnav a {
    flex: 1 1 auto; display: grid; place-items: center; min-height: 40px; padding: 0 0.15rem; border: 0; border-radius: 9px;
    font-family: var(--font-display); font-size: 0.78rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; white-space: nowrap;
    color: #fff; background: rgba(255, 255, 255, 0.06); -webkit-tap-highlight-color: transparent;
  }
  body .ms-chapnav a:active { background: var(--accent-pink); color: #07070e; }
  body .ms-chapter { scroll-margin-top: 116px; }
  body .ms-chapter + .ms-chapter { margin-top: 1.6rem; }
  body .ms-chapter-head { gap: 0.15rem; margin-bottom: 0.5rem; padding-bottom: 0.5rem; }
  body .ms-chapter-k { font-size: 0.6875rem !important; letter-spacing: 0.12em; }
  body .ms-chapter-h { font-size: 1.7rem; line-height: 0.95; }

  /* ── mission rows: picture left with its number on it, title and two lines right ── */
  body .ms-grid { gap: 0; }
  body .ms-grid .heist-row { grid-template-columns: 92px minmax(0, 1fr); grid-template-areas: 'thumb body'; align-items: center; column-gap: 0.7rem; row-gap: 0; padding: 0.5rem 0; min-height: 76px; -webkit-tap-highlight-color: transparent; }
  body .ms-grid .heist-row:first-child { border-top: 0; }
  body .ms-grid .heist-row:active { background: rgba(255, 255, 255, 0.06); }
  body .ms-grid .heist-row-thumb { height: 60px; border-radius: 8px; }
  body .ms-grid .heist-row-index {
    position: absolute; z-index: 1; left: 4px; top: calc(50% - 26px); min-width: 0; padding: 0.12rem 0.32rem; border-radius: 5px;
    font-size: 0.8rem; line-height: 1; color: #fff; background: rgba(7, 7, 14, 0.82);
  }
  body .ms-grid .heist-row-tag { margin-bottom: 0.1rem; font-size: 0.6875rem; letter-spacing: 0.08em; line-height: 1.2; }
  body .ms-grid .heist-row-title { font-size: 1.12rem; line-height: 1; }
  body .ms-grid .heist-row-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 0.2rem; font-size: 0.8rem; line-height: 1.3; }

  /* ── walkthrough: the brief, then facts as label / value lines (was a 2 x 5 grid of tall cells) ── */
  body .mw-glance { margin-top: 1rem; }
  body .mw-brief { padding: 0.75rem 0.9rem; gap: 0.25rem; }
  body .mw-brief blockquote { font-size: 0.95rem; line-height: 1.4; }
  body .mw-facts { grid-template-columns: minmax(0, 1fr); }
  body .mw-facts > div { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); align-items: baseline; gap: 0.7rem; padding: 0.5rem 0.9rem; }
  body .mw-facts dt { letter-spacing: 0.08em; line-height: 1.3; }
  body .mw-facts dd { margin: 0; font-size: 0.9rem; line-height: 1.3; }
  body .mw-facts dd a { display: inline-block; padding: 0.35rem 0; margin: -0.35rem 0; }

  /* ── steps: full-width cards, picture on top, no rail eating the left 48 px ── */
  body main section[aria-labelledby='steps-heading'] { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  body main section[aria-labelledby='steps-heading'] > p { margin-bottom: 0.9rem; }
  body .mw-steps { gap: 10px; }
  body .mw-steps::before, body .mw-num { display: none; }
  body .mw-step { padding-left: 0; scroll-margin-top: 4.5rem; }
  body .mw-card { gap: 0; padding: 0; overflow: hidden; }
  body .mw-body { padding: 0.75rem 0.9rem 0.9rem; }
  body .mw-shot { order: -1; border-radius: 0; box-shadow: none; }
  body .mw-eyebrow { font-size: 0.6875rem; color: var(--accent-pink); }
  body .mw-title { margin-top: 0.1rem; font-size: 1.25rem; line-height: 1.1; }
  body .mw-text { margin-top: 0.35rem; font-size: 0.9rem; line-height: 1.5; }
  body .mw-controls { margin-top: 0.6rem; padding: 0.45rem 0.65rem; }

  /* ── tips / not seen yet ── */
  body main section.py-10:has(> div > .run-head) { padding-top: 1.5rem; padding-bottom: 1.5rem; gap: 1.4rem; }
  body main section.py-10:has(> div > .run-head) ul { gap: 0.4rem; font-size: 0.9rem; line-height: 1.45; }

  /* ── previous / next: previous is a slim row, next a short picture card ── */
  body .mw-pn { gap: 8px; padding: 1.25rem 0; }
  body .mw-pn-card { min-height: 64px; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
  body .mw-pn-card:active { transform: scale(0.985); }
  body .mw-pn-body { gap: 0.2rem; padding: 0.7rem 0.9rem; min-width: 0; }
  body .mw-pn-tag { font-size: 0.6875rem; letter-spacing: 0.1em; }
  body .mw-pn-title { font-size: 1.25rem; }
  body .mw-pn-card--next { min-height: 150px; }
  body .mw-pn-card--next .mw-pn-title { font-size: 1.7rem; }
  body .mw-pn-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 0.85rem; line-height: 1.4; }
  body .mw-pn-cta { margin-top: 0.3rem; padding: 0 0.9rem; min-height: 40px; display: inline-flex; align-items: center; font-size: 0.72rem; }

  /* ── tail: FAQ block, verified line, back link ── */
  body main > div > .py-10:has(.run-faq), body main > div > nav.py-8 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  body main > div > section.py-8[aria-label='Verified in game'] { padding-top: 1.1rem; padding-bottom: 0.6rem; }
  body main > div > p.pb-8:last-child { padding-bottom: 1.25rem; }
  body main > div > p.pb-8:last-child a { display: inline-flex; align-items: center; min-height: 40px; }
}
