/* =========================================================================
   ASROMA.GE — primitives                                    components.css
   Naming: BEM-like, lowercase, no prefixes.
     .block  .block__element  .block--modifier   state: .is-*   JS hooks: data-*
   Every component uses semantic tokens only, so it renders in both themes and
   inside any .on-dark island without extra rules.
   Contents
     1 buttons · icon buttons      2 counts · dots · badges      3 chips · LIVE pill
     4 level badges                5 avatars                      6 club discs · jersey tiles · form dots
     7 cards · section head        8 page head · stats strip     9 breadcrumb · subnav · tabs · segmented
    10 forms                      11 stepper                     12 dropdown · dialog · toast · tooltip
    13 progress · level progress · meter · split bar · stat row · stat tile
    14 poll                       15 countdown                   16 media placeholder
    17 list rows · table · pagination · load more
    18 empty state · callout · divider · skeleton
    19 styleguide-only helpers (.sg-*)
   ========================================================================= */

/* =================================================================== 1. BUTTONS */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border: var(--bw) solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-stretch: var(--stretch-c);
  font-weight: var(--fw-bold);
  font-size: var(--fs-base);
  line-height: 1;
  letter-spacing: var(--tracking-btn);
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.btn .icon { width: 18px; height: 18px; }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }

/* primary = THE yellow CTA (one per view) */
.btn--primary { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.btn--primary:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); }
.btn--primary:active { background: var(--yellow-press); border-color: var(--yellow-press); }
/* live = red "Open match center / Join live" */
.btn--live { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn--live:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn--live:active { background: var(--red-press); border-color: var(--red-press); }
/* secondary = outline */
.btn--secondary { border-color: var(--border-strong); color: var(--text-strong); }
.btn--secondary:hover { border-color: var(--text-strong); background: var(--hover-tint); }
/* subtle = neutral fill */
.btn--subtle { background: var(--surface-2); border-color: var(--border-subtle); color: var(--text-strong); }
.btn--subtle:hover { background: var(--surface-3); }
/* ghost = text only */
.btn--ghost { color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text-strong); }
/* danger = outline in danger red (distinct from brand red) */
.btn--danger { border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }

/* sizes */
.btn--sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-sm); gap: 6px; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { min-height: 52px; padding: 0 var(--sp-6); font-size: var(--fs-lg); }
.btn--lg .icon { width: 20px; height: 20px; }
.btn--icon { width: var(--tap); padding: 0; }
.btn--icon.btn--sm { width: 36px; }
.btn--icon.btn--lg { width: 52px; }
.btn--block { display: flex; width: 100%; }

/* pressed / selected (toggle buttons, "your pick") */
.btn[aria-pressed="true"], .btn.is-selected { border-color: var(--yellow); background: var(--yellow-soft); color: var(--text-strong); }
.btn--primary[aria-pressed="true"] { background: var(--yellow-press); color: var(--on-yellow); }

/* disabled & loading */
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.is-loading { -webkit-text-fill-color: transparent; pointer-events: none; }
.btn.is-loading .icon { opacity: 0; }
.btn.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--r-full);
  animation: asr-spin .7s linear infinite;
}

/* quiet icon button (header, toolbars, card actions) */
.icon-btn {
  position: relative;
  display: inline-grid; place-items: center; flex: none;
  width: var(--tap); height: var(--tap);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text-strong); }
.icon-btn[aria-pressed="true"] { color: var(--highlight); background: var(--yellow-soft); }
.icon-btn:disabled { opacity: .4; pointer-events: none; }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn--sm .icon { width: 18px; height: 18px; }
.icon-btn > .count { position: absolute; top: 4px; right: 2px; }
.icon-btn > .dot { position: absolute; top: 10px; right: 10px; }
.icon-btn > .count, .icon-btn > .dot { box-shadow: 0 0 0 2px var(--ring-color, var(--bg)); }

/* =================================================================== 2. COUNTS · DOTS · BADGES */
.count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: var(--red); color: var(--on-red);
  font: var(--fw-bold) var(--fs-2xs)/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.count--neutral { background: var(--surface-3); color: var(--text-strong); }
.count--yellow { background: var(--yellow); color: var(--on-yellow); }

.dot { position: relative; display: inline-block; flex: none; width: 8px; height: 8px; border-radius: var(--r-full); background: var(--live); vertical-align: middle; }
.dot--online { background: var(--success); }
.dot--yellow { background: var(--yellow); }
.dot--muted { background: var(--text-faint); }
.dot--pulse::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; background: currentColor; background: inherit;
  animation: asr-pulse 1.6s var(--ease-out) infinite;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 6px;
  border: var(--bw) solid var(--border);
  border-radius: var(--r-xs);
  background: transparent; color: var(--text-muted);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); line-height: 1; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; vertical-align: middle;
}
.badge .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.badge--mod { background: var(--surface-inverse); border-color: var(--surface-inverse); color: var(--text-inverse); }
.badge--admin { background: var(--red); border-color: var(--red); color: var(--on-red); }
.badge--ai { border-color: var(--border-strong); color: var(--text-strong); }
.badge--ai .icon { color: var(--yellow-text); }
.badge--new { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.badge--solid { background: var(--surface-2); border-color: var(--surface-2); color: var(--text); }

/* =================================================================== 3. CHIPS · LIVE PILL */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 10px;
  border: var(--bw) solid var(--border);
  border-radius: var(--r-xs);
  background: transparent; color: var(--text-muted);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); line-height: 1; letter-spacing: var(--tracking-label); text-transform: uppercase;
  white-space: nowrap; vertical-align: middle;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.chip .icon { width: 14px; height: 14px; stroke-width: 2.25; }
.chip--sm { min-height: 24px; padding: 0 8px; gap: 5px; }   /* non-interactive, inline in rows/cards */
.chip--solid { background: var(--surface-2); border-color: var(--surface-2); color: var(--text); }
a.chip:hover { border-color: var(--border-strong); color: var(--text-strong); }
/* status */
.chip--upcoming { border-color: var(--border-strong); color: var(--text-strong); }
.chip--live { background: var(--red); border-color: var(--red); color: var(--on-red); }
.chip--live .dot { width: 7px; height: 7px; background: currentColor; }
.chip--ft { background: var(--surface-inverse); border-color: var(--surface-inverse); color: var(--text-inverse); }
/* filter chips (buttons, aria-pressed) */
.chip--filter { min-height: 36px; padding: 0 var(--sp-3); cursor: pointer; color: var(--text); }
.chip--filter:hover { border-color: var(--border-strong); color: var(--text-strong); }
.chip--filter[aria-pressed="true"], .chip--filter.is-active { background: var(--surface-inverse); border-color: var(--surface-inverse); color: var(--text-inverse); }
@media (min-width: 900px) { .chip--filter { min-height: 32px; } }
.chip__count { font-family: var(--font-body); font-stretch: var(--stretch-n); font-weight: var(--fw-semibold); letter-spacing: 0; opacity: .7; font-variant-numeric: tabular-nums; }
.chip__remove { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: -6px; border-radius: var(--r-xs); color: inherit; }
.chip__remove:hover { background: var(--surface-3); color: var(--text-strong); }
.chip__remove .icon { width: 12px; height: 12px; }
/* reward chip "+15 pts" — restrained, beside point-earning CTAs */
.chip--reward {
  gap: 5px; min-height: 24px; padding: 0 8px 0 4px;
  background: var(--surface-2); border-color: var(--border-subtle); color: var(--text-strong);
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.chip--reward .icon { width: 16px; height: 16px; padding: 2px; border-radius: 2px; background: var(--yellow); color: var(--on-yellow); stroke-width: 2.5; }

/* segmented header LIVE pill:  LIVE | 67' | PSG 1–2 ROM */
.live-pill {
  display: inline-flex; align-items: stretch; flex: none;
  height: 32px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  color: var(--text-strong);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-md); line-height: 1; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-fast);
}
a.live-pill:hover { background: var(--surface-3); }
.live-pill > span { display: flex; align-items: center; }
.live-pill__tag { gap: 7px; padding: 0 10px; background: var(--red); color: var(--on-red); font-size: var(--fs-sm); letter-spacing: .12em; }
.live-pill__tag .dot { width: 7px; height: 7px; background: currentColor; }
.live-pill__min { padding: 0 10px; color: var(--accent-num); font-size: var(--fs-base); }
.live-pill__score { gap: 6px; padding: 0 12px 0 10px; border-left: var(--bw) solid var(--border); color: var(--text-muted); }
.live-pill__score b { font-weight: var(--fw-black); font-size: var(--fs-base); color: var(--text-strong); }
.live-pill--compact .live-pill__score { display: none; }

