/*
 * The phone layer ("mobile by design", Lorenzo 2026-11-22). Everything here is under 768 px.
 * SEO rule: same URL, same HTML, same text as desktop. Nothing is removed for phones, only laid out for a thumb.
 */
.m-tabs { display: none; }

@media (max-width: 767px) {
  /* ── app chrome: a bottom tab bar in thumb reach ── */
  .m-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, #0b0b12 86%, transparent);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .m-tab {
    display: grid; justify-items: center; gap: 3px; min-height: 48px; padding: 6px 2px 4px; border-radius: 12px;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.55);
    -webkit-tap-highlight-color: transparent; transition: color 160ms, background 160ms, transform 160ms;
  }
  .m-tab:active { transform: scale(0.94); }
  .m-tab[aria-current='page'] { color: #fff; background: color-mix(in srgb, var(--accent-pink) 18%, transparent); }
  .m-tab[aria-current='page'] svg { color: var(--accent-pink); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent-pink) 70%, transparent)); }
  /* room for the bar under the footer and anything fixed at the bottom */
  body:has(.m-tabs) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body:has(.m-tabs) .lang-suggest { bottom: calc(72px + env(safe-area-inset-bottom)); }

  /* ── reading: nothing under 11 px, comfortable lines ── */
  /* uppercase labels: 11 px floor (they were 9 to 10 px) */
  main dt, main .gq-item dt, main .mw-facts dt, main .mw-brief figcaption, main th, main .chip, main .gt-ev, main .gs-cap, main .dz-plate-k, main .dz-credit, main .creator-eyebrow, main .mw-controls-label, main small, main [class*='tileTier'], main [class*='msChap'] { font-size: 0.6875rem !important; }
  main figcaption { font-size: max(0.72rem, 1em); }
  main figcaption { line-height: 1.4; }

  /* ── rhythm: tighter sections, full-bleed feel ── */
  main .run-hero-body { padding-top: 5.5rem; }
  main .run-h1 { font-size: clamp(2rem, 9.5vw, 2.8rem); line-height: 0.98; }
  main .run-hero-intro { font-size: 0.95rem; line-height: 1.5; }
  main .run-h2 { font-size: clamp(1.6rem, 7.5vw, 2.1rem); line-height: 1; }

  /* ── tables become cards: no sideways scrolling to read a row ── */
  .table-wrap:has(.data-table--stack) { border: 0; }
  .data-table--stack:not(.money-types) tr { margin-bottom: 8px; border: 1px solid var(--border-subtle) !important; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
  .data-table--stack:not(.money-types) td:first-child { font-family: var(--font-display); font-size: 1.15rem !important; text-transform: uppercase; line-height: 1.05; }
  .data-table--stack td:empty { display: none; }

  /* ── tap targets ── */
  main .run-ghost, main .gp-ev { min-height: 0; }
  main a.run-ghost { min-height: 44px; }
}
@media (max-width: 639px) { .data-table--stack td.gtab-ev { display: none; } }
@media (max-width: 639px) {
  /* card rows: label left, value right, one line each */
  .data-table--stack:not(.money-types) td[data-label] { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: baseline; gap: 0.7rem; min-width: 0; text-align: left; }
  .data-table--stack:not(.money-types) td[data-label]::before { flex: none; margin: 0; text-align: left; }
  .data-table--stack:not(.money-types) td + td { margin-top: 0.4rem; padding-top: 0.4rem; border-top: 1px dashed rgba(255, 255, 255, 0.07); }
  .data-table--stack:not(.money-types) tr { padding: 0.8rem 0.95rem; }
}

