/* Liga de agentes · labo. — look copied from the MiMo RL metrics page (mimo.xiaomi.com/rl): its colour tokens,
   Inter + monospace typography, 48 px tab bar, 1 px borders without shadows, dense 3-column chart grid and bar
   tables. Everything below is written for this page (no rule is copied from the reference stylesheet).
   Light by default, dark through prefers-color-scheme unless the viewer stamps data-theme on <html>.
   No inline styles anywhere: the page runs under a CSP with style-src 'self'. */
@font-face {
  font-family: "Inter";
  src: url("./fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --surface-3: #e9e9e7;
  --border: #e4e4e1;
  --ink: #111111;
  --ink-2: #5c5c59;
  --ink-3: #8c8c88;
  --grid: #ececea;
  --accent: #2a78d6;
  --baseline: #9a9a96;
  /* status colours as TEXT (>= 4.5:1 on white: live 5.2, ok 5.3, warn 5.3) and as DOTS/BARS (the brighter marks) */
  --live: #c53a33; --ok: #177a52; --warn: #946013;
  --live-dot: #d9463f; --ok-dot: #1f8a5f; --warn-dot: #b7791f;
  --radius: 6px;
  --nav-h: 48px;
  --font: "Inter", -apple-system, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  /* ten categorical colours (validated with the dataviz palette checks for this surface: CVD separation PASS,
     c4/c5 >= 3:1 on the track; c3/c9 sit just under 3:1 and are relieved by direct labels and the tables) */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #b07400; --c5: #cf3d74;
  --c6: #008300; --c7: #6250d6; --c8: #e34948; --c9: #00a3c4; --c10: #9c5b2a;
  --muerto: #9a9a96;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111; --surface: #161616; --surface-2: #1e1e1e; --surface-3: #2a2a2a; --border: #2a2a29;
    --ink: #ececea; --ink-2: #a3a3a0; --ink-3: #6f6f6c; --grid: #242423; --accent: #3987e5; --baseline: #6e6e6b;
    --live: #e05a52; --ok: #3fbf86; --warn: #d9a441;
    --live-dot: #d9463f; --ok-dot: #3fbf86; --warn-dot: #d9a441;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181;
    --c6: #008300; --c7: #9085e9; --c8: #e66767; --c9: #1189a6; --c10: #b0693a;
    --muerto: #6e6e6b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111111; --surface: #161616; --surface-2: #1e1e1e; --surface-3: #2a2a2a; --border: #2a2a29;
  --ink: #ececea; --ink-2: #a3a3a0; --ink-3: #6f6f6c; --grid: #242423; --accent: #3987e5; --baseline: #6e6e6b;
  --live: #e05a52; --ok: #3fbf86; --warn: #d9a441;
  --live-dot: #d9463f; --ok-dot: #3fbf86; --warn-dot: #d9a441;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181;
  --c6: #008300; --c7: #9085e9; --c8: #e66767; --c9: #1189a6; --c10: #b0693a;
  --muerto: #6e6e6b;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 13.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
.mono, .v, .grande, .tbl, .feed-lista, .avisos-lista, .podio-lista, .lista-mono, .mono-texto, .tabla-grafico table { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tenue { color: var(--ink-3); font-weight: 400; }
/* ink-3 (3.4:1) is for labels, units and timestamps only; sentences (disclaimers, empty and error messages) read in ink-2 */
p.tenue, .pie .tenue { color: var(--ink-2); }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 20px; }
.saltar { position: absolute; left: -999px; top: 6px; background: var(--surface); border: 1px solid var(--border); padding: 6px 10px; border-radius: 4px; z-index: 30; }
.saltar:focus { left: 10px; }
.vacio { color: var(--ink-2); font-family: var(--font); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------- nav */
.nav { position: sticky; top: 0; z-index: 20; height: var(--nav-h); background: var(--bg); border-bottom: 1px solid var(--border); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 18px; position: relative; }
.marca { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.marca span { color: var(--accent); }
.tabs { display: flex; gap: 2px; height: 100%; }
.tabs [role="tab"] { display: flex; align-items: center; padding: 0 9px; color: var(--ink-2); position: relative; white-space: nowrap; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; background: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-status { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.nav-celda { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.nav-celda .k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.nav-celda .v { font-size: 13.5px; color: var(--ink); }
.pildora { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; color: var(--ink-2); }
.pildora strong { font-weight: 600; color: var(--ink); letter-spacing: 0.04em; font-size: 11.5px; }
.pildora-dia, .pildora-detalle { font-family: var(--mono); font-size: 11.5px; }
.pildora-dia:empty { display: none; }
.punto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.pildora[data-modo="live"] .punto { background: var(--live-dot); }
.pildora[data-modo="shadow"] .punto { background: var(--accent); }
.pildora[data-modo="suspendida"] .punto { background: var(--warn-dot); }
.pildora[data-modo="caido"] .punto, .pildora[data-modo="caido"] strong { color: var(--live); }
.icono { width: 28px; height: 28px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 16px; }
.icono:hover { background: var(--surface-2); color: var(--ink); }

/* ------------------------------------------------------------------ page */
#principal { padding-top: 18px; padding-bottom: 36px; }
.vista { display: none; }
.vista.activa { display: block; }
.vista[hidden] { display: none; }
.tarjeta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.tarjeta-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.tarjeta-titulo { font-weight: 600; font-size: 13px; }
.tarjeta-titulo .tenue { font-weight: 400; margin-left: 6px; font-size: 12px; }
.tarjeta-nota { color: var(--ink-3); font-size: 12px; white-space: nowrap; font-family: var(--mono); }
.posiciones .tarjeta-nota { white-space: normal; overflow-wrap: anywhere; }   /* P27: «n posiciones · latente … en vivo (bruto) · precios hace n s · …» is long: it wraps */
.banda-directo > .noticias .tarjeta-nota { white-space: normal; overflow-wrap: anywhere; text-align: right; }   /* P33: «6 noticias · 5 leídas antes de las HH:03 UTC · …» in a 340 px column must wrap, not widen the page */
.cabecera-vista { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.titulo-vista { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.nota-vista { margin-top: 12px; font-size: 12px; max-width: 820px; }
.subtitulo { font-size: 12px; font-weight: 600; margin: 12px 0 6px; color: var(--ink-2); }
.contador { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.contador[data-estado="ok"] { color: var(--ok); }
.contador[data-estado="aviso"] { color: var(--warn); }
.contador[data-estado="error"] { color: var(--live); }
.delta { color: var(--ink-2); font-size: 11px; margin-left: 6px; }
.delta .flecha { font-size: 0.7em; margin-right: 2px; position: relative; top: -1px; }
.delta.plano { color: var(--ink-3); }
.positivo { color: var(--ok); }
.negativo { color: var(--live); }
.mas, .enlace { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.mas:hover, .enlace:hover { color: var(--ink); }
.mas { margin-top: 8px; }
.ruido { margin: 6px 0 8px; padding: 7px 10px; border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: 4px; background: var(--surface-2); font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.ruido strong { color: var(--ink); }
.insignia { display: inline-block; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--border); font-family: var(--mono); font-size: 10.5px; line-height: 1.5; color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.insignia[data-tipo="vivo"] { color: var(--ok); border-color: var(--ok); }
.insignia[data-tipo="muerto"] { color: var(--ink-2); background: var(--surface-3); border-color: var(--surface-3); }
.insignia[data-tipo="aviso"] { color: var(--warn); border-color: var(--warn); }
.insignia[data-tipo="real"] { color: var(--live); border-color: var(--live); }
.insignia[data-tipo="bot"] { margin-left: 6px; }
.muestra { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); } .c4 { background: var(--c4); } .c5 { background: var(--c5); }
.c6 { background: var(--c6); } .c7 { background: var(--c7); } .c8 { background: var(--c8); } .c9 { background: var(--c9); } .c10 { background: var(--c10); }
.muestra.muerta { background: var(--muerto); }
.muestra.m-muertes { background: var(--live-dot); }
.muestra.m-penal { background: var(--c4); }
.insignia[data-tipo="espera"] { color: var(--ink-3); font-style: italic; }
/* SVG parts hidden through the attribute (runner of a placeholder lane, ✕ of a living bot, chart cursor) */
.corredor[hidden], .corredor-cruz[hidden], .cursor[hidden] { display: none; }

/* ---------------------------------------------------------------- avisos */
.avisos { margin-bottom: 14px; }
.avisos-lista { font-size: 12.5px; }
.aviso { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 7px 0; border-top: 1px solid var(--border); line-height: 1.45; }
.aviso:first-child { border-top: 0; }
.aviso.vacio { grid-template-columns: 1fr; }
.aviso-hora { color: var(--ink-3); font-size: 12px; padding-top: 1px; white-space: nowrap; }
.aviso-texto { font-family: var(--font); overflow-wrap: anywhere; }
.aviso-texto b { font-family: var(--mono); font-weight: 600; margin-right: 6px; }
.aviso-texto .tipo { color: var(--ink-2); margin-right: 6px; }
.aviso[data-tipo="death"] .tipo, .aviso[data-tipo="penalty"] .tipo, .aviso[data-tipo="suspended"] .tipo, .aviso[data-tipo="warning"] .tipo { color: var(--live); }
.aviso[data-tipo="step_up"] .tipo { color: var(--ok); }
.aviso[data-tipo="step_down"] .tipo, .aviso[data-tipo="exit_forced"] .tipo, .aviso[data-tipo="exit_refused"] .tipo { color: var(--warn); }
.avisos-lista.recortada .aviso:nth-child(n + 9) { display: none; }

/* ------------------------------------------------------------- ejecución */
.ejecucion { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; }
.ejecucion-linea { display: grid; grid-template-columns: 250px 90px 230px minmax(0, 1fr); align-items: center; gap: 0 20px; padding: 13px 16px; font-size: 14px; }
.ejecucion-nombre { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ejecucion-nombre b { font-size: 15px; white-space: nowrap; }
.ejecucion-nombre .estado { font-size: 12.5px; color: var(--ink-2); font-family: var(--mono); white-space: nowrap; }
.muestra.live { background: var(--live-dot); }
.muestra.shadow { background: var(--accent); }
.muestra.suspendida { background: var(--warn-dot); }
.grande { font-size: 18px; font-weight: 600; }
.grande span { font-size: 22px; }
.reloj-col { display: inline-flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.reloj-col .mono { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reloj-col .iniciado { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fase { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, auto); align-items: center; gap: 10px; min-width: 0; }
.fase-pista { width: 100%; height: 4px; display: block; background: var(--surface-3); border-radius: 2px; }
.fase-relleno { fill: var(--accent); }
.fase-texto { font-family: var(--mono); font-size: 12px; color: var(--ink-2); line-height: 1.35; overflow-wrap: anywhere; }   /* wraps to a second line instead of clipping */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--border); }
.kv > div { padding: 10px 16px 12px; border-left: 1px solid var(--border); min-width: 0; }
.kv > div:first-child { border-left: 0; }
.kv .k { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font); }
.kv .v { font-size: 20px; font-weight: 600; white-space: nowrap; margin-top: 2px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; }
.kv .v .u, .kv .v .delta { font-size: 11.5px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
/* P25: the second, small line of «P&L total»: the sum of the open positions' latent P&L (its own sign colour) */
.kv .v .sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-top: 1px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }   /* P27: the live sub-lines are sentences, they wrap instead of being cut */
.kv .v .sub.positivo { color: var(--ok); }
.kv .v .sub.negativo { color: var(--live); }
.kv .v .u:empty, .kv .v .sub:empty { display: none; }
.kv-dia { border-top: 1px solid var(--border); }
.kv-dia .v { font-size: 17px; }
.kv-compacto { border-top: 1px solid var(--border); margin-top: 6px; }
.kv-compacto .v { font-size: 14px; white-space: normal; }

/* ---------------------------------------------------------------- carrera */
.sitio-carrera:empty { display: none; }
/* P32/P33 (7-nov): the news panel rode below the race, the positions and the feed — 2 700 px down at 1440, i.e. never
   seen. It now shares a band with the race: news first in the DOM (a phone stacks it right under the KPIs, which is
   where the operator looked for it) and, from 1240 px up, a 380 px right column whose top matches the race's top. */
.banda-directo { margin-bottom: 14px; }
.banda-directo > .noticias { margin-bottom: 14px; }
@media (min-width: 1240px) {
  .banda-directo { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
  .banda-directo > .sitio-carrera { grid-column: 1; grid-row: 1; min-width: 0; margin-bottom: 0; }
  .banda-directo > .noticias { grid-column: 2; grid-row: 1; margin-bottom: 0; }
  .banda-directo .carril { grid-template-columns: 192px minmax(0, 1fr); }
  .banda-directo .carrera-lado { gap: 10px; }
  .banda-directo .noticias-lista { max-height: 420px; }   /* the card keeps its own scroll inside the narrow column */
}
.carrera { margin-bottom: 14px; }
.carrera-controles { margin-bottom: 4px; }
.carrera-cuerpo { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 14px; align-items: start; margin-top: 6px; }
.carrera-pistas { min-width: 0; }
.carriles { display: flex; flex-direction: column; }
/* lanes separate with a bottom line (not :first-child/top), so the CSS order of the sorted race never breaks the rhythm */
.carril { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 10px; align-items: center; border-bottom: 1px solid var(--grid); padding: 4px 0; min-height: 54px; }
.carril.orden-0 { order: 0; } .carril.orden-1 { order: 1; } .carril.orden-2 { order: 2; } .carril.orden-3 { order: 3; } .carril.orden-4 { order: 4; }
.carril.orden-5 { order: 5; } .carril.orden-6 { order: 6; } .carril.orden-7 { order: 7; } .carril.orden-8 { order: 8; } .carril.orden-9 { order: 9; }
.carril-etiqueta { min-width: 0; line-height: 1.25; }
.carril-id { display: flex; align-items: center; gap: 6px; min-width: 0; }
.carril-id b { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.carril-meta { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.carril-meta .mercado { font-family: var(--mono); color: var(--ink); }
.var24 { font-family: var(--mono); font-size: 11px; margin-left: 5px; color: var(--ink-3); }
.var24:empty { display: none; }
.var24.positivo { color: var(--ok); }
.var24.negativo { color: var(--live); }
.chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.chip { display: inline-block; padding: 0 5px; border: 1px solid var(--border); border-radius: 3px; font-family: var(--mono); font-size: 10px; line-height: 1.5; color: var(--ink-3); }
.chip.on { color: var(--ink); background: var(--surface-2); border-color: var(--ink-3); }
/* P25: the open position under the lane label — market · qty @ entry · age · virtual|REAL · latent P&L (sign in ok/live
   text tokens, never a series colour); «sin posición» for a flat bot; nothing for a placeholder lane */
/* the P&L chip (21:00Z): sign, arrow and accessible words on every surface, so a flat bot no longer shows only its
   bankroll and a loss never depends on colour alone. Cents decide neutrality: -0.004 reads «0,00 ·», never a red zero. */
.pnl-chip { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; font-family: var(--mono); font-size: 10.5px; line-height: 1.5; color: var(--ink-2); white-space: nowrap; }
.pnl-chip .pnl-etiqueta { font-family: var(--font); font-size: 10px; color: var(--ink-3); text-transform: lowercase; }
.pnl-chip .pnl-cifra { font-weight: 600; }
.pnl-chip.positivo .pnl-cifra { color: var(--ok); }
.pnl-chip.negativo .pnl-cifra { color: var(--live); }
.pnl-chip.plano .pnl-cifra { color: var(--ink-2); }
.carril-pnl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; margin-top: 2px; }
.carril[data-vivo="false"] .pnl-chip .pnl-cifra { color: var(--ink-3); }
.podio-val { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.podio-metrica { font-family: var(--mono); }
.podio-val .pnl-chip { font-size: 10px; }
.carril-pos { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; margin-top: 3px; font-size: 10.5px; line-height: 1.5; }
.pos-chip { display: inline-block; padding: 0 5px; border: 1px solid var(--border); border-radius: 3px; font-family: var(--mono); color: var(--ink-2); white-space: nowrap; }
.pos-chip.mercado { color: var(--ink); font-weight: 600; background: var(--surface-2); }
.pos-chip.latente { font-weight: 600; color: var(--ink-2); }
.pos-chip.latente.positivo { color: var(--ok); border-color: var(--ok); }
.pos-chip.latente.negativo { color: var(--live); border-color: var(--live); }
.pos-vacia { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); font-style: italic; }
.carril-pos .insignia { font-size: 10px; padding: 0 5px; }
.carril[data-vivo="false"] .pos-chip.mercado { color: var(--ink-2); }
.insignia[data-tipo="virtual"] { color: var(--ink-2); border-style: dashed; }
/* a dead bot keeps full contrast: grey swatch, struck name, «muerto» badge, grey runner with an ink ✕ and a darker track */
.carril[data-vivo="false"] .carril-id b { text-decoration: line-through; text-decoration-color: var(--ink-2); }
.carril[data-vivo="false"] .carril-meta, .carril[data-vivo="false"] .carril-meta .mercado { color: var(--ink-2); }
.carril[data-vivo="false"] .pista-fondo { fill: var(--surface-3); }
.carril[data-vivo="false"] .corredor-valor { fill: var(--ink-2); }
.carril[data-vivo="espera"] .carril-meta { font-style: italic; }
.pista { display: block; width: 100%; height: 40px; }
.pista-eje { height: 22px; }
.carril-eje { min-height: 0; padding: 0; border-bottom: 0; }
.pista-fondo { fill: var(--surface-2); }
.pista-linea { stroke: var(--grid); stroke-width: 1; }
.pista-base { stroke: var(--baseline); stroke-width: 1; stroke-dasharray: 3 3; }
.pista-eje-texto { fill: var(--ink-3); font-family: var(--mono); font-size: 10.5px; }
.pista-eje-texto.base { fill: var(--ink-2); }
.corredor { transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.corredor circle { stroke: var(--surface); stroke-width: 2; }
.corredor-valor { font-family: var(--mono); font-size: 11.5px; fill: var(--ink); font-weight: 600; }
.corredor-valor.negativo { fill: var(--live); }
/* the latent P&L of the open position next to the marker value (a tspan of the same text; empty for a flat bot) */
.corredor-latente { font-weight: 500; fill: var(--ink-2); }
.corredor-latente.positivo { fill: var(--ok); }
.corredor-latente.negativo { fill: var(--live); }
.corredor-cruz { font-family: var(--mono); font-size: 10px; fill: var(--ink); font-weight: 700; }   /* ink on --muerto: 6.7:1 light, 4.3:1 dark */
.corredor.muerto circle { fill: var(--muerto); }
.carrera-estado { font-size: 12px; margin-top: 8px; }
.carrera-estado[hidden] { display: none; }
.carrera-lado { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.podio, .carrera-serie { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.podio-ruido { font-size: 11.5px; margin-bottom: 6px; }
.podio-lista { font-size: 12px; }
.podio-lista li { display: grid; grid-template-columns: 22px 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 0; border-top: 1px solid var(--grid); }
.podio-lista li:first-child { border-top: 0; }
.podio-lista li.vacio { display: block; }
.podio-lista .pos { color: var(--ink-3); }
.podio-lista .nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podio-lista .nombre span { color: var(--ink-3); margin-left: 6px; font-size: 11px; }
.podio-lista li[data-vivo="false"] { color: var(--ink-3); }
.grafico-carrera { height: 190px; }

/* ---------------------------------------------------- «pensamiento» por bot (7-nov, P34) */
/* one expandable panel per lane (spanning label + track, so the text reads full width) and one per bot card. Closed it is
   a single small line with the action, the confidence and the age; open it shows the rationale, the model's own note for
   the next hour and, when round 10 sends it, the reasoning excerpt. Model text is untrusted, so it wraps anywhere. */
.pensamiento { margin: 2px 0 4px; }
.carril > .pensamiento { grid-column: 1 / -1; min-width: 0; }
.pensamiento-cabecera { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-size: 10.5px; line-height: 1.5; color: var(--ink-2); list-style-position: inside; }
.pensamiento-cabecera::before { content: "\25B8"; font-size: 9px; line-height: 1; color: var(--ink-3); }   /* a visible caret: display:flex hides the native disclosure marker */
.pensamiento[open] > .pensamiento-cabecera::before { content: "\25BE"; }
.pensamiento-cabecera:hover .pensamiento-rotulo { text-decoration: underline; }
.pensamiento-rotulo { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pensamiento-resumen { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); }
.pensamiento-cuerpo { margin: 4px 0 6px; padding: 6px 9px; border-left: 2px solid var(--border); background: var(--surface-2); border-radius: 0 4px 4px 0; font-size: 12px; line-height: 1.5; }
.pensamiento-linea { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 0 0 2px; }
.pensamiento-linea .k { min-width: 68px; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.pensamiento-linea .negativo { color: var(--live); }
.pensamiento-razon { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.pensamiento-error { margin: 4px 0 0; color: var(--live); overflow-wrap: anywhere; }
.pensamiento-nota, .pensamiento-thinking { margin-top: 6px; }
.pensamiento-etiqueta { margin: 0 0 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.pensamiento-texto { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.pensamiento-extracto { margin: 0; padding: 6px 8px; max-height: 180px; overflow: auto; font-family: var(--mono); font-size: 11px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.pensamiento-bot { margin-top: 4px; }
.pensamiento-bot .pensamiento-cuerpo { font-size: 12.5px; }

/* ---------------------------------------------------- en vivo (7-nov, P27) */
/* the strip under the nav: EN VIVO indicator (red dot while the price file is fresh, grey otherwise), the ticker of the
   league's markets (MEXC public quotes, 24 h change coloured) and the countdown to the next hourly close (UTC) */
.cinta-barra { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cinta-inner { display: flex; align-items: center; gap: 16px; min-height: 36px; padding-top: 4px; padding-bottom: 4px; }
.vivo { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; flex: none; }
.vivo strong { font-weight: 600; letter-spacing: 0.06em; font-size: 11px; color: var(--ink-2); }
.vivo-detalle { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.vivo-punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.vivo[data-estado="vivo"] .vivo-punto { background: var(--live-dot); animation: latido 1.6s ease-in-out infinite; }
.vivo[data-estado="vivo"] strong { color: var(--live); }
.vivo[data-estado="gris"] .vivo-punto { background: var(--warn-dot); }
.cinta-lista { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 20px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }   /* wraps on desktop; one scrolling row on phones */
.cinta-lista::-webkit-scrollbar { display: none; }
.cinta-item { display: inline-flex; align-items: baseline; gap: 6px; flex: none; }
.cinta-mercado { color: var(--ink-2); }
.cinta-precio { color: var(--ink); font-weight: 600; padding: 0 2px; border-radius: 3px; }
.cinta-var { font-size: 11px; color: var(--ink-3); }
.cinta-var.positivo { color: var(--ok); }
.cinta-var.negativo { color: var(--live); }
.cinta-bots { font-size: 10.5px; color: var(--ink-3); }
.cinta-item[data-origen="cierre"] .cinta-precio { color: var(--ink-2); font-weight: 500; }
.cinta-vacia { color: var(--ink-2); font-family: var(--font); font-size: 12px; }
.cuentas { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 4px 18px; flex: none; max-width: 560px; }
.cuenta { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; flex: none; }
.cuenta .k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.cuenta .v { font-size: 13.5px; color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cuenta.pronto .v { color: var(--live); }
.cuenta-nota { flex-basis: 100%; margin: 0; text-align: right; font-size: 10px; line-height: 1.35; color: var(--ink-3); overflow-wrap: anywhere; }
/* ---------------------------------------------------- hero countdown (7-nov, P34) */
/* «pone también el thinking de cada modelo, pon un contador hacia atrás»: the decision clock at hero size, above every
   card, so it is visible at 1440×900 and at 390 px without scrolling. The same three clocks the strip carries. */
.reloj-hero { border-bottom: 1px solid var(--border); background: var(--surface); }
.reloj-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.reloj-hero-principal { display: flex; flex-direction: column; min-width: 0; }
.reloj-hero-principal .k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.reloj-hero-principal .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.02; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.reloj-hero.pronto .reloj-hero-principal .v { color: var(--live); }
.reloj-hero-sub { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.reloj-hero-lado { display: flex; align-items: flex-end; gap: 10px 26px; flex-wrap: wrap; }
.reloj-hero-mini { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.reloj-hero-mini .k { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.reloj-hero-mini .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(1.25rem, 2.6vw, 1.7rem); font-weight: 600; color: var(--ink); }
.reloj-hero-mini.pronto .v { color: var(--live); }
@media (max-width: 640px) {
  .reloj-hero-inner { align-items: flex-start; flex-direction: column; }
  .reloj-hero-lado { align-items: flex-start; flex-direction: row; width: 100%; justify-content: space-between; }
  .reloj-hero-mini { align-items: flex-start; }
}
@keyframes latido { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.75); } }
/* a figure that just changed pulses once: a tinted background (green up, red down, neutral otherwise) fading out; the
   class is removed on animationend. SVG text (the runner labels) cannot paint a background: it dips in opacity instead. */
.pulso { animation: pulso 900ms ease-out; border-radius: 3px; }
.pulso.sube { animation-name: pulso-sube; }
.pulso.baja { animation-name: pulso-baja; }
@keyframes pulso { 0% { background-color: var(--surface-3); } 100% { background-color: transparent; } }
@keyframes pulso-sube { 0% { background-color: color-mix(in srgb, var(--ok-dot) 28%, transparent); } 100% { background-color: transparent; } }
@keyframes pulso-baja { 0% { background-color: color-mix(in srgb, var(--live-dot) 28%, transparent); } 100% { background-color: transparent; } }
svg .pulso, svg .pulso.sube, svg .pulso.baja { animation-name: pulso-svg; }
@keyframes pulso-svg { 0% { opacity: 0.15; } 100% { opacity: 1; } }

/* -------------------------------------------------------------- controles */
.controles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; font-size: 12.5px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.seg button { padding: 3px 9px; color: var(--ink-2); border-left: 1px solid var(--border); font-size: 12.5px; }
.seg button:first-child { border-left: 0; }
.seg button.activo { background: var(--ink); color: var(--bg); }
.seg button:not(.activo):hover { color: var(--ink); background: var(--surface-2); }
.seg button[aria-disabled="true"] { color: var(--ink-3); cursor: not-allowed; }
.seg-pequeno button { padding: 1px 8px; font-size: 12px; }
.ctl-etiqueta { color: var(--ink-3); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--ink); margin: 0; }
.leyenda { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 12px; color: var(--ink-2); }
.leyenda li { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); }
.leyenda li[data-vivo="false"] { color: var(--ink-3); text-decoration: line-through; }

/* --------------------------------------------------------------- gráficas */
.rejilla-graficas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.rejilla-dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tarjeta-grafica { padding: 10px 12px 8px; display: flex; flex-direction: column; }
.tarjeta-grafica .tarjeta-cab { margin-bottom: 2px; align-items: flex-start; flex-wrap: nowrap; }
.etiqueta-metrica { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.etiqueta-metrica .tenue { font-weight: 400; margin: 0; }
.valor { font-family: var(--mono); font-size: 12px; white-space: nowrap; text-align: right; color: var(--ink); flex: none; line-height: 1.5; }
.valor .fila { display: block; }
.valor .muestra { margin-right: 6px; width: 7px; height: 7px; }
.cuerpo-grafica { height: 170px; margin-top: 4px; position: relative; }
.cuerpo-grafica.alto { height: 240px; }
.cuerpo-grafica svg, .grafico svg { display: block; width: 100%; height: 100%; }
.grafico-vacio { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 12px; margin: 0; text-align: center; padding: 0 10px; }
.grafico { position: relative; }
.eje-texto { fill: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.eje-linea { stroke: var(--grid); stroke-width: 1; }
.eje-cero { stroke: var(--baseline); stroke-width: 1; }
.serie { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.serie.muerta { stroke: var(--muerto); stroke-dasharray: 3 3; }
.serie.discontinua { stroke-dasharray: 4 3; }
.cursor-linea { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 2; }
.cursor-caja { fill: var(--surface); stroke: var(--border); }
.cursor-texto { fill: var(--ink); font-family: var(--mono); font-size: 10px; }
.cursor-texto.tenue { fill: var(--ink-3); }
.cursor { pointer-events: none; }
.cursor[hidden] { display: none; }
.barra { fill: var(--accent); }
.barra-muertes { fill: var(--live-dot); }
.barra-penal { fill: var(--c4); }
.datos-grafica { margin-top: 6px; font-size: 12px; }
.datos-grafica summary { cursor: pointer; color: var(--ink-3); list-style: none; }
.datos-grafica summary::before { content: "▸ "; font-size: 10px; }
.datos-grafica[open] summary::before { content: "▾ "; }
.datos-grafica summary:hover { color: var(--ink); }
.tabla-grafico { overflow-x: auto; margin-top: 6px; }
.tabla-grafico table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tabla-grafico caption { text-align: left; color: var(--ink-3); padding: 2px 0 4px; font-family: var(--font); }
.tabla-grafico th, .tabla-grafico td { padding: 3px 8px; text-align: right; white-space: nowrap; border-top: 1px solid var(--border); }
.tabla-grafico th { color: var(--ink-3); font-weight: 500; border-top: 0; }
.tabla-grafico th:first-child, .tabla-grafico td:first-child { text-align: left; }

/* ------------------------------------------------------------------ feeds */
.fila-directo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 14px; align-items: start; }
.feed-lista { font-size: 12px; max-height: 420px; overflow: auto; }
.feed-cabecera, .feed-fila { display: grid; grid-template-columns: 50px 62px minmax(90px, 0.9fr) 70px 44px minmax(0, 2fr); gap: 10px; align-items: baseline; }
.feed-cabecera { font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding: 4px 0 6px; border-bottom: 1px solid var(--border); }
.feed-fila { padding: 5px 0; border-top: 1px solid var(--grid); }
.feed-fila:first-child { border-top: 0; }
.feed-fila > span, .feed-fila > time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.feed-fila .hora { color: var(--ink-3); }
.feed-fila .bot { font-weight: 600; }
.feed-fila .accion[data-accion="buy"] { color: var(--ok); }
.feed-fila .accion[data-accion="sell"] { color: var(--live); }
.feed-fila .accion[data-accion="invalida"] { color: var(--warn); }
.feed-fila .motivo { color: var(--ink-2); font-family: var(--font); }
.feed-aviso { font-size: 11.5px; margin-bottom: 4px; }
.filtros-noticias { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.filtro-noticia { font: inherit; font-size: 11px; line-height: 1.5; padding: 1px 9px; color: var(--ink-2); background: transparent; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.filtro-noticia:hover { color: var(--ink); border-color: var(--ink-3); }
.filtro-noticia.activo { color: var(--ink); background: var(--surface-2); border-color: var(--ink-3); }
.filtro-noticia:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 74px: que «hace 54 min» y «hace 1,9 h» quepan en una línea (visto en público el 7-nov 16:08Z, partían en dos). */
.noticia { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid var(--grid); }
.noticia:first-child { border-top: 0; }
.noticia-cuando { color: var(--ink-3); font-size: 11px; line-height: 1.45; }
.noticia-cuerpo { min-width: 0; }
.noticia-titulo { margin: 0; font-family: var(--font); overflow-wrap: anywhere; }
.noticia-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; margin-top: 3px; }
.noticia-visto { font-size: 10px; color: var(--ink-2); }
.noticia-visto[data-visto="no"] { color: var(--ink-3); font-style: italic; }
.tono { font-size: 10px; color: var(--ink-3); }
.tono[data-tono="bullish"] { color: var(--ok); }
.tono[data-tono="bearish"] { color: var(--live); }
.tono[data-tono="mixed"] { color: var(--warn); }
.noticias-lista { max-height: 460px; }
.noticia-grupo { align-items: baseline; }
.noticia-grupo .noticia-titulo { color: var(--ink-2); }
.noticia-grupo-meta { font-size: 10.5px; color: var(--ink-3); margin: 2px 0 0; overflow-wrap: anywhere; }
.noticia .fuente { color: var(--ink-3); margin-left: 6px; font-size: 11px; }
.feed-lista li.vacio { padding: 6px 0; }

/* ----------------------------------------------------------------- tablas */
.duo { display: grid; grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr); gap: 10px; margin-bottom: 14px; align-items: start; }   /* models ≈ 450 px, scoreboard ≈ 745 px at 1440 */
.tabla-envoltorio { overflow-x: auto; }   /* only a fallback: at desktop widths the scoreboard fits its card */
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { padding: 6px 10px; text-align: right; white-space: nowrap; border-top: 1px solid var(--border); }
.tbl th { color: var(--ink-3); font-weight: 500; font-size: 11.5px; border-top: 0; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td:first-child { font-weight: 600; }
.tbl td.izq, .tbl th.izq { text-align: left; }
.tbl td.estado { white-space: normal; min-width: 150px; }   /* badges may wrap; the death reason goes on its own line */
.tbl td.posicion { white-space: normal; min-width: 150px; }   /* P25: market · qty @ entry may wrap; the latent P&L has its own line */
.tbl .tbl-sub { display: block; font-size: 11.5px; color: var(--ink-2); line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; white-space: normal; }
.tbl .tbl-sub.latente { font-family: var(--mono); }
.tbl td.pnl-col { white-space: normal; }
.tbl td.pnl-col .pnl-chip { justify-content: flex-end; }
.tbl td.pnl-col .tbl-sub { text-align: right; }
.tbl .latente.positivo, .tbl .tbl-sub.positivo { color: var(--ok); }
.tbl .latente.negativo, .tbl .tbl-sub.negativo { color: var(--live); }
.posiciones { margin-bottom: 14px; }
.tbl td.barra-col { width: 150px; text-align: left; }
.tbl td .muestra { margin-right: 7px; }
.tbl tr[data-vivo="false"] td { color: var(--ink-3); }
.tbl td.vacio { text-align: left; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.barra-fila { display: inline-flex; align-items: center; gap: 8px; width: 100%; }
.barra-fila svg { flex: 1 1 0; min-width: 24px; width: 0; height: 4px; display: block; background: var(--surface-3); }   /* no intrinsic 300 px: the column keeps its 150 px */
.barra-fila rect { fill: var(--accent); }
.barra-fila span { min-width: 64px; text-align: right; }
.tabla-pie { font-size: 11.5px; margin-top: 8px; }

/* ------------------------------------------------------------------- bots */
.rejilla-bots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bot { display: flex; flex-direction: column; gap: 8px; }
.bot[data-vivo="false"] { background: var(--surface-2); }
.bot-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bot-cab h3 { font-family: var(--mono); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bot-cab h3 span { font-weight: 400; color: var(--ink-2); }
.bot-modelo { font-size: 12px; color: var(--ink-2); }
.bot-modelo strong { color: var(--ink); font-weight: 500; }
.bot-cifras { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 4px; }
.bot-cifras > div { padding: 6px 10px; border-left: 1px solid var(--border); min-width: 0; }
.bot-cifras > div:first-child { border-left: 0; }
.bot-cifras dt { font-size: 11px; color: var(--ink-3); }
.bot-cifras dd { font-family: var(--mono); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-linea { display: grid; grid-template-columns: 112px 1fr; gap: 8px; font-size: 12px; border-top: 1px solid var(--grid); padding: 4px 0; }
.bot-linea span:first-child { color: var(--ink-3); }
.bot-linea span:last-child { font-family: var(--mono); overflow-wrap: anywhere; }
.bot-linea-pnl { align-items: baseline; }
.bot-pnl-chips { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.bot-pnl-chips .pnl-chip { font-size: 11px; }
.bot-razon { margin: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.bot-razon strong { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 3px; font-weight: 500; }
.bot-grafica h4 { font-size: 11.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }
.bot-grafica .cuerpo-grafica { height: 90px; }

/* ----------------------------------------------------------------- listas */
.lista-mono { font-size: 12px; }
.lista-mono li { padding: 5px 0; border-top: 1px solid var(--grid); overflow-wrap: anywhere; }
.lista-mono li:first-child { border-top: 0; }
.lista-mono time { color: var(--ink-3); margin-right: 8px; }
.lista-mono .fuente { color: var(--ink-3); margin-left: 6px; }
.mono-texto { font-size: 12px; color: var(--ink-2); line-height: 1.6; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------- chat */
.chat .tarjeta-cab p { font-size: 12px; max-width: 420px; }
.chat-mensajes { height: clamp(220px, 36svh, 420px); overflow-y: auto; padding: 8px 0; margin: 4px 0 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.chat-liga-log { height: clamp(180px, 28svh, 340px); }
.chat-mensaje { margin-bottom: 12px; }
.mensaje-cab { display: flex; align-items: baseline; gap: 8px; font-size: 12px; margin-bottom: 2px; }
.mensaje-cab strong { font-weight: 600; }
.mensaje-cab time { font-family: var(--mono); color: var(--ink-3); font-size: 11px; }
.chat-mensaje p { font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-mensaje[data-autor="liga"] .mensaje-cab strong { color: var(--accent); }
.chat-mensaje[data-autor="liga"] p { border-left: 2px solid var(--accent); padding-left: 10px; }
.chat-form label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-bottom: 5px; }
.chat-form label > span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.chat-form input, .chat-form textarea { display: block; width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 4px; padding: 7px 9px; color: var(--ink); font-size: 13px; line-height: 1.5; margin: 0 0 12px; resize: vertical; }
.chat-form input:focus, .chat-form textarea:focus { border-color: var(--ink-3); outline: none; }
.chat-form textarea { min-height: 72px; max-height: 190px; }
.chat-form textarea::placeholder { color: var(--ink-3); }
.chat-form textarea:disabled, .chat-form input:disabled { opacity: 0.55; cursor: not-allowed; }
.chat-enviar-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-enviar-fila > span { font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.chat-enviar-fila button { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: 4px; font-size: 12.5px; padding: 5px 11px; white-space: nowrap; }
.chat-enviar-fila button:hover { opacity: 0.85; }
.chat-enviar-fila button:disabled { opacity: 0.45; cursor: not-allowed; }
.chat-resultado { min-height: 18px; font-size: 12px; line-height: 1.5; color: var(--warn); margin: 8px 0 0; }

/* -------------------------------------------------------------------- pie */
.pie { padding: 14px 20px 26px; color: var(--ink-2); font-size: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: baseline; }
.pie strong { color: var(--ink); font-weight: 600; }
.pie-ruido-fijo { color: var(--ink-2); }
#pie-ruido:empty { display: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1320px) {
  /* 1280 px: the two summary tables stay side by side without scrolling (scoreboard ≈ 705 px, models ≈ 415 px here) */
  table.tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 6px 8px; }
  .tbl td.barra-col { width: 100px; }
}
@media (max-width: 1250px) {
  .duo { grid-template-columns: 1fr; }   /* below ~1250 px the two tables no longer fit side by side: they stack */
}
@media (max-width: 1180px) {
  .ejecucion-linea { grid-template-columns: 250px 90px 1fr; row-gap: 8px; }
  .fase { grid-column: 1 / -1; }
  .kv .k { white-space: normal; }
  .rejilla-graficas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rejilla-bots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carrera-cuerpo, .fila-directo, .duo { grid-template-columns: 1fr; }
  .carrera-lado { display: grid; grid-template-columns: 1fr 1fr; }
  .nav-celda { display: none; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .nav { height: auto; }
  .nav-inner { height: auto; flex-wrap: wrap; gap: 0 10px; padding: 4px 0 0; }
  .marca { display: none; }
  .tabs { height: 36px; width: 100%; order: 2; overflow-x: auto; scrollbar-width: none; }
  .tabs [role="tab"] { padding: 0 8px; font-size: 13px; }
  .nav-right { margin-left: auto; order: 1; width: 100%; justify-content: space-between; }
  .nav-status { gap: 10px; }
  .pildora { font-size: 11px; padding: 2px 7px; }
  .pildora-detalle { display: none; }
  #principal { padding-top: 14px; }
  .tarjeta-nota { white-space: normal; overflow-wrap: anywhere; }   /* no note may widen the page on a phone */
  .cinta-inner { flex-wrap: wrap; gap: 4px 10px; padding-top: 6px; padding-bottom: 6px; }
  .vivo { flex: 1 1 auto; min-width: 0; }
  .vivo-detalle { overflow: hidden; text-overflow: ellipsis; }
  .cuentas { order: 2; width: 100%; max-width: none; justify-content: flex-start; gap: 2px 14px; }
  .cuenta { flex-direction: row; align-items: baseline; gap: 6px; }
  .cuenta-nota { text-align: left; }
  .cinta-lista { order: 3; width: 100%; flex: none; flex-wrap: nowrap; gap: 0 16px; }
  .kv-dia .v { font-size: 15px; }
  .ejecucion-linea { grid-template-columns: auto minmax(0, 1fr); padding: 12px; }
  .ejecucion-nombre { grid-column: 1 / -1; }   /* the name owns its row; day and clocks share the next one */
  .fase { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .kv { grid-template-columns: repeat(2, 1fr); }
  .kv > div:nth-child(odd) { border-left: 0; }
  .kv > div:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .kv .v { font-size: 17px; }
  .rejilla-graficas, .rejilla-dos, .rejilla-bots, .carrera-lado { grid-template-columns: 1fr; }
  .carril { grid-template-columns: 1fr; gap: 2px; padding: 6px 0; }
  .carril-eje { grid-template-columns: 1fr; }
  .carril-eje .carril-etiqueta { display: none; }
  .carriles .pista { height: 34px; }   /* lanes only: the axis keeps its 22 px and raceLayout reads both heights */
  .aviso { grid-template-columns: 1fr; gap: 1px 0; }
  .aviso-hora { font-size: 11px; }
  .feed-cabecera { display: none; }
  .feed-fila { grid-template-columns: 50px 62px minmax(0, 1fr); row-gap: 2px; }
  .feed-fila .modelo, .feed-fila .conf { display: none; }
  .feed-fila .motivo { grid-column: 1 / -1; white-space: normal; }
  .fila-directo { gap: 10px; }
  .tbl th, .tbl td { padding: 5px 7px; }
  .chat-mensajes { height: 300px; }
  .chat-liga-log { height: 240px; }
  .chat-form input, .chat-form textarea { font-size: 16px; }
  .pie { padding: 12px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .corredor { transition: none; }
  /* specificity matches the rules that switch these animations on */
  .vivo-punto, .vivo[data-estado="vivo"] .vivo-punto, .pulso, .pulso.sube, .pulso.baja, svg .pulso, svg .pulso.sube, svg .pulso.baja { animation: none; }
}
