/* ==========================================================================
   Más allá del consumo · plataforma de formación
   Sistema de diseño: tokens, tipografía, componentes. Claro / oscuro.
   ========================================================================== */

@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/newsreader-latin.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400 600; font-display: swap; src: url("../fonts/newsreader-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); }

:root {
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: #f4f7f0;
  --surface: #ffffff;
  --surface-2: #eef3e7;
  --surface-3: #e3eadb;
  --ink: #14201a;
  --ink-2: #3b4b3a;
  --muted: #66765f;
  --line: #dbe3d2;
  --line-2: #c9d4bd;

  --brand: #6d4aff;
  --brand-2: #2a1f66;
  --brand-ink: #ffffff;
  --brand-soft: #e4f3d3;
  --accent: #b4531a;
  --accent-soft: #f6e5d8;
  --ok: #2b7a4b;
  --ok-soft: #dcefe3;
  --warn: #9a6208;
  --warn-soft: #f7ecd2;
  --bad: #ad3329;
  --bad-soft: #f6dcd9;
  --info: #2f5d9a;
  --info-soft: #dde8f6;

  --c1: #6d4aff; --c2: #b4531a; --c3: #3f5aa8; --c4: #7a8f2a; --c5: #8a4a7a; --c6: #5d6b73;

  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(12, 28, 12, .05), 0 8px 24px -12px rgba(12, 28, 12, .14);
  --shadow-s: 0 1px 2px rgba(12, 28, 12, .06);
  --sidebar: 268px;
  --sidebar-rail: 76px;
  --maxw: 1180px;
}

:root[data-tema="oscuro"] {
  --bg: #0a130b; --surface: #101c11; --surface-2: #162617; --surface-3: #1e331f;
  --ink: #e8f0e2; --ink-2: #c3cfb8; --muted: #93a789; --line: #243823; --line-2: #31492f;
  --brand: #a48bff; --brand-2: #c6b6ff; --brand-ink: #0a2a08; --brand-soft: #1a3319;
  --accent: #e58f58; --accent-soft: #3a2418;
  --ok: #58bd83; --ok-soft: #14301f; --warn: #e0ae52; --warn-soft: #382a0e; --bad: #ef7d73; --bad-soft: #3b1a17;
  --info: #7fa9e3; --info-soft: #172b46;
  --c1: #a48bff; --c2: #e58f58; --c3: #86a1ea; --c4: #b3c85a; --c5: #cf8ebf; --c6: #9fb0b8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #0a130b; --surface: #101c11; --surface-2: #162617; --surface-3: #1e331f;
    --ink: #e8f0e2; --ink-2: #c3cfb8; --muted: #93a789; --line: #243823; --line-2: #31492f;
    --brand: #a48bff; --brand-2: #c6b6ff; --brand-ink: #0a2a08; --brand-soft: #1a3319;
    --accent: #e58f58; --accent-soft: #3a2418;
    --ok: #58bd83; --ok-soft: #14301f; --warn: #e0ae52; --warn-soft: #382a0e; --bad: #ef7d73; --bad-soft: #3b1a17;
    --info: #7fa9e3; --info-soft: #172b46;
    --c1: #a48bff; --c2: #e58f58; --c3: #86a1ea; --c4: #b3c85a; --c5: #cf8ebf; --c6: #9fb0b8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
    --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-2); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.85rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.ico { flex: none; vertical-align: -.2em; }

/* los pequeños títulos sobre los titulares: serif, sin mayúsculas, sin línea */
.eyebrow { font-family: var(--serif); font-size: 1.02rem; font-style: italic; color: var(--brand); text-transform: none; letter-spacing: 0; margin: 0 0 .35rem; display: block; }
.eyebrow::first-letter { text-transform: uppercase; }

/* ---------- botones ---------- */
.btn { --b: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .7rem 1.15rem; border-radius: 10px; border: 1px solid var(--b); background: var(--b); color: var(--brand-ink); font: 600 .95rem/1.1 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s, transform .08s, box-shadow .15s; min-height: 44px; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-off { opacity: .5; pointer-events: none; }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-2); border-color: var(--brand); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn-danger { --b: var(--bad); background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #8c2820; border-color: #8c2820; color: #fff; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; min-height: 36px; border-radius: 8px; }
.btn-lg { padding: .95rem 1.5rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ---------- tarjetas y estructura ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow-s); }
.card-flat { box-shadow: none; }
.card h3 { margin-bottom: .4rem; }
.grid { display: grid; gap: 1.1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.stack > * + * { margin-top: 1rem; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.page-head { margin-bottom: 1.75rem; }
.page-head p { color: var(--ink-2); max-width: 62ch; font-size: 1.05rem; }
.section { margin-top: 2.25rem; }
.section > h2 { margin-bottom: 1rem; }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ---------- distintivos, progreso ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 99px; font: 600 .76rem/1.4 var(--sans); background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.ok > i { background: var(--ok); }
.bar-lg { height: 12px; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--muted); font-size: .88rem; }
.meta span { display: inline-flex; align-items: center; gap: .35rem; }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-track { stroke: var(--surface-3); }
.ring .ring-val { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.2, .8, .2, 1); }
.ring .ring-txt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 600 1.7rem/1 var(--serif); }
.ring .ring-txt small { display: block; font: 500 .72rem/1.2 var(--sans); color: var(--muted); margin-top: .15rem; }

