/* =====================================================================
   Microbiología 2026-2 — «Cuaderno clínico»
   Tokens y estilos. Ver DESIGN.md (fuente de verdad de los valores).
   Jerarquía por tipografía y espacio; sin barras de color ni emojis.
   ===================================================================== */

:root {
  /* superficies y tinta */
  --paper: #F7F6F2;
  --surface: #FFFFFF;
  --surface-alt: #F1EFE9;
  --ink: #1E2124;
  --ink-soft: #3A3F44;
  --muted: #5E615F;
  --faint: #6E716D;
  --line: #E4E1D9;
  --line-strong: #D2CEC3;

  /* acción */
  --primary: #0E6B61;
  --primary-hover: #0A544C;
  --primary-tint: #E6F2F0;

  /* dominios */
  --virus: #A8385E;
  --virus-tint: #F8EAF0;
  --bacteria: #2259A0;
  --bacteria-tint: #E8F0FA;
  --fungi: #7D6210;
  --fungi-tint: #F6F0DC;
  --foundations: #5A4CA0;
  --foundations-tint: #EEEBF8;

  /* estados */
  --ok: #25764A;   --ok-tint: #E7F3EC;
  --bad: #B0342C;  --bad-tint: #FBEAE8;
  --warn: #8F5B00; --warn-tint: #FBF1DC;

  /* formas y espacio */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 40px;
  --sp-2xl: 64px;
  --measure: 38em; /* ~80 caracteres con Atkinson Hyperlegible Next */

  /* elevación: nivel 2 y 3, opacidad ≤ 0,06 */
  --shadow-1: 0 1px 2px rgba(30, 33, 36, .045);
  --shadow-2: 0 1px 2px rgba(30, 33, 36, .05), 0 8px 20px rgba(30, 33, 36, .05);
  --shadow-3: 0 2px 6px rgba(30, 33, 36, .05), 0 18px 44px rgba(30, 33, 36, .06), 0 42px 80px rgba(30, 33, 36, .04);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

  /* alias heredados (JS y estilos antiguos siguen apuntando aquí) */
  --card: var(--surface);
  --accent: var(--primary);
  --accent-ink: #fff;
  --soft: var(--primary-tint);
  --shadow: var(--shadow-1);
  --r: var(--r-md);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--serif); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 2.5vw, 2.25rem); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 12px; }
h2 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.01em; margin: 40px 0 14px; }
h3 { font: 700 1.0625rem/1.35 var(--sans); margin: 0 0 8px; letter-spacing: 0; }
h4 { font: 700 .9375rem/1.35 var(--sans); margin: 0 0 6px; }
p { margin: 0 0 12px; text-wrap: pretty; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin: 4px 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
strong, b { font-weight: 700; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--primary-tint); }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 90; background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm); box-shadow: var(--shadow-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small, .muted.small { font-size: 12.5px; }
.first { margin-top: 0; }

/* iconos de línea (icons.js) */
.i { width: 16px; height: 16px; flex: none; vertical-align: -.18em; }

/* =====================================================================
   Estructura: barra lateral clara, contenido papel
   ===================================================================== */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 14px 28px;
  background: var(--surface-alt);
  border-right: 1px solid var(--line);
  color: var(--ink-soft);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--primary);
  font: 600 22px/1 var(--serif);
}
.brand-txt strong { display: block; font: 600 17px/1.2 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.brand-txt span { display: block; font-size: 12px; color: var(--muted); letter-spacing: .01em; }

.search { display: block; padding: 0 4px; }
.search input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: 400 14px var(--sans);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--primary); outline: 2px solid var(--primary-tint); outline-offset: 0; }

