/* Contra viento y marea · estilos
   Guía paso a paso: una idea por pantalla. En escritorio y tableta cada paso cabe entero en la ventana:
   app.js ajusta el tamaño del texto (--fs) y la altura de los gráficos a la altura disponible.
   Cada etapa tiñe la interfaz con su color (--stage), que cambia con una transición suave. */

@property --stage { syntax: '<color>'; inherits: true; initial-value: #2150C4; }

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F4F6F9;
  --surface-2: #EBEEF3;
  --ink: #14171C;
  --ink-2: #464D58;
  --ink-3: #6B7280;
  --rule: #DCE0E6;
  --rule-2: #ECEEF2;
  --water: #DDE7F3;
  --water-2: #C3D4E8;
  --c1: #2150C4;
  --c2: #E0530C;
  --c3: #00845A;
  --c4: #6A4FB3;
  --c5: #B02D7D;
  --muted-fill: #B9C1CC;
  --port: #C0283A;
  --port-wash: #FCEDEF;
  --stbd: #0B7A55;
  --stbd-wash: #E7F4EE;
  --warn-wash: #FFF4D6;
  --on-solid: #FFFFFF;
  --tip-bg: #14171C;
  --tip-ink: #FFFFFF;
  --tip-ink-2: #B7BDC6;
  --shadow-sm: 0 1px 2px rgba(20, 23, 28, 0.05);
  --shadow: 0 1px 2px rgba(20, 23, 28, 0.05), 0 12px 32px rgba(20, 23, 28, 0.08);
  --stage: #2150C4;
  --stage-ink: var(--stage);
  --stage-wash: color-mix(in oklab, var(--stage) 9%, var(--bg));
  --stage-wash-2: color-mix(in oklab, var(--stage) 16%, var(--bg));
  --lesson-bg: color-mix(in oklab, var(--stage) 5%, var(--bg));
  --panel-bg: var(--bg);
  --panel-line: color-mix(in oklab, var(--stage) 16%, var(--rule));
  --panel-shadow: 0 1px 2px rgba(20, 23, 28, 0.04), 0 22px 48px -22px color-mix(in oklab, var(--stage) 38%, transparent);
  --stage-deep: color-mix(in oklab, var(--stage) 78%, #000);
  --accent: var(--accent-base, var(--stage));
  --accent-ink: var(--accent-base, var(--stage-ink));
  --f-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --r: 16px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: clamp(1180px, 82vw, 1520px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  transition: --stage .7s ease;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101419;
    --surface: #171C23;
    --surface-2: #1E252E;
    --ink: #E8EBEF;
    --ink-2: #B4BCC7;
    --ink-3: #8993A0;
    --rule: #2A323D;
    --rule-2: #1F2630;
    --water: #1C2A3B;
    --water-2: #26405C;
    --c1: #5B8DEF;
    --c2: #E8651F;
    --c3: #1C9A6B;
    --c4: #8A72D8;
    --c5: #C9508F;
    --muted-fill: #4A5563;
    --port: #F0667A;
    --port-wash: #3A1D24;
    --stbd: #3DBB82;
    --stbd-wash: #16302A;
    --warn-wash: #3A3017;
    --on-solid: #101419;
    --tip-bg: #E8EBEF;
    --tip-ink: #101419;
    --tip-ink-2: #46505C;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 34px rgba(0, 0, 0, 0.4);
    --stage-ink: color-mix(in oklab, var(--stage) 55%, #FFFFFF);
    --stage-wash: color-mix(in oklab, var(--stage) 20%, var(--bg));
    --stage-wash-2: color-mix(in oklab, var(--stage) 30%, var(--bg));
    --lesson-bg: color-mix(in oklab, var(--stage) 9%, var(--bg));
    --panel-bg: color-mix(in oklab, var(--stage) 4%, #151A21);
    --panel-line: color-mix(in oklab, var(--stage) 26%, var(--rule));
    --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 50px -24px rgba(0, 0, 0, 0.7);
    --stage-deep: color-mix(in oklab, var(--stage) 70%, #000);
    --accent: color-mix(in oklab, var(--accent-base, var(--stage)) 72%, #FFFFFF);
    --accent-ink: var(--accent);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101419;
  --surface: #171C23;
  --surface-2: #1E252E;
  --ink: #E8EBEF;
  --ink-2: #B4BCC7;
  --ink-3: #8993A0;
  --rule: #2A323D;
  --rule-2: #1F2630;
  --water: #1C2A3B;
  --water-2: #26405C;
  --c1: #5B8DEF;
  --c2: #E8651F;
  --c3: #1C9A6B;
  --c4: #8A72D8;
  --c5: #C9508F;
  --muted-fill: #4A5563;
  --port: #F0667A;
  --port-wash: #3A1D24;
  --stbd: #3DBB82;
  --stbd-wash: #16302A;
  --warn-wash: #3A3017;
  --on-solid: #101419;
  --tip-bg: #E8EBEF;
  --tip-ink: #101419;
  --tip-ink-2: #46505C;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 34px rgba(0, 0, 0, 0.4);
  --stage-ink: color-mix(in oklab, var(--stage) 55%, #FFFFFF);
  --stage-wash: color-mix(in oklab, var(--stage) 20%, var(--bg));
  --stage-wash-2: color-mix(in oklab, var(--stage) 30%, var(--bg));
  --lesson-bg: color-mix(in oklab, var(--stage) 9%, var(--bg));
  --panel-bg: color-mix(in oklab, var(--stage) 4%, #151A21);
  --panel-line: color-mix(in oklab, var(--stage) 26%, var(--rule));
  --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 50px -24px rgba(0, 0, 0, 0.7);
  --stage-deep: color-mix(in oklab, var(--stage) 70%, #000);
  --accent: color-mix(in oklab, var(--accent-base, var(--stage)) 72%, #FFFFFF);
  --accent-ink: var(--accent);
}
@media (prefers-reduced-motion: reduce) { :root { transition: none; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--ink-3) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.1875rem/1.62 var(--f-body); -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; }
body.no-scroll { overflow: hidden; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
b, strong { font-weight: 700; }
a { color: var(--stage-ink); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--stage-ink); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--stage) 28%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.ico { width: 20px; height: 20px; flex: none; }
kbd { font: 700 0.82em var(--f-body); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--bg); color: var(--ink-2); }
.boot-lesson #v-home { display: none; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 2px solid transparent; border-radius: 12px; padding: 13px 22px; font-weight: 800; font-size: 1.05rem; line-height: 1.1; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, filter .15s, transform .15s; }
.btn svg { width: 20px; height: 20px; flex: none; transition: transform .2s var(--ease-out); }
.btn:active { transform: translateY(1px); }
.btn-main { background: var(--stage); color: #fff; }
.btn-main:hover { filter: brightness(1.1); }
.btn-main:hover svg, .btn-light:hover svg, .nextstage .btn:hover svg { transform: translateX(3px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink-3); background: var(--bg); }
.btn-ghost:hover svg { transform: translateX(-3px); }
.btn-ghost[disabled] { opacity: .35; cursor: default; }
.btn-light { background: #fff; color: var(--stage-deep); }
.btn-light:hover { background: #F2F5FA; }
.btn-small { padding: 9px 14px; font-size: .92em; border-radius: 10px; }
.btn-link { font: 700 0.95rem var(--f-body); color: var(--stage-ink); background: none; border: 0; padding: 2px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; }
.btn-link svg { width: 16px; height: 16px; }
.btn-link.danger { color: var(--port); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: inherit; display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: background-color .15s; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- cabecera de inicio ---------- */
.top { border-bottom: 1px solid var(--rule); padding-top: var(--safe-t); }
.top .wrap { height: 68px; display: flex; align-items: center; gap: 24px; }
.word { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.word svg { width: 28px; height: 28px; flex: none; color: var(--stage); }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top nav a, .top nav button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; border: 0; background: none; font-weight: 700; font-size: 1rem; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.top nav a:hover, .top nav button:hover { background: var(--surface); color: var(--ink); }
.top nav svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .top .lbl { display: none; } .word { font-size: 1.05rem; } .top .wrap { gap: 8px; } .top nav a, .top nav button { padding: 9px 10px; } }

/* ---------- inicio ---------- */
.intro { padding-block: clamp(36px, 6vw, 80px) 30px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.intro h1 { font-size: clamp(2.4rem, 4.8vw, 4.1rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.028em; }
.intro p { margin-top: 18px; font-size: clamp(1.1rem, 1.5vw, 1.28rem); color: var(--ink-2); max-width: 34em; }
@media (max-width: 900px) { .intro { grid-template-columns: minmax(0, 1fr); } }
.chart-map { position: relative; min-height: 200px; }
.chart-map svg { display: block; width: 100%; height: auto; overflow: visible; }
.map-sea { fill: color-mix(in oklab, var(--water) 55%, var(--bg)); }
.map-wave { fill: none; stroke: color-mix(in oklab, var(--water-2) 70%, var(--bg)); stroke-width: 1.4; stroke-linecap: round; }
.map-route { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }
.map-done { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.map-node { cursor: pointer; outline: none; }
.map-node circle.dot { stroke: var(--bg); stroke-width: 3; transition: transform .25s var(--ease-out); transform-box: fill-box; transform-origin: center; }
.map-node:hover circle.dot, .map-node:focus-visible circle.dot { transform: scale(1.14); }
.map-node:focus-visible circle.ring { stroke: var(--ink); stroke-width: 2.5; }
.map-node text { fill: #fff; font: 800 15px var(--f-body); pointer-events: none; }
.map-node.todo circle.dot { fill-opacity: .2; stroke: color-mix(in oklab, var(--c) 45%, var(--bg)); stroke-width: 2; }
.map-node.todo text { fill: var(--ink-2); }
.map-node .ring { fill: none; stroke: none; }
.map-node .base { fill: var(--bg); }
.map-node.cur .ring { stroke: var(--c); stroke-width: 2.5; }
@media (prefers-reduced-motion: no-preference) {
  .map-node.cur .ring { animation: ping 2.2s var(--ease-out) infinite; transform-box: fill-box; transform-origin: center; }
  .map-boat { animation: bob 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
}
@keyframes ping { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.75); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-3px) rotate(3deg); } }
.map-boat { color: var(--ink); }
.map-lab { fill: var(--ink-3); font: 600 12.5px var(--f-body); }
.map-lab.cur { fill: var(--ink); font-weight: 800; font-size: 14px; }
.map-lab.halo { paint-order: stroke; stroke: color-mix(in oklab, var(--water) 55%, var(--bg)); stroke-width: 5px; stroke-linejoin: round; }

.resume { background: var(--stage); color: #fff; border-radius: 22px; padding: clamp(22px, 3vw, 34px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: center; position: relative; overflow: hidden; isolation: isolate; }
.resume::after { content: ""; position: absolute; inset: auto -10% -55% 45%; height: 160%; background: radial-gradient(closest-side, rgba(255, 255, 255, .16), transparent); z-index: -1; pointer-events: none; }
.resume h2 { font-size: clamp(1.4rem, 2.4vw, 1.95rem); line-height: 1.12; font-weight: 800; letter-spacing: -0.01em; }
.resume p { margin-top: 6px; font-size: 1.08rem; color: rgba(255, 255, 255, 0.86); }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.28); margin-top: 16px; max-width: 460px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #fff; border-radius: 4px; transform-origin: left; animation: barIn 1s .2s var(--ease-out) both; }
@keyframes barIn { from { transform: scaleX(0); } }
.route { padding-block: 52px 8px; }
.route-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 14px; }
.route-sum { color: var(--ink-3); font-size: 1rem; font-variant-numeric: tabular-nums; }
.route-sum b { color: var(--ink); }
.home-h2 { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.01em; }
.tools .home-h2 { margin-bottom: 14px; }
.route ol { list-style: none; margin: 0; padding: 0; }
.route li { opacity: 1; }
.route li a { display: grid; grid-template-columns: 60px minmax(0, 1fr) 150px 190px; gap: 18px; align-items: center; padding: 15px 12px 15px 0; border-top: 1px solid var(--rule); text-decoration: none; color: var(--ink); border-radius: 4px; position: relative; transition: background-color .2s; }
.route li:last-child a { border-bottom: 1px solid var(--rule); }
.route li a:hover { background: color-mix(in oklab, var(--c) 6%, var(--bg)); }
.route li a::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 4px; border-radius: 2px; background: var(--c); transform: scaleY(0); transition: transform .25s var(--ease-out); }
.route li a:hover::before { transform: scaleY(1); }
.num { width: 46px; height: 46px; border-radius: 13px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; margin-left: 8px; transition: transform .25s var(--ease-out); }
.route li a:hover .num { transform: rotate(-6deg) scale(1.06); }
.num svg { width: 22px; height: 22px; }
.num.todo { background: color-mix(in oklab, var(--c) 14%, var(--bg)); color: var(--c); }
:root[data-theme="dark"] .num.todo { color: color-mix(in oklab, var(--c) 55%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .num.todo { color: color-mix(in oklab, var(--c) 55%, #fff); } }
.route .t { font-weight: 800; font-size: 1.2rem; line-height: 1.2; }
.route .t small { display: block; font-weight: 400; font-size: 1rem; color: var(--ink-2); margin-top: 3px; }
.route .info { display: contents; }
.route .meta { color: var(--ink-3); font-size: 0.98rem; }
.state { font-size: 0.98rem; font-weight: 700; color: var(--ink-3); }
.state.done { color: var(--stbd); display: inline-flex; gap: 6px; align-items: center; }
.state.done svg { width: 18px; height: 18px; }
.state.now { color: var(--ink); }
.state .mini { display: block; height: 6px; border-radius: 3px; background: var(--rule-2); margin-top: 6px; overflow: hidden; }
.state .mini i { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.tools { padding-block: 44px 40px; }
.tools ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.tools li a { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 15px 0; border-top: 1px solid var(--rule); text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.08rem; }
.tools li a div span { font-weight: 400; color: var(--ink-2); display: block; font-size: .98rem; }
.tmark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in oklab, var(--c) 13%, var(--bg)); color: var(--c); transition: background-color .2s, color .2s; }
.tmark svg { width: 20px; height: 20px; }
.tools li a:hover .tmark { background: var(--c); color: #fff; }
.tarrow { width: 20px; height: 20px; color: var(--ink-3); transition: transform .2s var(--ease-out), color .2s; }
.tools li a:hover .tarrow { color: var(--ink); transform: translateX(3px); }
@media (max-width: 760px) {
  .resume { grid-template-columns: 1fr; }
  .resume .btn { justify-self: start; }
  .route li a { grid-template-columns: 56px minmax(0, 1fr); row-gap: 6px; padding-block: 14px; }
  .route .info { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
  .route .state .mini { width: 120px; }
  .tools ul { grid-template-columns: 1fr; }
}
.site-foot { border-top: 1px solid var(--rule); margin-top: 48px; padding-block: 44px calc(56px + var(--safe-b)); font-size: 0.98rem; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.site-foot h3 { font-size: 1.05rem; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-foot p + p { margin-top: 10px; }
.disclaimer { margin-top: 28px; padding: 16px 18px; background: var(--surface); border-radius: 12px; font-size: 0.92rem; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr; } }
/* entrada de la portada */
@media (prefers-reduced-motion: no-preference) {
  .home-in .intro-txt > *, .home-in .resume, .home-in .route li, .home-in .tools li { animation: riseIn .7s var(--ease-out) both; }
  .home-in .intro-txt p { animation-delay: .06s; }
  .home-in .resume { animation-delay: .12s; }
  .home-in .route li { animation-delay: calc(.16s + var(--i, 0) * .04s); }
  .home-in .tools li { animation-delay: calc(.3s + var(--i, 0) * .03s); }
}
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- lección: armazón ---------- */
.lesson { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--lesson-bg); }
.lbar { background: var(--stage); color: #fff; position: sticky; top: 0; z-index: 20; padding-top: var(--safe-t); }
.lbar-in { height: 58px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; position: relative; }
.lbar .icon-btn { background: rgba(255, 255, 255, 0.14); color: #fff; }
.lbar .icon-btn:hover { background: rgba(255, 255, 255, 0.26); }
.lbar .icon-btn:focus-visible { outline-color: #fff; }
.lbar-mid { display: flex; align-items: center; gap: 24px; min-width: 0; }
.lbar h1 { font-size: 1.02rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; flex: 0 1 auto; max-width: 42%; }
.l-n { opacity: .78; font-weight: 700; }
.l-n::after { content: " · "; }
.l-t { font-weight: 800; }
.segs { flex: 1 1 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; max-width: 640px; min-width: 120px; }
.segs button { height: 22px; border: 0; padding: 8px 0; background: transparent; cursor: pointer; border-radius: 4px; position: relative; }
.segs button::before, .segs button::after { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 6px; border-radius: 3px; }
.segs button::before { background: rgba(255, 255, 255, 0.28); transition: background-color .3s; }
.segs button.seen::before { background: rgba(255, 255, 255, 0.55); }
.segs button::after { background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out); }
.segs button.on::after { transform: scaleX(1); }
.segs button:hover::before { background: rgba(255, 255, 255, 0.8); }
.segs button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.segs.complete button::after { animation: segFlash .9s var(--ease-out) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes segFlash { 0% { transform: scaleX(1); opacity: 1; } 35% { opacity: .35; } 100% { transform: scaleX(1); opacity: 1; } }
.seg-tip { position: absolute; top: calc(100% - 4px); z-index: 30; background: var(--tip-bg); color: var(--tip-ink); font-size: .9rem; font-weight: 700; line-height: 1.3; padding: 7px 11px; border-radius: 9px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); transform: translateX(-50%); }
.seg-tip small { display: block; font-weight: 600; color: var(--tip-ink-2); font-size: .8rem; }
.lbar-r { display: flex; align-items: center; gap: 10px; }
.count { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1rem; min-width: 3.2em; text-align: right; }
@media (max-width: 900px) {
  .lbar-in { height: auto; min-height: 64px; padding-block: 8px; gap: 12px; }
  .lbar-mid { flex-direction: column; align-items: stretch; gap: 2px; }
  .lbar h1 { max-width: none; font-size: .98rem; }
  .segs { max-width: none; }
}
@media (max-width: 560px) { .l-n { display: none; } .count { display: none; } }

.stage-area { position: relative; width: 100%; font-size: var(--fs, calc(17px * var(--size, 1))); outline: none; }
.stage-in { padding-block: clamp(22px, 4vw, 40px) 36px; }

/* pie de la lección */
.lfoot { border-top: 1px solid color-mix(in oklab, var(--stage) 12%, var(--rule)); background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); position: sticky; bottom: 0; z-index: 15; padding-bottom: var(--safe-b); }
.lfoot .wrap { min-height: 66px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.lfoot .btn { padding: 11px 20px; font-size: 1.02rem; }
.keys { color: var(--ink-3); font-size: 0.92rem; text-align: center; }
.lf-mid { display: grid; justify-items: center; min-width: 0; }
#l-next { min-width: 220px; max-width: 520px; }
#l-next .nt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; opacity: .85; }
#l-next .nt::before { content: "· "; }
@media (max-width: 860px) {
  .keys { display: none; }
  .lesson:not(.has-faces) .lf-mid { display: none; }
  .lesson:not(.has-faces) .lfoot .wrap { grid-template-columns: auto minmax(0, 1fr); }
  .lfoot .wrap { min-height: 64px; gap: 10px; }
  #l-next { min-width: 0; width: 100%; }
  #l-next .nt { display: none; }
}

/* indicador de «hay más abajo» (solo si un paso no cabe) */
.more-cue { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); z-index: 16; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: .88rem; padding: 7px 14px 7px 10px; border-radius: 99px; box-shadow: var(--shadow); cursor: pointer; border: 0; }
.more-cue svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: no-preference) { .more-cue:not([hidden]) { animation: cueIn .4s var(--ease-out) both, nudge 1.8s 1s ease-in-out infinite; } }
@keyframes cueIn { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 4px); } }

/* ---------- armazón a pantalla completa (escritorio, tableta y móvil en vertical) ---------- */
@media (min-height: 470px) {
  .lesson { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .lbar, .lfoot { position: relative; }
  .stage-area { overflow: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
  .stage-area.can-scroll { overflow-y: auto; }
  .stage-in { min-height: 100%; display: flex; flex-direction: column; padding-block: clamp(14px, 3.4vh, 44px); }
  .stage:not([hidden]) { flex: 1 0 auto; display: flex; flex-direction: column; }
  .step:not([hidden]) { flex: 1 0 auto; }
}

/* ---------- pasos ---------- */
.step { display: grid; grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.32fr); gap: 1.4em clamp(28px, 4.4vw, 76px); align-items: center; align-content: center; }
.step.wide { grid-template-columns: minmax(0, 1fr); row-gap: 1.1em; }
.step.solo { grid-template-columns: minmax(0, 44em); justify-content: center; }
.step.quizstep { grid-template-columns: minmax(0, 1fr); }
.step.quizstep > .txt { max-width: 62em; margin-inline: auto; width: 100%; }
.step.faqstep { grid-template-columns: minmax(0, 1fr); }
.step.faqstep > .txt { max-width: 66em; margin-inline: auto; width: 100%; }
.step.summary { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
.step.sc { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
@media (min-width: 1000px) {
  .step.wide > .txt { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); column-gap: clamp(28px, 4vw, 64px); align-items: start; }
  .step.wide > .txt > h2 { grid-column: 1; grid-row: 1 / span 8; }
  .step.wide > .txt > :not(h2) { grid-column: 2; }
  .step.wide > .txt > h2 + * { margin-top: .15em; }
}
.step.wide.as-side { grid-template-columns: minmax(0, 0.66fr) minmax(0, 1.5fr); }
.step.wide.as-side > .txt { display: block; }
.step.wide.as-side > .txt > h2 { font-size: 1.85em; }
.step.wide.as-side > .txt > h2 + * { margin-top: .9em; }
@media (max-width: 759px) {
  .step, .step.solo, .step.summary, .step.sc { grid-template-columns: minmax(0, 1fr); align-content: start; }
}
.step h2 { font-size: 2.05em; line-height: 1.07; font-weight: 800; letter-spacing: -0.022em; outline: none; }
.txt > p:not([class]), .txt > ul:not([class]), .txt > ol:not([class]) { margin-top: .8em; font-size: 1em; line-height: 1.58; color: var(--ink-2); max-width: 36em; }
.txt > h2 + p:not([class]) { margin-top: .9em; }
.txt > p strong, .txt li strong { color: var(--ink); }
.txt ul:not([class]), .txt ol:not([class]) { padding-left: 1.3em; }
.txt ul:not([class]) li + li, .txt ol:not([class]) li + li { margin-top: .45em; }
.txt blockquote, .side blockquote { margin: 0; padding: 1em 1.2em; background: var(--panel-bg); border-left: 4px solid var(--stage); border-radius: 4px 14px 14px 4px; font-size: 1.02em; line-height: 1.45; font-weight: 700; color: var(--ink); }
.txt blockquote cite, .side blockquote cite { display: block; margin-top: .4em; font-style: normal; font-weight: 400; font-size: .86em; color: var(--ink-3); }
.try { margin-top: 1.2em; display: flex; gap: .7em; align-items: flex-start; font-size: .92em; line-height: 1.5; color: var(--ink-2); }
.try svg { width: 1.3em; height: 1.3em; flex: none; color: var(--stage-ink); margin-top: .05em; }
.try b { color: var(--ink); }
.points { list-style: none; margin: 1.1em 0 0; padding: 0; display: grid; gap: .8em; counter-reset: pt; }
.points li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: .8em; align-items: start; font-size: 1em; line-height: 1.5; color: var(--ink-2); margin: 0; counter-increment: pt; }
.points li::before { content: counter(pt); width: 2em; height: 2em; border-radius: .6em; background: var(--stage); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .92em; }
.points li b { display: block; color: var(--ink); font-size: 1.05em; margin-bottom: .1em; }
.solo .points { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19em), 1fr)); gap: .9em 1.6em; }
.g { text-decoration: underline dotted color-mix(in oklab, var(--stage-ink) 70%, var(--ink-3)); text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: help; }
.g:hover, .g:focus-visible { text-decoration: underline solid var(--stage-ink); text-decoration-thickness: 2px; }

/* entrada de cada paso: los elementos llegan escalonados (app.js añade .enter y el índice --k) */
@media (prefers-reduced-motion: no-preference) {
  .step.enter [data-in] { animation: kIn .6s var(--ease-out) both; animation-delay: calc(var(--k) * 55ms); }
  .step.enter.back [data-in] { animation-name: kBack; }
  .step.enter > .panel[data-in], .step.enter > .side[data-in] { animation-name: pIn; animation-duration: .7s; }
}
@keyframes kIn { from { opacity: 0; transform: translate(26px, 0); } to { opacity: 1; transform: none; } }
@keyframes kBack { from { opacity: 0; transform: translate(-26px, 0); } to { opacity: 1; transform: none; } }
@keyframes pIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- panel de figura ---------- */
.panel { position: relative; margin: 0; background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: 22px; padding: 1.05em 1.3em 1.15em; box-shadow: var(--panel-shadow); container-type: inline-size; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.p-head { margin-bottom: .85em; }
.p-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.p-top h3 { font-size: 1.02em; font-weight: 800; line-height: 1.28; }
.p-sub { font-size: .86em; color: var(--ink-3); margin-top: .15em; line-height: 1.45; }
.p-hint { display: flex; gap: .55em; align-items: flex-start; margin-top: .5em; font-size: .88em; line-height: 1.45; color: var(--ink-2); }
.p-hint svg { width: 1.25em; height: 1.25em; flex: none; color: var(--stage-ink); margin-top: .05em; }
.p-hint b { color: var(--ink); }
.p-info-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--rule); background: var(--panel-bg); color: var(--ink-2); font-weight: 700; font-size: .76em; line-height: 1; padding: 6px 10px 6px 7px; border-radius: 99px; cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
.p-info-btn svg { width: 15px; height: 15px; }
.p-info-btn:hover, .p-info-btn[aria-expanded="true"] { border-color: var(--stage); color: var(--stage-ink); background: var(--stage-wash); }
.p-body { min-width: 0; }
.p-info { position: absolute; inset: 0; z-index: 6; background: var(--panel-bg); overflow-y: auto; overscroll-behavior: contain; }
.p-info-in { padding: 1.05em 1.3em 1.3em; }
.p-info-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: .6em; font-size: 1.02em; }
.p-info-top .icon-btn { width: 34px; height: 34px; background: var(--surface); }
.p-info .src { font-size: .9em; line-height: 1.55; color: var(--ink-2); }
.p-info-data { margin-top: .9em; }
@media (prefers-reduced-motion: no-preference) { .p-info:not([hidden]) { animation: sheetUp .32s var(--ease-out) both; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.src { font-size: 0.86em; line-height: 1.45; color: var(--ink-3); }
.src a { color: var(--ink-2); }
.table-host { margin-top: .6em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
table.data { border-collapse: collapse; width: 100%; font-size: 0.84em; font-variant-numeric: tabular-nums; }
table.data caption { text-align: left; padding: 10px 12px; color: var(--ink-2); font-size: 0.95em; }
table.data th, table.data td { padding: 6px 12px; border-bottom: 1px solid var(--rule-2); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { position: sticky; top: 0; background: var(--surface); color: var(--ink); font-weight: 700; }
table.data tbody th { font-weight: 700; }

/* ---------- controles ---------- */
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.6em), 1fr)); gap: .55em 1.5em; margin-bottom: .9em; align-items: end; }
@container (min-width: 500px) { .controls:not([style]) > .seg-wrap, .controls:not([style]) > .ctl.wide { grid-column: span 2; } }
.ctl { display: grid; gap: 0; min-width: 0; }
.ctl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0 .6em; }
.ctl-top > label { flex: 1 1 auto; min-width: 0; }
.ctl-top > output { flex: none; }
.ctl label, .ctl .lab { font-weight: 700; font-size: .88em; line-height: 1.25; color: var(--ink); }
.ctl output { font-weight: 800; font-size: .95em; color: var(--stage-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; --p: 50%; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--stage) 0 var(--p), var(--rule) var(--p) 100%); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--rule); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--stage); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--bg); border: 3px solid var(--stage); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform .15s var(--ease-out), box-shadow .15s; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--stage); }
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.1); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); box-shadow: 0 0 0 7px color-mix(in srgb, var(--stage) 18%, transparent); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px color-mix(in srgb, var(--stage) 25%, transparent); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 6px color-mix(in srgb, var(--stage) 25%, transparent); }
.seg-wrap { display: grid; gap: .3em; justify-items: start; min-width: 0; }
.seg-wrap .lab { font-weight: 700; font-size: .88em; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 12px; background: color-mix(in oklab, var(--stage) 7%, var(--surface-2)); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label, .seg button { font-weight: 700; font-size: .86em; line-height: 1; color: var(--ink-2); padding: .62em .8em; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s, box-shadow .2s; border: 0; background: transparent; }
.seg label:hover, .seg button:hover { color: var(--ink); background: var(--bg); }
.seg input:checked + label, .seg button[aria-pressed="true"] { background: var(--stage); color: #fff; box-shadow: 0 2px 6px -2px color-mix(in oklab, var(--stage) 70%, transparent); }
.seg input:focus-visible + label { outline: 3px solid var(--stage-ink); outline-offset: 1px; }
/* en el móvil, cada control ocupa todo el ancho de la tarjeta: nada de deslizadores y selectores a medias */
@media (max-width: 759px) {
  .controls:not([style*="repeat(2"]) { grid-template-columns: minmax(0, 1fr) !important; gap: .5em; }
  .controls:not([style*="repeat(2"]) > * { grid-column: auto !important; }
  /* con tres o más deslizadores van de dos en dos, para que la herramienta quepa sin desplazarse;
     los botones de opciones siguen ocupando toda la fila */
  .controls:not([style*="repeat(2"]):has(> .ctl ~ .ctl ~ .ctl) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .5em 1.1em; }
  .controls:has(> .ctl ~ .ctl ~ .ctl) > .seg-wrap, .controls:has(> .ctl ~ .ctl ~ .ctl) > .ctl:has(select) { grid-column: 1 / -1 !important; }
  .seg-wrap { justify-items: stretch; }
  .panel .seg:not(.seg-mini), .seg-wrap > .seg { display: flex; }
  .panel .seg:not(.seg-mini) > label, .panel .seg:not(.seg-mini) > button, .seg-wrap > .seg > label { flex: 1 1 auto; text-align: center; }
}
.chips { display: flex; flex-wrap: wrap; gap: .45em; }
.chip { font-weight: 700; font-size: .86em; line-height: 1.2; color: var(--ink); background: var(--bg); border: 2px solid var(--rule); border-radius: 11px; padding: .5em .75em; cursor: pointer; text-align: left; transition: border-color .15s, background-color .15s; }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--stage-wash); border-color: var(--stage); color: var(--ink); }
.check { display: flex; gap: .6em; align-items: flex-start; font-weight: 600; font-size: .92em; line-height: 1.35; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--stage); width: 1.15em; height: 1.15em; margin: 0; flex: none; }
select, input[type="number"], input[type="text"], textarea { font: 400 .92em/1.35 var(--f-body); color: var(--ink); background: var(--bg); border: 2px solid var(--rule); border-radius: 11px; padding: .5em .65em; width: 100%; }
textarea { resize: vertical; min-height: 3em; line-height: 1.45; }
select:focus, input[type="number"]:focus, input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--stage); }