/* ---------- alertas y avisos ---------- */
.flash { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-s); border: 1px solid; margin-bottom: 1rem; font-size: .95rem; }
.flash.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash.error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.flash.aviso { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.flash.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.flash p { margin: 0; color: inherit; word-break: break-word; }
.nota { display: flex; gap: .75rem; padding: 1rem 1.1rem; border-radius: var(--radius-s); background: var(--surface-2); border-left: 3px solid var(--brand); color: var(--ink-2); font-size: .95rem; }
.nota.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--ink-2); }
.nota p { margin: 0; }

/* ---------- formularios ---------- */
label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field { margin-bottom: 1.1rem; }
.field > label { display: block; margin-bottom: .35rem; }
.field .hint { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: .72rem .85rem; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 400 1rem/1.4 var(--sans); min-height: 44px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .22rem; }
.errores { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-s); padding: .9rem 1.1rem; margin-bottom: 1.25rem; font-size: .93rem; }
.errores ul { margin: 0; padding-left: 1.1rem; }

/* ---------- tablas ---------- */
.tabla-wrap { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
table.tabla, table.t { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.tabla th, table.tabla td, table.t th, table.t td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.tabla thead th, table.t thead th { background: var(--surface-2); font: 600 .8rem/1.3 var(--sans); color: var(--ink-2); position: sticky; top: 0; white-space: nowrap; }
table.tabla tbody th { font-weight: 600; color: var(--brand-2); background: color-mix(in srgb, var(--brand-soft) 45%, transparent); width: 24%; }
table.tabla tr:last-child td, table.tabla tr:last-child th, table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 35%, transparent); }
table.t td.num, table.t th.num { text-align: right; }

/* ==========================================================================
   Layout público
   ========================================================================== */
