/* Phone layer, tools templates. Everything inside @media (max-width: 767px). See docs/processes/mobile-layer.md */

/* ── /weapons: loadout rows, short gun cards two across, flat fact lists ── */
@media (max-width: 767px) {
  body .wl-head-in { padding-top: 1.2rem; padding-bottom: 1.2rem; }
  body .wl-plate { margin-top: 0.8rem; }
  body .wl-loadout { padding-top: 1.5rem; }
  body .wl-label { gap: 0.6rem; margin-bottom: 0.7rem; }
  body .wl-label span { min-width: 1.9rem; height: 1.9rem; font-size: 0.9rem; }
  body .wl-label h2 { font-size: 1.45rem; }
  body .wl-lede { margin-bottom: 0.9rem; font-size: 0.875rem; line-height: 1.5; }
  body .wl-db, body .wl-intel { padding-top: 1.75rem; }

  /* loadout: one row per hook (picture left, gun and why right, Change on the title line) */
  body .wl-wall { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px; border-radius: 14px; }
  body .wl-hook { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; column-gap: 0.7rem; row-gap: 0.12rem; align-items: center; min-height: 0; padding: 0.6rem 0.7rem; }
  body .wl-hook::before, body .wl-hook .wl-hook-n { display: none; }
  body .wl-hook-img { grid-column: 1; grid-row: 1 / span 4; align-self: start; margin: 0; }
  body .wl-hook-k { grid-column: 2; font-size: 0.6875rem; letter-spacing: 0.12em; }
  body .wl-hook-v { grid-column: 2; font-size: 1.15rem; }
  body .wl-hook-why { grid-column: 2 / -1; font-size: 0.8rem; line-height: 1.3; }
  body .wl-hook-spec { grid-column: 2 / -1; font-size: 0.6875rem; line-height: 1.35; }
  body .wl-hook-change { grid-column: 3; grid-row: 1 / span 2; align-self: center; margin: 0; padding: 0.7rem 0.6rem 0.6rem; font-size: 0.8rem; }
  body .wl-hook:active { transform: scale(0.985); }

  /* price tags: two across, the price beside the name */
  body .wl-tags { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
  body .wl-tags > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  body .wl-tag { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0.3rem; padding: 0.55rem 0.6rem 0.5rem 1.45rem; clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%); }
  body .wl-tag::before { left: 9px; width: 6px; height: 6px; margin-top: -3px; }
  body .wl-tag-ico { display: none; }
  body .wl-tag-k { font-size: 1rem; }
  body .wl-tag-note { font-size: 0.6875rem; line-height: 1.25; }
  body .wl-tag-v { padding-left: 0; border-left: 0; font-size: 1.15rem; }

  /* display case */
  body .wdb-case-glass:has(.wdb-case-gun) { padding: 0.6rem; }
  body .wdb-case-spec { gap: 0.6rem; padding: 0.85rem 0.9rem 0.9rem; }
  body .wdb-case-name { font-size: 1.75rem; }
  body .wdb-leaders { gap: 0.2rem; }
  body .wdb-leaders dt { font-size: 0.6875rem !important; letter-spacing: 0.1em; }
  body .wdb-leaders dd { font-size: 0.875rem; }
  body .wdb-bars--big { gap: 0.3rem; }
  body .wdb-bars--big .wdb-bar dt { font-size: 0.6875rem !important; letter-spacing: 0.08em; }
  body .wdb-bars--big .wdb-seg i { height: 7px; }

  /* search, sort, class tabs: everything wraps, nothing scrolls sideways */
  body .wdb-controls { gap: 0.45rem; padding: 0.6rem 0.6rem 0.5rem; }
  body .wdb-tools { gap: 0.4rem; }
  body .wdb-search { min-height: 44px; padding-left: 0.8rem; }
  body .wdb-sort { flex-wrap: wrap; overflow: visible; padding: 3px; }
  body .wdb-sort::before { padding: 0 0.4rem; font-size: 0.6875rem; letter-spacing: 0.08em; }
  body .wdb-sort button { flex: 1 1 auto; min-height: 40px; padding: 0 0.55rem; font-size: 0.8rem; }
  body .wdb-groups--full { flex-wrap: wrap; overflow: visible; gap: 4px; }
  body .wdb-groups--full .wdb-chip { flex: 1 1 auto; min-height: 40px; padding: 0.5rem 0.65rem 0.42rem; gap: 0.35rem; font-size: 0.95rem; border-radius: 8px; }
  body .wdb-groups--full .wdb-chip span { font-size: 0.6875rem; padding: 0.1rem 0.35rem; }
  body .wdb-chip:active, body .wdb-sort button:active, body .wdb-card:active { transform: scale(0.97); }

  /* gun cards: short, two across; the four stats as numbers (the bars stay in the display case) */
  body .wdb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; }
  body .wdb-grid > li:last-child:nth-child(odd), body .wdb-grid > .wdb-empty { grid-column: 1 / -1; }
  body .wdb-card { gap: 0.22rem; padding: 0.5rem 0.55rem; border-radius: 10px; background: linear-gradient(180deg, #202128, #16171c); }
  body .wdb-card-top { flex-wrap: wrap; padding-left: 0; gap: 0.2rem 0.3rem; }
  body .wdb-tag { font-size: 0.6875rem; letter-spacing: 0.04em; }
  body .wdb-pricetag { flex: none; margin-left: auto; padding: 0.24rem 0.4rem 0.16rem 0.9rem; font-size: 0.82rem; }
  body .wdb-card-img { margin-top: 0.1rem; }
  body .wdb-card-img img, body .wdb-card-img--empty { aspect-ratio: 2 / 1; object-fit: cover; }
  body .wdb-card-img--empty span { font-size: 0.6875rem; letter-spacing: 0.08em; }
  body .wdb-card-name { margin-top: 0.15rem; padding-left: 0; font-size: 1.05rem; }
  body .wdb-card-cls { padding-left: 0; font-size: 0.6875rem; line-height: 1.3; }
  body .wdb-card .wdb-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.1rem 0.6rem; margin-top: 0.15rem; padding: 0; }
  body .wdb-card .wdb-bar { grid-template-columns: auto 1fr; gap: 0.3rem; }
  body .wdb-card .wdb-seg { display: none; }
  body .wdb-card .wdb-bar dt { font-size: 0.6875rem !important; letter-spacing: 0.06em; }
  body .wdb-card .wdb-num { width: auto; margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
  body .wdb-card .wdb-nostats { padding-left: 0; font-size: 0.6875rem; }
  body .wdb-card-shop { padding: 0.3rem 0 0; font-size: 0.6875rem; letter-spacing: 0; line-height: 1.3; }

  body .wl-rules { margin-top: 0.8rem; padding: 0.8rem 0.9rem; }
  body .wl-rules-k { margin-bottom: 0.5rem; font-size: 0.6875rem; }
  body .wl-rules li p { font-size: 0.875rem; line-height: 1.45; }

  /* class cards: small picture beside the class name, records as one-line tiles */
  body .wl-classes { gap: 8px; margin-top: 0.6rem; }
  body .wl-class { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 0.7rem; row-gap: 0.5rem; align-content: start; padding: 0.7rem 0.8rem 0.75rem; border-radius: 14px; }
  body .wl-class > * { grid-column: 1 / -1; }
  body .wl-class:has(.wl-class-pic) { grid-template-columns: 104px minmax(0, 1fr); }
  body .wl-class > .wl-class-pic { grid-column: 1; grid-row: 1 / span 2; align-self: start; margin: 0; overflow: visible; background: none; box-shadow: none; }
  body .wl-class-pic img { height: 58px; border-radius: 8px; }
  body .wl-class-pic figcaption { position: static; padding: 0.25rem 0 0; font-size: 0.6875rem; line-height: 1.15; letter-spacing: 0.04em; color: var(--text-secondary); background: none; }
  body .wl-class:has(.wl-class-pic) > .wl-class-k { grid-column: 2; align-self: end; justify-self: start; }
  body .wl-class:has(.wl-class-pic) > .wl-class-h { grid-column: 2; align-self: start; }
  body .wl-class-h { font-size: 0.75rem; line-height: 1.3; }
  body .wl-class-best { gap: 4px; margin: 0; }
  body .wl-class-best > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.4rem; align-items: baseline; padding: 0.4rem 0.5rem; border-radius: 8px; }
  body .wl-class-best dt { grid-column: 1 / -1; font-size: 0.6875rem !important; letter-spacing: 0.04em; }
  body .wl-class-best dd { display: contents; }
  body .wl-class-best b { font-size: 1.3rem; }
  body .wl-class-best span { margin: 0; font-size: 0.72rem; line-height: 1.2; }
  body .wl-class-a { font-size: 0.875rem; line-height: 1.45; }
  body .wl-class-more { padding-top: 0.45rem; }
  body .wl-class-more summary { min-height: 32px; display: flex; align-items: center; }
  body .wl-class-go { padding-top: 0; }

  /* "Before the job": tighter rows, the facts as a flat list instead of boxed tiles */
  body .wl-rows { gap: 8px; margin-top: 0.6rem; }
  body .wl-row { padding: 0.85rem 0.9rem; border-radius: 14px; }
  body .wl-row-head { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.5rem; align-items: baseline; }
  body .wl-row-n { font-size: 0.9rem; }
  body .wl-row-h { margin: 0; font-size: 1.15rem; }
  /* !important: a global article-lede rule (article > header > p, !important) reaches this paragraph */
  body .wl-row .wl-row-head > p.wl-row-lead { grid-column: 1 / -1; margin-top: 0.45rem; font-size: 0.9rem !important; line-height: 1.45 !important; }
  body .wl-row .wl-row-head > p.wl-row-lead span { font-size: 0.875rem; }
  body .wl-bento { gap: 0; margin-top: 0.7rem; }
  body .wl-bento .wl-row-pic { aspect-ratio: 2 / 1; margin-bottom: 0.2rem; border-radius: 10px; }
  body .wl-row-pic span { padding: 1.2rem 0.6rem 0.45rem; font-size: 0.6875rem; }
  body .wl-bento .wl-fact { gap: 0.2rem; padding: 0.5rem 0; border-radius: 0; background: none; box-shadow: none; border-top: 1px solid rgba(255, 255, 255, 0.07); }
  body .wl-bento .wl-fact:first-child { border-top: 0; }
  body .wl-bento .wl-fact b { font-size: 0.6875rem; letter-spacing: 0.08em; }
  body .wl-bento .wl-fact p { font-size: 0.875rem; line-height: 1.45; }
  body .wl-row .wl-pills { gap: 0.35rem; margin-top: 0.6rem; }
  body .wl-pills a { min-height: 40px; padding: 0.3rem 0.8rem; }
  body .wl-row-extra { margin-top: 0.9rem; }
}

