/* iAtletismo — Portal público y portal de desarrolladores (FedHub).
   Sistema visual compartido con la consola de competencias: mismos NOMBRES de tokens en ambas hojas
   (ver iathletix/web/css/app.css). Oscuro por defecto («panel glass»): el bloque :root lleva los valores
   oscuros; el tema claro, completo, entra por prefers-color-scheme o por [data-theme="light"].
   Sin recursos externos: fuentes del sistema. */

/* ------------------------------------------------------------------ tokens (oscuro, por defecto) */
:root {
  color-scheme: dark;
  /* superficies: fondo profundo + paneles «glass» (borde translúcido y brillo de 1 px arriba) */
  --bg: #0E121A;
  --bg-depth: radial-gradient(1100px 560px at 12% -12%, rgba(48, 208, 240, 0.10), transparent 62%), radial-gradient(900px 520px at 100% 0%, rgba(30, 111, 217, 0.14), transparent 58%), radial-gradient(760px 420px at 50% 112%, rgba(25, 181, 166, 0.07), transparent 60%);
  --surface: #14181F;
  --surface-2: #1A2130;
  --surface-3: #232B37;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-bd: rgba(255, 255, 255, 0.08);
  --glass-hi: rgba(255, 255, 255, 0.14);
  /* texto y separadores */
  --ink: #F3F6FA;
  --ink-2: #C5CFDA;
  --muted: #8A98A8;
  --line: #232B37;
  --line-strong: #34404E;
  /* marca (verde del portal) e interacción (cian) */
  --brand: #3BB88A;
  --brand-ink: #5FD0A4;
  --accent: #30D0F0;
  --accent-ink: #5ADCF5;
  --accent-soft: rgba(48, 208, 240, 0.14);
  --accent-grad: linear-gradient(135deg, #1E6FD9 0%, #0E7C8F 100%);
  --accent-glow: 0 0 0 1px rgba(48, 208, 240, 0.45), 0 0 22px rgba(48, 208, 240, 0.22);
  --accent-2: #F08A4B;
  --on-accent: #06131A;
  --focus: #30D0F0;
  /* semánticos: color, fondo translúcido y borde al 35 % */
  --ok: #3DDC84;    --ok-bg: rgba(61, 220, 132, 0.14);   --ok-bd: rgba(61, 220, 132, 0.35);
  --neg: #F06464;   --neg-bg: rgba(240, 100, 100, 0.14); --neg-bd: rgba(240, 100, 100, 0.35);
  --warn: #F5B700;  --warn-bg: rgba(245, 183, 0, 0.14);  --warn-bd: rgba(245, 183, 0, 0.35);
  --info: #4FB3FF;  --info-bg: rgba(79, 179, 255, 0.14); --info-bd: rgba(79, 179, 255, 0.35);
  --live: #3DDC84;   --live-ink: #5CE69A;
  --danger: #F06464; --danger-ink: #F58A8A; --danger-soft: rgba(240, 100, 100, 0.12);
  --info-ink: #7CC8FF;
  --warn-ink: #F5B700;
  --input-bg: rgba(8, 12, 18, 0.55);
  --overlay: rgba(4, 8, 14, 0.62);

  /* píldoras del portal (PB/SB/Q, estados, métodos HTTP) */
  --pill-neutral-bg: rgba(197, 207, 218, 0.10); --pill-neutral-fg: #C5CFDA; --pill-neutral-bd: rgba(197, 207, 218, 0.28);
  --pill-pb-bg: rgba(240, 138, 75, 0.14);       --pill-pb-fg: #F7B183;      --pill-pb-bd: rgba(240, 138, 75, 0.35);
  --pill-sb-bg: rgba(79, 179, 255, 0.14);       --pill-sb-fg: #8FD8FB;      --pill-sb-bd: rgba(79, 179, 255, 0.35);
  --pill-q-bg: rgba(61, 220, 132, 0.14);        --pill-q-fg: #86EFAC;       --pill-q-bd: rgba(61, 220, 132, 0.35);
  --pill-danger-bg: rgba(240, 100, 100, 0.14);  --pill-danger-fg: #F7A3A3;  --pill-danger-bd: rgba(240, 100, 100, 0.35);
  --pill-warn-bg: rgba(245, 183, 0, 0.14);      --pill-warn-fg: #F9CF5A;    --pill-warn-bd: rgba(245, 183, 0, 0.35);
  --pill-ok-bg: rgba(61, 220, 132, 0.14);       --pill-ok-fg: #7FE8B0;      --pill-ok-bd: rgba(61, 220, 132, 0.35);
  --pill-accent-bg: rgba(48, 208, 240, 0.16);   --pill-accent-fg: #5ADCF5;  --pill-accent-bd: rgba(48, 208, 240, 0.45);

  /* visor JSON */
  --json-key: #5ADCF5; --json-str: #F7B183; --json-num: #93C5FD; --json-lit: #C4B5FD; --json-punc: #8A98A8;

  /* hero de la portada: panel glass con halos azul/cian */
  --hero-bg: radial-gradient(620px 320px at 88% -10%, rgba(48, 208, 240, 0.20), transparent 62%), radial-gradient(520px 340px at 8% 110%, rgba(30, 111, 217, 0.26), transparent 62%), linear-gradient(180deg, #161D2A 0%, #12161E 100%);
  --hero-ink: #F3F6FA;
  --hero-muted: #B4C3D1;
  --hero-tile: rgba(255, 255, 255, 0.05);
  --hero-tile-bd: rgba(255, 255, 255, 0.10);
  --hero-btn-bg: linear-gradient(135deg, #1E6FD9 0%, #0E7C8F 100%);
  --hero-btn-fg: #FFFFFF;
  --hero-btn-hover: linear-gradient(135deg, #1E6FD9 0%, #0E7C8F 100%);
  --hero-accent: #30D0F0;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 1px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 12px 36px rgba(0, 0, 0, 0.50), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.50), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 1px rgba(48, 208, 240, 0.35), 0 0 28px rgba(48, 208, 240, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --font-ui: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --header-h: 60px;
}

/* ------------------------------------------------------------------ tokens (claro) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #EEF2F7;
    --bg-depth: radial-gradient(1100px 560px at 12% -12%, rgba(14, 124, 143, 0.12), transparent 62%), radial-gradient(900px 520px at 100% 0%, rgba(30, 111, 217, 0.10), transparent 58%);
    --surface: #FFFFFF;
    --surface-2: #F3F6FA;
    --surface-3: #E6ECF3;
    --glass: rgba(255, 255, 255, 0.72);
    --glass-bd: rgba(15, 23, 34, 0.10);
    --glass-hi: rgba(255, 255, 255, 0.90);
    --ink: #0F1722;
    --ink-2: #2E3C4D;
    --muted: #5B6979;
    --line: #D8DFE8;
    --line-strong: #B9C4D1;
    --brand: #0F6E4F;
    --brand-ink: #0B5A40;
    --accent: #0E7C8F;
    --accent-ink: #0A6373;
    --accent-soft: rgba(14, 124, 143, 0.12);
    --accent-grad: linear-gradient(135deg, #1E6FD9 0%, #0E7C8F 100%);
    --accent-glow: 0 0 0 1px rgba(14, 124, 143, 0.45), 0 0 18px rgba(14, 124, 143, 0.20);
    --accent-2: #C2410C;
    --on-accent: #FFFFFF;
    --focus: #0E7C8F;
    --ok: #15803D;    --ok-bg: rgba(21, 128, 61, 0.12);    --ok-bd: rgba(21, 128, 61, 0.35);
    --neg: #C62828;   --neg-bg: rgba(198, 40, 40, 0.10);   --neg-bd: rgba(198, 40, 40, 0.35);
    --warn: #B45309;  --warn-bg: rgba(180, 83, 9, 0.12);   --warn-bd: rgba(180, 83, 9, 0.35);
    --info: #0369A1;  --info-bg: rgba(3, 105, 161, 0.10);  --info-bd: rgba(3, 105, 161, 0.35);
    --live: #15803D;   --live-ink: #166534;
    --danger: #C62828; --danger-ink: #B42318; --danger-soft: rgba(198, 40, 40, 0.08);
    --info-ink: #075985;
    --warn-ink: #8A3C0C;
    --input-bg: #FFFFFF;
    --overlay: rgba(15, 23, 34, 0.45);
    --pill-neutral-bg: #EEF2F6; --pill-neutral-fg: #3B4857; --pill-neutral-bd: #D3DBE4;
    --pill-pb-bg: #FFEDD5;      --pill-pb-fg: #9A3412;      --pill-pb-bd: #FDBA74;
    --pill-sb-bg: #E0F2FE;      --pill-sb-fg: #075985;      --pill-sb-bd: #7DD3FC;
    --pill-q-bg: #DCFCE7;       --pill-q-fg: #166534;       --pill-q-bd: #86EFAC;
    --pill-danger-bg: #FBEDEC;  --pill-danger-fg: #8F1F17;  --pill-danger-bd: #EFC4C0;
    --pill-warn-bg: #FEF3C7;    --pill-warn-fg: #8A3C0C;    --pill-warn-bd: #F6CF6A;
    --pill-ok-bg: #DDF3EA;      --pill-ok-fg: #0B5A40;      --pill-ok-bd: #9FD2BC;
    --pill-accent-bg: #DDF3F7;  --pill-accent-fg: #0A6373;  --pill-accent-bd: #7FD0E0;
    --json-key: #0A6373; --json-str: #9A3412; --json-num: #1D4ED8; --json-lit: #6D28D9; --json-punc: #5B6979;
    --hero-bg: radial-gradient(620px 320px at 88% -10%, rgba(48, 208, 240, 0.16), transparent 62%), radial-gradient(520px 340px at 8% 110%, rgba(30, 111, 217, 0.30), transparent 62%), linear-gradient(135deg, #0A2E52 0%, #0C4F66 55%, #0D6372 100%);
    --hero-ink: #F6FBFD;
    --hero-muted: #F4F9FB; /* casi blanco: ≥ 4,5:1 sobre el tile iluminado por el halo cian (medido en píxel) */
    --hero-tile: rgba(255, 255, 255, 0.10);
    --hero-tile-bd: rgba(255, 255, 255, 0.26);
    --hero-btn-bg: #FFFFFF;
    --hero-btn-fg: #0A4F5C;
    --hero-btn-hover: #DDF3F7;
    --hero-accent: #5ADCF5;
    --shadow-1: 0 1px 2px rgba(15, 23, 34, 0.06), 0 1px 1px rgba(15, 23, 34, 0.04);
    --shadow-2: 0 8px 28px rgba(15, 23, 34, 0.14), 0 2px 6px rgba(15, 23, 34, 0.08);
    --shadow: 0 8px 28px rgba(15, 23, 34, 0.14), 0 2px 6px rgba(15, 23, 34, 0.08);
    --shadow-glow: 0 0 0 1px rgba(14, 124, 143, 0.35), 0 0 24px rgba(14, 124, 143, 0.16);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #EEF2F7;
  --bg-depth: radial-gradient(1100px 560px at 12% -12%, rgba(14, 124, 143, 0.12), transparent 62%), radial-gradient(900px 520px at 100% 0%, rgba(30, 111, 217, 0.10), transparent 58%);
  --surface: #FFFFFF;
  --surface-2: #F3F6FA;
  --surface-3: #E6ECF3;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-bd: rgba(15, 23, 34, 0.10);
  --glass-hi: rgba(255, 255, 255, 0.90);
  --ink: #0F1722;
  --ink-2: #2E3C4D;
  --muted: #5B6979;
  --line: #D8DFE8;
  --line-strong: #B9C4D1;
  --brand: #0F6E4F;
  --brand-ink: #0B5A40;
  --accent: #0E7C8F;
  --accent-ink: #0A6373;
  --accent-soft: rgba(14, 124, 143, 0.12);
  --accent-grad: linear-gradient(135deg, #1E6FD9 0%, #0E7C8F 100%);
  --accent-glow: 0 0 0 1px rgba(14, 124, 143, 0.45), 0 0 18px rgba(14, 124, 143, 0.20);
  --accent-2: #C2410C;
  --on-accent: #FFFFFF;
  --focus: #0E7C8F;
  --ok: #15803D;    --ok-bg: rgba(21, 128, 61, 0.12);    --ok-bd: rgba(21, 128, 61, 0.35);
  --neg: #C62828;   --neg-bg: rgba(198, 40, 40, 0.10);   --neg-bd: rgba(198, 40, 40, 0.35);
  --warn: #B45309;  --warn-bg: rgba(180, 83, 9, 0.12);   --warn-bd: rgba(180, 83, 9, 0.35);
  --info: #0369A1;  --info-bg: rgba(3, 105, 161, 0.10);  --info-bd: rgba(3, 105, 161, 0.35);
  --live: #15803D;   --live-ink: #166534;
  --danger: #C62828; --danger-ink: #B42318; --danger-soft: rgba(198, 40, 40, 0.08);
  --info-ink: #075985;
  --warn-ink: #8A3C0C;
  --input-bg: #FFFFFF;
  --overlay: rgba(15, 23, 34, 0.45);
  --pill-neutral-bg: #EEF2F6; --pill-neutral-fg: #3B4857; --pill-neutral-bd: #D3DBE4;
  --pill-pb-bg: #FFEDD5;      --pill-pb-fg: #9A3412;      --pill-pb-bd: #FDBA74;
  --pill-sb-bg: #E0F2FE;      --pill-sb-fg: #075985;      --pill-sb-bd: #7DD3FC;
  --pill-q-bg: #DCFCE7;       --pill-q-fg: #166534;       --pill-q-bd: #86EFAC;
  --pill-danger-bg: #FBEDEC;  --pill-danger-fg: #8F1F17;  --pill-danger-bd: #EFC4C0;
  --pill-warn-bg: #FEF3C7;    --pill-warn-fg: #8A3C0C;    --pill-warn-bd: #F6CF6A;
  --pill-ok-bg: #DDF3EA;      --pill-ok-fg: #0B5A40;      --pill-ok-bd: #9FD2BC;
  --pill-accent-bg: #DDF3F7;  --pill-accent-fg: #0A6373;  --pill-accent-bd: #7FD0E0;
  --json-key: #0A6373; --json-str: #9A3412; --json-num: #1D4ED8; --json-lit: #6D28D9; --json-punc: #5B6979;
  --hero-bg: radial-gradient(620px 320px at 88% -10%, rgba(48, 208, 240, 0.16), transparent 62%), radial-gradient(520px 340px at 8% 110%, rgba(30, 111, 217, 0.30), transparent 62%), linear-gradient(135deg, #0A2E52 0%, #0C4F66 55%, #0D6372 100%);
  --hero-ink: #F6FBFD;
  --hero-muted: #F4F9FB; /* casi blanco: ≥ 4,5:1 sobre el tile iluminado por el halo cian (medido en píxel) */
  --hero-tile: rgba(255, 255, 255, 0.10);
  --hero-tile-bd: rgba(255, 255, 255, 0.26);
  --hero-btn-bg: #FFFFFF;
  --hero-btn-fg: #0A4F5C;
  --hero-btn-hover: #DDF3F7;
  --hero-accent: #5ADCF5;
  --shadow-1: 0 1px 2px rgba(15, 23, 34, 0.06), 0 1px 1px rgba(15, 23, 34, 0.04);
  --shadow-2: 0 8px 28px rgba(15, 23, 34, 0.14), 0 2px 6px rgba(15, 23, 34, 0.08);
  --shadow: 0 8px 28px rgba(15, 23, 34, 0.14), 0 2px 6px rgba(15, 23, 34, 0.08);
  --shadow-glow: 0 0 0 1px rgba(14, 124, 143, 0.35), 0 0 24px rgba(14, 124, 143, 0.16);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-depth);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; color: var(--ink); }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 0.75em; }
code, kbd, pre, samp { font-family: var(--font-num); font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
/* Barras de desplazamiento finas (recetas compartidas con la consola) */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }
[tabindex="-1"]:focus-visible { outline: none; }
h1[tabindex="-1"]:focus-visible { outline: 2px dashed var(--focus); outline-offset: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none; transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

.num, .mono {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.num { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ layout */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--glass-bd);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.site-header::before { content: ""; display: block; height: 2px; background: linear-gradient(90deg, var(--brand) 0 70%, var(--accent) 70% 100%); opacity: 0.9; }
.header-inner { display: flex; align-items: center; gap: 14px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-name span { color: var(--brand); }
.brand-sub { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em; }

/* Navegación principal: píldoras-pestaña con icono (como la barra superior de la referencia); la activa lleva halo cian. */
.main-nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; width: max-content; }
.main-nav a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; color: var(--ink-2);
  border: 1px solid transparent; text-decoration: none; font-weight: 600; font-size: 0.9rem; white-space: nowrap; line-height: 1.3;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.main-nav a .nav-ico { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.9; }
.main-nav a:hover { background: var(--glass); border-color: var(--glass-bd); color: var(--ink); }
.main-nav a[aria-current="page"] {
  color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-bd));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 16px color-mix(in srgb, var(--accent) 22%, transparent);
}
.main-nav a[aria-current="page"] .nav-ico { opacity: 1; }

/* Buscador glass de la cabecera con atajo Ctrl K (enfoca la búsqueda de atletas). */
.header-search { position: relative; display: flex; align-items: center; width: 250px; flex: 0 1 250px; min-width: 0; }
.header-search .search-ico { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.header-search input[type="search"] {
  height: 40px; width: 100%; padding: 0 66px 0 36px; border-radius: 999px; font-size: 0.88rem;
  background: var(--input-bg); border: 1px solid var(--glass-bd); box-shadow: inset 0 1px 0 var(--glass-hi);
}
.header-search input[type="search"]:hover { border-color: var(--line-strong); }
.header-search input[type="search"]:focus-visible { border-color: var(--accent); box-shadow: var(--accent-glow); }
.header-search input[type="search"]:not(:placeholder-shown) + .kbd-chip { display: none; }
.kbd-chip {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none;
  font-family: var(--font-ui); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; color: var(--muted);
  padding: 1px 6px; border-radius: 6px; border: 1px solid var(--glass-bd); background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-hi);
}
.icon-btn.search-btn { display: none; }

.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.env-pill { white-space: nowrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 9px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-bd); background: var(--glass); color: var(--ink-2); cursor: pointer;
  font: inherit; font-size: 0.88rem; box-shadow: inset 0 1px 0 var(--glass-hi); transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
/* El icono muestra el tema vigente: luna en oscuro (por defecto), sol en claro. */
.theme-btn .icon-sun { display: none; }
:root[data-theme="light"] .theme-btn .icon-moon { display: none; }
:root[data-theme="light"] .theme-btn .icon-sun { display: inline; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .icon-moon { display: none; }
  :root:not([data-theme="dark"]) .theme-btn .icon-sun { display: inline; }
}

.mock-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--pill-warn-bg); color: var(--pill-warn-fg); border: 1px dashed var(--pill-warn-bd);
  font-size: 0.76rem; font-weight: 650; white-space: nowrap;
}
.mock-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ≤ 960 px: la navegación es un cajón glass desde la izquierda (botón de menú; Escape y clic fuera cierran). */
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  /* sin backdrop-filter en la cabecera: crearía un bloque contenedor para el cajón fijo */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--surface) 94%, transparent); }
  .main-nav { display: none; position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(320px, 100vw); }
  .main-nav.open { display: block; }
  .main-nav.open::before { content: ""; position: fixed; inset: 0; background: var(--overlay); z-index: -1; }
  .main-nav ul {
    flex-direction: column; gap: 4px; height: 100%; padding: 18px 14px 20px; overflow-y: auto;
    background: color-mix(in srgb, var(--surface) 96%, transparent); border-right: 1px solid var(--glass-bd);
    box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-2); animation: drawer-in-left 0.2s ease-out;
  }
  .main-nav ul::before { content: "Secciones"; display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 6px 12px 10px; }
  .main-nav a { display: flex; padding: 11px 12px; font-size: 1rem; border-radius: var(--radius-sm); }
  .main-nav a .nav-ico { display: inline-block; width: 18px; height: 18px; }
  .header-inner { position: static; }
  .site-header { position: sticky; }
}
@keyframes drawer-in-left { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 600px) {
  /* the iAtletismo wordmark is in the platform bar: the header says which site this is */
  .brand-name { display: none; }
  .brand-sub { font-size: 0.95rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* la marca cede ancho (con elipsis) antes de que las herramientas desborden los 390 px */
  .brand { flex-shrink: 1; min-width: 0; }
  .brand-text { min-width: 0; }
  .header-tools .env-pill { display: none; }
}

main { flex: 1 0 auto; padding: 28px 0 56px; }
main:focus { outline: none; }

/* ------------------------------------------------------------------ iAtletismo platform bar */
/* Same markup above the competitions console (iathletix/web): wordmark + «Portal» / «Consola de competencias». */
.platform-bar { background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-bottom: 1px solid var(--glass-bd); font-size: 0.84rem; }
.platform-inner { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-height: 36px; }
.platform-brand { font-weight: 800; color: var(--ink); white-space: nowrap; letter-spacing: 0.01em; }
.platform-brand span { color: var(--brand-ink); }
.platform-nav { display: flex; gap: 2px; margin-left: auto; }
.platform-nav a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.platform-nav a:hover { color: var(--ink); background: var(--glass); }
.platform-nav a[aria-current="page"] { color: var(--accent-ink); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 440px) { .platform-bar { font-size: 0.78rem; } .platform-nav a { padding: 0 7px; } }
.console-card-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.console-card-inner > div { flex: 1 1 320px; min-width: 0; }
.console-card-inner .btn { flex: 0 0 auto; }

.site-footer { border-top: 1px solid var(--glass-bd); background: color-mix(in srgb, var(--surface) 70%, transparent); box-shadow: inset 0 1px 0 var(--glass-hi); color: var(--muted); font-size: 0.85rem; }
.site-footer strong { color: var(--ink); }
.site-footer strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 8px color-mix(in srgb, var(--brand) 60%, transparent); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; padding-top: 18px; padding-bottom: 18px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--accent-ink); text-decoration: underline; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ------------------------------------------------------------------ page header */
.breadcrumbs { font-size: 0.84rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin-bottom: 6px; overflow-wrap: anywhere; }
.page-head .lead { color: var(--muted); max-width: 72ch; margin: 0; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 0.9rem; align-items: center; }
.meta-line > * { display: inline-flex; gap: 6px; align-items: center; }