.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail-h {
  margin: 14px 10px 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
}
.rail nav a {
  display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 8px 10px;
  border-radius: var(--r-sm); color: var(--ink-soft); font-size: 14.5px; line-height: 1.3;
  text-decoration: none;
}
.rail nav a:hover { background: rgba(255, 255, 255, .8); color: var(--ink); text-decoration: none; }
.rail nav a.on { background: var(--surface); color: var(--primary); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.virus { background: var(--virus); }
.dot.bacteria { background: var(--bacteria); }
.dot.fungi { background: var(--fungi); }
.dot.foundations { background: var(--foundations); }

.topbar { display: none; }
.rail-scrim { display: none; }

main {
  width: 100%; max-width: 1200px; min-width: 0;
  padding: 40px clamp(20px, 3.4vw, 48px) 96px;
  counter-reset: blk;
}

/* =====================================================================
   Piezas comunes
   ===================================================================== */
.eyebrow, .kicker {
  margin: 0 0 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
.kicker { color: var(--c, var(--primary)); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--primary); text-decoration: underline; }

.lede { max-width: var(--measure); margin: 0 0 24px; font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); }
.sec {
  margin: 36px 0 12px; font: 700 12px/1.3 var(--sans);
  letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 20px 22px; box-shadow: var(--shadow-1);
}
.card.flush { padding: 0; overflow: hidden; }
.narrow { max-width: 480px; }
.stack > * + * { margin-top: 14px; }
.toolbar { margin: 0 0 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.spaced { margin-top: 16px; }
.row.align-start { align-items: flex-start; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--primary); border-radius: var(--r-sm);
  background: var(--primary); color: #fff;
  font: 700 15px/1.2 var(--sans); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; text-decoration: none; }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-alt); border-color: var(--muted); color: var(--ink); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active { transform: translateY(1px); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-alt); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 700; line-height: 1.4; white-space: nowrap;
  text-decoration: none; border: 1px solid transparent;
}
a.pill:hover { text-decoration: none; border-color: var(--line-strong); }
.pill.virus { background: var(--virus-tint); color: var(--virus); }
.pill.bacteria { background: var(--bacteria-tint); color: var(--bacteria); }
.pill.fungi { background: var(--fungi-tint); color: var(--fungi); }
.pill.foundations { background: var(--foundations-tint); color: var(--foundations); }
.pill.ok { background: var(--ok-tint); color: var(--ok); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.on { background: var(--primary); color: #fff; }
.pill.right { margin-left: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 13px; text-decoration: none;
}
.chip:hover { border-color: var(--line-strong); text-decoration: none; }
.chip.muted { color: var(--muted); }

.flag {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 12px 0 0; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--warn-tint); color: var(--warn);
  font-size: 13px; font-weight: 700; line-height: 1.45;
}
.flag .i { margin-top: .15em; }

/* tablas */
.tablewrap {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface-alt); font-size: 13px; font-weight: 700; color: var(--ink); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:nth-child(even) td, tbody tr:nth-child(even) th { background: #FBFAF7; }
tbody th[scope=row] { font-weight: 700; background: var(--surface); min-width: 76px; }
.compare th[scope=row] { font-style: italic; white-space: nowrap; }

/* figuras */
figure { margin: 0; }
.fig, .gal, .labfig, .sign-fig {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
}
.fig img, .gal img, .labfig img, .sign-fig img {
  display: block; width: 100%; object-fit: cover; background: var(--surface-alt); cursor: zoom-in;
}
.fig img { height: 220px; }
.fig figcaption, .gal figcaption, .labfig figcaption, .sign-fig figcaption {
  padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--ink-soft);
}
.lic { display: block; margin-top: 4px; font-size: 11.5px; color: var(--faint); }
.lic a { color: var(--faint); text-decoration: underline; }

/* =====================================================================
   Inicio — tablero de estudio (Monitor/Operate)
   ===================================================================== */
.home-head { margin: 0 0 30px; }
.home-head h1 { margin: 0 0 6px; max-width: 40ch; }
.home-head p { margin: 0; color: var(--muted); font-size: 14.5px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; margin: 0 0 8px; align-items: stretch; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; }
.panel.alt { background: var(--surface-alt); border-color: var(--line); }

.exam-title { font: 600 25px/1.22 var(--serif); letter-spacing: -.015em; margin: 0 0 6px; }
.exam-when { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 14px; color: var(--ink-soft); }
.exam-when b { font: 700 14px/1 var(--sans); color: var(--primary); letter-spacing: .01em; }
.exam-scope { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.exam-prog { margin: 0 0 18px; }
.exam-prog .bar { margin: 6px 0 4px; }
.exam-prog small { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.bar { height: 6px; background: var(--line); border-radius: var(--r-pill); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: var(--r-pill); }
.bar.thin { height: 4px; }

.cont-kicker { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.cont-title { font: 600 20px/1.3 var(--serif); letter-spacing: -.01em; margin: 0 0 6px; }
.cont-title a { color: var(--ink); text-decoration: none; }
.cont-title a:hover { color: var(--primary); text-decoration: underline; }
.cont-meta { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.cont-empty { margin: 0 0 16px; font-size: 14px; color: var(--muted); }

.week { border-top: 1px solid var(--line); }
.week-row {
  display: grid; grid-template-columns: 108px 76px minmax(0, 1fr) 160px;
  gap: 16px; align-items: baseline; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.week-date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.week-kind.exam { color: var(--warn); }
.week-title { color: var(--ink); text-decoration: none; font-weight: 600; }
.week-title:hover { color: var(--primary); text-decoration: underline; }
.week-doc { font-size: 13px; color: var(--muted); text-align: right; }
.empty { margin: 0; padding: 14px 0; font-size: 14px; color: var(--muted); }

.mods { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.mod-row {
  display: grid; grid-template-columns: 8px minmax(0, 1.6fr) 92px minmax(96px, .9fr) 46px;
  gap: 16px; align-items: center; padding: 13px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.mod-row:hover { text-decoration: none; }
.mod-row:hover .mod-name { color: var(--primary); }
.mod-name { font-size: 15.5px; font-weight: 700; }
.mod-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.mod-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mod-pct { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.res { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; border-top: 1px solid var(--line); }
.res a {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--line); color: var(--ink-soft);
  font-size: 14.5px; text-decoration: none;
}
.res a:hover { color: var(--primary); text-decoration: none; }
.res .i { color: var(--muted); }

/* =====================================================================
   Encabezado de lectura (sesión, caso, clase, organismo)
   ===================================================================== */
.hero { margin: 0 0 32px; padding: 0 0 22px; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }
.crumbs span { color: var(--line-strong); }
.hero .kicker { margin: 0 0 6px; }
.hero h1 { margin: 0 0 16px; max-width: 34ch; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0 0 14px; font-size: 14px; }
.meta-i { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.meta-i .i { color: var(--muted); }
.meta-row .pill { font-size: 12px; }
.prog { margin: 0; max-width: 80ch; font-size: 13.5px; color: var(--muted); }
.prog strong { color: var(--ink-soft); }

/* =====================================================================
   Lectura: índice lateral + bloques numerados
   ===================================================================== */
.topic-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 44px; align-items: start; }
.topic { min-width: 0; max-width: 760px; }
.topic.wide { max-width: 900px; }

.toc-d { display: contents; }
.toc-d > summary { display: none; }
.toc {
  position: sticky; top: 24px; display: flex; flex-direction: column; gap: 0;
  max-height: calc(100vh - 48px); overflow: auto; padding: 0;
  background: none; border: 0; box-shadow: none; font-size: 13.5px;
}
.toc p {
  margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--faint);
}
.toc a {
  display: -webkit-box; overflow: hidden; padding: 5px 0 5px 12px; border-left: 1px solid transparent;
  color: var(--muted); font-size: 13.5px; line-height: 1.4; text-decoration: none;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.toc a:hover { color: var(--primary); border-left-color: var(--line-strong); }

.lead { margin: 0 0 22px; font: 400 19px/1.55 var(--serif); color: var(--ink-soft); letter-spacing: -.005em; }
.source-line { margin: -6px 0 26px; font-size: 12.5px; color: var(--faint); }
.source-line span { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.focus {
  margin: 0 0 28px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface-alt); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.55; color: var(--ink-soft);
}
.focus strong { color: var(--ink); }
.focus a { color: var(--primary); }

.tblock {
  margin: 0; padding: 34px 0 6px; background: none; border: 0;
  border-top: 1px solid var(--line); border-radius: 0; box-shadow: none;
  scroll-margin-top: 24px;
}
.tblock:first-of-type { border-top: 0; padding-top: 0; }
.tblock > h3 { margin: 0 0 14px; font: 700 17px/1.35 var(--sans); color: var(--ink); counter-increment: blk; }
.tblock > h3::before {
  content: counter(blk, decimal-leading-zero);
  display: inline-block; min-width: 2.3em; margin-right: 4px;
  font: 700 11px/1 var(--sans); letter-spacing: .08em; color: var(--faint);
  vertical-align: .32em;
}
.tblock p { max-width: var(--measure); margin: 0 0 12px; }
.tblock p:last-child { margin-bottom: 0; }
.tblock .tablewrap, .tblock .anim, .tblock .labfig-grid, .tblock .gal-grid { margin-top: 16px; }
.tblock h3 + .muted { margin-top: -4px; }

/* objetivos */
.obj ol { margin: 0; padding-left: 0; list-style: none; counter-reset: obj; max-width: var(--measure); }
.obj li { position: relative; padding-left: 26px; margin: 8px 0; counter-increment: obj; }
.obj li::before {
  content: counter(obj) "."; position: absolute; left: 0; top: 0;
  font: 700 12.5px/1.7 var(--sans); color: var(--primary); font-variant-numeric: tabular-nums;
}

.blist { margin: 0 0 12px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; max-width: var(--measure); }
.blist li { position: relative; padding-left: 20px; margin: 0; }
.blist li::before {
  content: ""; position: absolute; left: 4px; top: .62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary); opacity: .55;
}

.timeline, .protocol { list-style: none; margin: 6px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 0; max-width: var(--measure); }
.timeline li, .protocol li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 16px; margin: 0; }
.timeline li:not(:last-child)::after, .protocol li:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 32px; bottom: 2px; width: 1px; background: var(--line-strong);
}
.timeline .n, .protocol .n {
  width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center;
  font: 700 12.5px var(--sans); background: var(--surface-alt); color: var(--primary);
  border: 0; font-variant-numeric: tabular-nums;
}
.timeline li p, .protocol li p { margin: 3px 0 0; color: var(--ink-soft); }

/* claves y errores */
.keys-box, .err-box { margin: 36px 0; padding: 20px 22px; border-radius: var(--r-md); border: 0; }
.keys-box { background: var(--warn-tint); }
.err-box { background: var(--bad-tint); }
.keys-box > h3, .err-box > h3 {
  margin: 0 0 10px; font: 700 11.5px/1.3 var(--sans);
  letter-spacing: .07em; text-transform: uppercase;
}
.keys-box > h3 { color: var(--warn); }
.err-box > h3 { color: var(--bad); }
.keys-box ul, .err-box ul { margin: 0; padding-left: 18px; }
.keys-box li, .err-box li { margin: 6px 0; font-size: 15px; }
.keys-box li::marker { color: var(--warn); }
.err-box li::marker { color: var(--bad); }

/* CTA de práctica */
.cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  margin: 36px 0; padding: 22px 24px;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: none;
}
.cta h2 { margin: 0 0 4px; font-size: 20px; }
.cta .muted { margin: 0; font-size: 13.5px; }

/* resumen heredado */
details.legacy {
  margin: 36px 0; padding: 0;
  border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  border-radius: 0; background: none;
}
details.legacy > summary {
  display: flex; align-items: center; min-height: 48px; padding: 12px 0;
  cursor: pointer; font: 700 14.5px var(--sans); color: var(--ink);
}
details.legacy > summary:hover { color: var(--primary); }
details.legacy > summary::marker { color: var(--faint); }
.ll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px 32px; padding: 6px 0 22px; }
.ll h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.ll p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* acordeones de comparación y entidades */
details.cmp, details.ent { border-top: 1px solid var(--line); }
details.cmp { margin-top: 16px; }
details.cmp summary, details.ent summary {
  cursor: pointer; min-height: 44px; display: flex; align-items: baseline; gap: 6px;
  padding: 10px 0; font-weight: 700; color: var(--ink);
}
details.cmp summary { color: var(--ink-soft); font-weight: 700; font-size: 14px; }
details.cmp summary:hover, details.ent summary:hover { color: var(--primary); }
details.ent summary { align-items: center; }
details.ent summary span { font-weight: 400; }
.ent dl { margin: 0 0 14px; }
.ent dt { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-top: 10px; }
.ent dd { margin: 2px 0 0; font-size: 14.5px; }

/* =====================================================================
   Módulo
   ===================================================================== */
.mod-head { margin: 0 0 26px; }
.mod-head h1 { margin: 0 0 8px; }
.mod-toc { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 10px; border-bottom: 1px solid var(--line); }
.mod-toc a { display: block; padding: 8px 0; color: var(--muted); font-size: 13.5px; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mod-toc a:hover { color: var(--primary); border-bottom-color: var(--line-strong); }

.mod-sec { scroll-margin-top: 24px; }
.mod-sec > h2 { margin: 40px 0 8px; font-size: 1.35rem; }
.mod-sec > .lede { margin-bottom: 20px; font-size: 15.5px; }

.group { margin: 28px 0; padding: 0; border: 0; background: none; box-shadow: none; }
.group > h3 { margin: 0 0 4px; font: 600 20px/1.3 var(--serif); letter-spacing: -.01em; }
.group > p.muted { max-width: 74ch; margin: 0 0 14px; font-size: 14.5px; }
.small-links { font-size: 13px; margin: 12px 0 0; color: var(--muted); }
.small-links a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--line-strong); }

.session-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin: 8px 0 0; }
.session {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 18px; align-items: center; padding: 14px 4px;
  background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  box-shadow: none; color: inherit; text-decoration: none;
}
.session:hover { background: var(--surface); text-decoration: none; }
.session .pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.snum { font: 600 20px/1.1 var(--serif); color: var(--muted); text-align: left; font-variant-numeric: tabular-nums; }
.snum small { display: block; font: 700 10px/1.6 var(--sans); color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.session .t { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.session .m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.session .m .i { vertical-align: -.2em; }

/* =====================================================================
   Organismos
   ===================================================================== */
.org-title { font-style: italic; letter-spacing: -.015em; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 12px; }
.org-chip {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: none; color: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.org-chip:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); text-decoration: none; }
.org-n { font: italic 600 16.5px/1.3 var(--serif); letter-spacing: -.005em; }
.org-k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.org-h { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.org-chip.has-thumb { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 12px; align-content: center; align-items: center; }
.org-chip.has-thumb .org-thumb { grid-row: 1 / span 3; grid-column: 1; width: 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-alt); display: block; }
.org-chip.has-thumb .org-thumb img { width: 56px; height: 56px; object-fit: cover; display: block; }
.org-chip.has-thumb .org-n, .org-chip.has-thumb .org-k, .org-chip.has-thumb .org-h { grid-column: 2; min-width: 0; }
.org-chip.has-thumb .org-h { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.org-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 0 24px; margin: 0 0 10px; border-top: 1px solid var(--line); }
.org-index a {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--line); color: var(--ink-soft);
  font-size: 14px; text-decoration: none;
}
.org-index a:hover { color: var(--primary); text-decoration: none; }
.org-index a b { font: 700 11px var(--sans); color: var(--faint); letter-spacing: .06em; }

.layer { margin: 28px 0; padding: 0; border: 0; background: none; border-radius: 0; scroll-margin-top: 24px; }
.layer h3 { display: flex; align-items: baseline; gap: 10px; font: 700 17px/1.35 var(--sans); }
.layer h3 b { font: 700 11px/1 var(--sans); color: var(--faint); letter-spacing: .08em; }
.layer p { max-width: var(--measure); margin: 0 0 10px; }
.layer.case { background: none; border-color: var(--line); }
.osec { padding-top: 18px; border-top: 1px solid var(--line); }
.osec:first-of-type { border-top: 0; padding-top: 0; }
.osec h3 b { min-width: 1.6em; }

.case-entry {
  margin: 32px 0; padding: 24px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: none;
}
.case-entry > h2 { margin: 0 0 14px; font-size: 1.35rem; }
.steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; }
.step { padding: 16px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 6px; }
.step .q { margin: 0 0 8px; max-width: var(--measure); }
.ans {
  margin: 10px 0 0; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface-alt); border: 1px solid var(--line);
  font-size: 14.5px; line-height: 1.55;
}
.ans p:last-child { margin-bottom: 0; }
.ans.res { background: var(--ok-tint); border-color: transparent; }