/* =================================================================== 4. LEVEL BADGES L1–L6 */
.level {
  --lv-bg: var(--lv1-bg); --lv-fg: var(--lv1-fg); --lv-line: var(--lv1-line); --lv-key-bg: var(--lv1-key-bg); --lv-key-fg: var(--lv1-key-fg);
  display: inline-flex; align-items: stretch; flex: none;
  height: 18px;
  border: var(--bw) solid var(--lv-line);
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--lv-bg); color: var(--lv-fg);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-2xs); line-height: 1; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.level__key { display: flex; align-items: center; padding: 0 4px; font-weight: var(--fw-black); }
.level__key:not(:only-child) { background: var(--lv-key-bg); color: var(--lv-key-fg); }
.level--1 .level__key:not(:only-child) { border-right: var(--bw) solid var(--lv-line); }
.level__name { display: flex; align-items: center; padding: 0 6px 0 5px; }
.level--2 { --lv-bg: var(--lv2-bg); --lv-fg: var(--lv2-fg); --lv-line: var(--lv2-line); --lv-key-bg: var(--lv2-key-bg); --lv-key-fg: var(--lv2-key-fg); }
.level--3 { --lv-bg: var(--lv3-bg); --lv-fg: var(--lv3-fg); --lv-line: var(--lv3-line); --lv-key-bg: var(--lv3-key-bg); --lv-key-fg: var(--lv3-key-fg); }
.level--4 { --lv-bg: var(--lv4-bg); --lv-fg: var(--lv4-fg); --lv-line: var(--lv4-line); --lv-key-bg: var(--lv4-key-bg); --lv-key-fg: var(--lv4-key-fg); }
.level--5 { --lv-bg: var(--lv5-bg); --lv-fg: var(--lv5-fg); --lv-line: var(--lv5-line); --lv-key-bg: var(--lv5-key-bg); --lv-key-fg: var(--lv5-key-fg); }
.level--6 { --lv-bg: var(--lv6-bg); --lv-fg: var(--lv6-fg); --lv-line: var(--lv6-line); --lv-key-bg: var(--lv6-key-bg); --lv-key-fg: var(--lv6-key-fg); }
.level--lg { height: 26px; font-size: var(--fs-sm); }
.level--lg .level__key { padding: 0 7px; }
.level--lg .level__name { padding: 0 9px 0 8px; }

/* =================================================================== 5. AVATARS (fans = rounded squares) */
.avatar {
  --av-size: 40px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--av-size); height: var(--av-size);
  border-radius: var(--r-md);
  background: var(--av-bg, var(--av-1)); color: var(--av-fg);
  font-family: var(--font-body); font-weight: var(--fw-semibold);
  font-size: var(--fs-md); line-height: 1; letter-spacing: .02em;
  text-transform: uppercase; user-select: none;
}
.avatar--xs { --av-size: 24px; border-radius: var(--r-sm); font-size: var(--fs-2xs); letter-spacing: 0; }
.avatar--sm { --av-size: 32px; border-radius: var(--r-sm); font-size: var(--fs-xs); }
.avatar--lg { --av-size: 56px; border-radius: var(--r-lg); font-size: var(--fs-lg); }
.avatar--xl { --av-size: 80px; border-radius: var(--r-lg); font-size: var(--fs-2xl); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); }
.avatar--2xl { --av-size: 112px; border-radius: var(--r-lg); font-size: var(--fs-3xl); font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); }
.avatar--c1 { --av-bg: var(--av-1); }
.avatar--c2 { --av-bg: var(--av-2); }
.avatar--c3 { --av-bg: var(--av-3); }
.avatar--c4 { --av-bg: var(--av-4); }
.avatar--c5 { --av-bg: var(--av-5); }
.avatar--c6 { --av-bg: var(--av-6); }
.avatar--you { box-shadow: 0 0 0 2px var(--ring-color, var(--surface-1)), 0 0 0 4px var(--yellow); }

/* wrapper for overlays: level badge (bottom-right) + online dot (top-right) */
.avatar-wrap { position: relative; display: inline-block; flex: none; line-height: 0; vertical-align: middle; }
.avatar-wrap > .level {
  position: absolute; right: -6px; bottom: -5px;
  background-color: var(--ring-color, var(--surface-1));
  background-image: linear-gradient(var(--lv-bg), var(--lv-bg));
  box-shadow: 0 0 0 2px var(--ring-color, var(--surface-1));
}
.avatar-wrap > .dot { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--ring-color, var(--surface-1)); }
.avatar-wrap > .avatar--xs ~ .level, .avatar-wrap > .avatar--sm ~ .level { right: -10px; bottom: -6px; }
.avatar-wrap > .avatar--lg ~ .level, .avatar-wrap > .avatar--xl ~ .level, .avatar-wrap > .avatar--2xl ~ .level { right: -4px; bottom: -4px; }

