:root {
  --paper: #F6F8FA;
  --surface: #FFFFFF;
  --ink: #13233A;
  --muted: #4D5B6A;
  --line: #D8DFE7;
  --tint: #EAF0F6;
  --accent: #1F4F8F;
  --dorsal: #A9661A;
  --ventral: #1F7A70;
  --lesion: #A8402F;
  --violet: #6B5B95;
  --ok: #1F7A70;
  --bad: #A8402F;
  --brain: #F3F6F9;
  --brain-line: #6F7C89;
  --sulcus: #9BA7B3;
  --r-front: #4F86C0;
  --r-temp: #3E9B91;
  --r-par: #8C7BB5;
  --r-aud: #13233A;
  --plate: #FFFFFF;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --radius-s: 6px;
  --radius-m: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1828; --surface: #152238; --ink: #E6EDF5; --muted: #A7B4C4; --line: #2B3B55; --tint: #1B2B45;
    --accent: #8DB5F2; --dorsal: #E3A452; --ventral: #52B8AB; --lesion: #E58474; --violet: #B3A4DC; --ok: #52B8AB; --bad: #E58474;
    --brain: #1E2E48; --brain-line: #8FA0B5; --sulcus: #5D6F88; --r-front: #6FA3DD; --r-temp: #4FB6AA; --r-par: #A898D6; --r-aud: #E6EDF5; --plate: #EEF2F6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1828; --surface: #152238; --ink: #E6EDF5; --muted: #A7B4C4; --line: #2B3B55; --tint: #1B2B45;
  --accent: #8DB5F2; --dorsal: #E3A452; --ventral: #52B8AB; --lesion: #E58474; --violet: #B3A4DC; --ok: #52B8AB; --bad: #E58474;
  --brain: #1E2E48; --brain-line: #8FA0B5; --sulcus: #5D6F88; --r-front: #6FA3DD; --r-temp: #4FB6AA; --r-par: #A898D6; --r-aud: #E6EDF5; --plate: #EEF2F6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(76px + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Barra superior ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--surface); z-index: 31; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 10px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.brand svg { width: 34px; height: 34px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: var(--radius-s); font-size: 0.97rem; }
.nav a:hover { color: var(--ink); background: var(--tint); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--tint); font-weight: 700; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-s); width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; }