/* ── /robberies/safe-codes: each code is a compact row (small picture, place, code, then where/inside) ── */
@media (max-width: 767px) {
  body .sc { margin-top: 0.8rem; }
  body .sc-panel { gap: 0.5rem; padding: 0.6rem; }
  body .sc-tools { gap: 0.4rem; }
  body .sc-search { flex: 1 1 100%; height: 2.6rem; }
  body .sc-switch { flex: 1 1 auto; height: 2.5rem; padding: 0 0.7rem; font-size: 0.8rem; }
  body .sc-seg { flex: 1 1 100%; height: 2.6rem; }
  body .sc-seg-k { font-size: 0.6875rem; letter-spacing: 0.08em; }
  body .sc-seg button { flex: 1 1 auto; padding: 0 0.4rem; font-size: 0.78rem; white-space: nowrap; }
  body .sc-tabs.mb-tabs { margin: 0; }
  /* type pills: the whole label on two lines, never cut with dots */
  body .sc-tabs .mb-tab-label { white-space: normal; overflow: visible; font-size: 0.6rem; line-height: 1.15; text-align: left; }
  /* the tool comes first on a phone: the question list above it only pushed it a screen down */
  body .guide-main:has(.sc) > nav[aria-label='On this page'] { display: none; }
  body .sc-count { margin: 0.6rem 0 0.3rem; font-size: 0.8rem; }
  body .sc-cat + .sc-cat { margin-top: 1.2rem; }
  body .sc-cat-t { margin-bottom: 0.5rem; font-size: 1.35rem; }
  body .sc-list { gap: 6px; }
  body .sc-row { grid-template-columns: 100px minmax(0, 1fr); grid-template-areas: 'pic place' 'pic code' 'info info' 'status status'; align-items: start; gap: 0.4rem 0.65rem; padding: 0.55rem 0.6rem; border-radius: 12px; }
  body .sc-row:has(.sc-pic--none) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'place code' 'info info' 'status status'; align-items: center; }
  body .sc-row:has(.sc-pic--none):has(.sc-code--text) { grid-template-areas: 'place place' 'code code' 'info info' 'status status'; }
  body .sc-code { gap: 3px; }
  body .sc-pic { align-self: stretch; aspect-ratio: auto; min-height: 60px; border-radius: 8px; }
  body .sc-name { font-size: 0.95rem; line-height: 1.15; }
  body .sc-area { margin-top: 0.1rem; font-size: 0.72rem; }
  body .sc-mission { margin-top: 0.15rem; font-size: 0.6875rem; line-height: 1.25; letter-spacing: 0; }
    body .sc-code span { width: 1.45rem; height: 2rem; border-radius: 5px; font-size: 1.35rem; }
  body .sc-code--text b { max-width: none; padding: 0.35rem 0.5rem; font-size: 1rem; text-align: center; }
  body .sc-info { gap: 0.2rem; }
  body .sc-info > div { grid-template-columns: 3.3rem minmax(0, 1fr); gap: 0.4rem; }
  body .sc-info dt { font-size: 0.6875rem !important; letter-spacing: 0.06em; }
  body .sc-info dd { font-size: 0.84rem; line-height: 1.35; }
  body .sc-status { gap: 0.25rem 0.5rem; padding-top: 0.4rem; }
  body .sc-badge { padding: 0.18rem 0.5rem; font-size: 0.6875rem; }
  body .sc-status-note { flex: 1 1 8rem; font-size: 0.6875rem; }
  body .sc-guide { font-size: 0.72rem; }
  body .sc-row:has(.sc-row-link):active { transform: scale(0.985); border-color: var(--accent-pink); }
}