.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack > .avatar { box-shadow: 0 0 0 2px var(--ring-color, var(--surface-1)); }
.avatar-stack > .avatar + .avatar { margin-left: -6px; }
.avatar-stack > .avatar--xs + .avatar--xs { margin-left: -2px; }
.avatar-stack__more { margin-left: var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* =================================================================== 6. CLUB DISCS · JERSEY TILES · FORM DOTS */
/* clubs = circles. Monogram only — never a crest. */
.club {
  --club-size: 40px;
  --club-bg: var(--club-generic-bg); --club-fg: var(--club-generic-fg); --club-ring: var(--club-generic-ring);
  display: inline-grid; place-items: center; flex: none;
  width: var(--club-size); height: var(--club-size);
  border-radius: var(--r-full);
  background: var(--club-bg); color: var(--club-fg);
  box-shadow: inset 0 0 0 calc(var(--club-size) * .05) var(--club-bg), inset 0 0 0 calc(var(--club-size) * .085) var(--club-ring);
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: calc(var(--club-size) * .34); line-height: 1; letter-spacing: .02em; text-transform: uppercase;
  user-select: none;
}
.club--xs { --club-size: 24px; font-size: var(--fs-2xs); }
.club--sm { --club-size: 32px; font-size: var(--fs-2xs); }
.club--lg { --club-size: 56px; }
.club--xl { --club-size: 72px; }
.club--2xl { --club-size: 96px; }
.club--roma { --club-bg: var(--club-roma-bg); --club-fg: var(--club-roma-fg); --club-ring: var(--club-roma-ring); }
.club--psg { --club-bg: var(--club-psg-bg); --club-fg: var(--club-psg-fg); --club-ring: var(--club-psg-ring); }
.club--mon { --club-bg: var(--club-mon-bg); --club-fg: var(--club-mon-fg); --club-ring: var(--club-mon-ring); }
.club--bol { --club-bg: var(--club-bol-bg); --club-fg: var(--club-bol-fg); --club-ring: var(--club-bol-ring); }
.club--laz { --club-bg: var(--club-laz-bg); --club-fg: var(--club-laz-fg); --club-ring: var(--club-laz-ring); }
.club--scp { --club-bg: var(--club-scp-bg); --club-fg: var(--club-scp-fg); --club-ring: var(--club-scp-ring); }
.club--par { --club-bg: var(--club-par-bg); --club-fg: var(--club-par-fg); --club-ring: var(--club-par-ring); }
.club--juv { --club-bg: var(--club-juv-bg); --club-fg: var(--club-juv-fg); --club-ring: var(--club-juv-ring); }
/* clubs without tokens in tokens.css: colours defined here */
.club--sas { --club-bg: #00A650; --club-fg: #111215; --club-ring: #111215; }
.club--mun { --club-bg: #DA291C; --club-fg: #FFFFFF; --club-ring: #111215; }
.club--udi { --club-bg: #111215; --club-fg: #FFFFFF; --club-ring: #FFFFFF; }
.club--cag { --club-bg: #12285A; --club-fg: #FFFFFF; --club-ring: #C8102E; }
.club--ata { --club-bg: #1E5BA8; --club-fg: #FFFFFF; --club-ring: #111215; }

/* players = number tiles */
.jersey {
  --jersey-size: 48px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--jersey-size); height: var(--jersey-size);
  border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-strong);
  box-shadow: inset 0 -3px 0 var(--border);
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: calc(var(--jersey-size) * .5); line-height: 1; font-variant-numeric: tabular-nums lining-nums;
}
.jersey--sm { --jersey-size: 36px; }
.jersey--lg { --jersey-size: 64px; }
.jersey--xl { --jersey-size: 96px; border-radius: var(--r-lg); }
.jersey--roma { background: var(--brand-red); color: var(--brand-yellow); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.jersey--ink { background: var(--island-surface); color: var(--gray-0); box-shadow: inset 0 -3px 0 var(--brand-yellow); }

/* form guide W / D / L — letter always present */
.form-dots { display: inline-flex; gap: 4px; }
.form-dot {
  display: inline-grid; place-items: center; flex: none;
  width: 24px; height: 24px;
  border: 1.5px solid transparent;
  border-radius: var(--r-xs);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-black);
  font-size: var(--fs-xs); line-height: 1;
}
.form-dot--w { background: var(--surface-inverse); border-color: var(--surface-inverse); color: var(--text-inverse); }
.form-dot--d { background: var(--surface-3); border-color: var(--surface-3); color: var(--text-strong); }
.form-dot--l { border-color: var(--red-text); color: var(--red-text); }
.form-dot--sm { width: 20px; height: 20px; font-size: var(--fs-2xs); }
.form-dot.is-latest { box-shadow: 0 0 0 2px var(--ring-color, var(--surface-1)), 0 0 0 4px var(--yellow); }

/* =================================================================== 7. CARDS · SECTION HEAD */
.card {
  position: relative;
  min-width: 0;
  background: var(--surface-1);
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--r-md);
}
.card--pad { padding: var(--sp-4); }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  min-height: 52px; padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--bw) solid var(--border-subtle);
}
.card__title {
  min-width: 0;
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-lg); line-height: 1.05; letter-spacing: .03em; text-transform: uppercase;
  color: var(--text-strong);
}
.card__body { padding: var(--sp-4); }
.card__foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-top: var(--bw) solid var(--border-subtle);
  font-size: var(--fs-sm); color: var(--text-muted);
}
@media (min-width: 600px) {
  .card--pad, .card__body { padding: var(--sp-5); }
  .card__head, .card__foot { padding-left: var(--sp-5); padding-right: var(--sp-5); }
}
.card--flush { overflow: hidden; }
.card--flush > .ph { border-radius: 0; }
.card--interactive { display: block; transition: border-color var(--dur-fast), background-color var(--dur-fast); }
.card--interactive:hover { border-color: var(--border-strong); }
.card--interactive:focus-visible { outline-offset: 3px; }
/* yellow accent rule (prompts that want action: "Rate the players") */
.card--accent { overflow: hidden; }
.card--accent::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--bw-accent); background: var(--yellow); }
/* live rule on top */
.card--live { overflow: hidden; }
.card--live::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--live); z-index: var(--z-base); }
/* inverse card = <div class="card on-dark"> (tokens re-map automatically); hero-sized islands use --island-surface */
.card.on-dark { border-color: var(--border-subtle); }

/* section head with the red+yellow double-slash marker */
.marker {
  display: inline-block; flex: none;
  width: 13px; height: .74em;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, var(--red) 0 38%, transparent 38% 62%, var(--yellow) 62%);
}
.on-dark .marker, html[data-theme="dark"] .marker { background: linear-gradient(90deg, var(--live) 0 38%, transparent 38% 62%, var(--yellow) 62%); }
.section-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  min-height: 32px;
  margin-bottom: var(--sp-4);
}
.section-head--rule { padding-bottom: var(--sp-3); border-bottom: var(--bw) solid var(--border-subtle); }
.section-head__title {
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 0;
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-xl); line-height: 1; letter-spacing: var(--tracking-display); text-transform: uppercase;
  color: var(--text-strong);
}
.section-head__title::before {
  content: ""; display: inline-block; flex: none;
  width: 13px; height: .74em;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, var(--red) 0 38%, transparent 38% 62%, var(--yellow) 62%);
}
.on-dark .section-head__title::before, html[data-theme="dark"] .section-head__title::before { background: linear-gradient(90deg, var(--live) 0 38%, transparent 38% 62%, var(--yellow) 62%); }
.section-head__meta { font-size: var(--fs-sm); color: var(--text-muted); }
.section-head__actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }

