/* 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); }
.esperable { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.esperable-h { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-cap); }
.esperable-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: var(--sorted-wash); }
.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: var(--tile); }
.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: var(--panel); }
.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: var(--band); }
.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); }
.esperable { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.esperable-h { font-size: var(--fs-cap); color: var(--text-2); }
.esperable-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 esperable 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: var(--band-wash); }
.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; }
/* (v3.5: la barra de arriba es la del marco común, igual en toda la web; antes se pintaba con --canvas acá) */
.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: var(--row-best) !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; }
}

/* ================= v3.5 · capital que necesitó, modelo sin banca (la barra común la pone Web/marco/envolver) ================= */
/* Tarjeta cerrada: la línea del capital que necesitó, debajo de lo que ganó (protagonista: cifra de 16 px) */
.c-cap { margin: 0; display: flex; align-items: baseline; gap: 5px; height: 21px; font-size: var(--fs-sec); line-height: 21px; white-space: nowrap; overflow: hidden; color: var(--text); }
.c-cap .k { font-size: var(--fs-cap); color: var(--text-2); }
.c-cap .fig.capv { font-size: 16px; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); }
.c-cap small { font-size: var(--fs-cap); color: var(--text-2); }
.c-cap .c-cap-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.c-cap .c-vec b { font-weight: 700; }
.c-cap.is-sorted .capv, .c-cap .c-vec.is-sorted b { box-shadow: inset 0 -2px 0 var(--accent-mark); }
@media (max-width: 767px) { .card { height: auto; } .c-cap { height: auto; white-space: normal; } }
/* marca del punto más bajo en la mini evolución */
.evo-mk { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--card); border: 2px solid var(--text); pointer-events: none; z-index: 1; }
/* Mosaico doble: lo que ganó y el capital que necesitó, lado a lado y del mismo tamaño */
.kpi.hero2 { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; align-content: center; }
.kpi.hero2 .hp { min-width: 0; display: flex; flex-direction: column; }
.kpi.hero2 .hp-c { padding-left: 14px; border-left: 1px solid var(--line); }
.kpi.hero2 .hp .v small { font-size: var(--fs-cap); font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.kpi.hero2 .hp .d { white-space: normal !important; overflow: visible; text-overflow: clip; }
.kpi.hero2 .hp-vec { margin-top: 3px; color: var(--text-2); }
.kpi.hero2 .hp-vec .fig { font-weight: 700; color: var(--text); }
.kpi.hero2 .hp-vec .fig.gain { color: var(--gain); } .kpi.hero2 .hp-vec .fig.loss { color: var(--loss); }
.kpi.hero2 .fig.capv { color: var(--text); }
@media (min-width: 1280px) { .x-kpis { grid-template-columns: minmax(300px, 2fr) repeat(4, minmax(0, 1fr)) !important; } }
.x-kpis .kpi.hero2 .v { font-size: 26px !important; letter-spacing: -.02em; }
.d-kpis .kpi.hero2 { grid-template-rows: auto 1fr; }
.d-kpis .kpi.hero2 .v { font-size: 30px; }
.d-kpis .kpi.hero2 .hero-spark { grid-column: 1 / -1; }
@media (max-width: 1279px) { .x-kpis .kpi.hero2 { grid-column: 1 / -1; grid-row: auto; } }
@media (max-width: 767px) { .kpi.hero2 { grid-template-columns: minmax(0, 1fr); row-gap: 10px; } .kpi.hero2 .hp-c { padding-left: 0; border-left: 0; padding-top: 10px; border-top: 1px solid var(--line); } }
/* Tu capital: arriba de todo en el riel, grande y con atajos */
.capbox { padding-top: 2px !important; border-top: 0 !important; }
.capbox h2 { font-size: var(--fs-sec) !important; color: var(--text) !important; font-weight: 650 !important; }
.banca.big input { width: 150px; height: 44px; font-size: 20px; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.capchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.capchips .chip { min-width: 0; height: 32px; padding: 0 11px; font-variant-numeric: tabular-nums; }
.capchips .chip[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.capbox .help { margin-top: 8px; }
@media (max-width: 1023px) { .capchips .chip { height: 44px; } }
/* Curva grande: rótulos que se leen sin pasar el mouse */
.low-ring { fill: var(--card); stroke: var(--text); stroke-width: 2; }
.need-seg { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; }
.need-tick { stroke: var(--text); stroke-width: 2; }
.ac-tick.ann { font-size: 13px; font-weight: 650; }
.ac-tick.ann-dd { fill: var(--dd); }
.ac-tick.ann-low, .ac-tick.ann-need-t, .ac-tick.ann-rank { fill: var(--text); }
/* Barras con una sola ruleta: las demás en gris, esta resaltada; días incompletos más tenues */
.bar.mute { fill: var(--line-hover); }
.bar.here:not(.p):not(.n) { fill: var(--accent-mark); }
.bar.mute.here { fill: var(--accent-mark); }
.bar.part { opacity: .5; }
/* Tabla y ficha: la columna del capital */
.grid td.t-cap, .grid th.t-cap { width: 86px; }
.rtable2 td.rk, .rtable2 th.rk { text-align: right; white-space: nowrap; }
.d-kpis { grid-template-columns: minmax(360px, 2fr) repeat(4, minmax(0, 1fr)) !important; }
.d-kpis .kpi.hero2 { grid-row: span 2 !important; }
@media (max-width: 1599px) { .d-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } .d-kpis .kpi.hero2 { grid-column: span 2; grid-row: span 2 !important; } }
@media (max-width: 767px) { .d-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .d-kpis .kpi.hero2 { grid-column: 1 / -1; grid-row: auto !important; } }
.c-cap .fig.apv { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--text); }
.apm-mesa { display: block; margin-top: 3px; color: var(--text-2); }
/* v3.5 · la línea del capital entra sin perder las 6 tarjetas enteras a 1366×630: todo 1–2 px más justo y el gráfico chico de 30 px como mínimo */
@media (min-width: 768px) {
  .card:not(.is-open) { min-height: 230px; padding: 7px 14px 6px; gap: 1px; }
  .card:not(.is-open) .c-sub { min-height: 19px; }
  .card:not(.is-open) .c-stats { margin-top: 1px; }
  .card:not(.is-open) .st-rows p.st { line-height: 19px; }
  .card:not(.is-open) .c-cap { height: 19px; line-height: 19px; }
  .card:not(.is-open) .c-chart { min-height: 47px; margin-top: 0; }
  .card:not(.is-open) .c-ch-h { height: 17px; }
  .card:not(.is-open) .evo-box, .card:not(.is-open) .c-strip { min-height: 30px; }
  .card:not(.is-open) .c-foot { height: 17px; }
  .c-stats.wide .st-rows p.st { font-size: var(--fs-cap); }
}
@media (min-width: 768px) { .c-stats.wide .st-saldo .fig { font-size: 20px; } }
/* Tarjeta abierta: 5 columnas iguales; lo que ganó y el capital, dos mosaicos altos */
@media (min-width: 1280px) { .x-kpis.x5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; } }
.x-kpis .kpi.hx { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; gap: 0; }
.x-kpis .kpi.hx .v { font-size: 28px !important; letter-spacing: -.02em; }
.x-kpis .kpi.hx .v small { font-size: var(--fs-cap); font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.x-kpis .kpi.hx .d { white-space: normal !important; }
.x-kpis .kpi.hx-c .fig.capv { color: var(--text); }
.x-kpis .kpi.hx .hp-vec { margin-top: 4px; }
.x-kpis .kpi.hx .hp-vec .fig { font-weight: 700; }
@media (max-width: 1279px) { .x-kpis .kpi.hx { grid-row: auto; grid-column: span 1; } }
@media (max-width: 1599px) { .toolbar.one .hlegend { display: none; } .toolbar.one ~ .lh2 .hl-2 { display: inline-flex; } }
/* Ruleta por ruleta: lugar para «Necesitó» */
.rtable2 .rn { width: 28%; } .rtable2 .rb { width: 15%; } .rtable2 .rv { width: 12%; } .rtable2 .rk { width: 11%; font-variant-numeric: tabular-nums; } .rtable2 .rg { width: 23%; } .rtable2 .rc { width: 11%; }
@media (max-width: 1499px) { .rtable2 .rn { width: 27%; } .rtable2 .rb { width: 20%; } .rtable2 .rg { width: 20%; } }
@media (max-width: 767px) { .rtable2 .rb { display: none; } .rtable2 .rn { width: 40%; } .rtable2 .rv { width: 20%; } .rtable2 .rk { width: 18%; } .rtable2 .rg { width: 22%; } }
/* Tabla: «Necesitó» entra y «Ganó o perdió» no se corta; con menos de 1500 px la escalera se ve en la tarjeta y en la ficha (vuelve si se ordena por ella) */
.grid th.t-saldo { width: 100px; } .grid th.t-cap { width: 88px; }
@media (max-width: 1499px) { .grid .t-peor { display: none; } .grid.so-peor .t-cap { display: none; } }
.grid.so-capital .t-cap, .grid.so-veces .t-cap { display: table-cell !important; }
.x-kpis .kpi.hx .v { font-size: 25px !important; }
.x-kpis .kpi.hx { padding-top: 7px; padding-bottom: 7px; }
.x-kpis.x5 .kpi:not(.hx) { padding-top: 7px; padding-bottom: 7px; }
@media (min-width: 1280px) and (max-width: 1439px) { .x-grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.5fr); } }
.x-kpis .kpi.hx .v { font-size: 24px !important; line-height: 1.1; }
/* Celular y tablet: «Tu capital» a la vista en la barra de la lista (abre la hoja, donde es el primer control) */
.capbtn { display: none; }
@media (max-width: 1023px) { .capbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; white-space: nowrap; } .capbtn span { color: var(--text-2); font-weight: 500; } .capbtn b { font-variant-numeric: tabular-nums; } }
@media (max-width: 420px) { .capbtn { padding: 0 10px; gap: 4px; } .capbtn span.l { display: none; } }
.capbtn span.s { display: none; }
@media (max-width: 420px) { .capbtn span.s { display: inline; color: var(--text-2); font-weight: 500; } }
/* v3.5 · ronda 2: «Ganó | Necesitó» lado a lado, mismo peso; debajo una línea con Cada 100 y Gana el */
.c-stats.c-pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 2px; }
.c-pair .st { min-width: 0; }
.c-pair .dt { display: block; font-size: var(--fs-cap); line-height: 16px; color: var(--text-2); }
.c-pair .dd { display: flex; align-items: baseline; gap: 4px; line-height: 26px; white-space: nowrap; }
.c-pair .st-saldo .fig { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.c-pair .st-cap { padding-left: 14px; border-left: 1px solid var(--line); }
.c-pair .st-cap .fig.capv { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.c-pair .st-cap .fig.capv.loss { color: var(--loss); }
.c-pair .st-cap small { font-size: var(--fs-cap); color: var(--text-2); }
.c-pair .capx { color: var(--loss); font-size: 14px; font-weight: 700; }
.c-pair .cs { display: block; font-size: var(--fs-cap); line-height: 16px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-pair .cs b { color: var(--text); font-weight: 700; } .c-pair .cs b .fig { color: var(--text); }
.c-pair .st-cap.is-sorted .capv { box-shadow: inset 0 -2px 0 var(--accent-mark); }
.c-line { margin: 1px 0 0; height: 19px; line-height: 19px; font-size: var(--fs-sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.c-line .k { font-size: var(--fs-cap); color: var(--text-2); }
.c-line .fig { font-weight: 700; }
.c-line small { font-size: var(--fs-cap); color: var(--text-2); }
.c-line .sep { margin: 0 6px; color: var(--text-2); }
.c-line .is-sorted .fig { box-shadow: inset 0 -2px 0 var(--accent-mark); }
@media (min-width: 768px) {
  /* filas alineadas: lo de abajo queda anclado al pie (la descripción absorbe la diferencia de 1 o 2 renglones de título) */
  /* (ronda 2: la descripción que absorbía la diferencia dejaba aire vacío; vuelve a absorberla el gráfico) */
}
.c-hl { font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; }
.c-hl b, .c-hl .fig { color: var(--text); font-weight: 700; font-size: var(--fs-sec); }
.c-hl b.gain { color: var(--gain); } .c-hl b.loss { color: var(--loss); }
.c-hl.is-sorted b { box-shadow: inset 0 -2px 0 var(--accent-mark); }
@media (min-width: 768px) {
  .c-chart.has-hl .chartsel { position: absolute; left: 0; top: 20px; z-index: 3; opacity: 0; }
  .card:hover .c-chart.has-hl .chartsel, .c-chart.has-hl .chartsel:focus-visible, .c-chart.has-hl .chartsel:focus { opacity: 1; }
}
@media (max-width: 767px) { .c-chart.has-hl .c-ch-h { justify-content: space-between; } }

/* curva: corchete de la caída y guías de los rótulos */
.dd-bracket { stroke: var(--dd); stroke-width: 2; }
.ann-lead { stroke: var(--text-2); stroke-width: 1; opacity: .8; }
.ann-lead.ann-dd { stroke: var(--dd); }
.ac-tick.halo.ann { stroke: var(--card); stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
/* «¿Dónde quedaron las que antes ganaban más?» dentro de «Cómo se lee» */
.howread .antes { margin: 10px 0 6px; padding: 14px 16px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.howread .antes h3 { margin: 0 0 6px; font-size: var(--fs-row); font-weight: 700; color: var(--text); }
.howread .antes p { margin: 0 0 6px; font-size: var(--fs-sec); line-height: 1.45; color: var(--text); max-width: 110ch; }
.howread .antes p.muted { color: var(--text-2); }
.ant-t { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: var(--fs-sec); font-variant-numeric: tabular-nums; }
.ant-t th, .ant-t td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; }
.ant-t thead th { border-top: 0; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); }
.ant-t th[scope="row"], .ant-t thead th:first-child { text-align: left; font-weight: 600; color: var(--text); }
.ant-t th[scope="row"] a { color: var(--text); }
.ant-t td b { display: block; font-weight: 700; } .ant-t td b.gain { color: var(--gain); } .ant-t td b.loss { color: var(--loss); }
.ant-t td small { display: block; font-size: var(--fs-cap); color: var(--text-2); }
.ant-x { display: block; font-size: var(--fs-cap); font-weight: 500; color: var(--loss); }
@media (max-width: 767px) { .ant-t thead { display: none; } .ant-t tr { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid var(--line); } .ant-t th[scope="row"] { grid-column: 1 / -1; border-top: 0; } .ant-t td { border-top: 0; text-align: left; } }
.capdrop > summary::marker { content: ""; }
@media (max-width: 1599px) { .toolbar .hlegend { display: none; } .lh2 .hl-2 { display: inline-flex; } }
/* Comparar: el color 2 deja de parecerse al rojo de la caída (índigo de la paleta ATLAS, dv-color-atlas-premium) */
:root { --cmp-2: #6f8ff0; }
:root[data-theme="light"] { --cmp-2: #3b5fc8; }
.cmp-leg-b { flex-basis: 100%; margin-top: 4px; }
.cmp-leg-b .ac-sw { width: 10px; height: 10px; border-radius: 2px; }
/* mosaico doble: las dos cifras a la misma altura */
.x-kpis .kpi.hx { justify-content: flex-start; }
.cmp-p .xp-h { flex-wrap: wrap; row-gap: 4px; }
.cmp-p .xp-h .cmp-leg-b { display: flex !important; order: 3; }
.rtable2 th .hs { display: none; }
@media (max-width: 767px) { .rtable2 th .hl { display: none; } .rtable2 th .hs { display: inline; } .rtable2 td.rv, .rtable2 td.rk { min-width: 6.5ch; } .rtable2 th.rn span { white-space: normal; } }
@media (max-width: 1023px) { .capdrop { display: none !important; } }
.c-hl.lad { color: var(--loss); } .c-hl.lad b, .c-hl.lad .fig { color: var(--loss); } .c-hl.lad .capx { margin-left: 3px; color: var(--loss); font-weight: 700; }
/* tocar una barra o una fila pasa a esa ruleta */
.bar.pick { cursor: pointer; }
.rtable2 tr.pick { cursor: pointer; }
.rtable2 tr.pick:hover th, .rtable2 tr.pick:hover td { background: var(--surface); }
.rtable2 tr.pick:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* v3.5 · en el celular también está «Ganancia por ruleta» en la tarjeta abierta (un toque pasa a esa ruleta) */
@media (max-width: 767px) { .card.is-open .x-bars-p { display: block; } .card.is-open .x-bars { height: 150px; } }

/* ================= v3.5 · ronda 3 de críticos ================= */
/* pastilla «no te alcanza» (en vez de ⊘) */
.nofit { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--loss-wash); color: var(--loss); font-size: var(--fs-cap); font-weight: 650; letter-spacing: 0; white-space: nowrap; vertical-align: 3px; }
.c-pair .dd .nofit { vertical-align: 2px; }
/* cabecera del minigráfico con «apuesta máx.»: el menú del gráfico aparece arriba a la derecha, al pasar el mouse */
@media (min-width: 768px) { .c-chart.has-hl .chartsel { left: auto !important; right: 0; top: 19px !important; } }
/* barra de la lista con una sola ruleta: el nombre no pisa el sello */
.tb-count { min-width: 0; } .tb-count .sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1699px) { .toolbar.one .tools .stamp { display: none; } .toolbar.one ~ .lh2 .stamp-2 { display: inline-flex; } }
/* riel: «Solo las que te alcanzan» como interruptor, en su renglón */
.capfit { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer; font: 600 var(--fs-sec) var(--font); color: var(--text); text-align: left; }
.capfit .sw { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line-hover); transition: background .15s ease; }
.capfit .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); transition: transform .15s ease; }
.capfit[aria-checked="true"] .sw { background: var(--ink); } .capfit[aria-checked="true"] .sw::after { transform: translateX(14px); background: var(--ink-text); }
.capfit .n { margin-left: auto; font-weight: 500; color: var(--text-2); font-size: var(--fs-cap); }
@media (max-width: 1023px) { .capfit { min-height: 44px; } }
/* chip de la ruleta elegida en la tarjeta abierta (× vuelve a todas) */
.rchip { height: 26px; padding: 0 10px; font-size: var(--fs-cap); font-weight: 600; border-color: var(--text-2); }
@media (max-width: 767px) { .rchip { height: 44px; } }
/* curva: guía del pico al corchete y aro en el pico */
.dd-guide { stroke: var(--dd); stroke-width: 1; stroke-dasharray: 2 3; opacity: .8; }
.peak-ring { fill: var(--card); stroke: var(--dd); stroke-width: 1.75; }
/* barras que se tocan: toda la columna responde */
.col-hit { cursor: pointer; } .col-hit:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.bar.is-on { filter: brightness(1.25); }
/* Comparar: la serie 2 en arena (lejos del violeta, también con daltonismo) */
:root { --cmp-2: #4e75d2; } /* índigo de dv-color-atlas-premium-dark-6 (el arena se leía como texto) */
:root[data-theme="light"] { --cmp-2: #3b5fc8; }
/* ficha: marca de «pleno sin verificar» */
.sticon.ps { color: var(--loss); font-weight: 700; }
/* «¿Dónde quedaron…?» en el celular: cada cifra con su rótulo */
@media (max-width: 767px) { .ant-t td[data-l]::before { content: attr(data-l); display: block; font-size: var(--fs-cap); color: var(--text-2); margin-bottom: 2px; } }
/* tarjeta abierta: la curva, el panel más ancho */
@media (min-width: 1440px) { .x-grid3 { grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr) minmax(0, 1.15fr); } }
/* la ayuda «tocá una barra» en la cabecera solo si entra en un renglón; si no, va en el globo de cada barra */
.x-bars-p .xp-note { display: none; }
@media (min-width: 1600px) { .x-bars-p .xp-note:not(:empty) { display: inline; margin-left: auto; font-size: var(--fs-cap); color: var(--text-2); white-space: nowrap; } }
/* celular: la barra de la lista no cambia de alto al pasar a una ruleta */
@media (max-width: 767px) { .tb-count .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; } }
.stop-line { stroke: var(--loss); stroke-width: 1.5; stroke-dasharray: 4 3; }

/* v3.5 · la que todavía no jugó: un solo bloque en el lugar de las cifras (tarjeta, abierta y ficha), sin números inventados */
.nj { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 14px; border: 1px dashed var(--line); border-left: 3px solid var(--bar-neutral); border-radius: 0 10px 10px 0; background: var(--surface); }
.nj p { margin: 0; }
.nj .nj-t { font-size: var(--fs-row); font-weight: 700; color: var(--text); }
.nj .nj-d { font-size: var(--fs-sec); line-height: 1.45; color: var(--text); }
.nj .nj-n { font-size: var(--fs-sec); color: var(--text-2); }
.nj-c { flex: 1; min-height: 0; }
.nj-x { margin: 4px 0 12px; }
.nj-d { margin: 12px 0; }
.x-grid3.nj-grid { grid-template-columns: 1fr !important; }
.d-row.nj-r1 { grid-template-columns: 1fr !important; }
.nj-s { font-style: normal; }
/* v3.5 · «¿Dónde quedaron…?»: las que salieron del catálogo, con su motivo */
.howread .antes .ant-h2 { margin: 16px 0 4px; font-size: var(--fs-row); font-weight: 700; color: var(--text); }
.sac-t th[scope="row"] { font-weight: 600; }
.sac-t .ant-x { color: var(--text-2); font-weight: 500; }
/* v3.5 · criterio de calidad (28/09): nada cortado en el celular. Nombre de la tarjeta hasta 2 renglones; en la cabecera del gráfico,
   «Juega aprox. cada» baja a su propio renglón si no entra al lado de «apuesta máx.» (antes se cortaba con «…») */
@media (max-width: 767px) {
  .card:not(.is-open) { height: auto; }
  .card:not(.is-open) .c-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 44px; }
  .c-chart.has-hl .c-ch-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'hl sel' 'fq fq'; align-items: center; column-gap: 8px; row-gap: 2px; height: auto !important; min-height: 44px; max-height: none; flex-shrink: 0; }
  .c-chart.has-hl .c-hl { grid-area: hl; } .c-chart.has-hl .chartsel { grid-area: sel; justify-self: end; } .c-chart.has-hl .c-freq { grid-area: fq; justify-self: start; overflow: visible; text-overflow: clip; line-height: 18px; }
  .card:not(.is-open) .c-chart.has-hl { height: auto !important; min-height: 0; flex: none; }
  .c-chart.has-hl .chartsel { position: static !important; top: auto !important; min-height: 36px; }
  .c-chart.has-hl .c-ch-h { row-gap: 0; }
  .card:not(.is-open) .c-chart.has-hl .evo-box { flex: none; height: 64px; }
}
/* v3.5 · criterio de calidad: la ventana de variantes nunca corta el nombre (la cantidad de columnas sale del ancho disponible, estrategias.js) */
.varpop .vp-item { grid-template-columns: minmax(8.5em, 1fr) 40px auto auto; min-width: 0; }
.varpop .vp-n { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; padding: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 767px) { .varpop .vp-item { grid-template-columns: minmax(0, 1fr) 40px auto auto; } }
/* v3.5 · tabla: nombre y variante en dos renglones, enteros (antes la variante se cortaba y pisaba el botón de variantes) */
.grid td.name .namecell a { flex-direction: column; align-items: flex-start; gap: 1px; }
.grid td.name .namecell .fam, .grid td.name .namecell .vn { white-space: normal; overflow: visible; text-overflow: clip; max-width: 100%; }
/* v3.5 · ficha, ruleta por ruleta: encabezados y nombres enteros (2 renglones si hace falta), sin «…» */
.rtable2 thead th { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; vertical-align: bottom; }
.rtable2 th.rn { white-space: normal; overflow: visible; text-overflow: clip; line-height: 18px; padding-top: 4px; padding-bottom: 4px; }
.rtable2 th.rn > span { overflow: visible; text-overflow: clip; }
.rtable2 td { overflow: visible; }
/* v3.5 · tarjetas de al menos 330 px: en 1920 pasan de 5 a 4 columnas y ya no se corta nada (en 1699, 1366 y 1024 quedan las mismas columnas) */
.cards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
@media (max-width: 767px) { .cards { grid-template-columns: minmax(0, 1fr); } }
/* v3.5 · barra de arriba entre 768 y 1279: el conteo de variantes y ruletas baja a su propio renglón en vez de cortarse */
@media (max-width: 1279px) { .tb-count { flex-wrap: wrap; row-gap: 0; } .tb-count .sub { flex-basis: 100%; white-space: normal; overflow: visible; text-overflow: clip; } }
/* v3.5 · criterio de calidad: ficha, par de arriba: el rótulo y «no te alcanza» bajan de renglón en vez de pisar el mosaico de al lado */
.kpi.hero2 .hp .k { white-space: normal; overflow: visible; text-overflow: clip; }
.kpi.hero2 .hp .v { white-space: normal; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 4px; }
.nofit { white-space: nowrap; }
/* tabla: los encabezados pueden ir en dos renglones; entre 768 y 1279 se esconden «Escalera» y «Juega aprox. cada» (están en la tarjeta
   abierta y en la ficha) y también «Gana el», para que la tabla entre sin barra horizontal */
