/**
 * @file        sg-stats.css
 * @description Styles of the stats module: statistics tiles and distance bars, records, flight log and route map, spending tables, audience tables, year in review, live counters, on this day card, tidy page (V6-10, V6-12 to V6-14, F6-10, S6-13, S6-14, L6-05, L6-06); Phase 6 mockup pass for V6-10, V6-12, V6-13, V6-14, S6-14, L6-05, L6-06
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         bfd7b249-2959-4485-a878-abc7c05f4c9b
 * @version     0.3.0.4
 * @created     2026-12-01
 * @updated     2026-12-04
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* Mobile first (360 px): one column; figures in IBM Plex Mono with tabular digits; nothing wider than the screen. */
.sg-stats-nav ul, .sg-stats-tabs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 16px; padding: 0; list-style: none; border-bottom: 1px solid var(--border); }
.sg-stats-nav a, .sg-stats-tabs a { padding: 8px 0; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink-muted); text-decoration: none; }
.sg-stats-nav a[aria-current="page"], .sg-stats-tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }
.sg-stats-filters { display: grid; gap: 4px; }

.sg-stats-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; justify-content: space-between; margin: 0 0 16px; }
.sg-stats-head h1 { margin: 0; }
.sg-stats-head__text { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.sg-stats-head__sub { margin: 4px 0 0; color: var(--ink-muted); }
.sg-stats-head__aside { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 100%; }
.sg-stats-head__aside .sg-chip { min-height: 32px; padding: 4px 12px; overflow-wrap: anywhere; }
.sg-stats-head__aside a.sg-chip { min-height: 44px; }
.sg-stats-visibility, .sg-stats-year { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.sg-stats-visibility select, .sg-stats-year select { min-height: 44px; max-width: 100%; }

.sg-stats-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.sg-stats-tiles .sg-stat { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sg-stats-tiles .sg-stat__value { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.sg-stats-chart { margin: 0 0 16px; max-width: 100%; }
.sg-stats-chart h2 { margin: 0; }
.sg-stats-bars { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 10px; }
.sg-stats-barrow__label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; margin: 0 0 2px; }
.sg-stats-svg { display: block; width: 100%; max-width: 100%; }
.sg-stats-svg__track { fill: var(--bg); stroke: var(--border); stroke-width: 1; }
.sg-stats-svg__bar { fill: var(--ink); }
.sg-stats-barrow__mode { display: inline-flex; align-items: center; gap: 6px; }
.sg-stats-barrow__mode .sg-icon { width: 18px; height: 18px; color: var(--ink-muted); }
.sg-stats-chart summary, .sg-stats-chart details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.sg-stats-links { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; list-style: none; }
.sg-stats-links a { min-height: 44px; display: inline-flex; align-items: center; }

.sg-stats-records { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.sg-stats-record { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.sg-stats-record p { margin: 2px 0; overflow-wrap: anywhere; }
.sg-stats-record__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin: 0 0 8px; }
.sg-stats-record__head h3 { margin: 0; font-size: 0.8rem; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.sg-stats-record__head .sg-icon { width: 20px; height: 20px; flex: none; color: var(--ink-muted); }
.sg-stats-record__value { font-size: 1.6rem; font-weight: 600; margin: 0 0 4px; }
.sg-stats-record__place { font-weight: 500; }
.sg-stats-record__date { color: var(--ink-muted); font-size: 0.9rem; }
.sg-stats-record__none { font-weight: 500; }
.sg-stats-open { margin-top: auto; padding-top: 8px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; align-self: flex-start; }
.sg-stats-open .sg-icon { width: 18px; height: 18px; }
.sg-stats-section h2 { font-size: 1.15rem; margin: 8px 0 12px; }
.sg-stats-modes, .sg-stats-counts, .sg-stats-routes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sg-stats-modes li, .sg-stats-counts li { display: flex; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
.sg-stats-two { display: grid; gap: 12px; }

.sg-stats-map svg { display: block; width: 100%; height: auto; }
.sg-stats-route { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; opacity: 0.7; }
.sg-stats-route--longest { stroke: var(--orange); stroke-width: 2.6; opacity: 1; }

.sg-stats-total__value { font-size: 2rem; font-weight: 600; margin: 4px 0; overflow-wrap: anywhere; }
.sg-stats-table caption { text-align: left; font-family: var(--font-head); font-weight: 600; padding: 8px 0; }
.sg-stats-table td, .sg-stats-table th { overflow-wrap: break-word; }

.sg-stats-audience__totals { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.sg-stats-reaction { white-space: nowrap; margin-right: 8px; }
.sg-stats-tiles .sg-stat__value, .sg-stats-record__value, .sg-stats-total__value { font-family: var(--font-mono); }
.sg-stats-stepline { font-size: 0.9rem; margin: 4px 0 0; }

.sg-stats-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.sg-stats-chips li { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.sg-stats-picker { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sg-stats-pick label { position: relative; display: block; min-height: 44px; cursor: pointer; }
.sg-stats-pick input { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; }
.sg-stats-pick img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.sg-stats-pick input:checked + img { outline: 3px solid var(--accent); outline-offset: -3px; }
.sg-stats-pick--locked img { filter: grayscale(1); opacity: 0.45; }
.sg-stats-pick--locked label { cursor: not-allowed; }
.sg-stats-pick .sg-chip { position: absolute; bottom: 6px; left: 6px; }

/* S6-14 live counters: a warm pill bar with a status dot; dots between segments come from CSS, so a missing segment leaves no stray separator. */
.sg-stats-live { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; list-style: none; margin: 8px 0; padding: 8px 12px; max-width: 100%;
  background: var(--beige); color: var(--warm-ink); border: 1px solid var(--border-warm); border-radius: var(--radius); font-weight: 500; }
.sg-stats-live::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.sg-stats-live--paused::before { background: var(--border-warm); }
.sg-stats-live li { display: inline-flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sg-stats-live li + li::before { content: ""; flex: none; width: 4px; height: 4px; border-radius: 50%; background: var(--border-warm); }

/* L6-05 on this day: head with icon, title and date chip, actions beside it; rows with year, step, trip, "Open step" and the photo strip. */
.sg-stats-day__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.sg-stats-day__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.sg-stats-day__title h2 { margin: 0; font-size: 1.15rem; }
.sg-stats-day__title .sg-icon { width: 22px; height: 22px; color: var(--accent); }
.sg-stats-day__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.sg-stats-day__actions form { margin: 0; }
.sg-stats-day__actions .sg-button, .sg-stats-tidy__switch { min-height: 44px; }
.sg-stats-day__actions .sg-link-button { min-height: 44px; display: inline-flex; align-items: center; }
.sg-stats-day__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sg-stats-day__row { padding: 12px 0 0; border-top: 1px solid var(--border); }
.sg-stats-day__line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; margin: 0 0 8px; }
.sg-stats-day__text { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.sg-stats-day__year { font-size: 0.85rem; color: var(--ink-muted); }
.sg-stats-day__step { font-weight: 600; }
.sg-stats-day__trip { font-size: 0.9rem; color: var(--ink-muted); }
.sg-stats-day__line .sg-stats-open { margin: 0; padding: 0; }
.sg-stats-day__strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sg-stats-day__strip img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }

/* L6-06 weekly reminder: one card per group, icon and heading with the count, rows with title, sub line and an arrow action. */
.sg-stats-tidy { display: grid; gap: 16px; }
.sg-stats-tidy .sg-panel { margin: 0; }
.sg-stats-tidy__switch { display: inline-flex; align-items: center; gap: 6px; }
.sg-stats-tidy__switch .sg-icon { width: 18px; height: 18px; }
.sg-stats-head__aside form { margin: 0; }
.sg-stats-tasks__h { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.sg-stats-tasks__h .sg-icon { width: 22px; height: 22px; flex: none; color: var(--accent); }
.sg-stats-tasks__list { list-style: none; margin: 0; padding: 0; }
.sg-stats-task { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; padding: 8px 0; border-top: 1px solid var(--border); }
.sg-stats-task:first-child { border-top: 0; }
.sg-stats-task__text { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.sg-stats-task__title { font-weight: 500; }
.sg-stats-task__sub { font-size: 0.9rem; color: var(--ink-muted); }
.sg-stats-task .sg-stats-task__go { margin: 0; padding: 0; }
.sg-stats-tidy .sg-stats-empty form { margin: 0; }

.sg-stats-settings input[inputmode="decimal"] { max-width: 12rem; }

/* Phase 6 mockup pass (V6-10, V6-12 to V6-14): segmented visibility and year switch, banner, empty card, card heads,
   "Explore more" links, flight tiles, airports with code chips, spending summary with the switch, tables with column heads. */
.sg-stats-seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.sg-stats-seg legend { font-size: 0.85rem; color: var(--ink-muted); padding: 0; margin: 0 0 4px; }
.sg-stats-seg__row { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.sg-stats-seg__radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sg-stats-seg__opt { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; cursor: pointer; font-weight: 500; }
.sg-stats-seg__opt + .sg-stats-seg__radio + .sg-stats-seg__opt { border-left: 1px solid var(--border-strong); }
.sg-stats-seg__radio:checked + .sg-stats-seg__opt { background: var(--ink); color: var(--surface); }
.sg-stats-seg__radio:focus-visible + .sg-stats-seg__opt { outline: 2px solid var(--orange); outline-offset: -2px; }
.sg-stats-visibility { align-items: flex-end; }
.sg-stats-visibility .sg-button { min-height: 44px; }

.sg-stats-years ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 16px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); width: fit-content; max-width: 100%; }
.sg-stats-years__opt { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink-muted); text-decoration: none; }
.sg-stats-years__opt[aria-current="true"] { background: var(--ink); color: var(--surface); }

.sg-stats-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 16px; border: 1px solid var(--border-warm); border-radius: var(--radius); background: var(--beige); color: var(--warm-ink); }
.sg-stats-banner p { margin: 0; overflow-wrap: anywhere; }
.sg-stats-banner .sg-icon { flex: none; }

.sg-stats-empty { text-align: center; padding: 40px 16px; }
.sg-stats-empty h2 { margin: 12px 0 6px; font-size: 1.2rem; }
.sg-stats-empty p { margin: 0 auto 12px; max-width: 46ch; color: var(--ink-muted); }
.sg-stats-empty__icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--bg); color: var(--ink); }
.sg-stats-empty__icon .sg-icon { width: 32px; height: 32px; }

.sg-stats-cardhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin: 0 0 12px; }
.sg-panel .sg-stats-cardhead h2 { margin: 0; font-size: 1.1rem; }
.sg-stats-cardhead__meta { font-size: 0.85rem; color: var(--ink-muted); }
.sg-stats-chart { margin: 0; }
.sg-stats-chart figcaption { margin: 0; }

.sg-stats-main { display: grid; gap: 16px; margin: 0 0 16px; }
.sg-stats-explore { margin: 0; }
.sg-panel.sg-stats-explore h2 { margin: 0 0 8px; }
.sg-stats-explore__list { list-style: none; margin: 0; padding: 0; }
.sg-stats-explore__list li + li { border-top: 1px solid var(--border); }
.sg-stats-explore__link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; color: var(--ink); text-decoration: none; }
.sg-stats-explore__icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); background: var(--bg); }
.sg-stats-explore__text { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.sg-stats-explore__title { font-weight: 600; }
.sg-stats-explore__sub { font-size: 0.85rem; color: var(--ink-muted); }
.sg-stats-explore__link > .sg-icon { flex: none; color: var(--ink-muted); }
.sg-stats-explore__link:hover .sg-stats-explore__title { text-decoration: underline; }

.sg-stats-tiles .sg-stat__label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.sg-stats-tiles .sg-stat__value { font-size: 1.6rem; }
.sg-stat__meta { font-size: 0.85rem; color: var(--ink-muted); overflow-wrap: anywhere; }
.sg-stats-tiles--flights .sg-stat__value { font-size: 1.4rem; overflow-wrap: anywhere; }
.sg-stats-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink-muted); }
.sg-stats-legend::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--orange); }
.sg-stats-listcard { margin: 0; min-width: 0; }
.sg-stats-counts li { padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.sg-stats-counts li:last-child { border-bottom: 0; }
.sg-stats-airport { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.sg-stats-code { padding: 1px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-weight: 600; }

.sg-stats-homechip .sg-icon, .sg-stats-ownerchip .sg-icon { width: 16px; height: 16px; }
.sg-stats-summary { display: grid; gap: 16px; }
.sg-stats-summary__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sg-stats-summary__row > div { min-width: 0; }
.sg-stats-summary__row p { margin: 0; }
.sg-stats-summary__meta { color: var(--ink-muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.sg-stats-note { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px; border: 1px solid var(--border-warm); border-radius: var(--radius); background: var(--beige); color: var(--warm-ink); }
.sg-stats-note p { margin: 0; overflow-wrap: anywhere; }
.sg-stats-note .sg-icon { flex: none; }
.sg-stats-note__title { font-weight: 600; }
.sg-stats-switchform p { margin: 4px 0; }
.sg-stats-switchrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sg-stats-switchrow__text { min-width: 0; }
.sg-stats-switchrow__text label { font-weight: 600; cursor: pointer; }
/* The checkbox box is 56 x 44 px (touch target); the track and thumb are drawn inside it. */
.sg-stats-switch { appearance: none; flex: none; position: relative; width: 56px; height: 44px; margin: 0; border: 0; background: transparent; cursor: pointer; }
.sg-stats-switch::before { content: ""; position: absolute; top: 6px; left: 0; width: 54px; height: 30px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg); }
.sg-stats-switch::after { content: ""; position: absolute; top: 10px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink-muted); transition: transform 0.15s; }
.sg-stats-switch:checked::before { background: var(--ink); border-color: var(--ink); }
.sg-stats-switch:checked::after { transform: translateX(24px); background: var(--surface); }
.sg-stats-switch:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 999px; }
.sg-stats-switchform__status { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-muted); }
.sg-stats-switchform .sg-button { min-height: 44px; margin-top: 8px; }
.sg-stats-tablecard { min-width: 0; }
.sg-stats-tablecard .sg-table-wrap { border: 0; border-radius: 0; }
/* At 360 px the columns wrap inside the card (no sideways scrolling); only the amount column stays on one line. */
.sg-stats-table thead th { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; overflow-wrap: normal; word-break: normal; }
.sg-stats-table tbody th { color: var(--ink); font-weight: 500; min-width: 6.5rem; overflow-wrap: break-word; word-break: normal; }
.sg-stats-table th, .sg-stats-table td { padding: 8px 6px; }
.sg-stats-table td { overflow-wrap: normal; }
.sg-stats-num { text-align: right; }
.sg-stats-table td.sg-mono { white-space: nowrap; }
.sg-table th.sg-stats-num, .sg-table td.sg-stats-num { text-align: right; }