/* =================================================================== 8. PAGE HEAD · STATS STRIP */
.page-head { display: grid; gap: var(--sp-4); margin-bottom: var(--section-gap); }
.page-head__eyebrow { display: flex; align-items: center; gap: var(--sp-2); }
.page-head__main { display: grid; gap: var(--sp-3); min-width: 0; }
.page-head__title { font-size: var(--fs-3xl); }
.page-head__intro { max-width: 62ch; font-size: var(--fs-base); line-height: var(--lh-normal); color: var(--text-muted); }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
@media (min-width: 900px) {
  .page-head__top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-6); }
  .page-head__intro { font-size: var(--fs-lg); }
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--bw);
  overflow: hidden;
  background: var(--border-subtle);
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--r-md);
}
@media (min-width: 600px) { .stats-strip { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
.stats-strip__item { display: grid; align-content: start; gap: 6px; min-width: 0; padding: var(--sp-3) var(--sp-4); background: var(--surface-1); }
.stats-strip__value {
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-2xl); line-height: 1; letter-spacing: .01em;
  color: var(--text-strong); font-variant-numeric: tabular-nums lining-nums;
}
.stats-strip__value small { margin-left: 2px; font-size: .55em; font-weight: var(--fw-bold); color: var(--text-muted); letter-spacing: .04em; }
.stats-strip__label { font-size: var(--fs-xs); line-height: 1.3; color: var(--text-muted); }
.stats-strip__item.is-highlight { box-shadow: inset 0 var(--bw-accent) 0 var(--yellow); }

/* =================================================================== 9. BREADCRUMB · SUBNAV · TABS · SEGMENTED */
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: var(--fs-sm); color: var(--text-muted); }
.breadcrumb li { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumb li + li::before { content: "/"; margin: 0 var(--sp-2); color: var(--text-faint); }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 32px; transition: color var(--dur-fast); }
.breadcrumb a:hover { color: var(--text-strong); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb [aria-current="page"] { color: var(--text-strong); font-weight: var(--fw-medium); }

/* shared underline-tab look: .subnav (links to sibling pages) and .tabs (in-page panels) */
.subnav, .tabs__list {
  display: flex; align-items: stretch; gap: 2px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-bottom: var(--bw) solid var(--border);
}
.subnav::-webkit-scrollbar, .tabs__list::-webkit-scrollbar { display: none; }
.subnav__link, .tabs__tab {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--sp-2); flex: none;
  min-height: var(--tap); padding: 0 var(--sp-4);
  color: var(--text-muted);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-base); line-height: 1; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--dur-fast);
}
.subnav__link .icon, .tabs__tab .icon { width: 18px; height: 18px; }
.subnav__link:hover, .tabs__tab:hover { color: var(--text-strong); }
.subnav__link[aria-current="page"], .tabs__tab[aria-selected="true"] { color: var(--text-strong); }
.subnav__link[aria-current="page"]::after, .tabs__tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: var(--sp-2); right: var(--sp-2); bottom: -1px;
  height: var(--bw-accent); background: var(--yellow);
}
.subnav__link:focus-visible, .tabs__tab:focus-visible { outline-offset: -3px; box-shadow: none; }
.tabs__tab .count { margin-left: 2px; }
/* .subnav--fit: few short links that should all fit on a phone instead of scrolling off-edge */
@media (max-width: 599px) {
  .subnav--fit .subnav__link { flex: 1 1 auto; justify-content: center; padding: 0 var(--sp-2); letter-spacing: .04em; }
  :lang(ka) .subnav--fit .subnav__link { font-size: var(--fs-sm); padding: 0 6px; }   /* Georgian labels are longer */
}
.tabs__panel:focus-visible { outline-offset: 4px; box-shadow: none; }
/* pill variant (secondary switches inside cards) */
.tabs--pill .tabs__list { gap: var(--sp-1); border-bottom: 0; }
.tabs--pill .tabs__tab { min-height: 36px; padding: 0 var(--sp-3); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.tabs--pill .tabs__tab[aria-selected="true"] { background: var(--surface-inverse); border-color: var(--surface-inverse); color: var(--text-inverse); }
.tabs--pill .tabs__tab[aria-selected="true"]::after { display: none; }
.tabs--pill .tabs__tab:focus-visible { outline-offset: 2px; }
/* full-width equal tabs */
.tabs--fill .tabs__tab { flex: 1 1 0; justify-content: center; }

/* segmented control — radio inputs (CSS only) or buttons with aria-pressed inside [data-segmented] */
.segmented {
  display: inline-flex; align-items: stretch; gap: 2px;
  max-width: 100%;
  padding: 3px;
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.segmented__btn, .segmented__item > span {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 auto;
  min-height: 36px; padding: 0 var(--sp-3);
  border-radius: var(--r-xs);
  color: var(--text-muted);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-sm); line-height: 1; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.segmented__btn .icon, .segmented__item .icon { width: 16px; height: 16px; }
a.segmented__btn { text-decoration: none; }
.segmented__item { display: flex; flex: 1 1 auto; position: relative; }
.segmented__item > input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented__btn:hover, .segmented__item:hover > span { color: var(--text-strong); }
.segmented__btn[aria-pressed="true"], .segmented__btn[aria-checked="true"], .segmented__btn[aria-current="true"], .segmented__item > input:checked + span {
  background: var(--surface-inverse); color: var(--text-inverse);
}
.segmented__item > input:focus-visible + span { outline: var(--bw-2) solid var(--focus); outline-offset: 1px; }
.segmented--block { display: flex; width: 100%; }
.segmented--block > * { flex: 1 1 0; min-width: 0; }
.segmented--block .segmented__btn, .segmented--block .segmented__item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.segmented--sm .segmented__btn, .segmented--sm .segmented__item > span { min-height: 30px; padding: 0 10px; font-size: var(--fs-xs); }

/* =================================================================== 10. FORMS */
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.3; color: var(--text-strong); }
.field__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.field__hint { font-size: var(--fs-xs); line-height: 1.4; color: var(--text-muted); }
.field__error { display: none; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--danger); }
.field__error .icon { width: 14px; height: 14px; }
.field.is-invalid .field__error { display: flex; }
.field.is-invalid .input, .field.is-invalid .textarea, .field.is-invalid .select select, [aria-invalid="true"] { border-color: var(--danger); }

.input, .textarea, .select select {
  display: block; width: 100%;
  min-height: var(--tap);
  padding: 0 var(--sp-3);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text-strong);
  font-family: var(--font-body); font-size: 16px; line-height: 1.4;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  -webkit-appearance: none; appearance: none;
}
@media (min-width: 900px) { .input, .textarea, .select select { font-size: var(--fs-base); } }
.input:hover, .textarea:hover, .select select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select select:focus,
.input:focus-visible, .textarea:focus-visible, .select select:focus-visible {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-halo); border-radius: var(--r-sm);
}
.input:disabled, .textarea:disabled, .select select:disabled { background: var(--surface-2); color: var(--text-faint); cursor: not-allowed; }
.input[readonly] { background: var(--surface-2); }
.input--mono { font-family: var(--font-mono); letter-spacing: .06em; }
.textarea { min-height: 96px; padding: 10px var(--sp-3); line-height: var(--lh-normal); resize: vertical; }
.textarea[data-autogrow] { resize: none; overflow: hidden; }
.input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.select { position: relative; display: block; min-width: 0; }
.select select { padding-right: 40px; cursor: pointer; text-overflow: ellipsis; }
.select > .icon { position: absolute; right: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--text-muted); pointer-events: none; }

/* input group: leading icon and/or trailing button */
.input-group { position: relative; display: flex; align-items: stretch; min-width: 0; }
.input-group > .input { flex: 1 1 auto; min-width: 0; }
.input-group__icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--text-muted); pointer-events: none; z-index: var(--z-base); }
.input-group__icon ~ .input { padding-left: 40px; }
.input-group > .input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .btn { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .icon-btn { position: absolute; right: 0; top: 50%; margin-top: calc(var(--tap) / -2); }

/* checkbox / radio: input visually hidden, .check__box draws the control */
.check { position: relative; display: inline-flex; align-items: flex-start; gap: 10px; min-height: var(--tap); padding: 12px 0; font-size: var(--fs-base); line-height: 20px; color: var(--text); cursor: pointer; }
.check > input { position: absolute; left: 0; top: 12px; width: 20px; height: 20px; margin: 0; opacity: 0; cursor: pointer; }
.check__box {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-xs);
  background: var(--surface-1);
  color: var(--on-yellow);
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}
.check__box .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.check:hover .check__box { border-color: var(--text-strong); }
.check > input:checked + .check__box { background: var(--yellow); border-color: var(--yellow); }
.check > input:checked + .check__box .icon { opacity: 1; }
.check > input:focus-visible + .check__box { outline: var(--bw-2) solid var(--focus); outline-offset: 2px; }
.check > input:disabled ~ * { opacity: .5; cursor: not-allowed; }
.check--radio .check__box { border-radius: var(--r-full); }
.check--radio .check__box::after { content: ""; width: 8px; height: 8px; border-radius: inherit; background: var(--on-yellow); opacity: 0; }
.check--radio > input:checked + .check__box::after { opacity: 1; }
.check__text { min-width: 0; }
.check__text small { display: block; margin-top: 2px; font-size: var(--fs-xs); line-height: 1.4; color: var(--text-muted); }

/* switch (squared, per the geometry) */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); font-size: var(--fs-base); color: var(--text); cursor: pointer; }
.switch > input { position: absolute; left: 0; top: 50%; width: 40px; height: 24px; margin: -12px 0 0; opacity: 0; cursor: pointer; }
.switch__track {
  position: relative; flex: none;
  width: 40px; height: 24px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color var(--dur);
}
.switch__track::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px;
  border-radius: var(--r-xs);
  background: var(--surface-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform var(--dur) var(--ease-out);
}
.switch > input:checked + .switch__track { background: var(--yellow); box-shadow: none; }
.switch > input:checked + .switch__track::after { transform: translateX(16px); background: var(--on-yellow); }
.switch > input:focus-visible + .switch__track { outline: var(--bw-2) solid var(--focus); outline-offset: 2px; }
.switch > input:disabled ~ * { opacity: .5; }
.switch--end { justify-content: space-between; width: 100%; }
.switch--end .switch__track { order: 2; }
.switch--end > input { left: auto; right: 0; }

