/* Asian Games data platform — design tokens & components (spec §6–§7). */
:root {
  --ink: #101820;
  --navy: #172A3A;
  --navy-2: #1F3A50;
  --vermilion: #E4572E;
  --vermilion-dark: #C2421D;
  --ivory: #F7F4EE;
  --white: #FFFFFF;
  --border: #E7E3DC;
  --muted: #5F6672;          /* spec #6B7280, darkened slightly for AA on ivory */
  --gold: #C9A227;
  --silver: #8C96A0;
  --bronze: #9A6236;
  --ok: #2F7D4F;
  --warn: #9A6A00;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s8: 96px;
  --max: 1320px;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --t-fast: 150ms; --t-ui: 300ms; --t-story: 700ms;
  --shadow: 0 1px 2px rgba(16,24,32,.06), 0 4px 16px rgba(16,24,32,.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ivory); color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  font-feature-settings: 'tnum' 1;  /* tabular numbers for tables & counters */
}
img { max-width: 100%; display: block; }
a { color: inherit; }
a:hover { color: var(--vermilion-dark); }
:focus-visible { outline: 3px solid var(--vermilion); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 var(--s2); letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; }
h3 { font-size: clamp(20px, 2vw, 26px); font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 var(--s2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 16px; z-index: 100; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--s2); }
@media (min-width: 768px) { .container { padding: 0 var(--s4); } }
.section { padding: var(--s5) 0; }
.section-tight { padding: var(--s4) 0; }
.eyebrow { font: 700 12px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--vermilion-dark); margin-bottom: var(--s1); display: block; }
.lede { font-size: 18px; color: var(--muted); max-width: 64ch; }
.meta { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* --- Status strip & header ---------------------------------------------- */
.demo-banner { background: #FFF3CD; color: #5C4400; font-size: 14px; padding: 8px 0; border-bottom: 1px solid #F0D98A; }
.demo-banner strong { font-weight: 700; }
.site-header { background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 50; }
.site-header .bar { display: flex; align-items: center; gap: var(--s2); min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); font: 800 17px/1.1 var(--font-display); }
.brand .mark { width: 34px; height: 34px; border-radius: 50%; background: var(--vermilion); display: grid; place-items: center; font-size: 13px; letter-spacing: -.02em; }
.brand small { display: block; font: 500 11px/1.2 var(--font-body); opacity: .7; letter-spacing: .04em; }
.nav { display: none; gap: 2px; margin-left: var(--s3); }
.nav a { color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: var(--r-sm); transition: background var(--t-fast); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--white); background: rgba(255,255,255,.1); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--vermilion); }
.header-actions { margin-left: auto; display: flex; gap: var(--s1); align-items: center; }
.icon-btn { text-decoration: none; background: transparent; border: 1px solid rgba(255,255,255,.25); color: var(--white); border-radius: var(--r-sm); min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; cursor: pointer; font: 600 14px var(--font-body); }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn .kbd { font-size: 11px; opacity: .6; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; padding: 0 4px; }
.mobile-nav { display: none; background: var(--navy-2); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 14px var(--s2); color: var(--white); text-decoration: none; border-top: 1px solid rgba(255,255,255,.08); font-weight: 600; }
.edition-select { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.25); border-radius: var(--r-sm); height: 44px; padding: 0 8px; font: 600 13px var(--font-body); }
.edition-select option { color: var(--ink); }
@media (min-width: 1200px) { .nav { display: flex; } .menu-toggle { display: none; } }
@media (max-width: 575px) { .search-label, .kbd, .edition-select { display: none; } }