.ents { display: flex; flex-direction: column; }
.sess-orgs { margin: 28px 0; }
.signs-case { margin: 32px 0; }
.program {
  margin: 0 0 24px; padding: 14px 16px;
  background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: 14px; line-height: 1.6; color: var(--ink-soft);
}
.program strong { color: var(--ink); }
.program a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--line-strong); }
.program a:hover { color: var(--primary); }

.org-gallery { margin: 28px 0 8px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.gal img { height: 165px; }
.gal figcaption { display: flex; flex-direction: column; gap: 3px; }
.gal figcaption strong { font-size: 13px; }
.kind {
  display: inline-block; align-self: flex-start; padding: 2px 8px;
  border-radius: var(--r-pill); border: 0; background: var(--surface-alt);
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.kind.micro { background: var(--primary-tint); color: var(--primary); }
.kind.cultivo { background: var(--bacteria-tint); color: var(--bacteria); }
.kind.clinica { background: var(--virus-tint); color: var(--virus); }
.kind.vector { background: var(--fungi-tint); color: var(--fungi); }

/* =====================================================================
   Calendario
   ===================================================================== */
.cal-row {
  display: grid; grid-template-columns: 132px 62px minmax(0, 1fr) 178px;
  gap: 18px; align-items: baseline; padding: 11px 18px;
  border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.cal-row:last-child { border-bottom: 0; }
.cal-row.exam { background: color-mix(in srgb, var(--warn-tint) 60%, #fff); font-weight: 600; }
.cal-row.lab { background: #FAF9F5; }
.cal-row .flag {
  display: block; margin: 3px 0 0; padding: 0; background: none;
  font-weight: 400; font-size: 12.5px; color: var(--warn);
}
.cal-row a { color: inherit; }
.cal-row a:hover { color: var(--primary); }
.cal-row .pill { margin-left: 4px; }
.exams-grid { margin-bottom: 24px; }
.exams-grid .card h3 { font: 600 18px/1.3 var(--serif); }

/* =====================================================================
   Simulacros (operate)
   ===================================================================== */
.setup-form { display: grid; gap: 16px; max-width: 560px; }
.setup-form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.setup-form select, .setup-form input, select, input[type=number], input[type=search], textarea {
  font: 400 15px var(--sans); color: var(--ink);
  padding: 9px 11px; min-height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
}
.setup-form select:focus, .setup-form input:focus { border-color: var(--primary); outline: 2px solid var(--primary-tint); outline-offset: 0; }
.setup-form .btn { justify-self: start; }

.quiz-top {
  position: sticky; top: 0; z-index: 6;
  padding: 12px 0 10px; margin: 0 0 20px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.quiz-top strong { font: 600 17px var(--serif); letter-spacing: -.01em; }
.quiz-top .muted { font-size: 13px; font-variant-numeric: tabular-nums; }
.progress { height: 4px; margin-top: 10px; background: var(--line); border-radius: var(--r-pill); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); transition: width .2s ease; }

.qcard { padding: 26px 28px; }
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 16px; }
.ctx {
  margin: 0 0 16px; padding: 13px 15px;
  background: var(--surface-alt); border: 0; border-radius: var(--r-sm);
  font-size: 14.5px; line-height: 1.55; color: var(--ink-soft);
}
.stem { margin: 0 0 18px; font: 600 20px/1.4 var(--serif); letter-spacing: -.005em; max-width: 36em; }
.qimg { display: block; max-width: 100%; max-height: 340px; margin: 0 0 18px; border-radius: var(--r-sm); border: 1px solid var(--line); }

.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: 52px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; font-size: 15.5px; line-height: 1.5;
  transition: border-color .12s, background .12s;
}
.opt:hover { background: var(--surface-alt); border-color: var(--line-strong); }
.opt input { margin: 3px 0 0; flex: none; width: 18px; height: 18px; accent-color: var(--primary); }
.opt .l { min-width: 16px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
.opt:has(input:checked) .l { color: var(--primary); }
.opt.right, .opts .opt.right { border-color: var(--ok); background: var(--ok-tint); }
.opt.wrong, .opts .opt.wrong { border-color: var(--bad); background: var(--bad-tint); }
.opt .mk { margin-left: auto; flex: none; font-weight: 700; line-height: 1.4; }
.opt .mk.ok { color: var(--ok); }
.opt .mk.bad { color: var(--bad); }
.opt .mk.miss { color: var(--warn); }

.multi-instr {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 14px !important; padding: 4px 11px;
  border-radius: var(--r-pill); background: var(--primary-tint);
  color: var(--primary); font-size: 12.5px; font-weight: 700;
}

.match { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 10px 12px; align-items: center; }
.blank { margin: 10px 0; }
.blank input, textarea { width: 100%; }

.feedback {
  margin: 20px 0 0; padding: 16px 18px;
  border: 0; border-radius: var(--r-md);
  background: var(--surface-alt); font-size: 15px; line-height: 1.55;
}
.feedback.note { background: var(--warn-tint); }
.feedback .pill { margin-right: 6px; }
.feedback p { max-width: var(--measure); }

.navgrid { display: grid; grid-template-columns: repeat(auto-fill, 36px); gap: 6px; margin: 20px 0 0; }
.navgrid button {
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-soft);
  font: 700 12.5px var(--sans); font-variant-numeric: tabular-nums; cursor: pointer;
}
.navgrid button:hover { border-color: var(--line-strong); background: var(--surface-alt); }
.navgrid button.ans { background: var(--primary-tint); border-color: transparent; color: var(--primary); }
.navgrid button.cur { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 1px; }
.navgrid button.right { background: var(--ok-tint); border-color: var(--ok); color: var(--ok); }
.navgrid button.wrong { background: var(--bad-tint); border-color: var(--bad); color: var(--bad); }
.navgrid button.man { background: var(--warn-tint); border-color: var(--warn); color: var(--warn); }
.navgrid button.pend { outline: 2px dashed var(--warn); outline-offset: 1px; }

.score { font: 600 26px/1.1 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.score small { font-size: .5em; color: var(--muted); letter-spacing: 0; }
.result { margin-bottom: 18px; }
.result .score { font-size: 40px; }
.result .row { gap: 24px; }
.pendbox { margin: 10px 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--warn-tint); font-size: 14px; }
.timer { font: 700 14px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.diff del { color: var(--bad); }
.diff ins { color: var(--ok); text-decoration: none; font-weight: 700; }
.hl { background: #FBEFC9; }

.grader { margin-top: 16px; padding: 16px 18px; background: var(--surface-alt); border: 0; border-radius: var(--r-md); }
.grader .gh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.gscore { font: 700 16px var(--sans); color: var(--primary); font-variant-numeric: tabular-nums; }
.gscore.pend { color: var(--warn); }
.crit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.crit .ct { font-size: 14.5px; }
.cg { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.gbtn { min-width: 40px; min-height: 36px; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font: 700 13px var(--sans); color: var(--ink-soft); }
.gbtn:hover { border-color: var(--primary); color: var(--primary); }
.gbtn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.gnum { width: 66px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font: 14px var(--sans); }

/* =====================================================================
   Atlas y diccionario (Explore)
   ===================================================================== */
.atlas-org { margin: 0 0 34px; padding: 0; background: none; border: 0; box-shadow: none; }
.atlas-org h3 { margin: 0 0 12px; font: italic 600 19px/1.3 var(--serif); }
.atlas-org h3 a { color: var(--ink); text-decoration: none; }
.atlas-org h3 a:hover { color: var(--primary); text-decoration: underline; }
.atlas-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.atlas-row .gal img { height: 136px; }
.atlas-row .gal figcaption { padding: 8px 10px; font-size: 12px; }
.atlas-row .gal figcaption strong { font-size: 12.5px; }

.sign-filter {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 22px; padding: 12px 0;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.sign-filter label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.sign-filter input { flex: 1 1 220px; min-width: 0; }
.sign-filter select { flex: 0 0 auto; }

.sign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 10px; }
.sign-card {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); color: inherit; text-decoration: none; box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.sign-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); text-decoration: none; }
.sign-card img, .sign-card .noimg {
  width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover;
  background: var(--surface-alt); display: grid; place-items: center; color: var(--muted);
}
.sign-card .st { display: block; font: 600 15.5px/1.3 var(--serif); }
.sign-card .sd { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.sign-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sign-chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 4px 12px 4px 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--ink-soft); font-size: 13.5px; text-decoration: none;
}
.sign-chip:hover { border-color: var(--line-strong); text-decoration: none; }
.sign-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface-alt); flex: none; }
.sign-chip .noimg { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-alt); display: grid; place-items: center; color: var(--muted); flex: none; }

.sign-link {
  font: inherit; color: var(--primary); background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-style: dotted;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.sign-link:hover { background: var(--primary-tint); border-radius: 3px; text-decoration-style: solid; }

.sign-pop {
  position: fixed; z-index: 90; max-width: 380px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-3); font-size: 14px;
}
.sign-pop img { display: block; width: 100%; max-height: 176px; object-fit: cover; background: var(--surface-alt); }
.sp-body { padding: 12px 16px 16px; }
.sp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font: 600 17px var(--serif); }
.sp-x { border: 0; background: none; color: var(--muted); cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); }
.sp-x:hover { background: var(--surface-alt); color: var(--ink); }
.sp-body p { margin: 8px 0; line-height: 1.5; }
.sp-body .pill { margin-top: 4px; }
.sp-go { margin: 10px 0 0; }
.card-meta { margin: 0 0 8px; }