.grid thead th button, .grid thead th .thb, .grid thead th .l, .grid thead th .u { white-space: normal; }
@media (min-width: 768px) and (max-width: 1279px) { .grid .t-entra, .grid .t-peor, .grid .t-gan, .grid .t-evo { display: none; } .grid th.t-name { width: auto; } }
/* celular: «Cómo juega» con el rótulo del paso en dos renglones si hace falta; la nota «esta» de la tabla de ruletas, entera */
@media (max-width: 767px) { .xs-k { white-space: normal; } .rtable2 td.here-note { white-space: normal; } }

.rtable2 thead th.rv { white-space: normal !important; }
@media (max-width: 767px) { .rtable2 thead th { padding-left: 3px; padding-right: 3px; } }
/* la pastilla «no te alcanza» baja de renglón en cualquier mosaico doble (tarjeta abierta en el celular: se salía 19 px) */
.hp .v { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 4px; min-width: 0; }
.kpi.hx .v { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 4px; white-space: normal; min-width: 0; }
@media (min-width: 1280px) and (max-width: 1399px) { .grid .t-entra { display: none; } .grid th.t-name { width: 320px; } }
/* v3.5 · criterio de calidad: los desplegables de los paneles nunca se cortan. No se achican; si no entran los dos, el segundo baja de renglón */
.x-panel .xp-h, .panel .xp-h { flex-wrap: wrap !important; row-gap: 2px; }
.xp-h .chartsel, .xp-r .chartsel { flex-shrink: 0; max-width: 100%; }
.x-bars-p .xp-note { display: none !important; }
.xp-h .chartsel, .xp-h .chartsel.strong, .xp-h .chartsel:not(.strong), .p-curve .xp-h .chartsel.strong, .p-curve .xp-h .chartsel:not(.strong) { max-width: 100% !important; flex: 0 0 auto !important; text-overflow: clip; }
/* v3.5 · «apuesta máx.» en la columna izquierda del minigráfico (arriba), «Caída» abajo; la columna crece solo en esas tarjetas */
.evo-y.hi.ap { display: flex !important; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 14px; color: var(--text); font-weight: 650; pointer-events: auto; }
.evo-y.hi.ap .cap { font-weight: 500; color: var(--text-2); }
.evo-g:has(.evo-y.ap) .evo-y.hi.mx { display: none !important; }
.evo-box.has-ap { grid-template-columns: 86px minmax(0, 1fr); }
.card:not(.is-open) .evo-box.has-ap .evo-plot { min-height: 60px; }
/* ventana de variantes: cada fila crece con su nombre (el recuadro de la elegida ya no corta el texto) */
.varpop .vp-item { height: auto; min-height: 32px; align-items: center; }
.varpop .vp-list { overflow-x: hidden; }
/* «Probar en la Mesa» entre 768 y 1439: ícono + «Mesa» (solo el ícono parecía una cámara) */
.x-mesa .bs { display: none; }
@media (min-width: 768px) and (max-width: 1439px) { .x-actions .x-mesa { width: auto !important; padding: 0 12px !important; gap: 6px; } .x-actions .x-mesa .bs { display: inline; } }
/* v3.5 · con la barra de abajo del marco común (celular), la bandeja de Comparar va arriba de ella (antes quedaba tapada) */
@media (max-width: 767px) {
  body:has(.mk-bottom) .cmptray { bottom: calc(var(--mk-bottom-h, 56px) + env(safe-area-inset-bottom) + 8px) !important; }
  body:has(.mk-bottom).has-tray .main { padding-bottom: calc(var(--mk-bottom-h, 56px) + 140px); }
}
/* v3.5 · «Por ruleta» en la tarjeta cerrada: las barras usan todo el alto del gráfico (antes 18 px) */
.card:not(.is-open) .c-chart .c-strip { display: flex; flex-direction: column; min-height: 0; }
.card:not(.is-open) .c-chart .c-strip .strip { flex: 1 1 auto; height: auto !important; min-height: 36px; }
/* flecha de «N var.» a la altura del texto (antes quedaba más arriba cuando el botón crecía a dos renglones) */
.card:not(.is-open) .c-var { align-items: center !important; }
.card:not(.is-open) .c-var::after { align-self: center; margin-top: -4px; }
@media (max-width: 767px) { .c-var .vcount, .c-kind, .vcount.static { min-height: 24px; display: inline-flex; align-items: center; } }
@media (max-width: 767px) { .card .c-var { height: auto; min-height: 24px; } }
/* «Se sacaron 23»: tabla angosta (sin el hueco de 500 px en el medio) y «38 de 39» en un renglón */
.howread .antes .sac-t { width: auto; min-width: min(100%, 640px); max-width: 820px; }
.sac-t td b, .sac-t td small { display: inline; }
.sac-t td small { margin-left: 4px; }
.sac-t th, .sac-t td { padding-top: 5px; padding-bottom: 5px; white-space: nowrap; }
.sac-t th[scope="row"] { white-space: normal; }
@media (max-width: 767px) { .howread .antes .sac-t { min-width: 0; width: 100%; } .sac-t th, .sac-t td { white-space: normal; } }
.kpi .k .xk { font-size: var(--fs-cap); font-weight: 500; color: var(--text-2); margin-left: 4px; }
.kpi.kcap .v .capv.loss { color: var(--loss); }
/* v3.5 · celular: cabecera del minigráfico en un renglón alineado y el gráfico crece con sus rótulos (apuesta máx. + caída) sin pisar el pie */
@media (max-width: 767px) {
  .card:not(.is-open) .c-chart .c-ch-h { align-items: center; }
  .card:not(.is-open) .c-chart .chartsel { top: 0 !important; min-height: 44px; }
  .card:not(.is-open) .c-chart { height: auto !important; flex: none; }
  .card:not(.is-open) .c-chart .evo-box { min-height: 56px; }
  .card:not(.is-open) .c-chart .evo-box.has-ap .evo-plot { min-height: 72px; }
  .card:not(.is-open) .c-foot { margin-top: 12px; }
}
/* ☆ de la tarjeta: caja de 24 px de alto (antes 30) para que no toque «N var. ⌄» cuando la variante va en dos renglones */
@media (min-width: 768px) { .card:not(.is-open) .starbtn { top: 6px; height: 24px; } .card:not(.is-open) .c-sub { padding-right: 4px; } }
@media (max-width: 767px) { .card:not(.is-open) .c-head { padding-right: 46px; } }
/* «Todavía no jugó» en la tarjeta abierta: el aviso y «Cómo juega» lado a lado (sin renglones estirados con media tarjeta vacía) */
.x-grid3.nj-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) !important; align-items: stretch; }
.x-grid3.nj-grid .nj-x { margin: 0; }
@media (max-width: 767px) { .x-grid3.nj-grid { grid-template-columns: minmax(0, 1fr) !important; } }
.cmp-msg { font-size: var(--fs-cap); color: var(--loss); } .cmp-msg:empty { display: none; }
/* v3.5 · celular: «Ganancia por ruleta» como filas con nombre (se tocan con el dedo); las 10 primeras y «Ver las N» */
.mbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mbars li.more { display: none; } .mbars.all li.more { display: block; }
.mb-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 6px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: var(--fs-sec); text-align: left; cursor: pointer; }
.mb-row:hover, .mb-row:focus-visible { background: var(--surface); }
.mb-n { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.mb-b { position: relative; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.mb-b i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; } .mb-b i.p { background: var(--gain-bar); } .mb-b i.n { background: var(--loss-bar); }
.mb-v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; } .mb-v.gain { color: var(--gain); } .mb-v.loss { color: var(--loss); }
.mb-more { margin-top: 6px; min-height: 44px; }
/* v3.5 · Comparar en el celular: matriz (una columna por estrategia, con su color arriba) en vez de repetir los nombres en cada cifra;
   «mejor» siempre debajo de la cifra, así las cifras quedan alineadas (críticos, ronda 3) */