.breadcrumbs { font-size: 13px; color: var(--muted); padding: var(--s2) 0 0; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: '/'; margin-right: 6px; opacity: .5; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* --- Hero ------------------------------------------------------------------- */
.hero { background: var(--navy); color: var(--white); position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background:
  radial-gradient(900px 400px at 85% 10%, rgba(228,87,46,.35), transparent 60%),
  radial-gradient(700px 500px at 0% 100%, rgba(201,162,39,.18), transparent 60%); pointer-events: none; }
.hero .container { position: relative; padding-top: var(--s6); padding-bottom: var(--s6); }
.hero h1 { font-size: clamp(40px, 7vw, 80px); max-width: 14ch; }
.hero .lede { color: rgba(255,255,255,.78); }
.hero .dates { font-weight: 600; letter-spacing: .02em; color: rgba(255,255,255,.9); }
.page-hero { background: var(--white); border-bottom: 1px solid var(--border); }
.page-hero .container { padding-top: var(--s4); padding-bottom: var(--s4); }
.page-hero.dark { background: var(--navy); color: var(--white); border: 0; }
.page-hero.dark .lede, .page-hero.dark .meta, .page-hero.dark .breadcrumbs { color: rgba(255,255,255,.75); }
.page-hero.dark .eyebrow { color: #FF9B7A; }
.hero-flag { font-size: 56px; line-height: 1; margin-bottom: var(--s1); }
.hero-grid { display: grid; gap: var(--s4); align-items: end; }
@media (min-width: 992px) { .hero-grid { grid-template-columns: 1.4fr 1fr; } }

/* --- Buttons & chips ----------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--r-sm); font: 700 15px var(--font-body); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.btn-primary { background: var(--vermilion); color: var(--white); }
.btn-primary:hover { background: var(--vermilion-dark); color: var(--white); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { color: var(--vermilion); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s1); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); font: 600 13px var(--font-body); text-decoration: none; color: var(--ink); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"], .chip.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip-row { display: flex; gap: var(--s1); overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }

/* --- Stat cards ------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .stats.five { grid-template-columns: repeat(5, 1fr); } .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s2) var(--s3); }
.stat .value { font: 800 clamp(32px, 4vw, 52px)/1 var(--font-display); letter-spacing: -.02em; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.stat .def { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero .stat, .page-hero.dark .stat { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.hero .stat .label, .hero .stat .def, .page-hero.dark .stat .label, .page-hero.dark .stat .def { color: rgba(255,255,255,.7); }

/* --- Medals ----------------------------------------------------------------- */
.medal { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.medal .disc { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font: 800 11px/1 var(--font-body); color: var(--white); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.medal.gold .disc, .disc.gold { background: var(--gold); }
.medal.silver .disc, .disc.silver { background: var(--silver); }
.medal.bronze .disc, .disc.bronze { background: var(--bronze); }
th .disc { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--white); font: 800 11px var(--font-body); }
.medal-strip { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--border); }
.medal-strip span { display: block; }
.medal-strip .g { background: var(--gold); } .medal-strip .s { background: var(--silver); } .medal-strip .b { background: var(--bronze); }
.medal-trio { display: flex; gap: var(--s2); flex-wrap: wrap; }
.medal-trio .medal { font-size: 22px; font-family: var(--font-display); }
.medal-trio .medal .disc { width: 32px; height: 32px; font-size: 13px; }

/* --- Cards & grids ----------------------------------------------------------- */
.grid { display: grid; gap: var(--s2); }
.grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr; }
@media (min-width: 576px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3); position: relative; }
.card-link { text-decoration: none; display: block; transition: transform var(--t-fast), box-shadow var(--t-fast); }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.card h3, .card h4 { margin-bottom: 6px; }
.card .row { display: flex; align-items: center; gap: var(--s1); justify-content: space-between; }
.card-flag { font-size: 30px; line-height: 1; }
.card-stats { display: flex; gap: var(--s2); font-size: 13px; color: var(--muted); margin-top: var(--s1); flex-wrap: wrap; }
.card-stats b { color: var(--ink); font-size: 15px; }
.sport-icon { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--ivory); display: grid; place-items: center; color: var(--navy); }
.split { display: grid; gap: var(--s4); }
@media (min-width: 992px) { .split { grid-template-columns: 2fr 1fr; } .split.even { grid-template-columns: 1fr 1fr; } }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.link-arrow { font-weight: 700; text-decoration: none; color: var(--vermilion-dark); white-space: nowrap; }

/* --- Athlete card ------------------------------------------------------------- */
.athlete-card { display: flex; gap: var(--s2); align-items: center; padding: var(--s2); }
.avatar { width: 64px; aspect-ratio: 4/5; border-radius: var(--r-sm); background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: var(--white); display: grid; place-items: center; font: 800 18px var(--font-display); flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 160px; font-size: 44px; border-radius: var(--r-md); }
.athlete-card .name { font-weight: 700; line-height: 1.3; }