/* Subnavegación (desarrolladores): píldoras-pestaña glass, la misma receta que .tabs y que las pestañas de la consola. */
.subnav { display: flex; gap: 4px; padding: 4px; width: fit-content; max-width: 100%; margin-bottom: 24px; border: 1px solid var(--glass-bd); border-radius: 999px; background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-hi); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 14px; border-radius: 999px; border: 1px solid transparent; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; white-space: nowrap; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.subnav a:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-bd)); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 12px color-mix(in srgb, var(--accent) 20%, transparent); }

/* ------------------------------------------------------------------ cards & sections */
/* Superficie «glass»: panel translúcido, borde fino, brillo de 1 px arriba. Misma receta en la consola. */
.card { background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--glass-bd); border-radius: var(--radius-lg); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-1); }
.card.is-active, .card.glow { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-bd)); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-glow); }
.card-pad { padding: 18px 20px; }
@media (max-width: 600px) { .card-pad { padding: 14px 14px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--glass-bd); }
.card-head h2, .card-head h3 { margin: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--glass-bd); }
@media (max-width: 600px) { .card-head, .card-foot { padding: 12px 14px; } }
.section { margin-top: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.callout { border: 1px solid var(--glass-bd); border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--surface) 86%, transparent); border-radius: var(--radius-sm); padding: 12px 16px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.callout.danger { border-left-color: var(--danger); background: var(--neg-bg); border-color: var(--neg-bd); }
.callout.info { border-left-color: var(--info); }
.callout p:last-child { margin-bottom: 0; }

dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 0.86rem; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
/* Lista clave/valor con líneas tenues y valores semánticos (.is-pos/.is-neg/.is-info); misma receta en la consola. */
dl.kv.kv-lines { gap: 0; }
dl.kv.kv-lines dt, dl.kv.kv-lines dd { padding: 8px 0; border-bottom: 1px solid var(--glass-bd); }
dl.kv.kv-lines dd { text-align: right; font-variant-numeric: tabular-nums; }
dl.kv.kv-lines dt:nth-last-of-type(1), dl.kv.kv-lines dd:last-of-type { border-bottom: 0; }
.is-pos { color: var(--live-ink); }
.is-neg { color: var(--danger-ink); }
.is-info { color: var(--info-ink); }
/* Mini-tiles clave/valor (base de las tarjetas «agente»): rejilla de 2 tiles glass. */
.mini-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mini-tile { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--glass-bd); box-shadow: inset 0 1px 0 var(--glass-hi); min-width: 0; }
.mini-tile .k { display: block; color: var(--muted); font-size: 0.74rem; }
.mini-tile .v { display: block; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Icono en tile (tarjetas de estadística y de «agente»). */
.icon-tile { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--glass); border: 1px solid var(--glass-bd); box-shadow: inset 0 1px 0 var(--glass-hi); color: var(--accent-ink); flex-shrink: 0; }
.icon-tile svg, .icon-tile .ico { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ hero */
.hero { background: var(--hero-bg); color: var(--hero-ink); border: 1px solid var(--glass-bd); border-radius: var(--radius-lg); padding: 36px 36px 28px; position: relative; overflow: hidden; box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-1); }
.hero::after {
  content: ""; position: absolute; right: -120px; top: -140px; width: 460px; height: 460px; border-radius: 50%;
  border: 26px solid rgba(255,255,255,0.045); box-shadow: 0 0 0 26px rgba(255,255,255,0.03), 0 0 0 52px rgba(255,255,255,0.02);
  pointer-events: none;
}
.hero h1 { color: var(--hero-ink); font-size: 2.1rem; max-width: 22ch; margin-bottom: 8px; }
.hero p.lead { color: var(--hero-muted); max-width: 60ch; font-size: 1.02rem; }
.hero-search { margin-top: 18px; max-width: 640px; position: relative; z-index: 1; }
.hero-search .search-field { display: flex; gap: 8px; }
.hero-search .search-field input { height: 46px; font-size: 1rem; border-color: var(--hero-tile-bd); background: var(--input-bg); } /* --input-bg: translúcido oscuro / blanco en claro (sobre el panel oscuro del hero) */
.hero-search .btn { height: 46px; }
.hero .suggestions { margin-top: 8px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink); border: 1px solid var(--glass-bd); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); overflow: hidden; }
.hero .suggestions ul { list-style: none; margin: 0; padding: 4px 0; }
.hero .suggestions a { display: flex; gap: 10px; justify-content: space-between; padding: 9px 14px; color: var(--ink); text-decoration: none; }
.hero .suggestions a:hover, .hero .suggestions a:focus-visible { background: var(--surface-2); }
.hero .suggestions .s-meta { color: var(--muted); font-size: 0.84rem; text-align: right; }
/* Fila de tarjetas de estadística (icono en tile, etiqueta, valor grande, mini-gráfico SVG). */
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 26px 0 0; position: relative; z-index: 1; }
.hero-stat {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 2px 12px; align-items: center;
  background: var(--hero-tile); border: 1px solid var(--hero-tile-bd); border-radius: var(--radius); padding: 12px 14px 10px; min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-stat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--hero-tile-bd)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 20px color-mix(in srgb, var(--accent) 16%, transparent); }