/* range slider with filled track + value bubble (JS keeps --val 0–100) */
.range { --val: 50; position: relative; display: grid; gap: var(--sp-1); min-width: 0; padding-top: 30px; }
.range__input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: var(--tap); margin: 0;
  background: transparent; cursor: pointer;
}
.range__input::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--yellow) 0 calc(var(--val) * 1%), var(--bar-track) calc(var(--val) * 1%) 100%);
}
.range__input::-moz-range-track { height: 6px; border-radius: 3px; background: var(--bar-track); }
.range__input::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--yellow); }
.range__input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -8px;
  border: 2px solid var(--text-strong); border-radius: var(--r-sm);
  background: var(--surface-1);
  transition: transform var(--dur-fast);
}
.range__input::-moz-range-thumb { width: 18px; height: 18px; border: 2px solid var(--text-strong); border-radius: var(--r-sm); background: var(--surface-1); }
.range__input:active::-webkit-slider-thumb { transform: scale(1.1); }
.range__input:focus-visible { outline: none; box-shadow: none; }
.range__input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--focus-halo); border-color: var(--focus); }
.range__input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--focus-halo); }
.range__bubble {
  position: absolute; top: 0;
  left: calc(11px + (100% - 22px) * var(--val) / 100);
  transform: translateX(-50%);
  min-width: 32px; padding: 4px 6px;
  border-radius: var(--r-xs);
  background: var(--surface-inverse); color: var(--text-inverse);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-black);
  font-size: var(--fs-md); line-height: 1; text-align: center; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.range__scale { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* =================================================================== 11. STEPPER (− value +) */
.stepper { display: inline-flex; align-items: center; gap: var(--sp-2); }
.stepper__btn {
  display: inline-grid; place-items: center; flex: none;
  width: var(--tap); height: var(--tap);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text-strong);
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.stepper__btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.stepper__btn:active { background: var(--surface-3); }
.stepper__btn:disabled { opacity: .35; pointer-events: none; }
.stepper__value {
  display: grid; place-items: center;
  min-width: 56px; height: 56px; padding: 0 var(--sp-2);
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--well);
  color: var(--text-strong);
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: 40px; line-height: 1; text-align: center; font-variant-numeric: tabular-nums lining-nums;
}
input.stepper__value { width: 56px; -moz-appearance: textfield; }
input.stepper__value::-webkit-inner-spin-button, input.stepper__value::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper--sm .stepper__btn { width: 36px; height: 36px; }
.stepper--sm .stepper__value { min-width: 44px; height: 44px; font-size: var(--fs-2xl); }
.stepper.is-locked .stepper__btn { display: none; }

/* =================================================================== 12. DROPDOWN · DIALOG · TOAST · TOOLTIP */
.dropdown { position: relative; display: inline-flex; }
.dropdown__menu {
  position: absolute; left: 0; top: calc(100% + 6px);
  z-index: var(--z-dropdown);
  min-width: 220px; max-width: calc(100vw - 2 * var(--gutter));
  padding: 6px;
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  animation: asr-pop var(--dur) var(--ease-out);
  transform-origin: top;
}
.dropdown__menu--end { left: auto; right: 0; }
.dropdown__menu--up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom; }
.dropdown__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: var(--tap); padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: 1.25; text-align: left;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
@media (min-width: 900px) { .dropdown__item { min-height: 40px; } }
.dropdown__item .icon { width: 18px; height: 18px; color: var(--text-muted); }
.dropdown__item:hover, .dropdown__item:focus-visible { background: var(--surface-2); color: var(--text-strong); box-shadow: none; outline-offset: -2px; }
.dropdown__item:hover .icon { color: var(--text-strong); }
.dropdown__item[aria-checked="true"], .dropdown__item.is-active { color: var(--text-strong); font-weight: var(--fw-semibold); }
.dropdown__item[aria-checked="true"]::after, .dropdown__item.is-active::after {
  content: ""; width: 6px; height: 6px; margin-left: auto; border-radius: var(--r-full); background: var(--yellow);
}
.dropdown__item--danger, .dropdown__item--danger .icon { color: var(--danger); }
.dropdown__item small { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); }
.dropdown__sep { margin: 6px -6px; border-top: var(--bw) solid var(--border-subtle); }
.dropdown__label { padding: 8px 10px 4px; }
/* panel variant (notifications, rich popovers) */
.dropdown__menu--panel { width: min(380px, calc(100vw - 16px)); padding: 0; overflow: hidden; }
.dropdown__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 52px; padding: 6px 8px 6px var(--sp-4); border-bottom: var(--bw) solid var(--border-subtle); }
.dropdown__title { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); letter-spacing: .03em; text-transform: uppercase; color: var(--text-strong); }
.dropdown__body { max-height: min(60vh, 480px); overflow-y: auto; overscroll-behavior: contain; }
.dropdown__foot { display: flex; justify-content: center; padding: 6px; border-top: var(--bw) solid var(--border-subtle); }
/* below 600px a panel can become a full-width sheet under the header */
@media (max-width: 599.98px) {
  .dropdown__menu--sheet { position: fixed; left: 8px; right: 8px; top: calc(var(--header-h) + 6px); width: auto; max-width: none; }
}

/* dialog — native <dialog>; bottom sheet below 600px */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 64px);
  padding: 0;
  border: var(--bw) solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; animation: asr-pop var(--dur-slow) var(--ease-out); }
.dialog::backdrop { background: var(--overlay, rgba(11, 11, 13, .6)); }
.dialog--sm { width: min(420px, calc(100vw - 32px)); }
.dialog--lg { width: min(760px, calc(100vw - 32px)); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex: none; min-height: 60px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-5); border-bottom: var(--bw) solid var(--border-subtle); }
.dialog__title { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1.05; letter-spacing: var(--tracking-display); text-transform: uppercase; color: var(--text-strong); }
.dialog__body { flex: 1 1 auto; padding: var(--sp-5); overflow-y: auto; overscroll-behavior: contain; }
.dialog__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); flex: none; padding: var(--sp-3) var(--sp-5); border-top: var(--bw) solid var(--border-subtle); background: var(--surface-1); }
@media (max-width: 599.98px) {
  .dialog, .dialog--sm, .dialog--lg {
    width: 100%; max-height: calc(100dvh - 48px);
    margin: auto 0 0;
    border-bottom: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .dialog[open] { animation: asr-sheet-up var(--dur-slow) var(--ease-out); }
  .dialog__head { position: relative; padding-top: 14px; }
  .dialog__head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--border); }
  .dialog__foot { padding-bottom: calc(var(--sp-3) + var(--safe-bottom)); }
  .dialog__foot > .btn { flex: 1 1 auto; }
}
html.has-modal { overflow: hidden; }

/* toast (region is created by app.js if the shell has none: [data-toast-region]) */
.toast-region {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--sp-3) + var(--safe-bottom));
  z-index: var(--z-toast);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  width: min(420px, calc(100vw - 2 * var(--gutter)));
  transform: translateX(-50%);
  pointer-events: none;
}
@media (min-width: 900px) { .toast-region { bottom: var(--sp-6); } }
.toast {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 48px; padding: 10px 8px 10px 14px;
  border: var(--bw) solid var(--border);
  border-left: var(--bw-accent) solid var(--toast-accent, var(--yellow));
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-strong);
  box-shadow: var(--shadow-pop);
  font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: 1.35;
  pointer-events: auto;
  animation: asr-fade-up var(--dur-slow) var(--ease-out);
  transition: opacity var(--dur), transform var(--dur);
}
.toast > .icon { color: var(--toast-accent, var(--yellow)); }
.toast__text { flex: 1 1 auto; min-width: 0; }
.toast--success { --toast-accent: var(--success); }
.toast--error { --toast-accent: var(--danger); }
.toast--info { --toast-accent: var(--info); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }

/* tooltip (CSS only; content is created on hover so it never causes overflow) */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  z-index: var(--z-dropdown);
  transform: translateX(-50%);
  width: max-content; max-width: 220px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-inverse); color: var(--text-inverse);
  font: var(--fw-medium) var(--fs-xs)/1.35 var(--font-body);
  letter-spacing: 0; text-transform: none; text-align: center; white-space: normal;
  pointer-events: none;
}

/* =================================================================== 13. DATA: progress · level progress · meter · split · stat row · stat tile */
.progress { position: relative; height: 6px; border-radius: 3px; background: var(--bar-track); overflow: hidden; }
.progress__bar { display: block; height: 100%; width: calc(var(--pct, 0) * 1%); border-radius: inherit; background: var(--bar-strong); transition: width var(--dur-slow) var(--ease-out); }
.progress--yellow .progress__bar { background: var(--yellow); }
.progress--red .progress__bar { background: var(--red); }
.progress--success .progress__bar { background: var(--success); }
.progress--sm { height: 4px; border-radius: 2px; }
.progress--lg { height: 10px; border-radius: var(--r-xs); }
/* match progress hairline with HT tick (live cards) */
.progress--match { height: 3px; border-radius: 0; overflow: visible; background: var(--border); }
.progress--match .progress__bar { background: var(--yellow); border-radius: 0; }
.progress--match::after { content: ""; position: absolute; left: 50%; top: -3px; width: 1px; height: 9px; background: var(--border-strong); }