/* --- Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #FBFAF7; position: sticky; top: 0; white-space: nowrap; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: #FBFAF7; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .rank { font: 800 16px var(--font-display); width: 48px; }
table.data a { text-decoration: none; font-weight: 600; }
table.data a:hover { text-decoration: underline; }
tr.is-target { background: #FFF6EE !important; box-shadow: inset 4px 0 0 var(--vermilion); }
.country-cell { display: flex; align-items: center; gap: 10px; }
.country-cell .flag { font-size: 20px; }
.code { font: 700 11px var(--font-body); color: var(--muted); letter-spacing: .06em; }
th button.sort { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; padding: 0; }

/* --- Status badges ------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font: 700 11px/1.8 var(--font-body); letter-spacing: .04em; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap; }
.badge-official { background: #E5F2EA; color: var(--ok); }
.badge-provisional { background: #FFF3CD; color: #6B4E00; border-color: #F0D98A; }
.badge-scheduled { background: #EEF1F4; color: var(--navy); }
.badge-in_progress { background: #FDE8E1; color: var(--vermilion-dark); }
.badge-in_progress::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--vermilion); animation: pulse 1.6s infinite; }
.badge-postponed { background: #F3E8FF; color: #5B2C83; }
.badge-cancelled { background: #EEE; color: #555; text-decoration: line-through; }
.is-cancelled { opacity: .6; }
@keyframes pulse { 50% { opacity: .3; } }

/* --- Filters ----------------------------------------------------------------- */
.explorer { display: grid; gap: var(--s3); }
@media (min-width: 1200px) { .explorer { grid-template-columns: 280px 1fr; align-items: start; } }
.filters { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s2); }
@media (min-width: 1200px) { .filters { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; } }
.filters fieldset { border: 0; padding: 0; margin: 0 0 var(--s2); }
.filters legend, .filters label.lbl { font: 700 12px var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; display: block; }
.filters select, .filters input[type=text], .filters input[type=date], .filters input[type=search], .input {
  width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; font: 500 14px var(--font-body); background: var(--white); color: var(--ink); }
.filters select[multiple] { min-height: 120px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--vermilion); }
.filter-toggle { display: inline-flex; }
/* The mobile backdrop sits inside the .explorer grid; keep it out of the
   layout entirely unless the drawer is open, or it claims a grid column. */
.scrim { display: none; }
@media (max-width: 1199px) {
  .filters { display: none; }
  .filters.open { display: block; position: fixed; inset: auto 0 0 0; max-height: 82vh; overflow: auto; z-index: 60; border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25); padding-bottom: var(--s4); }
  .scrim { position: fixed; inset: 0; background: rgba(16,24,32,.45); z-index: 55; display: none; }
  .scrim.open { display: block; }
}
@media (min-width: 1200px) { .filter-toggle, .filters .close-filters { display: none; } }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); justify-content: space-between; margin-bottom: var(--s2); }
.tabs { display: inline-flex; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; }
.tabs a { padding: 8px 14px; border-radius: 4px; text-decoration: none; font: 600 13px var(--font-body); color: var(--muted); }
.tabs a[aria-current="true"] { background: var(--navy); color: var(--white); }

