/* Hallmark · extends app.css (same DESIGN.md tokens, no new colours) · Bases de Datos screens: theory quiz, cardinalities, guided and free E/R boards, tables and graph, easy lessons, notes, glossary, exam mode · signature: the E/R diagram drawn live as you answer
 * critique: reuses the app panels, pills and the yellow primary; the subject teal (--c-bbdd) marks only diagram cardinalities and the active block */

/* Panels and text */
.bb-panel { display: grid; gap: var(--s-4); padding: var(--s-6); border-radius: var(--r-card); background: var(--surface); color: var(--text); min-width: 0; transition: opacity var(--dur-short) var(--ease-out); }
.bb-panel h2 { font-size: var(--t-xl); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.bb-panel.is-locked { opacity: 0.4; }
.bb-stage { display: grid; gap: var(--s-4); }
.bb-enun { margin: 0; padding: var(--s-4); border-radius: var(--r-cover); background: var(--surface-2); max-width: 72ch; }
.bb-know { margin: 0; color: var(--text-2); max-width: 72ch; }
.bb-list { margin: var(--s-1) 0 0; padding-left: var(--s-5); display: grid; gap: var(--s-1); color: var(--text-2); }
.tres p { margin: 0; }
.explain__first.is-bad { color: var(--bad); }

/* Diagram */
.bb-dia { display: block; width: 100%; min-width: 520px; height: auto; max-width: 640px; }
.bb-dia .bb-ent { fill: var(--surface-2); stroke: var(--text-2); stroke-width: 1.5; }
.bb-dia .bb-rel { fill: var(--surface); stroke: var(--text-2); stroke-width: 1.5; }
.bb-dia .bb-l { stroke: var(--text-3); stroke-width: 1.5; }
.bb-dia text { font-family: var(--font-code); }
.bb-dia .bb-t { fill: var(--text); font-weight: 700; }
.bb-dia .bb-v { fill: var(--text-2); font-family: var(--font-body); }
.bb-dia .bb-tipo { fill: var(--text-3); font-weight: 700; }
.bb-dia .bb-c { fill: var(--c-bbdd); font-weight: 700; }
.bb-dia .bb-c.is-ok { fill: var(--ok); }
.bb-dia .bb-c.is-bad { fill: var(--bad); }
.bb-relbox { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-cover); background: var(--surface-2); min-width: 0; overflow-x: auto; }
.bb-rels { display: grid; gap: var(--s-3); }

/* Questions with a select */
.bb-qs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.bb-q { display: grid; gap: var(--s-1); align-content: start; min-width: 0; }
.bb-q > span:first-child { font-weight: 600; }
.bb-q .select { justify-self: start; }
.select.is-ok { box-shadow: inset 0 0 0 2px var(--ok); }
.select.is-bad { box-shadow: inset 0 0 0 2px var(--bad); }
@media (max-width: 40rem) { .bb-qs { grid-template-columns: minmax(0, 1fr); } }

/* Toggle chips (entities, yes/no, relation type) */
.bb-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bb-chip { min-height: 40px; padding: 0 var(--s-4); border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font: 600 var(--t-sm)/1 var(--font-body); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.bb-chip:hover { background: var(--surface-3); }
.bb-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bb-chip[aria-pressed="true"] { background: var(--surface-3); box-shadow: inset 0 0 0 2px var(--c-bbdd); }
.bb-chip.is-ok { box-shadow: inset 0 0 0 2px var(--ok); }
.bb-chip.is-bad { box-shadow: inset 0 0 0 2px var(--bad); }

/* Attribute tokens (normalisation) */
.bb-at { min-height: 34px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-tag); background: var(--code-bg); color: var(--code-muted); font: 500 var(--t-sm)/1 var(--font-code); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
span.bb-at { display: inline-flex; align-items: center; cursor: default; }
.bb-at:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bb-at.is-in { color: var(--code-ink); box-shadow: inset 0 0 0 1px var(--text-2); }
.bb-at.is-key { color: var(--brand); text-decoration: underline; font-weight: 700; box-shadow: inset 0 0 0 2px var(--brand); }
.bb-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; color: var(--text-2); font-size: var(--t-sm); }
.bb-tbl { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-cover); background: var(--surface-2); }
.bb-tbl__head { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: space-between; align-items: center; }
.bb-tbl__name { min-height: 36px; padding: 0 var(--s-2); border: 0; border-bottom: 2px solid var(--line); background: transparent; color: var(--text); font: 700 var(--t-sm)/1 var(--font-code); max-width: 100%; }
.bb-tbl__name:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bb-dep { font-family: var(--font-code); }