.sign-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: start; margin: 16px 0 8px; }
.sign-hero.noimg { grid-template-columns: minmax(0, 1fr); }
.sign-fig { margin: 0; box-shadow: none; }
.sign-fig img { max-height: 320px; }
.sign-body h2 { margin: 0 0 4px; font: 700 11.5px/1.3 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.sign-body h2:not(:first-child) { margin-top: 18px; }
.sign-body p { margin: 0; max-width: var(--measure); }
.sign-svgfig { padding: 12px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--r-md); }
.sign-svg svg, .svgthumb svg { display: block; width: 100%; height: auto; color: var(--ink); }
.svgthumb { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-alt); overflow: hidden; }

/* =====================================================================
   Casos de la práctica y material de clase
   ===================================================================== */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 12px; margin: 12px 0; }
.pc-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-left: 1px solid var(--line);
  border-radius: var(--r-md); color: inherit; text-decoration: none; box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.pc-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); text-decoration: none; }
.pc-n { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c, var(--faint)); }
.pc-card > strong { font-size: 15.5px; line-height: 1.35; }
.pc-dx { font-size: 14px; color: var(--ink-soft); }
.pc-org { font: italic 400 12.5px/1.45 var(--serif); color: var(--muted); }

.pc-q { padding: 14px 0; border-top: 1px solid var(--line); }
.pc-q:first-of-type { border-top: 0; padding-top: 4px; }
.pc-q .q { margin: 0 0 8px; }
.pc-tag {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 3px 10px;
  border-radius: var(--r-pill); font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.pc-tag.lab { background: var(--primary-tint); color: var(--primary); }
.pc-tag.ses { background: var(--foundations-tint); color: var(--foundations); }
.pc-lab p, .pc-ses p { margin: 2px 0 10px; }
.pc-layers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 6px 28px; }
.pc-layer { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.pc-layer h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13.5px; }
.pc-layer h4 .i { color: var(--c, var(--primary)); }
.pc-layer p { margin: 0; font-size: 14.5px; }
.pc-nav { justify-content: space-between; margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; }