.hero-stat .icon-tile { grid-row: 1 / 3; color: var(--hero-accent); background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.hero-stat .l { grid-column: 2; grid-row: 1; font-size: 0.8rem; color: var(--hero-muted); margin: 0; }
.hero-stat .v { grid-column: 2; grid-row: 2; font-size: 2.1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--hero-ink); }
.hero-stat .stat-chart { grid-column: 1 / -1; grid-row: 3; margin-top: 8px; min-width: 0; }
.hero-stat .stat-chart svg { display: block; width: 100%; height: 40px; overflow: visible; }
.hero-stat .stat-sub { grid-column: 1 / -1; font-size: 0.7rem; color: var(--hero-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-foot { margin-top: 14px; font-size: 0.82rem; color: var(--hero-muted); position: relative; z-index: 1; }
@media (max-width: 1080px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .hero { padding: 24px 18px 20px; border-radius: 12px; }
  .hero h1 { font-size: 1.55rem; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-stat { padding: 10px 10px 8px; gap: 2px 8px; }
  .hero-stat .v { font-size: 1.3rem; }
  .hero-stat .icon-tile { width: 32px; height: 32px; border-radius: 8px; }
  .hero-stat .icon-tile svg { width: 16px; height: 16px; }
}
/* Mini-gráficos SVG inline (sparkline con área en gradiente y punto brillante; barras redondeadas con la destacada en gradiente). */
.sparkline .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sparkline .area { fill: var(--accent); opacity: 0.14; }
.sparkline .area-grad-start { stop-color: var(--accent); stop-opacity: 0.4; }
.sparkline .area-grad-end { stop-color: var(--accent); stop-opacity: 0; }
.sparkline .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 80%, transparent)); }
.sparkline .bar { fill: var(--glass); stroke: var(--glass-bd); }
.sparkline .bar.is-top { stroke: color-mix(in srgb, var(--accent) 55%, transparent); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 45%, transparent)); }
.sparkline .bar-grad-start { stop-color: var(--accent); stop-opacity: 0.95; }
.sparkline .bar-grad-end { stop-color: var(--accent); stop-opacity: 0.35; }
.hero .sparkline .bar { fill: rgba(255, 255, 255, 0.07); stroke: rgba(255, 255, 255, 0.14); }
.hero .sparkline .series { stroke: var(--hero-accent); }
.hero .sparkline .pt { fill: var(--hero-accent); stroke: #12161E; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--hero-accent) 80%, transparent)); }
.hero .sparkline .area-grad-start, .hero .sparkline .bar-grad-start, .hero .sparkline .bar-grad-end { stop-color: var(--hero-accent); }
.hero .sparkline .bar.is-top { stroke: color-mix(in srgb, var(--hero-accent) 55%, transparent); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--hero-accent) 45%, transparent)); }
.hero-stat:hover { border-color: color-mix(in srgb, var(--hero-accent) 45%, var(--hero-tile-bd)); }