/* ---------- Estructura general ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 0 24px 80px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.7rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.3rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 0.9em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- Portada ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr); gap: 48px; align-items: center; padding: 56px 0 40px; }
.hero h1 { margin-bottom: 18px; }
.hero-visual { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.legend-streams { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.95rem; margin: 6px 4px 0; color: var(--muted); }
.legend-streams span::before { content: ""; display: inline-block; width: 22px; height: 5px; border-radius: 3px; margin-right: 8px; vertical-align: middle; background: currentColor; }
.legend-streams .d { color: var(--dorsal); }
.legend-streams .v { color: var(--ventral); }
.legend-streams .d b, .legend-streams .v b { color: var(--ink); }

.band { padding: 44px 0; border-top: 1px solid var(--line); }
.band > h2 { margin-bottom: 8px; }
.band > .lead { margin-bottom: 26px; }
.tag-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px 28px; }
.tag-legend div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tag-legend p { margin: 0; color: var(--muted); font-size: 0.97rem; }

.sessions { display: grid; gap: 0; }
.session-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.session-row:hover h3 { text-decoration: underline; text-underline-offset: 0.15em; }
.session-num { font-family: var(--serif); font-size: 3.2rem; line-height: 1; color: var(--accent); font-weight: 400; }
.session-row p { margin: 6px 0 0; color: var(--muted); }
.session-meta { color: var(--muted); font-size: 0.95rem; text-align: right; white-space: nowrap; }

.practice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.practice a { display: block; padding: 22px; border-radius: var(--radius-m); background: var(--tint); color: var(--ink); text-decoration: none; }
.practice a:hover { outline: 2px solid var(--line); }
.practice strong { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin-bottom: 6px; }
.practice span { color: var(--muted); }

/* ---------- Etiquetas de evidencia ---------- */
.tag { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; font-weight: 700; color: var(--ink); padding: 3px 10px 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; }
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); }
.tag.est { --c: var(--accent); } .tag.mod { --c: #5B8FC4; } .tag.deb { --c: var(--dorsal); }
.tag.hist { --c: var(--muted); } .tag.cor { --c: var(--lesion); } .tag.cli { --c: var(--ventral); }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- Vista de sesión ---------- */
.session-head { padding: 48px 0 32px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; }
.session-head .kicker { font-family: var(--serif); font-size: 1.15rem; color: var(--accent); margin-bottom: 8px; display: block; }
.goals { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 22px; }
.goals h2 { font-size: 1.15rem; margin-bottom: 10px; }
.goals ol { margin: 0; padding-left: 1.3em; color: var(--muted); }
.goals li { margin-bottom: 6px; }
.session-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding-top: 32px; }
.toc { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
.toc h2 { font-size: 1rem; font-family: var(--sans); font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: grid; grid-template-columns: 26px 1fr; gap: 4px; color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: var(--radius-s); font-size: 0.92rem; line-height: 1.35; }
.toc a::before { content: counter(t); color: var(--accent); font-weight: 700; }
.toc a:hover, .toc a.active { background: var(--tint); color: var(--ink); }

.topic { padding: 0 0 48px; margin-bottom: 48px; border-bottom: 1px solid var(--line); max-width: 78ch; }
.topic:last-of-type { border-bottom: none; }
.topic-n { font-family: var(--serif); color: var(--accent); font-size: 1.05rem; display: block; margin-bottom: 6px; }
.topic h3 { margin-bottom: 14px; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.topic .content ul, .topic .content ol { padding-left: 1.25em; margin: 0 0 1em; }
.topic .content li { margin-bottom: 6px; }
.topic .content .flow { counter-reset: f; list-style: none; padding: 0; }
.topic .content .flow li { counter-increment: f; position: relative; padding: 8px 0 8px 42px; border-bottom: 1px dashed var(--line); margin: 0; }
.topic .content .flow li::before { content: counter(f); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.timeline-list { list-style: none; padding: 0 !important; border-left: 2px solid var(--line); margin-left: 6px !important; }
.timeline-list li { position: relative; padding: 2px 0 10px 20px; }
.timeline-list li::before { content: ""; position: absolute; left: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.dorsal { color: var(--dorsal); font-weight: 700; } .ventral { color: var(--ventral); font-weight: 700; } .violet { color: var(--violet); font-weight: 700; }
p.debate, p.warn { padding: 12px 16px; border-radius: var(--radius-s); }
p.debate { background: color-mix(in srgb, var(--dorsal) 12%, transparent); }
p.warn { background: color-mix(in srgb, var(--lesion) 11%, transparent); }

.example { background: var(--tint); border-radius: var(--radius-m); padding: 16px 20px; margin: 18px 0; }
.example h4 { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; color: var(--ventral); margin-bottom: 6px; }
.example p:last-child { margin-bottom: 0; }
.key { font-family: var(--serif); font-size: 1.28rem; line-height: 1.4; margin: 22px 0 10px; padding-left: 18px; position: relative; }
.key::before { content: ""; position: absolute; left: 0; top: 0.25em; bottom: 0.25em; width: 4px; border-radius: 2px; background: linear-gradient(var(--dorsal), var(--ventral)); }
.refs { font-size: 0.88rem; color: var(--muted); margin: 0; }
.figure { margin: 18px 0; background: var(--plate); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; }
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption { color: #4D5B6A; font-size: 0.9rem; margin-top: 8px; }

.table-wrap { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--tint); font-weight: 700; }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 700; }

.pager { display: flex; justify-content: space-between; gap: 16px; padding-top: 10px; flex-wrap: wrap; }

/* ---------- Mapa cerebral ---------- */
.brainmap-wrap { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.brainmap-wrap.compact { grid-template-columns: minmax(0, 1fr); }
.brainmap { width: 100%; height: auto; display: block; }
.bm-outline { fill: var(--brain); stroke: var(--brain-line); stroke-width: 3.2; }
.bm-back { fill: color-mix(in srgb, var(--brain) 80%, var(--sulcus)); stroke: var(--brain-line); stroke-width: 2.5; }
.bm-sulcus { fill: none; stroke: var(--sulcus); stroke-linecap: round; }
.bm-region { fill-opacity: 0.5; stroke: transparent; stroke-width: 3; cursor: pointer; transition: fill-opacity .15s; }
.bm-region.g-front { fill: var(--r-front); } .bm-region.g-temp { fill: var(--r-temp); } .bm-region.g-par { fill: var(--r-par); } .bm-region.g-aud { fill: var(--r-aud); fill-opacity: .85; }
.bm-region:hover, .bm-region:focus-visible { fill-opacity: 0.8; outline: none; }
.bm-region.sel { fill-opacity: 0.92; stroke: var(--ink); }
.bm-stream { fill: none; stroke-width: 10; stroke-linecap: round; pointer-events: none; }
.bm-stream.dorsal { stroke: var(--dorsal); } .bm-stream.ventral { stroke: var(--ventral); }
.bm-hit { fill: none; stroke: transparent; stroke-width: 24; cursor: pointer; pointer-events: stroke; }
.bm-hit:focus-visible { outline: none; stroke: color-mix(in srgb, var(--ink) 18%, transparent); }
.bm-stream.sel { stroke-width: 15; }
.draw .bm-stream { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1.6s ease-out .3s forwards; }
.draw .bm-stream.ventral { animation-delay: .9s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .draw .bm-stream { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; } }
.bm-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; min-height: 100%; }
.bm-panel h4 { font-family: var(--serif); font-size: 1.2rem; margin-bottom: 8px; }
.bm-panel dl { margin: 0; }
.bm-panel dt { font-weight: 700; font-size: 0.9rem; color: var(--muted); margin-top: 8px; }
.bm-panel dd { margin: 2px 0 0; }
.bm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { font: inherit; font-size: 0.86rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 11px; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Widgets ---------- */
.widget { margin: 18px 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tl-cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; }
.tl-cell h5 { margin: 0 0 4px; font-size: 0.92rem; color: var(--c); }
.tl-cell p { margin: 0; }
.bars { display: grid; gap: 10px; margin: 8px 0 4px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 48px; gap: 12px; align-items: center; }
.bar-track { height: 26px; background: var(--tint); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bar-row b { text-align: right; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { border-radius: var(--radius-m); padding: 16px 20px; }
.panel h4 { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.panel ul { margin: 0; padding-left: 1.2em; }
.panel.ok { background: color-mix(in srgb, var(--ventral) 12%, transparent); } .panel.ok h4 { color: var(--ventral); }
.panel.bad { background: color-mix(in srgb, var(--lesion) 11%, transparent); } .panel.bad h4 { color: var(--lesion); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: s; }
.step { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; position: relative; }
.step::before { content: counter(s); font-family: var(--serif); font-size: 1.6rem; color: var(--accent); display: block; line-height: 1; margin-bottom: 6px; }
.step strong { display: block; margin-bottom: 4px; }
.step em { display: block; color: var(--muted); font-size: 0.93rem; margin-top: 6px; }
.quad { display: grid; grid-template-columns: 30px repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(110px, auto)) 30px; gap: 8px; }
.quad .ax-y { grid-row: 1 / 3; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.quad .ax-x { grid-column: 2 / 4; text-align: center; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.quad .q { border-radius: var(--radius-m); padding: 14px; display: flex; flex-direction: column; justify-content: center; }
.quad .q strong { font-family: var(--serif); font-size: 1.1rem; }
.q1 { background: color-mix(in srgb, var(--dorsal) 15%, transparent); } .q2 { background: color-mix(in srgb, var(--ventral) 15%, transparent); }
.q3 { background: color-mix(in srgb, var(--lesion) 13%, transparent); } .q4 { background: color-mix(in srgb, var(--accent) 13%, transparent); }

.syn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.syn h4 { font-family: var(--serif); font-size: 1.45rem; margin-bottom: 10px; }
.fcr { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fcr span { font-size: 0.85rem; padding: 3px 10px; border-radius: 999px; background: var(--tint); }
.fcr span b { color: var(--muted); font-weight: 700; margin-right: 4px; }
.prof { display: grid; gap: 6px; margin-bottom: 14px; }
.prof-row { display: grid; grid-template-columns: 120px repeat(5, minmax(0, 1fr)); gap: 4px; align-items: center; font-size: 0.93rem; }
.prof-row i { height: 14px; border-radius: 3px; background: var(--tint); }
.prof-row i.on { background: var(--accent); }
.sample { font-family: var(--serif); font-style: italic; font-size: 1.08rem; background: var(--tint); border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 12px; }
.syn .figure { margin: 0 0 10px; }

/* ---------- Casos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 24px; }
.progress { margin-left: auto; color: var(--muted); font-size: 0.95rem; }
.case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px; margin-bottom: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.case-group { color: var(--accent); font-family: var(--serif); font-size: 1.05rem; }
.case h3 { margin: 2px 0 10px; }
.vignette { font-size: 1.08rem; max-width: 75ch; }
.q-label { font-weight: 700; margin: 8px 0 10px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { font: inherit; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 9px 15px; border-radius: var(--radius-s); cursor: pointer; }
.opt:hover { border-color: var(--ink); }
.opt.right { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); border-color: var(--ok); font-weight: 700; }
.opt.wrong { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); border-color: var(--bad); text-decoration: line-through; }
.feedback { margin-top: 14px; font-weight: 700; min-height: 1.4em; }
.feedback.ok { color: var(--ok); } .feedback.no { color: var(--bad); }
.solution { margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.solution.with-img { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.sol-sec h4 { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; color: var(--ventral); margin: 0 0 3px; }
.sol-sec p { margin: 0 0 10px; }
.dx { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 8px; }
.reveal { font: inherit; background: none; border: none; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 0; margin-top: 12px; justify-self: start; }

/* ---------- Herramientas ---------- */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px; margin-bottom: 28px; }
.tool h2 { font-size: 1.6rem; margin-bottom: 6px; }
.tree-q { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.tree-q fieldset { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin: 0; }
.tree-q legend { font-weight: 700; padding: 0 6px; }
.tree-result { min-height: 90px; }
.myths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.myth { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; background: var(--paper); }
.myth p.m { font-family: var(--serif); font-size: 1.15rem; margin-bottom: 8px; }
.myth p.m::before { content: "Se dice: "; font-family: var(--sans); font-size: 0.85rem; font-weight: 700; color: var(--lesion); display: block; }
.myth .ev { margin-top: 8px; }
.myth .ev strong { color: var(--ventral); }

/* ---------- Bibliografía ---------- */
.search { width: 100%; max-width: 460px; font: inherit; padding: 10px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); margin-bottom: 20px; }
.refs-list { list-style: none; padding: 0; margin: 0 0 32px; columns: 2 360px; column-gap: 40px; }
.refs-list li { break-inside: avoid; margin-bottom: 10px; font-size: 0.95rem; padding-left: 1.2em; text-indent: -1.2em; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
footer .inner { max-width: 1240px; margin: 0 auto; padding: 24px; display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero, .session-head { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .session-body { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px; background: var(--surface); }
  .brainmap-wrap, .syn, .solution.with-img { grid-template-columns: minmax(0, 1fr); }
  .practice { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-q { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .menu-btn { display: grid; margin-left: auto; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 16px 14px; }
  .nav.open { display: flex; }
  .topbar-inner { position: relative; padding: 10px 16px; }
  main { padding: 0 16px 60px; }
  .session-row { grid-template-columns: 56px minmax(0, 1fr); }
  .session-num { font-size: 2.4rem; }
  .session-meta { display: none; }
  .two-col, .tl-grid, .myths { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 110px minmax(0, 1fr) 40px; }
  .prof-row { grid-template-columns: 100px repeat(5, minmax(0, 1fr)); }
}
@media print {
  .topbar, .toc, .btn-row, .pager, footer { display: none; }
  body { background: #fff; color: #000; }
}

/* Los estados ocultos prevalecen sobre los layouts de tarjetas y soluciones. */
[hidden] { display: none !important; }

.portal-return { max-width: 1240px; margin: 0 auto; padding: 8px 24px; font-size: 0.92rem; }