.lab-case { margin: 0; padding: 20px 0; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.lab-case:first-of-type { border-top: 0; padding-top: 0; }
.lab-case h4 { margin: 0 0 8px; font: 600 17px/1.35 var(--serif); }
.lab-case .case-img { float: right; max-width: 220px; margin: 0 0 10px 18px; }
.lab-case::after { content: ""; display: block; clear: both; }
.case-qs, .case-as { margin: 8px 0; padding-left: 20px; }
.case-qs li, .case-as li { margin: 5px 0; }
.case-as { list-style: none; padding-left: 0; }
.case-as li { padding-left: 18px; position: relative; }
.case-as li::before { content: "—"; position: absolute; left: 0; color: var(--faint); }

.cn-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 26px; padding: 14px 16px;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-left: 1px solid var(--line); border-radius: var(--r-md);
  color: inherit; text-decoration: none;
}
.cn-banner:hover { background: #ECEAE2; border-color: var(--line-strong); text-decoration: none; }
.cn-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--surface); color: var(--primary); border: 1px solid var(--line); }
.cn-banner strong { font-size: 14.5px; }
.cn-banner .muted { font-size: 13px; }
.cn-go { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--primary); white-space: nowrap; }
.cn-quote {
  margin: 16px 0; padding: 2px 0 2px 18px;
  border-left: 2px solid var(--line-strong); background: none; border-radius: 0;
  font: italic 400 16px/1.6 var(--serif); color: var(--ink-soft);
}
.cn-quote span {
  display: block; margin-bottom: 4px; font: 700 10.5px var(--sans);
  letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-style: normal;
}