/* ------------------------------------------------------------------ forms & buttons */
/* Botones: secundario «glass»; primario con gradiente azul→teal y brillo; fantasma transparente. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-bd); background: var(--glass); color: var(--ink);
  font: inherit; font-size: 0.9rem; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 1px 0 var(--glass-hi); transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent-grad); border-color: transparent; color: #FFFFFF; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 18px rgba(30, 111, 217, 0.28); }
.btn-primary:hover { background: var(--accent-grad); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 0 1px rgba(48, 208, 240, 0.35), 0 8px 24px rgba(30, 111, 217, 0.40); }
.btn-danger { background: var(--neg-bg); border-color: var(--neg-bd); color: var(--danger-ink); }
.btn-danger:hover { background: color-mix(in srgb, var(--neg) 24%, transparent); border-color: var(--neg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-ink); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.85rem; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn .spinner { width: 14px; height: 14px; }

label, .label { font-size: 0.78rem; font-weight: 650; color: var(--ink-2); letter-spacing: 0.02em; }
.filters label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field .hint { font-size: 0.8rem; color: var(--muted); }
input[type="text"], input[type="search"], input[type="url"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  font: inherit; font-size: 0.92rem; color: var(--ink); background: var(--input-bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  height: 40px; padding: 0 11px; width: 100%; min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
select { padding-right: 28px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea { height: auto; padding: 10px; line-height: 1.45; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid transparent; outline-offset: 0; border-color: var(--accent); box-shadow: var(--accent-glow); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.85; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.9rem; color: var(--ink); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 12px; margin: 0; min-width: 0; }
legend { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); padding: 0 4px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filters .field-q { grid-column: span 2; }
@media (max-width: 600px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters .field-q { grid-column: 1 / -1; } }
.filters-actions { display: flex; gap: 8px; align-items: center; }
.search-field { position: relative; display: flex; }
.search-field input { padding-left: 34px; }
.search-field .search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }

.seg { display: inline-flex; border: 1px solid var(--glass-bd); border-radius: var(--radius-sm); overflow: hidden; background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-hi); }
.seg button { border: 0; background: transparent; font: inherit; font-size: 0.86rem; font-weight: 600; padding: 6px 12px; color: var(--muted); cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.seg button + button { border-left: 1px solid var(--glass-bd); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
/* Móvil: el segmento ocupa como mucho el ancho del contenedor y sus botones se reparten (y envuelven si no caben). */
@media (max-width: 600px) {
  .seg { display: flex; flex-wrap: wrap; max-width: 100%; }
  .seg button { flex: 1 1 auto; padding: 6px 8px; font-size: 0.8rem; }
}

/* ------------------------------------------------------------------ pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; min-height: 24px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700; line-height: 1.2; letter-spacing: 0.02em; white-space: nowrap;
  border: 1px solid var(--pill-neutral-bd); background: var(--pill-neutral-bg); color: var(--pill-neutral-fg);
  font-family: var(--font-ui); vertical-align: middle;
}
.pill.pb { background: var(--pill-pb-bg); color: var(--pill-pb-fg); border-color: var(--pill-pb-bd); }
.pill.sb { background: var(--pill-sb-bg); color: var(--pill-sb-fg); border-color: var(--pill-sb-bd); }
.pill.q { background: var(--pill-q-bg); color: var(--pill-q-fg); border-color: var(--pill-q-bd); }
.pill.danger { background: var(--pill-danger-bg); color: var(--pill-danger-fg); border-color: var(--pill-danger-bd); }
.pill.warn { background: var(--pill-warn-bg); color: var(--pill-warn-fg); border-color: var(--pill-warn-bd); }
.pill.ok { background: var(--pill-ok-bg); color: var(--pill-ok-fg); border-color: var(--pill-ok-bd); }
.pill.accent { background: var(--pill-accent-bg); color: var(--pill-accent-fg); border-color: var(--pill-accent-bd); }
.pill.lg { font-size: 0.8rem; padding: 2px 10px; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pills { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.method { display: inline-block; min-width: 54px; text-align: center; font-family: var(--font-num); font-size: 0.74rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; border: 1px solid; }
.method.get { color: var(--pill-sb-fg); background: var(--pill-sb-bg); border-color: var(--pill-sb-bd); }
.method.post { color: var(--pill-ok-fg); background: var(--pill-ok-bg); border-color: var(--pill-ok-bd); }
.method.delete { color: var(--pill-danger-fg); background: var(--pill-danger-bg); border-color: var(--pill-danger-bd); }
.cc { font-family: var(--font-num); font-size: 0.8rem; font-weight: 600; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink-2); }

/* ------------------------------------------------------------------ tables */
.table-wrap { position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data caption { text-align: left; padding: 0 0 8px; font-weight: 600; }
table.data th, table.data td { padding: 8px 12px; border-bottom: 1px solid var(--glass-bd); text-align: left; vertical-align: middle; font-variant-numeric: tabular-nums; }
table.data thead th {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent); white-space: nowrap; border-bottom: 1px solid var(--line-strong);
}
table.data tbody tr:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data tbody th { font-weight: 600; }
table.data th.num, table.data td.num { text-align: right; }
table.data td.center, table.data th.center { text-align: center; }
table.data td.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
table.data td.mark { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
table.data td.rank { font-weight: 700; color: var(--ink-2); width: 1%; }
table.data tr.is-muted td { color: var(--muted); }
table.data tr.is-assisted td.wind { color: var(--accent-2); font-weight: 700; }
table.data .name-cell { min-width: 160px; }
table.data .name-cell a { font-weight: 600; }
table.data .sub { display: block; font-size: 0.8rem; color: var(--muted); }
table.data td.attempts { white-space: nowrap; }
.card > .table-wrap table.data thead th:first-child, .card > .table-wrap table.data td:first-child { padding-left: 20px; }
.card > .table-wrap table.data thead th:last-child, .card > .table-wrap table.data td:last-child { padding-right: 20px; }
@media (max-width: 600px) {
  table.data th, table.data td { padding: 7px 9px; }
  .card > .table-wrap table.data thead th:first-child, .card > .table-wrap table.data td:first-child { padding-left: 14px; }
}
.att { display: inline-flex; gap: 3px; flex-wrap: nowrap; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.att span { padding: 0 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); min-width: 22px; text-align: center; }
.att span.x { color: var(--pill-danger-fg); background: var(--pill-danger-bg); }
.att span.p { color: var(--muted); }
.att span.best { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.att .h { color: var(--muted); font-size: 0.72rem; align-self: center; margin-left: 4px; }
.att .h:first-child { margin-left: 0; }

/* ------------------------------------------------------------------ pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 20px; border-top: 1px solid var(--glass-bd); background: color-mix(in srgb, var(--surface-2) 40%, transparent); border-radius: 0 0 var(--radius-lg) var(--radius-lg); font-size: 0.86rem; color: var(--muted); }
.pager ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.pager button { min-width: 34px; height: 32px; padding: 0 9px; border-radius: var(--radius-sm); border: 1px solid var(--glass-bd); background: var(--glass); color: var(--ink-2); font: inherit; font-size: 0.86rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.pager button:hover:not(:disabled) { background: var(--surface-3); }
.pager button[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-bd)); font-weight: 700; box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 12px color-mix(in srgb, var(--accent) 20%, transparent); }
.pager button:disabled { opacity: 0.45; cursor: default; }
.pager .gap { padding: 0 4px; align-self: center; }
.pager .size { display: inline-flex; align-items: center; gap: 6px; }
.pager .size select { height: 30px; width: auto; font-size: 0.85rem; }
@media (max-width: 600px) { .pager { padding: 10px 14px; } .pager .pages-num { display: none; } }

/* ------------------------------------------------------------------ states */
.state { text-align: center; padding: 40px 20px; color: var(--muted); }
.state h3, .state .state-title { color: var(--ink); margin-bottom: 4px; font-size: 1.02rem; }
.state .state-ico { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--line-strong); }
.state.error .state-ico { color: var(--danger); }
.state .state-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.state code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
.skeleton { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; opacity: 0.9; }
.skel-rows { padding: 14px 20px; display: grid; gap: 12px; }
.skel-block { height: 120px; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
[aria-busy="true"] .refetch-dim, .refetching { opacity: 0.55; transition: opacity 0.15s; }

/* ------------------------------------------------------------------ toast */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink); border: 1px solid var(--glass-bd); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 10px 12px 10px 14px; box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-2); display: flex; gap: 10px; align-items: flex-start; animation: toast-in 0.18s ease-out; font-size: 0.9rem; }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast .toast-msg { flex: 1; overflow-wrap: anywhere; }
.toast button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 4px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ drawer (native dialog) */
dialog.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(620px, 100vw); max-width: 100vw; height: 100%; max-height: 100%;
  border: 0; border-left: 1px solid var(--glass-bd); padding: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--ink);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2); display: flex; flex-direction: column;
}
dialog.drawer:not([open]) { display: none; }
dialog.drawer[open] { animation: drawer-in 0.2s ease-out; }
dialog.drawer::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--glass-bd); }
.drawer-head h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--glass-bd); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
@media (max-width: 600px) { .drawer-head, .drawer-body, .drawer-foot { padding-left: 14px; padding-right: 14px; } }

