/* Statera · Estrategias v2 (catálogo de tarjetas + tablero) · Claude 27/09/2026
 * Un solo scroll (el de la página). Riel pegado a x = 0 bajo la barra de 48 px.
 * Texto >= 13 px (12 solo en marcas de ejes SVG). Contrastes con los tokens de tokens-v2.css.
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { margin: 0; background: var(--canvas); color: var(--text); font-family: var(--font); font-size: var(--fs-body); line-height: 1.45; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--ink-text); padding: 8px 12px; border-radius: var(--radius); font-size: var(--fs-sec); }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gain { color: var(--gain); } .loss { color: var(--loss); } .muted { color: var(--text-2); } .of { color: var(--text-2); font-weight: 400; }
.num { font-weight: 600; }

/* ---------------- barra superior 48 ---------------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--bar-h); display: flex; align-items: center; gap: 20px; padding: 0 16px 0 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.logo { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; text-decoration: none; color: var(--text); white-space: nowrap; }
.logo .e { color: var(--brand-red); margin-left: 1px; }
.topnav { display: flex; align-items: center; gap: 4px; height: 100%; }
.topnav > a, .topnav summary { display: flex; align-items: center; height: 100%; padding: 0 12px; text-decoration: none; font-size: var(--fs-row); font-weight: 500; color: var(--text-2); cursor: pointer; list-style: none; border-bottom: 2px solid transparent; }
.topnav summary::-webkit-details-marker { display: none; }
.topnav > a:hover, .topnav summary:hover { color: var(--text); }
.topnav > a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.topnav details { position: relative; height: 100%; }
.topnav .menu { position: absolute; top: calc(100% + 1px); left: 0; min-width: 240px; padding: 6px; z-index: 40; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.topnav .menu-h { margin: 4px 10px 6px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); }
.topnav .menu a { display: flex; align-items: center; height: 40px; border-radius: 4px; padding: 0 10px; text-decoration: none; font-size: var(--fs-sec); font-weight: 500; }
.topnav .menu a:hover { background: var(--surface); }
.toptools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg-mini { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.seg-mini button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; min-width: 40px; height: 32px; padding: 0 10px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg-mini button svg { width: 15px; height: 15px; }
.seg-mini button[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; cursor: pointer; font-size: var(--fs-cap); font-weight: 600; color: var(--text); }
.iconbtn svg { width: 16px; height: 16px; }
.bottomnav { display: none !important; }

/* ---------------- marco: riel + contenido ---------------- */
.frame { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }
.rail-col { background: var(--bg); border-right: 1px solid var(--line); }
.rail { position: sticky; top: var(--bar-h); padding: 12px 16px 16px; }