@media (max-width: 767px) {
  /* safety net: a stray wide element can never make the page pan sideways */
  html, body { overflow-x: clip; }
  .jb, .jb * { min-width: 0; }
  .jb-rung-take { white-space: normal; text-align: right; }

  /* ── filters, phone look: picture pills two across, count left, label right, one line ── */
  body .mb-tabs, body .sc-tabs.mb-tabs, body .fr-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0.8rem 0 1.1rem; }
  body .mb-tab, body .sc-tabs .mb-tab, body .fr-chip { min-height: 0; height: 46px; flex-direction: row; justify-content: flex-start; align-items: center; gap: 0.4rem; padding: 0 0.65rem; border-radius: 999px; }
  body .mb-tab::before, body .fr-chip::before { background: linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.05) 100%); }
  body .mb-tab-img, body .fr-chip-img { opacity: 0.95; filter: none; object-position: right center; }
  body .mb-tab::after, body .fr-chip::after { display: none; }
  body .mb-tab-count, body .fr-chip-n { font-size: 1.2rem; line-height: 1; min-width: 1.3em; }
  body .mb-tab-label, body .fr-chip-label { margin-top: 0; font-size: 0.62rem; letter-spacing: 0.02em; line-height: 1.1; white-space: nowrap; text-shadow: 0 1px 6px #000; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  body .mb-tab[aria-pressed='true'], body .fr-chip:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent-pink); }

  /* ── money cards, phone look: two per row (picture on top, title and two lines under) ── */
  body .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  body .mk-grid > li { grid-column: auto; }
  body .mk-grid > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  body .mk-card { border-radius: 14px; height: 100%; }
  body .mk-card-main { flex-direction: column; }
  body .mk-frame { flex: none; aspect-ratio: 16 / 10; min-height: 0; }
  body .mk-status { top: 0.4rem; left: 0.4rem; padding: 0.12rem 0.4rem; font-size: 0.5rem !important; }
  body .mk-frame > :not(.mk-img):not(.mk-status):not(img) { display: none; }
  body .mk-body { justify-content: flex-start; gap: 0.2rem; padding: 0.55rem 0.6rem 0.65rem; min-width: 0; }
  body .mk-kicker { font-size: 0.56rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body .mk-name { font-size: 1rem; line-height: 1.1; }
  body .mk-line { -webkit-line-clamp: 2; font-size: 0.76rem; line-height: 1.35; }
  body .mk-gauges, body .mk-source { display: none; }
}
@media (max-width: 767px) {
  /* "What to read next": no swipe row, a two-column grid of the first six */
  body .nr-grid { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; gap: 6px; }
  body .nr-grid > :nth-child(n+7) { display: none; }
  body .nr-card { aspect-ratio: 16 / 10; }
}
/* phone hero (Lorenzo, 2026-11-22): the title sits on the picture; the intro shows three lines, "Read more" opens the rest */
.run-hero-more { display: none; }
@media (max-width: 767px) {
  body main .run-hero--image .run-hero-media { height: 250px; }
  body main .run-hero--image .run-hero-media::after { background: linear-gradient(to top, #07070e 0%, rgba(7, 7, 14, 0.82) 28%, rgba(7, 7, 14, 0.45) 62%, rgba(7, 7, 14, 0.2) 100%); }
  body main .run-hero--image .run-hero-body { padding-top: 3.6rem; padding-bottom: 1.1rem; }
  body main .run-hero-body > * + * { margin-top: 0.55rem; }
  body main .run-hero .run-h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7); }
  body main .run-hero-intro { font-size: 0.875rem; line-height: 1.5; color: rgba(255, 255, 255, 0.78); }
  .run-hero-introwrap:not(:has(input:checked)) .run-hero-intro { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .run-hero-more { display: inline-flex; align-items: center; min-height: 36px; font-size: 0.8rem; font-weight: 700; color: var(--accent-pink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .run-hero-more-close, .run-hero-introwrap:has(input:checked) .run-hero-more-open { display: none; }
  .run-hero-introwrap:has(input:checked) .run-hero-more-close { display: inline; }
  .run-hero-more:has(input:focus-visible) { outline: 2px solid var(--accent-pink); outline-offset: 2px; border-radius: 4px; }
}
/* ── dense cards on phones: label left, value right, one line each (was label over value, in 2 x 2) ── */
@media (max-width: 639px) {
  body .money-types tbody { gap: 6px; }
  body .money-types tr[data-type] { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0.7rem 0.85rem; border-radius: 12px; }
  body .money-types tr[data-type] td:first-child { font-size: 1.15rem; padding-bottom: 0.35rem; }
  body .money-types tr[data-type] td:first-child img, body .money-types tr[data-type] td:first-child svg { width: 26px; height: 26px; }
  body .money-types td[data-label] { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); align-items: baseline; gap: 0.6rem; padding: 0.32rem 0; border-top: 1px solid rgba(255, 255, 255, 0.07); font-size: 0.84rem; line-height: 1.3; }
  body .money-types td[data-label]::before { margin: 0; font-size: 0.6rem; letter-spacing: 0.08em; line-height: 1.25; }
  body .money-types .mt-val { padding: 0.12rem 0.45rem; font-size: 0.78rem; }

  /* section rhythm: less air between blocks everywhere */
  body main section[class*='py-12'], body main section[class*='py-16'] { padding-top: 1.75rem; padding-bottom: 1.75rem; }
  body main .run-head { margin-bottom: 0.9rem; }
  body main .pt-10 { padding-top: 1.6rem; }
  body main .gq { margin-top: 1rem; }
}
@media (max-width: 639px) {
  body main section[class*='py-12'] { padding-top: 0.6rem; }
  body main .gq-wrap { margin-top: 0.4rem; }
  body main .data-table--stack:not(.money-types) td + td { margin-top: 0.3rem; padding-top: 0.3rem; }
}
@media (max-width: 639px) {
  /* a table with one value column stays a simple list: name left, value right, one line */
  body main .data-table--stack:not(.money-types) tr:has(> td[data-label]:nth-child(2):nth-last-child(2)) { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; margin-bottom: 4px; padding: 0.55rem 0.85rem; }
  body main .data-table--stack:not(.money-types) tr:has(> td[data-label]:nth-child(2):nth-last-child(2)) td { width: auto; margin: 0; padding: 0; border: 0; }
  body main .data-table--stack:not(.money-types) tr:has(> td[data-label]:nth-child(2):nth-last-child(2)) td:first-child { font-size: 0.98rem !important; }
  body main .data-table--stack:not(.money-types) tr:has(> td[data-label]:nth-child(2):nth-last-child(2)) td[data-label] { display: block; flex: none; text-align: right; font-weight: 700; }
  body main .data-table--stack:not(.money-types) tr:has(> td[data-label]:nth-child(2):nth-last-child(2)) td[data-label]::before { display: none; }
}
/* home safe codes on phones: the featured safe and four codes, short cards (name + code), the rest is one tap away */
@media (max-width: 639px) {
  body .hs-pad > li:nth-child(n+5) { display: none; }
  body .hs-hero--small { aspect-ratio: auto; min-height: 118px; }
  body .hs-hero--small .hs-hero-tag, body .hs-hero--small .hs-hero-where { display: none; }
  body .hs-hero--small .hs-hero-body { padding: 0.7rem; gap: 0.35rem; }
  body .hs-wrap > .hs-hero:first-child { min-height: 210px; }
}
/* phones: no item alone at the end of a two-column list: an odd last one takes the full row */
@media (max-width: 767px) {
  body [class*='carouselTabs'] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body [class*='carouselTabs'] > * { min-width: 0; width: 100%; }
  body :is([class*='carouselTabs'], .mb-tabs, .fr-filter, .sc-tabs, .hs-pad, .nr-grid, .ha-grid, [class*='msGrid'], [class*='lineup'], .sr-grid, .hg-nav, .gm-stats, .gm-strip, .wdb-groups) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* lists cut to a visible count: the last visible one counts, so keep visible counts even */
}
@media (max-width: 767px) { body .hg-nav > :last-child:nth-child(odd), body .gm-stats > :last-child:nth-child(odd), body .gm-strip > :last-child:nth-child(odd) { flex: 1 1 100%; } }
@media (max-width: 767px) { body .store-chips > :last-child:nth-child(odd) { flex: 1 1 100%; grid-column: 1 / -1; } }
/* home fences on phones: a contact list. Round picture left, name and what he pays best, three mini meters on one line */
@media (max-width: 639px) {
  body .hf-grid { gap: 6px; margin-bottom: 1.2rem; }
  body .hf-card { position: relative; flex-direction: row; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; border-radius: 16px; box-shadow: none; }
  body .hf-media, body .hf-grid > li:last-child:nth-child(odd) .hf-media { flex: none; width: 58px; height: 58px; aspect-ratio: 1; border-radius: 50%; overflow: visible; }
  body .hf-media::after { display: none; }
  body .hf-img { border-radius: 50%; filter: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-pink) 60%, transparent); }
  body .hf-go { display: none; }
  body .hf-best { display: none; }
  body .hf-body { flex: 1; min-width: 0; gap: 0.4rem; padding: 0; }
  body .hf-name { font-size: 1.15rem; }
  body .hf-where { display: none; }
  body .hf-rates { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; padding-top: 0; border-top: 0; }
  body .hf-rate { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  body .hf-goods { font-size: 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body .hf-meter { grid-row: auto; grid-column: auto; }
  body .hf-meter i { height: 4px; }
  body .hf-level { display: none; }
}
@media (max-width: 639px) { body .ha .ha-grid { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; } }
/* ── footer, phone look: a short "buy" strip, the brand line, then every group as one row of chips ── */
@media (max-width: 767px) {
  body .foot { margin-top: 1rem; }
  body .foot-inner { padding: 1.2rem 1rem 1rem; }
  body .foot-launch { margin-bottom: 1.2rem; padding: 0.9rem 1rem; border-radius: 16px; min-height: 0; }
  body .foot-launch-title { margin-top: 0.2rem; font-size: 1.5rem; }
  body .foot-launch-text, body .foot-launch-count, body .foot-launch .foot-kicker--muted { display: none; }
  body .foot-launch-ctas { margin-top: 0.7rem; gap: 0.5rem; flex-wrap: nowrap; }
  body .foot-launch-ctas > * { flex: 1 1 0; min-width: 0; min-height: 40px; padding-inline: 0.6rem; font-size: 0.66rem; justify-content: center; text-align: center; white-space: nowrap; }
  body .foot-main { gap: 1rem; }
  body .foot-brand-text { margin-top: 0.4rem; font-size: 0.82rem; line-height: 1.45; }
  body .foot-brand-ctas { gap: 0.5rem; margin-top: 0.7rem; }
  body .foot-nav { grid-template-columns: minmax(0, 1fr); gap: 0; }
  body .foot-col { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); align-items: start; gap: 0.6rem; padding: 0.6rem 0; }
  body .foot-col-label { margin: 0.45rem 0 0; font-size: 0.6rem; }
  body .foot-col ul { gap: 0.3rem; }
  body .foot .foot-col a, body .foot .foot-consent { min-height: 30px; padding: 0 0.6rem; font-size: 0.78rem; }
  body .foot-bottom { margin-top: 0.8rem; padding-top: 0.8rem; }
  body .foot-legal { font-size: 0.6875rem; line-height: 1.45; }
}
/* text + pictures blocks on phones: one picture after each point instead of all pictures at the end */
@media (max-width: 639px) {
  body .rm-flow { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.8rem; }
  body .rm-flow > ul, body .rm-flow > div { display: contents; }
  body .rm-flow li { font-size: 0.9rem; line-height: 1.5; }
  body .rm-flow figure figcaption { font-size: 0.75rem; margin-top: 0.3rem; }
  body .rob-lede--wide { font-size: 1rem; line-height: 1.5; }
}
/* last sideways rows: the home crew line-up and the character "people" row become grids */
@media (max-width: 767px) {
  body [class*='lineup'] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; overflow: visible; margin-inline: 0; padding: 0; gap: 8px; scroll-snap-type: none; }
  body [class*='lineup'] > li { flex: none; min-width: 0; height: 220px; }
  body .cx-people--row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; gap: 8px; }
  body .cx-people--row > * { min-width: 0; width: auto; }
  body .cx-people--row > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