@media (max-width: 767px) {
  .cmp-t:not(.cmp-how) tbody tr { display: grid !important; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: 6px; padding: 8px 0 !important; border-top: 1px solid var(--line); }
  .cmp-t:not(.cmp-how) tbody th { grid-column: 1 / -1; }
  .cmp-t:not(.cmp-how) tbody td { display: flex !important; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 2px 0 !important; border: 0 !important; border-top: 3px solid var(--c) !important; min-width: 0; }
  .cmp-t:not(.cmp-how) tbody td::before { display: none !important; }
  .cmp-t:not(.cmp-how) tbody td .cmp-cn { display: none !important; }
  .cmp-t:not(.cmp-how) tbody td .cv { white-space: normal; text-align: left; overflow-wrap: anywhere; }
  .cmp-t:not(.cmp-how) tbody td small { display: block; text-align: left; -webkit-line-clamp: unset; overflow-wrap: anywhere; line-height: 1.25; }
  .cmp-t:not(.cmp-how) tbody td .best-t { display: table; margin: 2px 0 0 !important; }
  .cmp-t:not(.cmp-how) tbody td.best { padding-left: 2px !important; }
}
.vd-ax.v3 .tick.me { transform: translateX(-50%); font-weight: 700; color: var(--text); }
.vd-ax.v3 .tick.me.mr { transform: translateX(-100%); } .vd-ax.v3 .tick.me.ml { transform: none; }