.rail h2, .rail .h { margin: 0 0 6px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); }
.rail section { padding: 8px 0; border-top: 1px solid var(--line); }
.rail section:first-of-type { border-top: 0; padding-top: 0; }
.search { position: relative; display: block; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-size: var(--fs-row); }
.search input::placeholder { color: var(--text-2); opacity: 1; }
.search svg { position: absolute; left: 11px; top: 12px; width: 16px; height: 16px; color: var(--text-2); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.seg button { height: 36px; border: 0; background: transparent; font-size: var(--fs-sec); font-weight: 500; color: var(--text-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--ink-text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); font-size: var(--fs-cap); font-weight: 500; color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-size: var(--fs-row); }
.banca { display: flex; align-items: center; gap: 8px; }
.banca input { width: 120px; height: 40px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-size: var(--fs-row); font-weight: 600; text-align: right; }
.banca span { font-size: var(--fs-sec); color: var(--text-2); }
.help { margin: 6px 0 0; font-size: var(--fs-cap); color: var(--text-2); line-height: 1.4; }
.fold > summary { display: flex; align-items: center; justify-content: space-between; height: 36px; cursor: pointer; list-style: none; font-size: var(--fs-sec); font-weight: 600; color: var(--text); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); margin: -4px 4px 0 0; }
.fold[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.fold .sub { padding: 6px 0 10px; } .fold .sub + .sub { border-top: 1px solid var(--line); }
.checks { display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: var(--fs-sec); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.check .n { margin-left: auto; color: var(--text-2); }
.check.off { color: var(--text-2); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-size: var(--fs-sec); font-weight: 500; cursor: pointer; }
.sheet-head, .sheet-foot { display: none; }

/* ---------------- detalle: tablero ---------------- */
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; }
.kicker { margin: 0 0 2px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); }
.kicker a { color: var(--text); text-underline-offset: 3px; }
.dhead h1 { margin: 0; font-size: var(--fs-h1); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.dhead h1 .vn { color: var(--text-2); font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: var(--fs-sec); font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); }
.btn.primary { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.btn svg { width: 16px; height: 16px; } .btn[aria-pressed="true"] svg { fill: currentColor; }
.dchips { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kpi { padding: 8px 12px 9px; border-right: 1px solid var(--line); margin-right: -1px; }
.kpi .k { display: block; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.kpi .v { display: block; margin-top: 2px; font-size: 22px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; }
.kpi .d { display: block; margin-top: 1px; font-size: var(--fs-cap); color: var(--text-2); line-height: 1.3; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; margin-top: 12px; align-items: start; }
.dmain { display: grid; gap: 12px; min-width: 0; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pair.one { grid-template-columns: minmax(0, 1fr); }
.panel { min-width: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ph { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ph h2 { margin: 0; font-size: var(--fs-row); font-weight: 700; }
.ph .sub { font-size: var(--fs-cap); color: var(--text-2); }
.note { margin: 6px 0 0; font-size: var(--fs-cap); line-height: 1.4; }
.note.warnline { color: var(--loss); font-weight: 600; }
.tag { font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; }
.tag.warn { color: var(--loss); font-weight: 600; }
.tag.ok { color: var(--text-2); }
/* ruleta por ruleta */
.rtable { width: 100%; border-collapse: collapse; }
.rtable th, .rtable td { height: 27px; padding: 0 6px; border-bottom: 1px solid var(--line); font-size: var(--fs-cap); text-align: right; white-space: nowrap; }
.rtable thead th { height: auto; padding: 4px 6px; font-weight: 600; color: var(--text-2); border-bottom-color: var(--border-strong); white-space: normal; line-height: 1.2; vertical-align: bottom; max-width: 90px; }
.rtable th.rn { text-align: left; font-weight: 500; color: var(--text); font-size: var(--fs-sec); }
.rtable thead th.rn { color: var(--text-2); font-size: var(--fs-cap); font-weight: 600; }
.rtable td { font-weight: 600; font-size: var(--fs-sec); }
.rtable td .of { font-size: var(--fs-cap); }
.rtable td.rbar { text-align: left; }
.rtable td.st { text-align: left; }
.rtable tr.here th, .rtable tr.here td { background: var(--selected); }
.dbar { position: relative; display: inline-block; width: 96px; height: 10px; margin-right: 8px; vertical-align: -1px; }
.dbar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.dbar i { position: absolute; top: 0; height: 100%; }
.dbar i.p { left: 50%; background: var(--gain-bar); border-radius: 0 2px 2px 0; }
.dbar i.n { right: 50%; background: var(--loss-bar); border-radius: 2px 0 0 2px; }
.rtable td.heat { background: color-mix(in srgb, var(--heat) calc(var(--h) * 26%), transparent); }
/* cómo terminaron */
.stack { display: flex; gap: 2px; height: 16px; border-radius: 4px; overflow: hidden; }
.stack i { display: block; min-width: 3px; flex-basis: 0; }
.o-g { background: var(--gain-bar); } .o-p { background: var(--loss-bar); } .o-e { background: var(--border-strong); }
.o-x { background: repeating-linear-gradient(135deg, var(--track) 0 3px, var(--border-strong) 3px 5px); }
.olegend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-cap); }
.olegend li { display: inline-flex; align-items: center; gap: 4px; }
.olegend li i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 2px; }
.olegend .fig { font-weight: 700; }
.lg-b { background: var(--bar-neutral); } .lg-line { height: 2px !important; border-radius: 1px !important; background: var(--text); }
.azar { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.azar-h { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-cap); }
.azar-h .fig { font-weight: 700; font-size: var(--fs-sec); }
.bullet { position: relative; height: 18px; margin-top: 6px; }
.bl-track { position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--track); }
.bl-exp { position: absolute; top: 1px; width: 2px; height: 16px; margin-left: -1px; background: var(--text-2); }
.bl-obs { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.bl-axis { display: flex; justify-content: space-between; font-size: var(--fs-cap); color: var(--text-2); }
/* plata por jugada */
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mrow:last-of-type { border-bottom: 0; }
.ml { font-size: var(--fs-cap); color: var(--text-2); grid-column: 1 / -1; }
.hbar { height: 12px; background: var(--track); border-radius: 3px; overflow: hidden; }
.hbar i { display: block; height: 100%; } .hbar i.p { background: var(--gain-bar); } .hbar i.n { background: var(--loss-bar); }
.mv { font-size: 20px; font-weight: 700; text-align: right; }
.ms { grid-column: 1 / -1; font-size: var(--fs-cap); color: var(--text-2); }
.ms .fig { color: var(--text); font-weight: 600; }
/* gráficos SVG */
.ladder, .hist, .scatter { display: block; width: 100%; height: auto; }
.ladder .b { fill: var(--bar-neutral); } .ladder .n { fill: var(--loss-bar); }
.ladder .cum { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ladder .cap { stroke: var(--loss); stroke-width: 1.5; }
.ladder .grid, .hist .grid { stroke: var(--line); stroke-width: 1; }
.tick { font-size: 12px; fill: var(--text-2); font-family: var(--font); }
.capl { fill: var(--loss); font-weight: 600; }
.hist .b { fill: var(--bar-neutral); } .hist .me { fill: var(--ink); } .hist .zero, .scatter .zero { stroke: var(--border-strong); stroke-width: 1; }
.rankline { margin: 0 0 6px; font-size: var(--fs-sec); font-weight: 600; }
.scatter .p { fill: var(--gain-bar); } .scatter .n { fill: var(--loss-bar); }
.scatter circle { stroke: var(--bg); stroke-width: 2; }
.scatter .me { fill: var(--ink); }
/* variantes */
.vwrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.vscatter { margin: 0; }
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 6px; }
.vcard { display: flex; flex-direction: column; gap: 1px; padding: 6px 9px 7px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.vcard:hover { border-color: var(--border-strong); background: var(--surface); }
.vcard .vn { font-size: var(--fs-cap); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .vl { font-size: var(--fs-row); font-weight: 700; }
.vcard .vm { font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .vm .fig { color: var(--text); font-weight: 600; }
.vcard .vm .fig.loss { color: var(--loss); }
/* panel lateral: cómo juega */
.dside .panel { padding: 10px 14px 12px; }
.vfy { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; font-size: var(--fs-cap); color: var(--text-2); }
.vfy::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text-2); }
.vfy.ok::before { background: var(--gain-bar); border-color: var(--gain-bar); }
.vflow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.vflow li { position: relative; padding: 6px 0 8px 12px; border-left: 2px solid var(--line); }
.vflow li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }
.vflow .st { display: block; font-size: var(--fs-cap); color: var(--text-2); font-weight: 600; }
.vflow .st b { color: var(--text); }
.vflow .tx { display: block; font-size: var(--fs-sec); font-weight: 600; line-height: 1.35; }
.dside h3 { margin: 12px 0 4px; font-size: var(--fs-sec); font-weight: 700; }
.why { margin: 0; font-size: var(--fs-sec); line-height: 1.4; }
.bul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bul li { position: relative; padding-left: 20px; font-size: var(--fs-sec); line-height: 1.35; }
.bul li::before { position: absolute; left: 0; top: 1px; width: 15px; height: 15px; border-radius: 50%; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text); }
.bul.si li::before { content: "✓"; } .bul.no li::before { content: "–"; }
.nums { display: flex; flex-wrap: wrap; gap: 3px; }
.rn-chip { width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-cap); font-weight: 700; color: #FFFFFF; }
.rn-chip.r { background: var(--chip-red); } .rn-chip.b { background: var(--chip-black); box-shadow: inset 0 0 0 1px var(--chip-black-border); } .rn-chip.g { background: var(--chip-green); }
.fullrules { margin-top: 12px; border-top: 1px solid var(--line); }
.fullrules > summary { min-height: 36px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-sec); font-weight: 600; list-style: none; }
.fullrules > summary::-webkit-details-marker { display: none; }
.fullrules > summary::before { content: "?"; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.fullrules h4 { margin: 10px 0 2px; font-size: var(--fs-cap); font-weight: 700; }
.fullrules ul { margin: 0; padding-left: 16px; }
.fullrules li, .ladderline { font-size: var(--fs-cap); line-height: 1.45; margin: 2px 0; }
.tech { margin-top: 8px; font-size: var(--fs-cap); color: var(--text-2); }
.tech summary { cursor: pointer; min-height: 28px; display: flex; align-items: center; }
.tech code { font-size: var(--fs-cap); color: var(--text); word-break: break-all; }
.tech p { margin: 4px 0 0; }

/* ---------------- tamaños intermedios ---------------- */
@media (max-width: 1440px) { .dash { grid-template-columns: minmax(0, 1fr) 290px; } .dbar { width: 56px; } .rtable th, .rtable td { padding: 0 4px; } }
@media (max-width: 1279px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dside { order: -1; }
  .minibar { display: none; }
}

/* ---------------- riel como hoja (abajo de 1024) ---------------- */
@media (max-width: 1023px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .rail-col { display: none; }
  .rail-col.open { display: block; position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
  .rail-col.open .rail { position: static; padding: 0 16px 96px; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; height: 56px; position: sticky; top: 0; background: var(--bg); z-index: 2; border-bottom: 1px solid var(--line); margin: 0 -16px 8px; padding: 0 16px; }
  .sheet-head b { font-size: var(--fs-h3); }
  .sheet-foot { display: block; position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); z-index: 3; }
  .sheet-foot .btn { width: 100%; justify-content: center; height: 48px; }
  .filtersbtn { display: inline-flex; }
  body.sheet-open { overflow: hidden; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .vwrap { grid-template-columns: minmax(0, 1fr); }
  .rtable .c-apj, .rtable .c-wd { display: none; }
}

/* ---------------- celular ---------------- */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .topbar { gap: 8px; padding: 0 10px 0 14px; }
  .topnav > a { display: none; }
  .topnav summary { padding: 0 10px; }
  .topnav .menu { left: auto; right: -120px; }
  .main { padding: 14px var(--gutter) 32px; }
  .lh1 .tools { width: 100%; margin-left: 0; } .sortlab { flex: 1; min-width: 0; } .sortsel { flex: 1; min-width: 0; }
  .sortlab > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lh1 .stamp { white-space: normal; }
  .pills { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
  .hlegend { white-space: normal; }
  .pill { height: auto; min-height: 48px; padding: 6px 12px; border-radius: 12px; justify-content: space-between; text-align: left; line-height: 1.25; font-size: var(--fs-cap); }
  .seg-mini button, .iconbtn, .filtersbtn, .sortsel, .pill, .chip, .btn, .morebtn, .select, .search input, .banca input, .seg button, .vchip, .varbtn { min-height: 44px; }
  .seg-mini button { min-width: 44px; height: 44px; }
  .iconbtn { height: 44px; min-width: 44px; }
  .sortsel { height: 44px; }
  .chip, .vchip { height: 44px; min-width: 44px; justify-content: center; }
  .check { min-height: 44px; }
  .fold > summary, .fullrules > summary { height: 44px; }
  .starbtn { width: 44px; height: 44px; margin: -10px -10px 0 0; }
  .c-name, .kicker a, .linkbtn, .others > summary, .howread > summary, .tech summary, .uelist > summary { min-height: 44px; }
  .c-head { height: auto; }
  .c-name { display: flex; align-items: center; }
  .c-meta { height: 44px; } .c-var { height: 44px; }
  .card { gap: 8px; }
  .kicker a { display: inline-flex; align-items: center; }
  .linkbtn { display: inline-flex; align-items: center; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid thead { display: none; }
  .grid tbody tr { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding: 10px 12px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 8px; }
  .grid tbody td { height: auto; padding: 0; border: 0; text-align: left; white-space: normal; }
  .grid .t-entra, .grid .t-gana { display: block; }
  .grid td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-cap); font-weight: 500; color: var(--text-2); line-height: 1.3; margin-bottom: 1px; }
  .grid td.t-strip { grid-column: 1 / -1; padding: 0; }
  .grid .c-strip.mini .strip { height: 24px; }
  .varpop { left: 8px !important; right: 8px; width: auto; min-width: 0; max-width: none; }
  .vp-list { grid-template-columns: minmax(0, 1fr) !important; }
  .grid td.name { grid-column: 1 / -1; order: -1; padding-right: 44px; max-width: none; }
  .grid td.star { position: absolute; right: 8px; top: 8px; width: auto; }
  .namecell { flex-wrap: wrap; } .namecell a { flex-wrap: wrap; min-height: 44px; align-items: center; } .namecell .fam { white-space: normal; }
  .dhead h1 .vn { display: block; } .dhead h1 .vn .dot { display: none; }
  .actions { width: 100%; } .actions .btn { flex: 1; justify-content: center; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-bottom: 1px solid var(--line); }
  .rtable .c-rinde, .rtable .c-entra { display: none; }
  .dbar { display: none; }
  .dchips { display: none; }
  .rtable th, .rtable td { padding: 0 3px; }
  .rtable th.rn { white-space: normal; line-height: 1.2; max-width: 120px; padding: 3px 3px; }
  .rtable td .of { display: block; line-height: 1.1; }
  .rtable td.heat { line-height: 1.15; }
}

@media (prefers-reduced-motion: no-preference) {
  .pill, .chip, .vchip, .card, .btn { transition: background-color .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease; }
}

/* cajas de gráfico: marcas SVG estiradas + textos HTML */
.chart { position: relative; width: 100%; }
.chart svg { position: absolute; width: auto; height: auto; overflow: visible; }
.chart .plot { position: absolute; }
.chart .tick { position: absolute; font-size: 12px; line-height: 1; color: var(--text-2); white-space: nowrap; }
.chart .yt { left: 0; text-align: right; transform: translateY(-50%); }
.chart .xt { bottom: 0; transform: translateX(-50%); }
.chart .xt.l0 { transform: none; } .chart .xt.r1 { transform: translateX(-100%); }
.chart .caplabel { position: absolute; right: 2px; transform: translateY(-120%); font-size: var(--fs-cap); font-weight: 600; color: var(--loss); background: var(--bg); padding: 0 3px; }
.chart .dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); }
.chart .dot.p { background: var(--gain-bar); } .chart .dot.n { background: var(--loss-bar); } .chart .dot.me { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--ink); z-index: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .zero { stroke: var(--border-strong); stroke-width: 1; }
.chart .b { fill: var(--bar-neutral); } .chart .n { fill: var(--loss-bar); } .chart .me { fill: var(--ink); }
.chart .cum { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.chart .cap { stroke: var(--loss); stroke-width: 1.5; }
.p-ladder .olegend .o-p { width: 10px; height: 10px; }

/* «cada 100 apostadas» con la marca de la casa */
.hb { position: relative; display: inline-block; width: 44px; height: 10px; margin-right: 8px; vertical-align: -1px; background: linear-gradient(var(--track), var(--track)) center / 100% 2px no-repeat; }
.hb .hb-h { position: absolute; top: -1px; bottom: -1px; width: 2px; margin-left: -1px; background: var(--bar-neutral); }
.hb .hb-v { position: absolute; top: 1px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.hb-legend { width: 14px; margin: 0 2px 0 0; background: none; }
.housenote { margin: -4px 0 12px; font-size: var(--fs-cap); color: var(--text-2); }
.housenote .fig { color: var(--text); font-weight: 700; }
.uenote { margin: -4px 0 12px; padding: 8px 10px; border-left: 3px solid var(--bar-neutral); background: var(--surface); font-size: var(--fs-sec); }
.uenote.big { margin: 12px 0 0; font-size: var(--fs-row); }
.strip .ue { fill: var(--bar-neutral); }
.rtable tr.ue th, .rtable tr.ue td { color: var(--text-2); }
.rtable td.uecell { text-align: left; font-weight: 500; font-size: var(--fs-cap); }
.rsplit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.sticon, .iconkey { display: none; }
@media (min-width: 1600px) {
  .rsplit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rsplit .rtable { table-layout: fixed; }
  .rsplit .c-apj, .rsplit .c-entra, .rsplit .c-wd, .rsplit .st { display: none; }
  .rsplit th.rn { width: 40%; overflow: hidden; text-overflow: ellipsis; }
  .rsplit th.rbar, .rsplit td.rbar { width: 28%; }
  .rsplit .dbar { width: 44px; }
  .rsplit .c-rinde { width: 12%; }
  .rsplit .sticon { display: inline-block; width: 14px; margin-right: 3px; font-weight: 700; color: var(--text-2); }
  .rsplit .sticon.warn { color: var(--loss); }
  .iconkey { display: flex; gap: 4px 12px; flex-wrap: wrap; margin: 6px 0 0; font-size: var(--fs-cap); color: var(--text-2); }
  .iconkey .sticon { display: inline-block; font-weight: 700; margin-right: 3px; } .iconkey .sticon.warn { color: var(--loss); }
}
.aliasline { margin: 8px 0 0; font-size: var(--fs-cap); color: var(--text-2); }
.uenote a { color: var(--text); font-weight: 600; }
.uelist { margin-top: 8px; font-size: var(--fs-cap); color: var(--text-2); }
.uelist > summary { cursor: pointer; min-height: 28px; display: inline-flex; align-items: center; gap: 4px; }
.uelist .fig { color: var(--text); font-weight: 600; }
.uelist ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.uelist li { font-size: var(--fs-cap); }

@media (max-width: 767px) { .uelist > summary { min-height: 44px; } }

/* ---------------- v3: superficie de trabajo, esqueleto y movimiento ---------------- */
.topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); }
.grid thead th { background: var(--card); }
.grid thead th:first-child { border-top-left-radius: 12px; } .grid thead th:last-child { border-top-right-radius: 12px; }
.grid tbody tr:last-child td { border-bottom: 0; }
.panel, .kpis { background: var(--card); }
.pill, .chip, .sortsel, .seg-mini, .iconbtn, .btn, .morebtn { background-color: var(--bg); }
.seg-mini button[aria-pressed="true"] { background: var(--ink); }
.pill:hover:not([aria-pressed="true"]), .chip:hover:not([aria-pressed="true"]), .morebtn:hover, .btn:hover:not(.primary) { border-color: var(--text-2); background: var(--surface); }
.seg-mini button:hover:not([aria-pressed="true"]) { color: var(--text); background: var(--surface); }
.starbtn:hover { color: var(--text); background: var(--surface); }
.c-var:focus-visible, .c-name:focus-visible { outline-offset: 1px; }
.vp-item:focus-visible { outline-offset: -2px; }
.check:hover span:first-of-type { color: var(--text); }
.sk { display: block; border-radius: 6px; background: var(--surface-2); }
.skel .lhead { margin-bottom: 12px; }
.sk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sk-card { cursor: default; box-shadow: none; }
.sk-card:hover { border-color: var(--line); box-shadow: none; }
.sk-rail { display: grid; gap: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
  .card:hover { transform: translateY(-2px); }
  .pill, .chip, .vchip, .btn, .iconbtn, .seg-mini button, .sortsel, .starbtn, .vp-item, .check, .morebtn, .linkbtn { transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease); }
  .pill:active, .chip:active, .btn:active, .iconbtn:active, .morebtn:active { transform: scale(.97); }
  .varpop { animation: pop-in .16s var(--ease); }
  .starbtn[aria-pressed="true"] svg { animation: star-pop .28s var(--ease); }
  .fade-in { animation: fade-in .2s var(--ease); }
  .c-strip .sth { transition: left .08s linear; }
  .sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 45%, var(--surface-2) 90%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
  .striptip { animation: fade-in .1s ease-out; }
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes star-pop { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes fade-in { from { opacity: .35; } to { opacity: 1; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--line-hover); border-bottom-width: 2px; border-radius: 4px; font: 600 13px/1 var(--font); color: var(--text-2); }
.search kbd { position: absolute; right: 10px; top: 11px; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
@media (max-width: 1023px) { .search kbd { display: none; } }

/* detalle: anterior / siguiente */
.pnav { display: inline-flex; align-items: center; gap: 6px; }
.pnav .pos { font-size: var(--fs-cap); color: var(--text-2); min-width: 64px; text-align: center; }
.btn.pn { height: 36px; padding: 0 12px; gap: 6px; font-size: var(--fs-sec); }
.btn.pn.off { color: var(--text-2); border-color: var(--line); cursor: default; }
.dhead .actions { align-items: center; }
@media (max-width: 767px) { .pnav { width: 100%; justify-content: space-between; } .btn.pn { height: 44px; } }
/* fichas de variantes del detalle */
.vchip { max-width: 100%; height: 28px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: var(--fs-cap); font-weight: 600; color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vchip:hover { border-color: var(--line-hover); background: var(--surface); }
.vchip[aria-pressed="true"], .vchip[aria-current="page"] { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.vchip.more { border-color: var(--border-strong); }
@media (max-width: 767px) {
  .lh1 > * { min-width: 0; }
  .pills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill { white-space: normal; min-width: 0; }
  .sortlab { min-width: 0; } .sortsel { width: 100%; min-width: 0; }
  .varbtn { min-width: 44px; }
}
@media (max-width: 767px) { .roul-tools .linkbtn, .roul-more { min-height: 44px; min-width: 44px; justify-content: center; } }

/* =====================================================================
   v3.1 · sistema ATLAS (graphite-lime, bento, tech-grid) · catálogo 1B + abierta 6B
   Cromo de gráficos tomado de ATLAS/11_Dashboards-DataViz/demos/atlas-charts.css (ac-*),
   con texto >= 13 px y contraste >= 7:1 (las marcas de ejes pueden ir a 12 px).
   ===================================================================== */
.main { padding: 0 var(--gutter) 40px; min-width: 0; outline: none; }
.mono, .eyebrow { font-family: var(--mono); }
.loading { color: var(--text-2); font-size: var(--fs-row); }

/* barra de herramientas pegada (conteo · atajos · orden · vista) */
.toolbar { position: sticky; top: var(--bar-h); z-index: 20; display: flex; align-items: center; gap: 8px 16px; min-height: 56px; margin: 0 calc(-1 * var(--gutter)); padding: 8px var(--gutter); background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px); border-bottom: 1px solid var(--line); }
.tb-count { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; min-width: 0; }
.tb-count h1.count { margin: 0; display: flex; align-items: baseline; gap: 7px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.tb-count h1 .big { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.tb-count .sub { font-size: var(--fs-sec); color: var(--text-2); white-space: nowrap; }
.tb-count .sub .fig { color: var(--text-2); }
.tb-pills { flex: 1; min-width: 0; display: flex; justify-content: center; }
.toolbar .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sortlab { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sec); color: var(--text-2); }
.sortsel, .chartsel { height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line-hover); border-radius: 9px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; -webkit-appearance: none; font-size: var(--fs-sec); font-weight: 600; color: var(--text); cursor: pointer; }
.sortsel:hover, .chartsel:hover { border-color: var(--border-strong); }
.filtersbtn { display: none; }
.filtersbtn .n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-cap); }
.lh2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 10px 0 12px; }
.lh2-pills { display: none; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line-hover); border-radius: 999px; background: var(--card); font-size: var(--fs-sec); font-weight: 600; cursor: pointer; color: var(--text); white-space: nowrap; }
.pill .n { font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill[aria-pressed="true"] .n { color: var(--accent-ink); }
.pill[aria-pressed="true"]::after { content: "×"; font-size: 16px; line-height: 1; margin-left: -2px; }
.stamp { display: inline-flex; align-items: center; gap: 8px; margin: 0; 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); }
.hlegend { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; }
.lg-l, .lg-d { display: inline-block; width: 16px; height: 2px; border-radius: 2px; }
.lg-l { background: var(--accent-mark); } .lg-d { background: var(--dd); margin-left: 6px; }
.howread { font-size: var(--fs-sec); margin-left: auto; }
.howread > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 30px; color: var(--text); font-weight: 500; list-style: none; white-space: nowrap; }
.howread > summary::-webkit-details-marker { display: none; }
.howread > summary::before { content: "?"; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-hover); display: inline-flex; align-items: center; justify-content: center; font: 700 12px var(--mono); }
.howread[open] { flex-basis: 100%; margin-left: 0; }
.howread ul.defs { margin: 8px 0 4px; padding: 12px 16px 6px 30px; columns: 2 360px; column-gap: 32px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.howread ul.defs li { font-size: var(--fs-sec); line-height: 1.45; margin: 0 0 8px; break-inside: avoid; color: var(--text); }
.actives { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; }
.actives .chip::after { content: "×"; font-size: 15px; color: var(--text-2); }
.morebtn { display: block; margin: 18px auto 0; height: 40px; padding: 0 20px; border: 1px solid var(--line-hover); border-radius: 999px; background: var(--card); font-size: var(--fs-sec); font-weight: 600; color: var(--text); cursor: pointer; }
.empty { padding: 32px 0; font-size: var(--fs-row); } .empty p { margin: 0 0 10px; }
.others { margin-top: 16px; font-size: var(--fs-sec); color: var(--text-2); }
.others > summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.others ul { margin: 8px 0 0; padding: 0; list-style: none; columns: 4 200px; column-gap: 24px; }
.others li { font-size: var(--fs-sec); line-height: 1.8; break-inside: avoid; }
@media (max-width: 1499px) {
  .tb-pills { display: none; }
  .lh2-pills { display: block; }
  .viewtoggle button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------------- tarjetas (1B): nombre · variante · qué hace · 3 cifras · evolución · pie ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(296px, 1fr)); grid-auto-flow: row dense; gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; gap: 5px; height: 238px; padding: 11px 14px 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); cursor: pointer; min-width: 0; overflow: hidden; }
