/* Laboratorio de NotebookLM — tokens y componentes. Paleta institucional inspirada en SENA. */
:root {
  --green: #39A900;
  --green-ink: #2B7A00;      /* verde con contraste AA sobre blanco para texto */
  --navy: #00324D;
  --slate: #334155;
  --mist: #F1F5F9;
  --green-soft: #E8F5E0;
  --amber: #F4C95D;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: var(--mist);
  --text: #1E293B;
  --text-muted: #475569;
  --border: #CBD5E1;
  --accent: var(--green-ink);
  --accent-bg: var(--green-soft);
  --heading: var(--navy);
  --warn-bg: #FFF6DB;
  --warn-ink: #6B4E00;
  --danger-bg: #FDECEC;
  --danger-ink: #9B1C1C;
  --info-bg: #E6F0F5;
  --info-ink: #00324D;
  --focus: #0B6BCB;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(15 23 42 / .06), 0 4px 16px rgb(15 23 42 / .06);
  --font: "Inter", "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  --step--1: clamp(.875rem, .85rem + .1vw, .95rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + .5vw, 1.45rem);
  --step-2: clamp(1.45rem, 1.25rem + 1vw, 2rem);
  --step-3: clamp(1.9rem, 1.5rem + 2vw, 3rem);
  --step-4: clamp(2.4rem, 1.7rem + 3.5vw, 4.4rem);
  --gutter: clamp(1rem, .6rem + 2vw, 2.5rem);
  --header-h: 4.25rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1620; --surface: #10202C; --surface-2: #142836; --text: #E2E8F0; --text-muted: #A9B8C8;
    --border: #2A4152; --accent: #7BD64A; --accent-bg: #16301A; --heading: #E8F5E0;
    --warn-bg: #3A2F10; --warn-ink: #F4C95D; --danger-bg: #3B1717; --danger-ink: #FCA5A5;
    --info-bg: #0E2C40; --info-ink: #B8DCF0; --focus: #7CC4FF; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1620; --surface: #10202C; --surface-2: #142836; --text: #E2E8F0; --text-muted: #A9B8C8;
  --border: #2A4152; --accent: #7BD64A; --accent-bg: #16301A; --heading: #E8F5E0;
  --warn-bg: #3A2F10; --warn-ink: #F4C95D; --danger-bg: #3B1717; --danger-ink: #FCA5A5;
  --info-bg: #0E2C40; --info-ink: #B8DCF0; --focus: #7CC4FF; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--step-0); line-height: 1.65; overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.2; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: var(--step-3); letter-spacing: -.02em; }
h2 { font-size: var(--step-2); margin-top: 2.2em; }
h3 { font-size: var(--step-1); margin-top: 1.6em; }
h4 { font-size: var(--step-0); margin-top: 1.2em; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--navy); color: #fff; padding: .6rem 1rem; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: .5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Prosa: ocupa su columna; justifica solo con contenedor ≥ 40rem (regla 7.4). */
.prose-region { container-type: inline-size; inline-size: 100%; max-inline-size: 100%; min-inline-size: 0; }
.prose-region p, .prose-region li, .prose-region dd { text-align: start; white-space: normal; word-break: normal; hyphens: none; overflow-wrap: break-word; }
/* Cada región de lectura es su propio contenedor: el umbral mide su ancho real, no el de la página. */
.hero > div, .card, .callout, .acc-body, [role="tabpanel"], .activity, .result-panel { container-type: inline-size; min-width: 0; }
.prose-region .hero .subtitle, .prose-region .lead { text-align: start; }
@container (min-width: 40rem) {
  .prose-region p, .prose-region li, .prose-region dd { text-align: justify; text-align-last: start; }
}

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--navy); color: #fff; min-height: var(--header-h); display: flex; align-items: center; gap: 1rem; padding: .5rem var(--gutter); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; min-width: 0; }
.brand svg { flex: none; width: 40px; height: 40px; }
.brand strong { display: block; font-size: 1rem; letter-spacing: .04em; }
.brand small { display: block; font-size: .78rem; color: #CFE3EE; line-height: 1.3; }
.topbar .spacer { flex: 1; }
.top-progress { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: #E2EEF4; }
.top-progress .bar { width: 120px; height: 8px; background: rgb(255 255 255 / .2); border-radius: 99px; overflow: hidden; }
.top-progress .bar span { display: block; height: 100%; background: var(--green); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 44px; min-height: 44px; padding: .4rem .8rem; border-radius: 10px; border: 1px solid rgb(255 255 255 / .35); background: transparent; color: #fff; font: inherit; font-size: .9rem; cursor: pointer; }
.icon-btn:hover { background: rgb(255 255 255 / .1); }
.menu-btn { display: none; }
.top-search { position: relative; }
.top-search input { min-height: 44px; width: 15rem; max-width: 100%; border-radius: 10px; border: 1px solid rgb(255 255 255 / .35); background: rgb(255 255 255 / .1); color: #fff; padding: .4rem .8rem; font: inherit; font-size: .9rem; }
.top-search input::placeholder { color: #CFE3EE; }
.search-results { position: absolute; right: 0; top: calc(100% + .4rem); width: min(26rem, 92vw); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); list-style: none; margin: 0; padding: .4rem; max-height: 60vh; overflow: auto; }
.search-results[hidden] { display: none; }
.search-results a { display: block; padding: .55rem .7rem; border-radius: 8px; text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a:focus-visible { background: var(--accent-bg); }
.search-results small { display: block; color: var(--text-muted); }

/* Distribución */
.layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.sidebar { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow: auto; border-right: 1px solid var(--border); background: var(--surface-2); padding: 1.25rem .75rem; }
.sidebar ol { list-style: none; margin: 0; padding: 0; counter-reset: nav; }
.sidebar li a { display: flex; gap: .6rem; align-items: center; padding: .55rem .7rem; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .95rem; min-height: 44px; }
.sidebar li a::before { counter-increment: nav; content: counter(nav); flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.sidebar li a.visited::before { content: "✓"; background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.sidebar li a[aria-current="page"] { background: var(--surface); color: var(--heading); font-weight: 600; box-shadow: inset 3px 0 0 var(--green); }
.sidebar li a:hover { background: var(--surface); }
main { min-width: 0; padding: 2rem var(--gutter) 4rem; }
.page-head { border-bottom: 1px solid var(--border); padding-bottom: 1.25rem; margin-bottom: 1.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 .5rem; }
.lead { font-size: var(--step-1); color: var(--text-muted); line-height: 1.5; }
.question { display: inline-block; background: var(--accent-bg); color: var(--heading); border-radius: 99px; padding: .3rem .9rem; font-size: .9rem; font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1.5rem; }
.pager a { display: inline-flex; flex-direction: column; padding: .8rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; min-width: 12rem; }
.pager a small { color: var(--text-muted); }
.pager a.next { text-align: right; margin-left: auto; }

@media (max-width: 60rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .topbar { position: static; gap: .5rem .75rem; }
  .topbar .spacer { display: none; }
  .brand { flex: 1 1 12rem; }
  .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar[data-open="false"] { display: none; }
  .top-progress .bar { width: 64px; }
  .brand small { display: none; }
}
@media (max-width: 34rem) {
  .brand strong { font-size: .9rem; }
  .top-search { order: 10; flex-basis: 100%; }
  .top-search input { width: 100%; }
  .top-progress span.label { display: none; }
}

/* Bloques */
.callout { border-left: 4px solid var(--green); background: var(--accent-bg); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.25rem 0; }
.callout.warn { border-color: #C99A1E; background: var(--warn-bg); }
.callout.danger { border-color: #C0392B; background: var(--danger-bg); }
.callout.info { border-color: var(--navy); background: var(--info-bg); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout strong.title { display: block; color: var(--heading); margin-bottom: .25rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); margin: 1.25rem 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; min-width: 0; }
.card h3, .card h4 { margin-top: 0; }
.card .icon { width: 44px; height: 44px; margin-bottom: .5rem; }
.card dl { margin: 0; }
.card dt { font-weight: 700; color: var(--heading); font-size: .9rem; margin-top: .6rem; }
.card dd { margin: .1rem 0 0; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; }
.badge.confirmada { color: var(--accent); }
.badge.gradual { color: var(--info-ink); }
.badge.plan { color: var(--warn-ink); }
.badge.edad { color: var(--danger-ink); }
.badge.usuarios { color: var(--text-muted); border-style: dashed; }
.badge.pedagogica { color: var(--heading); background: var(--accent-bg); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }

.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); color: var(--heading); }
tbody tr:last-child td { border-bottom: 0; }

details.acc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: .6rem 0; }
details.acc > summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 600; color: var(--heading); min-height: 44px; list-style-position: inside; }
details.acc[open] > summary { border-bottom: 1px solid var(--border); }
details.acc > .acc-body { padding: .9rem 1.1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-bg); }
.btn.primary { background: var(--green-ink); color: #fff; border-color: var(--green-ink); }
.btn.primary:hover { background: #236300; }
.download { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .75rem 1rem; margin: 1rem 0; padding: 1rem; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-bg); container-type: inline-size; }
.download > div { flex: 1 1 16rem; min-inline-size: 0; }
.download p { margin: 0 0 .35rem; text-align: start; }
.download ul { margin: .4rem 0; padding-inline-start: 1.2rem; }
.download code { overflow-wrap: break-word; }
.btn.light { background: #fff; color: var(--navy); border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }

.prompt { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); margin: .8rem 0; overflow: hidden; }
.prompt header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem .5rem .5rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.prompt header span { font-weight: 600; font-size: .9rem; color: var(--heading); }
.prompt pre { margin: 0; padding: 1rem; white-space: pre-wrap; overflow-wrap: break-word; font-size: .9rem; } /* text-layout-exception: los prompts son texto para copiar y deben leerse completos en móvil; el botón copia la cadena exacta */
.prompt .copy-status { font-size: .8rem; color: var(--accent); min-width: 5rem; text-align: right; }

/* Diagramas */
figure.diagram { margin: 1.5rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
figure.diagram { overflow-x: auto; }
figure.diagram svg { display: block; width: 100%; min-width: 34rem; height: auto; }
figure.diagram figcaption { font-size: .9rem; color: var(--text-muted); margin-top: .6rem; }
.svg-box { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.svg-box.accent { fill: var(--accent-bg); stroke: var(--accent); }
.svg-box.navy { fill: var(--navy); stroke: var(--navy); }
.svg-box.warn { fill: var(--warn-bg); stroke: #C99A1E; }
.svg-box.danger { fill: var(--danger-bg); stroke: #C0392B; }
.svg-text { fill: var(--text); font-family: var(--font); font-size: 1.125rem; }
.svg-text.strong { font-weight: 700; fill: var(--heading); }
.svg-text.on-navy { fill: #fff; font-weight: 700; }
.svg-text.small { font-size: .8125rem; fill: var(--text-muted); }
.svg-line { stroke: var(--text-muted); stroke-width: 2; fill: none; }
.svg-arrow { fill: var(--text-muted); }

/* Diagrama interactivo por etapas */
.stepper { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 62rem) { .stepper { grid-template-columns: 18rem minmax(0, 1fr); } }
.stepper [role="tablist"] { display: flex; flex-direction: column; gap: .4rem; counter-reset: st; }
@media (max-width: 61.99rem) { .stepper [role="tablist"] { flex-direction: row; overflow-x: auto; padding-bottom: .4rem; } .stepper [role="tab"] { flex: none; } }
.stepper [role="tab"] { display: flex; align-items: center; gap: .6rem; text-align: left; min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .93rem; cursor: pointer; }
.stepper [role="tab"]::before { counter-increment: st; content: counter(st); flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: .8rem; }
.stepper [role="tab"][aria-selected="true"] { border-color: var(--accent); background: var(--accent-bg); color: var(--heading); font-weight: 600; }
.stepper [role="tab"][aria-selected="true"]::before { background: var(--green-ink); color: #fff; }
.stepper [role="tabpanel"] { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; min-width: 0; }
.stepper [role="tabpanel"] svg.stage-art { width: 120px; height: 90px; float: right; margin: 0 0 .5rem 1rem; }
.stage-label { font-weight: 700; color: var(--heading); margin: 1rem 0 .2rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }

/* Pestañas de ejercicio */
.tabs [role="tablist"] { display: flex; gap: .3rem; overflow-x: auto; border-bottom: 2px solid var(--border); }
.tabs [role="tab"] { flex: none; min-height: 44px; padding: .5rem .9rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; color: var(--text-muted); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { color: var(--heading); border-bottom-color: var(--green); }
.tabs [role="tabpanel"] { padding: 1.25rem 0; }

/* Actividades */
.activity { border: 2px solid var(--accent-bg); background: var(--surface); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1.5rem 0; }
.activity > h3 { margin-top: 0; }
.activity fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.activity legend { font-weight: 600; color: var(--heading); margin-bottom: .6rem; }
.option { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 10px; margin: .4rem 0; cursor: pointer; min-height: 44px; }
.option input { margin-top: .35rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--green-ink); }
.option.is-correct { border-color: var(--accent); background: var(--accent-bg); }
.option.is-wrong { border-color: #C0392B; background: var(--danger-bg); }
.feedback { border-radius: 10px; padding: .8rem 1rem; margin-top: .6rem; }
.feedback[hidden] { display: none; }
.feedback.correct { background: var(--accent-bg); }
.feedback.incorrect { background: var(--danger-bg); }
.feedback.empty { background: var(--warn-bg); }

.flashcard { perspective: 1200px; max-width: 30rem; }
.flashcard .face { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; min-height: 11rem; display: flex; flex-direction: column; justify-content: center; background: var(--surface); box-shadow: var(--shadow); }
.flashcard .face.back { background: var(--accent-bg); }
.flashcard .face[hidden] { display: none; }
.flashcard .face small { color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: .72rem; }
.flashcard .face p { font-size: var(--step-1); margin: .4rem 0 0; color: var(--heading); text-align: start; }

.checklist { list-style: none; padding: 0; margin: 1rem 0; }
.checklist li { margin: .3rem 0; }
.checklist label { display: flex; gap: .7rem; align-items: flex-start; padding: .5rem .7rem; border-radius: 10px; cursor: pointer; min-height: 44px; }
.checklist label:hover { background: var(--surface-2); }
.checklist input { width: 1.2rem; height: 1.2rem; margin-top: .25rem; flex: none; accent-color: var(--green-ink); }
.checklist input:checked + span { text-decoration: line-through; color: var(--text-muted); }
.checklist-count { font-size: .9rem; color: var(--text-muted); }

/* Portada */
.hero { display: grid; gap: 2rem; align-items: center; grid-template-columns: minmax(0, 1fr); padding: 1rem 0 2rem; }
.hero-note { margin: 1rem 0 0; text-align: start; font-weight: 600; }
@media (min-width: 64rem) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.hero h1 { font-size: var(--step-4); letter-spacing: -.03em; margin-bottom: .2em; }
.hero h1 span { color: var(--accent); }
.hero .subtitle { font-size: var(--step-2); color: var(--heading); font-weight: 600; line-height: 1.25; margin: 0 0 1rem; text-wrap: balance; }
.hero-art { background: linear-gradient(160deg, var(--accent-bg), var(--surface-2)); border-radius: 24px; padding: 1rem; }
.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); margin: 1rem 0 2rem; }
.kpi { display: flex; gap: .8rem; align-items: center; padding: 1rem; border-radius: var(--radius); background: var(--surface-2); }
.kpi svg { width: 48px; height: 48px; flex: none; }
.kpi strong { color: var(--heading); line-height: 1.3; }
.journey { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); counter-reset: j; }
.journey li a { display: flex; gap: .7rem; align-items: center; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); height: 100%; }
.journey li a::before { counter-increment: j; content: counter(j, decimal-leading-zero); font-weight: 800; color: var(--accent); font-size: 1.1rem; }
.journey li a.visited { border-color: var(--accent); background: var(--accent-bg); }

.exercise-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.5rem; }
.exercise-nav a { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--text); padding: 0 .6rem; }
.exercise-nav a[aria-current="page"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.exercise-nav a.done { border-color: var(--accent); color: var(--accent); }
.meta-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: .8rem 0; font-size: .95rem; }
.meta-row span strong { color: var(--heading); }
.complete-toggle[aria-pressed="true"] { background: var(--green-ink); color: #fff; border-color: var(--green-ink); }

.glossary-tools { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin: 1rem 0; }
.glossary-tools input { min-height: 44px; flex: 1 1 16rem; padding: .5rem .8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.letters { display: flex; flex-wrap: wrap; gap: .3rem; }
.letters button { min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.letters button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.glossary-list dt { font-weight: 700; color: var(--heading); font-size: var(--step-1); margin-top: 1.2rem; }
.glossary-list dd { margin: .3rem 0 0; }
.glossary-list dd.example { color: var(--text-muted); font-size: .95rem; }

.sources { font-size: .92rem; border-top: 1px dashed var(--border); margin-top: 2.5rem; padding-top: 1rem; }
.sources h2 { font-size: var(--step-1); margin-top: 0; }
.sources ol { padding-left: 1.3rem; }
.sources li { margin: .3rem 0; }
.sources a { overflow-wrap: anywhere; } /* text-layout-exception: URLs de referencia largas; el enlace completo sigue disponible al activarlo */

.exam-q { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.exam-q .topic { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; }
.result-panel { background: var(--surface-2); border-radius: var(--radius); padding: 1.4rem; margin: 1.5rem 0; }
.result-panel .score { font-size: var(--step-3); font-weight: 800; color: var(--heading); }

.footer { border-top: 1px solid var(--border); padding: 1.5rem var(--gutter); font-size: .88rem; color: var(--text-muted); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn, .sidebar a, .option { transition: background-color .15s ease, border-color .15s ease; }
}
@media print {
  .topbar, .sidebar, .pager, .btn-row, .copy-btn { display: none !important; }
  .layout { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