/* v3.5 · colores derivados como tokens (regla 8 del criterio de calidad: 0 colores fuera de paleta). Se recalculan solos con el tema. */
:root { --tile: color-mix(in srgb, var(--surface) 60%, var(--card)); --panel: color-mix(in srgb, var(--surface) 35%, var(--card)); --loss-wash: color-mix(in srgb, var(--loss) 16%, transparent); --band: color-mix(in srgb, var(--text-2) 30%, transparent); --band-wash: color-mix(in srgb, var(--text-2) 12%, transparent); --row-best: color-mix(in srgb, var(--text) 6%, transparent); --sorted-wash: color-mix(in srgb, var(--accent-mark) 5%, transparent); }
.ac-leader { fill: none; } /* guías de los rótulos de Comparar: sin relleno (pintaban un triángulo negro) */
/* celular: la lista de ruletas de la tarjeta abierta ocupa su alto (antes se salía del panel de 150 px) y cada fila mide 44 px */
.x-bars:has(.mbars) { height: auto !important; min-height: 0 !important; overflow: visible; }
.x-bars-p:has(.mbars) { height: auto !important; }
.mb-row { min-height: 44px; }
.card:not(.is-open) .evo-box.has-ap { min-height: 60px; } /* el lugar de «apuesta máx.» existe desde el arranque: sin salto al dibujar */
@media (max-width: 767px) { .card:not(.is-open) .c-chart .evo-box.has-ap { min-height: 72px; } }
/* v3.5 · en vivo (preparado). Todo sale de ATLAS 04_Motion, con la paleta de Estrategias:
   · punto «jugando ahora»: el «.live::before» de demos/number-ticker-odometer.html (7 px, halo y latido de 1,4 s), en lima de marca;
   · cifra que cambia: el odómetro de ese mismo demo (columnas que ruedan, curva cubic-bezier(.16,1,.3,1), de derecha a izquierda);
   · aviso «Reordenar»: el toast de demos/toast-notificaciones.html (entra desde abajo con escala .96, radio 14, sombra de ventana). */
.vivo-dot { display: inline-block; width: 7px; height: 7px; margin: 0 0 2px 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); vertical-align: middle; animation: vivo-late 1.4s ease-in-out infinite; }
@keyframes vivo-late { 50% { opacity: .3; } }
.fig.odo { display: inline-flex; line-height: 1; vertical-align: baseline; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fig.odo .col { position: relative; display: inline-block; height: 1em; overflow: hidden; width: .62em; text-align: center; -webkit-mask: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.fig.odo .strip { display: flex; flex-direction: column; transition: transform .6s cubic-bezier(.16, 1, .3, 1); will-change: transform; }
.fig.odo .strip span { display: block; height: 1em; line-height: 1em; }
.fig.odo .sep { display: inline-block; height: 1em; line-height: 1em; }
.fig.vivo-cambio { color: var(--accent-mark); transition: color .9s; }
@media (prefers-reduced-motion: reduce) { .vivo-dot { animation: none; } .fig.odo .strip { transition-duration: 0s; } }
.vivo-orden { position: fixed; z-index: 46; right: 24px; bottom: 24px; width: min(380px, calc(100vw - 32px)); display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-pop); font-size: var(--fs-sec); color: var(--text); transition: transform .5s cubic-bezier(.16, 1, .3, 1), opacity .4s; }
.vivo-orden .vivo-dot { margin: 0; }
.vivo-orden.enter { transform: translateY(120%) scale(.96); opacity: 0; }
@media (prefers-reduced-motion: reduce) { .vivo-orden { transition: opacity .2s; } .vivo-orden.enter { transform: none; } }
body.has-tray .vivo-orden { bottom: 96px; }
@media (max-width: 767px) { .vivo-orden { right: 16px; left: 16px; width: auto; } body:has(.mk-bottom) .vivo-orden { bottom: calc(var(--mk-bottom-h, 56px) + env(safe-area-inset-bottom) + 10px); } }
.vivo-p { margin: 12px 0 0; } .vivo-p .ph { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; } .vivo-p h2 { margin: 0; font-size: var(--fs-row); }
.vivo-l { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; } .vivo-l li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: var(--fs-sec); padding: 4px 0; border-top: 1px solid var(--line); }
.vivo-l li .on { color: var(--accent-mark); font-weight: 650; }
/* ronda 4 · globos: el nombre largo baja de renglón (antes «…») */
.ac-tip { max-width: 320px; }
.ac-tip-label { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
/* FICHA-CARTEL-CAL (13/10, Abel: «Captura» en vertical en el globo del calendario): en la fila sin color la etiqueta toma su ancho y el valor
   largo se parte en renglones en lo que sobra (antes «1fr auto»: el valor se llevaba todo y la etiqueta quedaba de 1 letra), como en-vivo.css */
.ac-tip-row.no-key { grid-template-columns: minmax(0, max-content) minmax(min-content, 1fr); align-items: start; }
/* tabla: el minigráfico no reserva la columna de «apuesta máx.» (todos del mismo ancho y la misma escala) */
.grid .evo-box.has-ap { grid-template-columns: minmax(0, 1fr) !important; min-height: 0 !important; }
.grid .evo-box.has-ap .evo-plot { min-height: 0 !important; }
/* catálogo: la columna izquierda del minigráfico mide lo mismo en todas las tarjetas → todos los gráficos del mismo ancho */
@media (min-width: 768px) { .card:not(.is-open) .evo-box { grid-template-columns: 86px minmax(0, 1fr); } }
@media (max-width: 767px) { .card:not(.is-open) .evo-box { grid-template-columns: 86px minmax(0, 1fr); } }
/* celular: filas de «Ganancia por ruleta» con columnas fijas (todas las barras arrancan y terminan igual) */
.mb-row { grid-template-columns: minmax(0, 1fr) 96px 68px; }
/* celular: con la tarjeta abierta, la fila «estrategias · Capital · Filtros · Orden» no queda fija (más lugar para la tarjeta) */
@media (max-width: 767px) { body:has(.card.is-open) .toolbar { position: static; } }
/* ficha, «Ruleta por ruleta»: leyenda arriba de las tablas y el ○ de «pleno sin verificar» más grande */
.p-rlist .iconkey { margin: 2px 0 8px; }
.sticon.ps { font-size: 12px; line-height: 1; }
/* ficha en el celular: la barra de secciones se desliza con un fundido en los bordes y cada pestaña queda entera */
@media (max-width: 767px) {
  .ds-chips { scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); scroll-padding-inline: 24px; padding-inline: 24px; }
  .ds-chips a { scroll-snap-align: start; flex: none; }
}
/* Comparar: violeta, magenta e índigo (dv-color-atlas-premium-dark-6) y gris punteado; sin verde. Con dos, violeta y magenta se distinguen también con daltonismo */
:root { --cmp-1: #9d87f5; --cmp-2: #c3518d; --cmp-3: #4e75d2; }
:root[data-theme="light"] { --cmp-1: #5b3fb0; --cmp-2: #a8336f; --cmp-3: #3b5fc8; }
.sal-area.n { opacity: .10 !important; } /* abajo del cero, ámbar suave (igual que el minigráfico); la caída va encima */
.c-sl .chevk { color: var(--text-2); font-size: var(--fs-cap); }

/* ficha, variantes: barra divergente al lado de lo que ganó (misma escala en todas las filas; el cero al medio) */
.vtable td.vs .vp-bar { display: inline-block; width: min(160px, 18vw); height: 6px; margin-right: 10px; vertical-align: middle; }
@media (max-width: 767px) { .vtable td.vs .vp-bar { display: none; } }
.vtable td.vs .fig, .vtable td.vs > span:not(.vp-bar) { display: inline-block; min-width: 7.5ch; text-align: right; } .vtable td .of { font-size: var(--fs-cap); color: var(--text-2); font-weight: 400; }

/* «Cómo terminaron»: pista fina de punta a punta y rótulos en los bordes de la franja esperable */
.bullet2 .track { left: 0; right: 0; top: 4px; height: 2px; border-radius: 1px; background: var(--track); }
.bl-band { position: relative; height: 18px; margin-top: 2px; font-size: var(--fs-cap); color: var(--text-2); font-variant-numeric: tabular-nums; }
.bl-band span { position: absolute; top: 0; transform: translateX(-100%); white-space: nowrap; padding-right: 4px; }
.bl-band span.r { transform: none; padding: 0 0 0 4px; }
.bl-band span.mid { transform: translateX(-50%); top: 16px; }
.p-out .esperable { padding-bottom: 16px; }
/* «Cómo se lee»: al abrirse, el botón queda donde estaba (a la derecha) y el contenido baja a todo lo ancho (antes saltaba a la izquierda) */
.howread[open] { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.howread[open] > summary { margin-left: auto; justify-content: flex-end; }
.howread[open] > :not(summary) { flex: 0 0 100%; }
.lh2 .howread[open] > summary { justify-content: flex-end; }

/* panel «Ahora» compacto: tarjeta angosta y el paso de la progresión como barra (dataviz, ronda 4) */
.vivo-p { max-width: 680px; }
.vivo-l li { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1.2fr) auto auto; align-items: center; gap: 4px 14px; }
.vivo-paso { display: inline-flex; align-items: center; gap: 8px; }
.vivo-pasos { position: relative; display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; } .vivo-pasos i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-mark); border-radius: 3px; }
@media (max-width: 767px) { .vivo-l li { grid-template-columns: minmax(0, 1fr) auto; } }
/* ventana de variantes: columnas fijas (el cero de las barritas queda en el mismo lugar en todas las filas) y la fila crece con el nombre;
   debajo de 360 px el nombre va en su propio renglón (antes a 320 px en portugués se salía 11 px y cortaba «de 19») */
.varpop .vp-item { grid-template-columns: minmax(0, 1fr) 40px 76px 8.6em !important; height: auto !important; min-height: 32px; padding-top: 4px; padding-bottom: 4px; }
.varpop .vp-g { white-space: nowrap; overflow: visible; }
@media (max-width: 767px) { .varpop .vp-item { grid-template-columns: minmax(0, 1fr) 40px 70px 8.2em !important; } }
@media (max-width: 380px) {
  .varpop .vp-item { grid-template-columns: 40px minmax(0, 1fr) auto !important; grid-template-areas: "n n n" "b s g"; row-gap: 2px; }
  .varpop .vp-n { grid-area: n; } .varpop .vp-bar { grid-area: b; } .varpop .vp-s { grid-area: s; text-align: left; } .varpop .vp-g { grid-area: g; }
}
@media (max-width: 767px) { .varpop .vp-list { grid-template-rows: none !important; grid-auto-rows: auto !important; grid-auto-flow: row !important; } }
@media (max-width: 767px) { .varpop .vp-list { display: flex !important; flex-direction: column; gap: 2px; } .varpop .vp-item { flex: none; } }
.sticon.ps { font-size: 13px; }
@media (max-width: 1279px) { .vtable td.vs .vp-bar { display: none; } }