.progress-field { display: grid; gap: var(--sp-2); min-width: 0; }
.progress-field__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); }
.progress-field__head b { color: var(--text-strong); font-variant-numeric: tabular-nums; }

/* level progress: [L3 Regular] ──bar── [L4 Ultra] + labels */
.level-progress { display: grid; gap: var(--sp-2); min-width: 0; }
.level-progress__track { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.level-progress__track > .progress { flex: 1 1 auto; min-width: 40px; }
.level-progress__labels { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.level-progress__labels b { color: var(--text-strong); font-weight: var(--fw-semibold); }
/* compact row ("You · #212 · 860 pts to Ultra") — under Top fans */
.level-progress--compact { gap: 8px; padding: 10px var(--sp-3) 12px; border-radius: var(--r-md); background: var(--surface-2); }
a.level-progress--compact { transition: background-color var(--dur-fast); }
a.level-progress--compact:hover { background: var(--surface-3); }
.level-progress--compact .level-progress__labels { font-size: var(--fs-xs); }
/* large (profile, DMs lock panel) */
.level-progress--lg { gap: var(--sp-3); }
.level-progress--lg .progress { height: 10px; border-radius: var(--r-xs); }
.level-progress--lg .level-progress__labels { font-size: var(--fs-base); }

/* meter: 5 segments (transfer reliability) — data-value="1..5" */
.meter { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.meter__bars { display: inline-flex; gap: 3px; flex: none; }
.meter__bars i { display: block; width: 14px; height: 8px; border-radius: 1px; background: var(--bar-track); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.meter[data-value="1"] .meter__bars i:nth-child(-n+1),
.meter[data-value="2"] .meter__bars i:nth-child(-n+2),
.meter[data-value="3"] .meter__bars i:nth-child(-n+3),
.meter[data-value="4"] .meter__bars i:nth-child(-n+4),
.meter[data-value="5"] .meter__bars i:nth-child(-n+5) { background: var(--bar-strong); box-shadow: none; }
.meter[data-value="5"] .meter__bars i { background: var(--yellow); }
.meter__label { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); white-space: nowrap; }
.meter__label b { color: var(--text-strong); font-variant-numeric: tabular-nums; }

/* split bar: 2- or 3-way percentage (--pct on each segment) */
.split { display: grid; gap: var(--sp-2); min-width: 0; }
.split__bar { display: flex; gap: 2px; height: 8px; }
.split__seg { flex: var(--pct, 1) 1 0; min-width: 3px; border-radius: 1px; background: var(--bar-fill); transition: flex-grow var(--dur-slow) var(--ease-out); }
.split__seg--strong { background: var(--bar-strong); }
.split__seg--yellow { background: var(--yellow); }
.split__seg--red { background: var(--red); }
.split__seg--muted { background: var(--border); }
.split__legend { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); }
.split__legend > * { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.split__legend > :nth-child(2):not(:last-child) { justify-content: center; text-align: center; }
.split__legend > :last-child { justify-content: flex-end; text-align: right; }
.split__legend b { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.split__key { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 1px; background: var(--bar-fill); }
.split__key--strong { background: var(--bar-strong); }
.split__key--yellow { background: var(--yellow); }
.split__key--red { background: var(--red); }

/* stat comparison row: home value · label · away value, bars grow outward from the centre */
.stat-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: baseline;
  gap: 6px var(--sp-3);
  --home-color: var(--bar-fill); --away-color: var(--bar-fill);
}
.stat-row + .stat-row { margin-top: var(--sp-4); }
.stat-row__val { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.stat-row__val:last-of-type { text-align: right; }
.stat-row__val.is-lead { color: var(--text-strong); }
.stat-row__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); text-align: center; }
.stat-row__bars { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.stat-row__bars i { display: block; height: 6px; border-radius: 1px; background: var(--bar-track); position: relative; overflow: hidden; }
.stat-row__bars i::after { content: ""; position: absolute; top: 0; bottom: 0; border-radius: 1px; }
.stat-row__bars i:first-child::after { right: 0; width: calc(var(--home, 50) * 1%); background: var(--home-color); }
.stat-row__bars i:last-child::after { left: 0; width: calc(var(--away, 50) * 1%); background: var(--away-color); }
.stat-row--roma-home { --home-color: var(--red); }
.stat-row--roma-away { --away-color: var(--red); }

/* stat tile */
.stat-tile { display: grid; align-content: start; gap: 6px; min-width: 0; padding: var(--sp-4); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface-1); }
.stat-tile__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.stat-tile__value { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-2xl); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums lining-nums; }
.stat-tile__value small { margin-left: 2px; font-size: .5em; font-weight: var(--fw-bold); letter-spacing: .04em; color: var(--text-muted); }
.stat-tile__sub { font-size: var(--fs-xs); color: var(--text-muted); }
.stat-tile__delta { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.stat-tile__delta .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.stat-tile__delta--up { color: var(--success); }
.stat-tile__delta--down { color: var(--danger); }
.stat-tile__delta--flat { color: var(--text-muted); }
.stat-tile--lg .stat-tile__value { font-size: var(--fs-4xl); }
.stat-tile--accent { box-shadow: inset var(--bw-accent) 0 0 var(--yellow); }

/* =================================================================== 14. POLL */
.poll { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.poll__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2); }
.poll__question {
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-2xl); line-height: 1; letter-spacing: var(--tracking-display); text-transform: uppercase;
  color: var(--text-strong); text-wrap: balance;
}
.poll__context { font-size: var(--fs-sm); color: var(--text-muted); }
.poll__options { display: grid; gap: var(--sp-2); }
.poll--duo .poll__options { grid-template-columns: 1fr 1fr; }
.poll__option {
  --pct: 0;
  position: relative; isolation: isolate;
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  min-height: 48px; padding: 6px var(--sp-3);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text-strong);
  text-align: left; overflow: hidden;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.poll__option::before {
  content: ""; position: absolute; z-index: -1; left: 0; top: 0; bottom: 0;
  width: 0; background: var(--surface-3);
  transition: width var(--dur-slow) var(--ease-out);
}
.poll__option:hover { border-color: var(--text-strong); }
.poll__num {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--border);
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1;
}
.poll__label { flex: 1 1 auto; min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll__label small { display: block; font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--text-muted); }
.poll__pct {
  flex: none; display: none;
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-xl); line-height: 1; font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right;
}
.poll__check {
  display: none; place-items: center; flex: none;
  width: 18px; height: 18px; padding: 2px;
  border-radius: 2px; background: var(--yellow); color: var(--on-yellow); stroke-width: 3;
}
/* results visible: voted, closed, or forced results */
.poll.is-voted .poll__option, .poll--closed .poll__option, .poll--results .poll__option { border-color: var(--border-subtle); }
.poll.is-voted .poll__option::before, .poll--closed .poll__option::before, .poll--results .poll__option::before { width: calc(var(--pct) * 1%); }
.poll.is-voted .poll__pct, .poll--closed .poll__pct, .poll--results .poll__pct { display: block; }
.poll.is-voted .poll__option:hover { border-color: var(--border-strong); }
/* the user's pick: yellow outline + check */
.poll__option.is-mine { border-color: var(--yellow); box-shadow: inset 0 0 0 1px var(--yellow); padding-right: calc(var(--sp-4) + 2px); }
.poll__option.is-mine::before { background: var(--yellow-soft); }
.poll__option.is-mine .poll__check { display: inline-grid; }
.poll__option.is-mine .poll__pct { color: var(--highlight); }
.poll__option.is-mine .poll__num { background: var(--yellow); color: var(--on-yellow); box-shadow: none; }
/* closed poll: winner highlighted, options inert */
.poll--closed .poll__option { cursor: default; }
.poll--closed .poll__option:hover { border-color: var(--border-subtle); }
.poll__option.is-winner::before { background: var(--bar-fill); }
.poll__option.is-winner .poll__label { font-weight: var(--fw-bold); }
.poll__option.is-winner .poll__label { white-space: normal; }
.poll__option.is-winner .poll__label::after { content: "Winner"; display: block; width: max-content; margin-top: 2px; font-weight: var(--fw-semibold); font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.on-dark .poll__option.is-winner .poll__label::after, html[data-theme="dark"] .poll__option.is-winner .poll__label::after { color: var(--text); }
.poll__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.poll__foot b { color: var(--text-strong); font-weight: var(--fw-semibold); }
/* show/hide helpers inside a poll */
.poll:not(.is-voted) .poll__when-voted { display: none; }
.poll.is-voted .poll__when-open { display: none; }
.poll--duo .poll__option { justify-content: space-between; }
.poll--duo .poll__label { flex: 0 1 auto; font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-md); letter-spacing: .08em; text-transform: uppercase; }

