/* Statera · Laboratorio, Progresiones, Aprender y Biblioteca · piezas comunes (Claude, 28/09/2026)
 * Sobre ../css/tokens-v2.css + ../marco/marco.css. Misma base que Estrategias v3.4: oscuro por defecto, claro a la par,
 * texto >= 13 px (12 solo en marcas de ejes), un solo scroll, fichas de ruleta con su color real, lima solo para la marca.
 * Cromo de gráficos: ATLAS demos/atlas-charts.css (ac-*), el mismo de Estrategias y En vivo.
 */
.lb { --ch-r: var(--chip-red); --ch-b: var(--chip-black); --ch-bb: var(--chip-black-border); --ch-z: var(--chip-green);
  --k1: var(--cmp-3); --k2: var(--cmp-1); --k3: var(--cmp-4); } /* categorías (docenas, columnas, par/impar, mitades): colores de comparar de la paleta */
.lb h1, .lb h2, .lb h3, .lb h4, .lb p, .lb ul, .lb ol, .lb dl, .lb dd, .lb figure { margin: 0; }
.lb ul, .lb ol { padding: 0; list-style: none; }
.lb :where(.mk-main, .mk-rail) :where(button, input, select, textarea) { font: inherit; color: inherit; }
.lb .num, .lb .fig { font-variant-numeric: tabular-nums; }
.lb .muted { color: var(--text-2); }
.lb .gain { color: var(--gain); } .lb .loss { color: var(--loss); } .lb .ddc { color: var(--dd); }
.lb :where(.mk-main, .mk-rail) a { color: inherit; }
.lb .vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- cabecera de la página ---------- */
.lb-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 18px; padding: 16px 0 12px; }
.lb-top h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.lb-top .sub { flex: 1 1 360px; min-width: 0; font-size: var(--fs-row); color: var(--text-2); line-height: 1.35; }
.lb-top .right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.stamp { display: inline-flex; align-items: center; gap: 8px; font: 500 var(--fs-cap)/1.3 var(--mono); letter-spacing: .02em; color: var(--text-2); white-space: nowrap; }
.stamp::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); flex: none; }
.btn.lb-filtros { display: none; }
@media (max-width: 1023px) { .btn.lb-filtros { display: inline-flex; } }