/* «Por ruleta» en la tarjeta: el renglón de mejor / peor hace wrap sin partir los grupos; debajo de 360 px, «^ pasa de 3.200» baja a su renglón */
.c-sl { flex-wrap: wrap; row-gap: 0; }
.c-sl > span { white-space: nowrap; }
@media (max-width: 360px) { .c-sl .chevk { order: 3; flex-basis: 100%; text-align: center; } }
.lab-go[hidden] { display: none !important; }
/* ronda 5 · tabla: «todavía no jugó» entero (baja de renglón); celular: el «?» de «Cómo se lee» más grande */
.grid td .nj-s { white-space: normal; display: inline-block; line-height: 1.2; }
@media (max-width: 767px) { .lh2 .howread > summary::before { width: 26px; height: 26px; font-size: 14px; } }
.vivo-l li { grid-template-columns: minmax(160px, 1.3fr) repeat(4, auto); } .vivo-l li > span { white-space: nowrap; } @media (max-width: 767px) { .vivo-l li > span { white-space: normal; } }
/* panel «Ahora»: filas que hacen wrap (nada se corta) y el nombre de la ruleta con ancho fijo */
.vivo-p { max-width: 900px; }
.vivo-l li { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.vivo-l li > b { flex: 0 0 200px; min-width: 0; }
@media (max-width: 767px) { .vivo-l li > b { flex-basis: 100%; } }
/* ventana de variantes: barrita divergente con más contraste (pista más clara, barra de 8 px) */
.vp-bar { height: 8px !important; background: var(--line-hover) !important; }

/* v3.5 · minigráfico con la gramática de la 6B (panel independiente, top 1-2): a todo el ancho, sin columna de rótulos */
.evo-box.evo-v2, .evo-box.evo-v2.has-ap, .card:not(.is-open) .evo-box.evo-v2 { grid-template-columns: minmax(0, 1fr) !important; }
.evo-box.evo-v2 .evo-plot { grid-column: 1; }
.evo-ddsh { fill: var(--dd); fill-opacity: .10; stroke: none; }
.evo-ddg { stroke: var(--dd); stroke-width: 1; stroke-dasharray: 2 3; opacity: .8; }
.evo-ddl { stroke: var(--dd); stroke-width: 2; }
.evo-pk, .evo-vl { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--dd); pointer-events: none; z-index: 1; }
.evo-ddlab { position: absolute; transform: translateY(-50%); padding: 1px 4px; border-radius: 4px; background: var(--card); font: 600 12px/1.2 var(--font); color: var(--dd); white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; z-index: 2; }
.evo-ddlab .cap { font-weight: 500; color: var(--text-2); }
.evo-ddlab.z { transform: none; }
.grid .evo-box.evo-v2 .evo-ddlab, .grid .evo-box.evo-v2 .evo-pk, .grid .evo-box.evo-v2 .evo-vl { display: none; }

.c-line { flex-wrap: wrap; row-gap: 0; } .c-line .c-ap { white-space: nowrap; } .c-line .c-ap .fig { color: var(--text); font-weight: 650; }
.card .c-line { height: auto; white-space: normal; overflow: visible; text-overflow: clip; } .card .c-line > span { white-space: nowrap; }

.evo-ddlab.up { transform: translateY(calc(-100% - 2px)); } .evo-ddlab.dn { transform: translateY(3px); }
/* fila de cifras de la tarjeta: hace wrap entre grupos (sin cortar «apuesta máx.») */
.card .c-line { display: flex !important; flex-wrap: wrap; align-items: baseline; height: auto !important; white-space: normal !important; overflow: visible !important; }
.card .c-line > span { white-space: nowrap; }
/* minigráfico con alto propio (antes lo apretaba la columna de rótulos) */
.card:not(.is-open) .c-chart .evo-box.evo-v2 { height: 64px; min-height: 64px; flex: none; }
@media (max-width: 767px) { .card:not(.is-open) .c-chart .evo-box.evo-v2 { height: 72px; min-height: 72px; } }

.evo-ddlab.md { transform: translateY(-50%); }
/* v3.5 · catálogo alineado (panel independiente, top 3): cada tarjeta ocupa 7 renglones de la grilla y los comparte con sus vecinas
   (subgrid): nombre, variante, qué hace, cifras, fila de cifras, gráfico y pie quedan a la misma altura en toda la fila */
@media (min-width: 768px) {
  .cards { row-gap: 0 !important; }
  .cards > .card { grid-row: span 7; margin-bottom: 12px; }
  .cards > .card:not(.is-open) { display: grid !important; grid-template-rows: subgrid; row-gap: 5px; height: auto !important; min-height: 0 !important; align-content: start; }
  .cards > .card:not(.is-open) > .c-chart { align-self: end; }
  .cards > .card:not(.is-open) > .c-foot { align-self: end; }
  .cards > .card:not(.is-open) > .c-stats, .cards > .card:not(.is-open) > .c-line { align-self: end; }
  .cards > .card:not(.is-open) > .nj-c { grid-row: span 3; }
}

/* «no te alcanza»: aviso neutro (contorno, ícono y tinta), no ámbar de pérdida; «Necesitó» siempre en tinta */
.nofit { background: transparent !important; border: 1px solid var(--border-strong); color: var(--text) !important; gap: 4px; padding: 0 7px 0 5px; }
.nofit::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border-radius: 50%; background: var(--text-2); color: var(--card); font: 800 10px/1 var(--font); }
.capv, .capv.loss, .kpi.kcap .v .capv.loss { color: var(--text) !important; }
.fig.over { text-decoration: underline dotted var(--text-2); text-underline-offset: 3px; }
@media (min-width: 768px) { .cards > .card:not(.is-open) > .c-stats, .cards > .card:not(.is-open) > .c-line { align-self: start; } }