/* =================================================================== 15. COUNTDOWN (scoreboard tiles) */
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); width: 100%; max-width: 400px; }
.countdown__unit {
  display: grid; justify-items: center; gap: 8px;
  padding: 12px 0 10px;
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--well);
  text-align: center;
}
.countdown__num {
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-bold);
  font-size: var(--fs-4xl); line-height: .86;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums lining-nums;
}
.countdown__unit--sec .countdown__num { color: var(--accent-num); }
.countdown__label {
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); line-height: 1; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
}
.countdown--sm { gap: 6px; max-width: none; }
.countdown--sm .countdown__unit { gap: 6px; padding: 9px 0 8px; }
.countdown--sm .countdown__num { font-size: var(--fs-2xl); }
.countdown.is-done .countdown__num { color: var(--text-faint); }
/* compact inline form: "2d 04h 15m" */
.countdown-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown-inline .icon { width: 16px; height: 16px; color: var(--text-muted); }

/* =================================================================== 16. MEDIA PLACEHOLDER (no real photos) */
.ph {
  --ph-ratio: 16 / 9;
  position: relative; isolation: isolate;
  display: block; width: 100%;
  aspect-ratio: var(--ph-ratio);
  overflow: hidden;
  border-radius: var(--r-sm);
  background: linear-gradient(155deg, var(--ph-a) 0%, var(--ph-b) 100%);
  color: var(--ph-fg);
}
.ph::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(135deg, var(--ph-pattern) 0 9px, transparent 9px 18px); }
.ph--grid::before { background: linear-gradient(var(--ph-pattern) 1px, transparent 1px) 0 0 / 14px 14px, linear-gradient(90deg, var(--ph-pattern) 1px, transparent 1px) 0 0 / 14px 14px; }
.ph--rings::before { background: repeating-radial-gradient(circle at 80% 120%, var(--ph-pattern) 0 1px, transparent 1px 14px); }
.ph--pitch::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 17%, var(--ph-glyph) 17% calc(17% + 1px), transparent calc(17% + 1px)),
    linear-gradient(90deg, transparent calc(50% - .5px), var(--ph-glyph) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px));
}
.ph--4x3 { --ph-ratio: 4 / 3; }
.ph--3x2 { --ph-ratio: 3 / 2; }
.ph--1x1 { --ph-ratio: 1 / 1; }
.ph--3x4 { --ph-ratio: 3 / 4; }
.ph--21x9 { --ph-ratio: 21 / 9; }
.ph--fill { aspect-ratio: auto; height: 100%; }
.ph__glyph {
  position: absolute; left: 6%; bottom: -.16em;
  font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--ph-glyph-size, 72px); line-height: 1; letter-spacing: -.01em; text-transform: uppercase;
  color: var(--ph-glyph); white-space: nowrap; user-select: none; pointer-events: none;
}
.ph__icon { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; stroke-width: 1.5; opacity: .5; }
.ph__label { position: absolute; right: 10px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--ph-fg); }
.ph__label .icon { width: 14px; height: 14px; }
.ph > .badge, .ph > .chip { position: absolute; left: 12px; top: 12px; }
.ph > .badge { border: 0; background: var(--brand-yellow); color: var(--on-yellow); }
/* variants */
.ph--news { --ph-glyph-size: 96px; }
.ph--hero { --ph-ratio: 21 / 9; --ph-glyph-size: clamp(80px, 12vw, 168px); }
.ph--player { --ph-ratio: 3 / 4; --ph-glyph-size: 140px; background: radial-gradient(120% 80% at 50% 0%, var(--ph-a) 0%, var(--ph-b) 70%); }
.ph--player::before { background: radial-gradient(circle at 50% 38%, var(--ph-pattern) 0 18%, transparent 18.5%), radial-gradient(ellipse 46% 34% at 50% 100%, var(--ph-pattern) 0 98%, transparent 100%); }
.ph--player .ph__glyph { left: 50%; transform: translateX(-50%); bottom: auto; top: 8%; }
/* real photo inside a media frame: <div class="ph ph--photo [ratio] [ph--ribbon]"><img src alt width height loading="lazy" decoding="async"><span class="badge">Match</span></div>
   the frame keeps its aspect ratio; the photo covers it; badges/ribbon/credit sit on top. Pattern + glyph are suppressed. */
.ph--photo { background: var(--island-surface); }
.ph--photo::before { display: none; }
.ph--photo > img { position: absolute; inset: 0; z-index: -1; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--photo-pos, 50% 50%); }
.ph--photo .ph__glyph, .ph--photo .ph__icon { display: none; }
.ph__credit { position: absolute; right: 0; bottom: 0; max-width: 100%; padding: 2px 6px; font-size: var(--fs-xs); line-height: 1.4; color: var(--gray-0); background: color-mix(in srgb, var(--island-bg) 72%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph__credit a { color: inherit; }
/* featured media signature: red/yellow corner ribbon */
.ph--ribbon::after {
  content: ""; position: absolute; right: 0; top: 0; width: 96px; height: 96px;
  background: linear-gradient(225deg, transparent 0 24%, var(--brand-red) 24% 40%, transparent 40% 46%, var(--brand-yellow) 46% 58%, transparent 58%);
}

/* =================================================================== 17. LIST ROWS · TABLE · PAGINATION */
.list { display: grid; min-width: 0; }
.list__row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3);
  min-height: 56px; padding: var(--sp-3) 0;
  border-top: var(--bw) solid var(--border-subtle);
  color: inherit;
}
.list__row:first-child { border-top: 0; }
.list--inset .list__row { padding-left: var(--sp-4); padding-right: var(--sp-4); }
@media (min-width: 600px) { .list--inset .list__row { padding-left: var(--sp-5); padding-right: var(--sp-5); } }
.list--compact .list__row { min-height: 44px; padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
a.list__row, button.list__row { width: 100%; text-align: left; transition: background-color var(--dur-fast); }
a.list__row:hover, button.list__row:hover { background: var(--hover-tint); }
a.list__row:focus-visible, button.list__row:focus-visible { outline-offset: -2px; box-shadow: none; }
.list__row.is-you { background: var(--yellow-soft); box-shadow: inset var(--bw-accent) 0 0 var(--yellow); }
.list__row.is-unread .list__title::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: var(--r-full); background: var(--live); vertical-align: middle; }
.list__lead { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.list__rank { min-width: 18px; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-lg); line-height: 1; text-align: center; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.list__rank.is-top { color: var(--highlight); }
.list__main { display: grid; gap: 3px; min-width: 0; }
.list__title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px var(--sp-2); min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.3; color: var(--text-strong); }
.list__title .username, .list__title > .truncate { min-width: 0; }
.list__meta { font-size: var(--fs-xs); line-height: 1.35; color: var(--text-muted); }
.list__trail { display: grid; justify-items: end; gap: 3px; text-align: right; font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.list__value { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.list__value small { display: block; margin-top: 3px; font-family: var(--font-display); font-stretch: var(--stretch-c); font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: .12em; color: var(--text-muted); }

/* responsive data table — scrolls inside its own container */
.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface-1); }
.table-wrap:focus-visible { outline-offset: 2px; }
.table { width: 100%; min-width: var(--table-min, 520px); font-size: var(--fs-md); color: var(--text); }
.table th {
  padding: 10px var(--sp-3);
  border-bottom: var(--bw) solid var(--border);
  background: var(--surface-1);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; text-align: left;
  color: var(--text-muted); white-space: nowrap;
}
.table td { padding: var(--sp-3); border-top: var(--bw) solid var(--border-subtle); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: var(--hover-tint); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.num { font-weight: var(--fw-semibold); color: var(--text-strong); }
.table tr.is-you td { background: var(--yellow-soft); }
.table tr.is-you td:first-child { box-shadow: inset var(--bw-accent) 0 0 var(--yellow); }
.table--compact td { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.table--compact th { padding-top: 8px; padding-bottom: 8px; }
.table--sticky-first th:first-child, .table--sticky-first td:first-child { position: sticky; left: 0; z-index: var(--z-base); background: var(--surface-1); }
.table caption { padding: var(--sp-3); text-align: left; font-size: var(--fs-sm); color: var(--text-muted); caption-side: bottom; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-1); }
.pagination__btn {
  display: inline-grid; place-items: center;
  min-width: var(--tap); height: var(--tap); padding: 0 var(--sp-2);
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.pagination__btn:hover { border-color: var(--border-strong); color: var(--text-strong); }
.pagination__btn[aria-current="page"] { background: var(--surface-inverse); border-color: var(--surface-inverse); color: var(--text-inverse); }
.pagination__btn[aria-disabled="true"], .pagination__btn:disabled { opacity: .4; pointer-events: none; }
.pagination__gap { min-width: 24px; text-align: center; color: var(--text-faint); }
.load-more { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-4) 0; }
.load-more__meta { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* =================================================================== 18. EMPTY · CALLOUT · DIVIDER · SKELETON */
.empty { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-10) var(--sp-4); text-align: center; }
.empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-muted); }
.empty__icon .icon { width: 28px; height: 28px; stroke-width: 1.75; }
.empty__title { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1.05; text-transform: uppercase; color: var(--text-strong); }
.empty__text { max-width: 44ch; font-size: var(--fs-md); color: var(--text-muted); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-1); }