/* F6-10 audience: privacy chip, period links next to the sort select, trip total cards, one step list across trips. */
.sg-stats-privacychip .sg-icon { width: 16px; height: 16px; }
.sg-stats-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; margin: 0 0 16px; }
.sg-stats-filters .sg-stats-years ul { margin: 0; }
.sg-stats-sort { margin: 0; }
.sg-stats-sort .sg-button { min-height: 44px; }
.sg-stats-tripcards { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.sg-stats-tripcard { margin: 0; min-width: 0; }
.sg-panel .sg-stats-tripcard h3, .sg-stats-tripcard h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.sg-stats-tripcard .sg-stats-cardhead { margin: 0 0 6px; }
.sg-stats-tripcard .sg-stats-audience__totals { margin: 0; color: var(--ink-muted); }
.sg-stats-steplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sg-stats-stepcard { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.sg-stats-stepcard__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; overflow-wrap: anywhere; }
.sg-stats-stepcard__title { font-weight: 600; }
.sg-stats-stepcard__meta { font-size: 0.85rem; color: var(--ink-muted); }
.sg-stats-stepcard__figures { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.sg-stats-stepcard__viewers { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.sg-stats-stepcard__viewers .sg-icon { width: 18px; height: 18px; color: var(--ink-muted); }
.sg-stats-stepcard__comments { color: var(--ink-muted); }
.sg-stats-counting { border-color: var(--border-warm); background: var(--beige); color: var(--warm-ink); }
.sg-stats-noviews { text-align: center; padding: 24px 8px; color: var(--ink-muted); }
.sg-stats-noviews .sg-icon { width: 32px; height: 32px; }
.sg-stats-noviews p { margin: 4px auto; max-width: 46ch; }
.sg-stats-noviews__title { font-weight: 600; color: var(--ink); }
.sg-stats-stepline a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.sg-stats-stepline .sg-icon { width: 16px; height: 16px; flex: none; }
@media (min-width: 720px) { .sg-stats-tripcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) { .sg-stats-switch::after { transition: none; } }

/* Below 600 px a four-column table stacks: the row head on top, then one "label  value" line per cell. */
@media (max-width: 599px) {
  .sg-stats-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sg-stats-table--stack tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .sg-stats-table--stack tr:last-child { border-bottom: 0; }
  .sg-stats-table--stack th, .sg-stats-table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 2px 6px; border: 0; text-align: left; overflow-wrap: anywhere; }
  .sg-stats-table--stack td::before { content: attr(data-label); flex: none; color: var(--ink-muted); font-family: var(--font-body); font-size: 0.85rem; }
  .sg-stats-table--stack td.sg-stats-num { text-align: right; }
  .sg-stats-table--stack td.sg-mono { white-space: normal; }
}

/* With JavaScript the year form submits on change (sg-stats.js marks it), so its button is hidden; without, it stays. */
.sg-stats-year--auto button { display: none; }

@media (min-width: 720px) {
  .sg-stats-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sg-stats-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-stats-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-stats-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sg-stats-tiles--flights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .sg-stats-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .sg-stats-records { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sg-stats-summary { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .sg-stats-summary__switch { border-left: 1px solid var(--border); padding-left: 16px; }
}

@media (min-width: 1100px) {
  .sg-stats-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sg-stats-tiles--flights { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