/* ---------- botones y controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: var(--fs-sec); font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid var(--line-hover); background: var(--card); color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--border-strong); background: var(--surface); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--surface); }
.btn[disabled] { opacity: .55; cursor: default; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.seg button { min-height: 36px; padding: 0 8px; border: 0; background: transparent; font-size: var(--fs-sec); font-weight: 500; color: var(--text-2); cursor: pointer; line-height: 1.15; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-checked="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); font-weight: 600; }
.seg button:hover:not([aria-checked="true"]):not([aria-pressed="true"]) { color: var(--text); background: var(--surface); }
.seg.v { grid-auto-flow: row; }
.seg.v button + button { border-left: 0; border-top: 1px solid var(--border-strong); }
.inp, .sel, .ta { width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: var(--fs-sec); }
.ta { min-height: 88px; padding: 8px 10px; resize: vertical; line-height: 1.4; font-family: var(--mono); font-size: var(--fs-cap); }
.sel { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.inp:focus, .sel:focus, .ta:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: var(--fs-cap); font-weight: 600; white-space: nowrap; border: 1px solid var(--line-hover); color: var(--text-2); background: var(--card); }
.pill.on { border-color: var(--accent-mark); color: var(--text); }
.qm { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-hover); font: 700 12px/1 var(--font); color: var(--text-2); cursor: help; background: transparent; padding: 0; vertical-align: 1px; }
.qm:hover { color: var(--text); border-color: var(--text-2); }

/* ---------- riel ---------- */
.lb .mk-rail h2, .lb .mk-rail .rh { margin: 0 0 6px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lb .mk-rail section { padding: 10px 0; border-top: 1px solid var(--line); }
.lb .mk-rail section:first-child { border-top: 0; padding-top: 2px; }
.lb .mk-rail .help { margin-top: 6px; font-size: var(--fs-cap); color: var(--text-2); line-height: 1.35; }
.opts { display: grid; gap: 2px; }
.opt { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border-radius: 8px; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; font-size: var(--fs-sec); color: var(--text); }
.opt:hover { background: var(--surface); }
.opt[aria-checked="true"], .opt[aria-current="true"] { background: var(--selected); font-weight: 600; }
.opt .c { margin-left: auto; font-size: var(--fs-cap); color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.opt .dotr { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; }
.opt[aria-checked="true"] .dotr { border: 4px solid var(--accent-mark); }

/* ---------- paneles y tarjetas ---------- */
.panel { position: relative; min-width: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.panel > h2, .ph h2 { font-size: var(--fs-row); font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.ph { display: flex; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ph .lead { flex: 1 1 260px; min-width: 0; }
.ph .lead p { margin-top: 2px; font-size: var(--fs-cap); color: var(--text-2); line-height: 1.35; }
.ph .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.pgrid { display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1279px) { .row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 1023px) { .row2, .row3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- cifras (mosaicos) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kpi { min-width: 0; padding: 9px 12px 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 60%, var(--card)); }
.kpi .k { display: block; font-size: var(--fs-cap); color: var(--text-2); line-height: 1.25; }
.kpi .v { display: block; margin-top: 3px; font-size: 20px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: var(--fs-cap); font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.kpi.hero .v { font-size: 26px; }
.kpi .d { display: block; margin-top: 2px; font-size: var(--fs-cap); color: var(--text-2); line-height: 1.3; }
.kpi .v { overflow: visible; text-overflow: clip; }

/* ---------- fichas de ruleta: color real ---------- */
.ch { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 6px; font: 700 14px/1 var(--font); font-variant-numeric: tabular-nums; color: #fff; letter-spacing: -.01em; }
.ch.r { background: var(--ch-r); }
.ch.b { background: var(--ch-b); box-shadow: inset 0 0 0 1px var(--ch-bb); }
.ch.z { background: var(--ch-z); }
.ch.s24 { width: 24px; height: 24px; font-size: 13px; border-radius: 5px; }
.ch.s32 { width: 32px; height: 32px; font-size: 15px; }
.ch.s40 { width: 40px; height: 40px; font-size: 19px; border-radius: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- barras chicas dentro del texto ---------- */
.mbar { position: relative; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.mbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--bar-neutral); }
.mbar i.p { background: var(--gain-bar); } .mbar i.n { background: var(--loss-bar); } .mbar i.a { background: var(--accent-mark); }

/* ---------- avisos y estados ---------- */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-hover); border-radius: var(--radius); background: var(--card); font-size: var(--fs-sec); line-height: 1.45; }
.notice b { display: block; }
.notice .btn { margin-left: auto; flex: none; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-2); font-size: var(--fs-sec); }
.empty b { display: block; color: var(--text); font-size: var(--fs-row); margin-bottom: 4px; }
/* aviso compacto «va con tu cuenta»: una fila, texto y botón */
.gate { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 12px 10px 14px; border: 1px solid var(--line-hover); border-radius: var(--radius); background: var(--card); font-size: var(--fs-sec); color: var(--text-2); }
.gate .gt { display: grid; gap: 2px; flex: 1 1 280px; min-width: 0; }
.gate b { color: var(--text); font-size: var(--fs-row); }
.gate .gate-go { flex: none; gap: 6px; }
.gate .gate-go svg { width: 16px; height: 16px; }
@media (max-width: 767px) { .gate { padding: 10px 12px; } .gate .gate-go { min-height: 44px; } }
/* cartel completo sin cuenta (el mismo de Estrategias: .gate-card) */
.gate-full { position: relative; padding: 32px 0 8px; }
.gate-card { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 28px 32px 26px; border: 1px solid var(--line-hover); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-pop); }
.lb .gate-card .kicker { margin: 0 0 8px; font: 500 var(--fs-cap)/1.3 var(--mono); letter-spacing: .02em; color: var(--text-2); }
.lb .gate-card h1 { margin: 0 0 10px; font-size: var(--fs-h1); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.lb .gate-text { margin: 0 0 18px; font-size: var(--fs-body); line-height: 1.5; color: var(--text-2); }
.lb .gate-list { display: grid; gap: 10px; margin: 0 0 22px; padding: 16px 0 0; list-style: none; border-top: 1px solid var(--line); }
.lb .gate-list li { display: flex; align-items: center; gap: 12px; font-size: var(--fs-row); line-height: 1.35; color: var(--text); }
.gate-list svg { flex: none; width: 18px; height: 18px; padding: 7px; box-sizing: content-box; border-radius: 9px; background: var(--surface); color: var(--accent-mark); }
.gate-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.gate-btn { height: 44px; padding: 0 22px; gap: 8px; font-size: var(--fs-row); }
.gate-btn svg { width: 18px; height: 18px; }
.lb .gate-note { margin: 0; font-size: var(--fs-cap); line-height: 1.45; color: var(--text-2); }
.gate-ghost { position: relative; margin-top: -96px; opacity: .6; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 120px, #000 60%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 120px, #000 60%, transparent 100%); }
.gate-ghost .bcards { max-height: 520px; overflow: hidden; }
@media (max-width: 767px) {
  .gate-full { padding-top: 8px; }
  .gate-card { padding: 22px 18px 20px; }
  .gate-card h1 { font-size: 22px; }
  .gate-actions { flex-direction: column; align-items: stretch; }
  .gate-btn { justify-content: center; }
  .gate-ghost { margin-top: 16px; }
  .gate-ghost .bcards { max-height: 300px; }
}

/* ---------- esqueleto ---------- */
.sk { display: block; border-radius: 6px; background: var(--surface-2); }
.sk-rail { display: grid; gap: 10px; }
@media (prefers-reduced-motion: no-preference) { .sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 45%, var(--surface-2) 90%) 0 0 / 300% 100%; animation: lb-shimmer 1.3s linear infinite; } }
@keyframes lb-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* ---------- tablas ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sec); font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--line-hover); white-space: nowrap; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--surface) 50%, transparent); }