.callout {
  --callout-accent: var(--border-strong); --callout-bg: var(--surface-1);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: var(--bw) solid var(--border-subtle);
  border-left: var(--bw-accent) solid var(--callout-accent);
  border-radius: var(--r-md);
  background: var(--callout-bg);
}
.callout > .icon, .callout__icon { color: var(--callout-accent); margin-top: 1px; }
.callout__body { display: grid; gap: 4px; min-width: 0; }
.callout__title { font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.35; color: var(--text-strong); }
.callout__text { font-size: var(--fs-md); line-height: var(--lh-normal); color: var(--text); max-width: none; }
.callout__note { font-size: var(--fs-xs); color: var(--text-muted); }
.callout__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.callout > .icon-btn { margin: -8px -10px -8px 0; }
.callout--info { --callout-accent: var(--info); --callout-bg: var(--info-soft); }
.callout--warning { --callout-accent: var(--warning); --callout-bg: var(--warning-soft); }
.callout--success { --callout-accent: var(--success); --callout-bg: var(--success-soft); }
.callout--danger { --callout-accent: var(--danger); --callout-bg: var(--danger-soft); }
.callout--ai { --callout-accent: var(--yellow); --callout-bg: var(--surface-1); }
.callout--ai .callout__icon { color: var(--yellow-text); }
.callout--banner { border-radius: 0; border-left: 0; border-right: 0; border-top: var(--bw-accent) solid var(--callout-accent); }

.divider { margin: var(--sp-4) 0; border: 0; border-top: var(--bw) solid var(--border-subtle); }
.divider--label { display: flex; align-items: center; gap: var(--sp-3); border: 0; font-size: var(--fs-xs); color: var(--text-muted); }
.divider--label::before, .divider--label::after { content: ""; flex: 1 1 auto; border-top: var(--bw) solid var(--border-subtle); }

.skeleton {
  display: block; min-height: 1em;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: asr-shimmer 1.4s ease infinite;
}
.skeleton--text { height: .9em; margin: .3em 0; }
.skeleton--title { height: 1.4em; width: 60%; }

/* =================================================================== 19. STYLEGUIDE-ONLY HELPERS (.sg-*) — not for product pages */
.sg-bar { position: sticky; top: 0; z-index: var(--z-header); background: var(--island-bg); border-bottom: var(--bw) solid var(--border-subtle); }
.sg-bar::before { content: ""; display: block; height: var(--header-hairline); background: var(--brand-yellow); }
.sg-bar__in { display: flex; align-items: center; gap: var(--sp-4); max-width: var(--content-max); height: 56px; margin: 0 auto; padding: 0 var(--gutter); }
.sg-wordmark { font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black); font-size: var(--fs-xl); line-height: 1; letter-spacing: .035em; color: var(--text-strong); }
.sg-wordmark span { color: var(--yellow); }
.sg-main { max-width: var(--content-max); margin: 0 auto; padding: var(--sp-6) var(--gutter) var(--sp-16); }
.sg-toc { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-10); }
.sg-section { margin-top: var(--sp-12); scroll-margin-top: calc(var(--header-h) + var(--sp-4)); }
.sg-section > .section-head { margin-bottom: var(--sp-2); }
.sg-lede { margin-bottom: var(--sp-6); font-size: var(--fs-md); color: var(--text-muted); }
.sg-demo { display: grid; align-content: start; gap: 0; margin-top: var(--sp-4); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface-1); overflow: hidden; }
.sg-demo__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: var(--bw) solid var(--border-subtle); }
.sg-demo__title { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-strong); }
.sg-demo__note { font-size: var(--fs-sm); color: var(--text-muted); max-width: 80ch; }
.sg-demo__note code, .sg-code { font-family: var(--font-mono); font-size: .92em; padding: 1px 4px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--text-strong); }
.sg-demo__body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); min-width: 0; padding: var(--sp-5) var(--sp-4); }
.sg-demo__body--stack { display: grid; gap: var(--sp-4); align-items: start; }
.sg-demo__body--canvas { background: var(--bg); }
.sg-demo__body > * { min-width: 0; }
.sg-island { padding: var(--sp-5) var(--sp-4); background: var(--island-surface); }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); width: 100%; }
.sg-swatch { display: grid; overflow: hidden; border: var(--bw) solid var(--border-subtle); border-radius: var(--r-sm); background: var(--surface-1); }
.sg-swatch__chip { height: 56px; background: var(--sw); border-bottom: var(--bw) solid var(--border-subtle); }
.sg-swatch__name { padding: 8px 10px 0; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-strong); overflow-wrap: anywhere; }
.sg-swatch__role { padding: 2px 10px 10px; font-size: var(--fs-xs); color: var(--text-muted); }
.sg-type { display: grid; gap: var(--sp-3); width: 100%; }
.sg-type__row { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: baseline; gap: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: var(--bw) solid var(--border-subtle); }
.sg-type__row:last-child { border-bottom: 0; }
.sg-type__meta { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.sg-scale { display: grid; gap: var(--sp-2); width: 100%; }
.sg-scale__row { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.sg-scale__bar { display: block; width: var(--w); height: 12px; border-radius: 1px; background: var(--yellow); }
.sg-radius { display: grid; place-items: center; width: 72px; height: 72px; border: var(--bw-2) solid var(--text-strong); border-radius: var(--r); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.sg-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--sp-2); width: 100%; }
.sg-icons li { display: grid; justify-items: center; gap: 6px; padding: var(--sp-3) var(--sp-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-sm); font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-muted); text-align: center; overflow-wrap: anywhere; }
.sg-icons .icon { color: var(--text-strong); }
.sg-w { width: 100%; max-width: var(--sg-w, 420px); }
.sg-fs { font-size: var(--sg-fs); line-height: .9; }
.sg-demo__body > .grid { flex: 1 1 100%; }