.card:hover { border-color: var(--line-hover); box-shadow: var(--shadow-lift); }
.card:focus-within { border-color: var(--line-hover); }
.c-head { display: flex; align-items: flex-start; gap: 4px; height: 22px; padding-right: 26px; }
.c-name { position: relative; display: block; flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; font: 650 16px/22px var(--font); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); cursor: pointer; }
.c-name:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 4px; }
.card .starbtn { position: absolute; top: 7px; right: 8px; margin: 0; }
.c-sub { display: flex; align-items: center; gap: 8px; height: 20px; min-width: 0; font-size: var(--fs-cap); }
.c-var { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; height: 20px; padding: 0; border: 0; background: none; font-size: var(--fs-cap); font-weight: 600; color: var(--text); cursor: pointer; }
.c-var .vname { min-width: 0; max-width: 60%; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-var .vcount, .vcount.static { flex-shrink: 0; color: var(--text-2); font-weight: 500; white-space: nowrap; padding-left: 8px; border-left: 1px solid var(--line-hover); }
.vcount.static { margin-left: auto; border-left: 0; padding-left: 0; }
.c-var::after { content: ""; flex-shrink: 0; width: 6px; height: 6px; margin: -3px 2px 0 0; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(45deg); }
.c-var:hover .vname, .c-var[aria-expanded="true"] .vname { text-decoration: underline; text-underline-offset: 3px; }
.c-kind { min-width: 0; font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-does { margin: 1px 0 0; height: 40px; font-size: var(--fs-sec); line-height: 20px; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.c-stats { margin: 2px 0 0; display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 10px; }
.c-stats .st { min-width: 0; }
.c-stats dt { font-size: var(--fs-cap); line-height: 16px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-stats dd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 24px; font-variant-numeric: tabular-nums; }
.c-stats dd .fig { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.c-stats .st-saldo dd .fig { font-size: 21px; letter-spacing: -.02em; }
.c-stats small, .c-foot small { font-size: var(--fs-cap); font-weight: 400; color: var(--text-2); }
.is-sorted dt, .c-foot .is-sorted { color: var(--text); }
.is-sorted dt::after { content: " ↓"; color: var(--accent-mark); }
.c-foot .is-sorted { box-shadow: inset 0 -2px 0 var(--accent-mark); }
.c-chart { position: relative; flex: 1; min-height: 50px; margin-top: 2px; }
.c-chart .chartsel { position: absolute; top: -2px; right: 0; z-index: 2; height: 24px; padding: 0 22px 0 8px; font-size: var(--fs-cap); font-weight: 600; border-radius: 7px; background-position: right 7px center; opacity: .0; transition: opacity .15s ease; }
.card:hover .c-chart .chartsel, .c-chart .chartsel:focus, .c-chart .chartsel:focus-visible { opacity: 1; }
.evo-box, .c-strip { position: relative; height: 100%; min-height: 50px; }
.evo-box.is-loading::before { content: ""; position: absolute; inset: 8px 0 8px; border-radius: 6px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 45%, var(--surface) 90%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
.evo { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.evo-area { fill: var(--accent-mark); opacity: .10; }
.evo-line { fill: none; stroke: var(--accent-mark); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.evo-dd { fill: none; stroke: var(--dd); stroke-width: 1.25; stroke-linejoin: round; opacity: .95; }
.evo-zero { stroke: var(--axis); stroke-width: 1; }
.evo-end, .evo-dot { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--accent-mark); box-shadow: 0 0 0 2px var(--card); pointer-events: none; }
.evo-dot { background: var(--text); }
.evo-x { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--text-2); opacity: .5; pointer-events: none; }
.evo-y { position: absolute; left: 0; font: 500 12px/1 var(--mono); color: var(--text-2); background: color-mix(in srgb, var(--card) 80%, transparent); padding: 1px 3px 1px 0; pointer-events: none; }
.evo-y.hi { top: 0; } .evo-y.lo { bottom: 0; }
.evo-none { font-size: var(--fs-cap); }
.c-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 18px; font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; }
.c-foot > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.c-foot b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.c-foot b.loss { color: var(--loss); }
.c-foot .fig { color: var(--text); }
/* tira por ruleta (modo «Por ruleta») */
.c-strip .strip { display: block; width: 100%; height: 34px; }
.strip .p { fill: var(--gain-bar); } .strip .n { fill: var(--loss-bar); }
.strip .zero { stroke: var(--text-2); stroke-width: 1; }
.strip .here { stroke: var(--text); stroke-width: 1; }
.strip .chev { fill: none; stroke: var(--text); stroke-width: .8; }
.c-sl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; }
.c-sl b { font-weight: 650; }

/* ---------------- ventana de variantes ---------------- */
.varpop { position: absolute; z-index: 45; width: max-content; min-width: 320px; max-width: min(900px, calc(100vw - 16px)); padding: 6px 8px 8px; background: var(--surface-2); border: 1px solid var(--line-hover); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.vp-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 4px 2px 8px 8px; border-bottom: 1px solid var(--line); }
.vp-h b { display: block; font-size: var(--fs-row); }
.vp-h span { font-size: var(--fs-cap); color: var(--text-2); }
.vp-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 2px 12px; padding-top: 6px; }
.vp-item { display: grid; grid-template-columns: minmax(0, 1fr) 56px 76px 52px; align-items: center; gap: 10px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: var(--fs-sec); color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.vp-item:hover { background: var(--surface); }
.vp-item[aria-pressed="true"] { background: var(--selected); box-shadow: inset 0 0 0 1px var(--accent-mark); }
.vp-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.vp-bar { position: relative; height: 6px; border-radius: 3px; background: var(--track); }
.vp-bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--text-2); }
.vp-bar i { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.vp-bar i.p { background: var(--gain-bar); } .vp-bar i.n { background: var(--loss-bar); }
.vp-s { text-align: right; font-weight: 700; }
.vp-g { text-align: right; font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; }
.xbtn { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line-hover); border-radius: 10px; background: var(--card); color: var(--text); cursor: pointer; }
.xbtn svg { width: 18px; height: 18px; }
.xbtn:hover { background: var(--surface); border-color: var(--border-strong); }

/* riel: una sola sección de ruletas */
.roul h2 .st { font-weight: 500; color: var(--text); }
.roul .seg { margin-bottom: 8px; }
.roul-q { display: block; }
.roul-q input { width: 100%; }
.roul-links { display: flex; gap: 14px; margin-top: 6px; }
.search.small input { height: 34px; font-size: var(--fs-sec); }
.search.small svg { top: 9px; }
.linkbtn[disabled] { color: var(--text-2); text-decoration: none; cursor: default; }
.roul-list { display: none; margin-top: 6px; }
.roul-list.open, .roul-list.searching { display: grid; }
.roul-list .check[hidden] { display: none; }
.roul-list .check .n { margin-left: auto; font-size: var(--fs-cap); color: var(--text-2); }
.roul-more { margin-top: 6px; }

/* ---------------- tabla ---------------- */
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.grid th.t-star { width: 38px; } .grid th.t-name { width: 340px; } .grid th.t-saldo { width: 84px; } .grid th.t-evo { width: 150px; } .grid th.t-rinde { width: 82px; }
.grid th.t-gan { width: 150px; } .grid th.t-peor { width: 86px; } .grid th.t-sin { width: 84px; } .grid th.t-gana { width: 84px; } .grid th.t-entra { width: 110px; }
.grid td { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1599px) { .grid .t-entra { display: none; } .grid th.t-name { width: 300px; } }
@media (max-width: 1399px) { .grid .t-gana { display: none; } .grid th.t-name { width: 260px; } .grid th.t-evo { width: 120px; } }
@media (max-width: 1199px) { .grid .t-peor { display: none; } }
.grid thead th { position: sticky; top: calc(var(--bar-h) + 56px); z-index: 5; background: var(--card); height: 40px; padding: 0 8px; text-align: right; vertical-align: middle; border-bottom: 1px solid var(--line-hover); font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.grid thead th:first-child { border-top-left-radius: var(--radius-lg); } .grid thead th:last-child { border-top-right-radius: var(--radius-lg); }
.grid thead th.t-name, .grid thead th.t-evo { text-align: left; }
.grid thead th button, .grid thead th .thb { border: 0; background: none; padding: 2px 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.grid thead th.t-name button, .grid thead th.t-evo .thb { align-items: flex-start; }
.grid thead th .u { font-weight: 500; color: var(--text-3); }
.grid thead th[aria-sort] button { color: var(--text); }
.grid thead th[aria-sort="descending"] .l::after { content: " ↓"; color: var(--accent-mark); } .grid thead th[aria-sort="ascending"] .l::after { content: " ↑"; color: var(--accent-mark); }
.grid tbody td { height: 36px; padding: 0 8px; border-bottom: 1px solid var(--line); font-size: var(--fs-sec); text-align: right; white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; }
.grid tbody td.is-sorted { background: color-mix(in srgb, var(--accent-mark) 5%, transparent); }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: var(--surface); }
.grid tbody tr[aria-expanded="true"] td { background: var(--selected); }
.grid td.star { padding: 0 0 0 4px; text-align: left; } .grid td.star .starbtn { margin: 0; position: static; }
.grid td.name { text-align: left; }
.grid td.t-evo { padding: 3px 8px; }
.grid .evo-box.mini { height: 26px; min-height: 26px; }
.grid .evo-box.mini .evo-y { display: none; }
.grid .of { font-size: var(--fs-cap); color: var(--text-2); font-weight: 400; }
.namecell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.namecell a { display: flex; align-items: baseline; gap: 8px; min-width: 0; text-decoration: none; }
.namecell .fam { flex-shrink: 0; max-width: 100%; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-row); }
.namecell .vn { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text-2); }
.tr-var .namecell { padding-left: 16px; } .tr-var .namecell .fam { font-weight: 500; }
.varbtn { flex-shrink: 0; height: 24px; padding: 0 8px; border: 1px solid var(--line-hover); border-radius: 999px; background: var(--surface); font-size: var(--fs-cap); font-weight: 600; color: var(--text); cursor: pointer; margin-left: auto; }
.grid tr.xrow td { height: auto; padding: 8px; text-align: left; white-space: normal; background: var(--canvas); cursor: default; }
.grid tr.xrow:hover td { background: var(--canvas); }
.card.in-table { height: auto; }