/* Keys */
.bb-keys { display: grid; gap: var(--s-2); }
.bb-key { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: var(--s-3); align-items: center; }
.bb-key b { font: 700 var(--t-sm)/1.3 var(--font-code); overflow-wrap: anywhere; }
.bb-key .select { justify-self: start; }

/* Relational schema board */
.bb-board { padding: var(--s-4); border-radius: var(--r-cover); background: var(--code-bg); color: var(--code-ink); font: 500 var(--t-sm)/1.9 var(--font-code); overflow-x: auto; }
.bb-board u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.bb-row { white-space: nowrap; }
.bb-fk { color: var(--code-num); font-size: var(--t-xs); }
.bb-deps { margin: var(--s-2) 0 0; color: var(--code-muted); }

/* Theory: blocks, options, flash card */
.bb-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--s-2); }
.bb-block { display: grid; gap: 2px; padding: var(--s-3) var(--s-4); border: 0; border-radius: var(--r-cover); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.bb-block:hover { background: var(--surface-2); }
.bb-block:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bb-block[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--c-bbdd); }
.bb-block[aria-pressed="false"] { color: var(--text-3); }
.bb-block__t { font-weight: 600; }
.bb-block__n, .bb-block__p { font-size: var(--t-xs); color: var(--text-3); }
.bb-block__p.is-ok { color: var(--ok); font-weight: 600; }
.bb-block__p.is-bad { color: var(--bad); font-weight: 600; }
.bb-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 28rem; }
@media (max-width: 50rem) { .tabs4.bb-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bb-tag { margin: 0; font-size: var(--t-sm); font-weight: 700; color: var(--c-bbdd); }
.bb-qtext { font-size: var(--t-2xl); line-height: 1.2; max-width: 40ch; }
.bb-opt { display: flex; align-items: center; gap: var(--s-3); background: var(--surface-2); color: var(--text); font: 500 var(--t-md)/1.4 var(--font-body); }
.bb-opt__l { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-tag); background: var(--surface-3); font: 700 var(--t-xs)/1 var(--font-code); color: var(--text-2); }
.bb-quiz { display: grid; gap: var(--s-4); max-width: 46rem; }
.bb-fcard .fcard__g { color: var(--c-bbdd); }
.bb-fcard .fcard__q { font-size: var(--t-xl); }
.bb-fcard .fcard__n { color: var(--text); font-size: var(--t-lg); }
.bb-rate { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bb-end { display: grid; gap: var(--s-4); max-width: 46rem; }
.bb-end .vars th[scope="row"] { font-size: var(--t-sm); color: var(--text); font-weight: 600; }
.bb-home { display: grid; gap: var(--s-4); }

@media (prefers-reduced-motion: reduce) {
  .bb-panel, .bb-chip, .bb-block { transition: none; }
}
.bb-qcode { padding-inline: var(--s-4); white-space: pre; }

/* v14 · Plano de taller: tarjetas de papel con borde de tinta */
.bb-tag, .bb-fcard .fcard__g { color: var(--c-bbdd-text); }
.bb-at.is-key { color: var(--brand-text); }
.bb-panel { border: 1.5px solid var(--edge); box-shadow: var(--hard); }
.bb-enun, .bb-relbox, .bb-tbl { border: 1px solid var(--line); }
.bb-chip, .bb-block, .bb-opt { border: 1.5px solid var(--edge); transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.bb-chip { background: var(--surface); box-shadow: var(--hard-sm); }
.bb-chip:hover, .bb-block:hover:not(:disabled), .bb-opt:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hard-c); }
.bb-chip[aria-pressed="true"] { background: var(--c-bbdd); color: var(--cover-ink); box-shadow: var(--hard-sm); }
.bb-block { box-shadow: var(--hard-sm); }
.bb-block[aria-pressed="true"] { background: color-mix(in oklab, var(--c-bbdd) 16%, var(--surface)); box-shadow: var(--hard-sm), inset 6px 0 0 var(--c-bbdd); }
.bb-opt { background: var(--surface); }
.bb-opt:active:not(:disabled), .bb-chip:active { transform: translate(2px, 2px); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .bb-chip:hover, .bb-block:hover:not(:disabled), .bb-opt:hover:not(:disabled) { transform: none; } }
.bb-opt:hover:not(:disabled) { background: var(--surface-2); }
.bb-opt.is-right, .l-opt.is-right { background: color-mix(in oklab, var(--ok) 18%, var(--surface)); }
.bb-opt.is-wrong, .l-opt.is-wrong { background: color-mix(in oklab, var(--bad) 14%, var(--surface)); }