/* v3.5 · selector de ruleta en la cabecera (buscador tipo símbolo de TradingView) */
.rsel { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; max-width: 100%; }
.rsel-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; padding: 0 8px; border: 1px solid var(--line-hover); border-radius: 8px; background: var(--card); color: var(--text); font: 600 var(--fs-sec)/1.2 var(--font); cursor: pointer; }
.rsel-btn:hover { border-color: var(--border-strong); }
.rsel-l { white-space: normal; text-align: left; }
.rsel-c { width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(45deg); flex: none; }
.rsel-step { width: 28px; min-height: 28px; border: 1px solid var(--line-hover); border-radius: 8px; background: var(--card); color: var(--text); font: 700 16px/1 var(--font); cursor: pointer; }
.rselpop { position: absolute; z-index: 47; display: flex; flex-direction: column; padding: 8px; background: var(--surface-2); border: 1px solid var(--line-hover); border-radius: 14px; box-shadow: var(--shadow-pop); }
.rselpop .rsel-q { margin: 0 0 6px; }
.rsel-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.rsel-list li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.rsel-list li .rn { font-size: var(--fs-sec); font-weight: 600; color: var(--text); }
.rsel-list li .rm { font-size: var(--fs-cap); color: var(--text-2); }
.rsel-list li.act, .rsel-list li:hover { background: var(--surface); }
.rsel-list li.on { box-shadow: inset 3px 0 0 var(--accent-mark); }
.rselpop.sheet { position: fixed !important; left: 0; right: 0; bottom: 0; top: auto; max-height: 75vh; border-radius: 16px 16px 0 0; z-index: 60; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
@media (max-width: 767px) { .rsel-btn, .rsel-step { min-height: 44px; } .rsel-step { width: 40px; } .rsel-btn { border-radius: 999px; padding: 0 12px; } .rsel-list li { min-height: 44px; } }
.dsub .rsel { margin-left: 10px; }

/* v3.5 · celular: tarjeta compacta 2C (nombre, variante, Ganó | Necesitó, minigráfico y pie); al tocarla se despliega la 6B en su lugar */
.denstoggle { display: none; }
@media (max-width: 767px) {
  .denstoggle { display: inline-flex; }
  .denstoggle button { min-height: 36px; padding: 0 10px; font-size: var(--fs-cap); font-weight: 600; }
  .cards.compact > .card:not(.is-open) { padding: 10px 12px 9px; gap: 3px; }
  .cards.compact > .card:not(.is-open) .c-does, .cards.compact > .card:not(.is-open) .c-line, .cards.compact > .card:not(.is-open) .c-ch-h { display: none !important; }
  .cards.compact > .card:not(.is-open) .c-name { min-height: 24px; -webkit-line-clamp: 2; }
  .cards.compact > .card:not(.is-open) .c-sub, .cards.compact > .card:not(.is-open) .c-var { min-height: 22px; height: auto; }
  .cards.compact > .card:not(.is-open) .c-stats .st .dt { font-size: var(--fs-cap); }
  .cards.compact > .card:not(.is-open) .c-stats .st .dd .fig { font-size: 22px; }
  .cards.compact > .card:not(.is-open) .c-chart { min-height: 0 !important; margin-top: 2px; }
  .cards.compact > .card:not(.is-open) .c-chart .evo-box.evo-v2 { height: 44px !important; min-height: 44px !important; }
  .cards.compact > .card:not(.is-open) .c-foot { font-size: var(--fs-cap); }
  .cards.compact { gap: 8px; }
}

/* ======================= v3.5 · panel top 15 + auditoría de comprensión (28/09) ======================= */
/* rótulo de la caída del minigráfico: 13 px como todo el sitio (UX n.º 4) */
.evo-ddlab { font-size: var(--fs-cap) !important; }
/* datos de la fila chica sin «·» colgando: separación con aire, sin puntos (UX n.º 12) */
.card .c-line { column-gap: 12px; }
.card .c-line > .sep { display: none; }
/* interlineado de 1,3 en lo que pasa a dos renglones (UX n.º 13) */
.mb-n, .rtable2 th, .grid thead th .l, .capfit, .capfit label, .rn span { line-height: 1.3; }

/* ⓘ: definición de una línea (UX n.º 5) */
.ii { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin: 0 0 0 4px; padding: 0; border: 1px solid var(--line-hover); border-radius: 50%; background: transparent; color: var(--text-2); font: italic 700 11px/1 Georgia, 'Times New Roman', serif; vertical-align: 1px; cursor: help; flex: none; position: relative; }
.ii::after { content: ''; position: absolute; inset: -8px; }
.ii:hover, .ii:focus-visible { color: var(--text); border-color: var(--border-strong); }
@media (max-width: 767px) { .ii::after { inset: -14px; } }

/* tira por ruleta: eje escrito a la izquierda y corte dibujado (panel n.º 9 y 12) */
.strip-w { display: flex; align-items: stretch; gap: 6px; flex: 1 1 auto; min-height: 44px; }
.strip-w .strip { flex: 1 1 auto; min-width: 0; height: auto !important; min-height: 44px; }
.strip-ax { display: flex; flex-direction: column; justify-content: space-between; flex: none; font-size: var(--fs-cap); line-height: 13px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.strip-ax i { font-style: normal; }
.strip .cut { fill: none; stroke: var(--card); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.strip .chev { display: none; }
.cutk { display: inline-block; width: 10px; height: 12px; margin-right: 3px; vertical-align: -1px; }
.cutk rect { fill: var(--gain-bar); } .cutk path { fill: none; stroke: var(--card); stroke-width: 1.6; }
.card:not(.is-open) .c-chart .c-strip { min-height: 64px; }

/* celdas por ruleta: ganó (cian), perdió sin quebrar (ámbar claro), quebró (ámbar) · ATLAS grafico-waffle (UX n.º 3) */
.waf { display: inline-grid; grid-template-columns: repeat(var(--wc), 6px); gap: 2px; vertical-align: middle; flex: none; }
.waf i { width: 6px; height: 6px; border-radius: 1px; }
.waf i.g { background: var(--gain-bar); }
.waf i.p { background: transparent; box-shadow: inset 0 0 0 1.5px var(--loss-bar); }
.waf i.q { background: var(--loss-bar); }
.waf.sm { grid-template-columns: repeat(var(--wc), 4px); gap: 1px; }
.waf.sm i { width: 4px; height: 4px; }
.waf.hx { margin-left: 10px; vertical-align: 2px; }
.card .c-foot { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 4px; }
.card .c-foot .waf.sm { margin-left: auto; }
.kpi .fig.qn { color: var(--text) !important; }

/* tarjeta: Comparar ⊞ al lado de la estrella (UX n.º 1) */
.card .c-acts { display: inline-flex; align-items: center; gap: 0; }
.card:not(.is-open) .c-acts { position: absolute; top: 6px; right: 6px; }
.card:not(.is-open) .c-acts .starbtn { position: static; margin: 0; }
.btn.cmpbtn.mini { width: 30px; height: 30px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.btn.cmpbtn.mini:hover { background: var(--surface); color: var(--text); }
.btn.cmpbtn.mini svg { width: 17px; height: 17px; }
.btn.cmpbtn.mini .bt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn.cmpbtn.mini[aria-pressed="true"] { color: var(--text); }
.card:not(.is-open) .c-head { padding-right: 60px; }
.grid td.star .t-acts { display: inline-flex; align-items: center; }
@media (min-width: 768px) { .card:not(.is-open) .c-acts .starbtn, .card:not(.is-open) .c-acts .cmpbtn.mini { height: 24px; width: 28px; } }
@media (max-width: 767px) { .btn.cmpbtn.mini { width: 44px; height: 44px; } .card:not(.is-open) .c-acts { top: 0; right: 0; } .card:not(.is-open) .c-head { padding-right: 84px; } }

/* 6B: conclusión de la curva y mejor/peor escritos (panel n.º 10 y 11) */
.x-concl { margin: 2px 0 0; font-size: var(--fs-cap); line-height: 16px; color: var(--text-2); }
.x-concl:empty { display: none; }
.xb-ends { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 12px; row-gap: 0; margin: 2px 0 0; font-size: var(--fs-cap); line-height: 17px; color: var(--text-2); }
.xb-ends:empty { display: none; }
.xb-ends b { font-weight: 650; color: var(--text); }
.xb-ends .ar { font-size: 9px; vertical-align: 1px; }
.xb-ends .ar.p { color: var(--gain); } .xb-ends .ar.n { color: var(--loss); }
.ac-label-strong.xb-v.p { fill: var(--gain); } .ac-label-strong.xb-v.n { fill: var(--loss); }
@media (min-width: 768px) {
  .card.is-open .x-curve { height: auto !important; min-height: 114px; }
  .card.is-open .x-bars { height: auto !important; min-height: 98px; }
}

/* «¿Te alcanza?»: puntos de lo que necesitó cada ruleta contra tu capital (UX n.º 7 y 15) */
.x-fit { min-width: 0; }
.fit-box { position: relative; min-height: 58px; }
.fit-box.big { min-height: 132px; }
.fit-d.ok { fill: var(--text-2); }
.fit-d.no { fill: var(--card); stroke: var(--text-2); stroke-width: 1.5; }
.fit-d.here { stroke: var(--accent-mark); stroke-width: 2.5; }
.fit-d.is-on { stroke: var(--text); stroke-width: 2; }
.fit-cap { stroke: var(--accent-mark); stroke-width: 2; }
.ac-tick.fit-capl { fill: var(--text); font-weight: 600; }
.fit-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0 0; font-size: var(--fs-cap); color: var(--text-2); }
.fit-key .fk { display: inline-block; width: 9px; height: 9px; margin-right: -6px; border-radius: 50%; }
.fit-key .fk.ok { background: var(--text-2); } .fit-key .fk.no { box-shadow: inset 0 0 0 1.5px var(--text-2); } .fit-key .fk.cap { width: 2px; height: 12px; border-radius: 1px; background: var(--accent-mark); }
.p-fit .ph h2 { display: inline-flex; align-items: center; }

/* 6B desde 1600 px: la curva a 2/3 del ancho y alta; «Por ruleta» y «Cómo juega» apilados a la derecha (panel n.º 6) */
@media (min-width: 1600px) {
  .card.is-open .x-grid3:not(.nj-grid) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) !important; grid-template-rows: auto auto; }
  .card.is-open .x-grid3 > .x-curve-p { grid-column: 1; grid-row: 1 / span 2; display: flex; flex-direction: column; }
  .card.is-open .x-grid3 > .x-curve-p .x-curve { flex: 1 1 auto; min-height: 210px; position: relative; }
  .card.is-open .x-grid3 > .x-curve-p .x-curve > svg { position: absolute; left: 0; top: 0; }
  .card.is-open .x-grid3 > .x-bars-p { grid-column: 2; grid-row: 1; }
  .card.is-open .x-grid3 > .x-how { grid-column: 2; grid-row: 2; }
  .card.is-open .x-bars { min-height: 150px; }
}

/* 6B en el celular: Ganó y Quebró, la evolución a lo ancho y 200 px, y después el resto (panel n.º 13 · UX n.º 2) */
@media (max-width: 767px) {
  .card.is-open .xk-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; margin-bottom: 8px; }
  .card.is-open .xk-hero .kpi.hero { grid-column: auto !important; }
  .card.is-open > .x-curve-p { margin: 0 0 8px; }
  .card.is-open > .x-curve-p .x-curve { height: auto !important; min-height: 200px; }
  .card.is-open .xk-rest { margin-bottom: 8px; }
}

/* 7B: curva + «bajo el agua» con el mismo eje, conclusión, «¿Te alcanza?» junto al puesto (UX n.º 7, 8 y 14) */
.d-concl { margin: 0 0 4px; }
.p-curve .d-curve { min-height: 210px !important; }
.d-under { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.d-under[hidden] { display: none; }
.d-under-h { margin: 0 0 2px; font-size: var(--fs-cap); color: var(--text-2); }
.d-under-c { height: 92px; }
.d-row.r4.two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 1023px) { .d-row.r4.two { grid-template-columns: minmax(0, 1fr); } }
.d-kpis > .p-curve { grid-column: 1 / -1; }
/* «Ruleta por ruleta»: barras divergentes, el cero al medio y una sola escala (panel n.º 8) */
.hb2.dv { overflow: visible; }
.hb2.dv::after { content: ''; position: absolute; left: calc(50% - .5px); top: -2px; bottom: -2px; width: 1px; background: var(--line-hover); }
.hb2.dv i.p { left: 50%; border-radius: 0 4px 4px 0; }
.hb2.dv i.n { left: auto; right: 50%; border-radius: 4px 0 0 4px; }

/* 7B en el celular: una sola fila de botones (‹ › ☆ ⊞ y la Mesa); el Laboratorio va abajo (UX n.º 2) */
@media (max-width: 767px) {
  .dhead .actions .lab-go { display: none !important; }
  .dhead .actions .pnav { order: 2; margin-left: 0 !important; width: auto !important; flex: none; }
  .dhead .actions .pnav .pos { display: none; }
  .dhead .actions [data-star], .dhead .actions [data-cmp] { order: 2; flex: none !important; width: 44px !important; padding: 0 !important; justify-content: center; }
  .dhead .actions [data-star] .bt, .dhead .actions [data-cmp] .bt { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap; }
  .dhead .actions .btn.primary { display: inline-flex !important; order: 2; flex: 1 1 0 !important; min-width: 0; justify-content: center; height: 44px; white-space: nowrap; }
  .dhead .actions .btn.primary svg { display: none; }
  .d-kpis > .p-curve .d-curve { min-height: 200px !important; }
  .d-kpis > .p-curve .d-under-c { height: 84px; }
}

/* celular: tarjeta compacta 2C en filas (nombre · variante; Ganó y Necesitó a la izquierda, la evolución a la derecha; pie) */
@media (max-width: 767px) {
  .cards.compact > .card:not(.is-open) { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 12px; row-gap: 3px; align-items: stretch; }
  .cards.compact > .card:not(.is-open) > .c-head, .cards.compact > .card:not(.is-open) > .c-sub, .cards.compact > .card:not(.is-open) > .c-foot, .cards.compact > .card:not(.is-open) > .nj-c { grid-column: 1 / -1; }
  .cards.compact > .card:not(.is-open) > .c-stats { grid-column: 1; display: flex !important; flex-direction: column; gap: 1px; margin: 0; }
  .cards.compact > .card:not(.is-open) > .c-chart { grid-column: 2; margin: 0 !important; display: flex; flex-direction: column; }
  .cards.compact > .card:not(.is-open) > .c-chart .evo-box.evo-v2 { flex: 1 1 auto; height: auto !important; min-height: 56px !important; }
  .cards.compact > .card:not(.is-open) .c-stats .st { border: 0 !important; padding: 0 !important; margin: 0 !important; }
  .cards.compact > .card:not(.is-open) .c-stats .st-cap { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; }
  .cards.compact > .card:not(.is-open) .c-stats .st-cap .dt { font-size: var(--fs-cap); }
  .cards.compact > .card:not(.is-open) .c-stats .st-cap .dd .fig { font-size: var(--fs-sec) !important; font-weight: 650; }
  .cards.compact > .card:not(.is-open) .c-foot .waf { display: none; }
}