/* frases de resultado */
.result, .verdict { font-size: .98em; line-height: 1.5; margin-top: .85em; color: var(--ink); }
.result b, .verdict b { font-weight: 800; font-variant-numeric: tabular-nums; }
.result.lg { font-size: 1.12em; line-height: 1.35; font-weight: 600; }
.figure { display: inline-block; font-size: 2.6em; line-height: 0.95; font-weight: 800; letter-spacing: -0.02em; margin-right: 0.12em; }
.note { font-size: .84em; color: var(--ink-3); line-height: 1.5; margin-top: .6em; }
.sublabel { font-weight: 800; font-size: .95em; line-height: 1.3; color: var(--ink); margin: 0 0 .5em; }
.is-good { color: var(--stbd); }
.is-bad { color: var(--port); }
.is-accent { color: var(--accent-ink); }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(16px, 2.6vw, 32px); align-items: start; }
@container (max-width: 540px) { .split { grid-template-columns: minmax(0, 1fr); } }
.split > div > .result:first-child, .split > div > .verdict:first-child { margin-top: 0; }
.sim-block { margin-top: 1.2em; }
.sim-block.first { margin-top: 0; }

/* leyenda */
.legend { display: flex; flex-wrap: wrap; gap: .3em 1.1em; font-size: .84em; color: var(--ink-2); margin: 0 0 .5em; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lk { width: 18px; height: 3px; border-radius: 2px; background: currentColor; display: inline-block; }
.lk-box { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lk-c1 { background: var(--c1); } .lk-c2 { background: var(--c2); } .lk-c3 { background: var(--c3); } .lk-c4 { background: var(--c4); } .lk-c5 { background: var(--c5); }
.lk-ink { background: var(--ink-2); } .lk-muted { background: var(--muted-fill); } .lk-port { background: var(--port); } .lk-stbd { background: var(--stbd); } .lk-accent { background: var(--accent); }

/* ---------- menú lateral de la lección ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(10, 13, 18, 0.42); }
.drawer-in { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--bg); overflow-y: auto; overscroll-behavior: contain; padding: calc(var(--safe-t) + 16px) 18px calc(var(--safe-b) + 24px); box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .35); }
@media (prefers-reduced-motion: no-preference) {
  .drawer:not([hidden]) .drawer-in { animation: drawerIn .38s var(--ease-out) both; }
  .drawer:not([hidden]) .drawer-scrim { animation: fadeIn .3s ease both; }
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } }
.drawer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 4px 4px 12px; }
.drawer-top b { display: block; font-size: 1.2rem; font-weight: 800; line-height: 1.2; }
.drawer-top span { display: block; color: var(--ink-3); font-size: .95rem; margin-top: 2px; }
.drawer-top .icon-btn { background: var(--surface); }
.d-h { font-size: .95rem; font-weight: 800; color: var(--ink-2); padding: 18px 8px 6px; margin: 0; border-top: 1px solid var(--rule); margin-top: 10px; }
.d-steps, .d-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.d-steps a, .d-stages a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 8px 10px; border-radius: 11px; color: var(--ink); text-decoration: none; font-size: 1rem; line-height: 1.3; }
.d-steps a:hover, .d-stages a:hover { background: var(--surface); }
.d-steps a i, .d-stages a i { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .85rem; color: var(--ink-2); }
.d-steps a i svg, .d-stages a i svg { width: 16px; height: 16px; }
.d-steps a.seen i { background: var(--stage-wash); color: var(--stage-ink); }
.d-steps a.on { background: var(--stage-wash); font-weight: 700; }
.d-steps a.on i { background: var(--stage); color: #fff; }
.d-stages a i { background: var(--c); color: #fff; }
.d-stages a.todo i { background: color-mix(in oklab, var(--c) 16%, var(--bg)); color: var(--ink-2); }
.d-stages a.on { background: color-mix(in oklab, var(--c) 10%, var(--bg)); font-weight: 700; }
.d-stages small { color: var(--ink-3); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-opts { display: grid; gap: 4px; padding-top: 4px; }
.d-opt { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 11px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 1rem; color: var(--ink); }
.d-opt > svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
button.d-opt:hover { background: var(--surface); }
.d-size { cursor: default; flex-wrap: wrap; }
.d-size > span { flex: 1; }
.seg-mini { font-size: 15px; }
.d-keys { color: var(--ink-3); font-size: .9rem; padding: 18px 8px 0; line-height: 1.7; }

/* ---------- telón de cada etapa ---------- */
.curtain { position: fixed; inset: 0; z-index: 90; background: var(--stage); color: #fff; display: grid; place-items: center; text-align: center; padding: 24px; cursor: pointer; }
.curtain-in { display: grid; justify-items: center; gap: 6px; }
.c-n { font-size: clamp(5.5rem, 17vmin, 12rem); line-height: .86; font-weight: 900; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.c-t { font-size: clamp(1.7rem, 4.6vmin, 3.2rem); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; max-width: 16em; text-wrap: balance; }
.c-m { font-size: clamp(1rem, 2vmin, 1.25rem); font-weight: 600; opacity: .82; margin-top: 4px; }

/* ---------- preguntas ---------- */
.quizset { margin-top: 1.2em; display: grid; gap: 1.1em; }
.quizset.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .quizset.two { grid-template-columns: minmax(0, 1fr); } }
.quiz { background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: 20px; padding: 1.1em 1.2em 1em; box-shadow: var(--panel-shadow); display: flex; flex-direction: column; }
.quiz .q { font-size: 1.05em; line-height: 1.42; font-weight: 700; color: var(--ink); }
.opts { margin-top: .8em; display: grid; gap: .5em; }
.opts button { text-align: left; background: var(--bg); width: 100%; border: 2px solid var(--rule); border-radius: 14px; padding: .65em .8em; font-size: .95em; line-height: 1.38; cursor: pointer; color: var(--ink); display: grid; grid-template-columns: 1.8em minmax(0, 1fr); gap: .7em; align-items: center; transition: border-color .15s, background-color .2s, transform .15s; }
.opts button:hover { border-color: var(--stage); background: color-mix(in oklab, var(--stage) 4%, var(--bg)); }
.opts button:active { transform: scale(.99); }
.opts button i { width: 1.8em; height: 1.8em; border-radius: .55em; background: var(--stage-wash); color: var(--stage-ink); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .95em; transition: background-color .2s, color .2s; }
.opts button i svg { width: 1.1em; height: 1.1em; }
.opts button.ok { border-color: var(--stbd); background: var(--stbd-wash); }
.opts button.ok i { background: var(--stbd); color: #fff; }
.opts button.ko { border-color: var(--port); background: var(--port-wash); }
.opts button.ko i { background: var(--port); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .opts button.ok.just i { animation: pop .5s var(--ease-out); }
  .opts button.ko.just { animation: shake .42s ease; }
}
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.fb { margin-top: .75em; font-size: .92em; line-height: 1.5; min-height: 3em; color: var(--ink-2); }
.fb b { color: var(--stbd); }
.fb b.ko { color: var(--port); }
@media (prefers-reduced-motion: no-preference) { .fb.just { animation: riseIn .45s var(--ease-out) both; } }
.burst { position: fixed; z-index: 85; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; }

/* ---------- resumen de etapa ---------- */
.takeaways { list-style: none; margin: 1.1em 0 0; padding: 0; display: grid; gap: .75em; }
.takeaways li { display: grid; grid-template-columns: 1.8em minmax(0, 1fr); gap: .7em; font-size: 1.02em; line-height: 1.48; color: var(--ink); }
.takeaways svg { width: 1.45em; height: 1.45em; color: var(--stbd); margin-top: .02em; }
@media (prefers-reduced-motion: no-preference) {
  .step.enter .takeaways svg { animation: pop .55s var(--ease-out) both; animation-delay: calc(.35s + var(--j, 0) * 110ms); }
}
.side { display: grid; gap: 1em; align-content: center; }
.aside { margin: 0; background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: 18px; padding: 1em 1.2em; font-size: 1em; line-height: 1.5; color: var(--ink); }
.txt > .aside { margin-top: 1.2em; }
.aside b { color: var(--stage-ink); }
.nextstage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1em 1.1em; border-radius: 22px; padding: 1.3em 1.4em; background: var(--next, var(--stage)); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.nextstage .ns-n { width: 2.3em; height: 2.3em; border-radius: .7em; background: rgba(255, 255, 255, .18); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 1.15em; }
.nextstage span { display: block; font-size: .9em; font-weight: 700; opacity: .85; }
.nextstage b { display: block; font-size: 1.45em; line-height: 1.12; font-weight: 800; letter-spacing: -0.01em; margin-top: .15em; }
.nextstage small { display: block; font-size: .88em; opacity: .85; margin-top: .35em; }
.nextstage .btn { background: #fff; color: var(--next, var(--stage)); }
.nextstage .btn:hover { background: #F2F5FA; }
.nextstage.last { background: var(--surface); color: var(--ink); }
@media (max-width: 560px) { .nextstage { grid-template-columns: auto minmax(0, 1fr); } .nextstage .btn { grid-column: 1 / -1; justify-self: start; } }
.finale { background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: 22px; padding: 1.1em 1.3em; box-shadow: var(--panel-shadow); }
.finale h3 { font-size: 1.05em; font-weight: 800; }
.finale ol { list-style: none; margin: .7em 0 0; padding: 0; display: grid; gap: .45em; }
.finale li { display: grid; grid-template-columns: 2em minmax(0, 1fr); gap: .7em; align-items: start; font-size: .93em; line-height: 1.4; }
.finale li i { width: 1.75em; height: 1.75em; border-radius: .5em; background: var(--c); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .9em; }
.finale li a { color: var(--ink); text-decoration: none; }
.finale li a:hover { text-decoration: underline; }
.closing { margin-top: 1.2em; background: var(--stage); color: #fff; border-radius: 20px; padding: 1.1em 1.3em; font-size: 1.12em; line-height: 1.32; font-weight: 800; letter-spacing: -0.01em; }

/* ---------- dudas frecuentes: pregunta a la izquierda, respuesta a la derecha ---------- */
.faqx { margin-top: 1.3em; display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.2fr); column-gap: 1.6em; row-gap: .45em; align-items: start; }
.fq { grid-column: 1; display: grid; grid-template-columns: 2em minmax(0, 1fr); gap: .75em; align-items: center; text-align: left; width: 100%; border: 2px solid transparent; background: transparent; border-radius: 14px; padding: .65em .8em; font-weight: 700; font-size: .98em; line-height: 1.35; color: var(--ink-2); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.fq i { width: 2em; height: 2em; border-radius: .6em; background: var(--surface-2); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .9em; color: var(--ink-2); transition: background-color .2s, color .2s; }
.fq:hover { background: var(--panel-bg); color: var(--ink); }
.fq[aria-expanded="true"] { background: var(--panel-bg); border-color: var(--panel-line); color: var(--ink); box-shadow: var(--panel-shadow); }
.fq[aria-expanded="true"] i { background: var(--stage); color: #fff; }
.fa { grid-column: 2; grid-row: 1 / span 12; background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: 22px; padding: 1.2em 1.4em; box-shadow: var(--panel-shadow); font-size: 1em; line-height: 1.58; color: var(--ink-2); }
.fa > div > * + * { margin-top: .8em; }
@media (prefers-reduced-motion: no-preference) { .fa.just { animation: kIn .45s var(--ease-out) both; } }
@media (max-width: 759px) {
  .faqx { grid-template-columns: minmax(0, 1fr); }
  .fq, .fa { grid-column: 1; grid-row: auto; }
  .fa { margin-bottom: .6em; }
}

/* ---------- confeti del final ---------- */
.confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }

/* ---------- gráficos SVG ---------- */
.chart-host { position: relative; width: 100%; min-height: 120px; }
.chart-host > svg.chart { margin-inline: auto; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--f-body); }
svg.chart text { fill: var(--ink-3); font-size: clamp(11.5px, .74em, 14px); font-variant-numeric: tabular-nums; }
svg.chart .grid { stroke: var(--rule-2); stroke-width: 1; shape-rendering: crispEdges; }
svg.chart .baseline { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
svg.chart .tick { stroke: var(--rule); }
svg.chart .zero { stroke: var(--ink-3); stroke-width: 1; }
svg.chart .lbl { fill: var(--ink-2); font-size: clamp(12px, .77em, 14.5px); font-weight: 600; }
svg.chart .lbl-strong { fill: var(--ink); font-size: clamp(12.5px, .82em, 15.5px); font-weight: 800; }
svg.chart .lbl-serif { fill: var(--ink-2); font-size: 13.5px; font-weight: 700; }
svg.chart .lbl-accent { fill: var(--accent-ink); font-weight: 800; }
svg.chart .lbl-port { fill: var(--port); font-weight: 800; }
svg.chart .lbl-stbd { fill: var(--stbd); font-weight: 800; }
svg.chart text.on-dark { fill: var(--on-solid); }
svg.chart text.on-light { fill: var(--ink); }
svg.chart .halo { paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.ln { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.ln-thin { fill: none; stroke-width: 1.3; stroke-linejoin: round; }
.s-c1 { stroke: var(--c1); } .s-c2 { stroke: var(--c2); } .s-c3 { stroke: var(--c3); } .s-c4 { stroke: var(--c4); } .s-c5 { stroke: var(--c5); }
.s-ink { stroke: var(--ink-2); } .s-muted { stroke: var(--muted-fill); } .s-port { stroke: var(--port); } .s-stbd { stroke: var(--stbd); } .s-accent { stroke: var(--accent); }
.f-c1 { fill: var(--c1); } .f-c2 { fill: var(--c2); } .f-c3 { fill: var(--c3); } .f-c4 { fill: var(--c4); } .f-c5 { fill: var(--c5); }
.f-ink { fill: var(--ink-2); } .f-muted { fill: var(--muted-fill); } .f-port { fill: var(--port); } .f-stbd { fill: var(--stbd); } .f-accent { fill: var(--accent); }
.f-paper { fill: var(--bg); } .f-shoal { fill: var(--surface-2); } .f-shoal2 { fill: var(--rule-2); } .f-land { fill: var(--surface-2); }
.wash-c1 { fill: var(--c1); fill-opacity: 0.1; } .wash-c2 { fill: var(--c2); fill-opacity: 0.12; } .wash-c3 { fill: var(--c3); fill-opacity: 0.11; } .wash-c4 { fill: var(--c4); fill-opacity: 0.1; }
.wash-port { fill: var(--port); fill-opacity: 0.1; } .wash-stbd { fill: var(--stbd); fill-opacity: 0.12; } .wash-muted { fill: var(--muted-fill); fill-opacity: 0.3; }
.gap { stroke: var(--bg); stroke-width: 2; }
.ring { stroke: var(--bg); stroke-width: 2; }
.hit { fill: transparent; cursor: crosshair; outline: none; }
.xhair-line { stroke: var(--ink-2); stroke-width: 1; }
.xhair.is-touch .xhair-line { stroke-width: 1.5; }
.tip.is-touch { font-size: 0.95rem; box-shadow: 0 6px 22px rgba(0,0,0,.22); }
.xhair-dot { stroke: var(--bg); stroke-width: 2; }
.xhair-dot.k-c1 { fill: var(--c1); } .xhair-dot.k-c2 { fill: var(--c2); } .xhair-dot.k-c3 { fill: var(--c3); } .xhair-dot.k-c4 { fill: var(--c4); } .xhair-dot.k-ink { fill: var(--ink-2); } .xhair-dot.k-port { fill: var(--port); } .xhair-dot.k-stbd { fill: var(--stbd); } .xhair-dot.k-muted { fill: var(--muted-fill); } .xhair-dot.k-accent { fill: var(--accent); }
.mark { transition: opacity .2s; cursor: pointer; outline: none; }
.mark.is-hover, .mark:focus-visible { opacity: 0.75; }
.mark:focus-visible { stroke: var(--ink); stroke-width: 1.5; }
.storm { fill: var(--ink); fill-opacity: 0.06; }
.hatch-port { fill: url(#hatch-port); }


/* tooltip y glosario */
.tip { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; background: var(--tip-bg); color: var(--tip-ink); padding: 10px 13px; border-radius: 10px; font-size: 0.92rem; line-height: 1.35; min-width: 150px; max-width: 290px; box-shadow: var(--shadow); }
.tip-head { font-weight: 700; color: var(--tip-ink-2); margin-bottom: 5px; font-size: 0.86rem; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row + .tip-row { margin-top: 3px; }
.tip-row strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.tip-lab { color: var(--tip-ink-2); }
.tip-key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.tip-key.k-c1 { background: var(--c1); } .tip-key.k-c2 { background: var(--c2); } .tip-key.k-c3 { background: var(--c3); } .tip-key.k-c4 { background: var(--c4); } .tip-key.k-c5 { background: var(--c5); }
.tip-key.k-ink { background: var(--tip-ink-2); } .tip-key.k-port { background: var(--port); } .tip-key.k-stbd { background: var(--stbd); } .tip-key.k-muted { background: var(--muted-fill); } .tip-key.k-accent { background: var(--accent); }
.tip-row.is-good strong { color: var(--stbd); } .tip-row.is-bad strong { color: var(--port); }
.gpop { position: fixed; left: 0; top: 0; z-index: 70; background: var(--tip-bg); color: var(--tip-ink); padding: 14px 16px; border-radius: 12px; font-size: 0.95rem; line-height: 1.45; pointer-events: none; box-shadow: var(--shadow); }
.gpop strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.gpop p { color: var(--tip-ink-2); }
.glossary-panel { position: fixed; inset: 0; z-index: 65; background: rgba(10, 13, 18, 0.5); display: flex; justify-content: flex-end; }
.glossary-in { width: min(540px, 100%); height: 100%; overflow-y: auto; background: var(--bg); padding: calc(var(--safe-t) + 22px) 26px 40px; }
.glossary-in header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.glossary-in h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.glossary-in .icon-btn { background: var(--surface); }
#glosario { margin: 12px 0 0; }
#glosario dt { font-weight: 800; font-size: 1.12rem; margin-top: 16px; scroll-margin-top: 20px; }
#glosario dd { margin: 4px 0 0; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }


/* ilustración de la etapa 1 */
.ill { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ill figure { margin: 0; background: var(--panel-bg); border: 1px solid var(--panel-line); box-shadow: var(--panel-shadow); border-radius: 22px; padding: 1.2em; }
.ill svg { width: 100%; height: auto; max-height: 150px; display: block; }
.ill figcaption { margin-top: 12px; font-size: 1.05em; line-height: 1.45; color: var(--ink-2); }
.ill figcaption b { display: block; color: var(--ink); font-size: 1.25em; font-weight: 800; margin-bottom: 2px; }
.ill .i-a { fill: color-mix(in srgb, var(--stage) 18%, var(--bg)); }
.ill .i-b { fill: var(--stage); }
.ill .i-w { fill: var(--bg); }
/* 1/1, acciones y bonos: la fábrica se enciende y reparte tu parte de los beneficios (y algún susto);
   el pagaré se escribe, se sella y va soltando intereses. El estado final es el de reposo: sin movimiento se ve igual de claro. */
.ill svg * { transform-box: fill-box; }
.ill .i-t { font: 800 10.5px var(--f-body); fill: #fff; letter-spacing: .01em; }
.ill .i-c { fill: #F2B705; stroke: #B98500; stroke-width: 1.5; }
.ill .i-ce { font: 800 11px var(--f-body); fill: #5A4300; }
.ill .i-down { stroke: var(--port); opacity: 0; }
.ill .i-up { opacity: 0; }
.step:not([hidden]) .ill .i-win { animation: ill-lamp .5s ease both; animation-delay: calc(.55s + var(--d) * .14s); }
.step:not([hidden]) .ill .i-part { animation: ill-part .6s var(--ease-out) both .35s; transform-origin: 50% 100%; }
.step:not([hidden]) .ill .i-t { animation: ill-fade .4s ease both 1.2s; }
.step:not([hidden]) .ill .i-up { animation: ill-coin 2.2s ease-out 2 1.6s; transform-origin: center; }
.step:not([hidden]) .ill .i-body { animation: ill-rise .7s var(--ease-out) both, ill-dip 1.3s ease 6.2s; transform-origin: 50% 100%; }
.step:not([hidden]) .ill .i-down { animation: ill-drop 1.3s ease 6.2s; }
.step:not([hidden]) .ill .i-paper { animation: ill-rise .7s var(--ease-out) both; transform-origin: 50% 100%; }
.step:not([hidden]) .ill .i-line { animation: ill-write .55s var(--ease-out) both; animation-delay: calc(.45s + var(--d) * .22s); transform-origin: 0 50%; }
.step:not([hidden]) .ill .i-seal { animation: ill-stamp .5s cubic-bezier(.3, 1.6, .5, 1) both 1.25s; transform-origin: center; }
.step:not([hidden]) .ill .i-cup { animation: ill-pay .8s var(--ease-out) both; animation-delay: calc(1.9s + var(--d) * .7s); }
@keyframes ill-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ill-part { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: none; } }
@keyframes ill-lamp { 0% { fill: var(--i-off, color-mix(in srgb, var(--stage) 30%, var(--bg))); } 60% { fill: #FFE39A; } 100% { fill: var(--bg); } }
@keyframes ill-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ill-coin { 0% { opacity: 0; transform: translateY(12px) scale(.4); } 18% { opacity: 1; transform: translateY(0) scale(1); } 70% { opacity: 1; transform: translateY(-20px); } 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes ill-dip { 0%, 100% { transform: none; } 30% { transform: translateY(4px) rotate(-1deg); } 60% { transform: translateY(1px); } }
@keyframes ill-drop { 0% { opacity: 0; transform: translateY(-8px); } 30%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(4px); } }
@keyframes ill-write { from { transform: scaleX(0); } to { transform: none; } }
@keyframes ill-stamp { from { opacity: 0; transform: scale(1.8) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes ill-pay { 0% { opacity: 0; transform: translate(-50px, var(--dy)) scale(.3); } 45% { opacity: 1; transform: translate(-22px, calc(var(--dy) - 16px)) scale(1); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ill svg * { animation: none !important; } }
@media (max-width: 560px) { .ill { grid-template-columns: 1fr; } }


/* ---------- módulos específicos ---------- */
.coins { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 5px; max-width: 520px; }
.coin { aspect-ratio: 1; border-radius: 50%; background: var(--stage); transition: background-color .35s, box-shadow .35s, transform .35s; }
.coin.lost { background: transparent; box-shadow: inset 0 0 0 2px var(--muted-fill); transform: scale(0.8); }
@media (max-width: 480px) { .coins { gap: 3px; } }

.hull { width: 100%; max-width: 420px; height: auto; display: block; }
.hull .water { fill: var(--water); }
.hull .hull-body { fill: var(--ink); }
.hull .barnacle { fill: #E9DDB8; stroke: #6B5A2E; stroke-width: 0.8; transition: opacity .3s, transform .3s; transform-box: fill-box; transform-origin: center; }
.hull .barnacle.off { opacity: 0; transform: scale(0.2); }
.knots { font-family: var(--f-body); }

.fleet { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px 8px; max-width: 460px; }
.fleet svg { width: 100%; height: auto; aspect-ratio: 30 / 28; display: block; overflow: visible; }
@media (max-width: 759px) { .fleet { grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 6px 3px; max-width: none; align-content: center; } }
.fleet .boat { transition: transform .5s cubic-bezier(.3, .7, .3, 1), opacity .5s; transform-box: fill-box; transform-origin: center bottom; }
.fleet .boat .sail { fill: var(--stbd); transition: fill .4s; }
.fleet .boat .hl { fill: var(--ink); }
.fleet .boat.behind { opacity: 0.9; transform: translateY(4px) rotate(-11deg); }
.fleet .boat.behind .sail { fill: var(--port); }

.bunting-wrap { overflow-x: auto; overscroll-behavior-x: contain; margin: 0 -4px 14px; padding: 0 4px; }
.bunting { width: 100%; height: auto; display: block; overflow: visible; }
.bunting .line { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.bunting .flag { cursor: pointer; outline: none; }
.bunting .flag > g { transform-box: fill-box; transform-origin: top left; transition: transform .25s; }
.bunting .flag:hover .fl { filter: brightness(1.08); }
.bunting .flag:focus-visible .flag-outline, .bunting .flag.is-sel .flag-outline { stroke: var(--stage-ink); stroke-width: 3; }
.bunting .flag.is-done text { fill: var(--stbd); }
@media (prefers-reduced-motion: no-preference) { .bunting .flag > g { animation: flutter 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.33s); } }
@keyframes flutter { 0%, 100% { transform: rotate(-2.2deg) skewY(0deg); } 50% { transform: rotate(2.2deg) skewY(-1.6deg); } }
.flag-outline { stroke: rgba(20, 23, 28, 0.35); stroke-width: 0.7; fill: none; }
.flag-score { font-weight: 700; font-size: 1.08em; margin: 0 0 12px; }
.flag-score strong { color: var(--stage-ink); }
.principles { list-style: none; margin: 0; padding: 0; }
.principle { display: none; grid-template-columns: 90px minmax(0, 1fr); column-gap: 22px; row-gap: 8px; align-items: start; background: var(--surface); border-radius: 18px; padding: 22px; }
.principle.is-sel { display: grid; animation: stepIn .35s cubic-bezier(.16, 1, .3, 1) both; }
.principle .pf { grid-column: 1; grid-row: 1 / span 4; display: grid; gap: 6px; justify-items: start; align-content: start; }
.principle .pf svg { width: 84px; height: auto; display: block; }
.principle .code { font-weight: 700; font-size: 0.95em; color: var(--ink-3); }
.principle h4 { grid-column: 2; font-size: 1.5em; line-height: 1.15; font-weight: 800; }
.principle p { grid-column: 2; font-size: 1.1em; line-height: 1.55; color: var(--ink-2); }
.principle q { grid-column: 2; font-weight: 700; font-size: 1.1em; line-height: 1.4; color: var(--ink); quotes: "«" "»"; }
.principle q::after { content: close-quote "  · John C. Bogle"; font-weight: 400; font-size: 0.95em; color: var(--ink-3); }
.principle .check { grid-column: 2; margin-top: 6px; }
.principle.is-done h4 { color: var(--stbd); }
.pr-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.pr-nav .btn { white-space: nowrap; }
.pr-nav #pr-next.is-last { background: var(--stage); border-color: var(--stage); color: #fff; }
.pr-nav #pr-next.is-last:hover { filter: brightness(1.08); }
.pr-nav .w-sm { display: none; }
@media (max-width: 400px) { .pr-nav .w-lg { display: none; } .pr-nav .w-sm { display: inline; } }
@media (max-width: 560px) { .principle { grid-template-columns: 1fr; } .principle .pf { grid-row: auto; grid-template-columns: 70px auto; align-items: center; } .principle .pf svg { width: 64px; } .principle h4, .principle p, .principle q, .principle .check { grid-column: 1; } }

.boat-stage { position: relative; background: linear-gradient(to bottom, var(--surface) 0 58%, var(--water) 58% 100%); border-radius: 16px; overflow: hidden; }
.boat-stage svg { display: block; width: 100%; height: auto; }
.boat-stage .sea { fill: var(--water-2); }
.boat-stage .sea2 { fill: var(--water); }
.boat-stage .hullc { fill: var(--ink); }
.boat-stage .keel { fill: var(--c1); }
.boat-stage .sailc { fill: var(--c2); fill-opacity: 0.92; }
.boat-stage .jib { fill: var(--c2); fill-opacity: 0.55; }
.boat-stage .mast { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.boat-stage .rig { stroke: var(--ink-3); stroke-width: 1; }
.boat-stage .wl { stroke: var(--ink-3); stroke-width: 1; fill: none; }
.boat-legend { position: absolute; left: 10px; top: 10px; display: grid; gap: 2px; font-size: .82em; font-weight: 600; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 82%, transparent); padding: 5px 9px; border-radius: 9px; }
.boat-legend span { display: flex; align-items: center; gap: 7px; }

.tm-cell { stroke: var(--bg); stroke-width: 2; cursor: pointer; }
.tm-des { fill: var(--c1); } .tm-eme { fill: var(--c3); } .tm-resto { fill: var(--muted-fill); } .tm-fuera { fill: var(--port); }
svg.chart .tm-lab { fill: var(--on-solid); font-size: 12.5px; font-weight: 800; pointer-events: none; }
svg.chart .tm-val { fill: var(--on-solid); font-size: 11.5px; font-weight: 600; opacity: 0.92; pointer-events: none; }
svg.chart .tm-lab.dark, svg.chart .tm-val.dark { fill: var(--ink); }

.alloc { display: flex; height: 62px; gap: 3px; border-radius: 12px; overflow: hidden; }
.alloc > div { display: flex; flex-direction: column; justify-content: center; padding: 0 10px; color: var(--on-solid); font-size: 0.95em; line-height: 1.15; min-width: 0; overflow: hidden; white-space: nowrap; transition: flex-basis .45s cubic-bezier(.3, .7, .3, 1); }
.alloc > div b { font-size: 1.25em; font-weight: 800; }
.alloc .a-world { background: var(--c2); } .alloc .a-em { background: var(--c3); } .alloc .a-sc { background: var(--c4); } .alloc .a-rf { background: var(--c1); }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; font-size: 1em; color: var(--ink-2); }
.alloc-legend span { display: inline-flex; align-items: center; gap: 8px; }
.alloc-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

.seesaw { width: 100%; height: auto; display: block; overflow: visible; margin-inline: auto; }
.seesaw .plank { fill: var(--ink); }
.seesaw .pivot { fill: var(--ink-3); }
.seesaw .ground { stroke: var(--rule); stroke-width: 1; }

.buoys { display: flex; gap: 8px; align-items: flex-end; }
.buoys svg { width: 28px; height: 36px; }
.buoys .b-on { fill: var(--stbd); } .buoys .b-off { fill: var(--rule); }
.risk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35em; font-size: .88em; line-height: 1.4; }
.risk-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; color: var(--ink-2); }
.risk-list li b { color: var(--ink); }
.risk-list .ic { width: 14px; height: 14px; margin-top: 5px; font-size: 0; color: transparent; border-radius: 3px; }
.risk-list .ic.ok { background: var(--stbd); }
.risk-list .ic.warn { background: #D98A00; transform: rotate(45deg) scale(0.82); }
.risk-list .ic.bad { background: var(--port); border-radius: 50%; }
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13em), 1fr)); gap: .7em 1.2em; align-items: start; }

.ladder { display: grid; gap: .3em; }
.rung { display: grid; grid-template-columns: minmax(0, 2.1fr) repeat(3, minmax(0, 1fr)); gap: 1em; align-items: center; padding: .36em .8em; border: 2px solid var(--rule-2); border-radius: 12px; transition: background-color .25s, border-color .25s, opacity .25s; font-size: .92em; line-height: 1.3; color: var(--ink-2); }
.rung .rd { display: block; font-size: .92em; color: var(--ink-3); }
.rung-h { border: 0; padding-block: 0 .1em; font-size: .78em; font-weight: 700; color: var(--ink-3); }
.rung b { font-weight: 800; font-size: 1.04em; color: var(--ink); }
.rung.is-fit { background: var(--stbd-wash); border-color: var(--stbd); }
.rung.is-dim { opacity: 0.45; }
.rung .meter { height: 6px; border-radius: 3px; background: var(--rule-2); position: relative; overflow: hidden; }
.rung .meter i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--ink-2); }
.rung .ml { display: none; }
@container (max-width: 560px) { .rung { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .8fr)); gap: .6em; } .rung .rd { display: none; } .rung-h { font-size: .7em; } }

.vmatrix { overflow-x: auto; }
.vmatrix table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: .84em; }
.vmatrix th, .vmatrix td { padding: .42em .6em; border-bottom: 1px solid var(--rule-2); text-align: left; vertical-align: top; line-height: 1.26; }
.vmatrix thead th { font-weight: 800; font-size: 1.04em; color: var(--ink); border-bottom: 2px solid var(--rule); transition: background-color .3s; vertical-align: bottom; }
.vmatrix tbody th { color: var(--ink); font-weight: 700; width: 25%; padding: .25em .3em; }
.rowpick { display: grid; grid-template-columns: 1.15em minmax(0, 1fr); gap: .55em; align-items: center; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink-2); padding: .3em .45em; border-radius: 8px; cursor: pointer; }
.rowpick:hover { background: var(--stage-wash); color: var(--ink); }
.rowpick .box { width: 1.15em; height: 1.15em; border-radius: .3em; border: 2px solid var(--ink-3); display: grid; place-items: center; transition: background-color .15s, border-color .15s; }
.rowpick[aria-pressed="true"] { color: var(--ink); }
.rowpick[aria-pressed="true"] .box { background: var(--stage); border-color: var(--stage); }
.rowpick[aria-pressed="true"] .box::after { content: ""; width: .32em; height: .58em; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-.06em) rotate(45deg); }
.vmatrix tr:not(.is-picked) td { color: var(--ink-3); }
.vmatrix td { color: var(--ink-2); transition: background-color .3s; }
.vmatrix .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.vmatrix .d3 { background: var(--stbd); } .vmatrix .d2 { background: #D98A00; } .vmatrix .d1 { background: var(--port); } .vmatrix .d0 { background: var(--rule); }
.vmatrix .col-best { background: var(--stbd-wash); }
.vmatrix .score { display: block; font-weight: 700; font-size: 0.85em; color: var(--ink-3); margin-top: 4px; }
.vmatrix .col-best .score { color: var(--stbd); }

.hold { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: end; }
@container (max-width: 640px) { .hold { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column-reverse; gap: 4px; }
.lot { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 11px 14px; font-weight: 600; font-size: 1em; color: var(--ink); background: var(--water); border-radius: 10px; position: relative; overflow: hidden; }
.lot .sold { position: absolute; inset: 0 auto 0 0; background: var(--stage); opacity: 0.3; transition: width .4s cubic-bezier(.3, .7, .3, 1); width: 0; }
.lot > span { position: relative; }
.lot small { color: var(--ink-2); font-weight: 400; }

.channel { display: grid; gap: 14px; }
.lane { display: grid; grid-template-columns: 150px minmax(0, 1fr) 120px; gap: 14px; align-items: center; }
.lane-name { font-weight: 800; font-size: 1.05em; line-height: 1.15; color: var(--ink); }
.lane-name small { display: block; font-weight: 400; font-size: 0.88em; color: var(--ink-3); }
.lane-track { position: relative; height: 36px; background: var(--surface-2); border-radius: 8px; }
.lane-band { position: absolute; top: 0; bottom: 0; background: var(--water); border-left: 3px solid var(--port); border-right: 3px solid var(--stbd); transition: left .35s, width .35s; }
.lane-target { position: absolute; top: 4px; bottom: 4px; width: 2px; background: var(--ink-3); transition: left .35s; }
.lane-ship { position: absolute; top: 50%; width: 26px; height: 22px; margin: -12px 0 0 -13px; transition: left .35s cubic-bezier(.3, .7, .3, 1); color: var(--ink); }
.lane-ship svg { width: 26px; height: 22px; display: block; }
.lane.out .lane-ship { color: var(--port); }
.lane-status { font-weight: 800; font-size: 1em; text-align: right; font-variant-numeric: tabular-nums; }
.lane.out .lane-status { color: var(--port); }
.lane.in .lane-status { color: var(--stbd); }
@container (max-width: 600px) { .lane { grid-template-columns: 1fr auto; } .lane-track { grid-column: 1 / -1; grid-row: 2; } }
.moves { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.moves li { padding: 11px 14px; background: var(--warn-wash); border-radius: 10px; font-weight: 600; }
.moves li.ok { background: var(--stbd-wash); }

.regret { display: grid; grid-template-columns: auto repeat(2, minmax(0, 1fr)); gap: 4px; font-size: 0.98em; }
.regret > div { padding: 12px 14px; background: var(--surface); border-radius: 10px; line-height: 1.4; }
.regret .rh { background: transparent; font-weight: 700; color: var(--ink-2); display: flex; align-items: flex-end; }
.regret .rc b { display: block; font-weight: 800; font-size: 1.1em; color: var(--ink); margin-bottom: 3px; }
.regret .good { background: var(--stbd-wash); } .regret .bad { background: var(--port-wash); }
@container (max-width: 520px) { .regret { grid-template-columns: 1fr 1fr; } .regret .corner { display: none; } .regret .rowh { grid-column: 1 / -1; } }

.lifeboat { width: 100%; max-width: 400px; height: auto; display: block; margin-inline: auto; }
.lifeboat .lb-fill { fill: var(--stage); transition: y .5s, height .5s; }
.lifeboat .lb-rim { fill: none; stroke: var(--ink); stroke-width: 2.5; }

.scale-svg { width: 100%; max-width: 440px; height: auto; display: block; margin-inline: auto; overflow: visible; }
.scale-svg .beam { transition: transform .6s cubic-bezier(.3, .7, .3, 1); transform-origin: 220px 60px; }
.scale-svg .pan-l, .scale-svg .pan-r { transition: transform .6s cubic-bezier(.3, .7, .3, 1); }

.toast { font-weight: 700; color: var(--stbd); margin-top: 8px; min-height: 1.3em; }

.years-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; }
.years-strip span { height: 26px; background: var(--stbd); cursor: pointer; position: relative; }
.years-strip span:first-child { border-radius: 6px 0 0 6px; } .years-strip span:last-child { border-radius: 0 6px 6px 0; }
.years-strip span.fail { background: var(--port); }
.years-strip span.warn { background: #D98A00; }
.years-strip span:hover, .years-strip span:focus-visible { outline: 3px solid var(--ink); outline-offset: 0; z-index: 1; }
.strip-axis { display: flex; justify-content: space-between; font-size: 0.88em; color: var(--ink-3); margin-top: 4px; }
.heat { display: grid; gap: 3px; font-size: 0.85em; }
.heat .hc { padding: 8px 2px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; border-radius: 5px; }
.heat .hh { color: var(--ink-3); text-align: center; padding: 6px 2px; font-weight: 700; }
.heat .hc.is-cur { outline: 3px solid var(--ink); outline-offset: -3px; }

/* ---------- tu carta de navegación: seis frases y la hoja al lado ---------- */
.ips.ct { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(18px, 2.6vw, 34px); align-items: stretch; }
.ct-main { display: flex; flex-direction: column; gap: .75em; min-width: 0; }
.ct-buoys { position: relative; display: flex; justify-content: space-between; gap: 4px; padding-bottom: 2px; }
.ct-buoys::before { content: ""; position: absolute; left: 16px; right: 16px; top: 15px; border-top: 2px dashed color-mix(in oklab, var(--stage) 40%, var(--rule)); }
.ct-buoy { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: .3em; padding: 0; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: .78em; font-weight: 700; line-height: 1.15; cursor: pointer; text-align: center; }
.ct-dot { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-bg); box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--stage) 45%, var(--rule)); color: var(--stage-ink); transition: background .2s, box-shadow .2s, transform .2s var(--ease-out); }
.ct-dot svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ct-dot .ct-ok { position: absolute; right: -5px; top: -4px; width: 15px; height: 15px; padding: 2px; border-radius: 50%; background: var(--stbd); color: #fff; stroke-width: 3.4; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s var(--ease-out); }
.ct-buoy.done .ct-ok { opacity: 1; transform: none; }
.ct-buoy[aria-selected="true"] { color: var(--ink); }
.ct-buoy[aria-selected="true"] .ct-dot { background: var(--stage); color: #fff; box-shadow: 0 0 0 5px var(--stage-wash-2); transform: scale(1.06); }
.ct-buoy:hover .ct-dot { box-shadow: inset 0 0 0 2px var(--stage); }
.ct-buoy[aria-selected="true"]:hover .ct-dot { box-shadow: 0 0 0 5px var(--stage-wash-2); }
.ct-buoy:focus-visible { outline: none; } .ct-buoy:focus-visible .ct-dot { outline: 3px solid var(--ink); outline-offset: 3px; }
.ct-buoy[data-page] { display: none; }
.ct-prog { display: flex; align-items: center; flex-wrap: wrap; gap: .35em .7em; font-size: .85em; font-weight: 700; color: var(--ink-2); margin: 0; }
.ct-segs { display: inline-flex; gap: 3px; } .ct-segs i { width: 18px; height: 5px; border-radius: 3px; background: var(--rule); transition: background .3s; } .ct-segs i.on { background: var(--stbd); }
.ct-prog .btn-link { font-size: 1em; }
.ct-prog #ips-pull, .ct-prog #ips-pull[hidden] + #ips-reset { margin-left: auto; }
.ct-form { position: relative; flex: 0 0 auto; display: grid; align-content: start; }
.ct-part { grid-area: 1 / 1; display: grid; gap: .55em; align-content: start; }
.ct-part.off { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) { .ct-part.just { animation: riseIn .4s var(--ease-out) both; } }
.ct-say { font-size: 1.16em; line-height: 2.1; font-weight: 500; letter-spacing: -.012em; color: var(--ink); margin: 0; text-wrap: pretty; }
.ct-say b { font-weight: 800; }
.ct-say .is-bad { color: var(--port); }
.ct-f { position: relative; display: inline-block; white-space: nowrap; max-width: 100%; }
.ct .ct-in { font: inherit; font-weight: 800; color: var(--stage-ink); background: var(--stage-wash); border: 0; border-radius: 9px; box-shadow: inset 0 -2px 0 color-mix(in oklab, var(--stage) 55%, transparent); padding: .05em .38em; line-height: 1.35; width: auto; min-width: 2.2ch; max-width: 100%; field-sizing: content; height: auto; letter-spacing: -.01em; transition: background .15s, box-shadow .15s; }
.ct .ct-in:hover { background: var(--stage-wash-2); }
.ct .ct-in:focus { outline: none; background: var(--panel-bg); box-shadow: inset 0 0 0 2px var(--stage); }
.ct .ct-in.num { text-align: center; font-variant-numeric: tabular-nums; }
.ct select.ct-in { -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 1.25em; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - .62em) 55%, calc(100% - .38em) 55%; background-size: .24em .24em; background-repeat: no-repeat; }
.ct select.ct-in option { color: var(--ink); background: var(--bg); font-weight: 600; }
.ct-f.from .ct-in, .ct-funds.from textarea { box-shadow: inset 0 -2px 0 var(--stbd); }
.ct-src { position: absolute; left: .45em; top: 100%; margin-top: -.35em; font-size: .52em; line-height: 1; font-weight: 700; color: var(--stbd); white-space: nowrap; letter-spacing: 0; pointer-events: none; }
.ct-funds { position: relative; display: block; }
.ct-funds textarea { width: 100%; font: inherit; font-size: .95em; line-height: 1.55; font-weight: 600; color: var(--ink); background: var(--panel-bg); border: 1.5px solid var(--rule); border-radius: 12px; padding: .5em .75em; resize: none; field-sizing: content; min-height: 4.9em; }
.ct-funds textarea:focus { outline: none; border-color: var(--stage); }
.ct-funds .ct-src { position: static; display: block; margin: .35em 0 0 .2em; font-size: .75em; }
.ct-bar { display: flex; gap: 3px; flex-wrap: wrap; }
.ct-bar span { position: relative; min-width: 0; height: 26px; border-radius: 7px; background: var(--fc); color: #fff; display: flex; align-items: center; padding: 0 .5em; overflow: hidden; }
.ct-bar b { font-size: .78em; font-weight: 800; white-space: nowrap; }
.ct-bar i { display: none; }
.ct-bar em { flex-basis: 100%; font-style: normal; font-weight: 700; font-size: .82em; color: var(--port); }
.ct-drops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8em; }
.ct-drops span { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: .1em .5em; font-size: .85em; }
.ct-drops i { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--port-wash); position: relative; overflow: hidden; }
.ct-drops i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--k) * 100%); background: var(--c1); border-radius: 5px; transition: width .5s var(--ease-out); }
.ct-drops b { color: var(--port); } .ct-drops em { font-style: normal; font-weight: 800; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.ct-hint { font-size: .88em; color: var(--ink-3); margin: 0; }
.ct-hint a { font-weight: 700; }
.ct-calc { font-weight: 800; }
.ct-nav { display: flex; justify-content: space-between; gap: .5em; margin-top: auto; }
.ct-side { display: flex; flex-direction: column; gap: .55em; min-width: 0; }
.ct-sheet-wrap { position: relative; flex: 1 1 auto; min-height: 200px; border-radius: 14px; background: color-mix(in oklab, var(--stage) 8%, var(--surface-2)); overflow: hidden; }
.ct-sheet { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; }
.ct-scale { position: absolute; left: 0; top: 0; width: 794px; transform-origin: 0 0; display: grid; gap: 30px; padding: 0; }
.ct-scale .cpg { box-shadow: 0 2px 4px rgba(10, 27, 46, .12), 0 18px 40px -12px rgba(10, 27, 46, .35); }
.ct-scale .on { background: rgba(255, 214, 90, .28); box-shadow: 0 0 0 10px rgba(255, 214, 90, .28); border-radius: 6px; transition: background .3s, box-shadow .3s; }
.ct-scale .cp-storm.on, .ct-scale .cp-cardrow.on { background: none; box-shadow: none; }
.ct-scale .cp-storm.on { box-shadow: 0 0 0 7px rgba(255, 196, 40, .75); background: linear-gradient(180deg, #1B3F66, #0B2140); }
.ct-side .ips-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; margin: 0; }
.ct-side .ips-actions .btn { padding-inline: .85em; }
.ct .cq-s { display: none; }
.ct-side { position: relative; }
.ct-side .toast { position: absolute; left: .6em; right: .6em; bottom: 3.6em; z-index: 2; margin: 0; min-height: 0; text-align: center; pointer-events: none; }
.ct-side .toast:not(:empty) { padding: .5em .8em; border-radius: 10px; background: var(--tip-bg); color: var(--tip-ink); font-size: .85em; }
@container (max-width: 820px) {
  .ips.ct { grid-template-columns: minmax(0, 1fr); }
  .ct-buoy[data-page] { display: grid; }
  .ips.ct:not(.show-page) > .ct-side { display: none; }
  .ips.ct.show-page > .ct-main > :not(.ct-buoys) { display: none; }
  .ct-sheet-wrap { min-height: 330px; }
  .ct-buoys { overflow-x: auto; scrollbar-width: none; margin-inline: -.4em; padding: 4px .4em 2px; }
  .ct-buoys::-webkit-scrollbar { display: none; }
  .ct-buoy { flex: 1 0 auto; font-size: .7em; }
  .ct-buoy .ct-bn { max-width: 6.2em; }
}
@container (max-width: 480px) {
  .ct-buoy:not([aria-selected="true"]) .ct-bn { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ct-buoy[aria-selected="true"] { flex: 2 0 auto; }
  .ct-buoy .ct-bn { max-width: none; white-space: nowrap; }
  .ct-say { font-size: 1.08em; line-height: 2.15; }
  .ct-drops { gap: .5em; } .ct-drops span { font-size: .78em; }
  .ct-prog .btn-link { margin-left: 0; }
  .ct .cq-l { display: none; } .ct .cq-s { display: inline; }
  .ct-sheet-wrap { min-height: 240px; }
  .ct-side .ips-actions { display: grid; grid-template-columns: 1.15fr 1fr 1.2fr auto; gap: .35em; }
  .ct-side .ips-actions .btn { font-size: .8em; padding-inline: .5em; justify-content: center; }
}

/* ---------- la hoja impresa: dos A4 con estilo de carta náutica (es papel: colores fijos en los dos temas) ---------- */
.cpg { width: 794px; height: 1123px; background: #fff; color: #2B333D; position: relative; overflow: hidden; font: 13px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; text-align: left; letter-spacing: 0; }
.cpg * { box-sizing: border-box; margin: 0; }
.cpg b { color: #0A1B2E; font-weight: 800; }
.cp-hd { height: 250px; background: linear-gradient(180deg, #F1E6C8, #CDEBE6 55%, #BFD6EE); position: relative; padding: 40px 52px 0; }
.cp-hd h1 { font-size: 31px; font-weight: 900; letter-spacing: -.03em; line-height: 1.02; color: #0A1B2E; }
.cp-hd h1 span { display: block; font-size: 14px; font-weight: 700; color: #51606F; letter-spacing: 0; margin-top: 6px; }
.cp-brand { position: absolute; right: 52px; top: 42px; font-weight: 800; font-size: 12px; color: #0A1B2E; display: flex; gap: 7px; align-items: center; }
.cp-brand i { width: 14px; height: 14px; border-radius: 4px; background: #2150C4; }
.cp-rw { position: absolute; left: 52px; right: 52px; bottom: 44px; height: 92px; }
.cp-route { display: block; overflow: visible; }
.cp-rt { font: 900 15px var(--f-body); fill: #0A1B2E; } .cp-rs { font: 600 11.5px var(--f-body); fill: #51606F; }
.cp-in { padding: 22px 52px 0; display: grid; gap: 14px; }
.cp-in2 { padding-top: 52px; gap: 22px; }
.cp-blk { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 14px; }
.cp-buoy { width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #0A1B2E; display: grid; place-items: center; }
.cp-buoy svg { width: 15px; height: 15px; stroke: #0A1B2E; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpg h2 { font-size: 15px; font-weight: 900; letter-spacing: -.01em; color: #0A1B2E; margin-top: 4px; }
.cpg h3 { font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.cpg p { margin-top: 2px; }
.cp-sm { font-size: 12px; margin-top: 6px !important; }
.cp-warn { color: #C0283A; font-weight: 800; }
.cp-mut { color: #51606F; }
.cp-barw { margin-top: 8px !important; } .cp-bar { display: block; width: 100%; height: auto; } .cp-bt { font: 800 12.5px var(--f-body); fill: #fff; }
.cpg table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.cpg td { padding: 5px 0; border-bottom: 1px solid #E3E7EC; vertical-align: top; } .cpg td.r { text-align: right; white-space: nowrap; padding-left: 12px; }
.cpg td i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.cp-isin { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px; color: #51606F; }
.cp-storm { margin: 16px 52px 0 !important; border-radius: 18px; background: linear-gradient(180deg, #1B3F66, #0B2140); color: rgba(255, 255, 255, .86); padding: 18px 22px; }
.cp-storm h2, .cp-storm h3, .cp-storm b { color: #fff; } .cp-storm h2 { margin: 0; }
.cp-storm td { border-bottom-color: rgba(255, 255, 255, .14); }
.cp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px !important; }
.cpg ul { padding-left: 16px; display: grid; gap: 3px; }
.cp-ck { list-style: none; padding: 0 !important; margin-top: 8px !important; } .cp-ck li { display: flex; gap: 9px; }
.cp-ck li::before { content: ""; flex: none; width: 12px; height: 12px; border: 1.5px solid #0A1B2E; border-radius: 50%; margin-top: 2px; }
.cp-sign { display: grid; grid-template-columns: 1fr 1fr 150px; gap: 24px; margin-top: 34px !important; }
.cp-sign div { border-top: 1.5px solid #0A1B2E; padding-top: 5px; font-size: 11px; color: #51606F; }
.cp-foot { position: absolute; left: 52px; right: 52px; bottom: 30px; display: flex; justify-content: space-between; font-size: 10.5px; color: #6B7280; }
.cp-cardrow { position: absolute; left: 52px; right: 52px; bottom: 80px; display: flex; gap: 22px; align-items: flex-end; }
.cp-cardrow > p { max-width: 250px; color: #51606F; font-size: 11.5px; }
.cp-card { position: relative; flex: none; width: 340px; height: 214px; border-radius: 14px; padding: 18px 20px; background: linear-gradient(180deg, #1B3F66, #0B2140); color: rgba(255, 255, 255, .82); outline: 1.5px dashed #9AA3AE; outline-offset: 6px; }
.cp-cut { position: absolute; top: -17px; left: 14px; background: #fff; padding: 0 6px; font-size: 10.5px; color: #6B7280; font-weight: 700; }
.cp-ct { display: block; font-size: 16px; font-weight: 900; letter-spacing: -.01em; color: #fff !important; }
.cp-cs { display: block; font-size: 11px; margin-top: 1px; }
.cp-card ol { margin: 10px 0 0 !important; padding-left: 18px; display: grid; gap: 3px; font-weight: 700; font-size: 12.5px; color: #fff; }
.cp-card p { margin-top: 9px !important; font-size: 11.5px; } .cp-card p b { color: #FB7185; }
.cpg-cards { padding: 70px 60px; display: flex; flex-direction: column; gap: 46px; align-items: flex-start; }
.cpg-cards > p { color: #51606F; font-size: 12px; max-width: 30em; }

.print-root { display: none; }
@page carta { size: A4; margin: 0; }
@media print {
  body.print-ips { background: #fff !important; }
  body.print-ips > *:not(.print-root) { display: none !important; }
  body.print-ips .print-root { display: block !important; }
  .print-root { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-root .cpg { page: carta; break-after: page; box-shadow: none; }
  .print-root .cpg:last-child { break-after: auto; }
}


/* simulador: controles y resultado a la izquierda, gráfico a la derecha */
.lab { display: grid; grid-template-columns: minmax(0, 15.5em) minmax(0, 1fr); gap: 1em 1.8em; align-items: start; }
.lab-ctl .controls { grid-template-columns: minmax(0, 1fr); gap: .5em; margin-bottom: .8em; }
.lab-ctl .controls > .ctl.wide { grid-column: auto; }
.lab-ctl .figure { font-size: 2.3em; }
.lab-ctl .result.lg { font-size: 1em; }
.lab-ctl .fig-sub { font-size: .86em; color: var(--ink-3); margin: .4em 0 0 !important; line-height: 1.45; }
.lab-fig .sublabel { margin-top: .9em !important; font-size: .86em; }
@container (max-width: 600px) { .lab { grid-template-columns: minmax(0, 1fr); } .lab-ctl .controls { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9em), 1fr)); } }

/* tablas del simulador: una al lado de la otra si hay anchura */
.sim-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 25em), 1fr)); gap: 1em 2em; align-items: start; }
.sim-pair .sim-block { margin-top: 0; }
.heat .hc { padding: .38em 2px; font-size: .92em; }
.heat .hh { padding: .3em 2px; }

/* pantallas bajas: barra y pie más finos para dejar sitio al paso */
@media (min-width: 760px) and (max-height: 760px) {
  .lbar-in { height: 50px; }
  .lbar .icon-btn { width: 36px; height: 36px; }
  .lfoot .wrap { min-height: 56px; }
  .lfoot .btn { padding: 9px 16px; font-size: .98rem; }
  .stage-in { padding-block: clamp(10px, 2.4vh, 44px); }
  .more-cue { bottom: 68px; }
}

/* ---------- selector de caras (móvil) ---------- */
.facesw { --f: 0; --n: 2; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); width: 100%; max-width: 250px; padding: 3px; border-radius: 13px; background: color-mix(in oklab, var(--stage) 9%, var(--surface-2)); }
.facesw::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n)); border-radius: 10px; background: var(--bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); transform: translateX(calc(var(--f) * 100%)); transition: transform .38s var(--ease-out); }
.facesw a { position: relative; z-index: 1; display: grid; place-items: center; padding: 9px 6px; font-weight: 700; font-size: .88rem; line-height: 1.1; color: var(--ink-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 10px; }
.facesw a[aria-current] { color: var(--stage-ink); }
@media (prefers-reduced-motion: reduce) { .facesw::before { transition: none; } }
.m-only { display: none; }

/* =================== móvil =================== */
@media (max-width: 759px) {
  .m-only { display: revert; }
  .seg .m-only { display: block; }
  /* chips en una sola fila que se desliza */
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -1em; padding: 2px 1em; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1em, #000 calc(100% - 1.6em), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 1em, #000 calc(100% - 1.6em), transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; flex: none; }
  /* dudas: acordeón */
  .fa { font-size: .95em; padding: 1em 1.1em; }
}

@media (max-width: 759px) and (min-height: 470px) {
  /* cabecera y pie compactos */
  .lbar-in { height: 54px; min-height: 0; padding-block: 0; gap: 10px; }
  .lbar .icon-btn { width: 38px; height: 38px; border-radius: 11px; }
  .lbar-mid { gap: 3px; }
  .lbar h1 { font-size: .9rem; line-height: 1.2; }
  .segs { gap: 4px; }
  .segs button { height: 14px; padding: 0; }
  .segs button::before, .segs button::after { top: 5px; height: 5px; }
  .lfoot .wrap { min-height: 60px; gap: 8px; }
  .lfoot .btn { padding: 11px 16px; }
  .has-faces .lfoot .wrap { grid-template-columns: auto minmax(0, 1fr) auto; }
  .has-faces #l-prev { padding-inline: 13px; }
  .has-faces #l-prev .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .has-faces #l-next { width: auto; padding-inline: 16px; }
  /* tres caras: el botón de seguir se queda en la flecha para que quepa el selector */
  .faces-3 #l-next { padding-inline: 13px; }
  .faces-3 #l-next .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .faces-3 .facesw { max-width: 300px; }
  .more-cue { bottom: calc(70px + var(--safe-b)); }
  .stage-in { padding-block: 12px 10px; }

  /* un paso = una cara que cabe entera */
  .step { align-content: center; row-gap: 0; }
  .step.face-0 [data-face]:not([data-face="0"]), .step.face-1 [data-face]:not([data-face="1"]), .step.face-2 [data-face]:not([data-face="2"]) { display: none !important; }
  .step.face-2 > .txt { display: none !important; }
  .step h2 { font-size: 1.85em; }
  .txt > p:not([class]) { margin-top: .7em; }
  .quizset { margin-top: 0; }
  .step.face-0 .quizset { margin-top: 1em; }
  .side { align-content: start; }

  /* panel: el gráfico arriba y los controles abajo, al alcance del pulgar */
  .panel { border-radius: 18px; padding: .85em .95em .95em; }
  .p-head { margin-bottom: .6em; }
  .p-hint { font-size: .84em; margin-top: .35em; }
  .panel .p-body { display: flex; flex-direction: column; }
  .panel .p-body > .controls, .panel .p-body > .chips { order: 20; margin: .85em 0 0; }
  .panel .p-body > .chips + .controls { margin-top: .5em; }
  .controls:not([style]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45em 1em; }
  .controls:not([style]) > .seg-wrap, .controls:not([style]) > .ctl.wide { grid-column: 1 / -1; }
  .ctl label, .ctl .lab, .seg-wrap .lab { font-size: .82em; }
  .ctl output { font-size: .9em; }
  .legend { font-size: .8em; }
  .result, .verdict { font-size: .93em; margin-top: .6em; }
}

/* simulador en una columna: resultado, gráfico, franja y, abajo, los controles */
@container (max-width: 600px) {
  .lab { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .lab-ctl, .lab-fig { display: contents; }
  .lab-ctl .controls { order: 10; margin: .9em 0 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-ctl .controls > .ctl.wide { grid-column: 1 / -1; }
  .lab-ctl .fig-sub { margin: .2em 0 .6em !important; }
}

/* ---------- pestañas dentro de un panel (solo móvil) ---------- */
.mtab-sw { display: none; }
@media (max-width: 759px) {
  .mtab-sw { display: flex; flex-wrap: nowrap; align-self: stretch; justify-self: stretch; margin: 0 0 .7em; grid-column: 1 / -1; }
  .mtab-sw > button, .mtab-sw > label { flex: 1 1 0; text-align: center; }
  [data-mtabs] > .mt-off { display: none !important; }
  /* ilustración de la etapa 1: dibujo y texto en la misma fila */
  .ill { gap: .8em; }
  .ill figure { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 1em; align-items: center; padding: .9em 1em; }
  .ill svg { max-height: 88px; }
  .ill figcaption { margin-top: 0; font-size: .95em; }
  .ill figcaption b { font-size: 1.15em; }
  /* comisiones: en el móvil sobra el casco, la frase de al lado dice lo mismo */
  .hull { display: none; }
  /* bono ideal: los riesgos en dos columnas, solo el nombre */
  .risk-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3em .8em; }
  .risk-list li { grid-template-columns: 16px minmax(0, 1fr); gap: 7px; }
  .risk-list li > span:last-child { font-size: 0; }
  .risk-list li > span:last-child b { font-size: .86rem; }
  .risk-list .ic { margin-top: 4px; }
  /* canal balizado: nombre y estado a la izquierda, canal a la derecha */
  .channel { gap: .55em; }
  .lane { grid-template-columns: 7.4em minmax(0, 1fr); gap: .1em .8em; }
  .lane-name { grid-column: 1; grid-row: 1; font-size: .95em; }
  .lane-name small { display: none; }
  .lane-status { grid-column: 1; grid-row: 2; text-align: left; font-size: .8em; }
  .lane-track { grid-column: 2; grid-row: 1 / span 2; height: 30px; align-self: center; }
  .moves { margin-top: .6em; gap: 4px; }
  .moves li { padding: .45em .75em; font-size: .88em; line-height: 1.35; }
  /* qué duele más */
  .regret { font-size: .84em; }
  .regret > div { padding: .55em .65em; }
  /* principios: bandera pequeña junto al título */
  .principle { padding: .85em 1em; row-gap: .35em; }
  .principle .pf { grid-template-columns: 44px auto; gap: 10px; }
  .principle .pf svg { width: 44px; }
  .principle h4 { font-size: 1.2em; }
  .principle p, .principle q { font-size: .93em; }
  .pr-nav { margin-top: .6em; }
  .pr-nav .btn { padding: 8px 12px; font-size: .85em; }
  .flag-score { margin-bottom: .5em; font-size: .95em; }
  .bunting-wrap { margin-bottom: .4em; }
}
@media (max-width: 759px) and (prefers-reduced-motion: no-preference) {
  [data-mtabs] > .just { animation: riseIn .35s var(--ease-out) both; }
}

/* móvil: textos secundarios más discretos para dejar sitio al gráfico */
@media (max-width: 759px) {
  .p-sub { font-size: .8em; }
  .p-hint { font-size: .8em; }
  .lab-ctl .fig-sub { display: none; }
  .legend { gap: .2em .9em; }
  [data-mtabs] > .result { margin-top: 0; }
}

@media (max-width: 759px) {
  /* comisiones: la frase del casco repite lo que dice la pestaña «En euros» */
  #fig-comisiones .split > div:last-child { display: none; }
  #fee-presets { margin-bottom: 0 !important; }
  /* bono ideal: selectores más apretados */
  .picker { gap: .4em 1em; }
  .picker .seg label { padding: .5em .62em; }
  .picker .seg-wrap .lab { font-size: .8em; }
}

@media (max-width: 759px) {
  /* simulador: la pestaña ya dice «Año de inicio»; el rótulo largo sobra */
  .lab-fig .sublabel { display: none; }
  .lab-fig .result, .lab .result:not(.lg) { font-size: .86em; }
  .lab-ctl .ctl.wide > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #fig-aritmetica .result { font-size: .88em; }
}

/* vehículos: en pantalla estrecha, una matriz de puntos; el detalle se lee al tocar */
.vmatrix .vshort, .vm-note { display: none; }
@container (max-width: 760px) {
  .vmatrix table { min-width: 0; table-layout: fixed; }
  .vmatrix .vfull, .vmatrix td .vt { display: none; }
  .vmatrix .vshort { display: block; }
  .vmatrix thead th { font-size: .92em; text-align: center; padding-inline: .2em; }
  .vmatrix thead th:first-child { width: 44%; }
  .vmatrix td { text-align: center; vertical-align: middle; cursor: pointer; padding-inline: .2em; }
  .vmatrix .dot { width: 14px; height: 14px; margin: 0; }
  .vmatrix .score { font-size: .78em; }
  .vm-note { display: block; }
}
@media (max-width: 759px) {
  .result.lg { font-size: 1em; }
  .step.face-1 .quizset { margin-top: 0; }
  .step.quizstep .txt { align-self: center; }
  .facesw a { font-size: .84rem; padding-inline: 4px; }
}

/* aviso de la segunda cara */
@keyframes faceHint { 0%, 100% { color: var(--ink-2); } 30%, 70% { color: var(--stage-ink); transform: translateX(0); } 45% { transform: translateX(3px); } 55% { transform: translateX(-2px); } }
.facesw.hint a:last-child { animation: faceHint 1.3s .7s ease-in-out 2; }
/* portada en el móvil: quien ya ha empezado ve «Continuar» lo primero */
@media (max-width: 759px) {
  #v-home > main.wrap { display: flex; flex-direction: column; }
  #v-home .resume.started { order: -1; margin-top: 18px; }
  #v-home .resume.started + .route { padding-top: 40px; }
  .intro { padding-top: 28px; }
  .route li a { padding-block: 12px; }
  .num { width: 42px; height: 42px; border-radius: 12px; }
}

/* =================== v4: portada =================== */
.storm-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 14px; padding: 14px 18px; border-radius: 16px; background: color-mix(in oklab, #1E293B 7%, var(--bg)); border: 1px solid color-mix(in oklab, #1E293B 16%, var(--rule)); color: var(--ink); text-decoration: none; font-size: 1.02rem; line-height: 1.35; transition: background-color .2s, border-color .2s; }
.storm-link > svg:first-child { width: 26px; height: 26px; color: var(--ink-2); }
.storm-link span { color: var(--ink-2); }
.storm-link span b { color: var(--ink); font-weight: 800; }
.storm-link:hover { background: color-mix(in oklab, #1E293B 12%, var(--bg)); }
.storm-link:hover .tarrow { transform: translateX(3px); color: var(--ink); }
.guides { padding-top: 40px; }
.guides .num svg { width: 22px; height: 22px; }
.install-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 28px 0 0; padding: 14px 18px; border-radius: 16px; background: var(--surface); color: var(--ink-2); font-size: 1rem; }
.install-line > svg { width: 22px; height: 22px; color: var(--stage-ink); }
.install-line > span:first-of-type { flex: 1 1 16em; }
.install-ios { flex-basis: 100%; font-size: .95rem; }
.d-ios { font-size: .92rem; color: var(--ink-2); cursor: default; margin: 0; }
.c-icon svg { width: .8em; height: .8em; }

/* =================== v4: tu reparto =================== */
.perfil { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 1.2em 2em; align-items: start; }
.perfil .q-item { justify-items: stretch; }
.perfil-q { display: grid; gap: .5em; }
.perfil .seg label { padding: .52em .62em; font-size: .82em; }
.q-item .lab { font-size: .88em; }
.q-item .seg { flex-wrap: wrap; }
.perfil-r { min-height: 12em; }
.pf-empty { color: var(--ink-3); font-size: .95em; padding: 1.2em; border: 2px dashed var(--rule); border-radius: 14px; text-align: center; }
.pf-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em 1.2em; }
.pf-n { color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.pf-n b { font-size: 2.6em; line-height: .95; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); margin-right: .08em; }
.pf-bar { height: 16px; margin-top: .7em; border-radius: 8px; }
.pf-bar > div { padding: 0; }
.pf-warn { list-style: none; margin: .7em 0 0; padding: 0; display: grid; gap: .35em; }
.pf-warn li { background: var(--warn-wash); border-radius: 10px; padding: .5em .75em; font-size: .88em; line-height: 1.4; }
.pf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1.2em; margin-top: .9em; }
.pf-actions .btn[disabled] { opacity: .6; cursor: default; filter: none; }
@container (max-width: 640px) { .perfil { grid-template-columns: minmax(0, 1fr); } }

/* =================== v4: tu rebalanceo =================== */
.mr-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2em 2em; align-items: start; }
.mr-rows { display: grid; gap: .5em; }
.mr-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr) auto; gap: .5em; align-items: end; }
.mr-num { display: grid; gap: .2em; font-size: .78em; font-weight: 700; color: var(--ink-2); }
.mr-num input { font-size: 1.12em; }
.mr-row .mr-n { font-weight: 700; }
.mr-del { width: 36px; height: 36px; color: var(--ink-3); background: var(--surface); }
.mr-del[disabled] { opacity: .35; cursor: default; }
.mr-tools { display: flex; gap: 1.2em; margin-top: .6em; }
.mr-tools .btn-link { font-size: .88em; }
.mr-apo { display: grid; gap: .3em; margin-top: .8em; font-weight: 700; font-size: .88em; }
.mr-bars { display: grid; gap: .45em; margin-bottom: .6em; }
.mr-bar { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) 3.2em; gap: .6em; align-items: center; font-size: .86em; }
.mr-bn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-bar > b { text-align: right; font-variant-numeric: tabular-nums; }
.mr-track { position: relative; height: 14px; border-radius: 7px; background: var(--surface-2); }
.mr-band { position: absolute; top: 0; bottom: 0; background: var(--stbd-wash); border-radius: 7px; }
.mr-now { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 4px; background: var(--stage); transition: width .4s var(--ease-out); }
.mr-tgt { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); }
.mr-bar.out .mr-now { background: var(--port); }
.mr-bar.out > b { color: var(--port); }
.mr-list { margin-top: .3em; }
.mr-list li { font-size: .88em; }
.mr-out .sublabel { margin: .7em 0 0; font-size: .9em; }
@container (max-width: 700px) { .mr-grid { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 420px) { .mr-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .mr-name { grid-column: 1 / -1; } }

/* =================== v4: impuestos al vender =================== */
.tramos { display: flex; gap: 2px; height: 2.6em; border-radius: 10px; overflow: hidden; margin-bottom: .2em; }
.tramos > div { display: flex; flex-direction: column; justify-content: center; padding: 0 .55em; min-width: 3px; color: #fff; line-height: 1.1; white-space: nowrap; overflow: hidden; transition: flex-basis .4s var(--ease-out); }
.tramos b { font-size: .92em; font-weight: 800; }
.tramos span { font-size: .72em; opacity: .9; }
.tramos .t19 { background: color-mix(in oklab, var(--stage) 45%, #9AA6B5); }
.tramos .t21 { background: color-mix(in oklab, var(--stage) 62%, #7D8A9B); }
.tramos .t23 { background: color-mix(in oklab, var(--stage) 78%, #5D6A7B); }
.tramos .t27 { background: color-mix(in oklab, var(--stage) 88%, #2F3845); }
.tramos .t30 { background: color-mix(in oklab, var(--stage) 80%, #111111); }

/* =================== v4: fondos con su ISIN =================== */
.fx-chips { margin-bottom: .8em; }
.fx-chips .chip { font-size: .8em; }
.fx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45em; }
.fx-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 8.5em; gap: .4em 1.2em; align-items: center; padding: .6em .8em; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
.fx-main b { display: block; font-size: .92em; line-height: 1.3; }
.fx-main span { display: block; font-size: .8em; color: var(--ink-3); margin-top: .1em; }
.fx-isin { display: inline-flex; align-items: center; gap: .3em; }
.fx-isin code { font: 700 .82em/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .02em; color: var(--ink); background: var(--surface); padding: .45em .55em; border-radius: 7px; user-select: all; }
.fx-copy { width: 32px; height: 32px; border-radius: 9px; color: var(--ink-3); }
.fx-copy:hover { background: var(--surface); color: var(--ink); }
.fx-copy svg { width: 17px; height: 17px; }
.fx-copy.done { color: var(--stbd); background: var(--stbd-wash); }
.fx-ter { text-align: right; line-height: 1.2; }
.fx-ter b { display: block; font-size: 1.05em; font-variant-numeric: tabular-nums; }
.fx-ter span { font-size: .72em; color: var(--ink-3); }
@container (max-width: 560px) {
  .fx-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .fx-main { grid-column: 1 / -1; }
}

/* =================== v4: carteras de ejemplo =================== */
.cx { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15em), 1fr)); gap: .8em; }
.cx-card { border: 1px solid var(--rule); border-radius: 14px; padding: .8em .9em; background: var(--bg); }
.cx-card h4 { font-size: .98em; font-weight: 800; margin: 0 0 .5em; }
.cx-card ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .5em; }
.cx-card li { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: .4em; align-items: baseline; font-size: .86em; line-height: 1.3; }
.cx-card li b { font-size: 1.12em; color: var(--stage-ink); font-variant-numeric: tabular-nums; }
.cx-card small { display: block; color: var(--ink-3); font-size: .86em; margin-top: .1em; }
.cx-card p { margin-top: .6em; font-size: .82em; color: var(--ink-2); }

/* =================== v4: tablas de plataformas =================== */
.plat-wrap { border: 0; background: transparent; }
table.plat { border-collapse: collapse; width: 100%; font-size: .86em; line-height: 1.38; }
table.plat th, table.plat td { text-align: left; vertical-align: top; padding: .6em .7em; border-bottom: 1px solid var(--rule-2); }
table.plat thead th { font-size: .88em; color: var(--ink-3); font-weight: 700; border-bottom: 2px solid var(--rule); }
table.plat tbody th { font-weight: 800; color: var(--ink); white-space: nowrap; }
table.plat td { color: var(--ink-2); }
@container (max-width: 600px) {
  table.plat thead { display: none; }
  table.plat tr { display: block; padding: .6em 0; border-bottom: 1px solid var(--rule); }
  table.plat tbody th, table.plat td { display: block; border: 0; padding: .12em 0; }
  table.plat tbody th { font-size: 1.06em; }
  table.plat td::before { content: attr(data-label) ': '; font-weight: 700; color: var(--ink-3); }
}

/* =================== v4: tu plan en un día de tormenta =================== */
.tp-dl { margin: 0; display: grid; gap: .6em; }
.tp-dl > div { background: var(--surface); border-radius: 12px; padding: .7em .9em; }
.tp-dl dt { font-weight: 800; font-size: .86em; color: var(--stage-ink); }
.tp-dl dd { margin: .15em 0 0; font-size: .98em; line-height: 1.45; color: var(--ink); white-space: pre-wrap; }
.tp-empty { color: var(--ink-2); font-size: .95em; line-height: 1.5; }
.tp .takeaways { margin-top: .6em; }
.tp-links { margin-top: .9em; display: flex; flex-wrap: wrap; gap: .6em 1.2em; align-items: center; }

/* lista partida en dos caras: la segunda sigue la numeración */
.step.face-1 .points[data-split] { counter-reset: pt var(--k); }
.cx .mtab-sw { grid-column: 1 / -1; justify-self: stretch; }

/* =================== v5: tres niveles =================== */
:root { --lv1: #0B7A55; --lv2: #2150C4; --lv3: #1F2937; --lv4: #A16207; --lv5: #0369A1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --lv1: #3DBB82; --lv2: #6E9BF2; --lv3: #E5E7EB; --lv4: #E3B341; --lv5: #5CC3F0; } }
:root[data-theme="dark"] { --lv1: #3DBB82; --lv2: #6E9BF2; --lv3: #E5E7EB; --lv4: #E3B341; --lv5: #5CC3F0; }

/* señal de nivel: tres barras, llenas según el nivel (verde, azul, oscuro, como las pistas) */
.lv-glyph { display: inline-flex; align-items: flex-end; gap: 2px; height: 1em; flex: none; }
.lv-glyph b { width: .26em; border-radius: 1.5px; background: color-mix(in oklab, var(--ink-3) 32%, transparent); }
.lv-glyph b:nth-child(1) { height: 45%; }
.lv-glyph b:nth-child(2) { height: 72%; }
.lv-glyph b:nth-child(3) { height: 100%; }
.lv-1 { --lv: var(--lv1); } .lv-2 { --lv: var(--lv2); } .lv-3 { --lv: var(--lv3); } .lv-4 { --lv: var(--lv4); } .lv-5 { --lv: var(--lv5); }
:is(.lv-1.lv-glyph, .lv-1 .lv-glyph) b:nth-child(-n+1), :is(.lv-2.lv-glyph, .lv-2 .lv-glyph) b:nth-child(-n+2), :is(.lv-3.lv-glyph, .lv-3 .lv-glyph) b { background: var(--lv); }

/* pestañas de nivel en la portada */
.lv-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-top: 26px; border-radius: 18px; background: var(--surface-2); max-width: 36em; }
.lv-tab { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 0; border-radius: 14px; background: transparent; color: var(--ink-2); text-align: left; cursor: pointer; font: inherit; min-width: 0; transition: background-color .2s, box-shadow .2s; }
.lv-tab .lv-glyph { font-size: 1.2rem; }
.lv-t { min-width: 0; display: block; }
.lv-tab b { display: block; font-weight: 800; font-size: 1.04rem; line-height: 1.2; color: var(--ink); }
.lv-tab small { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: .84rem; line-height: 1.25; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lv-tab small svg { width: 13px; height: 13px; flex: none; color: var(--stbd); }
.lv-tab.done small { color: var(--stbd); font-weight: 700; }
.lv-tab:hover { background: color-mix(in oklab, var(--bg) 55%, transparent); }
.lv-tab[aria-selected="true"] { background: var(--bg); box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 16px -8px rgba(15, 23, 42, .25); }
.lv-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 560px) {
  .lv-tabs { margin-top: 22px; }
  .lv-tab { flex-direction: column; align-items: flex-start; gap: 7px; padding: 10px 11px; }
  .lv-tab b { font-size: .98rem; }
  .lv-tab small { font-size: .8rem; }
}
.route-ttl { min-width: 0; }
.lv-desc { margin-top: 4px; color: var(--ink-2); font-size: 1.02rem; max-width: 46em; }

/* herramientas agrupadas por nivel */
.tools-h { display: flex; align-items: center; gap: 9px; font-size: 1.05rem; font-weight: 800; margin: 22px 0 4px; color: var(--ink); }
.tools-h:first-child { margin-top: 6px; }
.tools-h .lv-glyph { font-size: 1rem; }

/* menú lateral: título de cada nivel */
.d-h { display: flex; align-items: center; gap: 8px; }
.d-h .lv-glyph { font-size: .92rem; }

/* tarjeta del nivel siguiente y final de la guía */
.nextstage .ns-n .lv-glyph { font-size: 1.15em; }
.nextstage .lv-glyph b { background: rgba(255, 255, 255, .35); }
.nextstage .lv-1.lv-glyph b:nth-child(-n+1), .nextstage .lv-2.lv-glyph b:nth-child(-n+2), .nextstage .lv-3.lv-glyph b { background: #fff; }
.finale li i.lv-i { background: color-mix(in oklab, var(--lv) 14%, var(--bg)); }
.finale li i.lv-i .lv-glyph { font-size: 1em; }
.finale-lv li { font-size: .98em; }
.finale-lv li a b { font-weight: 800; }

/* tablas de resultados de las herramientas */
.st-wrap { overflow-x: auto; margin-top: .55em; }
.st-t { width: 100%; border-collapse: collapse; font-size: .84em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.st-t th, .st-t td { padding: .36em .5em; text-align: right; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
.st-t thead th { font-size: .9em; font-weight: 700; color: var(--ink-3); border-bottom-color: var(--rule); }
.st-t th:first-child { text-align: left; padding-left: 0; }
.st-t td:last-child, .st-t thead th:last-child { padding-right: 0; }
.st-t tbody th { font-weight: 700; color: var(--ink); }
.st-t tbody th .lk { vertical-align: middle; margin-right: .5em; }
.st-t tbody th small { font-weight: 500; color: var(--ink-3); margin-left: .45em; }
.st-t tbody tr:last-child th, .st-t tbody tr:last-child td { border-bottom: 0; }
@container (max-width: 460px) { .st-t { font-size: .78em; } .st-t tbody th small { display: none; } .st-t thead th, .st-t tbody th { white-space: normal; } .st-t th, .st-t td { padding-inline: .32em; } .st-t thead th { vertical-align: bottom; } }

/* barras de comparación: vender o pignorar, y tipos de interés */
.cmp, .rate-bars { display: grid; gap: .5em; margin: .1em 0 .2em; }
.cmp-r, .rate-r { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) 6.4em; gap: .7em; align-items: center; font-size: .9em; }
.rate-r { grid-template-columns: minmax(0, 17em) minmax(0, 1fr) 4.4em; font-size: .85em; }
.cmp-r > span, .rate-r > span { font-weight: 700; color: var(--ink-2); min-width: 0; line-height: 1.25; }
.cmp-r > b, .rate-r > b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.cmp-t { height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.cmp-t i { display: block; height: 100%; border-radius: 7px; background: color-mix(in oklab, var(--stage) 38%, var(--surface-2)); transition: width .45s var(--ease-out); }
.cmp-r.win > span, .rate-r.you > span { color: var(--ink); }
.cmp-r.win .cmp-t i, .rate-r.you .cmp-t i { background: var(--stage); }
@container (max-width: 520px) {
  .cmp-r, .rate-r { grid-template-columns: minmax(0, 1fr) auto; gap: .25em .6em; }
  .cmp-r .cmp-t, .rate-r .cmp-t { grid-column: 1 / -1; order: 3; height: 10px; }
}
#fig-senda .seg-wrap { margin-bottom: .7em; }
.pg-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1em 2em; align-items: start; }
.pg-grid > .controls { margin-bottom: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-out > .result:first-of-type { margin-top: .6em; }
@container (max-width: 700px) { .pg-grid { grid-template-columns: minmax(0, 1fr); } }
.nextstage .lv-glyph { display: inline-flex; opacity: 1; font-size: 1.25em; font-weight: 400; }
.nextstage .lv-glyph b { display: block; font-size: 1em; margin: 0; line-height: 0; letter-spacing: 0; }
@container (max-width: 420px) {
  .fx-list { gap: .35em; }
  .fx-list li { padding: .45em .65em; gap: .2em .8em; }
  .fx-ter span { display: none; }
  .fx-main span { display: none; }
}

/* =================== v6: portada «La travesía» =================== */
:root { --sz1: color-mix(in oklab, var(--water) 55%, var(--bg)); --sz2: var(--water); --sz3: #15304F; --sz-land: #EADBB9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sz1: #17212D; --sz2: #1C2B3D; --sz3: #0A1522; --sz-land: #3B3428; } }
:root[data-theme="dark"] { --sz1: #17212D; --sz2: #1C2B3D; --sz3: #0A1522; --sz-land: #3B3428; }

.hub-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px 56px; align-items: end; padding-block: clamp(36px, 5vw, 64px) 30px; }
.hub-txt h1 { font-size: clamp(2.3rem, 4.4vw, 3.8rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.028em; text-wrap: balance; }
.hub-txt p { margin-top: 16px; font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--ink-2); max-width: 36em; }
.hub-go { border-left: 4px solid var(--c, var(--stage)); padding: 4px 0 4px 22px; display: grid; justify-items: start; gap: 4px; }
.hub-go small { font-size: .92rem; font-weight: 700; color: var(--ink-3); }
.hub-go b { font-size: clamp(1.4rem, 2vw, 1.75rem); line-height: 1.12; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
.hub-go span { color: var(--ink-2); }
.hub-go .bar { justify-self: stretch; height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.hub-go .bar i { display: block; height: 100%; background: var(--c, var(--stage)); border-radius: 3px; }
.hub-go .btn { margin-top: 14px; background: var(--c, var(--stage)); color: #fff; }
.hub-go .btn:hover { filter: brightness(1.08); }
.hub-go .btn:hover svg { transform: translateX(3px); }

/* el mapa: puerto, costa y alta mar */
.seamap-box { border-radius: 26px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: var(--sz1); overscroll-behavior-x: contain; }
.seamap-box::-webkit-scrollbar { display: none; }
.seamap svg { display: block; }
.sz-1 { fill: var(--sz1); } .sz-2 { fill: var(--sz2); } .sz-3 { fill: var(--sz3); } .sz-land { fill: var(--sz-land); }
.map-wave.deep { stroke: rgba(255, 255, 255, .16); }
.map-route.deep { stroke: rgba(255, 255, 255, .5); }
.map-done.deep { stroke: #fff; }
.seamap .map-node .ring { fill: none; stroke: none; }
.seamap .map-node.cur .ring { stroke: var(--c); stroke-width: 2.5; }
.seamap .map-node text { font-size: 13px; }
.map-node.deep .base { fill: var(--sz3); }
.map-node.deep.todo circle.dot { fill-opacity: .3; stroke: rgba(255, 255, 255, .55); }
.map-node.deep.todo text { fill: #fff; }
.map-node.deep .dot { stroke: var(--sz3); }
.map-node.deep.cur .ring { stroke: #fff; }
.sz-lab { cursor: pointer; }
.sz-lab .n { font: 800 15px var(--f-body); fill: var(--ink); }
.sz-lab .s { font: 600 12.5px var(--f-body); fill: var(--ink-3); }
.sz-lab.deep .n { fill: #fff; }
.sz-lab.deep .s { fill: rgba(255, 255, 255, .72); }
.sz-lab rect.off { fill: color-mix(in oklab, var(--ink-3) 35%, transparent); }
.sz-lab.deep rect.off { fill: rgba(255, 255, 255, .3); }
.sz-lab rect.lv1 { fill: var(--lv1); } .sz-lab rect.lv2 { fill: var(--lv2); } .sz-lab rect.lv3 { fill: #fff; }
.sz-lab:hover .n { text-decoration: underline; }
.map-boat.deep { color: #fff; }
.map-lab.deep { fill: #fff; stroke: var(--sz3); }

/* una banda por nivel: qué es, sus etapas y sus herramientas */
.bands { margin-top: 10px; }
.band { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "side list" "tools list"; gap: 0 52px; padding-block: 44px 40px; border-top: 1px solid var(--rule); scroll-margin-top: 12px; }
.band:first-child { border-top: 0; }
.band-side { grid-area: side; }
.band-st { grid-area: list; }
.band-tl { grid-area: tools; }
.band-side .lv-glyph { font-size: 1.45rem; }
.band-side h2 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 12px; line-height: 1.1; }
.band-tag { font-weight: 700; color: var(--ink); margin-top: 4px; }
.band-desc { color: var(--ink-2); margin-top: 8px; font-size: 1rem; line-height: 1.5; }
.band-meta { margin-top: 18px; font-size: .92rem; color: var(--ink-3); display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.band-meta b { color: var(--ink); }
.band-meta svg { width: 14px; height: 14px; color: var(--stbd); }
.band.complete .band-meta { color: var(--stbd); font-weight: 700; }
.band-bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.band-bar i { display: block; height: 100%; width: 0; background: var(--lv); border-radius: 3px; transition: width .7s var(--ease-out); }
.band-h { font-size: .9rem; font-weight: 800; color: var(--ink-3); margin-top: 28px; }
.band-tools { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.band-tools a { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .98rem; line-height: 1.3; }
.band-tools a svg { width: 16px; height: 16px; color: var(--c); margin-top: 2px; }
.band-tools small { display: block; font-weight: 400; font-size: .86rem; color: var(--ink-3); margin-top: 2px; }
.band-tools a:hover > span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.band-st { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; align-content: start; }
.band-st a { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 16px 10px 16px 0; border-bottom: 1px solid var(--rule-2); text-decoration: none; color: var(--ink); border-radius: 6px; transition: background-color .2s; }
.band-st a:hover { background: color-mix(in oklab, var(--c) 6%, var(--bg)); }
.band-st i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .98rem; background: color-mix(in oklab, var(--c) 14%, var(--bg)); color: color-mix(in oklab, var(--c) 78%, var(--ink)); transition: transform .25s var(--ease-out); }
.band-st a:hover i { transform: rotate(-6deg) scale(1.06); }
.band-st .done i, .band-st .now i { background: var(--c); color: #fff; }
.band-st .now i { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }
.band-st i svg { width: 17px; height: 17px; }
.band-st b { display: block; font-weight: 800; font-size: 1.08rem; line-height: 1.25; }
.band-st span { display: block; color: var(--ink-2); font-size: .95rem; line-height: 1.4; margin-top: 3px; }
.band-st small { display: flex; gap: 5px; align-items: center; font-size: .86rem; color: var(--ink-3); margin-top: 7px; font-variant-numeric: tabular-nums; }
.band-st small svg { width: 14px; height: 14px; color: var(--stbd); }
.band-st .done small { color: var(--stbd); font-weight: 700; }
.band-st .now small, .band-st .seen small { color: var(--ink); font-weight: 700; }
#v-home .storm-link { margin-top: 6px; }
#v-home .install-line { margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .home-in .hub-txt > *, .home-in .hub-go, .home-in .seamap-box { animation: riseIn .7s var(--ease-out) both; }
  .home-in .hub-txt p { animation-delay: .06s; }
  .home-in .hub-go { animation-delay: .12s; }
  .home-in .seamap-box { animation-delay: .16s; }
  .home-in .band-st li { animation: riseIn .6s var(--ease-out) both; animation-delay: calc(.22s + var(--i, 0) * .04s); }
}
@media (max-width: 900px) {
  .hub-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 32px 24px; }
  .band { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "list" "tools"; padding-block: 34px 28px; }
  .band-st { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
  .band-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
}
@media (max-width: 560px) {
  .seamap-box { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }
  .band-tools { grid-template-columns: minmax(0, 1fr); }
  .band-side h2 { font-size: 1.65rem; }
  .band-st a { padding-block: 13px; }
}
@media (max-width: 560px) { .band-st span { display: none; } .band-st small { margin-top: 3px; } .band-desc { font-size: .96rem; } }

/* =================== v6: para saber más =================== */
.more-btn { margin-top: 1em; font-size: .8em; padding: 8px 14px 8px 11px; gap: 7px; }
.more-btn svg { width: 16px; height: 16px; }
.p-info.more-sheet { position: absolute; inset: 0; z-index: 20; background: var(--lesson-bg, var(--bg)); }
.more-sheet .p-info-in { max-width: 44em; margin-inline: auto; padding: clamp(18px, 3vw, 34px) var(--gutter) 48px; }
.more-sheet .p-info-top { position: sticky; top: 0; background: var(--lesson-bg, var(--bg)); padding-block: 4px 8px; z-index: 1; }
.more-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: .86em; font-weight: 800; color: var(--stage-ink); }
.more-kicker svg { width: 17px; height: 17px; }
.more-sheet h3 { font-size: clamp(1.35em, 2.4vw, 1.7em); line-height: 1.15; font-weight: 800; letter-spacing: -0.015em; text-wrap: balance; margin-top: .2em; }
.more-body { margin-top: .9em; font-size: 1.02em; line-height: 1.6; color: var(--ink); }
.more-body > * + * { margin-top: .85em; }
.more-body ul, .more-body .more-ol { padding-left: 1.2em; display: grid; gap: .45em; }
.more-body li::marker { color: var(--stage-ink); font-weight: 800; }
.more-body .more-tip { background: var(--surface); border-radius: 12px; padding: .7em .9em; font-size: .95em; }
.more-body .more-formula { font-weight: 800; background: var(--surface); border-radius: 12px; padding: .7em .9em; text-align: center; }
table.calc { width: 100%; border-collapse: collapse; font-size: .95em; font-variant-numeric: tabular-nums; }
table.calc th, table.calc td { padding: .45em 0; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
table.calc th { text-align: left; font-weight: 500; color: var(--ink-2); padding-right: 1em; }
table.calc td { text-align: right; font-weight: 700; white-space: nowrap; }
table.calc tr.tot th, table.calc tr.tot td { font-weight: 800; color: var(--ink); border-bottom: 0; }
table.calc tr.tot td { color: var(--stage-ink); }
@media (max-width: 560px) { table.calc td { white-space: normal; } }

/* =================== v6: examen de nivel y lo que te queda =================== */
.band-ex { margin-left: 2px; }
.exam .p-body { display: block; }
.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 1em; font-size: .86em; font-weight: 700; color: var(--ink-3); }
.ex-dots { display: flex; gap: 5px; }
.ex-dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--surface-2); }
.ex-dots i.on { background: var(--stage); }
.ex-dots i.ok { background: var(--stbd); }
.ex-dots i.ko { background: var(--port); }
.exam .q { font-size: 1.12em; line-height: 1.4; font-weight: 800; margin-top: .7em; text-wrap: balance; }
.exam .opts button:disabled { cursor: default; }
.exam .opts button:disabled:not(.ok):not(.ko) { opacity: .6; }
.ex-after { visibility: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7em 1.2em; margin-top: .9em; }
.ex-after.on { visibility: visible; }
.ex-after .fb { flex: 1 1 22em; margin: 0; }
.ex-after .btn svg { width: 16px; height: 16px; }
.ex-end { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1em 1.6em; align-items: start; }
.ex-score { width: 5.4em; height: 5.4em; border-radius: 50%; background: var(--stage); color: #fff; display: grid; place-content: center; text-align: center; line-height: 1; }
.ex-score b { font-size: 2.2em; font-weight: 800; }
.ex-score span { font-size: .85em; opacity: .85; margin-top: .2em; }
.ex-msg { font-size: 1.1em; font-weight: 800; line-height: 1.3; }
.ex-wrong { list-style: none; margin: .7em 0 0; padding: 0; display: grid; gap: .35em; }
.ex-wrong a { display: grid; grid-template-columns: 1.1em minmax(0, 1fr); gap: .5em; color: var(--ink); text-decoration: none; font-size: .9em; line-height: 1.35; }
.ex-wrong a svg { width: 1em; height: 1em; margin-top: .2em; color: var(--stage-ink); }
.ex-wrong a:hover span { text-decoration: underline; }
.ex-best { margin-top: .8em; font-size: .9em; color: var(--ink-2); }
.ex-again { margin-top: .5em; }
@container (max-width: 460px) { .ex-end { grid-template-columns: minmax(0, 1fr); } .ex-dots i { width: 14px; } }
.qd-cmp .cmp-r.ref > span, .qd-cmp .cmp-r.ref > b { color: var(--ink-3); font-weight: 600; }
.qd-cmp .cmp-r.ref .cmp-t i { background: repeating-linear-gradient(45deg, var(--rule) 0 4px, transparent 4px 8px); }
.qd-cmp .cmp-r.win .cmp-t i { background: var(--stage); }
.qd-cmp .cmp-r.win > span, .qd-cmp .cmp-r.win > b { color: var(--ink); }
.qd-cmp .cmp-r { grid-template-columns: minmax(0, 10em) minmax(0, 1fr) 6.4em; }
.pg-grid > .controls { align-content: start; }
@container (max-width: 520px) { .qd-cmp.cmp { gap: .3em; } .qd-cmp .cmp-r { grid-template-columns: minmax(0, 1fr) auto; } }
.more-btn.inline { display: inline-flex; margin: 0 0 0 .35em; vertical-align: .08em; font-size: .74em; padding: 4px 10px 4px 8px; gap: 5px; }
.more-btn.inline svg { width: 14px; height: 14px; }
.band-meta { display: block; line-height: 1.5; }
.band-meta svg { display: inline-block; vertical-align: -2px; margin-right: 4px; }

/* ---------- v8: la sección de Fiscalidad («La aduana») ---------- */
.lv-glyph.lv-4, .lv-glyph.lv-5 { align-items: center; }
.lv-glyph.lv-4 svg, .lv-glyph.lv-5 svg { width: 1.05em; height: 1.05em; color: var(--lv); display: block; }
.nextstage .lv-glyph.lv-4 svg { color: #fff; }
.band.lv-4 { position: relative; }
.band.lv-4 .band-tag { color: var(--lv); text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; }
.band.lv-4::before { content: ""; position: absolute; inset: -1px 0 auto; height: 3px; background: repeating-linear-gradient(90deg, var(--lv) 0 14px, transparent 14px 22px); opacity: .7; }

/* ---------- v8: herramientas del principiante ---------- */
.cmp .cmp-r.ref > span, .cmp .cmp-r.ref > b { color: var(--ink-3); font-weight: 600; }
.cmp .cmp-r.ref .cmp-t i { background: repeating-linear-gradient(45deg, var(--rule) 0 4px, transparent 4px 8px); }
.cmp-r.neg .cmp-t i { background: color-mix(in oklab, var(--c2) 55%, var(--surface-2)); }
.cmp-r.neg > b { color: var(--port); }

/* ---------- escenas: ejemplos animados junto al texto ---------- */
.ill.scenes { grid-template-columns: minmax(0, 1fr); }
.ill.scenes figure.scene { display: flex; flex-direction: column; width: 100%; box-sizing: border-box; padding: 1.05em 1.3em 1.1em; }
.scene .p-top { align-items: center; }
.scene .p-top h3 { font-size: 1.02em; font-weight: 800; line-height: 1.28; }
.scene-replay { width: 34px; height: 34px; border-radius: 10px; color: var(--ink-3); margin: -6px -6px -6px 0; }
.scene-replay:hover, .scene-replay:focus-visible { background: var(--surface-2); color: var(--ink); }
.scene-replay svg { width: 18px; height: 18px; }
.scene-sub { margin: .35em 0 0; font-size: .88em; line-height: 1.45; color: var(--ink-2); }
.scene-host { position: relative; width: 100%; margin-top: .8em; }
.ill.scenes .scene-host > svg.scene-svg { display: block; width: 100%; height: auto; max-height: none; margin-inline: auto; overflow: visible; }
.scene-note { margin: .6em 0 0; font-size: .78em; line-height: 1.4; color: var(--ink-3); }
.scene-host .dot { opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center; transition: opacity .25s ease-out, transform .45s cubic-bezier(.2, .9, .3, 1.35); transition-delay: var(--d, 0ms); }
.scene-host .leg { opacity: 0; transition: opacity .45s ease-out; transition-delay: var(--d, 0ms); }
.scene-host.go .dot, .scene-host.go .leg, .scene-host.still .dot, .scene-host.still .leg { opacity: 1; transform: none; }
.scene-host.still .dot, .scene-host.still .leg { transition: none; }
@media (prefers-reduced-motion: reduce) { .scene-host .dot, .scene-host .leg { transition: none; } }
@media (max-width: 759px) {
  .ill.scenes figure.scene { display: flex; align-items: stretch; padding: .9em 1em 1em; }
  .ill.scenes figcaption { font-size: 1em; }
  .scene-sub { font-size: .84em; }
}

/* ---------- vistazo: otra lección encima, sin salir del paso ---------- */
.peek { position: fixed; inset: 0; z-index: 90; }
.peek-scrim { position: absolute; inset: 0; background: rgba(8, 14, 24, .42); opacity: 0; transition: opacity .24s; }
.peek-card { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 94vw); background: var(--bg); color: var(--ink); display: flex; flex-direction: column; box-shadow: -18px 0 50px rgba(0, 0, 0, .22); transform: translateX(104%); transition: transform .28s var(--ease-out); padding-top: var(--safe-t); }
.peek.on .peek-scrim { opacity: 1; }
.peek.on .peek-card { transform: none; }
.peek-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 24px; border-bottom: 1px solid var(--rule); }
.peek-where { display: inline-flex; align-items: center; gap: 9px; font-size: .9rem; font-weight: 700; color: var(--ink-2); min-width: 0; }
.peek-where i { width: 11px; height: 11px; border-radius: 4px; flex: none; }
.peek-where span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 26px; font-size: 1rem; }
.peek-txt h2 { font-size: 1.6em; line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.peek-txt > p:not([class]) { margin-top: .8em; line-height: 1.58; color: var(--ink-2); }
.peek-txt .points { margin-top: 1em; }
.peek-txt table { width: 100%; }
.peek-more { margin-top: 1.2em; font-size: .9em; color: var(--ink-3); }
.peek-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--rule); }
.peek-foot .btn { padding: 11px 18px; font-size: .98rem; }
@media (max-width: 759px) {
  .peek-card { top: auto; left: 0; width: auto; max-height: 86dvh; border-radius: 22px 22px 0 0; transform: translateY(104%); box-shadow: 0 -18px 50px rgba(0, 0, 0, .22); padding-top: 0; }
  .peek-body { padding: 18px 18px 22px; }
  .peek-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .peek-card, .peek-scrim { transition: none; } }
/* «Volver a…» en la barra de la lección, en lugar del título */
.l-ret { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 46%; flex: 0 1 auto; padding: 6px 12px 6px 9px; border-radius: 99px; background: rgba(255, 255, 255, .95); color: var(--stage-ink, var(--stage)); font-size: .88rem; font-weight: 700; text-decoration: none; line-height: 1.2; }
.l-ret svg { width: 16px; height: 16px; flex: none; }
.l-ret span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-ret b { font-weight: 800; }
.l-ret:hover { background: #fff; }
.lbar.has-ret #l-title { display: none; }
@media (max-width: 759px) { .l-ret { max-width: 100%; align-self: flex-start; padding-block: 4px; font-size: .84rem; } }

/* =================== v15: portada «Aprende viendo» + la carta náutica =================== */
:root { --sea0: #F1E6C8; --sea1: #CDEBE6; --sea2: #BFD6EE; --sea3: #1B3F66; --sea4: #0B2140; --contour: #5F86AE; --beam: #FFE39A; --sand: #EAD9B0; --sand-2: #F4E9CC; --pier: #9B7449; --roof: #B6452C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sea0: #1F3A3A; --sea1: #193640; --sea2: #1C3350; --sea3: #0F2236; --sea4: #07121F; --contour: #6D90B6; --beam: #FFE39A; --sand: #3E3628; --sand-2: #4A4130; --pier: #7C6040; --roof: #9A3E2A; } }
:root[data-theme="dark"] { --sea0: #1F3A3A; --sea1: #193640; --sea2: #1C3350; --sea3: #0F2236; --sea4: #07121F; --contour: #6D90B6; --beam: #FFE39A; --sand: #3E3628; --sand-2: #4A4130; --pier: #7C6040; --roof: #9A3E2A; }

/* titular: la promesa a la izquierda, una lección de muestra a la derecha */
.hm-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 32px 60px; align-items: center; padding-block: clamp(36px, 5.5vw, 76px) clamp(28px, 4vw, 52px); }
.hm-txt h1 { font-size: clamp(2.4rem, 4.6vw, 4rem); line-height: 1.01; font-weight: 850; letter-spacing: -0.032em; text-wrap: balance; }
.hm-lead { margin-top: 18px; font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.hm-go { margin-top: 28px; display: grid; gap: 12px; justify-items: start; }
.hm-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.hm-go .btn-main { background: var(--c, var(--stage)); }
.hm-go .btn-main:hover svg { transform: translateX(3px); }
.hm-note { color: var(--ink-3); font-size: .95rem; line-height: 1.45; max-width: 32em; }
.hm-note b { color: var(--ink); font-weight: 700; }
.hm-prog { justify-self: stretch; max-width: 32em; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.hm-go .bar { flex: 1 1 12em; min-width: 8em; margin: 0; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
/* empezar de cero: discreto, pero con forma de botón */
.reset { display: inline-flex; align-items: center; }
.reset[hidden] { display: none; }
.reset.asking { flex: 1 1 100%; }
.rs-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg); color: var(--ink-3); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; transition: color .15s, border-color .15s, background-color .15s; }
.rs-btn svg { width: 14px; height: 14px; transition: transform .45s var(--ease-out); }
.rs-btn:hover, .rs-btn:focus-visible { color: var(--port); border-color: color-mix(in oklab, var(--port) 45%, var(--rule)); background: var(--port-wash); }
.rs-btn:hover svg { transform: rotate(-200deg); }
.rs-btn:focus-visible { outline: 2px solid var(--port); outline-offset: 2px; }
.reset-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--port-wash); border: 1px solid color-mix(in oklab, var(--port) 30%, transparent); font-size: .88rem; color: var(--ink); animation: rs-in .25s var(--ease-out); }
.reset-ask[hidden] { display: none; }
.rs-q { font-weight: 700; margin-right: auto; }
.rs-yes, .rs-no { height: 30px; padding: 0 12px; border-radius: 999px; font: inherit; font-size: .84rem; font-weight: 800; cursor: pointer; border: 0; }
.rs-yes { background: var(--port); color: var(--on-solid); }
.rs-yes:hover { background: color-mix(in oklab, var(--port) 85%, #000); }
.rs-no { background: transparent; color: var(--ink-2); }
.rs-no:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 7%, transparent); }
@keyframes rs-in { from { opacity: 0; transform: translateY(-4px); } }
.hm-go .bar i { display: block; height: 100%; background: var(--c, var(--stage)); border-radius: 3px; }
.hm-demo { display: grid; position: relative; }
.hm-demo > .hm-demo-i { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .45s var(--ease-out), transform .45s var(--ease-out), visibility 0s .45s; }
.hm-demo > .hm-demo-i.on { opacity: 1; visibility: visible; transform: none; transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }
.hm-demo .ill.scenes figure.scene { height: 100%; box-shadow: 0 24px 60px color-mix(in oklab, var(--ink) 9%, transparent); border-radius: 22px; }
.hm-demo .scene-host > svg.scene-svg { display: block; width: 100%; height: auto; }
.hm-src { margin-top: auto; padding-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 700; color: var(--ink-3); text-decoration: none; align-self: flex-start; }
.hm-src svg { width: 14px; height: 14px; transition: transform .2s; }
.hm-src:hover { color: var(--ink); } .hm-src:hover svg { transform: translateX(3px); }
.hm-demo-nav { grid-area: 2 / 1; display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.hm-demo-nav button { width: 30px; height: 6px; border-radius: 3px; border: 0; padding: 0; background: var(--rule); cursor: pointer; transition: background-color .2s, width .3s var(--ease-out); }
.hm-demo-nav button[aria-current] { width: 46px; background: var(--c, var(--stage)); }
.hm-demo-nav button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.hm-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 18px; }
.hm-sec-head h2 { font-size: clamp(1.55rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: -0.02em; }
.hm-sec-head p { color: var(--ink-3); font-size: .98rem; }

/* herramientas */
.hm-tools { padding-top: clamp(44px, 5.5vw, 72px); scroll-margin-top: 10px; }
.hm-tgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.hm-tgroup h3 { display: flex; align-items: center; gap: 9px; font-size: 1rem; font-weight: 800; padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.hm-tgroup ul { list-style: none; margin: 0; padding: 0; }
.hm-tgroup a { display: block; padding: 10px 0; border-bottom: 1px solid var(--rule-2); text-decoration: none; color: var(--ink); }
.hm-tgroup a b { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: .96rem; line-height: 1.3; }
.hm-tgroup a b::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex: none; }
.hm-tgroup a span { display: block; color: var(--ink-3); font-size: .85rem; line-height: 1.4; margin-top: 2px; padding-left: 16px; }
.hm-tgroup a:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.hm-end { padding-block: clamp(40px, 5vw, 64px) 30px; display: grid; gap: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .home-in .hm-txt > *, .home-in .hm-demo { animation: riseIn .7s var(--ease-out) both; }
  .home-in .hm-lead { animation-delay: .06s; }
  .home-in .hm-go { animation-delay: .12s; }
  .home-in .hm-demo { animation-delay: .16s; }
}
@media (max-width: 860px) {
  .hm-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) { .hm-tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .hm-tgrid { grid-template-columns: minmax(0, 1fr); }
  .hm-btns .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 600px) { .hm-tgroup a span { display: none; } .hm-tgroup a { padding: 9px 0; } }
.hm-demo .scene-host { margin-block: auto; }
.hm-demo .hm-src { margin-top: 0; }

/* =================== v16: la travesía es el índice =================== */
.hm-trip { padding-top: clamp(40px, 5vw, 64px); scroll-margin-top: 10px; }
.strips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.strip { border-radius: 22px; padding: 20px 16px 16px; display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 10px; --ink-s: var(--ink); --ink-s2: var(--ink-2); --ink-s3: var(--ink-3); --line: color-mix(in oklab, var(--ink) 30%, transparent); --row: color-mix(in oklab, var(--bg) 72%, transparent); }
.strip.lv-1 { background: linear-gradient(180deg, var(--sea0), var(--sea1)); }
.strip.lv-2 { background: linear-gradient(180deg, var(--sea1), var(--sea2)); }
.strip.lv-3 { background: linear-gradient(180deg, var(--sea3), var(--sea4)); --ink-s: #fff; --ink-s2: rgba(255, 255, 255, .86); --ink-s3: rgba(255, 255, 255, .64); --line: rgba(255, 255, 255, .34); --row: rgba(255, 255, 255, .1); }
.strip.lv-4 { background: var(--bg); border: 2px dashed color-mix(in oklab, var(--lv4) 35%, var(--rule)); }
/* los vientos: economía, una franja de cielo a todo el ancho, debajo del mar */
.strip.lv-5 { grid-column: 1 / -1; background: linear-gradient(90deg, color-mix(in oklab, var(--lv5) 10%, var(--bg)), color-mix(in oklab, var(--lv5) 4%, var(--bg))); border: 1px solid color-mix(in oklab, var(--lv5) 22%, var(--rule)); }
@media (min-width: 900px) {
  .strip.lv-5 .strip-h { grid-template-columns: auto minmax(0, 1fr) minmax(14em, 22em); column-gap: 18px; align-items: center; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid color-mix(in oklab, var(--lv5) 16%, transparent); }
  .strip.lv-5 .strip-h .strip-name { grid-column: 1; grid-row: 1 / span 2; }
  .strip.lv-5 .strip-h .strip-tag { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .strip.lv-5 .strip-h .band-meta { grid-column: 3; grid-row: 1; text-align: right; }
  .strip.lv-5 .strip-h .band-bar { grid-column: 3; grid-row: 2; }
  .strip.lv-5 .strip-st { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 0 18px; }
  .strip.lv-5 .strip-st::before { display: none; }
  .strip.lv-5 .strip-st li.st-part { padding-left: 6px; padding-top: 6px; border-bottom: 1px dashed color-mix(in oklab, var(--lv5) 22%, transparent); padding-bottom: 6px; margin-bottom: 4px; }
  .strip.lv-5 .strip-foot { display: none; }
}
.strip-h { display: grid; gap: 4px; padding: 0 4px 6px; color: var(--ink-s); }
.strip-name { display: flex; align-items: center; gap: 9px; }
.strip-name .lv-glyph { font-size: 1.1rem; }
.strip.lv-3 .lv-glyph b { background: rgba(255, 255, 255, .3); }
.strip.lv-3 .lv-glyph.lv-3 b { background: #fff; }
.strip-name h3 { font-size: 1.28rem; font-weight: 800; letter-spacing: -0.015em; color: var(--ink-s); }
.strip-zone { margin-left: auto; font-size: .82rem; font-weight: 700; color: var(--ink-s3); }
.strip-tag { font-weight: 700; font-size: .95rem; color: var(--ink-s2); line-height: 1.3; }
.strip .band-meta { margin-top: 4px; color: var(--ink-s3); font-size: .84rem; }
.strip .band-meta b { color: var(--ink-s); }
.strip .band-bar { margin-top: 2px; background: color-mix(in oklab, var(--ink-s) 12%, transparent); height: 5px; }
.strip.lv-3 .band-bar i { background: #fff; }
.strip-st { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; position: relative; }
.strip-st::before { content: ""; position: absolute; left: 19px; top: 18px; bottom: 18px; border-left: 2px dotted var(--line); }
.strip:not(.open) .strip-st li.fold:not(.st-part) { display: none; }
/* tramos: cada nivel en dos o tres partes; las que no tocan se ven plegadas, como una línea de resumen */
.strip-st li.st-part { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 8px 3px 44px; font-size: .8rem; font-weight: 800; color: var(--ink-s); letter-spacing: .01em; }
.strip-st li.st-part:first-child { padding-top: 2px; }
.strip-st li.st-part small { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.strip-st li.st-part small svg { width: 12px; height: 12px; }
.strip:not(.open) .strip-st li.st-part.fold { color: var(--ink-s2); }
.strip-st small.new { color: color-mix(in oklab, var(--c) 78%, var(--ink)); font-weight: 800; }
.strip.lv-3 .strip-st small.new { color: #fff; }
.strip-st a { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 8px 5px 4px; border-radius: 12px; text-decoration: none; color: var(--ink-s2); font-size: .93rem; line-height: 1.28; transition: background-color .15s, color .15s; }
.strip-st a:hover { background: var(--row); color: var(--ink-s); }
.buoy { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--bg); color: color-mix(in oklab, var(--c) 80%, var(--ink)); box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--c) 55%, var(--bg)); position: relative; z-index: 1; }
.strip.lv-3 .buoy { background: var(--sea4); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.buoy svg { width: 15px; height: 15px; }
.done .buoy { background: var(--c); color: #fff; box-shadow: none; }
.strip.lv-3 .done .buoy { background: #fff; color: var(--sea4); }
.now a { background: var(--bg); color: var(--ink); font-weight: 750; box-shadow: 0 8px 22px rgba(10, 27, 46, .14); }
.strip.lv-3 .now a { background: #fff; color: #0A1B2E; }
.now .buoy { background: var(--c); color: #fff; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }
.now .buoy .boat { width: 17px; height: 15px; }
.strip-st small { font-size: .76rem; color: var(--ink-s3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-go { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; font-weight: 800; color: color-mix(in oklab, var(--c) 80%, #0A1B2E); white-space: nowrap; }
.st-go svg { width: 14px; height: 14px; transition: transform .2s; }
.now a:hover .st-go svg { transform: translateX(3px); }
.strip-foot:empty { display: none; }
.strip-foot { padding: 4px 4px 0; }
.strip .hm-more { font-size: .85rem; color: var(--ink-s3); }
.strip .hm-more:hover { color: var(--ink-s); }
@media (prefers-reduced-motion: no-preference) {
  .now .buoy .boat { animation: mapBob 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
}
.hm-tmore { display: none; margin-top: 6px; font-size: .86rem; color: var(--ink-3); }
@media (max-width: 1080px) { .strips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  /* en el móvil, las tres franjas forman un solo mar que se oscurece al bajar; la aduana, aparte */
  .strips { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .strip { border-radius: 0; padding: 18px 12px 14px; }
  .strip.lv-1 { border-radius: 20px 20px 0 0; }
  .strip.lv-3 { border-radius: 0 0 20px 20px; }
  .strip.lv-4 { border-radius: 20px; margin-top: 14px; }
  .hm-tgroup:not(.open) li:nth-child(n + 4) { display: none; }
  .hm-tmore { display: inline-flex; }
}
@keyframes mapBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-2px) rotate(3deg); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .strip:not(.lv-3) .st-go { color: color-mix(in oklab, var(--c) 55%, #fff); } }
:root[data-theme="dark"] .strip:not(.lv-3) .st-go { color: color-mix(in oklab, var(--c) 55%, #fff); }

/* ---------- «¿Está cayendo la bolsa?»: la guía de la tormenta, a la vista ---------- */
.storm-band { padding-top: clamp(26px, 3.5vw, 44px); }
.storm-in { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px 32px; align-items: center; padding: clamp(22px, 3vw, 34px) clamp(20px, 3vw, 36px); border-radius: 24px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #334155 0%, #1E293B 45%, #0F172A 100%); box-shadow: 0 22px 50px rgba(15, 23, 42, .28); }
.storm-sky svg { width: clamp(78px, 9vw, 112px); height: auto; display: block; overflow: visible; }
.sb-cloud { fill: #CBD5E1; }
.sb-bolt { fill: #FACC15; }
.sb-rain line { stroke: #94A3B8; stroke-width: 2.4; stroke-linecap: round; }
.storm-txt h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 850; letter-spacing: -0.02em; line-height: 1.08; color: #fff; }
.storm-txt p { margin-top: 8px; color: #CBD5E1; line-height: 1.5; max-width: 30em; }
.storm-go { margin-top: 16px; background: #FACC15; color: #0F172A; }
.storm-go:hover { filter: brightness(1.05); }
.storm-go:hover svg { transform: translateX(3px); }
.storm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.storm-steps a { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 12px; border-radius: 14px; background: rgba(255, 255, 255, .07); color: #E2E8F0; text-decoration: none; font-size: .86rem; line-height: 1.35; transition: background-color .15s; height: 100%; }
.storm-steps a:hover { background: rgba(255, 255, 255, .13); }
.storm-steps i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .8rem; background: rgba(250, 204, 21, .16); color: #FACC15; }
.storm-steps b { display: block; color: #fff; font-size: .95rem; margin-bottom: 2px; }
.nav-storm svg { color: #CA8A04; }
@media (prefers-reduced-motion: no-preference) {
  .sb-cloud { animation: mapCloud 6s ease-in-out infinite alternate; transform-box: fill-box; }
  .sb-bolt { animation: mapBolt 4.5s steps(1) infinite; }
  .sb-rain line { stroke-dasharray: 5 9; animation: sbRain .9s linear infinite; }
}
@keyframes sbRain { to { stroke-dashoffset: -14; } }
@keyframes mapCloud { from { transform: translateX(-4px); } to { transform: translateX(5px); } }
@keyframes mapBolt { 0%, 84%, 90%, 100% { opacity: 0; } 86%, 94% { opacity: 1; } }
@media (max-width: 1080px) { .storm-in { grid-template-columns: auto minmax(0, 1fr); } .storm-steps { grid-column: 1 / -1; } }
@media (max-width: 600px) {
  .storm-in { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; }
  .storm-sky { position: absolute; right: 14px; top: 14px; opacity: .9; }
  .storm-sky svg { width: 70px; }
  .storm-txt h2 { padding-right: 78px; }
  .storm-go { width: 100%; justify-content: center; }
  .storm-steps { grid-template-columns: minmax(0, 1fr); }
  .storm-steps a { padding: 9px 10px; }
}

/* ---------- pie de página ---------- */
.foot { margin-top: clamp(48px, 6vw, 80px); --f-bg: #0B1726; --f-ink: #F1F5F9; --f-ink2: #B6C2D1; --f-ink3: #7F8FA4; --f-rule: rgba(255, 255, 255, .1); }
.foot-wave { display: block; width: 100%; height: 28px; }
.foot-wave path { fill: var(--f-bg); }
.foot-in { background: var(--f-bg); color: var(--f-ink2); padding-block: clamp(28px, 4vw, 48px) calc(28px + var(--safe-b)); margin-top: -1px; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.85fr); gap: 32px 56px; padding-bottom: 30px; border-bottom: 1px solid var(--f-rule); }
.foot-word { display: inline-flex; align-items: center; gap: 10px; color: var(--f-ink); text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em; }
.foot-word svg { width: 30px; height: 30px; color: #4F7FE0; }
.foot-claim { margin-top: 12px; color: var(--f-ink); font-size: 1.05rem; line-height: 1.45; max-width: 26em; }
.foot-url { margin-top: 6px; font-weight: 800; font-size: .95rem; letter-spacing: .01em; }
.foot-url a { color: var(--f-ink); text-decoration: none; border-bottom: 2px solid color-mix(in oklab, var(--f-ink) 35%, transparent); }
.foot-url a:hover { border-bottom-color: currentColor; }
.foot-by { margin-top: 14px; color: var(--f-ink2); }
.foot-by b { color: var(--f-ink); font-weight: 800; }
.foot-indep { margin-top: 6px; font-size: .9rem; line-height: 1.5; color: var(--f-ink3); max-width: 30em; }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-cols h3 { font-size: .95rem; font-weight: 800; color: var(--f-ink); margin-bottom: 10px; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .93rem; }
.foot a, .foot-link { color: var(--f-ink2); text-decoration: none; }
.foot-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.foot-link svg { width: 14px; height: 14px; }
.foot a:hover, .foot-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.foot-link.danger { color: #FCA5A5; }
.foot-thanks { margin-top: 12px; font-size: .84rem; line-height: 1.45; color: var(--f-ink3); }
.foot-legal { margin-top: 22px; font-size: .82rem; line-height: 1.55; color: var(--f-ink3); max-width: 90ch; }
.foot-bottom { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; font-size: .84rem; color: var(--f-ink3); }
@media (max-width: 900px) { .foot-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-cols > div:first-child { grid-column: 1 / -1; }
  .foot-cols > div:first-child ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hm-txt h1 { font-size: clamp(2.2rem, 3.7vw, 3.4rem); }
.top nav svg { flex: none; }
@media (max-width: 560px) { .top nav a[href="#niveles"] { display: none; } }

/* tablas de datos en el móvil: caben de un vistazo */
@media (max-width: 759px) {
  table.data { font-size: .8em; }
  table.data th, table.data td { padding: 6px 5px; text-align: center; }
  table.data th:first-child, table.data td:first-child { text-align: center; }
  table.data thead th { white-space: normal; vertical-align: bottom; line-height: 1.2; font-size: .92em; }
  table.data td, table.data tbody th { white-space: normal; line-height: 1.25; }
  table.data.wide { font-size: .72em; }
  table.data.wide th, table.data.wide td { padding: 5px 3px; }
}

/* ---------- progreso: novedades y tramos en el menú ---------- */
.hm-new { margin-top: 10px; font-size: .9rem; line-height: 1.45; color: var(--ink-2); max-width: 32em; }
.hm-new b { color: var(--ink); }
.d-part { padding: 12px 10px 2px 51px; font-size: .78rem; font-weight: 800; color: var(--ink-3); }
.d-stages .d-part:first-child { padding-top: 4px; }
.d-stages small.new, .d-steps small.new { color: var(--stage-ink, var(--stage)); font-weight: 800; }
.d-stages a small.new { color: color-mix(in oklab, var(--c) 80%, var(--ink)); }

/* =====================================================================
   Herramientas con página propia (#/herramientas, #/h/<id>)
   Cada herramienta es una pregunta con su respuesta. En su página, la calculadora es una frase:
   cada cifra es un botón que lleva su control al editor de la derecha (abajo, en el móvil).
   ===================================================================== */
.tview { min-height: 100dvh; background: var(--bg); --tc: var(--stage); --navy: #0A1B2E; --hero-bg: var(--tc); }
.tview.t-index .t-all { color: var(--ink); background: var(--surface); }
.t-main { outline: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tview { --navy: #0D1F33; --hero-bg: color-mix(in oklab, var(--tc) 70%, #0B1220); } }
:root[data-theme="dark"] .tview { --navy: #0D1F33; --hero-bg: color-mix(in oklab, var(--tc) 70%, #0B1220); }

/* ---------- índice ---------- */
.ti-hero { background: var(--navy); color: #fff; }
.ti-hero .wrap { display: grid; gap: 26px; padding-block: clamp(34px, 5vw, 56px) clamp(34px, 5vw, 60px); }
.ti-head h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance; }
.ti-head p { margin-top: 12px; font-size: 1.12rem; line-height: 1.5; color: #B9C6D8; max-width: 38em; }
.ti-sofar { border-radius: 26px; padding: 24px 28px 22px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.ti-sofar h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; color: #9FE7C7; }
.ti-sofar h2 svg { width: 17px; height: 17px; }
.ti-sofar p { margin-top: 10px; font-size: clamp(1.2rem, 2.1vw, 1.65rem); line-height: 1.5; letter-spacing: -0.012em; color: rgba(255, 255, 255, .86); max-width: 44em; }
.ti-sofar.is-empty p { margin-top: 0; font-size: clamp(1.1rem, 1.8vw, 1.35rem); }
.ti-sofar p b { color: #fff; font-weight: 800; box-shadow: inset 0 -3px 0 color-mix(in oklab, var(--tc) 50%, #fff); }
.ti-blank { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 10px; border: 2px dashed rgba(255, 255, 255, .42); color: #fff; font-weight: 700; font-size: .78em; line-height: 1.6; vertical-align: .08em; text-decoration: none; transition: background-color .15s, border-color .15s; }
.ti-blank svg { width: .9em; height: .9em; }
.ti-blank:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.ti-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 20px; }
.ti-btn { background: #fff; color: var(--navy); }
.ti-btn:hover { background: #E8EEF6; }
.ti-btn svg { width: 18px; height: 18px; }
.ti-act small { color: #9FB1C7; font-size: .92rem; }
.ti-list { padding-block: 16px clamp(56px, 7vw, 88px); }
.ti-grp { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 40px; padding-top: clamp(26px, 3.5vw, 40px); }
.ti-grp > h2 { position: sticky; top: 20px; align-self: start; padding-top: 20px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.ti-grp > h2 small { display: block; margin-top: 5px; font-size: .95rem; font-weight: 600; letter-spacing: 0; color: var(--ink-3); line-height: 1.4; }
.ti-qs { display: grid; }
.ti-q { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 10px 32px; align-items: center; padding: 20px; margin-inline: -20px; border-radius: 22px; color: var(--ink); text-decoration: none; transition: background-color .2s; }
.ti-q + .ti-q { box-shadow: 0 -1px 0 var(--rule-2); }
.ti-q:hover, .ti-q:focus-visible { background: color-mix(in oklab, var(--tc) 8%, var(--bg)); box-shadow: none; }
.ti-q:hover + .ti-q { box-shadow: none; }
.ti-qt h3 { display: flex; align-items: flex-start; gap: 12px; font-size: clamp(1.25rem, 2vw, 1.55rem); font-weight: 800; letter-spacing: -0.022em; line-height: 1.18; text-wrap: balance; }
.ti-qt h3 svg { flex: none; width: 26px; height: 26px; margin-top: 1px; color: color-mix(in oklab, var(--tc) 85%, var(--ink)); }
.ti-qt p { margin-top: 8px; padding-left: 38px; font-size: 1.04rem; line-height: 1.5; color: var(--ink-2); }
.ti-qt p b { color: var(--ink); font-weight: 800; }
.ti-qt p b.is-bad { color: var(--port); }
.ti-qt p b.is-good { color: var(--stbd); }
.ti-fig { justify-self: end; display: grid; justify-items: end; gap: 4px; text-align: right; }
.ti-fig small { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 800; color: var(--ink-3); }
.ti-fig small svg { width: 13px; height: 13px; }
.ti-fig small.mine { color: var(--stbd); }
.ti-fig strong { font-size: clamp(1.7rem, 2.6vw, 2.25rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1.02; color: color-mix(in oklab, var(--tc) 74%, var(--ink)); font-variant-numeric: tabular-nums; }
.ti-fig strong.is-bad { color: var(--port); }
.ti-fig strong.txt { font-size: clamp(1.35rem, 2vw, 1.6rem); letter-spacing: -0.025em; }
.ti-fig strong.is-good { color: var(--stbd); }
.ti-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .9rem; color: var(--ink); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s var(--ease-out); }
.ti-go svg { width: 16px; height: 16px; color: var(--tc); }
.ti-q:hover .ti-go, .ti-q:focus-visible .ti-go { opacity: 1; transform: none; }

/* ---------- la herramienta: pregunta, frase y respuesta ---------- */
.th { background: var(--hero-bg); color: #fff; }
.th .wrap { padding-block: 22px clamp(30px, 4vw, 44px); }
.th-back { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: .95rem; color: rgba(255, 255, 255, .86); text-decoration: none; }
.th-back:hover { color: #fff; }
.th-back svg { width: 16px; height: 16px; }
.th-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 44px; align-items: end; margin-top: 16px; }
.th.has-edit .th-grid { grid-template-columns: minmax(0, 1fr) 340px; }
.th-say h1 { font-size: clamp(2.1rem, 4vw, 3.3rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; text-wrap: balance; }
.th-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, .18); }
.th-tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font: 700 .94rem var(--f-body); color: rgba(255, 255, 255, .85); cursor: pointer; }
.th-tabs button:hover { color: #fff; }
.th-tabs button[aria-selected="true"] { background: #fff; color: color-mix(in oklab, var(--tc) 80%, #000); }
.th-sent { margin-top: 20px; max-width: 32em; font-size: clamp(1.3rem, 2.3vw, 1.85rem); line-height: 1.62; letter-spacing: -0.012em; font-weight: 500; color: rgba(255, 255, 255, .9); }
.th-intro { margin-top: 14px; max-width: 40em; font-size: 1.12rem; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.th-chip { display: inline-flex; align-items: center; gap: .3em; margin: 0 .06em; padding: 0 .4em; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .15); box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .55); color: #fff; font: inherit; font-weight: 800; line-height: 1.34; font-variant-numeric: tabular-nums; cursor: pointer; vertical-align: baseline; transition: background-color .15s, color .15s; -webkit-user-select: none; user-select: none; }
.th-chip svg { width: .6em; height: .6em; opacity: .75; }
.th-chip:hover { background: rgba(255, 255, 255, .26); }
.th-chip.on { background: #fff; color: color-mix(in oklab, var(--tc) 85%, #000); box-shadow: none; }
.th-edit { align-self: end; padding: 20px 20px 18px; border-radius: 22px; background: var(--bg); color: var(--ink); box-shadow: 0 24px 60px rgba(10, 27, 46, .32); }
.th-edit .ctl { font-size: 16px; }
.th-edit .seg-wrap .lab { font-weight: 700; }
.th-edit .ctl-top output, .th-edit .ctl-top label { font-size: 1.02rem; }
.th-help { margin-top: 12px; font-size: .92rem; line-height: 1.45; color: var(--ink-3); }
.th-help:empty { display: none; }
.th-tip { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule-2); font-size: .86rem; font-weight: 700; color: var(--ink-2); }
.th-ok { display: none; }
.th-ans { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 32px; align-items: end; margin-top: 26px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .24); }
.th-ans strong { font-size: clamp(2.8rem, 6.5vw, 5.2rem); font-weight: 900; letter-spacing: -0.05em; line-height: .92; color: #fff; font-variant-numeric: tabular-nums; }
.th-ans p { max-width: 30em; font-size: 1.18rem; line-height: 1.5; color: rgba(255, 255, 255, .88); }
.th-ans p b { color: #fff; font-weight: 800; }
.th-ans p a { color: #fff; }
/* lo que queda debajo: el gráfico y el resto de la herramienta */
.tb { padding-block: clamp(22px, 3vw, 34px) clamp(56px, 7vw, 80px); }
.t-stage { display: grid; }
.t-stage > .panel { font-size: 16.5px; }
.t-stage .t-open { display: none; }
.t-stage .t-chipped, .t-stage .t-inhero { display: none; }
.t-stage .controls:not(:has(> :not(.t-chipped))) { display: none; }
.t-reset { margin-top: 12px; }
.t-reset .btn-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 600; font-size: .9rem; text-decoration: none; }
.t-reset .btn-link svg { width: 16px; height: 16px; }
.t-reset .btn-link:hover { color: var(--ink); }
.tb-notes { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .9fr); gap: 24px 36px; align-items: start; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--rule); }
.tb-notes h2 { font-size: 1.02rem; font-weight: 800; margin-bottom: 10px; }
.tb-notes ul { margin: 0; padding-left: 1.1em; display: grid; gap: 7px; color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.tb-notes li::marker { color: var(--tc); }
.tb-lesson { display: grid; gap: 3px; padding: 18px; border-radius: 20px; background: color-mix(in oklab, var(--lc) 9%, var(--bg)); color: var(--ink); text-decoration: none; transition: background-color .15s; }
.tb-lesson:hover { background: color-mix(in oklab, var(--lc) 15%, var(--bg)); }
.tb-lesson small { font-size: .84rem; font-weight: 700; color: var(--ink-3); }
.tb-lesson b { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; }
.tb-lesson b svg { flex: none; width: 18px; height: 18px; color: color-mix(in oklab, var(--lc) 85%, var(--ink)); transition: transform .15s; }
.tb-lesson:hover b svg { transform: translateX(3px); }
.tb-lesson span { font-size: .9rem; color: var(--ink-2); }
.tb-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-top: 30px; padding: 24px 28px; border-radius: 26px; background: var(--navy); color: #fff; text-decoration: none; }
.tb-next small { font-size: .9rem; font-weight: 800; color: #9FB1C7; }
.tb-next b { display: block; margin-top: 2px; font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.tb-next i { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--navy); transition: transform .2s var(--ease-out); }
.tb-next i svg { width: 22px; height: 22px; }
.tb-next:hover i { transform: translateX(4px); }
@media (max-width: 980px) {
  .ti-grp { grid-template-columns: minmax(0, 1fr); }
  .ti-grp > h2 { position: static; padding-top: 0; margin-bottom: 6px; }
  .th.has-edit .th-grid { grid-template-columns: minmax(0, 1fr); }
  /* en pantallas estrechas el editor sube desde abajo al tocar una cifra */
  .th-edit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-radius: 24px 24px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); box-shadow: 0 -18px 50px rgba(10, 27, 46, .35); transform: translateY(105%); visibility: hidden; transition: transform .28s var(--ease-out), visibility 0s .28s; }
  .th-edit::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--rule); margin: 0 auto 14px; }
  .th-edit.open { transform: none; visibility: visible; transition: transform .28s var(--ease-out); }
  .th-edit .th-tip { display: none; }
  .th-ok { display: flex; justify-content: center; width: 100%; margin-top: 14px; background: var(--tc); color: #fff; }
  .tb-notes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .ti-sofar { padding: 18px 18px 18px; border-radius: 20px; }
  .ti-q { grid-template-columns: minmax(0, 1fr); padding: 18px 14px; margin-inline: -14px; }
  .ti-qt p { padding-left: 0; font-size: 1rem; }
  .ti-fig { justify-self: start; justify-items: start; text-align: left; grid-auto-flow: column; align-items: baseline; gap: 12px; }
  .ti-go { display: none; }
  .th-ans { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .th-ans p { font-size: 1.05rem; }
  .t-stage > .panel { font-size: 15.5px; padding: .9em 1em 1em; border-radius: 18px; }
  .tb-next { padding: 20px; }
  .tview .top nav .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { .th-edit, .ti-go, .tb-next i { transition: none; } }
/* en las lecciones: abrir la herramienta en su página */
.p-top .t-open { margin-left: auto; flex: none; width: 28px; height: 28px; margin-block: -6px; border-radius: 8px; color: var(--ink-3); }
.p-top .t-open:hover { background: var(--surface); color: var(--ink); }
.p-top .t-open svg { width: 16px; height: 16px; }
.p-top .p-info-btn + .t-open { margin-left: 6px; }
/* euros de cada fondo en «Tu cartera» */
.cx-eur { display: block; font-style: normal; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

/* en el móvil, mantener el dedo sobre un gráfico no debe seleccionar texto ni abrir el menú de copiar */
.chart-host, svg.chart, .scene-host, .vmatrix, .seg, .chips, .years-strip, .controls, .facesw, .th-tabs, .rowpick, .bunting-wrap, .heat { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ---------- portada: una pregunta respondida en una frase que se toca, y el resto de preguntas ---------- */
.hm-tools.eh { --navy: #0A1B2E; margin-top: clamp(44px, 5.5vw, 72px); padding-block: clamp(48px, 6vw, 84px); background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hm-tools.eh { --navy: #0D1F33; } }
:root[data-theme="dark"] .hm-tools.eh { --navy: #0D1F33; }
.eh-wrap { display: grid; gap: clamp(26px, 3.5vw, 36px); }
.eh-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 18px 28px; }
.eh-top h2 { font-size: clamp(2rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.eh-top p { margin-top: 10px; max-width: 34em; font-size: 1.1rem; line-height: 1.5; color: #B9C6D8; }
.eh-all { background: #fff; color: var(--navy); }
.eh-all:hover { background: #E8EEF6; }
.eh-all svg { width: 18px; height: 18px; }
.eh-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 400px); gap: 24px 48px; align-items: end; }
.eh-say { position: relative; }
.eh-sent { font-size: clamp(1.6rem, 3.4vw, 2.75rem); line-height: 1.45; letter-spacing: -0.025em; font-weight: 600; color: rgba(255, 255, 255, .9); max-width: 22em; }
.eh-sent em { font-style: normal; font-weight: 900; color: #FB7185; white-space: nowrap; }
.eh-chip { display: inline-flex; align-items: center; gap: .28em; margin: 0 .04em; padding: 0 .36em; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .12); box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .5); color: #fff; font: inherit; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s; -webkit-user-select: none; user-select: none; }
.eh-chip svg { width: .5em; height: .5em; opacity: .7; }
.eh-chip:hover { background: rgba(255, 255, 255, .22); }
.eh-chip.on { background: #fff; color: var(--navy); box-shadow: none; }
.eh-pop { position: absolute; z-index: 5; width: min(340px, 100%); padding: 16px 18px 12px; border-radius: 18px; background: var(--bg); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.eh-pop .ctl-top label, .eh-pop .ctl-top output { font-size: 1rem; }
.eh-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-weight: 800; color: #fff; text-decoration: none; }
.eh-go svg { width: 18px; height: 18px; transition: transform .15s; }
.eh-go:hover svg { transform: translateX(3px); }
.eh-chart { display: block; width: 100%; height: auto; overflow: visible; }
.eh-grid { stroke: rgba(255, 255, 255, .1); stroke-width: 1; }
.eh-gap { fill: #FB7185; opacity: .2; }
.eh-l { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.eh-a { stroke: #FB7185; }
.eh-b { stroke: #34D399; }
.eh-t { font: 700 13px var(--f-body); fill: #fff; }
.eh-qs { list-style: none; margin: 0; padding: 8px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 30px; border-top: 1px solid rgba(255, 255, 255, .14); }
.eh-qs a { display: flex; align-items: center; gap: 12px; height: 100%; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #E6EDF5; font-weight: 700; font-size: 1.02rem; line-height: 1.3; text-decoration: none; transition: color .15s; }
.eh-qs a svg { flex: none; width: 21px; height: 21px; color: color-mix(in oklab, var(--tc, #8FB0FF) 45%, #fff); }
.eh-qs a:hover { color: #fff; }
.eh-qs a:hover span { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 980px) { .eh-demo { grid-template-columns: minmax(0, 1fr); } .eh-chart { max-width: 460px; } .eh-qs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .eh-qs { grid-template-columns: minmax(0, 1fr); } .eh-sent { font-size: 1.55rem; } }

/* cabecera de panel con «Fuente» y el botón de abrir en Herramientas: los dos juntos a la derecha */
.p-top:has(.t-open) { justify-content: flex-start; }
.p-top:has(.t-open) h3 { margin-right: auto; }

/* ---------- portada: movimiento con sentido ---------- */
.hm-storm { position: relative; display: inline-block; white-space: nowrap; }
.hm-wave { position: absolute; left: -1%; right: -1%; bottom: -.14em; width: 102%; height: .26em; overflow: visible; }
.hm-wave path { fill: none; stroke: var(--c, var(--stage)); stroke-width: 3.2; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .85; }
@media (prefers-reduced-motion: no-preference) {
  .home-in .hm-wave path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: waveDraw 1.1s var(--ease-out) .45s forwards; }
  .hm-storm:hover .hm-wave { animation: waveRoll 1.6s ease-in-out infinite; }
  .rv { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
  .rv.seen { opacity: 1; transform: none; }
  .strip.rv-go .strip-st > li { animation: riseIn .55s var(--ease-out) both; animation-delay: calc(.12s + var(--i, 0) * .035s); }
  .storm-in.rv-go .storm-steps li { animation: riseIn .55s var(--ease-out) both; }
  .storm-in.rv-go .storm-steps li:nth-child(2) { animation-delay: .08s; } .storm-in.rv-go .storm-steps li:nth-child(3) { animation-delay: .16s; } .storm-in.rv-go .storm-steps li:nth-child(4) { animation-delay: .24s; }
  .eh.rv-go .eh-l { stroke-dasharray: 1; animation: lineDraw 1.6s var(--ease-out) .25s both; }
  .eh.rv-go .eh-gap { animation: fadeIn .8s ease-out 1.4s both; }
  .lv-glyph.lv-5 .w1 { animation: windA 3.4s ease-in-out infinite; }
  .lv-glyph.lv-5 .w2 { animation: windA 3.4s ease-in-out .5s infinite; }
  .lv-glyph.lv-5 .w3 { animation: windA 3.4s ease-in-out 1s infinite; }
}
@keyframes waveDraw { to { stroke-dashoffset: 0; } }
@keyframes lineDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes waveRoll { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3%); } }
@keyframes windA { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(1.6px); } }
.lv-glyph.lv-5 path { transform-box: fill-box; }