/* v16 · Bases de Datos completa: Pizarra libre (lienzo E/R), Tablas y grafo, Aprende fácil, Apuntes, Diccionario y Modo examen.
 * Mismos tokens; el lienzo es papel con puntos y tinta, y el grafo va en la pizarra oscura del código. */

/* ── Lista de ejercicios en dos grupos ── */
#z-list, #x-list { display: grid; gap: var(--s-3); }
.lz-grupo { margin-top: var(--s-2); }
.pick__s.is-done { color: var(--ok); }
.pick[aria-current="true"] .pick__s.is-done { color: var(--brand-ink); }

/* ── Pizarra libre ── */
.lz-panel { gap: var(--s-3); }
.lz-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.lz-head p { margin: 0; font-size: var(--t-sm); }
.bb-panel h2, .l-h { text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.lz-recuerda summary { cursor: pointer; font-weight: 600; color: var(--c-bbdd-text); }
.lz-recuerda summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lz-recuerda .bb-list { margin-top: var(--s-2); }
.lz-tools { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.lz-tool { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-3); border: 1.5px solid var(--edge); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: 600 var(--t-sm)/1 var(--font-body); cursor: pointer; box-shadow: var(--hard-sm); transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.lz-tool svg { width: 22px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lz-tool:hover { background: var(--surface-2); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hard-c); }
.lz-tool:active { transform: translate(2px, 2px); box-shadow: none; }
.lz-tool:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lz-tool[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lz-canvas { border: 1.5px solid var(--edge); border-radius: var(--r-card); background-color: var(--surface); background-image: radial-gradient(var(--star) 1.2px, transparent 1.3px); background-size: 22px 22px; overflow: auto; overscroll-behavior: contain; }
#lz-svg { display: block; width: 100%; min-width: 760px; height: auto; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }
.lz-node { touch-action: none; }
#lz-svg:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#lz-svg text { font-family: var(--font-code); pointer-events: none; }
.lz-node { cursor: grab; }
.lz-node:focus { outline: none; }
.lz-node:focus-visible .lz-shape { stroke: var(--brand); stroke-width: 3; }
.lz-shape { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; }
.lz-inner { fill: none; stroke-width: 1.2; }
.lz-agg { stroke-dasharray: 7 4; }
.lz-dot { fill: var(--surface); }
.lz-node.is-key .lz-dot { fill: var(--ink); }
.lz-grab { fill: transparent; }
.lz-node.is-sel .lz-shape, .lz-node.is-pend .lz-shape { stroke: var(--brand); stroke-width: 3; }
.lz-node.is-ok .lz-shape { stroke: var(--ok); stroke-width: 2.4; }
.lz-node.is-bad .lz-shape { stroke: var(--bad); stroke-width: 2.4; }
.lz-node.is-ok.is-key .lz-dot { fill: var(--ok); }
.lz-node.is-bad.is-key .lz-dot { fill: var(--bad); }
.lz-label { fill: var(--text); font-size: 13.5px; font-weight: 700; }
.lz-v { font-family: var(--font-body); font-weight: 500; font-size: 12.5px; }
#lz-svg .lz-v, .lz-sol .lz-v { font-family: var(--font-body); }
.lz-attr { fill: var(--text); font-size: 13px; }
.lz-node.is-key .lz-attr { font-weight: 700; text-decoration: underline; }
.lz-label.is-empty, .lz-attr.is-empty { fill: var(--text-3); font-weight: 500; }
.lz-small { fill: var(--text-2); font-size: 11px; }
.lz-b { font-weight: 700; }
.lz-arc { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.lz-empty { fill: var(--text-3); font-size: 17px; }
.lz-empty.lz-small { font-size: 13px; }
.lz-edge { cursor: pointer; }
.lz-hit { fill: none; stroke: transparent; stroke-width: 16; }
.lz-line { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.lz-edge.is-sel .lz-line { stroke: var(--brand); stroke-width: 2.6; }
.lz-edge.is-ok .lz-line { stroke: var(--ok); }
.lz-edge.is-bad .lz-line { stroke: var(--bad); stroke-width: 2.2; }
.lz-card { fill: var(--c-bbdd-text); font-size: 14px; font-weight: 700; }
.lz-card.is-empty { fill: var(--text-3); font-weight: 500; }
.lz-card.is-ok { fill: var(--ok); }
.lz-card.is-bad { fill: var(--bad); }
.lz-insp { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; min-height: 48px; padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-cover); background: var(--surface-2); }
.lz-insp p { margin: 0; }
.lz-insp__k { font-weight: 700; }
.lz-field { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.lz-input { min-height: 40px; min-width: 14rem; padding: 0 var(--s-3); border: 1.5px solid var(--edge); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: 500 var(--t-md)/1 var(--font-code); }
.lz-input:focus-visible, .lz-hand:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lz-check { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; color: var(--text); }
.lz-check input { width: 20px; height: 20px; accent-color: var(--brand); }
.lz-check input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 40rem) { .lz-input { min-width: 0; width: 100%; } .lz-field { flex: 1 1 100%; } .lz-tool { min-height: 36px; padding: 0 var(--s-2); font-size: var(--t-xs); } }

/* Nota y lista de aciertos */
#lz-res, #x-res { display: grid; gap: var(--s-3); }
.lz-nota { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-6); padding: var(--s-4) var(--s-5); border-radius: var(--r-card); }
.lz-nota .exam-end__nota { font-size: 4rem; margin: 0; }
.lz-nota p { margin: 0; }
.lz-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.lz-checks li { display: flex; gap: var(--s-2); align-items: baseline; color: var(--text-2); line-height: 1.5; }
.lz-mark { flex: none; width: 1.2em; font-weight: 800; }
.lz-checks .is-ok .lz-mark { color: var(--ok); }
.lz-checks .is-bad .lz-mark { color: var(--bad); }
.lz-checks .is-warn .lz-mark { color: var(--warn); }
.lz-checks .is-bad { color: var(--text); }
.lz-pista, .lz-solbox { padding: var(--s-4) var(--s-5); border-radius: var(--r-card); display: grid; gap: var(--s-3); }
.lz-pista p, .lz-solbox p { margin: 0; }
.lz-solscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-cover); background-color: var(--surface); background-image: radial-gradient(var(--star) 1.2px, transparent 1.3px); background-size: 22px 22px; }
.lz-sol { display: block; width: 100%; height: auto; }
.lz-sol text { font-family: var(--font-code); }
.lz-soltext { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--s-4); }
.lz-profe { margin: 0; display: grid; gap: var(--s-2); }
.lz-profe img { display: block; width: 100%; height: auto; border: 1.5px solid var(--edge); border-radius: var(--r-cover); }