/* ------------------------------------------------------------------ json / code */
.code-block { position: relative; }
pre.json, pre.code {
  margin: 0; background: var(--input-bg); border: 1px solid var(--glass-bd); border-radius: var(--radius-sm);
  padding: 12px 14px; overflow: auto; font-size: 0.8rem; line-height: 1.5; max-height: 480px; color: var(--ink);
  font-family: var(--font-num); tab-size: 2;
}
pre.code { white-space: pre; }
.code-block .copy-float { position: absolute; top: 8px; right: 8px; }
.json .k { color: var(--json-key); }
.json .s { color: var(--json-str); }
.json .n { color: var(--json-num); }
.json .l { color: var(--json-lit); font-weight: 600; }
.json .p { color: var(--json-punc); }
.copy-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.copy-row code { background: var(--surface-2); border: 1px solid var(--line); padding: 4px 8px; border-radius: 5px; overflow-x: auto; white-space: nowrap; min-width: 0; max-width: 100%; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 4px; padding: 4px; width: fit-content; max-width: 100%; border: 1px solid var(--glass-bd); border-radius: 999px; background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-hi); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] { border: 1px solid transparent; border-radius: 999px; background: transparent; font: inherit; font-weight: 600; font-size: 0.86rem; color: var(--muted); padding: 6px 14px; cursor: pointer; white-space: nowrap; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-bd)); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 12px color-mix(in srgb, var(--accent) 20%, transparent); }
.tabs [role="tab"]:hover { color: var(--ink); }
[role="tabpanel"] { padding-top: 12px; }

/* ------------------------------------------------------------------ home */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.comp-list { list-style: none; margin: 0; padding: 0; }
.comp-list li + li { border-top: 1px solid var(--glass-bd); }
.comp-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; color: inherit; text-decoration: none; }
.comp-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); text-decoration: none; }
.date-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--glass-bd)); border-radius: 12px; padding: 5px 0; background: color-mix(in srgb, var(--accent) 7%, var(--glass)); box-shadow: inset 0 1px 0 var(--glass-hi); line-height: 1.1; }
.comp-item:hover .date-chip { border-color: color-mix(in srgb, var(--accent) 55%, var(--glass-bd)); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 12px color-mix(in srgb, var(--accent) 22%, transparent); }
.date-chip .d { font-size: 1.2rem; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.date-chip .m { font-size: 0.7rem; text-transform: uppercase; color: var(--accent-ink); font-weight: 700; letter-spacing: 0.05em; }
.date-chip .y { font-size: 0.66rem; color: var(--muted); }
.comp-item .t { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.comp-item .e { font-size: 0.84rem; color: var(--muted); }
.comp-item .n { text-align: right; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .comp-item { grid-template-columns: 52px minmax(0, 1fr); padding: 10px 14px; } .comp-item .n { grid-column: 2; text-align: left; } }

.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--glass-bd); }
.top-list li:first-child { border-top: 0; }
.top-list .pos { font-family: var(--font-num); font-weight: 700; color: var(--muted); text-align: right; }
.top-list li:first-child .pos { color: var(--warn-ink); }
.top-list .who { min-width: 0; }
.top-list .who a { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .who .club { font-size: 0.8rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .val { text-align: right; }
.top-list .val .mk { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1rem; display: block; color: var(--live-ink); }
.top-list li.is-assisted .val .mk { color: var(--warn-ink); }
.top-list .val .wd { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 0.76rem; color: var(--muted); }
.top-card h3 { font-size: 0.98rem; }
.top-card .card-head { padding: 12px 16px; }
.top-card .card-foot { padding: 10px 16px; font-size: 0.86rem; }

/* Tarjeta «agente» (consola de competencias, API): icono en tile, píldora de estado, título, texto y mini-tiles. */
.agent-card { display: flex; flex-direction: column; gap: 12px; }
.agent-card .agent-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.agent-card .agent-top .icon-tile { width: 44px; height: 44px; border-radius: 12px; }
.agent-card h2 { margin: 0; font-size: 1.15rem; }
.agent-card p { margin: 0; color: var(--ink-2); }
/* Mini-tiles y acciones se agrupan al pie cuando la rejilla estira la tarjeta. */
.agent-card .mini-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: auto; }
.agent-card .agent-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.agent-card.is-brand .agent-top .icon-tile { color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 45%, var(--glass-bd)); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 18px color-mix(in srgb, var(--brand) 22%, transparent); }
/* Mejores marcas (tarjeta lateral): grupos por prueba con lista clave/valor en color semántico. */
.best-groups { display: grid; gap: 2px; }
.best-group { padding: 10px 16px 12px; }
.best-group + .best-group { border-top: 1px solid var(--glass-bd); }
.best-group h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 0.9rem; margin: 0 0 4px; }
.best-group h3 a { font-size: 0.78rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.best-group h3 a:hover { text-decoration: underline; }
.best-group dl.kv.kv-lines { grid-template-columns: minmax(0, 1fr) auto; }
.best-group dl.kv.kv-lines dt { font-size: 0.86rem; color: var(--ink-2); min-width: 0; display: flex; gap: 8px; align-items: baseline; }
.best-group dl.kv.kv-lines dt .pos { font-family: var(--font-num); font-weight: 700; color: var(--muted); width: 1.4em; flex-shrink: 0; }
.best-group dl.kv.kv-lines dt .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-group dl.kv.kv-lines dt .who a { font-weight: 600; text-decoration: none; }
.best-group dl.kv.kv-lines dt .who a:hover { text-decoration: underline; }
.best-group dl.kv.kv-lines dt .who .club { display: block; font-size: 0.76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.best-group dl.kv.kv-lines dd { font-family: var(--font-num); font-weight: 700; font-size: 1rem; white-space: nowrap; }
.best-group dl.kv.kv-lines dd .wd { display: block; font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.best-group dl.kv.kv-lines dd.is-warn { color: var(--warn-ink); }
.best-group dl.kv.kv-lines dt:first-of-type .pos { color: var(--warn-ink); }
.is-warn { color: var(--warn-ink); }
.cta-band { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 860px) { .cta-band { grid-template-columns: minmax(0, 1fr); } }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list svg { width: 18px; height: 18px; color: var(--accent-ink); flex-shrink: 0; margin-top: 2px; }

/* ------------------------------------------------------------------ profile */
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 18px; align-items: center; }
.avatar {
  width: 68px; height: 68px; border-radius: 16px; display: grid; place-items: center; font-weight: 750; font-size: 1.4rem; letter-spacing: 0.02em; flex-shrink: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--surface-2)), color-mix(in srgb, var(--accent) 6%, var(--surface)));
  color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--glass-bd)); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-glow);
}
.profile-head h1 { margin-bottom: 4px; }
.profile-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.profile-facts div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--glass-bd); box-shadow: inset 0 1px 0 var(--glass-hi); min-width: 0; }
.profile-facts .l { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-facts .v { font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.profile-facts .v.mark-v { font-family: var(--font-num); font-size: 1.05rem; color: var(--accent-ink); }
.profile-facts .v small { font-family: var(--font-ui); font-size: 0.74rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.profile-facts .v a { font-weight: 650; text-decoration: none; }
.profile-facts .v a:hover { text-decoration: underline; }
.profile-facts div.is-pb { border-color: color-mix(in srgb, var(--live) 40%, var(--glass-bd)); }
.profile-facts div.is-pb .v { color: var(--live-ink); }
@media (max-width: 600px) { .avatar { width: 54px; height: 54px; font-size: 1.1rem; border-radius: 12px; } .profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.bm-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.bm-item { border: 1px solid var(--glass-bd); border-radius: var(--radius); padding: 12px 14px; background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-hi); }
.bm-item .d { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.bm-item .m { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 750; line-height: 1.3; }
.bm-item .m small { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin-left: 6px; }
.bm-item .c { font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ chart */
.chart-card .chart-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.chart .axis-title { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); font-weight: 600; }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: 0.12; }
.chart .area-grad { opacity: 1; stroke: none; }
.chart .series { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 35%, transparent)); }
.chart .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .pt.assisted { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .pt.pb { fill: var(--accent-2); stroke: var(--surface); stroke-width: 2; filter: drop-shadow(0 0 7px color-mix(in srgb, var(--accent-2) 85%, transparent)); }
.chart .pt.active { stroke: var(--ink); stroke-width: 2; }
.chart .crosshair { stroke: var(--line-strong); stroke-width: 1; }
.chart .pb-label { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font-num); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .plot:focus-visible { outline: none; }
.chart .plot:focus-visible .focus-ring { stroke: var(--focus); stroke-width: 2; fill: none; }
.chart-tip { position: absolute; pointer-events: none; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--glass-bd); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); padding: 8px 10px; font-size: 0.82rem; min-width: 150px; max-width: 240px; z-index: 5; }
.chart-tip .tv { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 750; font-size: 1rem; }
.chart-tip .tl { color: var(--muted); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend svg { width: 12px; height: 12px; }
details.table-view { margin-top: 10px; }
details.table-view summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; font-size: 0.88rem; width: fit-content; }

