/* ============================================================================
   DISEÑO ASIR ESTUDIO «Fibra» (2026-12) · se carga el último y manda.
   Idea: cada asignatura es una fibra óptica con su color. Sin asignatura, la luz
   es blanca; al entrar en una, toda la interfaz toma su color.
   Verde, rojo y ámbar solo indican estado (acierto, fallo, aviso).
   Para cambiar colores edita los bloques de abajo. El movimiento está en fx.js.
   ============================================================================ */
@font-face { font-family: "Red Hat Display"; src: url("/fonts/red-hat-display.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Red Hat Text"; src: url("/fonts/red-hat-text.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Red Hat Mono"; src: url("/fonts/red-hat-mono.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --radius: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --page-width: 1240px;
  --font-sans: "Red Hat Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans", sans-serif;
  --font-head: "Red Hat Display", "Red Hat Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: "Red Hat Mono", "Cascadia Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --spring: cubic-bezier(0.3, 1.5, 0.5, 1);
  --screen: #060c24;          /* pantallas de terminal y código, iguales en los dos temas */
  --screen-bar: #0d1638;
  --screen-line: #24346f;
}
:root[data-theme="dark"] {
  --bg: #0a1230;
  --bg-elev: #0e1840;
  --bg-card: #121d49;
  --bg-hover: #1a2860;
  --border: #243572;
  --border-strong: #4459a3;
  --text: #f0f4ff;
  --text-muted: #a9b8e2;
  --primary: #dfe8ff;
  --primary-solid: #f3f6ff;
  --primary-hover: #ffffff;
  --on-primary: #0a1230;
  --primary-soft: rgba(206, 221, 255, 0.12);
  --accent: #dfe8ff;
  --success: #43dd9a;
  --success-solid: #43dd9a;
  --on-success: #05261a;
  --success-soft: rgba(67, 221, 154, 0.14);
  --danger: #ff7a70;
  --danger-solid: #ff7a70;
  --on-danger: #2d0704;
  --danger-soft: rgba(255, 122, 112, 0.14);
  --warning: #ffc65c;
  --warning-soft: rgba(255, 198, 92, 0.14);
  --shadow: none;
  --shadow-lg: 0 18px 50px rgba(2, 6, 26, 0.55);
  --glow-a: transparent;
  --glow-b: transparent;
  --fiber-glow: 0.16;
}
:root[data-theme="light"] {
  --bg: #eef2fc;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #e7edfb;
  --border: #d5def4;
  --border-strong: #9fb0da;
  --text: #0d1740;
  --text-muted: #4a5985;
  --primary: #16265f;
  --primary-solid: #16265f;
  --primary-hover: #0d1740;
  --on-primary: #ffffff;
  --primary-soft: rgba(22, 38, 95, 0.08);
  --accent: #16265f;
  --success: #0b7a4b;
  --success-solid: #0b7a4b;
  --on-success: #ffffff;
  --success-soft: rgba(11, 122, 75, 0.11);
  --danger: #c22a20;
  --danger-solid: #c22a20;
  --on-danger: #ffffff;
  --danger-soft: rgba(194, 42, 32, 0.09);
  --warning: #8a5400;
  --warning-soft: rgba(190, 120, 0, 0.14);
  --shadow: none;
  --shadow-lg: 0 18px 44px rgba(16, 30, 84, 0.16);
  --glow-a: transparent;
  --glow-b: transparent;
  --fiber-glow: 0.13;
}

/* ---------- Color de cada asignatura (su fibra) ---------- */
[data-subj] { --c: #a9b8e2; }
[data-subj="sad"] { --c: #f268e2; }
[data-subj="sri"] { --c: #ffcf3f; }
[data-subj="aso"] { --c: #2bd4d4; }
[data-subj="asgbd"] { --c: #9585ff; }
[data-subj="aws"] { --c: #ff9440; }
[data-subj="ing"] { --c: #4f95ff; }
[data-subj="iaw"] { --c: #a9e34b; }
[data-subj="sgs"] { --c: #3ecf8e; }
[data-subj="die"] { --c: #8fb4ff; }
[data-subj="eie"] { --c: #d9a57c; }
[data-subj="proy"] { --c: #ff9a9a; }
:root[data-theme="light"] [data-subj], :root[data-theme="light"][data-subj] { --c: #4a5985; }
:root[data-theme="light"] [data-subj="sad"], :root[data-theme="light"][data-subj="sad"] { --c: #b8179f; }
:root[data-theme="light"] [data-subj="sri"], :root[data-theme="light"][data-subj="sri"] { --c: #8f6400; }
:root[data-theme="light"] [data-subj="aso"], :root[data-theme="light"][data-subj="aso"] { --c: #007f86; }
:root[data-theme="light"] [data-subj="asgbd"], :root[data-theme="light"][data-subj="asgbd"] { --c: #6340d6; }
:root[data-theme="light"] [data-subj="aws"], :root[data-theme="light"][data-subj="aws"] { --c: #c04d00; }
:root[data-theme="light"] [data-subj="ing"], :root[data-theme="light"][data-subj="ing"] { --c: #1c63d8; }
:root[data-theme="light"] [data-subj="iaw"], :root[data-theme="light"][data-subj="iaw"] { --c: #4d7a00; }
:root[data-theme="light"] [data-subj="sgs"], :root[data-theme="light"][data-subj="sgs"] { --c: #0b7a4b; }
:root[data-theme="light"] [data-subj="die"], :root[data-theme="light"][data-subj="die"] { --c: #3a5fb5; }
:root[data-theme="light"] [data-subj="eie"], :root[data-theme="light"][data-subj="eie"] { --c: #8a5a30; }
:root[data-theme="light"] [data-subj="proy"], :root[data-theme="light"][data-subj="proy"] { --c: #b23b3b; }

:root[data-subj][data-theme="dark"] {
  --primary: var(--c);
  --primary-solid: var(--c);
  --primary-hover: color-mix(in srgb, var(--c) 80%, #ffffff);
  --accent: var(--c);
}
/* Tono profundo: carriles de progreso y fondos teñidos. Se mezcla con negro o blanco para no ensuciar el color. */
:root[data-theme="dark"] { --deep: #22306a; --deep-soft: #1c2a63; --ambient: #3559e8; }
:root[data-theme="light"] { --deep: #d3dcf3; --deep-soft: #e7edfb; --ambient: #5f83ff; }
:root[data-theme="dark"][data-subj], :root[data-theme="dark"] [data-subj] { --deep: color-mix(in oklab, var(--c) 27%, #05081a); --deep-soft: color-mix(in oklab, var(--c) 20%, #070b22); --ambient: var(--c); }
:root[data-theme="light"][data-subj], :root[data-theme="light"] [data-subj] { --deep: color-mix(in oklab, var(--c) 20%, #ffffff); --deep-soft: color-mix(in oklab, var(--c) 11%, #ffffff); --ambient: var(--c); }
:root[data-subj][data-theme="light"] {
  --primary: var(--c);
  --primary-solid: var(--c);
  --primary-hover: color-mix(in srgb, var(--c) 82%, #000000);
  --primary-soft: color-mix(in srgb, var(--c) 10%, transparent);
  --accent: var(--c);
}

/* ---------- Base ---------- */
html { scrollbar-color: var(--border-strong) transparent; }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 430;
  line-height: 1.55;
  overflow-x: clip;
  background: var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(1100px 520px at 82% -12%, color-mix(in srgb, var(--ambient) 15%, transparent), transparent 70%);
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 750; letter-spacing: -0.012em; text-wrap: balance; }
button, a, summary, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; }
kbd { font-family: var(--font-mono); font-size: 0.78em; font-weight: 500; padding: 0.1rem 0.4rem; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--text-muted); white-space: nowrap; }
.btn kbd { color: inherit; border-color: color-mix(in srgb, currentColor 45%, transparent); background: none; opacity: 0.85; }
select { background-color: var(--bg); color: var(--text); }
::selection { background: var(--primary-solid); color: var(--on-primary); }
.grad-text { background: none; color: inherit; }
.view-section:not(.hidden) { animation: none; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 200; padding: 0.6rem 1rem; border-radius: var(--radius-sm); background: var(--primary-solid); color: var(--on-primary); }
.skip-link:focus { top: 0.6rem; }
#contenido:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 3px; }

/* ---------- Iconos ---------- */
.ico { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-ok { color: var(--success); }
.ico-bad { color: var(--danger); }
.ico-warn { color: var(--warning); }
.ico-info { color: var(--primary); }
.ico-gold { color: #ffc93f; }
.ico-silver { color: #b9c6e6; }
.ico-bronze { color: #e0965a; }
[data-theme="light"] .ico-gold { color: #a87400; }
[data-theme="light"] .ico-silver { color: #66759f; }
[data-theme="light"] .ico-bronze { color: #96521a; }
.btn .ico, .alert .ico { color: inherit; }

/* ---------- Botones y campos ---------- */
.btn, .btn-sm { border-radius: var(--radius-sm); letter-spacing: 0; font-family: var(--font-sans); font-weight: 650; }
.btn { transition: background-color 0.18s, border-color 0.18s, color 0.18s, transform 0.25s var(--spring), box-shadow 0.25s; }
.btn:active:not(:disabled) { transform: scale(0.965); transition-duration: 0.08s; }
.btn-primary, .btn-primary:hover:not(:disabled) { background: var(--primary-solid); color: var(--on-primary); }
.btn-primary { box-shadow: 0 0 0 0 transparent; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 6px 22px color-mix(in srgb, var(--primary) 34%, transparent); }
.btn-secondary { background: transparent; border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--primary); }
.btn-success, .btn-success:hover:not(:disabled) { background: var(--success-solid); color: var(--on-success); box-shadow: none; filter: none; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.btn-danger:hover:not(:disabled) { background: var(--danger-solid); color: var(--on-danger); border-color: var(--danger-solid); }
.btn .ico { transition: transform 0.3s var(--spring); }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea { border-color: var(--border-strong); background-color: var(--bg); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
input[type="text"]:focus, input[type="password"]:focus, input[type="search"]:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input.linux-cmd-input[type="text"], input.linux-cmd-input[type="text"]:focus, .st-term input[type="text"], .st-term input[type="text"]:focus, .palette input[type="text"]:focus, textarea.nano-textarea:focus, .sqll textarea:focus { box-shadow: none; }
input.linux-cmd-input[type="text"], .st-term input[type="text"] { background: transparent; border: none; }
.form-group label { font-weight: 600; }
.form-group label.radio-card { display: flex; margin-bottom: 0.5rem; font-size: 0.95rem; }
.form-group label.radio-card .muted { font-weight: 400; }
.alert, .alert-success { border-radius: var(--radius-sm); }
.radio-card { border-radius: var(--radius-md); transition: border-color 0.18s, background-color 0.18s; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Acceso ---------- */
.auth-screen { position: relative; min-height: 100vh; min-height: 100dvh; padding: 2rem 1.5rem; overflow: hidden; background: none; }
#auth-fibers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auth-layout { position: relative; grid-template-columns: minmax(0, 1fr) minmax(0, 410px); gap: 5.5rem; max-width: 1200px; }
.auth-pitch h1 { font-size: clamp(2.5rem, 5.3vw, 4.6rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1; margin: 0 0 1.2rem; max-width: 11ch; }
.auth-pitch > p { font-size: 1.1rem; max-width: min(46ch, 92%); }
.auth-ports { list-style: none; display: flex; gap: 0.45rem; margin-top: 2rem; flex-wrap: nowrap; }
.auth-ports li { --c-line: var(--c); position: relative; flex: 0 0 auto; min-width: 3.9rem; padding: 0.55rem 0.55rem 0.75rem; text-align: center; font-family: var(--font-head); font-weight: 800; font-size: 0.95rem; color: var(--c); border-radius: 10px 10px 4px 4px; background: var(--bg-card); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--border)); }
.auth-ports li::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 14px; height: 9px; margin-left: -7px; border-radius: 3px; background: var(--c); }
.auth-card { position: relative; border-radius: 22px; padding: 2.1rem; background: color-mix(in srgb, var(--bg-card) 92%, transparent); border-color: var(--border-strong); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform 0.6s var(--ease), opacity 0.45s; }
.auth-brand { display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; align-items: center; text-align: left; margin-bottom: 1.6rem; }
.auth-brand .brand-mark { grid-row: span 2; width: 48px; height: 48px; }
.auth-brand h2 { font-size: 1.3rem; font-weight: 850; }
.auth-brand p { font-size: 0.9rem; margin: 0; }
.auth-tabs { position: relative; }
.auth-tab { font-weight: 650; border-radius: 8px; }
.auth-tab.active { background: var(--primary-solid); color: var(--on-primary); box-shadow: none; }
.auth-ports li.is-empty { display: none; }
.auth-ports li { min-width: 5.2rem; }
.auth-screen.is-leaving .auth-card { transform: scale(1.03); opacity: 0; }
.auth-screen.is-leaving .auth-pitch { opacity: 0.25; transition: opacity 0.4s; }
.auth-screen.is-wrong .auth-card { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@media (max-width: 1080px) and (min-width: 861px) {
  .auth-layout { gap: 3.5rem; }
  .auth-ports li { min-width: 4.4rem; }
}
@media (max-width: 860px) {
  .auth-screen { align-items: flex-start; padding: 1.6rem 1.1rem 2rem; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); gap: 3.6rem; max-width: 460px; }
  .auth-pitch { text-align: left; }
  .auth-pitch h1 { font-size: 2.45rem; max-width: none; margin-bottom: 0.7rem; }
  .auth-pitch > p { margin: 0; font-size: 1rem; }
  .auth-ports { margin-top: 1.2rem; gap: 0.3rem; }
  .auth-ports li { flex: 1 1 0; min-width: 0; font-size: 0.8rem; padding: 0.45rem 0.1rem 0.6rem; }
  .auth-card { padding: 1.4rem; }
}

/* ---------- Cabecera ---------- */
.topbar { background: color-mix(in srgb, var(--bg) 84%, transparent); border-bottom: none; -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%); view-transition-name: topbar; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, #f268e2 0 16.66%, #ffcf3f 0 33.33%, #2bd4d4 0 50%, #9585ff 0 66.66%, #ff9440 0 83.33%, #4f95ff 0); }
:root[data-subj] .topbar::after { background: var(--c); }
.topbar-inner { padding: 0.65rem 1.25rem; gap: 1.6rem; max-width: calc(var(--page-width) + 2.5rem); }
.brand-row { gap: 0.7rem; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; display: block; }
.brand-mark rect { fill: var(--primary-solid); transition: fill 0.4s; }
.brand-mark path { fill: none; stroke: var(--on-primary); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-title { font-family: var(--font-head); font-weight: 850; font-size: 1.08rem; letter-spacing: -0.02em; }
.brand-sub { display: none; }
.tool-nav { position: relative; background: none; border: none; padding: 0; gap: 0.1rem; }
.tool-link { position: relative; z-index: 1; font-weight: 600; font-size: 0.92rem; border-radius: var(--radius-sm); padding: 0.55rem 0.9rem; transition: color 0.2s; }
.tool-link:hover { background: none; color: var(--text); }
.tool-link.active { background: none; color: var(--primary); box-shadow: none; }
.tool-link:hover .tool-ico { transform: translateY(-2px); }
.tool-ico { display: inline-flex; transition: transform 0.3s var(--spring); }
.tool-ico .ico { width: 19px; height: 19px; vertical-align: 0; }
.nav-ink { position: absolute; z-index: 0; left: 0; top: 0; pointer-events: none; border-radius: var(--radius-sm); background: var(--primary-soft); transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.2s, background-color 0.4s; }
.main-nav .nav-ink { top: auto; bottom: 5px; height: 3px; border-radius: 3px; background: var(--primary); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; border-color: transparent; background: transparent; color: var(--text-muted); border-radius: var(--radius-sm); }
.icon-btn:hover { color: var(--text); background: var(--bg-hover); border-color: transparent; }
.icon-btn .ico { transition: transform 0.5s var(--spring); }
#theme-toggle-btn:hover .ico { transform: rotate(180deg); }
.search-btn { display: inline-flex; align-items: center; gap: 0.5rem; height: 36px; padding: 0 0.6rem 0 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font-size: 0.88rem; cursor: pointer; transition: border-color 0.18s, color 0.18s; }
.search-btn:hover { border-color: var(--border-strong); color: var(--text); }
.user-avatar { background: var(--primary-solid); color: var(--on-primary); border-radius: 9px; font-family: var(--font-head); font-weight: 800; transition: background-color 0.4s; }
.user-chip { border-color: transparent; background: transparent; border-radius: var(--radius-sm); padding-right: 0.5rem; margin-right: -0.5rem; }
.user-chip.active { background: var(--primary-soft); border-color: transparent; }
.main-nav { position: relative; border-top: none; padding: 0 max(0.4rem, calc((100% - var(--page-width)) / 2 - 0.85rem)); }
.nav-btn { font-weight: 600; padding: 0.7rem 0.9rem 0.85rem; background: none; }
.nav-btn::after { display: none; }
.nav-btn.active { color: var(--primary); background: none; }
.badge-pill { background: var(--danger-solid); color: var(--on-danger); font-weight: 700; }
.breadcrumb-inner { padding-top: 1.1rem; max-width: calc(var(--page-width) + 2.5rem); }
.crumb-link, .crumb-current { font-weight: 500; padding: 0.15rem 0; }
.crumb-link:hover { background: none; color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.crumb-sep { padding: 0 0.3rem; color: var(--border-strong); }

/* ---------- Títulos ---------- */
.main-container { max-width: calc(var(--page-width) + 2.5rem); padding: 1.6rem 1.25rem 4rem; view-transition-name: page; }
.section-header h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 850; letter-spacing: -0.028em; line-height: 1.12; }
.section-header p { margin-top: 0.45rem; max-width: 72ch; }
.section-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; margin: 3rem 0 1.1rem; }
.section-title-row { margin: 0 0 1.1rem; }
.section-title-row .section-title { margin: 0; }
.section-subtitle { text-transform: none; letter-spacing: 0; font-size: 0.92rem; font-weight: 650; }
.ud-tag { background: none; padding: 0; color: var(--text-muted); font-weight: 600; font-size: 0.86rem; letter-spacing: 0; margin-bottom: 0.2rem; }
.brand-badge { background: none; padding: 0; color: var(--text-muted); font-weight: 600; letter-spacing: 0; font-size: 0.95rem; }

/* ---------- Datos sueltos (número grande y su nombre) ---------- */
.facts { display: flex; flex-wrap: wrap; gap: 0.9rem 2.6rem; }
.fact dt { font-size: 0.9rem; color: var(--text-muted); }
.fact dd { font-family: var(--font-head); font-size: 1.9rem; font-weight: 850; line-height: 1.1; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.fact { display: flex; flex-direction: column-reverse; }
.fact .of { font-size: 1rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.fact.is-bad dd { color: var(--danger); }
.fact.is-ok dd { color: var(--success); }

/* ---------- Bobina: progreso en espiral ---------- */
.coil { position: relative; display: grid; place-items: center; flex: none; width: var(--size, 200px); height: var(--size, 200px); color: var(--c, var(--primary)); }
.coil svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.coil path { fill: none; stroke-width: 6.5; stroke-linecap: round; }
.coil .coil-base { stroke: var(--deep); }
.coil .coil-lit { stroke: currentColor; filter: drop-shadow(0 0 7px color-mix(in srgb, currentColor 55%, transparent)); }
[data-theme="light"] .coil .coil-lit { filter: none; }
.coil-text { position: relative; text-align: center; line-height: 1.1; }
.coil-text strong { display: block; font-family: var(--font-head); font-weight: 900; font-size: calc(var(--size, 200px) * 0.145); letter-spacing: -0.04em; color: var(--text); font-variant-numeric: tabular-nums; }
.coil-text span { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Portada ---------- */
.home { position: relative; --lane: 92px; }
.fibers { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.fibers path { fill: none; stroke: var(--c); stroke-linecap: round; transition: opacity 0.3s, stroke-width 0.3s; }
.fibers .f-glow { stroke-width: 11; opacity: var(--fiber-glow); }
.fibers .f-core { stroke-width: 3; }
.fibers.has-hot g:not(.hot) .f-core { opacity: 0.28; }
.fibers.has-hot g:not(.hot) .f-glow { opacity: 0.04; }
.fibers g.hot .f-core { stroke-width: 5; }
.fibers g.hot .f-glow { stroke-width: 18; opacity: 0.28; }
.pulses { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.pulse { position: absolute; left: 0; top: 0; width: 46px; height: 5px; border-radius: 5px; background: linear-gradient(90deg, transparent, var(--c) 55%, #ffffff); offset-anchor: 100% 50%; offset-rotate: auto; box-shadow: 8px 0 14px -2px var(--c); opacity: 0; }
[data-theme="light"] .pulse { background: linear-gradient(90deg, transparent, var(--c)); box-shadow: none; height: 7px; }
.home-hero { position: relative; padding: 2.4rem 0 8.2rem; max-width: 43rem; }
.home-hero h2 { font-size: clamp(2.7rem, 6.4vw, 5.2rem); font-weight: 900; letter-spacing: -0.045em; line-height: 0.98; }
.home-hero > p { margin-top: 1rem; font-size: 1.15rem; color: var(--text-muted); }
.home-hero > p strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.home-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.5rem 0 1.9rem; }
.home-cta .btn { padding: 0.8rem 1.25rem; font-size: 1rem; }
.home-body { padding-left: var(--lane); }
.subject-list { position: relative; display: grid; gap: 0.7rem; background: none; border: none; overflow: visible; border-radius: 0; }
.subject-row {
  position: relative;
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) 9.6rem 11rem 5rem 1.2rem;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 1.4rem 1.15rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.25s, transform 0.4s var(--ease);
}
.subject-row::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--deep), transparent 68%); opacity: 0.4; transform-origin: left; transform: scaleX(0.55); transition: opacity 0.35s, transform 0.6s var(--ease); }
.subject-row:hover::before, .subject-row:focus-visible::before { opacity: 1; transform: none; }
.subject-row:hover, .subject-row:focus-visible { border-color: var(--c); }
.subject-row .subject-code, .subject-row .subject-main { transition: transform 0.45s var(--ease); }
.subject-row:hover .subject-code, .subject-row:focus-visible .subject-code { transform: translateX(8px); }
.subject-row:hover .subject-main, .subject-row:focus-visible .subject-main { transform: translateX(4px); }
.subject-row:focus-visible { outline-color: var(--c); }
.subject-row .plug { position: absolute; left: -1px; top: 50%; width: 9px; height: 26px; margin-top: -13px; border-radius: 0 6px 6px 0; background: var(--c); }
.subject-row.is-lit .plug { animation: plug 0.7s var(--ease); }
@keyframes plug { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 80%, transparent); filter: brightness(1.8); } 100% { box-shadow: 0 0 0 18px transparent; filter: none; } }
.subject-code { font-family: var(--font-head); font-size: 1.6rem; font-weight: 900; letter-spacing: -0.04em; color: var(--c, var(--primary)); }
.subject-main { min-width: 0; }
.subject-main h3 { font-size: 1.1rem; font-weight: 750; line-height: 1.3; }
.subject-main p { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject-facts { display: flex; flex-direction: column; font-size: 0.86rem; line-height: 1.45; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.subject-facts .fact-fail { color: var(--danger); font-weight: 650; }
.subject-row .subject-progress { margin: 0; }
.subject-progress-head { font-weight: 500; font-size: 0.86rem; align-items: baseline; }
.subject-progress-head strong { font-family: var(--font-head); font-size: 1.02rem; font-weight: 800; }
.subject-score { text-align: right; line-height: 1.2; }
.subject-score strong { display: block; font-family: var(--font-head); font-weight: 850; font-size: 1.3rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.subject-score span { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.subject-go { color: var(--text-muted); justify-self: end; display: inline-flex; transition: transform 0.4s var(--ease), color 0.2s; }
.subject-row:hover .subject-go { transform: translateX(4px); color: var(--c); }
.progress-track { height: 7px; border-radius: 7px; background: var(--deep); overflow: hidden; }
.progress-fill, .progress-fill.fill-success { background: var(--c, var(--primary)); border-radius: 7px; transition: width 0.9s var(--ease); }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.7rem; }
.soon { display: flex; align-items: baseline; gap: 0.7rem; padding: 0.85rem 1rem; text-align: left; border-radius: var(--radius-md); border: 1px dashed var(--border-strong); background: none; color: var(--text-muted); font: inherit; font-size: 0.9rem; line-height: 1.3; cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.soon b { font-family: var(--font-head); font-weight: 850; color: var(--c); }
.soon:hover { color: var(--text); border-color: var(--c); border-style: solid; }

/* ---------- Laboratorios: pantallas en vivo ---------- */
.lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.lab-card { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; border-radius: 22px; cursor: pointer; background: var(--bg-card); border: 1px solid var(--border); transition: border-color 0.25s, transform 0.45s var(--ease); }
.lab-card:hover { border-color: var(--c); transform: translateY(-4px); }
.lab-screen { position: relative; height: 178px; padding: 1.1rem 1.3rem; background: var(--screen); color: #d9e3ff; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.62; white-space: pre; overflow: hidden; border-bottom: 2px solid var(--c); }
.lab-screen .p { color: var(--c-dark, #2bd4d4); }
.lab-screen .d { color: #8fa1d3; }
.lab-screen .k { color: #b7a8ff; font-weight: 600; }
.lab-screen .g { color: #43dd9a; }
.lab-caret { display: inline-block; width: 0.55em; height: 1.1em; vertical-align: -0.2em; background: currentColor; animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.lab-card-body { display: flex; align-items: center; gap: 1.2rem; padding: 1.2rem 1.3rem 1.3rem; }
.lab-card-body > div { flex: 1; min-width: 0; }
.lab-card-body h3 { font-size: 1.2rem; font-weight: 800; }
.lab-card-body p { font-size: 0.92rem; margin-top: 0.15rem; }
.lab-card .btn { white-space: nowrap; }
.lab-card:hover .btn { background: var(--c); border-color: var(--c); color: var(--on-primary); }
[data-theme="light"] .lab-card:hover .btn { color: #fff; }
.lab-terminal, .lab-sql, .lab-terminal:hover, .lab-sql:hover { background: var(--bg-card); }

/* ---------- Superficies ---------- */
.card, .quick-card, .topic-card, .failure-card, .exam-block-card, .resume-banner, .study-banner, .linux-window { border-radius: var(--radius); box-shadow: none; }
.count-pills { gap: 0.4rem; }
.count-pill, .st-tab, .sqll-chip, .st-chip-btn { border-radius: var(--radius-sm); font-weight: 600; background: transparent; border-color: var(--border); transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.25s var(--spring); }
.count-pill:hover:not(.active), .st-tab:hover:not(.active), .sqll-chip:hover:not(.active), .st-chip-btn:hover:not(.active) { border-color: var(--primary); background: transparent; }
.count-pill:active, .st-tab:active, .st-chip-btn:active { transform: scale(0.95); }
.count-pill.active, .st-tab.active, .sqll-chip.active, .st-chip-btn.active { background: var(--primary-solid); border-color: var(--primary-solid); color: var(--on-primary); }
.sqll-chip.active span { color: inherit; }
.stat-chip { background: none; border: none; padding: 0; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.stat-chip.chip-fail { background: none; color: var(--danger); font-weight: 650; }
.topic-stats-row { gap: 0.35rem 1.2rem; }
.status-pill { border-radius: 0; padding: 0; font-weight: 600; font-size: 0.88rem; }
.status-pill.pill-active { background: none; color: var(--text-muted); }
.status-pill.pill-active::before { display: none; }
.meta-tag { border: none; background: none; padding: 0; font-weight: 500; font-size: 0.86rem; }
.meta-tag[style*="--success"], .meta-tag[style*="--danger"] { font-weight: 650; }
.meta-tag.tag-warn { background: none; }
.question-meta { gap: 0.3rem 1.2rem; }
.resume-banner, .study-banner { background: var(--bg-card); border: 1px solid var(--border); padding: 1.1rem 1.4rem; }
.resume-banner strong, .study-banner strong { font-family: var(--font-head); font-size: 1.08rem; font-weight: 750; }
.resume-banner { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: linear-gradient(90deg, var(--deep), transparent 75%), var(--bg-card); }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; }
.kpi-card, .kpi-card.kpi-danger, .kpi-card.kpi-ok { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); padding: 1.2rem 1.3rem; }
.kpi-label { text-transform: none; letter-spacing: 0; font-size: 0.88rem; font-weight: 500; }
.kpi-value { font-family: var(--font-head); font-size: 1.9rem; font-weight: 850; }
.kpi-value .muted, .kpi-of { font-size: 1rem !important; font-weight: 600; letter-spacing: 0; color: var(--text-muted); }
.kpi-card.kpi-danger .kpi-value { color: var(--danger); }
/* Sin el filete de color a un lado: las cajas de aviso se distinguen por el fondo */
.explanation-box, .st-scenario, .sqll-task, .tutor-exam-box, .md-tip { border-left-width: 1px; }
.sqll-task, .tutor-exam-box { background: var(--deep-soft); }
.st-scenario { border: 1px solid var(--border); border-radius: var(--radius-md); }
.md-tip { border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); border-radius: var(--radius-md); }
.sqll-task, .tutor-exam-box { border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); border-radius: var(--radius-md); }

/* ---------- Página de asignatura ---------- */
.subj-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; padding: 0.8rem 0 2.6rem; }
.subj-hero-text { min-width: 0; }
.subject-code-xl { display: block; width: max-content; font-family: var(--font-head); font-weight: 900; font-size: clamp(4.4rem, 13vw, 10.5rem); line-height: 0.82; letter-spacing: -0.045em; color: var(--c); margin: 0 0 1.1rem -0.05em; view-transition-name: subj-code; }
.subj-hero h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.subj-hero p { margin: 0.45rem 0 1.5rem; max-width: 62ch; color: var(--text-muted); }
.on-strand { padding-left: 2.6rem; }
.exam-blocks-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-left: 2.6rem; }
.strand { position: absolute; left: 0.55rem; top: -4.6rem; height: calc(100% + 1.2rem); width: 3px; border-radius: 3px; background: var(--c, var(--primary)); box-shadow: 0 0 14px color-mix(in srgb, var(--c, var(--primary)) 55%, transparent); overflow: hidden; }
[data-theme="light"] .strand { box-shadow: none; }
[data-theme="light"] .strand::after { background: linear-gradient(transparent, var(--text)); }
.strand::after { content: ""; position: absolute; left: 0; right: 0; height: 90px; top: 0; background: linear-gradient(transparent, #fff); animation: strand 3.8s linear infinite; }
@keyframes strand { from { transform: translateY(-90px); } to { transform: translateY(1600px); } }
.exam-block-card { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 2.4rem; align-items: start; padding: 1.8rem 1.9rem; overflow: visible; border: 1px solid var(--border); background: var(--bg-card); transition: border-color 0.25s; }
.exam-block-card:hover { transform: none; box-shadow: none; border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); }
.exam-block-card::before { content: ""; position: absolute; right: 100%; top: 2.7rem; width: 2.05rem; height: 3px; background: var(--c, var(--primary)); }
.exam-block-card::after { content: ""; position: absolute; left: -1px; top: calc(2.7rem - 11px); width: 9px; height: 25px; border-radius: 0 6px 6px 0; background: var(--c, var(--primary)); }
.exam-block-card h3 { font-size: 1.55rem; font-weight: 850; letter-spacing: -0.025em; line-height: 1.15; }
.exam-sub { margin: 0.5rem 0 1rem; color: var(--text-muted); font-size: 0.95rem; }
.exam-block-card .progress-track { margin: 0.9rem 0 1.4rem; }
.exam-block-card details { margin: 0.2rem 0 1rem; font-size: 0.92rem; }
.exam-block-card summary { cursor: pointer; font-weight: 600; color: var(--primary); width: max-content; list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.exam-block-card summary::-webkit-details-marker { display: none; }
.exam-block-card summary .ico { width: 0.95em; height: 0.95em; transition: transform 0.3s var(--ease); }
.exam-block-card details[open] summary .ico { transform: rotate(90deg); }
.exam-block-card details p { margin-top: 0.5rem; color: var(--text-muted); max-width: 68ch; }
.exam-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.exam-actions .btn-primary { flex: 1 1 14rem; }
.exam-topics h4 { font-size: 0.95rem; font-weight: 650; color: var(--text-muted); margin-bottom: 0.5rem; letter-spacing: 0; }
.included-topics-list { background: none; border: none; border-radius: 0; padding: 0; gap: 0; }
.included-topic-item, .included-topic-item + .included-topic-item { display: grid; grid-template-columns: 1.9rem minmax(0, 1fr) auto; gap: 0.5rem; padding: 0.55rem 0; border-top: 1px solid var(--border); align-items: baseline; font-size: 0.95rem; }
.included-topic-item > b { font-family: var(--font-head); font-weight: 850; color: var(--primary); }
.exam-block-card.is-global { grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: none; border-style: dashed; border-color: var(--border-strong); }
.exam-block-card.is-global .btn { flex-shrink: 0; }

/* ---------- Resumen del examen ---------- */
.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; margin: 0.4rem 0 1.8rem; }
.dash-hero > div:first-child { min-width: 0; }
.dash-hero h2 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.05; }
.dash-hero .clamp { margin: 0.8rem 0 0; max-width: 70ch; color: var(--text-muted); }
.clamp.is-clamped { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-btn { border: none; background: none; padding: 0.25rem 0; color: var(--primary); font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.clamp-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.dash-hero .facts { margin-top: 1.5rem; }
.fact small { font-family: var(--font-sans); font-size: 0.86rem; color: var(--text-muted); }
.practice { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr); gap: 1rem; }
.practice-main { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 1.6rem; padding: 1.8rem; border-radius: 22px; background: var(--primary-solid); color: var(--on-primary); isolation: isolate; }
.practice-main h3 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.05; }
.practice-main p { margin-top: 0.6rem; font-size: 1.02rem; font-weight: 520; line-height: 1.45; max-width: 40ch; }
.practice-main .btn { align-self: flex-start; background: var(--on-primary); color: var(--primary-solid); padding: 0.85rem 1.4rem; font-size: 1.02rem; }
.practice-main .btn:hover:not(:disabled) { background: var(--on-primary); color: var(--primary-solid); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3); }
.practice-main .rings { position: absolute; z-index: -1; right: -90px; bottom: -110px; width: 320px; height: 320px; fill: none; stroke: currentColor; stroke-width: 9; opacity: 0.13; transition: transform 1.2s var(--ease); }
.practice-main:hover .rings { transform: rotate(-70deg); }
.practice-list { display: grid; gap: 0.7rem; }
.practice-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.2rem; align-items: center; padding: 1.1rem 1.3rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); transition: border-color 0.25s; }
.practice-item:hover { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); }
.practice-item h3 { font-size: 1.1rem; font-weight: 750; }
.practice-item p { font-size: 0.92rem; color: var(--text-muted); margin-top: 0.1rem; }
.topics-grid { position: relative; display: block; padding-left: 4.6rem; background: none; border: none; overflow: visible; }
.topics-grid .strand { left: 1.61rem; top: 1.6rem; height: calc(100% - 8rem); }
.topic-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 23rem); gap: 2rem; align-items: center; border: none; border-radius: 0; background: none; padding: 1.5rem 0; }
.topic-card:hover { transform: none; box-shadow: none; }
.topic-card + .topic-card { border-top: 1px solid var(--border); }
.topic-node { position: absolute; left: -4.6rem; top: 1.35rem; width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--deep) 0); box-shadow: 0 0 0 6px var(--bg); font-style: normal; transition: transform 0.4s var(--spring); }
.topic-node::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg); }
.topic-node b { position: relative; font-family: var(--font-head); font-weight: 900; font-size: 1.25rem; color: var(--primary); }
.topic-card:hover .topic-node { transform: scale(1.1); }
.topic-card h3 { font-size: 1.22rem; font-weight: 800; }
.topic-actions { justify-content: flex-end; }

/* ---------- Test ---------- */
.quiz-strand { display: flex; gap: 3px; height: 9px; margin: 0 0 1.3rem; }
.quiz-strand.is-many { gap: 0; border-radius: 9px; overflow: hidden; }
.quiz-strand i { flex: 1; border-radius: 9px; background: var(--deep); transition: background-color 0.4s; }
.quiz-strand.is-many i { border-radius: 0; }
.quiz-strand i.answered { background: var(--primary); }
.quiz-strand i.right { background: var(--success); }
.quiz-strand i.wrong { background: var(--danger); }
.quiz-strand i.current { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary); }
.quiz-strand i.just { animation: seg 0.6s var(--spring); }
@keyframes seg { 0% { transform: scaleY(0.2); } 60% { transform: scaleY(2.3); } 100% { transform: none; } }
.quiz-topbar { background: none; border: none; padding: 0; margin-bottom: 1rem; }
.quiz-topbar h2 { font-weight: 800; }
.streak { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--success-soft); color: var(--success); font-weight: 700; font-size: 0.88rem; }
.streak.pop { animation: pop 0.5s var(--spring); }
@keyframes pop { 0% { transform: scale(0.5); } 60% { transform: scale(1.18); } 100% { transform: none; } }
.quiz-layout { grid-template-columns: minmax(0, 1fr) 280px; }
.quiz-layout > .card { padding: 1.8rem 1.9rem; }
.quiz-layout > aside.card { padding: 1.4rem; }
.question-title { font-family: var(--font-head); font-weight: 750; font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.32; letter-spacing: -0.015em; text-wrap: pretty; margin: 0.4rem 0 1.5rem; }
.option-btn { position: relative; overflow: hidden; border: 1.5px solid var(--border-strong); border-radius: 14px; background: transparent; transition: background-color 0.2s, border-color 0.2s, transform 0.3s var(--ease); }
.option-btn:hover:not(:disabled):not(.correct):not(.wrong) { transform: translateX(6px); border-color: var(--primary); background: var(--primary-soft); }
.option-btn:active:not(:disabled) { transform: translateX(6px) scale(0.99); }
.option-btn > span:last-child { padding-top: 0.2rem; min-width: 0; overflow-wrap: anywhere; }
.option-letter { background: var(--bg-hover); border-color: transparent; font-family: var(--font-head); font-weight: 800; border-radius: 8px; transition: background-color 0.2s, color 0.2s; }
.option-btn:hover:not(:disabled) .option-letter { background: var(--primary-solid); color: var(--on-primary); }
.option-btn.selected { border-color: var(--primary); }
.option-btn.selected .option-letter { background: var(--primary-solid); border-color: var(--primary-solid); color: var(--on-primary); }
.option-btn.correct .option-letter { background: var(--success-solid) !important; border-color: var(--success-solid) !important; color: var(--on-success) !important; }
.option-btn.wrong .option-letter { background: var(--danger-solid) !important; border-color: var(--danger-solid) !important; color: var(--on-danger) !important; }
.anim-answer .option-btn.correct::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--success) 55%, transparent), transparent); animation: sweep 0.75s var(--ease) forwards; }
@keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(340%); } }
.anim-answer .option-btn.wrong { animation: shake 0.4s; }
.anim-answer .explanation-box { animation: unfold 0.5s var(--ease); }
@keyframes unfold { from { opacity: 0; transform: translateY(-10px); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0); } }
.anim-next > * { animation: from-right 0.38s var(--ease) backwards; }
.anim-prev > * { animation: from-left 0.38s var(--ease) backwards; }
@keyframes from-right { from { opacity: 0; transform: translateX(34px); } }
@keyframes from-left { from { opacity: 0; transform: translateX(-34px); } }
.explanation-box { border: 1px solid var(--border); border-radius: 14px; }
.explanation-box.exp-correct { border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.explanation-box.exp-wrong { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.qnav-cell { font-weight: 600; border-radius: 9px; background: transparent; font-variant-numeric: tabular-nums; transition: background-color 0.15s, transform 0.25s var(--spring); }
.qnav-cell:hover { transform: scale(1.08); background: var(--bg-hover); }
.qnav-cell.answered { background: var(--primary-soft); }
.qnav-cell.right { background: var(--success-soft); }
.qnav-cell.wrong { background: var(--danger-soft); }
.score-hero { position: relative; display: grid; justify-items: center; gap: 0.6rem; background: none; border: none; padding: 1.6rem 1rem 2.4rem; }
.score-hero .brand-badge { font-size: 1rem; margin-bottom: 0.6rem; }
.score-hero .coil-text strong { font-size: calc(var(--size) * 0.17); }
.score-hero.is-pass { --c: var(--success); }
.score-hero.is-fail { --c: var(--danger); }
.score-hero .verdict { font-family: var(--font-head); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 850; letter-spacing: -0.025em; margin-top: 0.8rem; text-align: center; text-wrap: balance; }
.score-hero .facts { justify-content: center; margin: 0.7rem 0 1.2rem; }
.score-hero .fact { align-items: center; }
#fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* ---------- Historial y ranking ---------- */
.chart-card { position: relative; padding: 1.4rem 1.5rem 1rem; margin-bottom: 1rem; }
.chart-card h3 { font-size: 1.15rem; font-weight: 750; margin-bottom: 0.6rem; }
.chart-card svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-card .grid-l { stroke: var(--border); stroke-width: 1; }
.chart-card .pass-l { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: none; opacity: 0.7; }
.chart-card text { fill: var(--text-muted); font-size: 12px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.chart-card .end-l { fill: var(--text); font-weight: 700; font-size: 14px; }
.chart-card .line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-card .area { fill: var(--primary); opacity: 0.1; }
.chart-card .dot { fill: var(--primary); stroke: var(--bg-card); stroke-width: 2; }
.chart-card .cross { stroke: var(--text-muted); stroke-width: 1; opacity: 0; }
.chart-tip { position: absolute; z-index: 3; pointer-events: none; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 0.86rem; max-width: 240px; opacity: 0; transition: opacity 0.15s; }
.chart-tip b { display: block; font-family: var(--font-head); font-size: 1.1rem; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 13rem)); justify-content: center; align-items: end; gap: 0.8rem; margin: 0.5rem 0 1.6rem; }
.podium-col { text-align: center; min-width: 0; }
.podium-col strong { display: block; font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-col span { font-size: 0.9rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.podium-bar { display: grid; place-items: start center; margin-top: 0.6rem; padding-top: 0.8rem; border-radius: 16px 16px 4px 4px; background: var(--deep); color: var(--primary); font-family: var(--font-head); font-weight: 900; font-size: 2.4rem; line-height: 1; transform-origin: bottom; animation: rise 0.8s var(--ease) backwards; }
.podium-col:nth-child(1) .podium-bar { height: 110px; animation-delay: 0.14s; }
.podium-col:nth-child(2) .podium-bar { height: 160px; background: var(--primary-solid); color: var(--on-primary); animation-delay: 0.28s; }
.podium-col:nth-child(3) .podium-bar { height: 78px; }
@keyframes rise { from { transform: scaleY(0); } }

/* ---------- Apuntes y tablas ---------- */
#notes-file-select { width: 420px; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.section-header > * { min-width: 0; max-width: 100%; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1.25rem; }
.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="search"] { flex: 1 1 220px; width: auto; max-width: 320px; min-width: 0; }
@media (max-width: 640px) { .filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="search"] { max-width: none; flex-basis: 100%; } }
.notes-body hr { border: 0; height: 1px; background: var(--border); margin: 2rem 0; }
.notes-body h4 { margin: 1.3rem 0 0.4rem; font-size: 1.05rem; font-weight: 700; }
.md-table { overflow-x: auto; margin: 1.1rem 0 1.4rem; border: 1px solid var(--border); border-radius: var(--radius-md); }
.md-table table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.96rem; line-height: 1.5; }
.md-table th { background: var(--primary-soft); color: var(--text); text-align: left; }
.md-table th, .md-table td { padding: 0.65rem 0.9rem; vertical-align: top; border-bottom: 1px solid var(--border); }
.md-table tr:last-child td { border-bottom: 0; }
.notes-body :not(pre) > code { overflow-wrap: anywhere; }
.read-bar { position: fixed; left: 0; top: 0; z-index: 80; height: 3px; width: 100%; transform-origin: left; transform: scaleX(0); background: var(--primary); }
.notes-body h1 + h2 { border-top: none; padding-top: 0; }
.linux-vkeys { background: var(--screen-bar) !important; border-top-color: var(--screen-line) !important; }
.linux-vkeys button { background: var(--screen); border-color: #4459a3; }
.notes-body { max-width: 860px; font-size: 1.04rem; line-height: 1.7; }
.notes-body h1 { font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; color: var(--text); }
.notes-body h2 { color: var(--text); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.notes-body h3 { color: var(--primary); }
.notes-body p, .notes-body li { max-width: 74ch; }
.notes-body code { border-radius: 6px; }
.notes-body :not(pre) > code { background: var(--primary-soft); color: var(--text); padding: 0.1em 0.35em; }
.notes-body .md-code code { background: none; color: inherit; padding: 0; }
th { text-transform: none; letter-spacing: 0; font-size: 0.86rem; font-weight: 600; }
.card.table-wrap { padding: 0.4rem 0.7rem; }
.card.table-wrap > p { padding: 1rem 0.8rem; }

/* ---------- Terminal, SQL y repaso ---------- */
.linux-window, .linux-window-bar, .linux-live-hint-bar, .nano-modal-host { border-color: var(--screen-line); }
.linux-window, .nano-modal-host { background: var(--screen); }
.linux-window { box-shadow: 0 20px 60px rgba(2, 6, 26, 0.4); }
.linux-window-bar, .linux-live-hint-bar { background: var(--screen-bar); }
.term-side-tabs { border: none; border-bottom: 1px solid var(--border); border-radius: 0; background: none; padding: 0; gap: 0; display: flex; flex-wrap: wrap; }
.term-tab-btn { border-radius: 0; padding: 0.7rem 1rem; font-size: 0.92rem; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; transition: color 0.2s, border-color 0.3s; }
.term-tab-btn:hover { color: var(--text); }
.term-tab-btn.active { background: none; color: var(--primary); border-bottom-color: var(--primary); }
.linux-side-panel .term-tab-btn { flex: 1; padding-inline: 0.4rem; }
.tutor-card, .lab-step-item { border-radius: var(--radius-md); }
.sqll { --code-bg: var(--screen); }
.sqll-task-label, .sqll-results-title { text-transform: none; letter-spacing: 0; font-weight: 650; font-size: 0.92rem; }
.sqll-mod summary { font-family: var(--font-head); font-weight: 700; }
.sqll-step.active { font-weight: 650; }
.sqll-step-dot, .sqll-test-ico { border-width: 1.5px; border-color: var(--border-strong); }
.sqll-step-dot { color: var(--on-success); }
.sqll-chip { font-weight: 500; }
.sqll-side { top: 4.6rem; }
.st-tabs { gap: 0.4rem; padding-bottom: 0.9rem; }
.st-progress { gap: 0.35rem 1.4rem; }
.st-toolbar select { width: auto; max-width: 100%; min-width: 220px; }
.st-flash { height: 300px; }
.st-flash-inner { transition: transform 0.7s cubic-bezier(0.3, 1.25, 0.5, 1); }
.st-flash-face { border-radius: 22px; border-color: var(--border-strong); }
.st-flash-back { background: var(--deep-soft); border-color: var(--primary); }
.st-flash-text { font-family: var(--font-head); font-size: 1.35rem; font-weight: 650; line-height: 1.4; }
.st-gloss-item, .st-match-item, .st-option { border-radius: var(--radius-md); }
.st-gloss-item, .st-option { transition: border-color 0.2s, background-color 0.2s; }
.st-gloss-item:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); }
.st-match-item:hover:not(.done) { transform: translateX(4px); border-color: var(--primary); }
.st-match-item.done { animation: pop 0.45s var(--spring); }
.st-case-card { border-radius: var(--radius); padding: 1.3rem; line-height: 1.45; transition: border-color 0.25s, transform 0.4s var(--ease); }
.st-case-card strong, .st-case-card h3, .st-case-card h4 { font-family: var(--font-head); font-size: 1.08rem; line-height: 1.25; }
.st-case-card:hover { transform: translateY(-4px); }
.st-case-icon { color: var(--primary); font-size: 1.7rem; transition: transform 0.4s var(--spring); }
.st-case-card:hover .st-case-icon { transform: rotate(-8deg) scale(1.12); }
.st-term { background: var(--screen); font-family: var(--font-mono); }
.linux-window .muted, .linux-live-hint-bar .muted, .linux-live-hint-bar, .linux-bar-hint { color: #a9b8e2 !important; }
.term-mini-chip { background: transparent; border-color: #4459a3; color: #bfe9ee; transition: background-color 0.2s, border-color 0.2s; }
.term-mini-chip:hover { background: rgba(43, 212, 212, 0.16); border-color: #2bd4d4; }
[data-theme="light"] .linux-side-panel .term-mini-chip { color: var(--primary); background: transparent; border-color: var(--border-strong); }
.term-banner, .term-path, .lab-hint-box { color: #9fdfe6; }
.lab-hint-box, .md-code { background: var(--screen); }
.md-code { border-radius: var(--radius-md); }
.md-code code { font-family: var(--font-mono); }

/* ---------- Buscador (Ctrl K) ---------- */
.palette { width: min(640px, calc(100vw - 2rem)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.palette::backdrop { background: rgba(4, 8, 28, 0.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.palette[open] { animation: palette-in 0.28s var(--ease); }
@keyframes palette-in { from { opacity: 0; transform: translateY(-16px) scale(0.97); } }
.palette-top { display: flex; align-items: center; gap: 0.7rem; padding: 0.3rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.palette input[type="text"] { flex: 1; min-width: 0; border: none; background: none; box-shadow: none; padding: 0.95rem 0; font-size: 1.08rem; color: var(--text); }
.palette-list { list-style: none; max-height: min(52vh, 440px); overflow-y: auto; overscroll-behavior: contain; padding: 0.5rem; }
.palette-item { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) auto; gap: 0.8rem; align-items: baseline; padding: 0.7rem 0.8rem; border-radius: 12px; cursor: pointer; }
.palette-item b { font-family: var(--font-head); font-weight: 850; color: var(--c, var(--primary)); }
.palette-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item small { color: var(--text-muted); font-size: 0.84rem; white-space: nowrap; }
.palette-item[aria-selected="true"] { background: var(--deep); }
.palette-empty { padding: 1.4rem 1rem; color: var(--text-muted); text-align: center; }

/* ---------- Avisos ---------- */
.toast { border-left-width: 1px; border-radius: var(--radius-md); font-weight: 550; overscroll-behavior: contain; animation: toast-in 0.45s var(--spring); }
.toast.toast-success { border-color: color-mix(in srgb, var(--success) 55%, transparent); }
.toast.toast-error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(0.94); } }

/* ---------- Interruptor (perfil) ---------- */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background-color 0.25s; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); transition: transform 0.35s var(--spring); }
.switch input:checked + i { background: var(--success-solid); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--primary); outline-offset: 3px; }

/* ---------- Cambio de pantalla ---------- */
::view-transition { pointer-events: none; }
::view-transition-group(*) { animation-duration: 0.42s; animation-timing-function: cubic-bezier(0.22, 0.8, 0.24, 1); }
::view-transition-old(topbar), ::view-transition-new(topbar) { animation-duration: 0.25s; }
html.vt-in::view-transition-old(page) { animation: vt-out-left 0.2s ease-in both; }
html.vt-in::view-transition-new(page) { animation: vt-in-right 0.4s cubic-bezier(0.22, 0.8, 0.24, 1) both; }
html.vt-back::view-transition-old(page) { animation: vt-out-right 0.2s ease-in both; }
html.vt-back::view-transition-new(page) { animation: vt-in-left 0.4s cubic-bezier(0.22, 0.8, 0.24, 1) both; }
html.vt-flat::view-transition-old(page) { animation: vt-fade-out 0.15s both; }
html.vt-flat::view-transition-new(page) { animation: vt-fade-in 0.28s both; }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-40px); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(60px); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(40px); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-60px); } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
::view-transition-old(subj-code), ::view-transition-new(subj-code) { height: 100%; width: auto; }
html.vt-theme .topbar, html.vt-theme .main-container { view-transition-name: none; }
html.vt-theme::view-transition-old(root), html.vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Sin movimiento: por preferencia del sistema o desde Mi perfil */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; }
html[data-motion="off"] .strand::after { display: none; }
@media (prefers-reduced-motion: reduce) { .strand::after { display: none; } ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* ---------- Tableta y móvil ---------- */
@media (max-width: 1180px) { .search-btn span, .search-btn kbd { display: none; } .search-btn { padding: 0 0.55rem; border-color: transparent; } }
@media (min-width: 641px) and (max-width: 900px) {
  .tool-label { display: inline; }
  .topbar-inner { gap: 0.8rem; }
  .tool-link { font-size: 0.87rem; padding-inline: 0.6rem; }
  #user-chip-name { display: none; }
}
@media (max-width: 1080px) {
  .home { --lane: 74px; }
  .subject-row { grid-template-columns: 6.4rem minmax(0, 1fr) 9rem 4.8rem 1.2rem; }
  .subject-facts { grid-column: 2; grid-row: 2; flex-direction: row; flex-wrap: wrap; gap: 0.1rem 1rem; margin-top: -1.1rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quiz-layout { grid-template-columns: minmax(0, 1fr); }
  .quiz-layout > aside.card { position: static; }
  .topic-card { grid-template-columns: 1fr; gap: 0.9rem; }
  .topic-actions { justify-content: flex-start; }
  .practice { grid-template-columns: 1fr; }
  .exam-block-card { grid-template-columns: 1fr; gap: 1.6rem; }
}
@media (max-width: 900px) { .lab-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .topbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .section-header h2 { font-size: 1.55rem; }
  .brand-mark { width: 32px; height: 32px; }
  .search-btn { height: 40px; width: 40px; justify-content: center; }
  .icon-btn { width: 40px; height: 40px; }
  .tool-nav { background: var(--bg-elev); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border-top: 1px solid var(--border); padding: 0.3rem 0.4rem calc(0.3rem + env(safe-area-inset-bottom)); position: fixed; }
  .tool-link { gap: 0.25rem; font-weight: 600; padding: 0.35rem 0.2rem; font-size: 0.72rem; }
  .tool-link .tool-label { font-size: 0.75rem; }
  .tool-ico .ico { width: 22px; height: 22px; }
  .section-title { margin: 2.2rem 0 0.9rem; font-size: 1.2rem; }
  .main-container { padding: 0.6rem 1rem 2rem; }
  .facts { gap: 0.8rem 1.7rem; }
  .fact dd { font-size: 1.55rem; }
  .home { --lane: 46px; }
  .home-hero { padding: 1.1rem 0 5.6rem; }
  .home-hero h2 { font-size: clamp(2.5rem, 13vw, 3.4rem); }
  .home-hero > p { font-size: 1.05rem; margin-top: 0.7rem; }
  .home-cta { margin: 1.1rem 0 1.4rem; }
  .home-cta .btn { flex: 1 1 auto; }
  .home-cta .btn-secondary { display: none; }
  .section-title-row { gap: 0.6rem; }
  .fibers .f-core { stroke-width: 2.5; }
  .fibers .f-glow { stroke-width: 7; }
  .subject-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 1rem; padding: 1rem 1.1rem 1.1rem 1.25rem; }
  .subject-row:hover, .subject-row:focus-visible { transform: none; }
  .subject-row .subject-code { grid-column: 1; grid-row: 1; font-size: 1.35rem; }
  .subject-main { grid-column: 1 / -1; grid-row: 2; }
  .subject-main h3 { font-size: 1.02rem; }
  .subject-main p { display: none; }
  .subject-facts { grid-column: 1 / -1; grid-row: 3; margin: 0.15rem 0 0.6rem; gap: 0 0.9rem; }
  .subject-facts span:first-child { display: none; }
  .subject-row .subject-progress { grid-column: 1 / -1; grid-row: 4; }
  .subject-row .subject-score { grid-column: 2; grid-row: 1; display: flex; align-items: baseline; gap: 0.35rem; }
  .subject-score strong { font-size: 1.1rem; }
  .subject-go { display: none; }
  .soon-grid { grid-template-columns: 1fr; }
  .home-after { margin-left: 0; }
  .lab-screen { height: 158px; font-size: 0.78rem; padding: 0.9rem 1rem; }
  .lab-card-body { flex-direction: column; align-items: stretch; gap: 0.9rem; padding: 1.1rem; }
  .subj-hero { flex-direction: column; align-items: flex-start; gap: 1.2rem; padding: 0.4rem 0 1.6rem; }
  .subj-hero p { margin-bottom: 1.1rem; }
  .subj-hero .coil, .dash-hero .coil { align-self: center; }
  .dash-hero { flex-direction: column; align-items: flex-start; gap: 1.4rem; }
  .exam-blocks-grid, .on-strand { padding-left: 1.15rem; }
  .strand { left: 0; }
  .exam-block-card { padding: 1.25rem 1.1rem; border-radius: 16px; }
  .exam-block-card::before { width: 1.15rem; }
  .exam-block-card h3 { font-size: 1.3rem; }
  .exam-block-card.is-global { grid-template-columns: 1fr; }
  .exam-actions { flex-direction: column; }
  .exam-actions .btn-primary { flex: none; }
  .practice-main { padding: 1.4rem; border-radius: 18px; }
  .practice-main .btn { align-self: stretch; }
  .practice-item { grid-template-columns: 1fr; gap: 0.8rem; padding: 1.05rem; }
  .topics-grid { padding-left: 3.3rem; }
  .topics-grid .strand { left: 1.12rem; }
  .topic-node { left: -3.3rem; width: 2.4rem; height: 2.4rem; }
  .topic-node::before { inset: 4px; }
  .topic-node b { font-size: 1rem; }
  .quiz-layout > .card { padding: 1.15rem; }
  .sqll-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .podium { gap: 0.4rem; }
  .podium-bar { font-size: 1.8rem; }
  .st-flash { height: 320px; }
  .palette { margin-top: 5vh; }
  .palette-item { grid-template-columns: 3.9rem minmax(0, 1fr); }
  .palette-item small { display: none; }
}

/* ---------- Casillas y opciones ---------- */
input[type="radio"], input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: 0 0 auto; display: inline-grid; place-content: center; width: 1.2rem; height: 1.2rem; margin: 0.1rem 0 0; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--bg); cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
input[type="checkbox"] { border-radius: 6px; }
input[type="radio"]::before { content: ""; width: 0.58rem; height: 0.58rem; border-radius: 50%; background: var(--on-primary); transform: scale(0); transition: transform 0.22s var(--ease); }
input[type="checkbox"]::before { content: ""; width: 0.36rem; height: 0.66rem; margin-top: -0.16rem; border: solid var(--on-primary); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform 0.22s var(--ease); }
input[type="radio"]:checked, input[type="checkbox"]:checked { border-color: var(--primary-solid); background: var(--primary-solid); }
input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:checked::before { transform: rotate(45deg) scale(1); }
input[type="radio"]:hover, input[type="checkbox"]:hover { border-color: var(--primary); }
.failure-q { margin-top: 0.7rem; font-size: 1.08rem; font-weight: 650; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.75; }
@media (max-width: 640px) { .table-wrap .col-opt { display: none; } }

/* ---------- Nada se sale por los lados ---------- */
html, body { overflow-x: clip; }
@media (max-width: 1200px) { .main-container { overflow-x: clip; } }
.failure-card, .option-text, .explanation-box, .ans-compare, .question-text, .notes-body, .st-root { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody { display: block; }
  .stack-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 1rem; padding: 0.95rem 0.6rem; border-bottom: 1px solid var(--border); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { padding: 0; border: 0; }
  .hist-table td:nth-child(2) { order: 1; }
  .hist-table td:nth-child(5) { order: 2; font-size: 1.3rem; font-family: var(--font-head); text-align: right; }
  .hist-table td:nth-child(4) { order: 3; font-size: 0.92rem; }
  .hist-table td:nth-child(1) { order: 4; font-size: 0.88rem; text-align: right; }
  .hist-table td:nth-child(3), .hist-table td:nth-child(6) { display: none; }
  .hist-table td:nth-child(7) { order: 5; grid-column: 1 / -1; margin-top: 0.5rem; }
  .hist-table td .btn { width: 100%; }
  .rank-table tr { grid-template-columns: 2.6rem minmax(0, 1fr) auto; align-items: center; }
  .rank-table td:nth-child(2) strong { display: block; }
  .rank-table td:nth-child(3), .rank-table td:nth-child(5) { display: none; }
  .rank-table td:nth-child(4) { grid-column: 3; }
  .rank-table td:nth-child(6) { display: none; }
}

.quiz-move { display: flex; gap: 0.5rem; }
.notes-body hr + h2 { border-top: none; padding-top: 0; margin-top: 0; }
@media (max-width: 640px) {
  .hist-table td:nth-child(5) .muted { font-size: 0.95rem; font-family: var(--font-sans); }
  .quiz-footer { display: contents; }
  .quiz-footer > div:first-child { margin-top: 1rem; }
  .quiz-footer > div:first-child .btn { flex: 1 1 auto; justify-content: center; }
  .quiz-move { display: grid; grid-template-columns: 1fr 1.6fr; margin: 0.7rem -0.6rem -0.4rem; padding: 0.6rem; background: var(--bg-card); }
  .quiz-move.is-ready { position: sticky; bottom: calc(4rem + env(safe-area-inset-bottom)); z-index: 6; }
  .quiz-move .btn { justify-content: center; padding-inline: 0.6rem; }
}

@media (min-width: 641px) { .hist-table td:nth-child(1), .hist-table td:nth-child(3), .hist-table td:nth-child(4), .table-wrap td.muted { white-space: nowrap; } }
[data-theme="light"] .linux-window { box-shadow: 0 14px 34px rgba(20, 30, 80, 0.22); }
.more-active { margin: -0.4rem 0 1.2rem; }
.more-active summary { display: inline-flex; padding: 0.4rem 0; cursor: pointer; font-weight: 600; color: var(--primary); }
.more-active .resume-banner { background: var(--bg-card); border-color: var(--border); margin-top: 0.6rem; }

/* ---------- Pregunta de confirmación ---------- */
.ask { width: min(460px, calc(100vw - 2rem)); margin: auto; padding: 1.6rem; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg); overscroll-behavior: contain; }
.ask[open] { animation: palette-in 0.28s var(--ease); }
.ask::backdrop { background: rgba(4, 8, 28, 0.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.ask h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.ask-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; margin-top: 1.3rem; }
a.brand-row { color: inherit; text-decoration: none; }
html { scroll-padding: 7rem 0 2rem; }
@media (max-width: 900px) { html { scroll-padding-bottom: 8rem; } .ask-btns .btn { flex: 1 1 100%; justify-content: center; } .ask-btns { flex-direction: column-reverse; } }
@media (pointer: fine) { html { overscroll-behavior: none; } }
.failure-card { content-visibility: auto; contain-intrinsic-size: auto 340px; }
.st-flash:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 4px; border-radius: 18px; }

/* ---------- Visitas (administrador) ---------- */
@media (max-width: 1080px) { .tool-admin { display: none; } }
.use-range { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.use-facts { margin-bottom: 1.5rem; }
.use-charts, .use-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.use-charts .chart-card { margin-bottom: 0; }
.use-chart .bar { fill: var(--primary); transform-origin: bottom; transform-box: fill-box; animation: rise 0.6s var(--ease) backwards; transition: opacity 0.15s; }
.use-chart .is-hover .bar:not(.on) { opacity: 0.4; }
.use-users { border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); overflow: hidden; margin-bottom: 1.6rem; }
.use-user + .use-user { border-top: 1px solid var(--border); }
.use-user summary { display: grid; grid-template-columns: auto minmax(0, 1fr) 8rem 6rem 9.5rem 1rem; gap: 0.4rem 1.1rem; align-items: center; padding: 1rem 1.3rem; cursor: pointer; list-style: none; transition: background-color 0.2s; }
.use-user summary::-webkit-details-marker { display: none; }
.use-user summary::after { content: ""; width: 8px; height: 8px; border: solid var(--text-muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 0.25s var(--ease); }
.use-user[open] summary::after { transform: rotate(-135deg); }
.use-user summary:hover { background: var(--primary-soft); }
.use-user summary:focus-visible { outline-offset: -3px; }
.use-av { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: var(--primary-solid); color: var(--on-primary); font-family: var(--font-head); font-weight: 850; }
.use-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.use-name strong { font-family: var(--font-head); font-size: 1.08rem; }
.use-name small, .use-num small, .use-last { color: var(--text-muted); font-size: 0.86rem; }
.use-num { text-align: right; }
.use-num b { display: block; font-family: var(--font-head); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.use-last { text-align: right; }
.use-last.is-on { color: var(--success); font-weight: 650; }
.use-last.is-on::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 0.4rem; border-radius: 50%; background: var(--success); }
.use-detail { padding: 0.4rem 1.3rem 1.4rem; }
.use-detail .fact dd { font-size: 1.45rem; }
.use-detail > p { margin: 0.9rem 0; font-size: 0.93rem; }
.use-sections, .use-recent { list-style: none; margin: 0; padding: 0; }
.use-sections li:not([data-subj]) { --c: var(--text-muted); }
.use-sections li { break-inside: avoid; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 1rem; padding: 0.5rem 0; font-size: 0.95rem; }
.use-sections b { font-variant-numeric: tabular-nums; }
.use-sections i { grid-column: 1 / -1; height: 7px; width: var(--w); min-width: 4px; border-radius: 4px; background: var(--c); }
.use-detail .use-sections { columns: 2; column-gap: 2.4rem; }
.use-two + .more-active { margin-top: 1.4rem; }
.use-two h3 { font-size: 1.15rem; margin-bottom: 0.7rem; }
.use-recent li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.use-recent li:first-child { border-top: 0; }
.use-recent div { min-width: 0; }
.use-recent div:last-child { text-align: right; white-space: nowrap; }
.use-recent strong, .use-recent small, .use-recent b { display: block; }
.use-recent small { color: var(--text-muted); font-size: 0.86rem; white-space: normal; }
.use-note { margin-top: 1rem; font-size: 0.9rem; }
@media (max-width: 860px) {
  .use-charts, .use-two { grid-template-columns: minmax(0, 1fr); }
  .use-user summary { grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 0.9rem 1rem; }
  .use-name { grid-column: 2 / 4; }
  .use-user summary::after { grid-column: 4; grid-row: 1; justify-self: end; margin-right: 0.3rem; }
  .use-user summary .use-num { grid-row: 2; text-align: left; }
  .use-user summary .use-num:nth-of-type(3) { grid-column: 1 / 3; }
  .use-user summary .use-num:nth-of-type(4) { grid-column: 3; }
  .use-last { grid-row: 2; grid-column: 4; align-self: center; }
  .use-detail { padding-inline: 1rem; }
  .use-detail .use-sections { columns: 1; }
}

/* ---------- Plan de la víspera ---------- */
.home-hero.is-exam { padding-bottom: 7.4rem; }
.home-hero.is-exam h2 span { color: var(--c); }
@media (max-width: 1000px) { .home-hero.is-exam > p { max-width: 30rem; } }
.eve { position: relative; margin-bottom: 2.6rem; padding: 1.6rem 1.8rem 1.7rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--c) 38%, var(--border)); background: var(--bg-card); }
.eve-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 1.2rem; margin-bottom: 1.1rem; }
.eve-head h3 { font-size: 1.5rem; }
.eve-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
.eve-step { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); gap: 1rem; }
.eve-n { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 2px solid var(--border-strong); font-family: var(--font-head); font-weight: 800; color: var(--text-muted); }
.eve-step.is-now .eve-n { border-color: var(--c); color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 20%, transparent); }
.eve-step h4 { font-size: 1.1rem; line-height: 2.1rem; }
.eve-now { display: inline-block; margin-left: 0.5rem; padding: 0 0.6rem; border-radius: 99px; line-height: 1.6; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text); font-size: 0.82rem; font-weight: 650; vertical-align: 1px; }
.eve-step p { font-size: 0.95rem; max-width: 62ch; }
.eve-step > div > .btn { margin-top: 0.6rem; }
.eve-topics { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.85rem; }
.eve-topic { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.35rem 1rem; align-items: center; }
.eve-name { font-weight: 600; font-size: 0.97rem; }
.eve-count { color: var(--text-muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.eve-topic.is-ok .eve-count { color: var(--success); font-weight: 650; }
.eve-topic .btn { grid-column: 3; grid-row: 1 / 3; }
.eve-fiber { grid-column: 1 / 3; height: 7px; border-radius: 4px; background: var(--deep, var(--border)); position: relative; overflow: visible; }
.eve-fiber::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 4px; background: var(--c); transform-origin: left; animation: eve-grow 0.9s var(--ease) backwards; }
[data-theme="dark"] .eve-fiber::after { box-shadow: 0 0 12px color-mix(in srgb, var(--c) 45%, transparent); }
@keyframes eve-grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .eve-fiber::after { animation: none; } }
.eve-models { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.7rem; }
.eve-model { display: grid; gap: 0.1rem; padding: 0.6rem 1rem; text-align: left; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: none; color: var(--text); font: inherit; cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.eve-model:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.eve-model b { font-family: var(--font-head); }
.eve-model span { color: var(--text-muted); font-size: 0.84rem; }
.eve-rest { margin-top: 1.2rem; font-size: 0.92rem; }
.res-plan { margin-top: 1rem; min-height: 1.4em; }
.soon-more { margin: 2.2rem 0 0; }
.soon-more .soon-grid { margin-top: 0.7rem; }
.dates { width: min(640px, calc(100vw - 2rem)); }
.dates-list { display: grid; gap: 0.2rem; max-height: min(52vh, 480px); overflow: auto; overscroll-behavior: contain; margin-top: 0.8rem; padding-right: 0.3rem; }
.dates-list label { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 0.5rem 0; border-top: 1px solid var(--border); font-size: 0.93rem; }
.dates-list label:first-child { border-top: 0; }
.dates-list b { color: var(--c); font-family: var(--font-head); margin-right: 0.3rem; }
.dates-list input { padding: 0.45rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); font: inherit; }
.rep-label { display: block; margin: 0.9rem 0 0.35rem; font-weight: 600; }
.ask textarea { width: 100%; padding: 0.7rem 0.8rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); font: inherit; resize: vertical; }
.use-reports { margin-bottom: 1.4rem; }
.use-reports h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
@media (max-width: 700px) {
  .home-hero.is-exam { padding-bottom: 8rem; }
  .home:has(.eve) .eve { margin-left: calc(var(--lane) * -1 + 0.6rem); position: relative; z-index: 1; }
  .eve { padding: 1.2rem 1rem 1.3rem; }
  .eve-step { grid-template-columns: 1.8rem minmax(0, 1fr); gap: 0.7rem; }
  .eve-n { width: 1.8rem; height: 1.8rem; font-size: 0.9rem; }
  .eve-step h4 { line-height: 1.35; padding-top: 0.2rem; }
  .eve-now { margin-left: 0; display: table; margin-top: 0.2rem; }
  .eve-topic { grid-template-columns: minmax(0, 1fr) auto; }
  .eve-name { grid-column: 1; }
  .eve-count { grid-column: 1; grid-row: 2; }
  .eve-fiber { grid-column: 1 / 3; grid-row: 3; }
  .eve-topic .btn { grid-column: 2; grid-row: 1 / 3; }
  .dates-list label { grid-template-columns: 1fr; gap: 0.3rem; }
}