.pub-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.pub-top .in { max-width: var(--maxw); margin: 0 auto; padding: .85rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.marca { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); font: 600 1.15rem/1 var(--serif); }
.marca-sello { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.marca small { display: block; font: 500 .72rem/1.2 var(--sans); color: var(--muted); letter-spacing: 0; }
.pub-nav { display: flex; gap: .4rem; align-items: center; }
.pub-nav a:not(.btn) { padding: .5rem .8rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; }
.pub-nav a:not(.btn):hover { background: var(--surface-2); color: var(--ink); }
.pub-main { min-height: 62vh; }
.pub-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.pub-foot { margin-top: 5rem; border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; color: var(--muted); font-size: .88rem; }
.pub-foot .in { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.pub-foot p { margin: 0 0 .35rem; max-width: 62ch; }

.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.4vw, 4rem); line-height: 1.05; margin-bottom: 1rem; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero .lead { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); color: var(--ink-2); max-width: 54ch; margin-bottom: 1.6rem; line-height: 1.55; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1.4rem; }
.hero-card h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.hero-q { font: italic 500 1.35rem/1.4 var(--serif); color: var(--ink); border-left: 3px solid var(--brand); padding-left: 1rem; margin: 0 0 1.1rem; }
.hero-pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.hero-pasos li { display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem; border-radius: 9px; background: var(--surface-2); font-size: .93rem; }
.hero-pasos b { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 600 .8rem/1 var(--sans); flex: none; }
.compe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.compe { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.compe h3 { font-size: 1.15rem; margin-bottom: .3rem; display: flex; align-items: center; gap: .5rem; }
.compe h3 i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.compe p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.prog-lista { display: grid; gap: .75rem; }
.prog-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prog-item .n { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font: 600 1.4rem/1 var(--serif); }
.prog-item.pronto { opacity: .62; }
.prog-item.pronto .n { background: var(--surface-3); color: var(--muted); }
.prog-item h3 { margin: 0 0 .15rem; font-size: 1.15rem; }
.prog-item p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.formato { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.formato .card { padding: 1.1rem; }
.formato h3 { font-size: 1.05rem; display: flex; gap: .5rem; align-items: center; }
.formato p { margin: 0; color: var(--ink-2); font-size: .92rem; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .compe-grid { grid-template-columns: repeat(2, 1fr); } .formato { grid-template-columns: repeat(2, 1fr); } .pub-nav .hide-s { display: none; } }
@media (max-width: 560px) { .compe-grid, .formato { grid-template-columns: 1fr; } .prog-item { grid-template-columns: 44px 1fr; } .prog-item > :last-child { grid-column: 2; } }

.auth { max-width: 470px; margin: clamp(2rem, 6vw, 4.5rem) auto; padding: 0 1.25rem; }
.auth-wide { max-width: 640px; }
.auth h1 { font-size: 2rem; margin-bottom: .4rem; }
.auth .sub { color: var(--ink-2); margin-bottom: 1.6rem; }
.auth .card { padding: 1.75rem; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.2rem; font-size: .9rem; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .cols-2 { grid-template-columns: 1fr; } }

/* ==========================================================================
   Layout aula / admin (con barra lateral)
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 1.1rem .9rem 1rem; display: flex; flex-direction: column; gap: 1rem; z-index: 40; }
.side .marca { padding: .2rem .35rem .6rem; }
.nav-g { display: grid; gap: 2px; }
.nav-g h4 { font: 600 .72rem/1 var(--sans); color: var(--muted); margin: 1rem .6rem .35rem; letter-spacing: .01em; }
.nav-a { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .94rem; position: relative; }
.nav-a:hover { background: var(--surface-2); color: var(--ink); }
.nav-a.on { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.nav-a .tag { margin-left: auto; font: 600 .72rem/1 var(--sans); background: var(--accent); color: #fff; padding: .2rem .45rem; border-radius: 99px; }
.nav-a .lock { margin-left: auto; color: var(--muted); }
.nav-mod { display: flex; align-items: center; gap: .6rem; }
.nav-mod .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 .72rem/1 var(--sans); background: var(--surface-3); color: var(--ink-2); flex: none; }
.nav-mod .dot.done { background: var(--ok); color: #fff; }
.nav-mod .dot.cur { background: var(--brand); color: var(--brand-ink); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: .9rem; display: grid; gap: .6rem; }
.usr { display: flex; align-items: center; gap: .7rem; padding: .3rem .35rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 600 .9rem/1 var(--sans); flex: none; }
.usr b { display: block; font-size: .9rem; line-height: 1.25; }
.usr small { color: var(--muted); }
.side-btns { display: flex; gap: .4rem; }
.side-btns .btn { flex: 1; }
.main { padding: clamp(1.25rem, 3vw, 2.5rem); max-width: 1240px; width: 100%; }
.topbar { display: none; }
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(88vw, 320px); transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5, 14, 6, .5); z-index: 35; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .main { padding: 1.1rem 1rem 3rem; }
}
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs span { opacity: .6; }

/* ---------- panel del alumno ---------- */
.bienvenida { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: stretch; margin-bottom: 1.4rem; }
.continuar { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: 18px; padding: clamp(1.4rem, 3vw, 2.1rem); position: relative; overflow: hidden; border: 0; }
.continuar::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 0 0 36px rgba(255, 255, 255, .04), 0 0 0 76px rgba(255, 255, 255, .03); pointer-events: none; }
.continuar .eyebrow { color: rgba(255, 255, 255, .8); }
.continuar h2 { color: #fff; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); margin-bottom: .4rem; }
.continuar p { color: rgba(255, 255, 255, .85); margin-bottom: 1.2rem; max-width: 46ch; }
.continuar .btn { background: #fff; color: var(--brand-2); border-color: #fff; }
.continuar .btn:hover { background: #eef7f5; }
:root[data-tema="oscuro"] .continuar { background: linear-gradient(135deg, #1c5a14, #0f3a0f); }
.mini-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.kpi .v { font: 600 1.9rem/1.05 var(--serif); letter-spacing: -.02em; }
.kpi .v small { font: 500 .85rem/1 var(--sans); color: var(--muted); letter-spacing: 0; margin-left: .2rem; }
.kpi .l { color: var(--muted); font-size: .84rem; margin-top: .35rem; }
.kpi .d { font-size: .8rem; margin-top: .3rem; color: var(--ok); }
@media (max-width: 900px) { .bienvenida { grid-template-columns: 1fr; } }

.mods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.mod { display: flex; flex-direction: column; gap: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; text-decoration: none; color: inherit; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.mod:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.mod-n { font: italic 500 1rem/1 var(--serif); color: var(--brand); }
.mod h3 { margin: 0; font-size: 1.25rem; }
.mod p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.mod .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.mod.lock { opacity: .72; background: var(--surface-2); }
.mod.soon { background: transparent; border-style: dashed; opacity: .75; }
@media (max-width: 760px) { .mods { grid-template-columns: 1fr; } }

.lec-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.lec { display: grid; grid-template-columns: 38px 1fr auto; gap: .9rem; align-items: center; padding: .95rem 1.15rem; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .12s; }
.lec:last-child { border-bottom: 0; }
a.lec:hover { background: var(--surface-2); color: inherit; }
.lec-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); font: 600 .85rem/1 var(--sans); }
.lec.done .lec-ico { background: var(--ok); color: #fff; }
.lec.next .lec-ico { background: var(--brand); color: var(--brand-ink); }
.lec b { display: block; font-weight: 600; line-height: 1.3; }
.lec .meta { font-size: .8rem; margin-top: .15rem; }
.lec.off { opacity: .55; }

.comp-wrap { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 1.5rem; align-items: center; }
.comp-leyenda { display: grid; gap: .55rem; }
.comp-it { display: grid; grid-template-columns: 90px 1fr 42px; gap: .7rem; align-items: center; font-size: .9rem; }
.comp-it b { font-weight: 600; }
.comp-it .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .comp-wrap { grid-template-columns: 1fr; } }

/* ==========================================================================
   Lección
   ========================================================================== */
.lec-head { margin-bottom: 1.4rem; }
.lec-head h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.7rem); margin-bottom: .6rem; }
.lec-head .lead { font-family: var(--serif); font-size: 1.2rem; color: var(--ink-2); max-width: 60ch; line-height: 1.5; }
.lec-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 2rem; align-items: start; }
.lec-aside { position: sticky; top: 1rem; display: grid; gap: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; padding-bottom: 1rem; }
.aside-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.aside-box h4 { font: 600 .78rem/1 var(--sans); color: var(--muted); margin: 0 0 .7rem; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.toc a { display: block; padding: .38rem .6rem; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-size: .88rem; line-height: 1.35; border-left: 2px solid transparent; }
.toc a:hover { background: var(--surface-2); }
.toc a.on { color: var(--brand-2); border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.nota-txt { min-height: 130px; font-size: .92rem; }
.guardado { font-size: .78rem; color: var(--muted); margin-top: .35rem; min-height: 1.1em; }
.leer-prog { position: sticky; top: 0; height: 3px; background: transparent; z-index: 25; margin: 0 calc(-1 * clamp(1.25rem, 3vw, 2.5rem)) 1rem; }
.leer-prog i { display: block; height: 100%; width: 0; background: var(--brand); }
@media (max-width: 1100px) { .lec-grid { grid-template-columns: 1fr; } .lec-aside { position: static; max-height: none; } }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0a130b; margin-bottom: 1.75rem; box-shadow: var(--shadow); }
.video-el { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video-ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1.5rem; color: #cfe3df; background:
  radial-gradient(circle at 20% 15%, rgba(77, 183, 174, .22), transparent 45%), radial-gradient(circle at 85% 90%, rgba(180, 83, 26, .2), transparent 45%), linear-gradient(160deg, #13301a, #0a1a0c); }
.video-ph .play { width: 74px; height: 74px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5); display: grid; place-items: center; margin: 0 auto 1.1rem; color: #fff; }
.video-ph b { display: block; font: 600 1.2rem/1.3 var(--serif); color: #fff; margin-bottom: .3rem; }
.video-ph span { font-size: .92rem; opacity: .8; }
.video-ph small { display: block; margin-top: .9rem; opacity: .6; }

.claves { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 2rem 0; }
.claves h3 { font-size: 1.15rem; margin-bottom: .6rem; color: var(--brand-2); }
.claves ul { margin: 0; padding-left: 1.2rem; }
.claves li { margin-bottom: .4rem; color: var(--ink); }
.objetivos { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.objetivos li { font-size: .88rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: .3rem .8rem; color: var(--ink-2); }

/* texto del manual */
.manual { font-family: var(--serif); font-size: 1.2rem; line-height: 1.7; color: var(--ink); max-width: 68ch; }
.manual h2 { font-size: 1.75rem; margin: 2.6rem 0 .8rem; scroll-margin-top: 1rem; }
.manual .man-sec:first-child h2 { margin-top: 0; }
.manual h3 { font-size: 1.35rem; margin: 2rem 0 .6rem; color: var(--brand-2); }
.manual h4 { font-size: 1.15rem; margin: 1.6rem 0 .4rem; }
.manual p { margin-bottom: 1.1em; }
.manual ul, .manual ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.manual li { margin-bottom: .45em; }
.manual li::marker { color: var(--brand); }
.manual strong { font-weight: 650; }
.manual .cita { margin: 1.6rem 0; padding: 1.1rem 1.4rem; background: var(--surface); border-left: 3px solid var(--brand); border-radius: 0 var(--radius-s) var(--radius-s) 0; font-style: italic; font-size: 1.12rem; color: var(--ink); box-shadow: var(--shadow-s); }
.manual .man-frases .cita { margin: .8rem 0; border-color: var(--accent); }
.manual .tabla-wrap { font-family: var(--sans); }
.manual table.tabla { font-size: .9rem; line-height: 1.5; }
.manual .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; font-family: var(--sans); }
.manual .duo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; font-size: .95rem; line-height: 1.55; }
.manual .duo-card:first-child { border-top: 3px solid var(--bad); }
.manual .duo-card:last-child { border-top: 3px solid var(--ok); }
.manual .duo-t { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: .5rem; }
.manual .duo-card p { margin: 0 0 .4em; }
@media (max-width: 640px) { .manual { font-size: 1.1rem; } .manual .duo { grid-template-columns: 1fr; } }

/* comprobación inmediata */
.chk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin: 2rem 0; box-shadow: var(--shadow-s); }
.chk-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; gap: 1rem; }
.chk-h h3 { margin: 0; font-size: 1.15rem; }
.chk .fb { margin-top: 1rem; padding: .95rem 1.1rem; border-radius: var(--radius-s); font-size: .95rem; line-height: 1.55; font-family: var(--sans); }
.chk .fb.ok { background: var(--ok-soft); color: var(--ink); border-left: 3px solid var(--ok); }
.chk .fb.no { background: var(--bad-soft); color: var(--ink); border-left: 3px solid var(--bad); }
.chk .fb b { display: block; margin-bottom: .25rem; }
.chk .fb .ref { display: block; margin-top: .45rem; color: var(--muted); font-size: .82rem; }
.chk-pie { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; }

.nav-lec { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.nav-lec .btn { min-width: 160px; }
.hecho-bar { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: .8rem 0; margin-top: 2rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; z-index: 20; }

/* preguntas */
.preg { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
.preg legend { display: flex; gap: .85rem; align-items: flex-start; padding: 0; margin-bottom: .9rem; font: 600 1.08rem/1.5 var(--sans); float: left; width: 100%; }
.preg legend + * { clear: both; }
.preg-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font: 600 .85rem/1 var(--sans); margin-top: .1rem; }
.preg-enun { flex: 1; }
.preg-ctx { background: var(--surface-2); border-radius: var(--radius-s); padding: .9rem 1.1rem; margin-bottom: .9rem; font-size: .95rem; }
.preg-ops { display: grid; gap: .55rem; padding-left: 0; }
.op { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem .95rem; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s; font-weight: 400; font-size: .98rem; line-height: 1.5; }
.op:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 50%, var(--surface)); }
.op input { margin-top: .25rem; }
.op:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.op-let { flex: none; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-3); display: grid; place-items: center; font: 600 .78rem/1 var(--sans); color: var(--ink-2); margin-top: .05rem; }
.op-txt { flex: 1; }
.op.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.op.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.preg-nota { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.orden { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.orden li { display: flex; gap: .7rem; align-items: center; padding: .7rem .85rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); cursor: grab; user-select: none; }
.orden li.drag { opacity: .45; border-style: dashed; }
.orden li.over { border-color: var(--brand); background: var(--brand-soft); }
.orden-asa { color: var(--muted); letter-spacing: -.15em; }
.orden-txt { flex: 1; }
.orden-btns { display: flex; gap: .25rem; }
.mini { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); cursor: pointer; font-size: 1rem; line-height: 1; }
.mini:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.parejas { display: grid; gap: .6rem; }
.pareja { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .8rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.pareja-l { font-weight: 600; font-size: .95rem; }
.pareja select { font-size: .92rem; padding: .55rem .6rem; }
@media (max-width: 640px) { .pareja { grid-template-columns: 1fr; } }

/* ==========================================================================
   Examen
   ========================================================================== */
.ex-top { position: sticky; top: 0; z-index: 25; background: color-mix(in srgb, var(--bg) 93%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin: calc(-1 * clamp(1.25rem, 3vw, 2.5rem)) calc(-1 * clamp(1.25rem, 3vw, 2.5rem)) 1.75rem; padding: .85rem clamp(1.25rem, 3vw, 2.5rem); }
.ex-top .in { display: flex; align-items: center; gap: 1.25rem; justify-content: space-between; flex-wrap: wrap; }
.reloj { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .85rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); font: 600 1rem/1 var(--sans); font-variant-numeric: tabular-nums; }
.reloj.poco { background: var(--bad-soft); color: var(--bad); border-color: transparent; animation: latido 1s infinite; }
@keyframes latido { 50% { opacity: .6; } }
.puntos { display: flex; gap: .35rem; flex-wrap: wrap; }
.puntos button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; font: 600 .78rem/1 var(--sans); }
.puntos button.resp { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-2); }
.puntos button.cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.25rem, 3vw, 2rem); max-width: 820px; margin: 0 auto; box-shadow: var(--shadow-s); }
.ex-nav { display: flex; justify-content: space-between; gap: 1rem; max-width: 820px; margin: 1.2rem auto 0; }
.ex-paso { display: none; }
.ex-paso.on { display: block; animation: entra .25s ease; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* resultado */
.res-hero { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.5rem; }
.res-hero.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.res-hero h1 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); margin-bottom: .4rem; }
@media (max-width: 640px) { .res-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; } }
.rev { background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-s); padding: 1.1rem 1.25rem; margin-bottom: .9rem; }
.rev.ok { border-left-color: var(--ok); }
.rev.no { border-left-color: var(--bad); }
.rev.par { border-left-color: var(--warn); }
.rev h4 { font: 600 1rem/1.5 var(--sans); margin: 0 0 .6rem; }
.rev dl { margin: 0; display: grid; grid-template-columns: 130px 1fr; gap: .35rem .9rem; font-size: .92rem; }
.rev dt { color: var(--muted); }
.rev dd { margin: 0; }
.rev .exp { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--line-2); font-size: .92rem; color: var(--ink-2); }
@media (max-width: 560px) { .rev dl { grid-template-columns: 1fr; } }