/* ------------------------------------------------------------------ results */
.series-block + .series-block { margin-top: 18px; }
.series-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.series-head h2 { margin: 0; font-size: 1.05rem; }
.wind-badge { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 0.84rem; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; }
.wind-badge.assisted { color: var(--pill-pb-fg); background: var(--pill-pb-bg); border-color: var(--pill-pb-bd); font-weight: 700; }
.legend-note { font-size: 0.82rem; color: var(--muted); display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; }

.date-group + .date-group { margin-top: 22px; }
.date-group h2 { font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.date-group h2 .count { font-weight: 500; color: var(--muted); font-size: 0.86rem; }

/* ------------------------------------------------------------------ developers */
.dev-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 20px); font-size: 0.88rem; }
.toc h2 { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; border: 1px solid var(--glass-bd); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: inset 0 1px 0 var(--glass-hi); }
.toc a { display: block; padding: 7px 10px; color: var(--ink-2); text-decoration: none; border-radius: var(--radius-sm); border: 1px solid transparent; transition: background-color 0.15s, color 0.15s; }
.toc a:hover { color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
@media (max-width: 1020px) { .dev-layout { grid-template-columns: minmax(0, 1fr); } .toc { position: static; } .toc ol { display: flex; flex-wrap: wrap; gap: 4px 6px; } .toc a { border: 1px solid var(--glass-bd); border-radius: 999px; padding: 3px 10px; background: var(--glass); } }
.dev-section { scroll-margin-top: calc(var(--header-h) + 16px); }
.dev-section > h2 { display: flex; align-items: center; gap: 10px; }
.dev-section > h2 .step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.82rem; font-weight: 750; flex-shrink: 0; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: inset 0 1px 0 var(--glass-hi); }
.env-card { position: relative; padding-left: 74px; min-height: 96px; }
.env-card > .icon-tile { position: absolute; left: 20px; top: 18px; }
.env-card[data-env="production"] > .icon-tile { color: var(--warn-ink); }
@media (max-width: 600px) { .env-card { padding-left: 62px; } .env-card > .icon-tile { left: 14px; top: 14px; } }
.env-card.current { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-bd)); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-glow); }
.env-card .badge-current { position: absolute; top: 14px; right: 14px; }
.env-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 0.9rem; }
.ep-group + .ep-group { margin-top: 18px; }
.ep-group h3 { font-size: 0.95rem; margin-bottom: 6px; }
table.data td.path { font-family: var(--font-num); font-size: 0.82rem; white-space: nowrap; }
.console-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.prefix-input { display: flex; align-items: stretch; min-width: 0; }
.prefix-input .prefix { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-hi); color: var(--accent-ink); font-family: var(--font-num); font-size: 0.84rem; font-weight: 600; white-space: nowrap; }
.prefix-input input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--font-num); font-size: 0.86rem; }
@media (max-width: 600px) { .console-form { grid-template-columns: minmax(0, 1fr); } .prefix-input .prefix { display: none; } .prefix-input input { border-radius: var(--radius-sm); } }
.resp-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 0.86rem; color: var(--muted); }
.resp-meta .status { font-family: var(--font-num); font-weight: 700; }
.editor { font-family: var(--font-num); font-size: 0.8rem; line-height: 1.5; min-height: 360px; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 2; background: var(--input-bg); }
.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.issue-list li:first-child { border-top: 0; }
.issue-list .path-btn { font-family: var(--font-num); font-size: 0.8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--ink); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.issue-list .path-btn:hover { border-color: var(--accent); }
.issue-list .msg { grid-column: 2; font-size: 0.88rem; color: var(--ink-2); }
.verdict { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 650; }
.verdict.ok { background: var(--ok-bg); color: var(--pill-ok-fg); border: 1px solid var(--ok-bd); }
.verdict.bad { background: var(--neg-bg); color: var(--pill-danger-fg); border: 1px solid var(--neg-bd); }
.verdict svg { width: 18px; height: 18px; flex-shrink: 0; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-chips .chip { border: 1px solid var(--glass-bd); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-hi); font-size: 0.84rem; }
.summary-chips .chip b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1rem; margin-right: 4px; }

.keypanel { display: grid; gap: 10px; }
.keypanel .key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: end; }
@media (max-width: 600px) { .keypanel .key-row { grid-template-columns: minmax(0, 1fr) auto; } .keypanel .key-row .field { grid-column: 1 / -1; } }
.keypanel .who { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 0.88rem; min-height: 26px; }
.keypanel .demo-keys { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.84rem; }

.secret-box { border: 1px solid var(--pill-pb-bd); background: var(--pill-pb-bg); border-radius: var(--radius-sm); padding: 12px 14px; }
.secret-box code { font-size: 0.86rem; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ misc */
.kbd-hint { font-size: 0.8rem; color: var(--muted); }
.empty-inline { color: var(--muted); font-style: italic; }
.dash { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .pill, .method, .btn { border: 1px solid CanvasText; }
  .chart .series { stroke: CanvasText; }
  .chart .pt { fill: CanvasText; }
}
@media print {
  .platform-bar, .site-header, .site-footer, .toasts, .pager, .filters, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; }
}

/* ------------------------------------------------------------------ late additions */
.hero-stat dd { margin: 0; }
table.data tr.is-selected td { background: var(--accent-soft); }
.ico { width: 1em; height: 1em; vertical-align: -0.125em; flex-shrink: 0; }
.meta-line .ico { width: 16px; height: 16px; color: var(--muted); }
.btn .ico, .icon-btn .ico { width: 16px; height: 16px; vertical-align: middle; }
.state .ico.state-ico { width: 40px; height: 40px; }
.feature-list .ico { width: 18px; height: 18px; }

/* En el hero el primario usa --hero-btn-*: gradiente en oscuro; blanco con texto teal sobre el hero oscuro del tema claro. */
.hero .btn-primary { background: var(--hero-btn-bg); color: var(--hero-btn-fg); border-color: transparent; }
.hero .btn-primary:hover { background: var(--hero-btn-hover); }

/* Links inside dense data (tables, ranked lists) are bold accent text; underline on hover/focus. */
table.data a, .top-list a, .bm-list a { text-decoration: none; font-weight: 600; }
table.data a:hover, table.data a:focus-visible, .top-list a:hover, .top-list a:focus-visible { text-decoration: underline; }
table.data .link-btn { text-decoration: none; font-weight: 600; }
table.data .link-btn:hover { text-decoration: underline; }

.mock-badge .mock-short { display: none; }
@media (max-width: 600px) {
  .mock-badge .mock-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mock-badge .mock-short { display: inline; }
  .header-inner { gap: 10px; }
  .header-tools { gap: 6px; }
}
@media (max-width: 440px) {
  .menu-btn .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 720px) {
  table.data th, table.data td { white-space: nowrap; }
  table.data td .sub { white-space: nowrap; }
  table.data td.wrap { white-space: normal; min-width: 200px; }
}
table.ep-table { table-layout: fixed; min-width: 720px; }
table.ep-table td.path code { font-size: 0.82rem; overflow-wrap: anywhere; white-space: normal; }
table.ep-table td.path .sub { font-family: var(--font-num); font-size: 0.74rem; overflow-wrap: anywhere; white-space: normal; }
table.data td .btn, table.data td .link-btn:not(.mono), table.data td .pill { font-family: var(--font-ui); }
.att.v { font-family: var(--font-ui); font-weight: 600; letter-spacing: 0.04em; }