/* =====================================================================
   Animaciones SVG
   ===================================================================== */
.anim {
  margin: 20px 0 4px; max-width: 580px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: none;
}
.anim-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px 7px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.anim-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.anim-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-soft);
  font: 700 12px var(--sans); cursor: pointer;
}
.anim-toggle:hover { border-color: var(--line-strong); color: var(--primary); }
.anim-svg { padding: 10px 10px 6px; color: var(--ink); }
.anim-svg svg { display: block; width: 100%; height: auto; max-width: 100%; }
.anim figcaption { padding: 10px 14px 14px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--muted); }
.anim figcaption strong { color: var(--ink); }
.anim.paused * { animation-play-state: paused !important; }
.anim-grid { display: grid; gap: 14px; margin: 16px 0 4px; }
.anim-grid .anim { margin: 0; }
.anim-grid.multi { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.anim-grid.multi .anim { max-width: none; }

.labfig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 12px; }
.labfig img { height: 148px; }
.labfig figcaption { padding: 8px 10px; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* visor ampliado */
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow: auto; background: rgba(24, 26, 27, .84);
}
.lightbox figure { margin: 0; max-width: min(1100px, 96vw); overflow: hidden; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
.lightbox img { display: block; max-width: 100%; max-height: 76vh; margin: 0 auto; object-fit: contain; background: #15171A; }
.lightbox figcaption { padding: 10px 16px 14px; font-size: 13.5px; color: var(--ink); }
.lb-close {
  position: absolute; top: 14px; right: 16px; width: 44px; height: 44px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-2);
}

/* avisos flotantes */
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 120; max-width: 360px;
  padding: 12px 16px; background: var(--ink); color: #fff;
  border-radius: var(--r-sm); box-shadow: var(--shadow-3); font-size: 14px;
}

/* =====================================================================
   Tutor IA
   ===================================================================== */
.tutor {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 110;
  width: min(420px, 100%); max-width: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  transform: translateX(102%); visibility: hidden;
  transition: transform .22s ease, visibility .22s ease;
}
.tutor.is-open { transform: none; visibility: visible; }
.tutor.is-collapsed { display: none; }
.tutor-scrim { position: fixed; inset: 0; z-index: 105; background: rgba(24, 26, 27, .32); }

.tutor-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 100;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 9px 14px;
  border: 1px solid var(--primary); border-radius: var(--r-pill);
  background: var(--primary); color: #fff;
  font: 700 13.5px var(--sans);
  box-shadow: 0 6px 18px rgba(14, 107, 97, .26);
  cursor: pointer;
}
.tutor-fab:hover { background: var(--primary-hover); }
.tutor-tab {
  display: none; position: fixed; right: 0; top: 116px; z-index: 60;
  flex-direction: column; align-items: center; gap: 8px;
  padding: 13px 9px; border: 1px solid var(--line); border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  background: var(--surface); color: var(--ink-soft);
  box-shadow: var(--shadow-2); font: 700 12px var(--sans); cursor: pointer;
}
.tutor-tab span { writing-mode: vertical-rl; letter-spacing: .04em; }

.tutor-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.tutor-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tutor-bot { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--primary-tint); color: var(--primary); }
.tutor-brand strong { display: block; font: 600 15px/1.2 var(--serif); }
.tutor-brand span { display: block; font-size: 11.5px; color: var(--muted); }
.tutor-headbtns { display: flex; gap: 4px; flex: none; }
.tutor-icon {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.tutor-icon:hover { border-color: var(--line-strong); color: var(--primary); background: var(--surface-alt); }

.tutor-opts { display: flex; flex-direction: column; gap: 9px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tutor-field { display: flex; align-items: center; gap: 8px; font: 700 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.tutor-field select { flex: 1; min-width: 0; min-height: 34px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 400 13.5px var(--sans); text-transform: none; letter-spacing: 0; }
.tutor-switch, .tutor-chk { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; color: var(--ink-soft); cursor: pointer; }
.tutor-switch input, .tutor-chk input { margin: 2px 0 0; flex: none; width: 16px; height: 16px; accent-color: var(--primary); }
.tutor-switch em { font-style: normal; color: var(--faint); }
.tutor-chk b { font-weight: 400; color: var(--faint); }

.tutor-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tutor-quick button {
  padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-soft);
  font: 700 11.5px var(--sans); cursor: pointer;
}
.tutor-quick button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }

.tutor-banner { margin: 0; padding: 9px 14px; background: var(--warn-tint); border-bottom: 1px solid var(--line); color: var(--warn); font-size: 12.5px; }
.tutor-warn { margin: 0; padding: 9px 14px; background: var(--bad-tint); border-bottom: 1px solid var(--line); color: var(--bad); font-size: 12.5px; font-weight: 700; }

.tutor-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--paper); }
.tutor-empty { margin: auto 4px; color: var(--muted); font-size: 14px; }
.tutor-empty-h { margin: 0 0 6px; font: 600 16px var(--serif); color: var(--ink); }
.tutor-empty p { margin: 0 0 8px; }