/* ---------- leyenda ---------- */
.leg[hidden] { display: none; }
.leg { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: var(--fs-cap); color: var(--text-2); }
.leg span { display: inline-flex; align-items: center; gap: 6px; }
.leg i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.leg i.bx { width: 10px; height: 10px; border-radius: 2px; }
.leg i.dash { height: 0; border-top: 2px dashed currentColor; background: none !important; }

/* ---------- ayuda desplegable (lo largo detrás de «?») ---------- */
.more { font-size: var(--fs-cap); color: var(--text-2); }
.more summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; font-weight: 600; color: var(--text-2); }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "?"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-hover); font-size: 12px; }
.more[open] summary { color: var(--text); }
.more p { margin-top: 4px; line-height: 1.45; }

/* ---------- cromo de gráficos (igual que Estrategias · ATLAS atlas-charts.css) ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.ac-grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.ac-gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.ac-baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.ac-axis text, .ac-tick { fill: var(--text-2); font: 500 13px var(--mono); font-variant-numeric: tabular-nums; }
.ac-tick.halo { paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.ac-label { fill: var(--text-2); font: 500 13px var(--font); }
.ac-label-strong { fill: var(--text); font: 600 13px var(--font); font-variant-numeric: tabular-nums; }
.ac-annot line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }
.ac-annot circle { fill: var(--card); stroke: var(--dd); stroke-width: 1.75; }
.ac-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ac-dot { stroke: var(--card); stroke-width: 2; }
.ac-crosshair { stroke: var(--text-2); stroke-width: 1; opacity: .55; shape-rendering: crispEdges; pointer-events: none; }
.ac-hit { fill: transparent; cursor: crosshair; }
.ac-hit:focus { outline: none; }
.ac-plot:focus-visible { outline: 2px solid var(--accent-mark); outline-offset: 4px; }
.ac-mark { transition: opacity .18s ease, filter .18s ease; cursor: default; }
.is-dim .ac-mark:not(.is-on) { opacity: .45; }
.ac-mark.is-on { filter: brightness(1.2); }
:root[data-theme="light"] .ac-mark.is-on { filter: brightness(.88); }
.ac-mark:focus-visible { outline: 2px solid var(--accent-mark); }
.dd-area { fill: var(--dd-wash); }
.sal-area { fill: var(--accent-mark); opacity: .07; }
.sal-area.n { opacity: .05; }
.capline { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 4 4; }
.bar.p { fill: var(--gain-bar); } .bar.n { fill: var(--loss-bar); } .bar.lad { fill: var(--bar-neutral); }
.bar.here { stroke: var(--text); stroke-width: 1.5; fill: var(--accent-mark); }
.bar.tp { fill: var(--gain-bar); } .bar.tn { fill: var(--loss-bar); }
.bar.nt { fill: var(--bar-neutral); } .bar.q { fill: var(--dd); opacity: .85; } .bar.hi { fill: var(--accent-mark); }
.wf-link { stroke: var(--axis); stroke-dasharray: 2 2; }
/* bandas del azar: gris en dos niveles (ATLAS demos/funnel-plot-ruletas); lima solo para la serie real */
.cband { fill: var(--text-2); opacity: .2; }
.cexp { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.cobs { fill: none; stroke: var(--accent-mark); stroke-width: 2; }
.fan-50 { fill: var(--text-2); opacity: .30; } .fan-90 { fill: var(--text-2); opacity: .13; }
:root[data-theme="light"] .fan-50 { opacity: .34; } :root[data-theme="light"] .fan-90 { opacity: .16; } :root[data-theme="light"] .cband { opacity: .24; }
.fun-95 { fill: var(--text-2); opacity: .22; } .fun-998 { fill: var(--text-2); opacity: .10; }
.fun-dot { fill: var(--accent-mark); stroke: var(--card); stroke-width: 1.5; }
.fun-dot.out { fill: var(--text); } .fun-dot.sel { stroke: var(--text); stroke-width: 2; }
.fun-lab { font-size: 13px; paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; fill: var(--text); }
.sgn-area.p { fill: var(--gain-bar); opacity: .16; } .sgn-area.n { fill: var(--loss-bar); opacity: .16; }
.dd-brk line { stroke: var(--dd); stroke-width: 1.5; } .dd-brk .dd-peak { stroke-dasharray: 2 3; stroke-width: 1; }
.dd-lab { fill: var(--dd); font: 700 13px var(--font); paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.obs-dot { fill: var(--accent-mark); stroke: var(--card); stroke-width: 1.5; } .obs-zero { fill: none; stroke: var(--text-2); stroke-width: 1.5; }
.ac-endlabels .ac-label-strong { font-size: 13px; }
.ac-leader { stroke: var(--axis); fill: none; }
/* leyenda: muestras de las bandas grises */
.leg i.band95 { background: var(--text-2) !important; opacity: .34; }
.leg i.band998 { background: var(--text-2) !important; opacity: .16; }
.leg i.lime { background: var(--accent-mark) !important; }
.leg i.ref { height: 0 !important; border-top: 2px dashed var(--text-2); background: none !important; }
.cmp-hit { fill: transparent; }
.ac-tip { position: fixed; z-index: 70; pointer-events: none; min-width: 168px; max-width: 300px; background: var(--surface-2); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 10px 12px; font-size: var(--fs-cap); line-height: 1.4; color: var(--text); opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease; }
.ac-tip.is-on { opacity: 1; transform: none; }
.ac-tip-title { font: 600 13px var(--font); color: var(--text); margin-bottom: 6px; }
.ac-tip-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; padding: 2px 0; }
.ac-tip-row.no-key { grid-template-columns: 1fr auto; }
.ac-tip-key { width: 12px; height: 2px; border-radius: 2px; }
.ac-tip-key.rect { height: 8px; width: 8px; border-radius: 2px; margin-left: 2px; }
.ac-tip-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-tip-val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ac-tip-note { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--text-2); }
.sr-only, .ac-sr, .ac-tip-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- celular ---------- */
@media (max-width: 767px) {
  .lb-top { padding: 12px 0 10px; }
  .lb-top h1 { font-size: 22px; }
  .lb-top .right { width: 100%; margin-left: 0; justify-content: space-between; }
  .btn { min-height: 44px; }
  .seg button { min-height: 44px; }
  .inp, .sel { min-height: 44px; }
  .opt { min-height: 44px; }
  .more summary { min-height: 44px; }
  .seg.sm button { min-height: 44px; }
  .panel { padding: 12px; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stamp { white-space: normal; }
  .tbl th { white-space: normal; vertical-align: bottom; }
  .tbl th, .tbl td { padding: 5px 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .seg button, .opt { transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease); }
}

/* ---------- v3 (críticos, ronda 2) ---------- */
@media (min-width: 1280px) {
  .lb-top { flex-wrap: nowrap; align-items: center; }
  .lb-top h1 { flex: none; }
  .lb-top .sub { flex: 1 1 auto; min-width: 0; }
  .lb-top .right { flex: none; }
}
/* rótulos dentro del gráfico (capital, sin capital): sans de 13, no mono */
.lb .ac-tick.halo { font: 600 13px var(--font); fill: var(--text-2); }
/* referencia teórica en gris sólido, no lima */
.lb .lad-cum { stroke: var(--text-2); }
.lg-endpt { font: 600 13px var(--font); paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; fill: var(--text); }
.lg-axt { font: 500 13px var(--font); fill: var(--text-2); }
/* cifras: el valor siempre alineado abajo aunque el rótulo parta */
.kpi { display: flex; flex-direction: column; }
.kpi .v { margin-top: auto; padding-top: 3px; }

/* ---------- índice de Aprender (arriba, sin riel: no filtra) ---------- */
.apr-tabs { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; margin: 0 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.apr-tab { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 8px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-size: var(--fs-cap); font-weight: 600; line-height: 1.2; }
.apr-tab .k { font: 600 13px var(--mono); color: var(--text-2); flex: none; }
.apr-tab:hover { background: var(--surface); color: var(--text); }
.apr-tab[aria-current="page"] { background: var(--ink); color: var(--ink-text); }
.apr-tab[aria-current="page"] .k { color: var(--ink-text); }
.apr-tsel { display: none; margin: 0 0 12px; }
@media (max-width: 1499px) { .apr-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .apr-tabs { display: none; } .apr-tsel { display: block; } }
@media (min-width: 1280px) { .apr-tabs { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
@media (min-width: 1280px) and (max-width: 1599px) { .apr-tab .k { display: none; } .apr-tab { justify-content: center; text-align: center; padding: 4px 6px; } }

/* ---------- v5: cuadros de cifras — el valor siempre debajo del rótulo; rótulo, valor y detalle alineados en la fila ---------- */
.kpi { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 2px; align-content: start; }
.kpi .k { align-self: start; }
.kpi .v { margin-top: 0; padding-top: 0; align-self: end; }
.kpi .d { margin-top: 0; align-self: start; }
/* v5: «Ver más» con flecha (el «?» queda para las ayudas) */
.more.vm > summary::before, .lesson .more > summary::before { content: ""; width: 8px; height: 8px; border: 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; border-radius: 0; transform: rotate(45deg) translateY(-2px); margin: 0 4px 0 2px; }
.more.vm[open] > summary::before, .lesson .more[open] > summary::before { transform: rotate(-135deg) translateY(-2px); }
/* v5: pestañas de Aprender en una sola línea desde 1280 */
@media (min-width: 1280px) {
  .apr-tabs { display: flex; gap: 2px; }
  .apr-tab { flex: 1 1 auto; justify-content: center; white-space: nowrap; padding: 4px 7px; gap: 5px; }
}
.fun-guia { stroke: var(--text-2); stroke-width: 1; }
.hitcol { cursor: crosshair; outline: none; }
.hitcol:focus-visible { stroke: var(--focus); stroke-width: 2; }
.obs-dot.on, .dev-dot.on { r: 7; }