/* ==========================================================================
   Caso clínico
   ========================================================================== */
.caso-intro { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; }
.caso-ficha { display: inline-block; font: italic 500 1rem/1 var(--serif); color: var(--accent); margin-bottom: .6rem; }
.caso-texto { font-family: var(--serif); font-size: 1.18rem; line-height: 1.7; }
.caso-paso { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.25rem, 3vw, 1.75rem); margin-top: 1.25rem; }
.caso-paso .ctx { color: var(--ink-2); font-family: var(--serif); font-size: 1.1rem; margin-bottom: 1.1rem; }
.caso-paso h3 { font-size: 1.25rem; }
.caso-op { display: block; width: 100%; text-align: left; padding: .9rem 1rem; margin-top: .55rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); cursor: pointer; font: 400 .97rem/1.5 var(--sans); color: var(--ink); }
.caso-op:hover:not([disabled]) { border-color: var(--brand); background: var(--brand-soft); }
.caso-op[disabled] { cursor: default; }
.caso-op.p2 { border-color: var(--ok); background: var(--ok-soft); }
.caso-op.p1 { border-color: var(--warn); background: var(--warn-soft); }
.caso-op.p0 { border-color: var(--bad); background: var(--bad-soft); }
.caso-op.dim { opacity: .5; }
.caso-fb { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius-s); background: var(--surface-2); font-size: .95rem; border-left: 3px solid var(--brand); }
.caso-prog { display: flex; gap: .35rem; margin: 1.25rem 0 0; }
.caso-prog i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); }
.caso-prog i.on { background: var(--brand); }
.caso-fin { text-align: center; padding: 1rem 0 .5rem; }