.tutor-msg { max-width: 100%; font-size: 14.2px; line-height: 1.55; }
.tutor-msg.user { align-self: flex-end; max-width: 92%; padding: 10px 14px; background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; }
.tutor-msg.user .tutor-md p { margin: 0; }
.tutor-msg.user a { color: #fff; text-decoration: underline; }
.tutor-msg.bot { align-self: stretch; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; }
.tutor-md { overflow-wrap: anywhere; }
.tutor-md > *:first-child { margin-top: 0; }
.tutor-md > *:last-child { margin-bottom: 0; }
.tutor-md p { margin: 0 0 9px; }
.tutor-md h3, .tutor-md h4, .tutor-md h5, .tutor-md h6 { margin: 14px 0 6px; font-family: var(--sans); font-weight: 700; line-height: 1.3; }
.tutor-md h3 { font-size: 16px; }
.tutor-md h4 { font-size: 15px; }
.tutor-md h5 { font-size: 14.5px; }
.tutor-md h6 { font-size: 14px; }
.tutor-md ul, .tutor-md ol { margin: 0 0 9px; padding-left: 20px; }
.tutor-md li { margin: 3px 0; }
.tutor-md code { padding: 1px 5px; border-radius: 4px; background: var(--surface-alt); font: 13px ui-monospace, Consolas, monospace; }
.tutor-code { margin: 0 0 9px; padding: 10px 12px; overflow: auto; border-radius: var(--r-sm); background: var(--ink); color: #EDEBE6; font-size: 12.5px; }
.tutor-code code { background: none; padding: 0; color: inherit; }
.tutor-md blockquote { margin: 0 0 9px; padding: 2px 0 2px 11px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.tutor-table { display: block; width: 100%; overflow-x: auto; margin: 0 0 10px; border-collapse: collapse; font-size: 12.8px; }
.tutor-table th, .tutor-table td { padding: 5px 7px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.tutor-table th { background: var(--surface-alt); font-weight: 700; }
.tutor-cite { padding: 0 1px; font-size: 11.5px; font-weight: 700; color: var(--primary); text-decoration: none; vertical-align: super; }
a.tutor-cite:hover { text-decoration: underline; }
.tutor-typing { margin: 6px 0 0 !important; font-size: 12.5px; color: var(--muted); }
.tutor-error { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bad-tint); color: var(--bad); font-size: 12.8px; }

.tutor-sources { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.tutor-src-h { margin: 0 0 6px; font: 700 10.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.tutor-sources ol { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
.tutor-src a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-alt); color: var(--ink); text-decoration: none; }
.tutor-src a:hover { border-color: var(--line-strong); text-decoration: none; }
.tutor-badge { grid-row: span 2; align-self: start; padding: 2px 6px; border-radius: 4px; background: var(--surface); color: var(--primary); font: 700 10px var(--sans); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tutor-src-title { display: -webkit-box; overflow: hidden; font-size: 12.6px; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tutor-src-dom { font-size: 11px; color: var(--muted); }

.tutor-composer { padding: 10px 14px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.tutor-composer textarea { width: 100%; min-height: 54px; max-height: 150px; padding: 10px 12px; resize: vertical; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 400 14px/1.45 var(--sans); }
.tutor-composer textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-tint); outline-offset: 0; }
.tutor-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 8px; }
.tutor-btn { min-height: 38px; padding: 0 15px; border: 1px solid var(--primary); border-radius: var(--r-sm); background: var(--primary); color: #fff; font: 700 14px var(--sans); cursor: pointer; }
.tutor-btn:hover { background: var(--primary-hover); }
.tutor-btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.tutor-btn.ghost:hover { background: var(--surface-alt); }
.tutor-btn:disabled { opacity: .5; cursor: not-allowed; }
.tutor-note { margin: 8px 0 0; font-size: 11px; line-height: 1.4; color: var(--faint); }

@media (min-width: 1500px) {
  .shell { grid-template-columns: 264px minmax(0, 1fr) clamp(340px, 25vw, 430px); }
  .shell.tutor-closed { grid-template-columns: 264px minmax(0, 1fr); }
  .tutor {
    position: sticky; top: 0; right: auto; bottom: auto;
    grid-column: 3; grid-row: 1; width: auto; max-width: none; height: 100vh; z-index: 20;
    transform: none; visibility: visible; border-left: 1px solid var(--line);
    box-shadow: none; background: var(--surface-alt);
  }
  .tutor .tutor-body { background: var(--surface-alt); }
  .tutor.is-collapsed { display: none; }
  .tutor-scrim { display: none; }
  .tutor-fab { display: none; }
  .tutor-tab { display: flex; }
  main { padding-right: clamp(20px, 2.2vw, 32px); }
}

/* =====================================================================
   Ajustes de las vistas (clases de apoyo)
   ===================================================================== */
.cal-head {
  display: grid; grid-template-columns: 132px 62px minmax(0, 1fr) 178px;
  gap: 18px; padding: 10px 18px;
  background: var(--surface-alt); border-bottom: 1px solid var(--line);
  font: 700 11px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
.session.plain { grid-template-columns: minmax(0, 1fr); }
.session.plain .t { font-size: 15px; }
.note-card { margin: 0 0 18px; }
.form-note { margin: 14px 0 0; font-size: 13px; }
.stack-item { margin-top: 14px; }
.mt { margin-top: 10px; }
.h-serif { font: 600 18px/1.3 var(--serif); letter-spacing: -.01em; }

.btn.saved { border-color: var(--primary); color: var(--primary); }
.btn.saved .i { fill: currentColor; }
.btn .i { width: 15px; height: 15px; }

.bar { display: block; }
.timer { display: inline-flex; align-items: center; gap: 5px; }
.match .pill { grid-column: 1 / -1; justify-self: end; }

.fb-lead { margin: 0 0 8px; }
.fb-p { margin: 0 0 6px; }
.fb-p.last { margin: 0; }
.fb-extra { margin-top: 10px; }
.result-row { align-items: flex-start; }
.pend-actions { margin-top: 8px; gap: 6px; }
.gnote { margin: 4px 0 10px; font-size: 14px; }
.gactions { margin-top: 10px; }
.model { margin: 14px 0 0; }

.keys-box > h3, .err-box > h3 { display: flex; align-items: center; gap: 7px; }
.keys-box > h3 .i, .err-box > h3 .i { width: 14px; height: 14px; }
.cn-go .i { width: 14px; height: 14px; }
.pc-tag .i { width: 13px; height: 13px; }

.exam-later { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.cont-foot { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.cont-foot a { text-decoration: underline; text-decoration-color: var(--line-strong); }

/* tarjetas de rejilla: el CTA siempre al pie */
.g2 > .card, .g3 > .card, .exams-grid > .card { display: flex; flex-direction: column; }
.g2 > .card > .row:last-child, .g3 > .card > .row:last-child,
.exams-grid > .card > .row:last-child, .exams-grid > .card > .btn:last-child { margin-top: auto; padding-top: 8px; align-self: flex-start; }
.exams-grid .card h3 { text-wrap: balance; }
.panel.alt { display: flex; flex-direction: column; }
.panel.alt .cont-foot { margin-top: auto; }
.panel.alt > .btn { align-self: flex-start; }
.flag { font-weight: 400; }
.flag strong { font-weight: 700; }

/* lecturas del organismo: columna de cuaderno */
.org-wrap { max-width: 980px; }
.org-wrap .gal-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.org-wrap .gal img { height: 180px; }
.meta-i a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.meta-i a:hover { color: var(--primary); }

/* cifras de progreso y bancos */
.stats { display: flex; flex-wrap: wrap; gap: 18px 56px; margin: 0 0 26px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-n { font: 600 26px/1.1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-l { font-size: 13px; color: var(--muted); }
.stat .btn { margin-top: 8px; align-self: flex-start; }
.stat.warn .stat-n { color: var(--warn); }
.stat.bad .stat-n { color: var(--bad); }

/* simulacros: columna de trabajo, no página completa */
.quiz-top, .qcard, .result, .navgrid, #main > .row.between.spaced { max-width: 820px; }
.toc { scrollbar-width: thin; }
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); }

/* =====================================================================
   Móvil
   ===================================================================== */
@media (max-width: 999px) {
  .topic-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .topic, .topic.wide { max-width: none; }
  .toc-d {
    display: block; order: -1; margin: 0 0 26px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  }
  .toc-d > summary {
    display: flex; align-items: center; gap: 10px;
    min-height: 48px; padding: 10px 16px; cursor: pointer;
    font: 700 13.5px var(--sans); color: var(--ink); list-style: none;
  }
  .toc-d > summary::-webkit-details-marker { display: none; }
  .toc-d > summary::after {
    content: ""; width: 7px; height: 7px; margin-left: auto;
    border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
    transform: rotate(45deg) translateY(-2px); transition: transform .15s;
  }
  .toc-d[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
  .toc-d[open] > summary { border-bottom: 1px solid var(--line); }
  .toc-d > summary .n { font-weight: 400; color: var(--muted); }
  .toc { position: static; max-height: none; padding: 6px 16px 10px; }
  .toc p { display: none; }
  .toc a { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
  .toc a:last-child { border-bottom: 0; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: min(84vw, 300px); transform: translateX(-102%);
    transition: transform .2s ease; box-shadow: var(--shadow-3);
    padding-top: 18px;
  }
  .rail.open { transform: none; }
  .rail-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(24, 26, 27, .32); }
  .rail-scrim[hidden] { display: none !important; }
  .topbar {
    display: flex; align-items: center; gap: 4px;
    position: sticky; top: 0; z-index: 30; height: 56px;
    padding: 0 6px 0 2px; background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .icon-btn {
    width: 44px; height: 44px; display: grid; place-items: center;
    border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); cursor: pointer;
  }
  .icon-btn:hover { background: var(--surface-alt); }
  .topbar-title {
    flex: 1; min-width: 0; padding-right: 10px;
    font: 700 15px var(--sans); color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  main { padding: 20px 16px 104px; }
  h1 { font-size: 1.65rem; }
  h2 { margin-top: 32px; font-size: 1.3rem; }

  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .week-row { grid-template-columns: 88px minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; }
  .week-date { grid-row: 1; }
  .week-kind { grid-row: 1; }
  .week-title { grid-column: 1 / -1; }
  .week-doc { grid-column: 1 / -1; text-align: left; }
  .mod-row { grid-template-columns: 8px minmax(0, 1fr) 46px; gap: 4px 12px; padding: 14px 0; }
  .mod-row .bar { grid-column: 2 / -1; grid-row: 2; }
  .mod-count { grid-column: 2; grid-row: 3; }
  .mod-pct { grid-column: 3; grid-row: 3; }
  .res { grid-template-columns: minmax(0, 1fr); }

  .hero h1 { max-width: none; }
  .meta-row {
    flex-wrap: nowrap; overflow-x: auto; gap: 8px;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  }
  .meta-row > * { flex: none; }
  .meta-row::-webkit-scrollbar { display: none; }
  .tblock { padding-top: 28px; }
  .lead { font-size: 17.5px; }
  .qcard { padding: 20px 18px; }
  .match { grid-template-columns: minmax(0, 1fr); }
  .row.between.spaced { flex-direction: column; align-items: stretch; }
  .row.between.spaced > .row { justify-content: space-between; }
  .row.between.spaced > .row .btn { flex: 1 1 auto; }
  .cal-row { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 14px; }
  .cal-head { display: none; }
  .cal-row > div:nth-child(2) { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
  .session { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; }
  .session .pills { grid-column: 1 / -1; justify-content: flex-start; }
  .sign-filter { top: 56px; }
  .sign-hero { grid-template-columns: minmax(0, 1fr); }
  .sign-grid { grid-template-columns: minmax(0, 1fr); }
  .pc-nav .btn { flex: 1 1 auto; }
}

@media (max-width: 640px) {
  .opt { min-height: 56px; }
  .tutor-fab { padding: 0; width: 46px; height: 46px; justify-content: center; }
  .tutor-fab span { display: none; }
  .navgrid { grid-template-columns: repeat(auto-fill, 44px); }
  .navgrid button { width: 44px; height: 44px; }
  .crit { grid-template-columns: minmax(0, 1fr); }
  .cg { justify-content: flex-start; }
  .gal-grid, .labfig-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .gal img { height: 140px; }
  .lab-case .case-img { float: none; max-width: 100%; margin: 0 0 12px; }
  .sign-pop { left: 8px !important; right: 8px !important; top: auto !important; bottom: 8px !important; width: auto !important; max-width: none; max-height: 72vh; overflow: auto; }
  .quiz-top .row { gap: 4px 10px; }
  .btn { padding: 10px 14px; }
}

@media (max-width: 420px) {
  .gal-grid, .labfig-grid, .atlas-row { grid-template-columns: minmax(0, 1fr); }
  .sign-card { grid-template-columns: 56px minmax(0, 1fr); }
  .sign-card img, .sign-card .noimg { width: 56px; height: 56px; }
  .org-chip.has-thumb { grid-template-columns: 48px minmax(0, 1fr); }
  .org-chip.has-thumb .org-thumb, .org-chip.has-thumb .org-thumb img { width: 48px; height: 48px; }
  .tutor-quick button { font-size: 11px; padding: 6px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .rail, .topbar, .tutor, .tutor-fab, .tutor-tab, .tutor-scrim, .quiz-top .row { display: none !important; }
  .shell { display: block; }
  main { padding: 0; }
  .tblock { break-inside: avoid; }
}

/* ---------- simulacro práctico de respuesta abierta ---------- */
.pr-sec { margin: 18px 0; }
.pr-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.pr-imgs .fig img { height: 200px; object-fit: contain; background: var(--surface); }
.pr-q { margin: 14px 0; }
.pr-q label { display: block; margin-bottom: 6px; }
.pr-q textarea { width: 100%; min-height: 52px; resize: vertical; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 400 15px/1.45 var(--sans); }
.pr-fb { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-sm); border-left: 4px solid var(--line-strong); background: var(--surface); font-size: 14px; }
.pr-fb.ok { border-left-color: var(--ok); background: var(--ok-tint); }
.pr-fb.warn { border-left-color: var(--warn); background: var(--warn-tint); }
.pr-fb.bad { border-left-color: var(--bad); background: var(--bad-tint); }
.pr-fb p { margin: 4px 0; }
.pr-notes { margin: 4px 0 6px 18px; }
.pr-chk { display: inline-block; font-size: 12.5px; margin: 2px 6px 2px 0; }
.pr-chk.ok { color: var(--ok); } .pr-chk.part { color: var(--warn); } .pr-chk.no { color: var(--bad); }
.pr-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; margin: 12px 0; background: var(--paper, var(--surface)); border: 1px solid var(--line); border-radius: var(--r-sm); }