/* --- Charts & maps ----------------------------------------------------------- */
.chart { width: 100%; height: 360px; }
.chart.sm { height: 260px; }
.map { width: 100%; height: 420px; border-radius: var(--r-md); border: 1px solid var(--border); background: #E8EEF2; z-index: 0; }
.map .leaflet-tile-pane { filter: saturate(.45) brightness(1.04); }
details.data-alt { margin-top: var(--s1); font-size: 14px; }
details.data-alt summary { cursor: pointer; font-weight: 600; color: var(--muted); min-height: 32px; }
.chart-summary { font-size: 14px; color: var(--muted); }

/* --- Timeline / schedule ---------------------------------------------------- */
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.day-strip a { flex: 0 0 auto; text-align: center; min-width: 60px; padding: 8px 6px; border-radius: var(--r-sm); background: var(--white); border: 1px solid var(--border); text-decoration: none; }
.day-strip a b { display: block; font: 800 20px var(--font-display); }
.day-strip a span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.day-strip a .count { font-size: 11px; color: var(--vermilion-dark); font-weight: 700; }
.schedule-day { margin-bottom: var(--s3); scroll-margin-top: 90px; }
.schedule-day h3 { font-size: 18px; border-bottom: 2px solid var(--navy); padding-bottom: 6px; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 var(--s3) 40px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 3px solid var(--navy); }
.timeline li.gold::before { border-color: var(--gold); background: var(--gold); }
.timeline li.silver::before { border-color: var(--silver); background: var(--silver); }
.timeline li.bronze::before { border-color: var(--bronze); background: var(--bronze); }

/* --- Medal journey ------------------------------------------------------------ */
.journey { background: var(--navy); color: var(--white); border-radius: var(--r-lg); padding: var(--s3); }
.journey h3 { color: var(--white); }
.journey ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; }
.journey li { display: flex; align-items: center; }
.journey li + li::before { content: ''; width: 24px; height: 2px; background: rgba(255,255,255,.35); margin: 0 2px; }
.journey a { display: block; padding: 10px 14px; border-radius: var(--r-sm); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); text-decoration: none; color: var(--white); min-width: 110px; transition: background var(--t-fast), transform var(--t-fast); }
.journey a:hover { background: var(--vermilion); transform: translateY(-2px); color: var(--white); }
.journey a small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.journey a strong { font-size: 14px; }
.journey .branch { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px dashed rgba(255,255,255,.25); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.journey .medal-node { box-shadow: inset 0 -3px 0 var(--gold); }
.journey .medal-node.SILVER { box-shadow: inset 0 -3px 0 var(--silver); }
.journey .medal-node.BRONZE { box-shadow: inset 0 -3px 0 var(--bronze); }
@media (max-width: 767px) { .journey ol { flex-direction: column; align-items: stretch; } .journey li { flex-direction: column; align-items: stretch; } .journey li + li::before { width: 2px; height: 14px; margin: 2px 24px; } }

/* --- Search overlay ----------------------------------------------------------- */
.search-overlay { position: fixed; inset: 0; background: rgba(16,24,32,.6); z-index: 80; display: none; padding: 10vh var(--s2) var(--s2); }
.search-overlay.open { display: block; }
.search-panel { max-width: 680px; margin: 0 auto; background: var(--white); border-radius: var(--r-lg); box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.search-panel input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 20px 24px; font: 600 20px var(--font-body); outline: none; }
.search-results { max-height: 60vh; overflow: auto; padding: 8px 0; }
.search-results .grp { font: 700 11px var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 10px 24px 4px; }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 24px; text-decoration: none; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--ivory); }
.search-results .sub { color: var(--muted); font-size: 13px; }
.search-hint { padding: 12px 24px; font-size: 13px; color: var(--muted); }

/* --- Compare tray --------------------------------------------------------------- */
.compare-tray { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 45; background: var(--ink); color: var(--white); border-radius: 999px; padding: 6px 6px 6px 18px; display: none; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100vw - 32px); }
.compare-tray.show { display: flex; }
.compare-tray .items { display: flex; gap: 6px; overflow-x: auto; font-size: 13px; }
.compare-tray .items button { background: rgba(255,255,255,.12); color: var(--white); border: 0; border-radius: 999px; padding: 6px 10px; font: 600 12px var(--font-body); cursor: pointer; white-space: nowrap; }
.compare-tray .btn { min-height: 36px; border-radius: 999px; }

/* --- Notices, empty states, prose ------------------------------------------- */
.notice { border-left: 4px solid var(--vermilion); background: var(--white); padding: var(--s2); border-radius: var(--r-sm); }
.notice.warn { border-color: var(--warn); background: #FFF8E6; }
.empty { text-align: center; padding: var(--s5) var(--s2); color: var(--muted); background: var(--white); border: 1px dashed var(--border); border-radius: var(--r-md); }
.empty h3 { color: var(--ink); }
.prose { max-width: 70ch; font-size: 17px; }
.prose h2 { margin-top: var(--s5); }
.prose li { margin-bottom: 6px; }
.story-quote { font: 600 clamp(22px, 3vw, 30px)/1.35 var(--font-display); border-left: 4px solid var(--vermilion); padding-left: var(--s3); margin: var(--s4) 0; }
.source-line { font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding-top: var(--s1); margin-top: var(--s2); }
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: var(--s3); flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--white); text-decoration: none; font-weight: 600; padding: 0 12px; }
.pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }
.messages { list-style: none; padding: 0; margin: var(--s2) 0; }
.messages li { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 8px; background: var(--white); border-left: 4px solid var(--navy); }
.messages .error { border-color: var(--vermilion); }
.messages .success { border-color: var(--ok); }