/* ── /robberies/fences: shorter dossier rows (photo band, tight facts, the map as a thin strip) ── */
@media (max-width: 767px) {
  body .fr { margin: 1rem 0 1.5rem; }
  body .fr-lede { margin: 0.4rem 0 0.8rem; font-size: 0.875rem; line-height: 1.5; }
  body .fr-grid { gap: 8px; }
  body .fr-card { border-radius: 14px; }
  body .fr-photo { height: 112px; }
  body .fr-no { right: 0.7rem; top: 0.5rem; font-size: 2rem; -webkit-text-stroke-width: 1px; }
  body .fr-best { left: 0.7rem; top: 0.6rem; padding: 0.22rem 0.55rem 0.16rem; font-size: 0.6875rem; letter-spacing: 0.06em; }
  body .fr-id { left: 0.8rem; right: 0.8rem; bottom: 0.45rem; }
  body .fr-name { font-size: 1.6rem; }
  body .fr-who { margin-top: 0.15rem; font-size: 0.78rem; line-height: 1.3; }
  body .fr-body { gap: 0.6rem; padding: 0.6rem 0.8rem 0.75rem; }
  body .fr-col { gap: 0.55rem; }
  body .fr-facts { gap: 0.25rem; }
  body .fr-facts dt, body .fr-paid-k { font-size: 0.6875rem !important; letter-spacing: 0.1em; }
  body .fr-facts dd { max-width: 74%; font-size: 0.82rem; line-height: 1.3; }
  body .fr-rates { gap: 0.25rem; }
  body .fr-rates li { grid-template-columns: 5.6rem 1fr 4.4rem; gap: 0.5rem; }
  body .fr-rate i { height: 6px; }
  body .fr-rate-t { font-size: 0.9rem; }
  body .fr-paid { gap: 0.3rem; }
  body .fr-prices { gap: 0.3rem; }
  body .fr-prices span { font-size: 0.85rem; padding: 0.26rem 0.5rem 0.2rem 1rem; }
  body .fr-takes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  body .fr-takes li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  body .fr-takes li { gap: 0.45rem; padding: 0.4rem 0.45rem; border-radius: 10px; }
  body .fr-takes svg { width: 16px; height: 16px; padding: 0.3rem; border-radius: 7px; }
  body .fr-takes b { font-size: 0.78rem; line-height: 1.2; }
  body .fr-takes small { font-size: 0.6875rem !important; line-height: 1.25; }
  body .fr-foot { gap: 0.4rem; padding: 0.5rem 0.7rem; font-size: 0.8rem; }
  body .fr-foot a { min-height: 34px; }
  body .fr-map { min-height: 58px; }
  body .fr-map-label { left: 0.8rem; right: 40%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; }
  body .fr-map-label small { flex: 1 1 100%; font-size: 0.6875rem !important; letter-spacing: 0.1em; }
  body .fr-map-label b { font-size: 1.1rem; }
  body .fr-map-label em { margin: 0; font-size: 0.6875rem; }
  body .fr-map-canvas i.area { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  body .fr-map:active { filter: brightness(1.25); }
  /* what each kind of fence buys: short tiles, the tag above the name without overlap */
  body .fg { gap: 6px; margin-top: 1rem; }
  body .fg-tile, body .fg-tile:last-child { aspect-ratio: auto; min-height: 104px; border-radius: 12px; }
  body .fg-to { left: 0.5rem; top: 0.5rem; padding: 0.2rem 0.5rem 0.14rem; font-size: 0.6875rem; letter-spacing: 0.04em; }
  body .fg-id { left: 0.6rem; right: 0.6rem; bottom: 0.5rem; }
  body .fg-kind { font-size: 1.2rem; }
  body .fg-best { margin-top: 0.1rem; font-size: 0.72rem; line-height: 1.25; }
  /* best fence by chapter: one card per kind of goods, the three chapters across (labels repeat the hidden header row) */
  body .fm-wrap { margin: 0.8rem 0 1.2rem; overflow: visible; border: 0; background: none; }
  body .fm { display: block; min-width: 0; }
  body .fm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body .fm tbody { display: grid; gap: 6px; }
  body .fm tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-elevated); }
  body .fm tbody th { grid-column: 1 / -1; width: auto; padding: 0.5rem 0.65rem 0.25rem; border: 0; font-size: 1.1rem !important; }
  body .fm tbody td { display: block; min-width: 0; padding: 0.35rem 0.5rem 0.55rem 0.65rem; border: 0; }
  body .fm td::before { display: block; margin-bottom: 0.15rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
  body .fm td:nth-child(2)::before { content: 'Chapter 1'; }
  body .fm td:nth-child(3)::before { content: 'Chapter 2'; }
  body .fm td:nth-child(4)::before { content: 'Chapter 3+'; }
  body .fm td strong { font-size: 0.88rem; line-height: 1.2; }
  body .fm-rate { margin-top: 0.2rem; padding: 0.08rem 0.4rem; font-size: 0.6875rem; }
  body .fm-note { margin-top: 0.15rem; font-size: 0.6875rem; line-height: 1.25; }
}

