/* ===== Tokens ===== */
:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efea;
  --surface-3: #e6e4dc;
  --border: #e2e0d8;
  --text: #17201b;
  --text-2: #4d5550;
  --text-3: #7c837e;
  --brand: #2b5f47;
  --brand-2: #3a7a5c;
  --brand-soft: #e3efe8;
  --brand-ink: #ffffff;
  --accent: #d98516;
  --accent-soft: #fbefdc;
  --ok: #138a3e;
  --ok-soft: #e1f4e7;
  --ko: #c93a3a;
  --ko-soft: #fbe5e3;
  --warn: #b97709;
  --warn-soft: #fdf1d8;
  --seq-0: #ebeee9;
  --seq-1: #c4ddcd;
  --seq-2: #8fbf9f;
  --seq-3: #4f9a6c;
  --seq-4: #2b6b47;
  --shadow: 0 1px 2px rgb(20 30 25 / .05), 0 4px 16px rgb(20 30 25 / .06);
  --shadow-lg: 0 10px 40px rgb(20 30 25 / .16);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-w: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #111513; --surface: #191e1b; --surface-2: #212724; --surface-3: #2b322e; --border: #2e3531;
    --text: #eef2ef; --text-2: #b9c2bc; --text-3: #8a948e;
    --brand: #4fa57a; --brand-2: #67b98f; --brand-soft: #1f3329; --brand-ink: #08130d;
    --accent: #f0a640; --accent-soft: #3a2c16;
    --ok: #3cc46b; --ok-soft: #173323; --ko: #ef6b6b; --ko-soft: #3a1d1d; --warn: #f0b440; --warn-soft: #3a2f16;
    --seq-0: #232a26; --seq-1: #24452f; --seq-2: #2f6a45; --seq-3: #43925f; --seq-4: #6cc58d;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111513; --surface: #191e1b; --surface-2: #212724; --surface-3: #2b322e; --border: #2e3531;
  --text: #eef2ef; --text-2: #b9c2bc; --text-3: #8a948e;
  --brand: #4fa57a; --brand-2: #67b98f; --brand-soft: #1f3329; --brand-ink: #08130d;
  --accent: #f0a640; --accent-soft: #3a2c16;
  --ok: #3cc46b; --ok-soft: #173323; --ko: #ef6b6b; --ko-soft: #3a1d1d; --warn: #f0b440; --warn-soft: #3a2f16;
  --seq-0: #232a26; --seq-1: #24452f; --seq-2: #2f6a45; --seq-3: #43925f; --seq-4: #6cc58d;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .8em; }
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.tiny { font-size: .76rem; color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.g2w { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }

/* ===== Layout ===== */
.shell {
  display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100dvh;
  background: linear-gradient(90deg, var(--surface) calc(var(--nav-w) - 1px), var(--border) 0 var(--nav-w), transparent 0);
}
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 22px 14px; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 1.05rem; text-decoration: none; color: var(--text); }
.logo img { width: 34px; height: 34px; }
.logo small { display: block; font-weight: 500; font-size: .74rem; color: var(--text-3); }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); text-decoration: none; font-weight: 600; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); }
.nav-link .ico { width: 22px; text-align: center; font-size: 1.1rem; }
.nav-link .badge { margin-left: auto; }
.sidebar .user-box { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
main { padding: 28px clamp(16px, 4vw, 44px) 120px; max-width: 1180px; width: 100%; outline: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--text-2); }

.bottom-nav { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { display: none; }
  main { padding: 18px 16px 110px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none;
    color: var(--text-3); font-size: .7rem; font-weight: 600; text-decoration: none; border-radius: 12px; position: relative;
  }
  .bottom-nav .ico { font-size: 1.25rem; }
  .bottom-nav .active { color: var(--brand); }
  .bottom-nav .fab .ico {
    background: var(--brand); color: var(--brand-ink); width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center; margin-top: -22px; box-shadow: var(--shadow-lg); font-size: 1.3rem;
  }
  .bottom-nav .badge { position: absolute; top: 0; right: 18%; }
}