/* ---------------- tarjeta abierta (6B): fila completa ---------------- */
.card.is-open { grid-column: 1 / -1; height: auto; cursor: default; gap: 10px; padding: 14px 18px 14px; border-color: var(--line-hover); background: var(--card); box-shadow: var(--shadow-lift); outline: none; overflow: visible; }
.card.is-open:hover { transform: none; }
.card.is-open:focus-visible { box-shadow: 0 0 0 2px var(--focus), var(--shadow-lift); }
.x-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.x-titles { min-width: 0; flex: 1 1 360px; }
.x-head .c-name { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.02em; white-space: normal; }
.x-head .c-name:hover { text-decoration: none; }
.x-head .c-sub { height: auto; margin-top: 2px; flex-wrap: wrap; }
.x-actions { display: flex; align-items: center; gap: 8px; }
.x-actions .starbtn { position: static; }
.btn.primary, .x-full { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.x-full svg { width: 16px; height: 16px; }
.x-full:hover { filter: brightness(1.06); }
.x-does { margin: 0; font-size: var(--fs-row); line-height: 21px; color: var(--text); max-width: 110ch; }
.x-why { color: var(--text-2); }
.x-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 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); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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.hero .v { font-size: 24px; }
.kpi .d { display: block; margin-top: 2px; font-size: var(--fs-cap); color: var(--text-2); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d .fig { color: var(--text-2); }
.x-grid3 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .95fr); gap: 10px; }
.x-panel { min-width: 0; padding: 10px 12px 8px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 35%, var(--card)); }
.xp-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.chartsel { height: 30px; font-size: var(--fs-cap); border-radius: 8px; background-color: var(--card); }
.chartsel.strong { font-size: var(--fs-sec); border-color: transparent; background-color: transparent; padding-left: 2px; }
.chartsel.strong:hover { border-color: var(--line-hover); }
.x-curve, .x-bars { height: 196px; }
.x-skel { height: 180px; margin-top: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 45%, var(--surface) 90%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
.x-how h3 { margin: 2px 0 8px; font-size: var(--fs-sec); font-weight: 700; }
.x-how h3 + ul { margin-bottom: 0; }
.x-how h3:not(:first-child) { margin-top: 10px; }
.xsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.xsteps li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.xs-k { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.xs-k b { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font: 700 12px var(--mono); }
.xs-v { font-size: var(--fs-sec); line-height: 19px; color: var(--text); }
.x-foot { display: flex; align-items: flex-end; gap: 24px; padding-top: 8px; border-top: 1px solid var(--line); }
.x-vars { flex: 1; min-width: 0; }
.x-sh { display: flex; align-items: baseline; gap: 10px; font-size: var(--fs-cap); line-height: 18px; }
.x-sh .lab { font-weight: 700; color: var(--text); }
.x-lost { margin: 0; font-size: var(--fs-sec); color: var(--text-2); max-width: 44ch; }
.x-lost .fig { color: var(--loss); font-weight: 700; }
.vdots { position: relative; height: 18px; margin: 4px 7px 0; background: linear-gradient(var(--track), var(--track)) center / 100% 2px no-repeat; }
.vdots .vz { position: absolute; top: 1px; bottom: 1px; width: 1px; background: var(--text-2); }
.vdots .vd { position: absolute; top: 5px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; cursor: default; }
.vd.p { background: var(--gain-bar); } .vd.n { background: var(--loss-bar); }
.vd.me { top: 2px; width: 14px; height: 14px; margin-left: -7px; background: var(--accent-mark); box-shadow: 0 0 0 2px var(--card); z-index: 1; }
.vd-ax { display: flex; justify-content: space-between; margin: 2px 0 0; font: 500 12px var(--mono); color: var(--text-2); }
@media (max-width: 1599px) { .x-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1279px) { .x-grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .x-how { grid-column: 1 / -1; } }

/* ---------------- cromo de gráficos ATLAS (ac-*) ---------------- */
.ac-grid line { 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 12px var(--mono); font-variant-numeric: tabular-nums; }
.ac-label { fill: var(--text-2); font: 500 12px var(--font); }
.ac-label-strong { fill: var(--text); font: 650 13px var(--font); font-variant-numeric: tabular-nums; }
.ac-annot line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }
.ac-annot text { fill: var(--text-2); font: 500 12px var(--font); }
.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; }
.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.here { stroke: var(--text); stroke-width: 1.5; }
.bar.tp { fill: var(--accent-mark); } .bar.tn { fill: var(--dd); }
.wf-link { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 2; }
.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: translate3d(0, 4px, 0); transition: opacity .12s ease, transform .16s var(--ease); }
.ac-tip.is-on { opacity: 1; transform: none; }
.ac-tip-title { font: 600 12px var(--mono); letter-spacing: .03em; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; }
.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); }
.ac-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-cap); color: var(--text-2); }
.ac-legend li { display: inline-flex; align-items: center; gap: 7px; }
.ac-sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ac-sw.line { width: 14px; height: 2px; border-radius: 2px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-cap); font-weight: 600; font-variant-numeric: tabular-nums; }
.delta svg { width: 10px; height: 10px; }
.delta.up { color: var(--gain); } .delta.down { color: var(--loss); } .delta.flat { color: var(--text-2); }
.chart svg { display: block; width: 100%; overflow: visible; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* ---------------- riel pegado ---------------- */
.rail, .rail.is-tall { position: sticky; top: var(--bar-h); }

/* ---------------- celular ---------------- */
@media (max-width: 1023px) {
  .toolbar { top: var(--bar-h); }
  .filtersbtn { display: inline-flex; }
  .grid thead th { top: calc(var(--bar-h) + 56px); }
}
@media (max-width: 767px) {
  .toolbar { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 8px; }
  .tb-count { width: 100%; }
  .toolbar .tools { width: 100%; margin-left: 0; }
  .toolbar .sortlab { flex: 1; min-width: 0; } .toolbar .sortsel { width: 100%; }
  .toolbar .sortlab > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lh2-pills { display: none; }
  .lh2 { padding: 8px 0 10px; gap: 6px 14px; }
  .hlegend { white-space: normal; }
  .card { height: auto; gap: 6px; }
  .c-head { height: auto; }
  .c-name { min-height: 22px; }
  .c-name::after { content: ""; position: absolute; inset: -11px 0; }
  .c-var { height: 22px; position: relative; }
  .c-var::before { content: ""; position: absolute; inset: -11px 0; }
  .card .starbtn { top: 0; right: 0; width: 44px; height: 44px; }
  .c-chart { min-height: 64px; flex: none; height: 64px; }
  .c-chart .chartsel { opacity: 1; height: 44px; top: -12px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card.is-open { padding: 0 14px 14px; }
  .x-head { position: sticky; top: calc(var(--bar-h) + 96px); z-index: 3; margin: 0 -14px; padding: 10px 14px 8px; background: var(--card); border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .x-actions { width: 100%; flex-wrap: wrap; }
  .x-actions .btn { height: 44px; }
  .x-actions .xbtn { width: 44px; height: 44px; margin-left: auto; }
  .x-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-grid3 { grid-template-columns: minmax(0, 1fr); }
  .x-how { order: -1; }
  .x-foot { flex-direction: column; align-items: stretch; }
  .chartsel { height: 44px; }
  .vp-list { grid-auto-flow: row; grid-template-rows: none !important; }
  .varpop { left: 8px !important; right: 8px; width: auto; min-width: 0; max-width: none; }
  .grid tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .grid td.t-evo { grid-column: 1 / -1; }
  .grid .evo-box.mini { height: 36px; }
  .grid td[data-label]::before { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .grid tr.xrow { display: block; }
  .grid tr.xrow td { display: block; }
}

/* v3.1 ajustes: estrella, texto de 2 renglones, cifras en dos columnas */
.starbtn { flex-shrink: 0; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.starbtn svg { width: 17px; height: 17px; }
.starbtn:hover { color: var(--text); background: var(--surface); }
.starbtn[aria-pressed="true"] { color: var(--accent-mark); }
.starbtn[aria-pressed="true"] svg { fill: currentColor; }
.card > * { flex-shrink: 0; }
.card > .c-chart { flex: 1 1 auto; flex-shrink: 1; }
.c-does { max-height: 40px; }
.c-stats { margin: 3px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: end; }
.c-stats .st-saldo .dt { display: block; font-size: var(--fs-cap); line-height: 16px; color: var(--text-2); }
.c-stats .st-saldo .dd { display: block; line-height: 26px; }
.c-stats .st-saldo .fig { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.st-rows { margin: 0; display: grid; gap: 1px; min-width: 0; }
.st-rows .st { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.st-rows dt { flex-shrink: 0; width: 64px; font-size: var(--fs-cap); line-height: 20px; color: var(--text-2); white-space: nowrap; }
.st-rows dd { margin: 0; min-width: 0; font-size: var(--fs-sec); line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.st-rows dd .fig { font-weight: 700; }
.st-rows .st.is-sorted dt, .c-stats .st-saldo.is-sorted .dt { color: var(--text); }
.st-rows .st.is-sorted dt::after, .c-stats .st-saldo.is-sorted .dt::after { content: " ↓"; color: var(--accent-mark); }
.toolbar .stamp { margin-right: 8px; }
@media (max-width: 1199px) { .toolbar .stamp { display: none; } }
@media (max-width: 767px) { .toolbar .stamp { display: none; } }
.stamp-2 { display: none; }
@media (max-width: 1199px) { .stamp-2 { display: inline-flex; } }

/* =====================================================================
   v3.1 · ficha completa (7B · arquetipo ATLAS statera-panel-banca)
   ===================================================================== */
.main.detail { padding-top: 16px; }
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.dtitle { min-width: 0; flex: 1 1 420px; }
.kicker { margin: 0 0 4px; font: 500 var(--fs-cap)/1.3 var(--mono); letter-spacing: .02em; color: var(--text-2); }
.kicker a { color: var(--text); text-underline-offset: 3px; }
.dhead h1 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
.dhead h1 .vn { color: var(--text-2); font-weight: 600; }
.dsub { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin-top: 6px; }
.dsub .c-var { height: 28px; padding: 0 10px; border: 1px solid var(--line-hover); border-radius: 8px; }
.dsub .c-var .vname { max-width: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: 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); }
.btn:hover { border-color: var(--border-strong); background: var(--surface); }
.btn svg { width: 16px; height: 16px; } .btn[aria-pressed="true"] svg { fill: currentColor; color: var(--accent-mark); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.d-does { margin: 10px 0 0; font-size: var(--fs-row); line-height: 1.5; max-width: 120ch; }
.d-kpis { display: grid; grid-template-columns: 1.5fr repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.d-kpis .kpi { background: var(--card); padding: 11px 13px 12px; }
.d-kpis .kpi .v { font-size: 22px; }
.d-kpis .kpi.hero { position: relative; }
.d-kpis .kpi.hero .v { font-size: 28px; }
.kspark { height: 34px; min-height: 34px; margin-top: 6px; }
.kspark .evo-y { display: none; }
.d-row { display: grid; gap: 12px; margin-top: 12px; }
.d-row.r1 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.d-row.r2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.d-row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d-row.r3.two { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.d-row.r4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.d-row.r4.one { grid-template-columns: minmax(0, 1fr); }
.panel { min-width: 0; padding: 12px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.p-vars, .p-rules { margin-top: 12px; }
.ph { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ph h2 { margin: 0; font-size: var(--fs-row); font-weight: 700; letter-spacing: -.01em; }
.ph h2 .fig { color: var(--text); }
.ph .sub { font-size: var(--fs-cap); color: var(--text-2); }
.xp-h { flex-wrap: wrap; }
.xp-r { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.xp-note { font-size: var(--fs-cap); color: var(--text-2); }
.xp-note .fig { color: var(--text); font-weight: 650; }
.d-curve { height: 268px; }
.d-bars { height: 240px; }
.d-wf { height: 200px; }
.d-rank { height: 150px; }
.rank-me { stroke: var(--accent-mark); stroke-width: 1.5; stroke-dasharray: 3 3; }
.p-how .ph { margin-bottom: 10px; }
.vfy { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-cap); color: var(--text-2); }
.vfy::before { content: ""; flex-shrink: 0; width: 7px; height: 7px; border-radius: 2px; border: 1.5px solid var(--text-2); }
.vfy.ok::before { background: var(--accent); border-color: var(--accent); }
.p-how .xsteps { gap: 8px; }
.p-how .xsteps li { grid-template-columns: 104px minmax(0, 1fr); }
.how2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.how2 h3 { margin: 0 0 6px; font-size: var(--fs-sec); font-weight: 700; }
.bul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.bul li { position: relative; padding-left: 20px; font-size: var(--fs-sec); line-height: 1.4; }
.bul li::before { position: absolute; left: 0; top: 2px; width: 15px; height: 15px; border-radius: 5px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text); }
.bul.si li::before { content: "\2713"; color: var(--accent-mark); } .bul.no li::before { content: "\2013"; }
.aliasline { margin: 10px 0 0; font-size: var(--fs-cap); color: var(--text-2); }
.rsplit2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
.rcol h3 { margin: 0 0 4px; font: 600 var(--fs-cap)/1.3 var(--mono); letter-spacing: .03em; text-transform: uppercase; color: var(--text-2); }
.rtable2 { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rtable2 th, .rtable2 td { height: 28px; padding: 0 6px; border-bottom: 1px solid var(--line); font-size: var(--fs-sec); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.rtable2 thead th { height: 24px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); border-bottom-color: var(--line-hover); }
.rtable2 th.rn { width: 38%; text-align: left; font-weight: 500; color: var(--text); }
.rtable2 thead th.rn { color: var(--text-2); }
.rtable2 .rb { width: 22%; } .rtable2 .rv { width: 13%; font-weight: 700; } .rtable2 .rg { width: 17%; } .rtable2 .rc { width: 10%; font-weight: 600; }
.rtable2 td.rg { position: relative; }
.rtable2 tr.here th, .rtable2 tr.here td { background: var(--selected); }
.rtable2 tbody tr:hover th, .rtable2 tbody tr:hover td { background: var(--surface); }
.hb2 { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.hb2 i { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; }
.hb2 i.p { background: var(--gain-bar); } .hb2 i.n { background: var(--loss-bar); }
.azmini { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 4px; }
.azmini i, .azkey i, .bullet2 i { position: absolute; }
.azmini .band, .azkey .band, .bullet2 .band { top: 0; height: 100%; border-radius: 2px; background: color-mix(in srgb, var(--text-2) 30%, transparent); }
.azmini .exp, .azkey .exp, .bullet2 .exp { top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--text-2); }
.azmini .obs, .azkey .obs, .bullet2 .obs { top: -1px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent-mark); }
.azkey { position: relative; display: inline-block; width: 16px; height: 6px; margin: 0 4px 0 2px; vertical-align: 1px; }
.azkey .band { left: 0; right: 0; } .azkey .exp { left: 50%; } .azkey .obs { left: 50%; }
.iconkey { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 8px 0 0; font-size: var(--fs-cap); color: var(--text-2); }
.iconkey .fig { color: var(--text); font-weight: 650; }
.sticon { display: inline-block; width: 14px; margin-right: 4px; font-weight: 700; color: var(--text-2); }
.sticon.warn { color: var(--loss); }
.tag { font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; }
.stack { display: flex; gap: 2px; height: 16px; border-radius: 5px; overflow: hidden; }
.stack i { display: block; min-width: 3px; flex-basis: 0; }
.o-g { background: var(--gain-bar); } .o-p { background: var(--loss-bar); } .o-e { background: var(--border-strong); }
.o-x { background: repeating-linear-gradient(135deg, var(--track) 0 3px, var(--border-strong) 3px 5px); }
.olegend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-cap); color: var(--text-2); }
.olegend li { display: inline-flex; align-items: center; gap: 5px; }
.olegend li i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.olegend b, .olegend .fig { color: var(--text); font-weight: 700; }
.olegend .fig.loss { color: var(--loss); }
.azar { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.azar-h { font-size: var(--fs-cap); color: var(--text-2); }
.azar-h b { color: var(--text); font-size: var(--fs-sec); }
.bullet2 { position: relative; height: 10px; margin: 10px 0 4px; }
.bullet2 .band { top: 2px; height: 6px; }
.bullet2 .obs { top: 0; width: 10px; height: 10px; margin-left: -5px; box-shadow: 0 0 0 2px var(--card); }
.bl-axis { display: flex; justify-content: space-between; font: 500 12px var(--mono); color: var(--text-2); }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mrow:last-of-type { border-bottom: 0; }
.ml { font-size: var(--fs-cap); color: var(--text-2); grid-column: 1 / -1; }
.hbar { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 5px; } .hbar i.p { background: var(--gain-bar); } .hbar i.n { background: var(--loss-bar); }
.mv { font-size: 20px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.p-money .ph h2 .fig { color: var(--loss); }
.chart { position: relative; width: 100%; }
.chart svg { position: absolute; width: auto; height: auto; overflow: visible; }
.chart .plot { position: absolute; }
.chart .tick { position: absolute; font: 500 12px/1 var(--mono); color: var(--text-2); white-space: nowrap; }
.chart .yt { left: 0; text-align: right; transform: translateY(-50%); }
.chart .xt { bottom: 0; transform: translateX(-50%); }
.chart .caplabel { position: absolute; right: 2px; transform: translateY(-120%); font-size: var(--fs-cap); font-weight: 600; color: var(--text); background: var(--card); padding: 0 3px; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .b { fill: var(--bar-neutral); } .chart .n { fill: var(--loss-bar); }
.chart .cum { fill: none; stroke: var(--accent-mark); stroke-width: 2; stroke-linejoin: round; }
.chart .cap { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.lg-b { background: var(--bar-neutral); } .lg-line { height: 2px !important; border-radius: 1px !important; background: var(--accent-mark) !important; }
.p-vars .vdots { margin-top: 6px; }
.vtable { width: 100%; margin-top: 12px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.vtable th, .vtable td { height: 32px; padding: 0 10px; border-bottom: 1px solid var(--line); text-align: right; font-size: var(--fs-sec); white-space: nowrap; }
.vtable thead th { height: 34px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); border-bottom-color: var(--line-hover); }
.vtable thead th button { all: unset; cursor: pointer; }
.vtable thead th button:focus-visible { outline: 2px solid var(--focus); }
.vtable thead th.is-sorted { color: var(--text); }
.vtable thead th[aria-sort="descending"] button::after { content: " \2193"; color: var(--accent-mark); } .vtable thead th[aria-sort="ascending"] button::after { content: " \2191"; color: var(--accent-mark); }
.vtable th.vn { text-align: left; font-weight: 500; }
.vtable th.vn a { color: var(--text); text-decoration: none; } .vtable th.vn a:hover { text-decoration: underline; text-underline-offset: 3px; }
.vtable tr.me th, .vtable tr.me td { background: var(--selected); }
.vtable td .fig { font-weight: 650; }
.vme { font-weight: 700; }
.vmore { margin-top: 8px; }
.rules-cols { display: grid; gap: 10px; }
.nums { display: flex; flex-wrap: wrap; gap: 3px; }
.rn-chip { width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-cap); font-weight: 700; color: #FFFFFF; }
.rn-chip.r { background: var(--chip-red); } .rn-chip.b { background: var(--chip-black); box-shadow: inset 0 0 0 1px var(--chip-black-border); } .rn-chip.g { background: var(--chip-green); }
.fullrules > summary, .tech summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; gap: 8px; font-size: var(--fs-sec); font-weight: 600; list-style: none; }
.fullrules > summary::-webkit-details-marker { display: none; }
.fullrules h4 { margin: 10px 0 2px; font-size: var(--fs-cap); font-weight: 700; }
.fullrules ul { margin: 0; padding-left: 16px; }
.fullrules li, .ladderline { font-size: var(--fs-cap); line-height: 1.45; margin: 2px 0; }
.tech { font-size: var(--fs-cap); color: var(--text-2); } .tech p { margin: 4px 0 0; }
.vp-item[aria-current="page"] { background: var(--selected); box-shadow: inset 0 0 0 1px var(--accent-mark); }
a.vp-item { text-decoration: none; }
.uenote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--bar-neutral); background: var(--card); border-radius: 0 8px 8px 0; font-size: var(--fs-sec); }
.uenote.big { margin: 12px 0 0; font-size: var(--fs-row); }
.uelist { margin-top: 8px; font-size: var(--fs-cap); color: var(--text-2); }
.uelist > summary { cursor: pointer; min-height: 28px; display: inline-flex; align-items: center; gap: 4px; }
.uelist .fig { color: var(--text); font-weight: 600; }
.uelist ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; }
@media (max-width: 1599px) { .d-kpis { grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); } .d-kpis .kpi.hero { grid-row: span 2; } }
@media (max-width: 1279px) { .d-row.r1, .d-row.r2, .d-row.r4 { grid-template-columns: minmax(0, 1fr); } .d-row.r3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 1023px) { .rsplit2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) {
  .dhead h1 { font-size: 22px; }
  .dhead h1 .vn { display: block; } .dhead h1 .vn .dot { display: none; }
  .actions { width: 100%; } .actions .btn { flex: 1; justify-content: center; height: 44px; }
  .pnav { width: 100%; justify-content: space-between; } .btn.pn { height: 44px; }
  .d-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .d-kpis .kpi.hero { grid-column: 1 / -1; grid-row: auto; }
  .d-row.r3 { grid-template-columns: minmax(0, 1fr); }
  .how2 { grid-template-columns: minmax(0, 1fr); }
  .p-how .xsteps li { grid-template-columns: 88px minmax(0, 1fr); }
  .rtable2 .rc { display: none; } .rtable2 th.rn { width: 44%; }
  .vtable td:nth-child(n+5), .vtable th:nth-child(n+5) { display: none; }
  .xp-r { margin-left: 0; width: 100%; justify-content: space-between; }
  .dsub .c-var { height: 44px; }
  .fullrules > summary, .tech summary, .uelist > summary { min-height: 44px; }
  .vtable thead th button { min-height: 44px; display: inline-flex; align-items: center; }
  .vtable th.vn a { display: inline-flex; min-height: 44px; align-items: center; }
  .kicker a { display: inline-flex; min-height: 44px; align-items: center; }
  .linkbtn { min-height: 44px; display: inline-flex; align-items: center; }
}

.d-row.rfull { grid-template-columns: minmax(0, 1fr); }
.d-row.r2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.d-row.r3.n3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.d-row.r3.n2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.d-row.r3.n1 { grid-template-columns: minmax(0, 1fr); }
.d-kpis .kpi .d { white-space: normal; }
.rtable2 th, .rtable2 td { height: 32px; }
.rtable2 .rv { width: 14%; } .rtable2 th.rn { width: 34%; }
.azmini { bottom: 2px; height: 3px; }
@media (max-width: 1279px) { .d-row.r2, .d-row.r3.n3 { grid-template-columns: minmax(0, 1fr); } }
.st-rows dd small .fig, .c-foot small .fig { font-weight: 500; color: var(--text-2); }

.toolbar .hlegend { margin-right: 6px; }
.hl-2 { display: none; }
@media (max-width: 1199px) { .toolbar .hlegend { display: none; } .hl-2 { display: inline-flex; } }
@media (min-width: 1280px) { .x-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; } .x-kpis .kpi .d { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .x-kpis .kpi .v { font-size: 19px; } .x-kpis .kpi.hero .v { font-size: 21px; } }

.card { height: 236px; gap: 4px; }
.c-chart { min-height: 42px; }
.evo-box, .c-strip { min-height: 42px; }
.x-does p, .d-does p { margin: 0; }
.x-does .x-why, .d-does .x-why { margin-top: 2px; color: var(--text-2); font-size: var(--fs-sec); }
.d-does { margin: 10px 0 0; }
@media (max-width: 767px) {
  .howread > summary { min-height: 44px; }
  .grid td.star .starbtn { width: 44px; height: 44px; }
  .vtable { table-layout: fixed; }
  .vtable th.vn { width: 44%; overflow: hidden; text-overflow: ellipsis; }
  .vtable th.vn a, .vtable .vme { display: block; overflow: hidden; text-overflow: ellipsis; }
}
.xs-k b { font-size: 13px; }
.bl-axis { font-size: 13px; }
@media (max-width: 767px) { .vtable thead th button { min-width: 44px; justify-content: flex-end; } }
.rail-pills { display: none; }
@media (max-width: 767px) { .rail-pills { display: block; } .rail-pills .pills { display: grid; grid-template-columns: 1fr; } .rail-pills .pill { justify-content: space-between; min-height: 44px; } .roul-links .linkbtn { min-width: 44px; min-height: 44px; } }
.lh2-pills { display: block !important; }
@media (max-width: 767px) { .lh2-pills { display: none !important; } .c-chart .chartsel { display: none; } .x-actions { flex-wrap: nowrap; } .x-actions .btn:not(.x-full) { display: none; } .x-actions .x-full { flex: 1; justify-content: center; } }

.bar.tp { fill: var(--accent-mark); } .bar.tn { fill: var(--loss); }
@media (max-width: 1599px) { .d-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } .d-kpis .kpi.hero { grid-row: auto !important; } }
.rtable2 tbody tr.sep th, .rtable2 tbody tr.sep td { border-top: 2px solid var(--line-hover); }

/* =====================================================================
   v3.2 · ajustes de la tercera ronda de críticas + decisiones del dueño
   ===================================================================== */
/* texto: sans en todo (la mono queda para kbd); ejes y rótulos de gráfico a 13 px */
.kicker, .stamp, .rcol h3, .bl-axis, .vd-ax, .chart .tick, .ac-tip-title, .xs-k b, .x-sh, .evo-y { font-family: var(--font); letter-spacing: 0; }
.ac-axis text, .ac-tick { font: 500 13px var(--font) !important; fill: var(--text-2); }
.ac-tip-title { font-size: 13px; text-transform: none; }
.ac-tick.halo, .ac-annot text { paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.rcol h3 { text-transform: none; font-size: var(--fs-cap); letter-spacing: 0; }
.fig.dd, .kpi .v .dd { color: var(--dd); }
.kpi .v small { font-size: var(--fs-cap); font-weight: 500; color: var(--text-2); letter-spacing: 0; }

/* orden: sin flecha en la tarjeta (se leía «baja»); la cifra ordenada lleva subrayado lima */
.is-sorted dt::after, .st-rows .st.is-sorted dt::after, .c-stats .st-saldo.is-sorted .dt::after { content: none !important; }
.is-sorted .fig, .c-foot .is-sorted b { box-shadow: inset 0 -2px 0 var(--accent-mark); }
.c-foot .is-sorted { box-shadow: none; }

/* píldoras compactas */
.lh2 { padding: 6px 0 8px; }
.pill { height: 30px; padding: 0 11px; }
.toolbar { min-height: 52px; padding-top: 6px; padding-bottom: 6px; }

/* tarjeta: saldo + dos renglones en frase; encabezado del gráfico siempre visible */
.card { height: 236px; gap: 3px; padding: 10px 14px 9px; }
.c-stats { margin-top: 3px; gap: 14px; align-items: center; }
.st-rows { display: grid; gap: 0; min-width: 0; }
.st-rows p.st { margin: 0; font-size: var(--fs-sec); line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.st-rows .k { color: var(--text-2); font-size: var(--fs-cap); }
.st-rows .fig { font-weight: 700; }
.st-rows small .fig { font-weight: 500; color: var(--text-2); box-shadow: none; }
.c-chart { position: relative; flex: 1 1 auto; min-height: 58px; margin-top: 3px; display: flex; flex-direction: column; }
.c-ch-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 18px; }
.c-range { font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; }
.chartsel.ghost, .c-chart .chartsel { position: static; opacity: 1; height: auto; min-height: 18px; padding: 0 16px 0 0; border: 0; border-radius: 4px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 2px center; font-size: var(--fs-cap); font-weight: 600; color: var(--text); cursor: pointer; }
.chartsel.ghost:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.chartsel.ghost.strong { font-size: var(--fs-sec); font-weight: 700; }
.chartsel.ghost:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.c-chart .evo-box, .c-chart .c-strip { flex: 1; min-height: 38px; height: auto; }
/* mini evolución con margen propio para los rótulos */
.evo-box { display: grid; grid-template-columns: 50px minmax(0, 1fr); position: relative; }
.evo-plot { position: relative; grid-column: 2; grid-row: 1; min-height: 34px; }
.evo-g { grid-column: 1; grid-row: 1; position: relative; }
.evo-y { position: absolute; left: 0; right: 6px; text-align: right; font: 500 13px/1 var(--font); color: var(--text-2); background: none; padding: 0; font-variant-numeric: tabular-nums; }
.evo-y.hi { top: 0; } .evo-y.lo { bottom: 0; }
.evo-area.p { fill: var(--gain-bar); opacity: .16; } .evo-area.n { fill: var(--loss-bar); opacity: .18; }
.evo-line { stroke-width: 1.75; } .evo-line.p { stroke: var(--gain-bar); } .evo-line.n { stroke: var(--loss-bar); }
.evo-dd { stroke: var(--dd); stroke-width: 1.25; opacity: 1; }
.evo-end.p { background: var(--gain-bar); } .evo-end.n { background: var(--loss-bar); }
.kspark { display: none; }
.grid .evo-box { grid-template-columns: minmax(0, 1fr); }
.grid .evo-box .evo-plot { grid-column: 1; }
.grid .evo-box .evo-g { display: none; }
.sal-area.p { fill: var(--gain-bar); opacity: .12; } .sal-area.n { fill: var(--loss-bar); opacity: .14; }
.lg-l { background: var(--gain-bar); }

/* ventana de variantes: sin desborde */
.varpop { width: min(960px, calc(100vw - 320px)); max-width: calc(100vw - 16px); min-width: 0; }
.varpop.c1 { width: min(420px, calc(100vw - 16px)); }
.vp-list { grid-auto-flow: column; gap: 2px 14px; }
.vp-item { grid-template-columns: minmax(0, 1fr) 48px auto auto; min-width: 0; }
.vp-s, .vp-g { white-space: nowrap; }

/* tarjeta abierta: un mosaico dominante + 8 chicos; 3 paneles del mismo alto; qué hace / qué no al pie */
.card.is-open { padding: 12px 16px 12px; gap: 8px; scroll-margin-top: 112px; }
.x-head .c-name { font-size: 20px; line-height: 26px; }
.x-does p { font-size: var(--fs-sec); line-height: 20px; }
.x-kpis { display: grid !important; grid-template-columns: minmax(170px, 1.35fr) repeat(4, minmax(0, 1fr)) !important; grid-auto-rows: minmax(54px, auto); gap: 6px; }
.x-kpis .kpi { padding: 7px 10px 8px; }
.x-kpis .kpi .k { font-size: var(--fs-cap); white-space: normal; line-height: 1.25; }
.x-kpis .kpi .v { font-size: 17px !important; margin-top: 1px; white-space: nowrap; overflow: visible; text-overflow: clip; }
.x-kpis .kpi .d { font-size: var(--fs-cap); white-space: normal !important; display: block !important; -webkit-line-clamp: unset !important; overflow: visible; }
.x-kpis .kpi.hero { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
.x-kpis .kpi.hero .v { font-size: 30px !important; letter-spacing: -.03em; }
.x-grid3 { align-items: stretch; }
.x-panel { display: flex; flex-direction: column; }
.x-curve, .x-bars { height: 164px; flex: none; }
.xp-h { min-height: 24px; }
.x-how h3 { margin-bottom: 6px; }
.x-how .xsteps { gap: 4px; }
.x-how .xsteps li { grid-template-columns: 90px minmax(0, 1fr); }
.x-how .xs-v { font-size: var(--fs-cap); line-height: 18px; }
.x-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; padding-top: 8px; }
.x-hace h3 { margin: 0 0 4px; font-size: var(--fs-cap); font-weight: 700; }
.x-hace .bul li { font-size: var(--fs-cap); line-height: 18px; }
.x-foot-r { display: grid; gap: 6px; }
.x-full-m { display: none; }
.cards.is-morphing .card { pointer-events: none; }
.cards.is-morphing .card:focus, .cards.is-morphing .card:focus-within { outline: none; box-shadow: none; }
.cards.is-morphing .card:hover { transform: none; }
@media (max-width: 1439px) {
  .x-grid3 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .x-actions .x-mesa { display: none; }
}
@media (max-width: 1279px) { .x-grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .x-how { grid-column: 1 / -1; } .x-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } .x-kpis .kpi.hero { grid-column: 1 / -1; grid-row: auto; } }

/* ficha: ruleta por ruleta con selector de barra; jugadas y plata juntas */
.rl-sel { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: var(--fs-cap); color: var(--text-2); }
.p-rlist .ph { align-items: center; }
.money { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.money h3 { margin: 0 0 4px; font-size: var(--fs-sec); font-weight: 700; }
.money h3 .fig { color: var(--loss); }
.vtable td.vthis { text-align: left; color: var(--text-2); font-size: var(--fs-cap); }
.rtable2 td, .rtable2 th { text-overflow: clip; }
.rtable2 .rv, .rtable2 .rc, .rtable2 .rg { min-width: 7ch; }
.d-row.r3.n3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.1fr); }
.d-kpis { grid-template-columns: minmax(200px, 1.4fr) repeat(4, minmax(0, 1fr)) !important; }
.d-kpis .kpi.hero { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
.d-kpis .kpi.hero .v { font-size: 34px; }
.d-kpis .kpi .v { white-space: nowrap; overflow: visible; text-overflow: clip; }
.d-kpis .kpi .d { white-space: normal; }
/* riel del detalle: índice de la ficha */
.dnav h2 { margin: 0 0 6px; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); }
.dnav ol { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.dnav a { display: block; padding: 5px 10px; margin-left: -1px; border-left: 2px solid transparent; font-size: var(--fs-sec); color: var(--text-2); text-decoration: none; }
.dnav a:hover { color: var(--text); }
.dnav a.on { color: var(--text); font-weight: 600; border-left-color: var(--accent-mark); }
.dnav li[hidden] { display: none; }
/* tabla: la columna ordenada nunca se esconde */
.grid.so-entra .t-entra, .grid.so-ganaen .t-gana, .grid.so-peor .t-peor { display: table-cell !important; }
@media (max-width: 1599px) { .grid.so-entra .t-gan, .grid.so-ganaen .t-gan { display: none; } }
.grid tr.xrow td > .card { width: 100%; max-width: 100%; }
.grid tr.xrow .x-kpis { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important; }
.grid tr.xrow .x-kpis .kpi.hero { grid-row: auto; }

/* celular */
@media (max-width: 767px) {
  .lh2 { gap: 4px 12px; }
  .howread { margin-left: 0; }
  .card { height: auto; }
  .c-chart { min-height: 70px; }
  .c-ch-h { height: 26px; }
  .c-chart .chartsel { display: inline-block !important; min-height: 26px; }
  .chartsel.ghost { position: relative; }
  .chartsel.ghost::after { content: ""; position: absolute; inset: -9px 0; }
  /* tarjeta abierta más corta: cabeza fija de una fila, sin barras por ruleta, ficha completa al pie */
  .card.is-open { padding: 0 12px 12px; }
  .x-head { top: calc(var(--bar-h) + 100px); padding: 6px 12px; }
  .x-head .c-sub { display: none; }
  .x-head .c-name { font-size: 17px; line-height: 22px; }
  .x-actions { width: auto; flex-wrap: nowrap; }
  .x-actions .x-full, .x-actions .x-mesa, .x-actions .starbtn { display: none !important; }
  .x-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .x-kpis .kpi.hero { grid-column: 1 / -1; grid-row: auto; }
  .x-bars-p { display: none; }
  .x-grid3 { grid-template-columns: minmax(0, 1fr); }
  .x-how { order: -1; }
  .x-foot { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .x-full-m { display: flex; justify-content: center; height: 48px; margin-top: 4px; }
  /* ficha en el celular: saldo a todo el ancho, el resto en 2 columnas, cabecera corta */
  .kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kicker a { min-height: 32px; }
  .dhead { gap: 8px; }
  .dhead h1 { font-size: 20px; }
  .actions { flex-wrap: nowrap; }
  .pnav { width: auto; } .pnav .pos { display: none; }
  .btn.pn { width: 44px; padding: 0; justify-content: center; } .btn.pn span:not(:first-child) { display: none; }
  .actions [data-star] { width: 44px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .actions [data-star] svg { width: 18px; height: 18px; }
  .actions .btn.primary { flex: 1; font-size: var(--fs-sec); }
  .d-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .d-kpis .kpi.hero { grid-column: 1 / -1; grid-row: auto; }
  .d-kpis .kpi .v { font-size: 20px; }
  .d-kpis .kpi.hero .v { font-size: 30px; }
  .d-does { margin-top: 6px; }
  .rl-sel { margin-left: 0; }
}

.c-freq { font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.c-freq b { color: var(--text); font-weight: 650; }
.c-freq .fig { color: var(--text); }
.c-freq.is-sorted b { box-shadow: inset 0 -2px 0 var(--accent-mark); }
.c-ch-h .chartsel { flex-shrink: 0; }
.evo-box { grid-template-columns: 58px minmax(0, 1fr); }
.evo-y { white-space: nowrap; }
.lg-per { margin-left: 6px; color: var(--text-2); }
.xp-h { flex-wrap: nowrap; gap: 10px; }
.xp-h .chartsel { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-h .chartsel:not(.strong) { max-width: 48%; margin-left: auto; font-weight: 500; color: var(--text-2); }
.x-curve, .x-bars { height: 146px; }
.x-kpis .kpi { padding: 6px 10px 7px; }
.x-kpis .kpi .v { font-size: 16px !important; }
.d-kpis .kpi .d .fig { color: var(--text-2); }
@media (max-width: 767px) { .c-freq { font-size: var(--fs-cap); } .lg-per { display: none; } }

@media (max-width: 1499px) { .lg-per { display: none; } }
.tb-count { flex-wrap: nowrap; }
.x-kpis .kpi:not(.hero) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline; }
.x-kpis .kpi:not(.hero) .k { grid-column: 1; }
.x-kpis .kpi:not(.hero) .v { grid-column: 2; grid-row: 1; margin: 0; text-align: right; }
.x-kpis .kpi:not(.hero) .d { grid-column: 1 / -1; }
.x-kpis { grid-auto-rows: minmax(44px, auto); }
.x-curve, .x-bars { height: 134px; }
.x-hace .bul li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-foot { padding-top: 6px; }

.c-chart { min-height: 50px; }
.c-stats { height: 42px; }
@media (max-width: 767px) {
  .actions [data-star] { font-size: var(--fs-sec); }
  .actions [data-star] .bt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .chartsel.ghost, .c-chart .chartsel, .rl-sel .chartsel { min-height: 44px; }
  .xp-r { flex-wrap: wrap; gap: 6px 14px; } .xp-r .chartsel { max-width: 100%; }
  .xp-h { flex-wrap: wrap; }
  .kicker a { min-height: 44px; }
  .c-ch-h { height: 44px; }
  .c-chart { min-height: 90px; }
}
@media (max-width: 767px) { .tb-count { flex-wrap: wrap; } .tb-count .sub { white-space: normal; } }

/* v3.2b — tarjeta abierta: título y variante en una fila; qué hace / qué no hace enteros (2 líneas como mucho) */
.m-only { display: none; }
.x-hace .bul li { white-space: normal; overflow: visible; text-overflow: clip; }
@media (min-width: 768px) {
  .x-head { align-items: center; }
  .x-titles { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 14px; }
  .x-head .c-sub { margin-top: 0; }
}
/* celular: ✕ en la misma fila del nombre, mosaicos sin cortes, un solo renglón de menús, cabecera de la ficha más corta */
@media (max-width: 767px) {
  .x-head { flex-wrap: nowrap; align-items: center; gap: 10px; }
  .x-titles { flex: 1 1 auto; min-width: 0; }
  .x-actions { width: auto; margin-left: auto; }
  .x-kpis .kpi:not(.hero), .d-kpis .kpi:not(.hero) { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; padding: 7px 10px 8px; }
  .x-kpis .kpi:not(.hero) .k, .d-kpis .kpi:not(.hero) .k { flex: 0 0 100%; margin-bottom: 1px; }
  .x-kpis .kpi:not(.hero) .v, .d-kpis .kpi:not(.hero) .v { text-align: left; margin: 0; font-size: 19px !important; }
  .x-kpis .kpi:not(.hero) .d, .d-kpis .kpi:not(.hero) .d { flex: 0 1 auto; min-width: 0; margin: 0; }
  .xp-h { flex-wrap: nowrap; }
  .xp-h .chartsel.strong { flex: 1 1 auto; min-width: 0; }
  .xp-h .chartsel:not(.strong) { flex: 0 1 auto; max-width: 46%; }
  .x-vars { display: none; }
  .d-does .x-why { display: none; }
  .m-only { display: block; }
  .p-how .x-why { margin: 0 0 10px; }
  .dsub { flex-wrap: nowrap; gap: 12px; }
  .dsub .c-var .vname { display: none; }
  .dsub .c-var .vcount { margin: 0; padding: 0; border: 0; }
  .dsub .stamp { margin: 0; white-space: nowrap; }
  .btn.pn { font-size: 22px; line-height: 1; }
  .btn.pn span { display: none; }
}
@media (min-width: 1280px) { .x-kpis { grid-template-columns: minmax(160px, 1fr) repeat(4, minmax(0, 1fr)) !important; } }

/* v3.2c — tarjeta abierta más baja con cualquier estrategia: «cómo juega» más ancho, la pérdida junto a «qué hace», variante entera */
.x-does { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 24px; }
.x-does > p:first-child { flex: 1 1 auto; min-width: 0; }
.x-does .x-lost { flex: none; margin: 0 0 0 auto; max-width: none; font-size: var(--fs-sec); }
.x-head .c-var .vname { max-width: none; overflow: visible; }
@media (min-width: 1280px) and (max-width: 1439px) { .x-grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, .82fr) minmax(0, 1.3fr); } }
@media (min-width: 1440px) { .x-grid3 { grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr) minmax(0, 1.2fr); } }
@media (max-width: 767px) { .x-does .x-lost { margin-left: 0; } }

/* v3.2d — leyenda de la barra: la línea de saldo es celeste si gana y ámbar si pierde */
.lg-l { background: linear-gradient(90deg, var(--gain-bar) 0 50%, var(--loss-bar) 50% 100%); }
.ac-legend li[hidden] { display: none; }
/* la fila de 3 paneles de la ficha va de a uno por debajo de 1280 (también en el celular) */
@media (max-width: 1279px) { .d-row.r3.n3 { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 768px) and (max-width: 1279px) { .d-row.r3.n3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .d-row.r3.n3 > :last-child { grid-column: 1 / -1; } }
.p-how .x-why { margin: 0 0 10px; font-size: var(--fs-sec); line-height: 20px; color: var(--text-2); }
@media (max-width: 767px) {
  /* menús del gráfico en una fila, la leyenda debajo */
  .p-curve .xp-h { flex-wrap: wrap; row-gap: 2px; }
  .p-curve .xp-r { display: contents; }
  .p-curve .xp-h .chartsel.strong { order: 0; flex: 0 1 auto; max-width: 56%; }
  .p-curve .xp-h .chartsel:not(.strong) { order: 1; flex: 0 1 auto; max-width: 44%; margin-left: auto; }
  .p-curve .ac-legend { order: 2; flex: 0 0 100%; }
  /* ruleta por ruleta: sin la barra, el nombre entero (puede ir en dos líneas) */
  .rtable2 .rb { display: none; }
  .rtable2 th.rn { width: 54%; white-space: normal; overflow: visible; line-height: 18px; padding-top: 5px; padding-bottom: 5px; }
  .rtable2 .rv { width: 22%; } .rtable2 .rg { width: 24%; }
  .rtable2 th, .rtable2 td { height: auto; min-height: 32px; }
  /* variantes: nombre arriba y cifras abajo, nada encimado */
  .vtable { table-layout: auto; }
  .vtable, .vtable thead, .vtable tbody { display: block; width: 100%; }
  .vtable tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
  .vtable th, .vtable td { height: auto; padding: 2px 6px; border-bottom: 0; }
  .vtable thead th.vn { display: none; }
  .vtable th.vn { grid-column: 1 / -1; width: auto; white-space: normal; overflow: visible; text-align: left; }
  .vtable th.vn a, .vtable .vme { display: inline-flex; align-items: center; white-space: normal; overflow: visible; min-height: 36px; position: relative; }
  .vtable th.vn a::after { content: ""; position: absolute; inset: -4px 0; }
  .vtable td.vthis { grid-column: 1 / -1; text-align: left; white-space: normal; }
}

/* v3.2e — menús: el ancho es el del texto elegido (flecha pegada); la curva con lugar para sus dos menús en 1366 */
.chartsel.ghost, .c-chart .chartsel { field-sizing: content; }
@media (min-width: 1280px) and (max-width: 1439px) { .x-grid3 { grid-template-columns: minmax(0, 1.1fr) minmax(0, .72fr) minmax(0, 1.28fr); } }
.xp-h .chartsel.strong { flex: 0 1 auto; }
.xp-h .chartsel:not(.strong) { flex: 0 1 auto; max-width: 60%; }
@media (max-width: 767px) {
  .actions [data-star] { flex: none; width: 44px; }
  .actions .btn.primary { white-space: nowrap; }
}
.vtable .vme { gap: 8px; flex-wrap: wrap; }
/* v3.2f — la ficha: el saldo ocupa dos filas en toda pantalla ancha; ventana de variantes en el celular: una columna a lo ancho */
@media (min-width: 768px) { .d-kpis .kpi.hero { grid-row: span 2 !important; } }
@media (max-width: 767px) {
  .varpop, .varpop.c1 { left: 8px !important; right: 8px !important; width: auto !important; min-width: 0 !important; max-width: none !important; }
  .vp-list { grid-auto-flow: row !important; grid-template-rows: none !important; grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 767px) { .grid tbody td.t-evo { height: auto !important; overflow: visible !important; } }
@media (max-width: 767px) { .grid tbody tr:not(.xrow) td { text-align: left !important; border-bottom: 0 !important; } .grid tbody td[data-label]::before { text-align: left; } }

/* v3.2g — escalera con ATLAS (barras AC.barPath + línea AC.linePath + tooltip AC.bindMark) */
.d-ladder { height: 180px; }
.bar.lad { fill: var(--bar-neutral); }
.lad-cum { pointer-events: none; }
/* cascada y escalera llenan el alto de su fila (sin hueco bajo el gráfico) */
.p-wf, .p-ladder { display: flex; flex-direction: column; }
.p-wf .d-wf, .p-ladder .d-ladder { flex: 1 1 auto; height: auto; min-height: 180px; }
/* la línea de saldo lleva exactamente el color de su cifra (--gain / --loss); el total de la cascada también */
.evo-line.p { stroke: var(--gain); } .evo-line.n { stroke: var(--loss); }
.evo-end.p { background: var(--gain); } .evo-end.n { background: var(--loss); }
.lg-l { background: linear-gradient(90deg, var(--gain) 0 50%, var(--loss) 50% 100%); }
.bar.tp { fill: var(--gain); } .bar.tn { fill: var(--loss); }

/* ============ v3.3 · guardadas, comparar y CSV ============ */
/* riel: guardadas + planilla */
.railtools { display: flex; gap: 8px; align-items: stretch; }
.favtoggle, .csvbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-hover); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: var(--fs-sec); font-weight: 600; cursor: pointer; }
.favtoggle { flex: 1 1 auto; }
.favtoggle svg, .csvbtn svg { width: 16px; height: 16px; flex: none; }
.favtoggle .n { margin-left: auto; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.favtoggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.favtoggle[aria-pressed="true"] .n { color: inherit; }
.favtoggle[aria-pressed="true"] svg path { fill: currentColor; }
.favtoggle:hover, .csvbtn:hover { border-color: var(--border-strong); }
.favtoggle:focus-visible, .csvbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* barra de guardadas arriba de la lista */
.favbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line-hover); border-radius: var(--radius-lg); background: var(--card); }
.favbar .fb-h { margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-row); }
.favbar .fb-star svg { width: 18px; height: 18px; display: block; }
.favbar .fb-star svg path { fill: var(--accent-mark); stroke: var(--accent-mark); }
.favbar .fb-act { display: flex; align-items: center; gap: 12px; }
.favbar .fb-act .btn svg { width: 16px; height: 16px; }
.favbar .fb-note { grid-column: 1 / -1; margin: 0; font-size: var(--fs-cap); color: var(--text-2); }

/* botón comparar (tarjeta abierta y ficha) */
.cmpbtn svg { width: 16px; height: 16px; }
.cmpbtn[aria-pressed="true"] { border-color: var(--accent-mark); box-shadow: inset 0 0 0 1px var(--accent-mark); }

/* bandeja de comparar */
.cmptray { position: fixed; z-index: 40; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(920px, calc(100vw - 24px)); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "h list act" "h msg act"; align-items: center; gap: 2px 14px; padding: 10px 12px 10px 14px; background: var(--surface-2, var(--card)); border: 1px solid var(--line-hover); border-radius: 14px; box-shadow: var(--shadow-pop, 0 12px 32px rgba(0,0,0,.35)); animation: pop-in .18s var(--ease, ease); }
.cmptray .ct-h { grid-area: h; margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-sec); }
.cmptray .ct-h svg { width: 18px; height: 18px; }
.cmptray .ct-c { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cmptray .ct-list { grid-area: list; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cmptray .ct-list li { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; min-width: 0; padding: 0 2px 0 8px; height: 32px; border: 1px solid var(--line-hover); border-radius: 8px; font-size: var(--fs-sec); }
.cmptray .ct-sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.cmptray .ct-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmptray .ct-x { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; }
.cmptray .ct-x:hover { color: var(--text); background: var(--surface); }
.cmptray .ct-x svg { width: 14px; height: 14px; }
.cmptray .ct-msg { grid-area: msg; margin: 0; font-size: var(--fs-cap); color: var(--text-2); min-height: 0; }
.cmptray .ct-msg:empty { display: none; }
.cmptray .ct-act { grid-area: act; display: flex; align-items: center; gap: 10px; }
.cmptray .ct-act .btn svg { width: 16px; height: 16px; }
body.has-tray .main { padding-bottom: 96px; }

/* página de comparar */
.cmp-add { position: relative; display: inline-flex; align-items: center; }
.cmp-add svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--text-2); pointer-events: none; }
.cmp-add input { height: 36px; width: 260px; padding: 0 12px 0 34px; border: 1px solid var(--line-hover); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: var(--fs-sec); }
.cmp-add input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cmp-p { margin-top: 12px; }
.cmp-t { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.cmp-t .cmp-corner { width: 190px; border: 0; }
.cmp-t thead th { vertical-align: top; text-align: left; padding: 10px 12px 12px; border-top: 3px solid var(--c); position: relative; font-weight: 400; }
.cmp-t .cmp-h .ch-sw { display: none; }
.cmp-t .ch-n { display: block; padding-right: 30px; font-size: 16px; line-height: 21px; font-weight: 700; color: var(--text); text-decoration: none; }
.cmp-t .ch-n:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-t .ch-v { display: block; margin-top: 2px; font-size: var(--fs-sec); font-weight: 600; color: var(--text); }
.cmp-t .ch-k { display: block; margin-top: 2px; font-size: var(--fs-cap); color: var(--text-2); }
.cmp-t .ch-does { display: block; margin-top: 6px; font-size: var(--fs-cap); line-height: 18px; color: var(--text-2); }
.cmp-t .ch-x { position: absolute; top: 6px; right: 4px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.cmp-t .ch-x:hover { background: var(--surface); color: var(--text); }
.cmp-t .ch-x svg { width: 16px; height: 16px; }
.cmp-t tbody th { text-align: left; font-weight: 500; font-size: var(--fs-sec); color: var(--text-2); padding: 9px 12px 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.cmp-t tbody td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; font-size: var(--fs-row); position: relative; }
.cmp-t tbody td .fig { font-weight: 700; }
.cmp-t tbody td small { display: block; margin-top: 1px; font-size: var(--fs-cap); color: var(--text-2); font-weight: 400; }
.cmp-t tbody td small .fig { font-weight: 600; color: var(--text-2); }
.cmp-t tbody td.best { background: var(--accent-wash, rgba(198, 242, 78, .08)); }
.best-m { display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--accent-mark); vertical-align: middle; }
.cmp-p .ph .sub .best-m { margin: 0 2px 0 0; }
.cmp-t .cmp-cn { display: none; }
.cmp-how tbody td { font-size: var(--fs-sec); line-height: 20px; }
.cmp-how thead th { font-size: var(--fs-sec); font-weight: 700; color: var(--text); padding-top: 8px; padding-bottom: 8px; }
.cmp-how .ch-sw { display: none; }
.cmp-leg { display: none; }
.cmp-curve { min-height: 300px; }
.cmp-bars { min-height: 260px; }
.cmp-p .xp-h .sub { margin-left: auto; font-size: var(--fs-cap); color: var(--text-2); }
.cmp-end { fill: var(--text); }
.cmp-rl { fill: var(--text); }
.cmp-hit { fill: transparent; cursor: default; }
.cmp-hit.is-on, .cmp-hit:focus-visible { fill: var(--text); fill-opacity: .06; outline: none; }
@media (max-width: 1279px) { .cmp-t .cmp-corner { width: 150px; } }
@media (max-width: 767px) {
  .railtools { flex-wrap: wrap; }
  .favtoggle, .csvbtn { min-height: 44px; }
  .favbar { grid-template-columns: minmax(0, 1fr); }
  .favbar .fb-act { flex-wrap: wrap; }
  .favbar .fb-act .linkbtn { min-height: 44px; }
  .cmptray { bottom: 8px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "h act" "list list" "msg msg"; padding: 8px 10px; }
  .cmptray .ct-list li { max-width: 100%; }
  .cmptray .ct-x { width: 36px; height: 36px; }
  .cmptray .ct-act .linkbtn { min-height: 44px; }
  .cmptray .ct-act .btn { height: 44px; }
  body.has-tray .main { padding-bottom: 180px; }
  .actions [data-cmp] { flex: none; width: 44px; padding: 0; justify-content: center; }
  .actions [data-cmp] .bt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .actions .cmp-add { flex: 1 1 100%; } .actions .cmp-add input { width: 100%; height: 44px; }
  /* tabla de cifras: la fila lleva su nombre arriba y las cifras de cada estrategia abajo */
  .cmp-t, .cmp-t thead, .cmp-t tbody { display: block; width: 100%; }
  .cmp-t thead tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cmp-t .cmp-corner { display: none; }
  .cmp-t thead th { border-top: 0; border-left: 4px solid var(--c); padding: 6px 10px; }
  .cmp-t .ch-does { display: none; }
  .cmp-t .ch-x { top: 2px; width: 44px; height: 44px; }
  .cmp-t tbody tr { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0 8px; padding: 8px 0; border-top: 1px solid var(--line); }
  .cmp-t tbody th { grid-column: 1 / -1; border: 0; padding: 0 0 4px; }
  .cmp-t tbody td { border: 0; border-top: 3px solid var(--c); padding: 5px 2px 0; font-size: var(--fs-sec); }
  .cmp-t tbody td.best { background: transparent; }
  .cmp-how tbody tr { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .cmp-how tbody td { border-top: 0; border-left: 3px solid var(--c); padding: 2px 0 2px 10px; }
  .cmp-how .cmp-cn { display: block; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); }
  .cmp-how thead { display: none; }
  .cmp-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; order: 2; flex: 0 0 100%; margin: 4px 0 0; }
  .cmp-p .xp-h { flex-wrap: wrap; }
  .cmp-p .xp-h .sub { margin-left: 0; flex: 0 0 100%; }
  .cmp-curve { min-height: 230px; }
}
.cmp-t tbody td .best-m { position: absolute; top: 14px; right: 10px; margin: 0; }
.cmp-t tbody td.best { padding-right: 24px; }
/* v3.3: «qué hace» de la tarjeta a 13 px para que la frase completa (con cómo sube) entre en 2 líneas en todos los anchos */
.c-does { font-size: var(--fs-cap); line-height: 19px; height: 38px; max-height: 38px; }

/* v3.3 · mini evolución: arriba el máximo del saldo, abajo la caída máxima rotulada (la misma de la tarjeta abierta y la ficha) */
.evo-box { grid-template-columns: 62px minmax(0, 1fr); }
.evo-y.lo.dd { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 14px; color: var(--dd); font-weight: 600; }
.evo-y.lo.dd .cap { font-weight: 500; color: var(--text-2); }

/* v3.3 · ruleta por ruleta: franja del azar en su pista (64×8), punto adentro; una columna por debajo de 1500 */
.rtable2 td.rg { position: static; }
.rg-in { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; width: 100%; }
.rg-in .azmini { position: relative; left: auto; right: auto; bottom: auto; flex: none; width: 64px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--text-2) 12%, transparent); }
.rg-in .azmini .band { top: 0; height: 100%; border-radius: 4px; }
.rg-in .azmini .exp { top: -3px; bottom: -3px; }
.rg-in .azmini .obs { top: 0; width: 8px; height: 8px; margin-left: -4px; }
.rtable2 th.rn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtable2 th.rn > span { overflow: hidden; text-overflow: ellipsis; }
.rtable2 .rn { width: 32%; } .rtable2 .rb { width: 18%; } .rtable2 .rv { width: 12%; } .rtable2 .rg { width: 26%; } .rtable2 .rc { width: 12%; }
@media (max-width: 1499px) {
  .rsplit2 { grid-template-columns: minmax(0, 1fr); }
  .rsplit2 .rcol.cont h3, .rsplit2 .rcol.cont thead { display: none; }
  .rtable2 .rn { width: 30%; } .rtable2 .rb { width: 24%; } .rtable2 .rg { width: 22%; }
}
@media (max-width: 767px) {
  .rg-in { flex-direction: column; align-items: flex-end; gap: 4px; }
  .rg-in .azmini { width: 56px; height: 6px; }
  .rg-in .azmini .obs { width: 6px; height: 6px; margin-left: -3px; }
  .rtable2 th.rn { white-space: normal; }
  .rtable2 .rn { width: 50%; } .rtable2 .rv { width: 22%; } .rtable2 .rg { width: 28%; } .rtable2 .rc { width: auto; }
}
/* v3.3 · «Por ruleta» en la tarjeta: tira más baja y «mejor / peor» en su propia fila, sin pisar el pie */
@media (min-width: 768px) { .card .c-strip .strip { height: 22px; } .card .c-sl { margin-top: 3px; line-height: 16px; } .card .c-strip { overflow: hidden; } }
.vd-ax { font: 500 13px var(--font); }
@media (min-width: 768px) { .card .c-chart .c-strip { min-height: 0; } .card .c-strip .strip { height: 18px; } .card .c-sl { margin-top: 2px; line-height: 15px; } }

/* v3.3 · títulos y variantes enteros: hasta 2 líneas; la tarjeta crece solo si hace falta (la fila entera acompaña) */
@media (min-width: 768px) {
  .card:not(.is-open) { height: auto; min-height: 236px; padding: 9px 14px 8px; }
  .card:not(.is-open) .c-head { height: auto; min-height: 22px; }
  .card:not(.is-open) .c-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .card:not(.is-open) .c-sub { height: auto; min-height: 20px; align-items: flex-start; }
  .card:not(.is-open) .c-var { height: auto; min-height: 20px; align-items: flex-start; text-align: left; }
  .card:not(.is-open) .c-var .vname { max-width: none; flex: 0 1 auto; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 18px; }
  .card:not(.is-open) .c-var .vcount { line-height: 18px; }
  .card:not(.is-open) .c-chart { flex: 1 1 auto; }
}
@media (min-width: 768px) { .card:not(.is-open) { min-height: 222px; } }
/* v3.3 · 20 px menos por fila para que 6 tarjetas sigan enteras en 1366×630 aunque una variante ocupe 2 líneas */
@media (min-width: 768px) {
  .lh2 { padding-top: 4px; padding-bottom: 6px; }
  .cards { gap: 10px; }
  .card:not(.is-open) { padding: 8px 14px 7px; }
  .card:not(.is-open) .c-does { line-height: 18px; height: 36px; max-height: 36px; }
  .card:not(.is-open) .c-stats { margin-top: 2px; }
  .card:not(.is-open) .c-chart { margin-top: 1px; }
}
.x-how .x-why { margin: -2px 0 6px; font-size: var(--fs-cap); line-height: 18px; color: var(--text-2); }
.x-does .x-why { flex: 0 0 100%; order: 3; margin: 0; font-size: var(--fs-cap); line-height: 18px; color: var(--text-2); }
/* v3.3 · capas pegadas opacas y sin rendijas: todas usan el borde real de la barra (--sticky-top) */
.toolbar { background: var(--canvas) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border-bottom: 1px solid var(--line); }
.grid thead th { top: var(--sticky-top, calc(var(--bar-h) + 52px)); }
@media (max-width: 767px) { .card.is-open .x-head { top: var(--sticky-top, calc(var(--bar-h) + 96px)); } }
/* v3.3 · ventana de variantes siempre dentro de la pantalla: cabecera fija y la lista se desplaza adentro */
.varpop { display: flex; flex-direction: column; }
.varpop .vp-h { flex: none; }
.varpop .vp-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 767px) {
  .varpop.sheet { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0; width: auto !important; max-height: 70vh; border-radius: 16px 16px 0 0; padding-bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 60; }
}
@media (min-width: 768px) { .card .evo-g:has(.evo-y.dd) .evo-y.hi { display: none; } }
/* v3.3 · tabla: la fila abierta usa la misma grilla que la tarjeta abierta; minigráficos sin recorte; sin «Tabla» en el celular */
@media (min-width: 1280px) { .grid tr.xrow .x-kpis { grid-template-columns: minmax(160px, 1fr) repeat(4, minmax(0, 1fr)) !important; } .grid tr.xrow .x-kpis .kpi.hero { grid-row: span 2 !important; } }
.grid td.t-evo, .grid td.t-evo .evo-box, .grid td.t-evo .evo-plot { overflow: visible; }
.grid.so-saldo td.t-saldo .fig, .grid td.is-sorted .fig { box-shadow: none; text-decoration: none; }
@media (max-width: 767px) { .viewtoggle { display: none !important; } }

/* v3.3 · ficha: cabecera fija al bajar (nombre · saldo · anterior/siguiente) y, en el celular, índice en chips */
.dstick { position: fixed; z-index: 25; top: var(--bar-h); left: var(--rail-w); right: 0; background: var(--canvas); border-bottom: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,.18); animation: pop-in .16s var(--ease, ease); }
.dstick[hidden] { display: none; }
.dstick .ds-row { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 var(--gutter, 24px); }
.dstick .ds-n { min-width: 0; flex: 1 1 auto; font-weight: 700; font-size: var(--fs-row); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dstick .ds-s { flex: none; font-weight: 700; font-size: var(--fs-row); font-variant-numeric: tabular-nums; }
.dstick .ds-s.gain { color: var(--gain); } .dstick .ds-s.loss { color: var(--loss); }
.dstick .ds-pn { flex: none; } .dstick .ds-pn .btn { height: 34px; }
.dstick .ds-chips { display: none; }
.rail-more > summary { cursor: pointer; }
.dm-extra { margin-top: 4px; }
@media (max-width: 1023px) { .dstick { left: 0; } }
@media (max-width: 767px) {
  .dstick .ds-row { height: 44px; gap: 10px; padding: 0 16px; }
  .dstick .ds-pn { display: none; }
  .dstick .ds-chips { display: flex; gap: 6px; padding: 0 16px 8px; overflow-x: auto; scrollbar-width: none; }
  .dstick .ds-chips::-webkit-scrollbar { display: none; }
  .dstick .ds-chips a { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-hover); border-radius: 999px; font-size: var(--fs-cap); color: var(--text); text-decoration: none; position: relative; }
  .dstick .ds-chips a::after { content: ""; position: absolute; inset: -6px 0; }
  .dstick .ds-chips a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  /* el primer número arriba: título, una fila de controles, las cifras; «qué hace», la Mesa y la fecha después */
  .dmain > * { order: 3; }
  .dmain > .dhead { order: 0; }
  .dmain > .d-kpis { order: 1; }
  .dmain > .d-does { order: 2; }
  .dmain > .dm-extra { order: 2; display: flex; flex-direction: column; gap: 6px; }
  .dmain > .dm-extra .btn { justify-content: center; height: 44px; }
  .dhead .dsub .stamp, .dhead .actions .btn.primary { display: none; }
  .dhead { gap: 6px; }
  .dhead .dtitle { display: contents; }
  .dhead .kicker, .dhead h1 { flex: 0 0 100%; margin: 0; }
  .dhead .dsub { flex: none; margin-top: 0; }
  .dhead .actions { flex: 1 1 auto; justify-content: flex-end; }
  .dhead h1 .vn { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
  .dhead .kicker { margin-bottom: 2px; } .dhead .kicker a { min-height: 32px; position: relative; } .dhead .kicker a::after { content: ""; position: absolute; inset: -6px 0; }
  .dhead .actions { gap: 6px; }
  /* mosaicos iguales: etiqueta, cifra y nota, alineados arriba */
  .x-kpis .kpi:not(.hero), .d-kpis .kpi:not(.hero) { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; }
  .x-kpis .kpi:not(.hero) .d, .d-kpis .kpi:not(.hero) .d { flex: none; }
}
@media (max-width: 767px) {
  .dhead .actions { width: auto !important; flex: 1 1 0 !important; min-width: 0; }
  .x-kpis .kpi:not(.hero) .k, .d-kpis .kpi:not(.hero) .k { flex: none !important; margin-bottom: 2px; }
  .x-kpis .kpi:not(.hero) .v, .d-kpis .kpi:not(.hero) .v { flex: none; }
}
@media (max-width: 767px) {
  .main.detail { display: flex; flex-direction: column; }
  .main.detail > * { order: 3; }
  .main.detail > .dhead { order: 0; }
  .main.detail > .d-kpis { order: 1; }
  .main.detail > .d-does { order: 2; margin-top: 12px; }
  .main.detail > .dm-extra { order: 2; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
  .main.detail > .dm-extra .btn { justify-content: center; height: 44px; }
  .main.detail > .dstick { order: 0; }
}
/* v3.3 · caída y saldo negativo sin mezclarse en marrón: dos lavados más suaves */
.sal-area.p { opacity: .10; } .sal-area.n { opacity: .08; }
.dd-area { fill: var(--dd); fill-opacity: .07; }
:root[data-theme="light"] .dd-area { fill-opacity: .06; }
/* v3.3 · tira de variantes en carriles: ningún punto tapa a otro; «0» y «esta» rotulados, a 13 px */
.vdots.v3 { height: 30px; margin-top: 16px; background-size: 100% 2px; }
.vdots.v3 .vd { top: 11px; }
.vdots.v3 .vd.me { z-index: 2; }
.vdots.v3 .vz { top: 0; bottom: 0; }
.vdots.v3 .vd-me { position: absolute; top: -17px; transform: translateX(-50%); font-size: var(--fs-cap); line-height: 15px; font-weight: 600; color: var(--text); white-space: nowrap; pointer-events: none; }
.vd-ax.v3 { position: relative; display: block; height: 18px; font-size: var(--fs-cap); }
.vd-ax.v3 .tick { position: absolute; top: 0; white-space: nowrap; }
.vd-ax.v3 .tick.l { left: 0; } .vd-ax.v3 .tick.r { right: 0; } .vd-ax.v3 .tick.z { transform: translateX(-50%); }
.x-vars .vdots.v3 { height: 22px; margin-top: 4px; } .x-vars .vdots.v3 .vd { top: 7px; }
/* v3.3 · arreglos de las compuertas */
.cmp-t tbody td.best { background: none; box-shadow: inset 3px 0 0 var(--accent-mark); }
.cmp-t .ch-n { position: relative; } .cmp-t .ch-n::after { content: ""; position: absolute; inset: -12px 0; }
.main.is-cmp .dhead .dsub .stamp { display: block !important; }
@media (max-width: 767px) {
  .cmptray .ct-x { width: 44px; height: 44px; }
  .cmptray .ct-act .linkbtn { min-width: 44px; justify-content: center; }
  .dhead h1 { min-width: 0; max-width: 100%; }
  .dhead h1 .vn { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
/* v3.3 · «Probar en la Mesa» visible en todos los anchos de escritorio (a 1280–1439 como ícono con nombre accesible) */
.x-actions .x-mesa svg { width: 16px; height: 16px; }
@media (min-width: 768px) and (max-width: 1439px) { .x-actions .x-mesa { display: inline-flex !important; width: 40px; padding: 0; justify-content: center; } .x-actions .x-mesa .bt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
/* ficha: el mosaico del saldo con el contenido arriba, alineado con «Cada 100» */
.d-kpis .kpi.hero { justify-content: flex-start !important; }
/* celular: «Cómo se lee» como «?» en la fila de la leyenda */
@media (max-width: 767px) {
  .lh2 { flex-wrap: wrap; align-items: center; }
  .lh2 .howread { margin-left: auto; }
  .lh2 .howread > summary { min-width: 44px; min-height: 44px; justify-content: center; }
  .lh2 .howread:not([open]) .hr-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lh2 .howread[open] { flex: 0 0 100%; }
  .lh2 .howread[open] > summary { justify-content: flex-start; }
}
@media (min-width: 768px) and (max-width: 1439px) { .x-actions .cmpbtn { width: 40px; padding: 0; justify-content: center; } .x-actions .cmpbtn .bt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.cmptray .ct-list li { max-width: 280px; }

/* ============ v3.4 · pulido final ============ */
.main { position: relative; }
.topbar { background: var(--canvas) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.tick, .vd-ax .tick, .chart .tick { font-size: var(--fs-cap) !important; }
.cards-ghost .card { pointer-events: none; }

/* tarjeta abierta: «1 perdida borra N ganadas» debajo de la regla, a la izquierda, antes del «por qué» */
.x-does > p:first-child { flex: 1 1 100%; }
.x-does .x-lost { order: 2; flex: 0 0 auto; margin: 0 14px 0 0; font-size: var(--fs-cap); line-height: 18px; color: var(--text); }
.x-does .x-why { order: 3; flex: 1 1 260px; }

/* botón Comparar siempre con texto; encendido = color de la estrategia + «En comparación» (no un cuadrado lima) */
.cmpbtn .cmp-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--text-2)); flex: none; }
.cmpbtn[aria-pressed="true"] { background: var(--card) !important; color: var(--text) !important; border-color: var(--c, var(--line-hover)) !important; box-shadow: inset 0 0 0 1px var(--c, var(--line-hover)) !important; }
@media (min-width: 768px) and (max-width: 1439px) {
  .x-actions .cmpbtn { width: auto !important; padding: 0 12px !important; justify-content: flex-start !important; }
  .x-actions .cmpbtn .bt { position: static !important; width: auto !important; height: auto !important; clip: auto !important; overflow: visible !important; }
}
.x-mact { display: none; }
@media (max-width: 767px) {
  .x-mact { display: flex; gap: 8px; margin: 8px 0 2px; }
  .x-mact .starbtn { position: static; flex: none; width: 44px; height: 44px; border: 1px solid var(--line-hover); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--card); }
  .x-mact .cmpbtn { height: 44px; flex: 1 1 auto; justify-content: center; }
  .x-mact .c-var.btn { height: 44px; flex: none; padding: 0 12px; border: 1px solid var(--line-hover); border-radius: 10px; }
  .actions [data-cmp] { width: auto !important; padding: 0 12px !important; flex: 0 1 auto !important; }
  .actions [data-cmp] .bt { position: static !important; width: auto !important; height: auto !important; clip: auto !important; overflow: visible !important; }
}

/* bandeja anclada a la columna del contenido (no tapa el riel); una fila; en el celular una barra que se despliega */
.cmptray { display: block !important; left: calc(var(--rail-w) + 24px) !important; right: 24px !important; width: auto !important; transform: none !important; padding: 8px 12px !important; animation: none; }
.cmptray .ct-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cmptray .ct-h { display: inline-flex; align-items: center; gap: 8px; flex: none; margin: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--fs-sec); min-height: 36px; cursor: default; }
.cmptray .ct-h svg { width: 18px; height: 18px; }
.cmptray .ct-chev { display: none; }
.cmptray .ct-list { flex: 1 1 auto; display: flex; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow: hidden; }
.cmptray .ct-list li { flex: 0 1 auto; min-width: 0; max-width: 260px; }
.cmptray .ct-act { flex: none; margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cmptray .ct-msg { margin: 4px 0 0; }
.cmptray .ct-msg:empty { display: none; }
body.has-tray .main { padding-bottom: calc(var(--tray-h, 60px) + 28px) !important; }
@media (max-width: 1023px) { .cmptray { left: 12px !important; right: 12px !important; } }
@media (max-width: 767px) {
  .cmptray { bottom: 8px !important; padding: 4px 8px !important; }
  .cmptray .ct-row { flex-wrap: wrap; gap: 4px 8px; }
  .cmptray .ct-h { min-height: 44px; cursor: pointer; }
  .cmptray .ct-chev { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-135deg) translate(-2px, -2px); }
  .cmptray.open .ct-chev { transform: rotate(45deg); }
  .cmptray .ct-list { order: 3; flex: 0 0 100%; display: none; flex-direction: column; max-height: 45vh; overflow-y: auto; padding-bottom: 4px; }
  .cmptray.open .ct-list { display: flex; }
  .cmptray .ct-list li { max-width: 100%; }
  .cmptray .ct-act .btn { height: 44px; }
}

/* comparar: fila de nombres fija al bajar; debajo, variante, tipo y qué hace; «mejor» neutro (fondo tenue y rótulo) */
.cmp-t thead tr.cmp-hn th, .cmp-t thead tr.cmp-hn td { position: sticky; top: var(--bar-h); z-index: 4; background: var(--card); }
.cmp-t thead tr.cmp-hn th { border-top: 3px solid var(--c); padding: 8px 38px 8px 12px; vertical-align: middle; }
.cmp-t thead tr.cmp-hn .ch-n { font-size: 15px; line-height: 20px; padding-right: 0; }
.cmp-t thead tr.cmp-hn .ch-x { top: 50%; transform: translateY(-50%); }
.cmp-t thead tr.cmp-hd-r td { vertical-align: top; padding: 2px 12px 10px; border: 0; }
.cmp-t thead tr.cmp-hd-r .ch-v, .cmp-t thead tr.cmp-hd-r .ch-k, .cmp-t thead tr.cmp-hd-r .ch-does { display: block; }
.cmp-t thead tr.cmp-hd-r .ch-v { font-size: var(--fs-sec); font-weight: 600; }
.cmp-t thead tr.cmp-hd-r .ch-k { margin-top: 2px; font-size: var(--fs-cap); color: var(--text-2); }
.cmp-t thead tr.cmp-hd-r .ch-does { margin-top: 6px; font-size: var(--fs-cap); line-height: 18px; color: var(--text-2); }
.cmp-t tbody td.best { background: color-mix(in srgb, var(--text) 6%, transparent) !important; box-shadow: none !important; }
.cmp-t tbody td .cv { display: inline; }
.cmp-t tbody td.best .cv > .fig { font-weight: 800; }
.best-m { display: none !important; }
.best-t { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px solid var(--line-hover); border-radius: 999px; font-size: var(--fs-cap); line-height: 18px; font-weight: 600; color: var(--text); vertical-align: 1px; }
.cmp-p .ph .sub .best-t { margin: 0 4px 0 0; }
.cmp-t .u { font-size: var(--fs-cap); color: var(--text-2); font-weight: 500; }
.ac-sw.line.dash { -webkit-mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 10px); mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 10px); }
.dhead .actions .linkbtn[data-act="cmp-clear"] { min-height: 36px; }
@media (max-width: 767px) {
  .cmp-t thead tr.cmp-hn { position: sticky; top: var(--bar-h); z-index: 4; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; padding: 6px 0; background: var(--card); }
  .cmp-t thead tr.cmp-hn th { position: relative; top: auto; border-top: 0; border-left: 0; border-bottom: 3px solid var(--c); padding: 2px 26px 4px 2px; }
  .cmp-t thead tr.cmp-hn .ch-n { font-size: var(--fs-cap); line-height: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cmp-t thead tr.cmp-hn .ch-x { width: 24px; height: 24px; right: 0; }
  .cmp-t thead tr.cmp-hn .ch-x::after { content: ""; position: absolute; inset: -10px; }
  .cmp-t thead tr.cmp-hd-r { display: none; }
  .cmp-t tbody td small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cmp-t tbody td.best { padding-left: 6px; padding-right: 4px; }
  .cmp-t tbody td .best-t { display: block; width: max-content; margin: 2px 0 0; }
}

/* ficha: el mosaico del saldo con su mini evolución (llena el lugar vacío) */
.d-kpis .kpi.hero .hero-spark { flex: 1 1 auto; min-height: 56px; margin-top: 10px; grid-template-columns: minmax(0, 1fr) !important; }
.d-kpis .kpi.hero .hero-spark .evo-g { display: none; }
@media (max-width: 767px) { .d-kpis .kpi.hero .hero-spark { min-height: 40px; height: 40px; } }
/* curva de la ficha: llena su panel */
.p-curve { display: flex; flex-direction: column; }
.p-curve .d-curve { flex: 1 1 auto; min-height: 268px; }

/* mini evolución: el máximo también rotulado («máx.») */
.evo-y.hi.mx { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 14px; }
.evo-y.hi.mx .cap { font-weight: 500; color: var(--text-2); }

/* relleno bajo cero más liviano (sin «losas» marrones) */
.evo-area.n { opacity: .45; }
.sal-area.n { opacity: .05 !important; }

/* tarjeta en el celular: la variante entera (hasta 2 líneas); el conteo con su flecha, siempre en una pieza */
.c-var .vcount { white-space: nowrap; display: inline-flex; align-items: center; }
@media (max-width: 767px) {
  .card:not(.is-open) .c-sub { height: auto; min-height: 20px; align-items: flex-start; }
  .card:not(.is-open) .c-var { height: auto; min-height: 22px; align-items: flex-start; text-align: left; max-width: 100%; }
  .card:not(.is-open) .c-var .vname { max-width: none; flex: 1 1 auto; min-width: 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 18px; }
}

/* ventana de variantes: si la lista sigue, se nota */
.vp-list.scrolls { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.vp-list.scrolls.at-end { -webkit-mask-image: none; mask-image: none; }

/* ficha: separación entre anterior/siguiente y las acciones */
.dhead .actions .pnav { margin-right: 8px; padding-right: 14px; border-right: 1px solid var(--line); }
@media (max-width: 767px) { .dhead .actions .pnav { margin-right: 0; padding-right: 6px; } }
.rtable2 th.rn .sticon { margin-left: 4px; }

/* v3.4 · tarjeta abierta a 1280–1439: sin el tipo de jugada en la cabecera (está en la ficha y en los filtros) para que el nombre, la variante y las acciones entren en una fila */
@media (min-width: 768px) and (max-width: 1439px) { .x-head .c-sub .c-kind { display: none; } }
.x-vars .vdots.v3 { margin-top: 2px; } .x-vars .vd-ax.v3 { height: 16px; }
.x-kpis .kpi .v small { font-size: var(--fs-cap); font-weight: 500; color: var(--text-2); }
@media (min-width: 1280px) { .x-kpis { grid-template-columns: minmax(150px, .82fr) repeat(4, minmax(0, 1fr)) !important; } .x-kpis .kpi:not(.hero) { padding-left: 9px; padding-right: 9px; column-gap: 6px; } }
/* v3.4 · mini evolución dentro del mosaico del saldo */
.d-kpis .kpi.hero .hero-spark { height: 64px !important; flex: none !important; position: relative; display: grid; }
.d-kpis .kpi.hero .hero-spark .evo-plot { grid-column: 1 !important; height: 100%; }
@media (max-width: 767px) { .d-kpis .kpi.hero .hero-spark { height: 40px !important; } }
/* comparar en el celular: una métrica por bloque, una fila por estrategia (color · nombre · cifra) */
@media (max-width: 767px) {
  .cmp-t:not(.cmp-how) thead tr.cmp-hn { position: static; display: flex; flex-direction: column; gap: 4px; padding: 0 0 6px; }
  .cmp-t:not(.cmp-how) thead tr.cmp-hn th { border-bottom: 0; border-left: 4px solid var(--c); padding: 6px 44px 6px 10px; }
  .cmp-t:not(.cmp-how) thead tr.cmp-hn .ch-n { font-size: var(--fs-sec); line-height: 20px; -webkit-line-clamp: 2; }
  .cmp-t:not(.cmp-how) thead tr.cmp-hn .ch-x { width: 36px; height: 36px; right: 2px; }
  .cmp-t:not(.cmp-how) tbody tr { display: block; padding: 8px 0 6px; }
  .cmp-t:not(.cmp-how) tbody th { display: block; padding: 0 0 4px; }
  .cmp-t:not(.cmp-how) tbody td { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline; padding: 5px 6px 5px 0; border: 0; border-top: 1px solid var(--line); }
  .cmp-t:not(.cmp-how) tbody td::before { content: ""; grid-column: 1; grid-row: 1; width: 10px; height: 10px; border-radius: 3px; background: var(--c); align-self: center; }
  .cmp-t:not(.cmp-how) tbody td .cmp-cn { display: block; grid-column: 2; grid-row: 1; font-size: var(--fs-cap); color: var(--text-2); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cmp-t:not(.cmp-how) tbody td .cv { grid-column: 3; grid-row: 1; text-align: right; white-space: nowrap; }
  .cmp-t:not(.cmp-how) tbody td small { grid-column: 2 / -1; grid-row: 2; text-align: right; -webkit-line-clamp: 1; }
  .cmp-t:not(.cmp-how) tbody td .best-t { display: inline-block; margin: 0 0 0 6px; }
  .cmp-t:not(.cmp-how) tbody td.best { padding-left: 6px; }
}
@media (max-width: 767px) {
  .d-kpis .kpi.hero .hero-spark { display: none !important; }
  /* ficha: fila 1 variantes + anterior/siguiente; fila 2 Guardar y Comparar con texto */
  .dhead .actions { display: contents; }
  .dhead .dsub { order: 1; }
  .dhead .actions .pnav { order: 1; margin-left: auto; margin-right: 0; padding-right: 0; border-right: 0; }
  .dhead .actions [data-star] { order: 2; flex: 1 1 40% !important; width: auto !important; padding: 0 12px !important; justify-content: center; gap: 6px; }
  .dhead .actions [data-star] .bt { position: static !important; width: auto !important; height: auto !important; clip: auto !important; overflow: visible !important; }
  .dhead .actions [data-cmp] { order: 2; flex: 1 1 55% !important; justify-content: center; }
}
/* v3.4 · relleno de la mini evolución: tenue arriba y abajo de cero (sin losas) */
.evo-area.p { fill: var(--gain-bar) !important; fill-opacity: .14; opacity: 1 !important; }
.evo-area.n { fill: var(--loss-bar) !important; fill-opacity: .09; opacity: 1 !important; }
/* bandeja: los nombres enteros; si no entran en una fila, pasa a dos (solo entonces) */
@media (min-width: 768px) { .cmptray .ct-list { flex-wrap: wrap; overflow: visible; } .cmptray .ct-list li { max-width: none; flex: 0 0 auto; } .cmptray .ct-n { overflow: visible; text-overflow: clip; } }

/* v3.4 · comparar en el celular: «Vaciar» con blanco táctil de 44 */
@media (max-width: 767px) { .dhead .actions .linkbtn[data-act="cmp-clear"] { min-height: 44px; min-width: 44px; } }
/* v3.4 · tarjeta en el celular: la mini evolución solo rotula la caída (el máximo apilado encima se leía como parte de la caída) */
@media (max-width: 767px) { .card:not(.is-open) .evo-g:has(.evo-y.dd) .evo-y.hi { display: none; } }
/* v3.4 · bandeja del celular en una fila (≤ 88 px): «Vaciar» aparece al desplegarla */
@media (max-width: 767px) {
  .cmptray:not(.open) .ct-act [data-act="cmp-clear"] { display: none; }
  .cmptray .ct-act .btn.primary { padding: 0 14px; }
}

/* En línea sin sesión: «Entrá con tu cuenta». Sin cifras: detrás, la grilla vacía y apagada. */
.frame.gate-on { grid-template-columns: minmax(0, 1fr); }
.frame.gate-on .rail-col { display: none; }
.gate { position: relative; padding: 44px 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); }
.gate-card .kicker { margin-bottom: 8px; }
.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); }
.gate-text { margin: 0 0 18px; font-size: var(--fs-body); line-height: 1.5; color: var(--text-2); }
.gate-list { display: grid; gap: 10px; margin: 0 0 22px; padding: 16px 0 0; list-style: none; border-top: 1px solid var(--line); }
.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; font-size: var(--fs-row); }
.gate-btn svg { width: 18px; height: 18px; }
.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 .cards { max-height: 520px; overflow: hidden; }
@media (max-width: 767px) {
  .gate { 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 .cards { max-height: 300px; }
}