/* --- Footer --------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: var(--s5) 0 var(--s4); margin-top: var(--s6); font-size: 14px; }
.site-footer a { color: rgba(255,255,255,.9); }
.site-footer .cols { display: grid; gap: var(--s3); }
@media (min-width: 768px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { color: var(--white); font-size: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }

/* --- Reveal-on-scroll (progressive; content visible without JS) ------------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--t-story) ease, transform var(--t-story) ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print { .site-header, .compare-tray, .site-footer, .filters, .filter-toggle { display: none !important; } }

/* Grid/flex children default to min-width:auto, which lets a wide table or
   tab strip push the whole page wider than a phone screen. */
.explorer > *, .split > *, .grid > *, .hero-grid > *, .toolbar > * { min-width: 0; }
.tabs { max-width: 100%; overflow-x: auto; }
.tabs a { white-space: nowrap; }

/* --- The Data Shop branding (showcase strip, header mark, footer, pitch) --- */
.tds-strip { background: #2B4438; color: #EEE8D8; font-size: 13.5px; }
.tds-strip .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
.tds-strip a { color: #fff; }
.tds-strip-cta { font-weight: 700; white-space: nowrap; text-decoration: none; background: rgba(255,255,255,.12); padding: 4px 12px; border-radius: 999px; }
.tds-strip-cta:hover { background: rgba(255,255,255,.22); color: #fff; }
@media (max-width: 767px) { .tds-strip-long { display: none; } }
@media (max-width: 420px) { .tds-strip .container { flex-wrap: wrap; } }
.tds-mark { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.header-cta { display: none; }
@media (min-width: 1200px) { .header-cta { display: inline-flex; } }
.tds-footer-brand { display: grid; gap: var(--s2); padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid rgba(255,255,255,.12); }
@media (min-width: 992px) { .tds-footer-brand { grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s4); } }
.tds-footer-brand p { margin: 0; max-width: 70ch; }
.tds-footer-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; line-height: 1.3; }
.tds-footer-logo img { border-radius: 8px; }
.built-on { background: #2B4438; color: #EEE8D8; border-radius: var(--r-lg); padding: var(--s5) var(--s3); }
@media (min-width: 768px) { .built-on { padding: var(--s5); } }
.built-on h2 { color: #fff; max-width: 22ch; }
.built-on .lede { color: rgba(238,232,216,.85); }
.built-on .eyebrow { color: #F2C77A; }
.built-tiles { display: grid; gap: var(--s2); margin: var(--s4) 0; grid-template-columns: 1fr; }
@media (min-width: 576px) { .built-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .built-tiles { grid-template-columns: repeat(3, 1fr); } }
.built-tile { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-md); padding: var(--s3); }
.built-tile h3 { color: #fff; font-size: 18px; margin-bottom: 6px; }
.built-tile p { margin: 0; font-size: 14.5px; color: rgba(238,232,216,.8); }
.built-tile i { color: #F2C77A; margin-bottom: 10px; display: block; }
.btn-light { background: #EEE8D8; color: #2B4438; }
.btn-light:hover { background: #fff; color: #2B4438; }
.pitch-steps { counter-reset: step; display: grid; gap: var(--s2); }
@media (min-width: 768px) { .pitch-steps { grid-template-columns: repeat(3, 1fr); } }
.pitch-steps .card::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--vermilion); color: #fff; font: 800 16px var(--font-display); margin-bottom: 12px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { padding-left: 30px; position: relative; }
.check-list li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: #E5F2EA; color: var(--ok); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
@media (max-width: 575px) { .brand .brand-product { display: none; } }