/* ==========================================================================
   Tarjetas (repaso)
   ========================================================================== */
.fc-wrap { max-width: 640px; margin: 0 auto; }
.fc { perspective: 1200px; height: 320px; cursor: pointer; margin: 1.25rem 0; }
.fc-in { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.fc.flip .fc-in { transform: rotateY(180deg); }
.fc-c { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; padding: 1.75rem; text-align: center; overflow-y: auto; }
.fc-c.back { transform: rotateY(180deg); background: var(--brand-soft); text-align: left; place-items: start; align-content: center; }
.fc-c h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem); margin: 0; }
.fc-c p { margin: 0; font-size: 1.02rem; line-height: 1.6; }
.fc-c small { display: block; margin-top: .8rem; color: var(--muted); }
.fc-btns { display: flex; gap: .8rem; justify-content: center; }
.fc-btns .btn { min-width: 150px; }

/* glosario */
.glos { display: grid; gap: .75rem; }
.glos-it { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; scroll-margin-top: 1rem; }
.glos-it h3 { font-size: 1.15rem; margin-bottom: .3rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.glos-it p { margin: 0; color: var(--ink-2); font-size: .96rem; }
.abc { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1.2rem; }
.abc a { min-width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font: 600 .85rem/1 var(--sans); text-decoration: none; }
.abc a:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }

/* biblioteca */
.docs { display: grid; gap: .75rem; }
.doc { display: grid; grid-template-columns: 48px 1fr auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.doc-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--info-soft); color: var(--info); display: grid; place-items: center; }
.doc b { display: block; line-height: 1.3; }
.doc small { color: var(--muted); }
@media (max-width: 560px) { .doc { grid-template-columns: 44px 1fr; } .doc > :last-child { grid-column: 1 / -1; } }

/* tarea */
.escenas { display: grid; gap: .7rem; margin-bottom: 1.5rem; }
.escena { display: flex; gap: .85rem; padding: 1rem 1.1rem; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: pointer; }
.escena:hover { border-color: var(--brand); }
.escena:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.escena input { margin-top: .25rem; }
.escena b { display: block; margin-bottom: .2rem; }
.escena span { font-size: .93rem; color: var(--ink-2); font-weight: 400; }
.rub { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.rub:last-child { border-bottom: 0; }
.rub-sel { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.rub-sel label { padding: .45rem .8rem; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink-2); border-right: 1px solid var(--line-2); background: var(--surface); }
.rub-sel label:last-child { border-right: 0; }
.rub-sel input { position: absolute; opacity: 0; pointer-events: none; }
.rub-sel label:has(input:checked) { background: var(--brand); color: var(--brand-ink); }
.resp-bloque { background: var(--surface-2); border-radius: var(--radius-s); padding: .85rem 1rem; margin-bottom: .75rem; }
.resp-bloque h4 { font: 600 .8rem/1.3 var(--sans); color: var(--muted); margin: 0 0 .3rem; }
.resp-bloque p { margin: 0; white-space: pre-wrap; font-size: .95rem; }

/* certificado (pantalla) */
.cert-req { display: grid; gap: .6rem; }
.cert-req li { list-style: none; display: flex; gap: .7rem; align-items: center; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cert-req .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.cert-req .ok .ic { background: var(--ok); color: #fff; }
.cert-prev { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; text-align: center; }

/* ==========================================================================
   Gráficos (SVG generados por graficos.js)
   ========================================================================== */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); fill: var(--muted); font-size: 11px; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); }