/* ── /map: the place tables become cards (name + area, type, money, guide links); no sideways scroll ── */
@media (max-width: 767px) {
  body .map-head { padding: 1.2rem 0 0.8rem; }
  body .map-head-intro { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.5; }
  body main section[id^='layer-'], body main section#areas { padding-top: 1.75rem; padding-bottom: 1.75rem; }
  body main section[id^='layer-'] > p.prose-measure, body main section#areas > p.prose-measure { margin-bottom: 0.8rem; font-size: 0.875rem; line-height: 1.5; }
  /* "Show on the map": the small light pill, top right of the heading */
  body main section[id^='layer-'] .run-head { position: relative; display: block; }
  body main section[id^='layer-'] .run-head .run-tag { min-height: 40px; padding-right: 10.6rem; align-items: center; }
  body main section[id^='layer-'] .run-head .run-ghost { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; height: 40px; margin: 0; padding: 0 0.3rem 0 0.75rem; border: 0; border-radius: 999px; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; color: #0b0b12; background: #f5f1ea; box-shadow: none; }
  body main section[id^='layer-'] .run-head .run-ghost::before { display: none; }
  body main section[id^='layer-'] .run-head .run-ghost span { color: #0b0b12; mix-blend-mode: normal; }
  body main section[id^='layer-'] .run-head .run-ghost::after { content: '→'; display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: 0.8rem; color: #f5f1ea; background: #0b0b12; }
  body main section[id^='layer-'] .run-head .run-ghost:active { transform: scale(0.96); }

  body .hm-table-wrap { overflow: visible; }
  body .hm-table, body .hm-table tbody { display: block; }
  body .hm-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body .hm-table tbody { display: grid; gap: 6px; }
  body .hm-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.12rem 0.6rem; padding: 0.55rem 0.7rem; border: 1px solid var(--border-subtle); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
  body .hm-table tbody td, body .hm-table tbody th { display: block; min-width: 0; padding: 0; border: 0; }
  body .hm-table tr:not(:has(> th)) td:nth-child(1) { font-size: 0.95rem; font-weight: 700; line-height: 1.25; }
  body .hm-table tr:not(:has(> th)) td:nth-child(2) { font-size: 0.75rem; text-align: right; color: var(--text-muted); }
  body .hm-table tr:not(:has(> th)) td:nth-child(3) { grid-column: 1 / -1; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
  body .hm-table tr:not(:has(> th)) td:nth-child(4) { grid-column: 1 / -1; font-size: 0.8125rem; line-height: 1.4; color: var(--text-secondary); }
  body .hm-table tr:not(:has(> th)) td:nth-child(5) { grid-column: 1 / -1; font-size: 0.8rem; line-height: 1.9; }
  body .hm-table td:empty { display: none; }
  /* areas: the name, then its six counts across (labels repeat the hidden header row) */
  body .hm-table tr:has(> th) { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.3rem 0.2rem; }
  body .hm-table tbody th { grid-column: 1 / -1; font-family: var(--font-display); font-size: 1.1rem !important; letter-spacing: 0.02em; color: var(--text-primary); }
  body .hm-table tr:has(> th) td { font-size: 0.95rem; font-weight: 700; text-align: center; }
  body .hm-table tr:has(> th) td::before { display: block; font-size: 0.6875rem; font-weight: 500; color: var(--text-muted); }
  body .hm-table tr:has(> th) td:nth-child(2)::before { content: 'Banks'; }
  body .hm-table tr:has(> th) td:nth-child(3)::before { content: 'Stores'; }
  body .hm-table tr:has(> th) td:nth-child(4)::before { content: 'Illegal'; }
  body .hm-table tr:has(> th) td:nth-child(5)::before { content: 'Fences'; }
  body .hm-table tr:has(> th) td:nth-child(6)::before { content: 'Heists'; }
  body .hm-table tr:has(> th) td:nth-child(7)::before { content: 'Loot'; }
}

/* ── /pre-order and /editions: the extras as rows, the compare table fits the screen ── */
@media (max-width: 767px) {
  body main:has(.store-hero) .ed-walk { gap: 0; }
  body main:has(.store-hero) .ed-walk-item, body main:has(.store-hero) .ed-walk-item:nth-child(even) { grid-template-columns: 104px minmax(0, 1fr); gap: 0.75rem; align-items: start; padding: 0.7rem 0; border-top: 1px solid var(--border-subtle); }
  body main:has(.store-hero) .ed-walk-media { aspect-ratio: 1; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border-subtle); }
  body main:has(.store-hero) .ed-walk-text { gap: 0.3rem; }
  body main:has(.store-hero) .ed-walk-kicker { gap: 0.4rem; font-size: 0.6875rem; letter-spacing: 0.1em; }
  body main:has(.store-hero) .ed-walk-num { font-size: 0.75rem; }
  body main:has(.store-hero) .ed-walk-name { font-size: 1.15rem; }
  body main:has(.store-hero) .ed-walk-quote { padding-left: 0; border: 0; }
  body main:has(.store-hero) .ed-walk-quote p { font-size: 0.84rem; line-height: 1.45; }
  body main:has(.store-hero) .ed-walk-quote cite { margin-top: 0.2rem; font-size: 0.6875rem; letter-spacing: 0.06em; }
  body main:has(.store-hero) .ed-walk-link { min-height: 32px; font-size: 0.8rem; }
  body .ed-group { margin-top: 1.4rem; }
  body .ed-group-title { margin-bottom: 0.4rem; padding-top: 1rem; font-size: 1.4rem; }
  body .ed-break { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 1rem; }
  body .ed-card { padding: 14px; border-radius: 14px; }
  body .ed-card-head { padding-bottom: 10px; }
  body .ed-card-name { font-size: 22px; }
  body .ed-card-price { font-size: 28px; }
  body .ed-layers { gap: 6px; margin: 10px 0 12px; }
  body .ed-layer { gap: 10px; padding: 10px; }
  body .ed-layer--stack { gap: 8px; }
  body .ed-layer-title--small { font-size: 0.6875rem; letter-spacing: 0.1em; }
  body .ed-thumb-name { padding: 14px 5px 4px; }
  /* compare table: three columns that fit, values wrap */
  body .store-table-wrap { overflow-x: visible; }
  body .store-table { table-layout: fixed; font-size: 0.8rem; }
  body .store-table th, body .store-table td { padding: 0.5rem 0.45rem; overflow-wrap: anywhere; }
  body .store-table thead th:first-child { width: 42%; }
  body .store-table thead th:not(:first-child), body .store-table td { width: auto; }
  body .store-table-val { font-size: 0.9rem; white-space: normal; }
  body .store-table-cat { font-size: 0.6875rem; letter-spacing: 0.06em; }
  /* bonus items: picture left, text right */
  body .store-items { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  body .store-item { flex-direction: row; align-items: stretch; border-radius: 12px; }
  body .store-item-frame { flex: 0 0 108px; aspect-ratio: auto; min-height: 92px; }
  body .store-item-glyph { font-size: 2.4rem; }
  body .store-item-cat { left: 0.35rem; top: 0.35rem; padding: 0.12rem 0.4rem; font-size: 0.6875rem; letter-spacing: 0.04em; }
  body .store-item-body { gap: 0.25rem; padding: 0.55rem 0.7rem; min-width: 0; }
  body .store-item-name { font-size: 1rem; }
  body .store-item-quote { font-size: 0.8rem; line-height: 1.4; }
  body .store-item-flag { font-size: 0.6875rem; letter-spacing: 0.04em; }
}

/* ── /news: shorter archive cards, creators two across ── */
@media (max-width: 767px) {
  body .newsx-grid { gap: 6px; }
  body .newsx-grid .newsx-card { aspect-ratio: auto; min-height: 132px; }
  body .newsx-grid .newsx-card-body { padding: 0.7rem 0.8rem 0.75rem; }
  body .newsx-grid .newsx-card-title { margin-top: 0.3rem; font-size: 1.15rem; line-height: 1; }
  body .newsx-grid .newsx-card .news-with { margin-top: 0.4rem; }
  body .newsx-card:active { transform: scale(0.985); }
  body .newsx-creators { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  body .newsx-creators > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  body .newsx-creator { gap: 0.55rem; padding: 0.55rem 0.6rem; min-width: 0; }
  body .newsx-creator-avatar, body .newsx-creator-plus { width: 38px; height: 38px; }
  body .newsx-creator-name { font-size: 1rem; overflow-wrap: anywhere; }
  body .newsx-creator-meta { font-size: 0.6875rem; letter-spacing: 0.02em; font-variation-settings: normal; }
}

/* ── news article: tables fit the screen (cells wrap) instead of scrolling sideways ── */
@media (max-width: 767px) {
  body .prose-article table { display: table; width: 100%; table-layout: auto; overflow: visible; font-size: 0.8125rem; line-height: 1.4; }
  body .prose-article th, body .prose-article td { min-width: 0 !important; padding: 0.5rem 0.55rem; white-space: normal; overflow-wrap: break-word; }
  body .prose-article th { font-size: 0.6875rem; letter-spacing: 0.04em; }
}

/* ── /heist-planner: tighter job rows (nothing clipped), checklist and link cards ── */
@media (max-width: 767px) {
  body .jb { gap: 1.75rem; }
  body .jb-ladder { gap: 2px; }
  body .jb-rung { grid-template-columns: 52px minmax(0, 1fr) auto; column-gap: 0.6rem; row-gap: 5px; padding: 7px 10px; }
  body .jb-rung-thumb { width: 52px; height: 34px; }
  body .jb-rung-name strong { font-size: 0.92rem; line-height: 1.15; }
  body .jb-rung-name span { font-size: 0.6875rem; line-height: 1.25; white-space: normal; overflow: visible; }
  body .jb-rung-track { height: 6px; }
  body .jb-rung-take { font-size: 0.88rem; }
  body .jb-rung:active { background: rgba(255, 255, 255, 0.06); }
  body .jb-note { font-size: 0.75rem; line-height: 1.4; }
  body .jb-prep-head { gap: 8px 10px; margin-bottom: 10px; }
  body .jb-phases { gap: 14px; }
  body .jb-check { gap: 10px; padding: 9px 0; }
  body .jb-check span span { font-size: 0.8rem; line-height: 1.35; }
  body .jb-check em { font-size: 0.6875rem; }
  body main:has(.jb) .db-crosslinks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  body main:has(.jb) .db-crosslinks > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  body main:has(.jb) .db-crosslink { min-width: 0; padding: 0.65rem 0.7rem; }
  body main:has(.jb) .db-crosslink-title { font-size: 1.1rem; }
  body main:has(.jb) .db-crosslink-note { font-size: 0.6875rem; letter-spacing: 0.02em; line-height: 1.25; }
  body main:has(.jb) .db-crosslink-arrow { display: none; }
}

/* ── labels under 11 px on these pages ── */
@media (max-width: 767px) {
  body .news-meta, body .news-meta span, body .news-meta time, body .news-feature-badge, body .article-eyebrow, body .article-crumbs-current,
  body .store-hero-updated, body .store-hero-updated time, body .store-chips li, body .store-hero-countdown-label, body .ed-card-flag, body .store-country-label,
  body .store-retailer-kind, body .store-retailer-meta, body .store-retailer-go, body .po-tl-label { font-size: 0.6875rem; }
  body .store-retailer-kind { letter-spacing: 0.06em; }
  body .store-country-btn { min-height: 36px; padding-inline: 0.7rem; font-size: 0.6875rem; }
  body .store-country-btn:active, body .store-retailer:active { transform: scale(0.96); }
}