/* ── Tablas y grafo ── */
.lz-relline { font-family: var(--font-code); font-size: var(--t-sm); overflow-wrap: anywhere; }
.lz-graphwrap { overflow-x: auto; padding: var(--s-3); border-radius: var(--r-cover); background: var(--code-bg); border: 1.5px solid var(--edge); }
.lz-graph { display: block; max-width: none; height: auto; }
.lz-graph text { fill: var(--code-ink); font: 500 13px var(--font-code); }
.lz-graph .lz-fk { fill: var(--code-num); font-size: 10px; }
.lz-graph .lz-b { font-weight: 700; }
.lz-arrow { fill: none; stroke: var(--code-num); stroke-width: 1.3; }
.lz-graph marker path { fill: var(--code-num); }
.lz-opts { display: grid; gap: var(--s-2); }
.lz-opt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-cover); background: var(--surface-2); }
.lz-fkname { font: 500 var(--t-sm)/1.4 var(--font-code); overflow-wrap: anywhere; }
.lz-hand { width: 100%; min-height: 12rem; padding: var(--s-3); border: 1.5px solid var(--edge); border-radius: var(--r-cover); background: var(--surface); color: var(--text); font: 500 var(--t-sm)/1.8 var(--font-code); resize: vertical; }
.lz-code { font: 500 var(--t-xs)/1.4 var(--font-code); padding: 0 var(--s-1); border-radius: var(--r-tag); background: var(--code-bg); color: var(--code-ink); white-space: nowrap; display: inline-block; margin: 2px 0; }