.chart .lbl-v { fill: var(--ink); font-weight: 600; font-size: 11px; }
.chart .bar-r { fill: var(--brand); transition: opacity .15s; }
.chart .bar-r:hover { opacity: .8; }
.chart .l-line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .l-area { fill: var(--brand); opacity: .12; }
.chart .dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.chart .rad-poly { fill: var(--brand); fill-opacity: .2; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
.chart .rad-web { fill: none; stroke: var(--line-2); }
.chart .rad-dot { fill: var(--brand); }
.chart .rad-lbl { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--bg); padding: .4rem .65rem; border-radius: 7px; font: 500 .8rem/1.3 var(--sans); opacity: 0; transition: opacity .1s; max-width: 220px; }
.leyenda { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .83rem; color: var(--ink-2); margin-top: .6rem; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.chart-vacio { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: .92rem; }

/* ==========================================================================
   Diagramas interactivos
   ========================================================================== */
.diag { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1rem, 2.5vw, 1.6rem); margin: 2rem 0; font-family: var(--sans); box-shadow: var(--shadow-s); }
.diag-h { margin-bottom: 1rem; }
.diag-h b { display: block; font: 600 1.15rem/1.3 var(--serif); color: var(--ink); }
.diag-h span { color: var(--muted); font-size: .88rem; }
.diag svg text { font-family: var(--sans); }
.diag-det { margin-top: 1rem; padding: 1rem 1.15rem; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--brand); font-size: .95rem; line-height: 1.6; min-height: 5.5rem; }
.diag-det b { display: block; font: 600 1.05rem/1.3 var(--serif); margin-bottom: .25rem; }
.dg-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.dg-tab { padding: .5rem .9rem; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; font: 600 .86rem/1 var(--sans); }
.dg-tab:hover { border-color: var(--brand); color: var(--brand); }
.dg-tab.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.dg-nodo { cursor: pointer; transition: opacity .15s; }
.dg-nodo:hover { opacity: .85; }
.dg-nodo.on rect, .dg-nodo.on circle, .dg-nodo.on path { stroke: var(--brand) !important; stroke-width: 3 !important; }
.dg-pasos { display: grid; gap: .6rem; }
.dg-paso { display: grid; grid-template-columns: 42px 1fr; gap: .9rem; align-items: start; padding: .85rem 1rem; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--surface); text-align: left; width: 100%; font: inherit; color: inherit; }
.dg-paso:hover { border-color: var(--brand); }
.dg-paso.on { border-color: var(--brand); background: var(--brand-soft); }
.dg-paso .n { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font: 600 1rem/1 var(--serif); color: var(--ink-2); }
.dg-paso.on .n { background: var(--brand); color: var(--brand-ink); }
.dg-paso b { display: block; line-height: 1.3; }
.dg-paso span { color: var(--ink-2); font-size: .9rem; }
.dg-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.dg-col { border: 1px solid var(--line-2); border-radius: 14px; padding: 1rem; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, background .15s; }
.dg-col:hover, .dg-col.on { border-color: var(--brand); background: var(--brand-soft); }
.dg-col h4 { margin-bottom: .2rem; }
.dg-col .t { font: italic 500 .95rem/1.2 var(--serif); color: var(--accent); margin-bottom: .4rem; display: block; }
.dg-col p { margin: 0; font-size: .88rem; color: var(--ink-2); }
@media (max-width: 700px) { .dg-cols { grid-template-columns: 1fr; } }
.dg-range, .dg-rango { width: 100%; accent-color: var(--brand); }
.dg-escala { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: .25rem; }

/* ==========================================================================
   Administración
   ========================================================================== */