/* 1280–1599: «Por ruleta» más ancha para escribir la mejor y la peor en un renglón cada una */
@media (min-width: 1280px) and (max-width: 1599px) { .card.is-open .x-grid3:not(.nj-grid) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.2fr) !important; } }
.x-fit .fit-box { min-height: 46px; }
.x-foot:not(:has(.x-fit)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

@media (min-width: 1280px) and (max-width: 1599px) { .card.is-open .x-grid3:not(.nj-grid) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr) !important; } }
@media (min-width: 768px) and (max-width: 1599px) { .card.is-open .x-curve { min-height: 134px; } .card.is-open .x-curve .x-skel { height: 126px; } .card.is-open .x-bars { min-height: 100px; } }
@media (min-width: 1600px) { .card.is-open .x-curve .x-skel { height: 200px; } }
.x-fit .fit-box { min-height: 30px; }
.fit-n::before { content: ''; display: inline-block; width: 2px; height: 12px; margin-right: 6px; border-radius: 1px; background: var(--accent-mark); vertical-align: -1px; }
@media (min-width: 1280px) and (max-width: 1599px) { .card.is-open .x-grid3:not(.nj-grid) { grid-template-columns: minmax(0, .95fr) minmax(0, .95fr) minmax(0, 1.45fr) !important; } }
@media (max-width: 767px) {
  .cards.compact > .card:not(.is-open) > .c-stats, .cards.compact > .card:not(.is-open) .c-stats .st { height: auto !important; min-height: 0 !important; max-height: none !important; }
  .cards.compact > .card:not(.is-open) .c-stats .st-saldo .dt { font-size: var(--fs-cap); }
}
@media (max-width: 767px) {
  .cards.compact > .card:not(.is-open) { padding: 8px 12px 8px !important; row-gap: 2px !important; }
  .cards.compact > .card:not(.is-open) > .c-foot { margin-top: 2px !important; padding-top: 0 !important; border-top: 0 !important; }
  .cards.compact > .card:not(.is-open) .c-stats .dt { line-height: 15px; }
  .cards.compact > .card:not(.is-open) .c-stats .st-saldo .dd { line-height: 1.1; }
}

.nw { white-space: nowrap; }

/* Comparar: 4.º color categórico de ATLAS (teal de dv-color-atlas-premium-dark-6; el gris se leía como «secundario»), valores escritos y celular con la cifra sola (panel n.º 14) */
:root { --cmp-4: #00866e; }
:root[data-theme="light"] { --cmp-4: #0b6e5b; }
.ac-tick.cmp-bv { font-variant-numeric: tabular-nums; fill: var(--text-2); }
@media (max-width: 767px) {
  .cmp-t:not(.cmp-how) tbody td small { display: none !important; }
  .cmp-t:not(.cmp-how) tbody td.show small { display: block !important; -webkit-line-clamp: unset !important; }
  .cmp-t:not(.cmp-how) tbody td:has(small) { cursor: pointer; }
}

.ii { border: 0 !important; font-size: 0; }
.ii svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.ii svg .dot { fill: currentColor; stroke: none; }
/* jerarquía (UX n.º 9): el rótulo del título de la lista a 16 (26 · 22 · 16 · 14 · 13) */
.tb-count .lbl, #toolbar .lbl { font-size: 16px; }

/* «Necesitó 8.289 fichas» y la insignia: si no entran en un renglón, la insignia baja (nunca se sale de la tarjeta) */
.card .st-cap .dd { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; row-gap: 2px; }
.card .st-cap .dd .nofit { margin-left: 0; }
.card:not(.is-open) .c-stats, .card:not(.is-open) .c-stats .st, .card:not(.is-open) .c-stats .st .dd { height: auto !important; max-height: none !important; min-height: 0; }

/* exportar: CSV y Excel en una fila, cada uno con su botón */
.expbtns { display: inline-flex; gap: 6px; }

/* puertas r8 */
.grid th.t-star { width: 66px !important; } .grid td.star .t-acts { gap: 2px; } .grid td.star .cmpbtn.mini { width: 28px; height: 28px; }
.xb-ends .ar { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; vertical-align: 2px; }
.xb-ends .ar.p { border-bottom: 6px solid var(--gain); } .xb-ends .ar.n { border-top: 6px solid var(--loss); }
/* el minigráfico ocupa su alto desde antes de dibujarse (sin salto) */
.card:not(.is-open) .c-chart .evo-box[data-cchart-box] { height: 64px; }
@media (max-width: 767px) { .cards:not(.compact) > .card:not(.is-open) .c-chart .evo-box[data-cchart-box] { height: 72px; } }
/* la conclusión reserva su renglón antes de que lleguen los datos */
.d-concl { min-height: 16px; }
.d-concl:empty { display: block; }
@media (min-width: 1600px) { .card.is-open .x-concl { min-height: 16px; } .card.is-open .x-concl:empty { display: block; } }
@media (max-width: 767px) { .card.is-open .x-concl, .d-concl { min-height: 32px; } .card.is-open .x-concl:empty { display: block; } }
/* celular: Capital y Filtros en un renglón; Orden y Compacta/Cómoda en el siguiente (Orden no queda aplastado) */
@media (max-width: 767px) {
  .toolbar .tools { flex-wrap: wrap; row-gap: 8px; }
  .toolbar .tools .capbtn, .toolbar .tools .filtersbtn { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .toolbar .tools .sortlab { flex: 1 1 0; min-width: 0; order: 5; }
  .toolbar .tools .denstoggle { order: 6; flex: none; }
  .rsel-step { width: 44px; }
}

.card .c-line { column-gap: 10px; }
.card .c-line .k[title] { text-decoration: underline dotted var(--line-hover); text-underline-offset: 3px; cursor: help; }
@media (max-width: 767px) { .cards.compact > .card:not(.is-open) > .c-chart .evo-box[data-cchart-box] { flex: 1 1 auto; height: auto !important; min-height: 56px !important; } }

/* v3.5 · tipografía en 4 tamaños (13 rótulo · 14 texto y dato · 16 título y cifra de mosaico · 22 cifra principal y título de página), nada menor a 13 (coordinador, 29/09; ATLAS §11.3 anatomía de dashboard · Linear/Stripe: 4 roles) */
#main .tb-count .fig.big { font-size: 22px !important; }
.card.is-open .x-head .c-name { font-size: 16px !important; }
.x-kpis .kpi.hero .v, .x-kpis .kpi.hero .v .fig { font-size: 22px !important; }
.dhead h1, .dhead h1 .vn, .dhead h1 .dot { font-size: 22px !important; }
.d-kpis .kpi.hero .v, .d-kpis .kpi.hero .v .fig, .d-kpis .kpi.hero2 .hp .v .fig { font-size: 22px !important; }
.d-kpis .kpi:not(.hero) .v, .d-kpis .kpi:not(.hero) .v .fig, .x-kpis .kpi:not(.hero) .v, .x-kpis .kpi:not(.hero) .v .fig { font-size: 16px !important; }
.mrow .mv .fig { font-size: 16px !important; }
.panel .ph h2, .panel .ph h2 .fig, .howread .antes h3, .howread .antes .ant-h2 { font-size: 16px !important; }
.d-does p { font-size: 14px !important; }
.cmp-t .cv .fig { font-size: 16px !important; }
.cmp-t .ch-n { font-size: 14px !important; }
/* ficha en el celular: Ganó y Quebró lado a lado (la curva sube a la primera pantalla) */
@media (max-width: 767px) {
  .d-kpis .kpi.hero2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; column-gap: 12px; }
  .d-kpis .kpi.hero2 .hp-c { padding-left: 12px !important; padding-top: 0 !important; margin-top: 0 !important; border-top: 0 !important; border-left: 1px solid var(--line) !important; }
}
/* riel: «Guardadas» arriba; CSV y Excel abajo, mitad y mitad */
.railtools { flex-wrap: wrap; }
.railtools .favtoggle { flex: 1 1 100%; }
.railtools .expbtns { display: flex; gap: 8px; flex: 1 1 100%; }
.railtools .expbtns .csvbtn { flex: 1 1 0; justify-content: center; }
/* compacta del celular: la columna de cifras más ancha (entra «8.289 fichas · no te alcanza» en un renglón) */
@media (max-width: 767px) {
  .cards.compact > .card:not(.is-open) { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr) !important; }
  .cards.compact > .card:not(.is-open) .st-cap .nofit { padding: 1px 6px; }
}

/* 6B · su mejor ruleta (chip de Estrategias, ATLAS 03_Componentes/uiverse/buttons.js) y ‹ k.ª de N › (segmentado, ATLAS 03_Componentes/uiverse/radio-buttons.js) */
.x-best { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.x-best:empty { display: none; }
.x-does .x-best { flex: none; margin-left: auto; }
.chip.bestchip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 1px solid var(--line-hover); border-radius: 999px; background: var(--card); color: var(--text-2); font: 500 var(--fs-cap)/1.25 var(--font); cursor: pointer; text-align: left; }
.chip.bestchip b { font-weight: 650; color: var(--text); }
.chip.bestchip b.gain { color: var(--gain); } .chip.bestchip b.loss { color: var(--loss); }
.chip.bestchip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.bestchip.on { cursor: default; border-color: var(--accent-mark); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-mark); }
.chip.bestchip .bc-ar { font-size: 16px; line-height: 1; color: var(--text-2); }
.bestnav { display: inline-flex; align-items: center; border: 1px solid var(--line-hover); border-radius: 999px; overflow: hidden; background: var(--card); }
.bestnav .bn-b { width: 30px; min-height: 28px; border: 0; background: transparent; color: var(--text); font: 700 16px/1 var(--font); cursor: pointer; }
.bestnav .bn-b:hover:not([disabled]) { background: var(--surface); }
.bestnav .bn-b[disabled] { color: var(--text-2); opacity: .45; cursor: default; }
.bestnav .bn-pos { padding: 0 6px; font-size: var(--fs-cap); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 767px) {
  .card.is-open > .x-best.m { display: flex; margin: 0 0 8px; }
  .chip.bestchip { min-height: 44px; white-space: normal; }
  .bestnav .bn-b { width: 44px; min-height: 44px; }
}

.x-does .x-best { order: 1; margin-left: 0 !important; }
.x-does .x-lost { order: 2; }
/* sin salto: el minigráfico reserva su alto (y no se encoge por flex) desde antes de dibujarse */
.card:not(.is-open) .c-chart .evo-box[data-cchart-box] { height: 64px; min-height: 64px; flex: none; }
@media (max-width: 767px) { .cards:not(.compact) > .card:not(.is-open) .c-chart .evo-box[data-cchart-box] { height: 72px; min-height: 72px; } .cards.compact > .card:not(.is-open) > .c-chart .evo-box[data-cchart-box] { flex: 1 1 auto; height: auto !important; min-height: 56px !important; } }
/* ficha: los botones van en su propio renglón (así el título no cambia de ancho cuando aparece «Abrir en el Laboratorio») */
@media (min-width: 768px) {
  .dhead { flex-wrap: wrap; }
  .dhead .dtitle { flex: 1 1 100%; min-width: 0; }
  .dhead .actions { flex: 1 1 100%; justify-content: flex-start; }
}
/* 6B entre 768 y 1599: el «por qué» queda en la ficha (en la tarjeta abierta no entra sin pasar 1366×630); la fila de «Su mejor ruleta» mide lo mismo que un renglón */
@media (min-width: 768px) and (max-width: 1599px) { .card.is-open .x-how .x-why { display: none; } }
@media (min-width: 768px) {
  .x-does .chip.bestchip { min-height: 22px; padding: 0 9px; }
  .x-does .bestnav .bn-b { min-height: 22px; width: 26px; font-size: 15px; }
  .x-does { row-gap: 2px; }
}
@media (min-width: 768px) {
  .x-does .chip.bestchip { height: auto !important; line-height: 18px; padding-top: 1px; padding-bottom: 1px; }
  .x-does .bestnav { height: 22px; }
}
@media (min-width: 768px) and (max-width: 1599px) {
  .card.is-open .x-how .xsteps li { grid-template-columns: 80px minmax(0, 1fr) !important; }
  .card.is-open .x-how .xsteps { gap: 2px !important; }
}
@media (min-width: 768px) and (max-width: 1599px) { .card.is-open .x-how .xsteps li { grid-template-columns: 94px minmax(0, 1fr) !important; } }
/* 6B desde 1600: «Cómo juega» y «¿Te alcanza?» reservan su alto mientras llegan los datos (sin salto al abrir) */
@media (min-width: 1600px) { .card.is-open .x-grid3 > .x-how { min-height: 200px; } .card.is-open .x-fit .fit-box { min-height: 44px; } }