/* ── Aprende fácil ── */
.ba-body { gap: var(--s-5); }
.l-kick { color: var(--c-bbdd-text); }
.ba-body .l-tema, .l-side .l-tema { color: var(--c-bbdd-text); }
.ba-easy { display: grid; gap: var(--s-3); max-width: 68ch; font-size: var(--t-lg); line-height: 1.7; color: var(--text); }
.ba-easy p { margin: 0; }
.ba-easy ul, .ba-easy ol { margin: 0; padding-left: var(--s-6); display: grid; gap: var(--s-2); }
.ba-easy code, .l-q__t code { font: 500 0.85em/1.4 var(--font-code); background: var(--code-bg); color: var(--code-ink); padding: 0 var(--s-1); border-radius: var(--r-tag); }
.ba-vida { max-width: 68ch; padding: var(--s-4) var(--s-5); border: 1.5px solid var(--edge); border-radius: var(--r-card); background: var(--note); box-shadow: var(--hard-sm); }
.ba-vida p { margin: 0; line-height: 1.65; color: var(--text); }
.ba-vida .mini-h { margin-bottom: var(--s-1); }
.ba-keep { max-width: 68ch; padding: var(--s-4) var(--s-5); border-radius: var(--r-card); background: var(--surface-2); box-shadow: inset 5px 0 0 var(--c-bbdd); }
.ba-keep p { margin: 0; line-height: 1.6; }
.ba-ok { color: var(--ok); font-weight: 700; }
.ba-bad { color: var(--bad); font-weight: 700; }
.l-opts--row { display: flex; flex-wrap: wrap; max-width: none; }
.ba-tablas { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.ba-tabla { display: grid; gap: var(--s-1); min-width: 0; }
.ba-tabla__n { margin: 0; font: 700 var(--t-sm)/1.2 var(--font-code); }
.ba-dt { width: auto; font-family: var(--font-code); }
.ba-dt td, .ba-dt th { border: 1px solid var(--line); }
.ba-dt tr.is-dup td { background: color-mix(in oklab, var(--bad) 16%, var(--surface)); }
.ba-dt tr.is-uni td { background: color-mix(in oklab, var(--ok) 14%, var(--surface)); }
.ba-dt tr.is-flash td { background: var(--note); }
.ba-dt td.is-hl { font-weight: 700; color: var(--text); box-shadow: inset 0 0 0 2px var(--c-bbdd); }
.ba-colb { min-height: 32px; padding: 0 var(--s-2); border: 1.5px solid var(--edge); border-radius: var(--r-tag); background: var(--surface); color: var(--text); font: 700 var(--t-sm)/1 var(--font-code); cursor: pointer; }
.ba-colb:hover { background: var(--surface-2); }
.ba-colb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ba-colb[aria-pressed="true"] { background: var(--c-bbdd); color: var(--cover-ink); }
.ba-step { display: grid; gap: var(--s-3); padding: var(--s-4) var(--s-5); border: 1.5px dashed var(--edge); border-radius: var(--r-card); }
.ba-step h3 { font-size: var(--t-lg); }
.ba-step p, .ba-step ul { margin: 0; max-width: 68ch; line-height: 1.6; }
.ba-step ul { padding-left: var(--s-5); display: grid; gap: var(--s-1); }
.ba-steps-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.ba-sim { display: grid; gap: var(--s-2); }
.ba-simrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.ba-simk { font-weight: 700; min-width: 7rem; }
mark { background: var(--mark); color: inherit; padding: 0 var(--s-1); border-radius: var(--r-tag); }
.bb-sql { padding-inline: var(--s-4); white-space: pre; margin: 0; }

/* ── Apuntes de Bases de Datos ── */
.ap-facil { padding: var(--s-3) var(--s-4); border: 1.5px solid var(--edge); border-radius: var(--r-cover); background: var(--note); max-width: 72ch; line-height: 1.6; color: var(--text); }
.ap-mas { font-weight: 600; color: var(--c-bbdd-text); }
.ap-mas:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ap-svgwrap { overflow-x: auto; }
.ap-svg { display: block; width: 100%; min-width: 560px; max-width: 720px; height: auto; }
.ap-svg text { fill: var(--text); font: 500 12px var(--font-body); }
.ap-svg .ap-b { font-weight: 700; font-family: var(--font-code); }
.ap-svg .ap-s { font-size: 11px; fill: var(--text-3); }
.ap-svg .ap-card { fill: var(--c-bbdd-text); font-weight: 700; font-size: 13px; }
.ap-svg .ap-tipo { fill: var(--text-2); font-weight: 700; font-size: 13px; }
.ap-ent { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.ap-key { fill: var(--ink); }
.ap-ln { stroke: var(--ink); stroke-width: 1.3; }
.ap-arc { fill: none; stroke: var(--c-bbdd-text); stroke-width: 1.8; }
.ap-body .bb-board, .ap-body .bb-sql { max-width: 100%; }

/* ── Diccionario ── */
.dic-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.dic-top p { margin: 0; }
.dic-search { border: 1.5px solid var(--edge); background: var(--surface); }
.dic { display: grid; margin: 0; border: 1.5px solid var(--edge); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--hard); overflow: hidden; }
.dic-row { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: var(--s-4); padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); }
.dic-row:last-child { border-bottom: 0; }
.dic-row dt { font-weight: 700; color: var(--c-bbdd-text); overflow-wrap: break-word; min-width: 0; }
.dic-row dd { margin: 0; display: grid; gap: 2px; }
.dic-row dd p { margin: 0; line-height: 1.55; }
.dic > p { margin: 0; padding: var(--s-4) var(--s-5); }
@media (max-width: 40rem) { .dic-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ── Modo examen ── */
.bx-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--s-4); }
.bx-top p { margin: 0; }
.bx-timer { margin: 0; padding: var(--s-2) var(--s-4); border: 1.5px solid var(--edge); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--hard-sm); font-size: var(--t-3xl); }
.bx-timer.is-late { color: var(--bad); }
.bx-rub { display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-radius: var(--r-card); }
.bx-rub p { margin: 0; }
.bx-rub .exam-end__nota { font-size: 4rem; }
.bx-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.bx-hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-4); align-items: baseline; padding: var(--s-1) 0; border-bottom: 1px solid var(--line); }
.bx-ok { color: var(--ok); }
.bx-bad { color: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  .lz-tool, .lz-tool:hover, .lz-tool:active { transition: none; transform: none; }
}
.lz-halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