.adm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
@media (max-width: 1000px) { .adm-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .adm-kpis { grid-template-columns: 1fr; } }
.panel-t { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.panel-t h3 { margin: 0; font-size: 1.1rem; }
.panel-t small { color: var(--muted); }
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filtros input[type=search] { max-width: 300px; }
.filtros select { width: auto; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { padding: .4rem .8rem; border-radius: 99px; border: 1px solid var(--line-2); font: 600 .82rem/1 var(--sans); color: var(--ink-2); text-decoration: none; background: var(--surface); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font-size: .9rem; text-decoration: none; color: var(--ink-2); background: var(--surface); }
.pager .on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.persona { display: flex; gap: .7rem; align-items: center; }
.persona .avatar { width: 34px; height: 34px; font-size: .8rem; }
.persona b { display: block; line-height: 1.25; }
.persona small { color: var(--muted); }
.mini-bar { display: flex; align-items: center; gap: .6rem; min-width: 130px; }
.mini-bar .bar { flex: 1; height: 6px; }
.mini-bar span { font: 600 .82rem/1 var(--sans); font-variant-numeric: tabular-nums; }
.tabs-bar { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; overflow-x: auto; }
.tabs-bar a { padding: .7rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs-bar a.on { color: var(--brand); border-color: var(--brand); }
.embudo { display: grid; gap: .8rem; }
.emb-row { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; align-items: center; font-size: .9rem; }
.emb-bars { display: grid; gap: 3px; }
.emb-bars i { display: block; height: 14px; border-radius: 4px; min-width: 2px; position: relative; }
.emb-bars i b { position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); font: 600 .75rem/1 var(--sans); color: var(--ink-2); white-space: nowrap; }
.emb-bars i:nth-child(1) { background: color-mix(in srgb, var(--brand) 38%, var(--surface)); }
.emb-bars i:nth-child(2) { background: color-mix(in srgb, var(--brand) 68%, var(--surface)); }
.emb-bars i:nth-child(3) { background: var(--brand); }
.det-q { background: var(--surface-2); border-radius: var(--radius-s); padding: 1rem 1.2rem; margin: .4rem 0 1rem; font-size: .93rem; }
.acciones-adm { display: flex; flex-wrap: wrap; gap: .6rem; }
.acciones-adm form { display: inline-flex; gap: .4rem; align-items: center; }
details.plegable { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); margin-bottom: .6rem; }
details.plegable > summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
details.plegable > summary::-webkit-details-marker { display: none; }
details.plegable[open] > summary { border-bottom: 1px solid var(--line); }
details.plegable > div { padding: 1rem; }

@media print {
  .side, .topbar, .no-print, .hecho-bar { display: none !important; }
  body { background: #fff; }
}

/* modo examen: sin barra lateral, para concentrarse */
body.modo-examen .side, body.modo-examen .topbar { display: none; }
body.modo-examen .shell { grid-template-columns: 1fr; }
body.modo-examen .main { max-width: 1000px; margin: 0 auto; }

@media (max-width: 640px) {
  .hecho-bar { position: static; flex-direction: column; align-items: stretch; background: transparent; backdrop-filter: none; border-top: 0; padding: 0; }
  .hecho-bar .btn-row { width: 100%; }
  .hecho-bar .btn-row .btn { flex: 1 1 100%; }
  .nav-lec .btn { width: 100%; }
}

.consulta-it { border-bottom: 1px dashed var(--line-2); margin-bottom: .7rem; padding-bottom: .5rem; }
.resp-t { margin: 0 0 .6rem; padding: .55rem .7rem; background: var(--brand-soft); border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: .7rem 1rem; border-radius: 0 0 8px 0; font-weight: 600; text-decoration: none; }
.skip:focus { left: 0; }

@media (max-width: 560px) {
  .pub-top .in { padding: .6rem 1rem; gap: .5rem; }
  .pub-top .marca { font-size: 1rem; min-width: 0; }
  .pub-top .marca small { display: none; }
  .pub-nav { gap: .25rem; flex-shrink: 0; }
  .pub-nav .btn { padding: .5rem .75rem; min-height: 38px; font-size: .85rem; }
  .pub-nav [data-tema-toggle] { display: none; }
}
.fila-partes td { padding-top: 0; border-top: 0; }
.fila-partes summary { cursor: pointer; padding: .25rem 0; }
.partes-adm { display: grid; gap: .35rem; margin: .5rem 0 .6rem; }
.partes-adm label { display: grid; grid-template-columns: 26px minmax(160px, 1fr) minmax(220px, 1.4fr); gap: .6rem; align-items: center; font-size: .86rem; }
.partes-adm .pn { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font: 600 .7rem/1 var(--sans); }
.partes-adm input { padding: .4rem .6rem; font-size: .85rem; }
@media (max-width: 760px) { .partes-adm label { grid-template-columns: 26px 1fr; } .partes-adm input { grid-column: 1 / -1; } }
/* diagramas de psicología: color propio en pasos y apego */
.dg-paso[style*="--c"].on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.dg-paso[style*="--c"].on .n { background: var(--c); color: #fff; }
.diag-det[style*="--c"] { border-left-color: var(--c); }
.diag-det i { font-style: normal; font-weight: 700; color: var(--c, var(--brand)); }
.dg-apego { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr 22px; gap: .4rem; }
.dg-apego-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: .8rem; color: var(--muted); }
.dg-apego-x { grid-column: 2; text-align: center; font-size: .8rem; color: var(--muted); }
.dg-apego-g { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.dg-apego-c { border: 2px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 14px; padding: 1.1rem .9rem; background: color-mix(in srgb, var(--c) 7%, var(--surface)); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: background .15s, transform .15s; }
.dg-apego-c b { display: block; font: 600 1.05rem/1.2 var(--serif); color: var(--c); }
.dg-apego-c small { color: var(--muted); }
.dg-apego-c.on { background: var(--c); transform: scale(1.02); }
.dg-apego-c.on b, .dg-apego-c.on small { color: #fff; }
.dg-col .t { font: 700 .82rem/1.2 var(--sans); font-style: normal; color: var(--c, var(--accent)); }
.dg-tipo.on circle { fill: var(--c) !important; }

/* tarjetas ilustradas de la portada */
.e-pieza { border-top: 4px solid var(--c); overflow: hidden; }
.e-pieza-img { display: block; aspect-ratio: 16/9; margin: -1.4rem -1.4rem 1rem; background-size: cover; background-position: center right; }

/* esquemas del rostro */
.dg-cara { width: 100%; max-width: 230px; display: block; margin: 0 auto; }
.dg-nota { font-size: .8rem; color: var(--muted); margin: .8rem 0 0; }
.dg-emociones { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.dg-emo-cara { display: block; width: 86px; margin: 0 auto .3rem; }
.dg-emo-cara .dg-cara { max-width: 86px; }

/* esquemas de psicología transpersonal */
.dg-fig { width: 100%; max-width: 320px; display: block; margin: 0 auto; }
.dg-zona { cursor: pointer; outline: none; }
.dg-zona > :first-child { opacity: .45; transition: opacity .15s; }
.dg-zona:hover > :first-child, .dg-zona:focus > :first-child { opacity: .7; }
.dg-zona.on > :first-child { opacity: 1; }
.dg-zona text { font: 600 13px var(--sans); fill: #fff; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.25); stroke-width: 2px; }
.dg-col h4 { margin: .2rem 0 0; }