/* críticos r6 · dataviz */
.evo-line.p { stroke: var(--gain) !important; } .evo-line.n { stroke: var(--loss) !important; }
.capline { stroke: var(--accent-mark) !important; stroke-dasharray: 5 3; }
.bar.over { fill: var(--bar-neutral); }
.bl-band span.l.edge { transform: none; left: 0 !important; padding: 0 4px 0 0; }
.bl-band span.r.edge { left: auto !important; right: 0; transform: none; padding: 0 0 0 4px; }
.bl-obsv { position: relative; height: 18px; margin-top: 2px; font-size: var(--fs-cap); font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.bl-obsv span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.bl-band span.one { transform: translateX(-50%); padding: 0; }
.bl-band span.one.edge-r { left: auto !important; right: 0; transform: none; }
.bl-band span.one.edge-l { left: 0 !important; transform: none; }
/* Home (320 px): el renglón de la variante crece si pasa a 2 renglones (no pisa la descripción) */
.card:not(.is-open) .c-sub { height: auto !important; min-height: 20px; }
/* celular: al abrir, la cifra y la curva primero; «Su mejor ruleta», los botones y la descripción después */
@media (max-width: 767px) {
  .cards > .card.is-open { display: flex !important; flex-direction: column; }
  .card.is-open > .x-head { order: 0; } .card.is-open > .xk-hero { order: 1; } .card.is-open > .x-curve-p { order: 2; } .card.is-open > .x-best { order: 3; }
  .card.is-open > .x-mact { order: 4; } .card.is-open > .x-does { order: 5; } .card.is-open > .xk-rest { order: 6; } .card.is-open > .x-grid3 { order: 7; }
  .card.is-open > .x-foot { order: 8; } .card.is-open > .x-full-m { order: 9; }
}
/* «Ruleta por ruleta»: subtítulo de cada grupo */
.rtable2 tr.rgrp th { padding: 10px 6px 4px; font-size: var(--fs-cap); font-weight: 700; color: var(--text); text-align: left; border-bottom: 1px solid var(--line); background: transparent; }
.rtable2 tbody tr.rgrp:first-child th { padding-top: 2px; }

/* celdas por ruleta: leyenda; línea de lo esperable; «¿Te alcanza?» completo desde 1600 */
.waf-l { display: inline-flex !important; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.waf-l i { display: inline-block; width: 8px; height: 8px; margin-right: -4px; border-radius: 1px; vertical-align: 0; }
.waf-l i.g { background: var(--gain-bar); } .waf-l i.p { box-shadow: inset 0 0 0 1.5px var(--loss-bar); } .waf-l i.q { background: var(--loss-bar); }
.refline { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; }
@media (min-width: 1600px) { .card.is-open .x-fit .fit-box { min-height: 78px !important; } }
@media (min-width: 768px) and (max-width: 1599px) { .card.is-open .waf-l { display: none !important; } }
.ac-label-strong.xb-v.m { fill: var(--text); }
.waf-l i { margin-right: 4px !important; }

/* críticos r6 · UX */
/* 1 · ficha en el celular con una ruleta: la fila de variantes y ruleta salta de renglón y el nombre se recorta con «…» (nunca desborda) */
@media (max-width: 767px) {
  .dhead .dsub { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .dhead .dsub .rsel { flex: 1 1 100%; min-width: 0; display: flex; }
  .dhead .dsub .rsel-btn { flex: 1 1 auto; min-width: 0; }
  .dhead .dsub .rsel-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .toolbar .rsel { max-width: 100%; min-width: 0; } .toolbar .rsel-btn { min-width: 0; } .toolbar .rsel-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .d-best { flex: 1 1 100%; }
}
/* 6 · blancos de 44 en el celular */
@media (max-width: 767px) {
  .card .c-var, .dhead .c-var { min-height: 44px; }
  .p-vars a, .p-vars .vchip, .dvar-list a { min-height: 44px; display: inline-flex; align-items: center; }
  .cmp-t .ch-x { width: 44px !important; height: 44px !important; }
  .cmp-t .cmp-hn th { min-height: 44px; }
}
@media (min-width: 768px) { .card:not(.is-open) select.chartsel { min-height: 24px; } }
/* 8 · Comparar en el celular: «mejor» con su relleno */
@media (max-width: 767px) { .cmp-t:not(.cmp-how) tbody td .best-t { display: block !important; width: max-content; border-collapse: separate; margin: 4px 0 0 !important; } }
/* 11 · hoja del selector de ruleta: título y Cerrar */
.rsel-sh { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; font-size: var(--fs-sec); }
.rsel-sh .rsel-x { min-height: 44px; }
/* dataviz: «no alcanza» neutro en La escalera; «tu capital» en lima en su leyenda */
.olegend i.o-over { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--bar-neutral); margin-right: 6px; vertical-align: -1px; }
.olegend i.lg-cap { display: inline-block; width: 14px; height: 0; border-top: 2px dashed var(--accent-mark); margin-right: 6px; vertical-align: 3px; }
.olegend i.lg-line { background: var(--text) !important; }
/* tabla: nombre a 14 (4 tamaños) */
.grid .namecell .fam { font-size: 14px; }
/* ficha: «Su mejor ruleta» debajo del título */
.dsub .x-best.d-best { margin-left: 8px; }
.dsub .x-best.d-best:empty { display: none; }
@media (max-width: 767px) { .cards > .card:not(.is-open) .c-sub .c-var, .cards.compact > .card:not(.is-open) .c-var { min-height: 44px !important; } }
.x-fit .x-sh .lab { white-space: nowrap; display: inline-flex; align-items: center; }
/* leyenda del waffle: aire entre cada cuadradito y su palabra anterior; renglón propio */
.waf-l { column-gap: 0 !important; }
.waf-l i { margin: 0 4px 0 10px !important; }
.waf-l i:first-child { margin-left: 0 !important; }

.x-fit .fit-box { min-height: 44px; }
@media (max-width: 767px) {
  .dhead .dsub .d-best { display: none !important; }
  .dhead .dsub .rsel, .dhead .dsub .x-best { margin-left: 0 !important; }
  .d-kpis > .x-best.d-best.m { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; }
}
@media (min-width: 768px) { .d-kpis > .x-best.d-best.m { display: none; } }
/* 6B entre 768 y 1599: «¿Te alcanza?» con su título a la izquierda (2 renglones) y el gráfico con su escala a la derecha: el pie no crece */
@media (min-width: 768px) and (max-width: 1599px) {
  .card.is-open .x-fit { display: grid; grid-template-columns: 132px minmax(0, 1fr); column-gap: 10px; align-items: start; }
  .card.is-open .x-fit .x-sh { flex-direction: column; align-items: flex-start; gap: 2px; }
  .card.is-open .x-fit .x-sh .fit-n { line-height: 17px; }
}
/* ficha en el celular con una ruleta: en la fila de la ruleta van el selector y ‹ k.ª de N › (de mejor a peor); el chip de la mejor, debajo del saldo */
@media (max-width: 767px) {
  .dhead .dsub .d-best { display: inline-flex !important; flex: none; order: 3; }
  .dhead .dsub .d-best .bestchip { display: none !important; }
  .dhead .dsub .d-best:not(:has(.bestnav)) { display: none !important; }
  .dhead .dsub .rsel { flex: 1 1 0 !important; order: 2; }
  .dhead .dsub .c-var { order: 1; }
  .dhead .dsub:has(.bestnav) .rsel-step { display: none; }
  .d-kpis > .d-best.m .bestnav { display: none; }
  .d-kpis > .d-best.m:not(:has(.bestchip)) { display: none; }
}
@media (max-width: 767px) {
  .dhead .dsub .d-best { order: 2 !important; }
  .dhead .dsub .rsel { order: 3 !important; flex: 1 1 100% !important; }
}
/* la cifra grande de la tarjeta no invade el rótulo de arriba (caja del mismo alto que su renglón) */
.card:not(.is-open) .c-stats .st .dd .fig { line-height: inherit; vertical-align: baseline; }
.card:not(.is-open) .c-stats .st .dd { line-height: 1.25; }
.card:not(.is-open) .c-stats .st .dd .fig { display: inline-block; line-height: 1.15; }
/* tabla (críticos r6, screener): «N variantes» a la derecha del nombre y el subtítulo a todo el ancho debajo (filas de 2 renglones) */
@media (min-width: 768px) {
  .grid td.name .namecell { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 1px; align-items: baseline; }
  .grid td.name .namecell > a { display: contents; }
  .grid td.name .namecell .fam { grid-column: 1; grid-row: 1; }
  .grid td.name .namecell .vn { grid-column: 1 / -1; grid-row: 2; }
  .grid td.name .namecell .varbtn { grid-column: 2; grid-row: 1; align-self: start; min-height: 22px; padding-top: 0; padding-bottom: 0; }
  /* «Gana el»: el % alineado; «de N» en su propia subcolumna */
  .grid td.t-gan { white-space: nowrap; }
  .grid td.t-gan .of { display: inline-block; min-width: 66px; text-align: left; }
}
/* campana del Radar en las guardadas (la pone /radar/alertas.js): el nombre deja lugar a los 3 botones */
.card:not(.is-open) .c-head:has(.al-bell) { padding-right: 92px; }
@media (max-width: 767px) { .card:not(.is-open) .c-head:has(.al-bell) { padding-right: 132px; } }

/* reducir movimiento: sin brillo en los esqueletos */
@media (prefers-reduced-motion: reduce) { .x-skel, .evo-box.is-loading::before { animation: none !important; } }
/* botones de la tarjeta a la misma altura en cualquier página */
.card .c-acts > * { margin: 0 !important; align-self: center; vertical-align: middle; }

.ann-q { fill: var(--loss) !important; font-weight: 650; }
/* La escalera: los pasos que ya piden más que tu capital, en contorno (distintos de los demás, sin el ámbar de pérdida) */
.bar.over { fill: transparent !important; stroke: var(--text-2); stroke-width: 1.25; }
.olegend i.o-over { background: transparent !important; box-shadow: inset 0 0 0 1.25px var(--text-2); }
/* ficha: con «Bajo el agua» abajo, la curva no repite la sombra de la caída */
#dcurve .dd-area { display: none; }
/* leyenda del waffle: cada ítem entero */
.waf-l .wl { white-space: nowrap; }
.waf-l .wl + .wl { margin-left: 10px; }
.d-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.d-col > .p-how { flex: 0 0 auto; }
.d-col > .p-fit { flex: 1 1 auto; }
@media (max-width: 767px) { .p-vars .vn a, .p-vars td a, .cmp-t a.ch-n { min-height: 44px; display: inline-flex; align-items: center; } }

/* tarjeta compartida · modo público (bloqueada) */
.card .c-lock { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.card .i-lock { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.card .c-chl { font-size: var(--fs-sec); font-weight: 600; color: var(--text); }