/* ------------------------------------------------------------------ fedhub-web QA pass */
.att .aw { display: inline-block; margin-left: 3px; font-size: 0.68rem; font-weight: 500; color: var(--muted); }
.att .aw.va { color: var(--accent-2); font-weight: 700; }
.att span.best .aw { color: inherit; opacity: 0.85; }
.series-head { justify-content: flex-start; }
.series-head > .muted:last-child { margin-left: auto; }
h1[data-autofocus]:focus-visible { outline: none; }
table.data .cell-v { display: contents; }
/* Stacked tables: on phones each row becomes a labelled block (PB/SB, historial). */
@media (max-width: 600px) {
  table.data.stack-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data.stack-sm, table.data.stack-sm tbody, table.data.stack-sm tr { display: block; width: 100%; }
  table.data.stack-sm tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.data.stack-sm tbody tr:last-child { border-bottom: 0; }
  .card > .table-wrap table.data.stack-sm td, .card > .table-wrap table.data.stack-sm th,
  table.data.stack-sm td, table.data.stack-sm th { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border: 0; text-align: right; white-space: normal; min-width: 0; }
  table.data.stack-sm td::before { content: attr(data-label); flex: 0 0 auto; text-align: left; font-family: var(--font-ui); font-size: 0.74rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
  table.data.stack-sm th[scope="row"], table.data.stack-sm td.stack-title { justify-content: flex-start; text-align: left; font-size: 0.98rem; padding-bottom: 4px; }
  table.data.stack-sm td.stack-title::before { content: none; }
  table.data.stack-sm td > .sub, table.data.stack-sm td .sub { white-space: normal; }
  table.data.stack-sm td > :only-child { min-width: 0; }
  table.data.stack-sm .cell-v { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
  table.data.stack-sm th[scope="row"] .cell-v, table.data.stack-sm td.stack-title .cell-v { align-items: flex-start; }
  table.data.stack-sm .dash { color: var(--muted); }
}
.chart .pb-line { stroke: var(--accent-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .pb-line-label { fill: var(--accent-2); font-size: 11px; font-weight: 700; font-family: var(--font-num); }
.chart-legend svg[viewBox="0 0 18 12"] { width: 18px; }
@media (max-width: 600px) {
  table.data.stack-sm td:has(> .cell-v > .dash:only-child) { display: none; }
}
@media (min-width: 721px) {
  table.data.results-table { table-layout: fixed; }
  table.data.results-table td, table.data.results-table th { overflow: hidden; text-overflow: ellipsis; }
  table.data.results-table td.attempts { overflow: visible; }
  table.data.results-table .name-cell { min-width: 0; }
}
@media (max-width: 600px) {
  .keypanel .key-row { grid-template-columns: auto minmax(0, 1fr); }
  .keypanel .key-row [data-toggle] { justify-self: start; }
  .keypanel .key-row button[type="submit"] { justify-self: end; }
}
/* Meta line: each item wraps as text (icon + link + edition) instead of splitting into columns. */
.meta-line > * { display: block; min-width: 0; }
.meta-line .ico { margin-right: 5px; vertical-align: -3px; }
/* Compact stacked lists on phones: title line + wrapping "Label: value" items. */
@media (max-width: 600px) {
  table.data.stack-inline thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data.stack-inline, table.data.stack-inline tbody { display: block; width: 100%; }
  table.data.stack-inline tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.data.stack-inline tbody tr:last-child { border-bottom: 0; }
  .card > .table-wrap table.data.stack-inline td, .card > .table-wrap table.data.stack-inline th,
  table.data.stack-inline td, table.data.stack-inline th { display: block; padding: 0; border: 0; text-align: left; white-space: normal; min-width: 0; font-size: 0.86rem; }
  table.data.stack-inline td::before { content: attr(data-label) " "; font-family: var(--font-ui); font-size: 0.74rem; font-weight: 600; color: var(--muted); }
  table.data.stack-inline td:not([data-label])::before { content: none; }
  table.data.stack-inline th[scope="row"], table.data.stack-inline .stack-title { flex: 1 1 100%; font-size: 0.95rem; order: -2; }
  table.data.stack-inline .stack-title::before, table.data.stack-inline .stack-first::before { content: none; }
  table.data.stack-inline .stack-first { order: -1; }
  table.data.stack-inline td.stack-end { margin-left: auto; }
  table.data.stack-inline td .sub { display: inline; margin-left: 6px; }
  table.data.stack-inline td:has(> .cell-v > .dash:only-child) { display: none; }
  table.data.stack-inline .cell-v { display: inline; }
}
.chart .pb-label, .chart .pb-line-label { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
/* Gradiente reutilizable para áreas/sparklines SVG inline (los carriles lo referencian por el id del linearGradient, p. ej. g-accent). */
.chart .area-grad-start { stop-color: var(--accent); stop-opacity: 0.26; }
.chart .area-grad-end { stop-color: var(--accent); stop-opacity: 0; }
.stack > dl.kv:not(:first-child) { margin-top: 16px; }
dl.kv dt { padding-top: 1px; }
.filters.filters-dense { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.filters .field-check { justify-content: flex-end; padding-bottom: 8px; }
@media (max-width: 600px) { .filters.filters-dense { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Roles y permisos (developers): top-aligned rows, permission lists, the stored key's role marked. */
table.data.roles-table th, table.data.roles-table td { vertical-align: top; }
table.data tr.is-selected th { background: var(--accent-soft); }
.role-name code { font-size: 0.8rem; margin-left: 2px; }
.perm-inherit { display: block; margin-top: 6px; }
.perm-list { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.perm-list li + li { margin-top: 2px; }
.role-current .ico { width: 16px; height: 16px; color: var(--accent); margin-right: 4px; vertical-align: -3px; }
@media (max-width: 600px) {
  table.data.roles-table.stack-sm td { flex-direction: column; align-items: stretch; gap: 2px; text-align: left; }
  table.data.roles-table.stack-sm .cell-v { align-items: flex-start; }
  table.data.roles-table.stack-sm tr.is-selected { background: var(--accent-soft); }
  table.data.roles-table.stack-sm tr.is-selected > * { background: transparent; }
}

/* ------------------------------------------------------------------ cabecera: anchos por tramo (1400 → 1240 → 1080 → 960 cajón) */
@media (max-width: 1400px) {
  .header-search { width: 168px; flex-basis: 168px; }
  .header-search input[type="search"] { padding-right: 58px; }
  .main-nav ul { gap: 2px; }
  .main-nav a { padding: 7px 9px; font-size: 0.88rem; gap: 6px; }
  .mock-badge .mock-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mock-badge .mock-short { display: inline; }
}
@media (max-width: 1240px) { .header-search { width: 150px; flex-basis: 150px; } .main-nav a .nav-ico { display: none; } .main-nav a { padding: 7px 8px; } }
@media (max-width: 1080px) { .header-search { display: none; } .icon-btn.search-btn { display: inline-flex; } .main-nav a { padding: 7px 9px; font-size: 0.88rem; } }
/* Enlace «Buscar atletas» que app.js añade al cajón (solo visible en el cajón); ≤ 440 px sustituye al botón de búsqueda. */
.main-nav .nav-extra { display: none; }
@media (max-width: 960px) {
  .main-nav ul { width: 100%; }
  .main-nav a .nav-ico { display: inline-block; }
  .main-nav .nav-extra { display: block; border-top: 1px solid var(--glass-bd); margin-top: 6px; padding-top: 8px; }
}
@media (max-width: 440px) { .icon-btn.search-btn { display: none; } }