/* ===== Components ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.pad-lg { padding: 26px; }
.card h2 { margin-bottom: 14px; }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 650; cursor: pointer;
  text-decoration: none; transition: background .15s, transform .08s, border-color .15s; white-space: nowrap; min-height: 44px;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--ko); border-color: color-mix(in srgb, var(--ko) 40%, var(--border)); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: .88rem; border-radius: 10px; }
.btn.lg { padding: 14px 22px; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.badge.ko { background: var(--ko); color: #fff; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.fail { background: var(--ko-soft); color: var(--ko); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: .88rem; user-select: none; min-height: 36px;
}
.chip:has(input:checked), .chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chip input { accent-color: var(--brand); margin: 0; }

.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  min-height: 46px; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
label.field { display: block; font-weight: 600; font-size: .9rem; }
label.field .input { margin-top: 6px; font-weight: 400; }

.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.progress.accent > span { background: var(--accent); }
.progress.dual { display: flex; gap: 2px; background: var(--surface-3); }
.progress.dual > span { border-radius: 0; }
.progress.dual > span:first-child { border-radius: 99px 0 0 99px; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }

/* ===== Dashboard ===== */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 70%, #0d2a1d) 100%);
  color: #fff; border-radius: 22px; padding: 26px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  position: relative; overflow: hidden; border: 0;
}
:root[data-theme="dark"] .hero { background: linear-gradient(135deg, #24533d, #14301f); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .hero { background: linear-gradient(135deg, #24533d, #14301f); } }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; border: 34px solid rgb(255 255 255 / .06); pointer-events: none; }
.hero h1 { color: #fff; margin-bottom: 6px; }
.hero p { color: rgb(255 255 255 / .82); margin: 0 0 16px; max-width: 52ch; }
.hero .btn { border-color: transparent; }
.hero .btn.light { background: #fff; color: #1d4231; }
.hero .btn.glass { background: rgb(255 255 255 / .14); color: #fff; }
.hero .btn.glass:hover { background: rgb(255 255 255 / .22); }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; padding: 20px; } .hero .gauge { justify-self: center; } }

.gauge { position: relative; width: 150px; height: 150px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge .val b { font-size: 2rem; font-weight: 800; line-height: 1; }
.gauge .val span { font-size: .72rem; opacity: .85; margin-top: 4px; max-width: 90px; }

.stat { padding: 16px 18px; }
.stat .label { font-size: .82rem; color: var(--text-2); font-weight: 600; }
.stat .value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.stat .sub { font-size: .78rem; color: var(--text-3); }

.action-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.action-card .ic { font-size: 1.5rem; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--brand-soft); }
.action-card.warn .ic { background: var(--ko-soft); }
.action-card.acc .ic { background: var(--accent-soft); }
.action-card h3 { margin: 0 0 2px; }
.action-card p { margin: 0; font-size: .86rem; color: var(--text-2); }

.tema-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; text-decoration: none; color: inherit; }
.tema-row + .tema-row { border-top: 1px solid var(--border); }
.tema-row .num { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.05rem; }
.tema-row .name { font-weight: 600; font-size: .92rem; }
.tema-row .pct { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }

/* ===== Temario ===== */
.tema-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.tema-card .top { display: flex; align-items: center; gap: 12px; }
.tema-card .emoji { font-size: 1.6rem; width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); display: grid; place-items: center; flex: none; }
.tema-card .t-num { font-size: .75rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.tema-card h3 { margin: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.claves { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.clave { padding: 16px 18px; border-left: 4px solid var(--brand); }
.clave h4 { margin: 0 0 6px; font-size: .95rem; color: var(--brand); }
.clave p { margin: 0; font-size: .9rem; color: var(--text-2); }
.clave b { color: var(--text); }

details.sub { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
details.sub + details.sub { margin-top: 10px; }
details.sub > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; gap: 12px; align-items: center; font-weight: 650; }
details.sub > summary::-webkit-details-marker { display: none; }
details.sub > summary::after { content: '›'; margin-left: auto; font-size: 1.4rem; color: var(--text-3); transition: transform .2s; }
details.sub[open] > summary::after { transform: rotate(90deg); }
details.sub > summary .cnt { font-size: .78rem; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.sub-body { padding: 0 18px 16px; }
.study-q { padding: 14px 0; border-top: 1px dashed var(--border); }
.study-q .qt { font-weight: 600; margin-bottom: 8px; }
.study-q .qt .n { color: var(--text-3); font-weight: 700; margin-right: 6px; }
.study-q ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.study-q li { padding: 6px 10px; border-radius: 8px; font-size: .9rem; color: var(--text-2); }
.study-q li.correct { background: var(--ok-soft); color: var(--text); font-weight: 600; }
.study-q li.correct::before { content: '✓ '; color: var(--ok); font-weight: 800; }
.study-q .exp { margin-top: 8px; font-size: .86rem; color: var(--text-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.study-q .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ===== Flashcards ===== */
.flash-wrap { max-width: 720px; margin: 0 auto; }
.flash { min-height: 320px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.flash .q { font-size: 1.15rem; font-weight: 650; }
.flash .reveal { border-top: 1px solid var(--border); padding-top: 16px; animation: fadeUp .3s ease; }
.flash .answer { font-size: 1.05rem; font-weight: 700; color: var(--ok); }

/* ===== Configurar test ===== */
.mode-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.mode {
  position: relative; text-align: left; padding: 16px 16px 16px 66px; border-radius: 16px; border: 2px solid var(--border);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; min-height: 92px;
}
.mode:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.mode.on { border-color: var(--brand); background: var(--brand-soft); }
.mode .ic { position: absolute; left: 14px; top: 16px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--surface-2); }
.mode.on .ic { background: var(--surface); }
.mode b { display: block; font-size: .98rem; }
.mode span { font-size: .82rem; color: var(--text-2); display: block; margin-top: 2px; }
.mode .badge { position: absolute; top: 12px; right: 12px; }
.range-row { display: flex; align-items: center; gap: 16px; }
.range-row input[type=range] { flex: 1; accent-color: var(--brand); height: 28px; }
.range-row output { font-weight: 800; font-size: 1.5rem; min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; cursor: pointer; }
.switch + .switch { border-top: 1px solid var(--border); }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }
.switch .txt b { display: block; font-size: .94rem; }
.switch .txt span { font-size: .8rem; color: var(--text-2); }

/* ===== Test runner ===== */
.runner { max-width: 820px; margin: 0 auto; }
.run-top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); padding: 12px 0; margin: -12px 0 12px; }
.run-top .row { gap: 10px; }
.run-title { font-weight: 700; font-size: .95rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; padding: 6px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.timer.low { color: var(--ko); border-color: var(--ko); animation: pulse 1s infinite; }
.qcard { padding: clamp(18px, 4vw, 30px); }
.qcard .qmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.qcard .qtext { font-size: clamp(1.05rem, 2.4vw, 1.22rem); font-weight: 650; line-height: 1.45; margin-bottom: 20px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s; font-size: .98rem; min-height: 58px;
}
.opt:hover:not([disabled]) { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); background: var(--surface-2); }
.opt:active:not([disabled]) { transform: scale(.99); }
.opt .key { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--text-2); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel .key { background: var(--brand); color: var(--brand-ink); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .key { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--ko); background: var(--ko-soft); }
.opt.wrong .key { background: var(--ko); color: #fff; }
.opt.dim { opacity: .55; }
.opt[disabled] { cursor: default; }
.opt .mark { font-weight: 800; font-size: 1.1rem; }
.opt.correct .mark { color: var(--ok); }
.opt.wrong .mark { color: var(--ko); }
.opt.just-wrong { animation: shake .4s; }
.opt.just-right { animation: pop .35s; }

.feedback { margin-top: 18px; border-radius: 14px; padding: 16px 18px; animation: fadeUp .25s ease; }
.feedback.ok { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.feedback.ko { background: var(--ko-soft); border: 1px solid color-mix(in srgb, var(--ko) 35%, transparent); }
.feedback h4 { margin: 0 0 6px; font-size: 1rem; }
.feedback.ok h4 { color: var(--ok); }
.feedback.ko h4 { color: var(--ko); }
.feedback p { margin: 0 0 6px; font-size: .92rem; }
.feedback p:last-child { margin: 0; }
.feedback .lbl { font-weight: 700; }

.run-nav { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.qgrid button { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: .8rem; cursor: pointer; position: relative; padding: 0; }
.qgrid button.ans { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.qgrid button.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qgrid button.ko { background: var(--ko-soft); border-color: var(--ko); color: var(--ko); }
.qgrid button.cur { outline: 3px solid var(--accent); outline-offset: 1px; }
.qgrid button.flag::after { content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.kbd-hint { font-size: .75rem; color: var(--text-3); text-align: center; margin-top: 14px; }
kbd { font: 600 .72rem var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); border-bottom-width: 2px; }
@media (max-width: 640px) { .kbd-hint { display: none; } .opt { padding: 12px; grid-template-columns: 32px 1fr auto; } .opt .key { width: 30px; height: 30px; } }

/* ===== Resultados ===== */
.result-hero { text-align: center; padding: 30px 20px; position: relative; overflow: hidden; }
.result-hero.pass { background: linear-gradient(180deg, var(--ok-soft), var(--surface) 70%); }
.result-hero.fail { background: linear-gradient(180deg, var(--ko-soft), var(--surface) 70%); }
.result-hero .score { font-size: clamp(2.6rem, 8vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.result-hero .verdict { font-size: 1.25rem; font-weight: 800; margin: 10px 0 4px; }
.result-hero.pass .verdict { color: var(--ok); }
.result-hero.fail .verdict { color: var(--ko); }
.result-stats { display: flex; justify-content: center; gap: clamp(14px, 5vw, 40px); margin-top: 18px; flex-wrap: wrap; }
.result-stats div { text-align: center; }
.result-stats b { display: block; font-size: 1.35rem; }
.result-stats span { font-size: .78rem; color: var(--text-2); }
.review-q { padding: 18px; }
.review-q + .review-q { margin-top: 12px; }
.review-q .qtext { font-weight: 650; margin-bottom: 10px; }
.review-q .opts { gap: 6px; }
.review-q .opt { min-height: 0; padding: 9px 12px; font-size: .9rem; cursor: default; border-width: 1.5px; }
.review-q .opt .key { width: 26px; height: 26px; font-size: .8rem; border-radius: 8px; }
.review-q .exp { margin-top: 10px; font-size: .88rem; background: var(--surface-2); padding: 12px 14px; border-radius: 12px; color: var(--text-2); }
.review-q .exp b { color: var(--text); }
.review-q.is-ko { border-left: 4px solid var(--ko); }
.review-q.is-ok { border-left: 4px solid var(--ok); }
.review-q.is-blank { border-left: 4px solid var(--warn); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 650; font-size: .86rem; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ===== Historial / errores ===== */
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; text-decoration: none; color: inherit; }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item .sc { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: .95rem; flex: none; }
.list-item .sc.pass { background: var(--ok-soft); color: var(--ok); }
.list-item .sc.fail { background: var(--ko-soft); color: var(--ko); }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item:hover { background: var(--surface-2); border-radius: 12px; }
.errtest { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.errtest + .errtest { margin-top: 10px; }
.errtest .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--ko-soft); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.errtest.done .ic { background: var(--ok-soft); }
.errtest .info { flex: 1; min-width: 0; }
.errq { padding: 12px 0; display: flex; gap: 12px; align-items: flex-start; }
.errq + .errq { border-top: 1px solid var(--border); }
.errq .info { flex: 1; font-size: .9rem; }
.errq .info .ans { color: var(--ok); font-weight: 600; margin-top: 4px; }

/* ===== Gráficos ===== */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .thr { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .thr-label { fill: var(--accent); font-weight: 700; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--brand) 12%, transparent); }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .dot.pass { fill: var(--ok); }
.chart .dot.fail { fill: var(--ko); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .dot, .chart .dot.hover { r: 6; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 48px; gap: 12px; align-items: center; font-size: .86rem; }
.bar-row .lbl { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { height: 14px; background: var(--seq-0); border-radius: 0 4px 4px 0; position: relative; }
.bar-row .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--brand); }
.bar-row .thr80 { position: absolute; left: 80%; top: -3px; bottom: -3px; width: 0; border-left: 1.5px dashed var(--accent); }
.bar-row .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 92px 1fr 42px; } }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--seq-0); min-width: 10px; }
.heat i[data-l="1"] { background: var(--seq-1); } .heat i[data-l="2"] { background: var(--seq-2); }
.heat i[data-l="3"] { background: var(--seq-3); } .heat i[data-l="4"] { background: var(--seq-4); }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--text-3); justify-content: flex-end; margin-top: 8px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
#tooltip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--text); color: var(--bg); padding: 7px 10px;
  border-radius: 8px; font-size: .8rem; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 240px; transform: translate(-50%, calc(-100% - 10px));
}
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th, table.data td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { color: var(--text-2); font-weight: 650; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Login ===== */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  background: linear-gradient(150deg, #2b5f47, #12301f); color: #fff; padding: clamp(28px, 6vw, 70px);
  display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; overflow: hidden;
}
.auth-side::before { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgb(255 255 255 / .05); right: -140px; bottom: -140px; }
.auth-side h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); color: #fff; }
.auth-side p { color: rgb(255 255 255 / .8); font-size: 1.05rem; max-width: 46ch; }
.auth-feats { display: grid; gap: 12px; margin-top: 10px; }
.auth-feats div { display: flex; gap: 12px; align-items: center; color: rgb(255 255 255 / .9); }
.auth-feats span { width: 38px; height: 38px; border-radius: 12px; background: rgb(255 255 255 / .12); display: grid; place-items: center; flex: none; }
.auth-main { display: grid; place-items: center; padding: 28px 16px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .seg { width: 100%; margin-bottom: 22px; }
.auth-box .seg button { flex: 1; }
.form-error { color: var(--ko); font-size: .88rem; font-weight: 600; min-height: 1.3em; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px 34px; }
  .auth-feats { display: none; }
}

/* ===== Guía ===== */
.guide-step { display: flex; gap: 16px; }
.guide-step .n { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.guide-step + .guide-step { margin-top: 16px; }
.guide-step p { margin: 2px 0 0; color: var(--text-2); font-size: .92rem; }
.callout { border-radius: 14px; padding: 14px 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: .92rem; }
.callout.brand { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
ul.ticks { padding: 0; margin: 0; list-style: none; display: grid; gap: 8px; }
ul.ticks li { padding-left: 26px; position: relative; font-size: .93rem; }
ul.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

/* ===== Dialog / toasts ===== */
dialog#modal {
  border: 0; border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 40px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(.97);
  transition-property: opacity, transform, display, overlay; transition-duration: .22s; transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
dialog#modal[open] { opacity: 1; transform: none; }
@starting-style { dialog#modal[open] { opacity: 0; transform: translateY(12px) scale(.97); } }
dialog#modal::backdrop {
  background: rgb(10 15 12 / 0); backdrop-filter: blur(3px);
  transition-property: background-color, display, overlay; transition-duration: .22s; transition-behavior: allow-discrete;
}
dialog#modal[open]::backdrop { background: rgb(10 15 12 / .5); }
@starting-style { dialog#modal[open]::backdrop { background: rgb(10 15 12 / 0); } }
.modal-body { padding: 24px; }
.modal-body h2 { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
#toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
@media (max-width: 860px) { #toasts { bottom: 92px; } }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); animation: fadeUp .25s ease; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }

/* ===== Animaciones ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.025); } 100% { transform: scale(1); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
.fade-in { animation: fadeUp .3s ease both; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .confetti { display: none; }
}
@media print { .sidebar, .bottom-nav, .run-top { display: none !important; } .shell { display: block; } }
.btn kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .75; }
.heat { max-width: 460px; }

/* ===== Landing y planes ===== */
.lp { min-height: 100dvh; background: var(--bg); }
.lp-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.lp-nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.lp-nav .lp-wrap { min-height: 66px; gap: 8px; flex-wrap: nowrap; }
.lp-nav .logo { flex: none; }
@media (max-width: 760px) { .lp-links { display: none; } }
@media (max-width: 420px) { .lp-cta-top { display: none; } .lp-nav .logo small { display: none; } }
.lp-hero { padding: clamp(36px, 7vw, 84px) 0 clamp(36px, 6vw, 64px); background: radial-gradient(900px 420px at 85% 10%, var(--brand-soft), transparent 70%), radial-gradient(600px 300px at 0% 100%, var(--accent-soft), transparent 70%); }
.lp-hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
@media (max-width: 900px) { .lp-hero-grid { grid-template-columns: 1fr; } }
.lp-hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; letter-spacing: -.03em; margin: 14px 0 16px; }
.lp-hero .hl { color: var(--brand); }
.lp-sub { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--text-2); max-width: 54ch; margin-bottom: 24px; }
.lp-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: .86rem; color: var(--text-2); font-weight: 600; }
.lp-demo { box-shadow: var(--shadow-lg); transform: rotate(.6deg); }
.lp-demo .qtext { font-size: 1.08rem; }
.lp-strip { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .lp-strip { background: #1f3d2d; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .lp-strip { background: #1f3d2d; } }
.lp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 26px 20px; text-align: center; }
.lp-stats b { display: block; font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; }
.lp-stats span { font-size: .84rem; opacity: .85; }
@media (max-width: 600px) { .lp-stats { grid-template-columns: repeat(2, 1fr); row-gap: 20px; } }
.lp-section { padding: clamp(48px, 8vw, 88px) 0; }
.lp-section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; text-align: center; }
.lp-lead { text-align: center; color: var(--text-2); max-width: 60ch; margin: 0 auto 32px; font-size: 1.05rem; }
.lp-feat .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 12px; }
.lp-feat p { color: var(--text-2); font-size: .92rem; margin: 0; }
.lp-steps { margin-top: 28px; text-align: center; }
.lp-steps .n { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; margin: 0 auto 12px; }
.lp-steps p { color: var(--text-2); font-size: .92rem; }
.lp-faq { max-width: 780px; }
.lp-faq .lp-h2 { margin-bottom: 26px; }
.lp-foot { padding: 26px 0; border-top: 1px solid var(--border); color: var(--text-2); font-size: .88rem; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; max-width: 820px; margin: 0 auto; align-items: stretch; }
.plan { position: relative; background: var(--surface); border: 2px solid var(--border); border-radius: 22px; padding: 28px 26px 22px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.plan.featured { border-color: var(--brand); box-shadow: 0 14px 44px color-mix(in srgb, var(--brand) 22%, transparent); }
.plan-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: .74rem; font-weight: 800; padding: 4px 12px; border-radius: 99px; white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.plan-lic { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.plan h3 { font-size: 1.35rem; margin: 6px 0 4px; }
.plan-lema { color: var(--text-2); font-size: .9rem; margin: 0 0 14px; }
.price { display: flex; align-items: baseline; gap: 8px; }
.price b { font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.price span { color: var(--text-2); font-weight: 600; }
.plan-save { font-size: .78rem; color: var(--ok); font-weight: 600; min-height: 1.3em; margin: 8px 0 16px; }
.plan .ticks { margin-bottom: 22px; flex: 1; }

.auth-wrap { padding-top: clamp(24px, 6vw, 60px); padding-bottom: 60px; }
.auth-card { max-width: 440px; margin: 0 auto; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; max-width: 940px; margin: 0 auto; }
.reg-grid .plan { box-shadow: none; }
@media (max-width: 820px) { .reg-grid { grid-template-columns: 1fr; } }
.checkout { max-width: 940px; margin: 0 auto; }
.checkout-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; margin-top: 16px; }
@media (max-width: 760px) { .checkout-grid { grid-template-columns: 1fr; } }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.sum-row + .sum-row { border-top: 1px solid var(--border); }
.sum-row.total { font-size: 1.15rem; }
.sum-row.total b { font-size: 1.4rem; }

/* ===== Landing: sección de funciones (bento) ===== */
.lp-eyebrow { display: block; text-align: center; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bento-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.bento-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.bento-card.span2 { grid-column: span 2; }
.bento-head { display: flex; align-items: center; gap: 12px; }
.bento-head h3 { margin: 0; font-size: 1.08rem; }
.bento-ic { width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.25rem; flex: none; }
.bento-card > p { color: var(--text-2); font-size: .92rem; margin: 4px 0 10px; }
.bento-visual { margin-top: auto; background: var(--surface-2); border-radius: 14px; padding: 14px; font-size: .84rem; }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .bento { grid-template-columns: 1fr; } .bento-card.span2 { grid-column: auto; } }

.mini-q { font-weight: 700; margin-bottom: 8px; }
.mini-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid; background: var(--surface); margin-bottom: 6px; }
.mini-opt b { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: .74rem; flex: none; }
.mini-opt span { margin-left: auto; font-weight: 800; }
.mini-opt.ko { border-color: var(--ko); background: var(--ko-soft); } .mini-opt.ko b { background: var(--ko); } .mini-opt.ko span { color: var(--ko); }
.mini-opt.ok { border-color: var(--ok); background: var(--ok-soft); } .mini-opt.ok b { background: var(--ok); } .mini-opt.ok span { color: var(--ok); }
.mini-exp { margin-top: 8px; padding: 9px 11px; border-radius: 10px; background: var(--surface); color: var(--text-2); }
.mini-exp b { color: var(--text); }
.mini-stack { display: grid; gap: 6px; }
.mini-stack div { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; }
.mini-stack div:nth-child(1) { border-color: var(--brand); box-shadow: var(--shadow); }
.mini-stack div:nth-child(2) { opacity: .75; margin: 0 6px; }
.mini-stack div:nth-child(3) { opacity: .45; margin: 0 12px; }
.mini-stack span { color: var(--text-3); font-weight: 600; }
.mini-flow { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.mini-flow span { padding: 6px 11px; border-radius: 99px; font-weight: 700; }
.mini-flow i { font-style: normal; color: var(--text-3); padding-left: 14px; transform: rotate(90deg); line-height: 1; }
.mini-flow .ko { background: var(--ko-soft); color: var(--ko); } .mini-flow .acc { background: var(--accent-soft); color: var(--accent); } .mini-flow .ok { background: var(--ok-soft); color: var(--ok); }
.mini-timer { text-align: center; }
.mini-timer b { display: block; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mini-timer span { display: block; color: var(--text-2); margin: 2px 0 10px; font-weight: 600; }
.mini-bars { display: grid; gap: 8px; }
.mini-bars div { display: grid; grid-template-columns: 1fr 80px 36px; gap: 8px; align-items: center; }
.mini-bars span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mini-bars i { height: 8px; border-radius: 0 4px 4px 0; background: var(--seq-0); display: block; position: relative; }
.mini-bars i::after { content: ''; position: absolute; left: 80%; top: -3px; bottom: -3px; border-left: 1.5px dashed var(--accent); }
.mini-bars em { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--brand); }
.mini-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.mini-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-chips span { padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; }
.mini-chips span:nth-child(3n+1) { border-color: var(--brand); color: var(--brand); }
.mini-devices { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 2rem; padding: 6px 0; }
.mini-devices i { font-style: normal; font-size: 1.1rem; color: var(--text-3); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }
.compare-col { border-radius: 20px; padding: 22px 24px; border: 1px solid var(--border); }
.compare-col h3 { margin-bottom: 12px; }
.compare-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.compare-col li { padding-left: 28px; position: relative; font-size: .93rem; }
.compare-col li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.compare-col.bad { background: var(--surface-2); color: var(--text-2); }
.compare-col.bad li::before { content: '✗'; color: var(--ko); }
.compare-col.good { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.compare-col.good h3 { color: var(--brand); }
.compare-col.good li::before { content: '✓'; color: var(--ok); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ===== Sitio público: artículos y navegación ===== */
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.lp-links .btn.on { background: var(--brand-soft); color: var(--brand); }
.mnav { display: none; position: relative; }
.mnav summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 1.1rem; }
.mnav summary::-webkit-details-marker { display: none; }
.mnav > div { position: absolute; right: 0; top: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; display: grid; min-width: 230px; z-index: 40; }
.mnav a { padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.mnav a:hover { background: var(--surface-2); }
@media (max-width: 760px) { .mnav { display: block; } }
.lp-demo-wrap .quiz-q { box-shadow: var(--shadow-lg); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .84rem; color: var(--text-3); margin-bottom: 18px; }
.crumbs a { color: var(--text-2); }
.article-wrap { padding-top: 26px; padding-bottom: 70px; }
.article { max-width: 780px; margin: 0 auto 40px; font-size: 1.02rem; line-height: 1.7; }
.article h1 { font-size: clamp(1.8rem, 4.2vw, 2.6rem); line-height: 1.12; letter-spacing: -.02em; }
.article h2 { font-size: clamp(1.3rem, 2.8vw, 1.6rem); margin: 38px 0 12px; scroll-margin-top: 80px; }
.article h3, .article .h4 { font-size: 1.05rem; }
.article p, .article li { color: var(--text-2); }
.article b { color: var(--text); }
.article ol, .article ul:not(.ticks) { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article-lead { font-size: 1.15rem; color: var(--text-2); max-width: 64ch; }
.toc { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; margin: 18px 0; }
.toc b { width: 100%; }
.fact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.fact-grid div { background: var(--brand-soft); border-radius: 14px; padding: 14px; text-align: center; }
.fact-grid b { display: block; font-size: 1.8rem; color: var(--brand); line-height: 1.1; }
.fact-grid span { font-size: .82rem; color: var(--text-2); line-height: 1.3; display: block; margin-top: 4px; }
@media (max-width: 600px) { .fact-grid { grid-template-columns: repeat(2, 1fr); } }
.tema-ol li { margin-bottom: 10px; }
.steps-v { display: grid; gap: 14px; margin: 16px 0; }
.steps-v > div { display: flex; gap: 14px; align-items: flex-start; }
.steps-v span { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.steps-v h3 { margin: 4px 0 2px; }
.steps-v p { margin: 0; }
.quiz { display: grid; gap: 14px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.table-wrap table.data th[scope="row"] { color: var(--text); text-transform: none; letter-spacing: 0; font-size: .86rem; }
.table-wrap td { color: var(--text-2); }
mark.pend { background: var(--accent-soft); color: var(--accent); padding: 0 4px; border-radius: 4px; font-weight: 700; }
.cta-box {
  max-width: 980px; margin: 0 auto; border-radius: 24px; padding: clamp(24px, 4vw, 40px); color: #fff;
  background: linear-gradient(135deg, #2b5f47, #14301f); display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
}
.cta-box h2 { color: #fff; margin: 0 0 6px; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.cta-box p { color: rgb(255 255 255 / .82); margin: 0; max-width: 52ch; }
.cta-box .btn.light { background: #fff; color: #1d4231; border-color: transparent; }
.cta-box .btn.glass { background: rgb(255 255 255 / .14); color: #fff; border-color: transparent; }
.site-foot { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 26px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 24px; }
.foot-grid h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 10px; }
.foot-grid a:not(.logo) { display: block; color: var(--text-2); text-decoration: none; font-size: .9rem; padding: 4px 0; }
.foot-grid a:not(.logo):hover { color: var(--brand); }
.foot-note { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

/* ===== ¿Qué es el permiso E? ===== */
.que-es .lp-lead { max-width: 70ch; }
.armas-title { text-align: center; font-size: 1.05rem; margin: 8px 0 16px; color: var(--text-2); }
.armas-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 16px 0; }
@media (max-width: 1000px) { .armas-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .armas-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .armas-grid { grid-template-columns: 1fr; } }
.arma { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 16px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.arma-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.7rem; margin-bottom: 4px; }
.arma h3 { margin: 0; font-size: 1rem; }
.arma p { margin: 0; font-size: .85rem; color: var(--text-2); line-height: 1.45; flex: 1; }
.que-es-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; align-items: start; }
@media (max-width: 820px) { .que-es-bottom { grid-template-columns: 1fr; } }
.no-e { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; }
.no-e h3 { font-size: 1rem; margin-bottom: 10px; }
.no-e ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.no-e li { padding-left: 26px; position: relative; font-size: .9rem; color: var(--text-2); }
.no-e li::before { content: '✗'; position: absolute; left: 0; color: var(--ko); font-weight: 800; }
.no-e b { color: var(--text); }
.que-es-side .fact-grid { grid-template-columns: repeat(2, 1fr); margin: 0; }
.article .armas-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.article .no-e { margin: 18px 0; }
@media (max-width: 1100px) { .lp-links { display: none; } .mnav { display: block; } }
.lp > main { max-width: none; padding: 0; }

/* ===== Precio de oferta ===== */
.offer-tag { display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; background: var(--ko-soft); color: var(--ko); font-size: .78rem; font-weight: 800; padding: 4px 10px; border-radius: 99px; margin-bottom: 8px; }
.price { flex-wrap: wrap; }
.price s { color: var(--text-3); font-size: 1.25rem; font-weight: 700; text-decoration-thickness: 2px; text-decoration-color: var(--ko); }

/* =====================================================================
   SISTEMA DE MAQUETACIÓN COMÚN (web pública y pantallas de acceso)
   Un solo contenedor y los mismos márgenes en todas las páginas.
   ===================================================================== */
:root { --container: 1180px; --gutter: clamp(16px, 4vw, 32px); --section-y: clamp(56px, 8vw, 96px); }
.lp-wrap { max-width: calc(var(--container) + var(--gutter) * 2); padding-left: var(--gutter); padding-right: var(--gutter); margin-left: auto; margin-right: auto; }
.lp-section { padding: var(--section-y) 0; }
.lp-nav .lp-wrap { min-height: 68px; }

/* Franja de título de las páginas interiores */
.page-hero { padding: 28px 0 40px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 75%, transparent), transparent); }
.page-hero .crumbs { margin-bottom: 18px; }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 12px; max-width: 30ch; }
.page-lead { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--text-2); max-width: 68ch; margin: 0; }
.page-meta { font-size: .8rem; color: var(--text-3); margin: 14px 0 0; }
.page-body { padding-top: 44px; padding-bottom: var(--section-y); }

/* Contenido con barra lateral */
.layout-2col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.page-side { position: sticky; top: 92px; display: grid; gap: 16px; }
@media (max-width: 1000px) {
  .layout-2col { grid-template-columns: 1fr; gap: 36px; }
  .page-side { position: static; }
  .side-toc { display: none; }
}
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.side-card > b { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 10px; }
.side-toc a, .side-nav a { display: flex; gap: 8px; padding: 7px 10px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: .9rem; line-height: 1.35; }
.side-toc a:hover, .side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a[aria-current] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.start-card { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); box-shadow: none; }
.start-card > b { color: var(--brand); }
.start-card p { font-size: .9rem; color: var(--text-2); margin: 0 0 12px; }
.side-price { font-size: .9rem; color: var(--text-2); margin-bottom: 12px; }
.side-price b { font-size: 1.4rem; color: var(--text); }

/* Texto de las guías */
.prose { max-width: 760px; font-size: 1.02rem; line-height: 1.7; }
.prose.wide { max-width: none; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); margin: 44px 0 14px; scroll-margin-top: 90px; letter-spacing: -.015em; }
.prose h3, .prose .h4 { font-size: 1.05rem; }
.prose p, .prose li { color: var(--text-2); }
.prose b { color: var(--text); }
.prose ol, .prose ul:not(.ticks) { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose .claves { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* Bloques al final de la página */
.page-cta { margin-top: var(--section-y); }
.cta-box { max-width: none; }
.page-faq { margin-top: var(--section-y); }

/* Pantallas de acceso y pago: alineadas al mismo borde que el título */
.auth-card { max-width: 460px; margin: 0; }
.reg-grid { max-width: none; margin: 0; grid-template-columns: minmax(0, 460px) minmax(0, 420px); justify-content: start; gap: 32px; }
@media (max-width: 860px) { .reg-grid { grid-template-columns: 1fr; } }
.checkout { max-width: none; }
.checkout-grid { margin-top: 0; grid-template-columns: minmax(0, 560px) minmax(0, 420px); justify-content: start; }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; } }
/* Reserva el hueco de la barra de desplazamiento para que nada "salte" entre páginas cortas y largas */
html { scrollbar-gutter: stable; }

/* ===== Temario: claves bloqueadas ===== */
.sub-list { margin: 8px 0 0; }
.locked { position: relative; margin-top: 12px; border-radius: 16px; overflow: hidden; }
.locked-list { filter: blur(5px); opacity: .55; pointer-events: none; user-select: none; }
.locked-cta {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 35%, transparent), color-mix(in srgb, var(--bg) 85%, transparent) 45%);
}
.locked-cta .lock { width: 48px; height: 48px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.3rem; box-shadow: var(--shadow-lg); }
.locked-cta b { font-size: 1.08rem; color: var(--text); }
.locked-cta p { margin: 0 0 8px; max-width: 42ch; font-size: .92rem; }

/* Precios: las preguntas frecuentes, centradas como las tarjetas */
.page-faq { max-width: 820px; margin-left: auto; margin-right: auto; }
.locked { min-height: 280px; }

/* ===== Portada: ¿Qué es el permiso E? (explicación + panel de venta) ===== */
.qe-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 960px) { .qe-grid { grid-template-columns: 1fr; } }
.qe-eyebrow { text-align: left; }
.qe-h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; margin: 0 0 14px; }
.qe-lead { font-size: 1.1rem; color: var(--text-2); margin: 0 0 26px; max-width: 58ch; }
.qe-lead b { color: var(--text); }
.qe-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 0 0 6px; }
.qe-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.qe-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.qe-check { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.qe-list b { display: block; font-size: .98rem; }
.qe-list div span { display: block; font-size: .86rem; color: var(--text-2); line-height: 1.4; }
.qe-list em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
@media (max-width: 480px) { .qe-list em { display: none; } .qe-list li { grid-template-columns: 28px 1fr; } }
.qe-no { font-size: .9rem; color: var(--text-2); margin: 16px 0 10px; }
.qe-no b { color: var(--ko); }
.qe-more { font-weight: 700; text-decoration: none; }
.qe-more:hover { text-decoration: underline; }

.qe-panel {
  position: relative; overflow: hidden; color: #fff; border-radius: 26px; padding: clamp(24px, 3.5vw, 36px);
  background: radial-gradient(500px 260px at 100% 0%, rgb(243 196 106 / .18), transparent 60%), linear-gradient(150deg, #2b5f47, #12301f);
  box-shadow: 0 24px 60px rgb(18 48 31 / .35);
}
.qe-kicker { display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #f3c46a; margin-bottom: 6px; }
.qe-panel h3 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 1.9rem); letter-spacing: -.02em; margin: 0 0 18px; }
.qe-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.qe-stats div { background: rgb(255 255 255 / .09); border: 1px solid rgb(255 255 255 / .12); border-radius: 14px; padding: 12px 10px; text-align: center; }
.qe-stats b { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1; }
.qe-stats span { display: block; font-size: .76rem; opacity: .8; margin-top: 6px; line-height: 1.25; }
.qe-panel > p { color: rgb(255 255 255 / .82); font-size: .93rem; margin: 0 0 18px; }
.qe-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; }
.qe-steps li { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: rgb(255 255 255 / .7); }
.qe-steps li span { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .35); display: grid; place-items: center; font-size: .78rem; font-weight: 800; flex: none; }
.qe-steps li.on { color: #fff; font-weight: 700; }
.qe-steps li.on span { background: #f3c46a; border-color: #f3c46a; color: #1d4231; }
.qe-steps em { font-style: normal; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #f3c46a; color: #1d4231; padding: 3px 8px; border-radius: 99px; margin-left: auto; }
.qe-panel .btn.light { background: #fff; color: #1d4231; border-color: transparent; }
.qe-panel .btn.light:hover { background: #f1f5f2; }
.qe-price { text-align: center; font-size: .82rem; color: rgb(255 255 255 / .75); margin: 10px 0 0; }

/* ===== Portada y temario: lista de los 7 temas ===== */
.tm-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 960px) { .tm-grid { grid-template-columns: 1fr; } }
.tm-ticks { margin: 0 0 26px; }
.tm-intro .row { gap: 18px; }
.tm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tm-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 18px; gap: 16px; align-items: center; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tm-row:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow-lg); transform: translateX(3px); }
.tm-num { font-size: 1.35rem; font-weight: 800; color: var(--brand); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tm-body b { display: block; font-size: 1rem; }
.tm-body > span { display: block; font-size: .85rem; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.tm-bar { height: 4px; border-radius: 99px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.tm-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.tm-meta { text-align: right; }
.tm-meta b { display: block; font-size: 1.25rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tm-meta span { font-size: .74rem; color: var(--text-3); white-space: nowrap; }
.tm-arrow { color: var(--text-3); font-weight: 700; transition: color .15s, transform .15s; }
.tm-row:hover .tm-arrow { color: var(--brand); transform: translateX(2px); }
@media (max-width: 520px) { .tm-row { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 14px; gap: 12px; } .tm-arrow { display: none; } .tm-meta span { white-space: normal; display: block; max-width: 70px; } }
.prose.wide .tm-list { max-width: 900px; }
.prose ol.tm-list { padding-left: 0; }
.tm-meta span { display: block; }
.tm-pct { color: var(--brand) !important; font-weight: 700; }
@media (max-width: 520px) { .tm-pct { display: none !important; } .tm-meta span { max-width: none; } }

/* ===== Formularios: casillas de consentimiento ===== */
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--text-2); line-height: 1.45; cursor: pointer; }
label.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
label.check a { color: var(--brand); }

/* ===== Panel de administración ===== */
.adm-table th, .adm-table td { white-space: nowrap; }
.adm-table td:nth-child(2) { white-space: normal; min-width: 180px; }
