/* PROADEX · Atlas editorial. Un sistema tipográfico y una sola tinta de acento. */
:root {
  color-scheme: light;
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f7f8;
  --surface-hover: #f0f2f8;
  --ink: #242427;
  --ink-strong: #141416;
  --muted: #66666e;
  --line: #dedee2;
  --line-strong: #b4b4bc;
  --brand: #002fa7;
  --brand-solid: #002fa7;
  --brand-soft: #edf1fb;
  --on-brand: #ffffff;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --page-gutter: clamp(24px, 4.2vw, 80px);
  --header-offset: 148px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111113;
  --surface: #111113;
  --surface-soft: #1b1b1f;
  --surface-hover: #20232d;
  --ink: #dedee2;
  --ink-strong: #fafafa;
  --muted: #a9a9b2;
  --line: #34343b;
  --line-strong: #60606b;
  --brand: #a4baff;
  --brand-soft: #1d2846;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--brand); color: var(--canvas); }
button, input, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button { border-radius: 0; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--brand); text-underline-offset: .22em; }
svg { display: block; }
button svg, .search-box svg { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; stroke-width: 1.5; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
h1, h2, h3, h4 { color: var(--ink-strong); line-height: 1.12; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.045em; font-weight: 500; }
h3 { font-size: 1.2rem; letter-spacing: -.025em; }
h4 { font-size: .85rem; }
ul { margin: 0; padding-left: 1.2rem; }
li + li { margin-top: 7px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 5px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 12px 18px;
  background: var(--brand);
  color: var(--canvas);
}
.skip-link:focus { transform: none; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Cabecera e índice: la navegación conserva el ancho completo del atlas. */
.app-shell { max-width: 1920px; min-height: 100vh; margin-inline: auto; }
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  padding-inline: var(--page-gutter);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.masthead {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--ink-strong); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; color: var(--brand); }
.brand strong { font-size: 1.9rem; font-weight: 750; line-height: 1; letter-spacing: -.065em; }
.brand-period { color: var(--brand); }
.brand-description { padding-left: 28px; border-left: 1px solid var(--line); font-size: .76rem; line-height: 1.55; }
.brand-description span { color: var(--muted); }
.header-tools { display: flex; align-items: center; gap: 20px; min-width: 0; margin-left: auto; }
.search-panel { position: relative; width: 300px; max-width: 100%; }
.search-box {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  transition: border-color 180ms ease;
}
.search-box:focus-within { border-color: var(--brand); outline: 1px solid var(--brand); }
.search-box svg { width: 17px; height: 17px; }
.search-box input { width: 100%; min-width: 0; padding: 10px 0; border: 0; outline: none; background: transparent; font-size: .78rem; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box kbd { padding: 0 5px; border: 1px solid var(--line); font: .75rem var(--font); }
.search-status { position: absolute; top: 100%; right: 0; z-index: 2; width: max-content; max-width: min(360px, 88vw); padding: 8px 12px; background: var(--ink-strong); color: var(--canvas); font-size: .72rem; }
.search-status:empty { display: none; }
.search-panel:not(:focus-within) .search-status { display: none; }
.theme-btn { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 8px 0 8px 12px; border: 0; background: transparent; font-size: .75rem; }
.theme-btn:hover { color: var(--brand); }
#theme-symbol { transition: transform 250ms ease; }
[data-theme="dark"] #theme-symbol { transform: rotate(180deg); }
.nav-list { position: relative; display: flex; gap: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav-btn { position: relative; display: inline-flex; min-height: 55px; flex: 1 0 auto; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 20px; border: 0; background: transparent; color: var(--muted); font-size: .8rem; white-space: nowrap; transition: color 160ms ease; }
.nav-btn:first-child { padding-left: 0; }
.nav-btn:last-child { padding-right: 0; }
.nav-btn::after { position: absolute; right: 20px; bottom: 0; left: 20px; height: 3px; background: var(--brand); content: ""; transform: scaleX(0); transform-origin: left; transition: transform 200ms ease; }
.nav-btn:first-child::after { left: 0; }
.nav-btn:last-child::after { right: 0; }
.nav-btn.active, .nav-btn:hover { color: var(--ink-strong); }
.nav-btn.active { font-weight: 700; }
.nav-btn.active::after { transform: scaleX(1); }
.nav-btn:focus-visible { outline-offset: -5px; }
.nav-index { align-self: center; color: var(--muted); font-size: .63rem; font-variant-numeric: tabular-nums; }
.nav-btn.active .nav-index { color: var(--brand); }

/* La portada usa el vacío como motivo; el gráfico es decorativo, no un dato clínico. */
.main { min-width: 0; padding: 0 var(--page-gutter); }
.instrument-header { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: clamp(40px, 7vw, 110px); padding: 48px 0 42px; }
.eyebrow { display: block; margin-bottom: 16px; color: var(--brand); font-size: .65rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin-bottom: 24px; font-size: clamp(4.6rem, 7.2vw, 7.8rem); font-weight: 500; line-height: .94; letter-spacing: -.07em; }
h1 > span { color: var(--brand); }
.lead { max-width: 450px; color: var(--muted); font-size: .98rem; line-height: 1.65; }
.lead strong { color: var(--ink-strong); font-weight: 500; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 25px; }
.primary-action, .text-action, .quiet-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 24px; padding: 0; border: 0; background: transparent; color: var(--ink-strong); font-size: .81rem; font-weight: 600; text-align: left; }
.primary-action { min-height: 48px; padding: 12px 20px; background: var(--brand-solid); color: var(--on-brand); }
.primary-action:hover { background: var(--ink-strong); color: var(--canvas); }
.text-action svg, .quiet-action svg { width: 17px; height: 17px; transition: transform 180ms ease; }
.text-action:hover, .quiet-action:hover { color: var(--brand); }
.text-action:hover svg, .quiet-action:hover svg { transform: translate(2px, -2px); }
.hero-art { position: relative; overflow: hidden; width: 100%; max-width: 480px; justify-self: end; background: var(--brand-solid); color: #fff; }
.coverage-art { width: 100%; height: auto; }
.art-caption { display: flex; justify-content: space-between; gap: 12px; padding: 0 24px 19px; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }
.specimen-field { transform-origin: 240px 210px; animation: specimen-in 750ms cubic-bezier(.2,.7,.3,1) both; }
.specimen-focus { animation: focus-in 800ms ease both; }
@keyframes specimen-in { from { opacity: 0; transform: scale(.9) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes focus-in { from { opacity: 0; } to { opacity: 1; } }
.atlas-overview { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 48px; padding: 24px 0; border-block: 1px solid var(--line); }
.atlas-index { display: grid; grid-template-columns: repeat(3, 1fr); }
.atlas-index div { display: flex; align-items: baseline; gap: 12px; padding-inline: 24px; border-right: 1px solid var(--line); }
.atlas-index div:first-child { padding-left: 0; }
.atlas-index div:last-child { border-right: 0; }
.atlas-index dt { color: var(--ink-strong); font-size: 2.65rem; font-weight: 400; line-height: 1; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.atlas-index dd { color: var(--muted); font-size: .77rem; }
.clinical-boundary { display: grid; grid-template-columns: 1fr; gap: 2px; padding-left: 24px; border-left: 2px solid var(--brand); }
.clinical-boundary strong { font-size: .8rem; font-weight: 600; }
.clinical-boundary p { max-width: 390px; color: var(--muted); font-size: .72rem; }

/* El escáner representa las celdas de la matriz canónica sin recalcular la cobertura. */
.spectrum-scanner { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; margin-bottom: 64px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.scanner-head .eyebrow { margin-bottom: 10px; }
.scanner-head h2 { max-width: 230px; margin-bottom: 18px; font-size: 1.5rem; line-height: 1.12; }
.scanner-picker { display: grid; gap: 6px; }
.scanner-picker > span { color: var(--muted); font-size: .7rem; }
.scanner-picker select { width: 100%; min-height: 44px; padding: 8px 28px 8px 10px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--surface); font-size: .8rem; }
.scanner-workspace { min-width: 0; align-self: center; }
.scanner-strip { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); border-block: 1px solid var(--line); border-left: 1px solid var(--line); }
.scanner-cell { position: relative; display: flex; min-width: 0; min-height: 91px; flex-direction: column; justify-content: space-between; gap: 10px; padding: 12px 10px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.scanner-cell.is-yes { background: var(--brand-solid); color: var(--on-brand); }
.scanner-cell.is-maybe { background: var(--brand-soft); color: var(--brand); }
.scanner-cell.is-no { color: var(--muted); }
.scanner-target { font-size: .62rem; line-height: 1.25; overflow-wrap: anywhere; }
.scanner-cell .cov { width: auto; height: auto; align-self: flex-start; background: none; color: inherit; font-size: 1.6rem; font-weight: 400; }
.scanner-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-top: 14px; }
.scanner-foot p { max-width: 640px; color: var(--muted); font-size: .75rem; }
.scanner-foot p strong { color: var(--ink-strong); font-weight: 600; }
.scanner-foot .quiet-action { min-height: 32px; flex: 0 0 auto; gap: 8px; color: var(--brand); font-size: .73rem; }

/* Catálogo: líneas compartidas, jerarquía estable y fichas pulsables completas. */
.section { display: none; scroll-margin-top: calc(var(--header-offset) + 28px); animation: section-in 220ms ease both; }
.section.active { display: block; }
@keyframes section-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.section-head .eyebrow { margin-bottom: 12px; }
.section-head p { max-width: 640px; margin-top: 13px; color: var(--muted); font-size: .87rem; line-height: 1.6; }
.toolbar { flex: 0 0 auto; }
.segmented { display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.segmented button { position: relative; min-height: 44px; flex: 0 0 auto; padding: 8px 13px; border: 0; background: transparent; color: var(--muted); font-size: .76rem; }
.segmented button.active { background: var(--ink-strong); color: var(--canvas); }
.segmented button:not(.active):hover { background: var(--surface-soft); color: var(--brand); }
.map-row { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; margin-bottom: 28px; padding: 18px 22px; background: var(--surface-soft); }
.morph-lane { min-width: 0; }
.morph-lane + .morph-lane { padding-left: 28px; border-left: 1px solid var(--line); }
.morph-lane h3 { margin-bottom: 10px; font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.lane-items { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 0; }
.lane-chip { min-height: 30px; padding: 5px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); font-size: .71rem; text-align: left; }
.lane-chip:hover { border-bottom-color: var(--brand); color: var(--brand); }
.grid { display: grid; gap: 0; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line); }
.organism-grid, .antibiotic-grid, .mechanism-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pokedex-card { position: relative; display: flex; min-width: 0; flex-direction: column; padding: 25px 26px 18px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; transition: background 180ms ease; }
.pokedex-card::before { position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: var(--brand); content: ""; transform: scaleY(0); transform-origin: top; transition: transform 200ms ease; }
.pokedex-card:hover, .pokedex-card:focus-visible { z-index: 1; background: var(--surface-hover); }
.pokedex-card:hover::before, .pokedex-card:focus-visible::before { transform: scaleY(1); }
.pokedex-card:focus-visible { outline-offset: -3px; }
.pokedex-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-metadata { display: grid; gap: 9px; }
.dex-id { color: var(--muted); font-size: .67rem; letter-spacing: .045em; font-variant-numeric: tabular-nums; }
.type-badge { color: var(--muted); font-size: .71rem; }
.pokedex-card h3 { margin: 22px 0 9px; font-size: 1.7rem; font-weight: 500; letter-spacing: -.04em; overflow-wrap: anywhere; }
.card-subtitle { min-height: 43px; margin-bottom: 22px; color: var(--muted); font-size: .79rem; line-height: 1.55; }
.clinical-glyph { --glyph-color: var(--brand); position: relative; display: block; width: 55px; height: 55px; flex: 0 0 auto; color: var(--glyph-color); }
.glyph-organism span { position: absolute; width: 11px; height: 11px; border: 1.5px solid currentColor; border-radius: 50%; }
.glyph-organism span:nth-child(1) { top: 8px; left: 12px; }
.glyph-organism span:nth-child(2) { top: 20px; left: 27px; }
.glyph-organism span:nth-child(3) { top: 34px; left: 14px; }
.glyph-organism.shape-rods span { width: 23px; height: 9px; border-radius: 99px; transform: rotate(-35deg); }
.glyph-organism.shape-rods span:nth-child(1) { top: 9px; left: 9px; }
.glyph-organism.shape-rods span:nth-child(2) { top: 24px; left: 23px; }
.glyph-organism.shape-rods span:nth-child(3) { top: 37px; left: 8px; }
.glyph-organism.shape-mixed span:nth-child(1) { top: 5px; left: 7px; width: 22px; height: 22px; border-style: dashed; }
.glyph-antibiotic span:nth-child(1), .glyph-antibiotic span:nth-child(2) { position: absolute; top: 19px; width: 20px; height: 16px; border: 1.5px solid currentColor; transform: rotate(-35deg); }
.glyph-antibiotic span:nth-child(1) { left: 8px; border-right: 0; border-radius: 99px 0 0 99px; background: currentColor; }
.glyph-antibiotic span:nth-child(2) { left: 24px; top: 8px; border-left: 0; border-radius: 0 99px 99px 0; }
.glyph-mechanism::before, .glyph-mechanism::after { position: absolute; top: 7px; width: 1.5px; height: 40px; background: currentColor; content: ""; }
.glyph-mechanism::before { left: 20px; transform: rotate(25deg); }
.glyph-mechanism::after { right: 20px; transform: rotate(-25deg); }
.glyph-mechanism span { position: absolute; left: 16px; width: 22px; height: 1.5px; background: currentColor; }
.glyph-mechanism span:nth-child(1) { top: 14px; }
.glyph-mechanism span:nth-child(2) { top: 26px; }
.glyph-mechanism span:nth-child(3) { top: 38px; }
.mini-list { display: grid; margin-top: auto; border-top: 1px solid var(--line); }
.mini-row { display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .79rem; line-height: 1.55; }
.mini-row b { color: var(--ink-strong); font-size: .69rem; font-weight: 600; }
.mini-row:nth-child(2) b { color: var(--brand); }
.mini-row span { color: var(--muted); overflow-wrap: anywhere; }
.card-link { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 16px; color: var(--ink-strong); font-size: .71rem; }
.card-link svg { width: 18px; height: 18px; color: var(--brand); transition: transform 200ms ease; }
.pokedex-card:hover .card-link svg { transform: translate(2px, -2px); }
@supports (grid-template-rows: subgrid) {
  .pokedex-card { display: grid; grid-row: span 7; grid-template-rows: subgrid; }
  .mini-list { display: contents; }
  .mini-row:first-child { border-top: 1px solid var(--line); }
}
.empty { padding: 48px 24px; border-block: 1px solid var(--line); color: var(--muted); }

/* Clasificación: la columna de pruebas conserva el contexto de cada grupo. */
.search-classification-link { display: block; min-height: 32px; margin-top: 4px; padding: 0; border: 0; background: transparent; color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.search-classification-link:focus-visible { outline-color: currentColor; outline-offset: 2px; }
.classification-tools { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; padding: 24px; background: var(--surface-soft); }
.classification-tools input { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--surface); font-size: .85rem; }
.classification-status { margin-block: 14px; color: var(--muted); font-size: .76rem; }
.classification-boundary { max-width: 85ch; margin-bottom: 30px; padding-left: 16px; border-left: 2px solid var(--brand); color: var(--muted); font-size: .85rem; }
.classification-boundary strong { color: var(--ink-strong); }
.classification-group { margin-bottom: 36px; border: 1px solid var(--line); }
.classification-group > h3 { padding: 18px 24px; background: var(--brand-solid); color: var(--on-brand); font-size: 1.3rem; font-weight: 500; }
.classification-row { display: grid; grid-template-columns: minmax(200px, .38fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.classification-criteria { padding: 22px 24px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.classification-criteria p { margin-bottom: 8px; color: var(--muted); font-size: .75rem; }
.classification-criteria h4 { font-size: .9rem; font-weight: 600; line-height: 1.5; }
.classification-content { min-width: 0; padding: 20px 24px; }
.classification-taxa { display: flex; flex-wrap: wrap; gap: 6px 0; padding: 0; list-style: none; font-size: .96rem; line-height: 1.7; }
.classification-taxa li { margin: 0; overflow-wrap: anywhere; }
.classification-taxa li:not(:last-child)::after { content: ";"; padding-right: .5em; color: var(--muted); }
.classification-note { max-width: 85ch; margin-top: 12px; color: var(--muted); font-size: .8rem; }
.classification-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; margin-top: 12px; }
.classification-links > span { color: var(--muted); font-size: .7rem; }
.classification-links .lane-chip { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
.classification-group > .source-details { padding-inline: 18px; border: 0; }
.classification-group > .source-details summary { padding-block: 16px; font-size: .8rem; }
.classification-notes { margin-top: 40px; }
.classification-notes .source-list { margin-top: 16px; }

/* Las alertas mantienen su texto completo y la misma jerarquía en ambos temas. */
.warning-stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 32px; background: var(--surface-soft); }
.warning-card { display: flex; min-width: 0; gap: 15px; padding: 24px 18px; border-left: 1px solid var(--line); }
.warning-card:first-child { border-left: 0; }
.big-letter { color: var(--brand); font-size: 2rem; font-weight: 400; line-height: 1; letter-spacing: -.05em; }
.warning-card strong { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 600; }
.warning-card p { color: var(--muted); font-size: .74rem; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 20px; }
.pill { display: inline-flex; width: fit-content; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); color: var(--muted); font-size: .7rem; line-height: 1.25; }
.legend .pill { padding: 0; border: 0; }
.cov { display: inline-grid; width: 29px; height: 29px; place-items: center; font-weight: 600; font-size: 1.1rem; line-height: 1; }
.cov.yes { background: var(--brand-solid); color: var(--on-brand); }
.cov.maybe { background: var(--brand-soft); color: var(--brand); }
.cov.no { background: var(--surface-soft); color: var(--muted); }
.matrix-wrap { max-height: min(70vh, 780px); overflow: auto; border: 1px solid var(--line-strong); overscroll-behavior: contain; }
.coverage-matrix { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.coverage-matrix th, .coverage-matrix td { height: 50px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); text-align: center; }
.coverage-matrix thead th { position: sticky; top: 0; z-index: 4; height: 60px; background: var(--surface-soft); color: var(--muted); font-size: .7rem; font-weight: 500; vertical-align: bottom; }
.coverage-matrix abbr { text-decoration: none; }
.coverage-matrix th:first-child { position: sticky; z-index: 3; left: 0; width: 220px; min-width: 220px; padding-left: 16px; background: var(--surface); border-right-color: var(--line-strong); text-align: left; }
.coverage-matrix thead th:first-child { z-index: 6; background: var(--surface-soft); }
.coverage-matrix tr:not(.matrix-group):hover td, .coverage-matrix tr:not(.matrix-group):hover th { background: var(--surface-hover); }
.coverage-matrix .matrix-group th, .coverage-matrix .matrix-group td { height: 37px; background: var(--ink-strong); color: var(--canvas); font-size: .64rem; font-weight: 500; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.matrix-drug { width: 100%; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--ink-strong); font-size: .79rem; font-weight: 500; text-align: left; }
.matrix-drug:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.matrix-note { margin-top: 16px; color: var(--muted); font-size: .78rem; }

.wizard { display: grid; grid-template-columns: minmax(230px, .36fr) minmax(0, 1fr); gap: 36px; }
.wizard-panel { display: grid; align-content: start; gap: 24px; padding: 28px; background: var(--surface-soft); border-top: 3px solid var(--brand); }
.field { display: grid; gap: 10px; }
.field label { font-size: .78rem; font-weight: 500; }
.field label span { margin-right: 8px; color: var(--brand); font-size: .65rem; }
.field select { width: 100%; min-height: 48px; padding: 8px 28px 8px 10px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--surface); font-size: .85rem; }
.route-proof { display: flex; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 6px; background: var(--brand); }
.route-proof strong { font-size: .76rem; font-weight: 500; }
.route-proof p { margin-top: 6px; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.result-panel { min-width: 0; padding-top: 2px; }
.result-title { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.result-title h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 500; }
.result-title .eyebrow { margin-bottom: 12px; }
.result-meta { display: flex; flex-wrap: wrap; align-content: start; justify-content: flex-end; gap: 8px; }
.scenario-scope { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.case-result { padding: 16px 20px; border-left: 2px solid var(--brand); background: var(--brand-soft); color: var(--ink); font-size: .85rem; line-height: 1.65; }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.answer-box { padding: 18px 0; border-top: 1px solid var(--line-strong); }
.answer-box h4 { margin-bottom: 15px; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.answer-box li { color: var(--muted); font-size: .82rem; }
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line); }
.case-card { display: flex; min-width: 0; flex-direction: column; padding: 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-index { display: block; margin-bottom: 30px; color: var(--brand); font-size: 2.6rem; font-weight: 400; letter-spacing: -.065em; line-height: 1; }
.case-card h3 { margin-bottom: 16px; font-size: 1.5rem; font-weight: 500; }
.case-card > p { margin-bottom: 26px; color: var(--muted); font-size: .88rem; }
.case-card .case-result { margin-top: auto; }
.source-details { border-bottom: 1px solid var(--line); }
.source-details:first-child { border-top: 1px solid var(--line); }
.source-details summary { padding: 22px 6px; font-size: 1rem; font-weight: 500; }
.source-details summary::marker { color: var(--brand); font-size: .8em; }
.source-details summary:hover { color: var(--brand); }
.source-details[open] summary { color: var(--brand); }
.source-details > ul, .source-details > div { padding: 0 24px 24px; color: var(--muted); font-size: .88rem; }
.source-list { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.source-note { margin-top: 6px; color: var(--muted); font-size: .76rem; }

/* Detalle nativo: el navegador gestiona el foco, Escape y el retorno al elemento de origen. */
.detail-drawer { width: min(650px, calc(100vw - 24px)); max-width: none; height: 100%; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; overflow: auto; overscroll-behavior: contain; border: 0; border-left: 1px solid var(--line); border-top: 5px solid var(--brand-solid); background: var(--surface); color: var(--ink); animation: drawer-in 240ms cubic-bezier(.2,.7,.3,1) both; }
.detail-drawer::backdrop { background: rgb(12 12 16 / 52%); }
body:has(.detail-drawer[open]) { overflow: hidden; }
@keyframes drawer-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.drawer-close { position: sticky; z-index: 2; top: 18px; display: grid; width: 44px; height: 44px; float: right; place-items: center; margin: 18px 24px 0 0; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink-strong); }
.drawer-close:hover { background: var(--ink-strong); color: var(--canvas); }
#detail-content { padding: 42px clamp(24px, 4vw, 50px) 56px; }
#detail-content > .clinical-glyph { margin-bottom: 30px; }
.drawer-title { max-width: 480px; margin-bottom: 22px; padding-right: 10px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.04; overflow-wrap: anywhere; }
.drawer-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 30px; }
.info-block { padding: 22px 0; border-top: 1px solid var(--line); }
.info-block h4 { margin-bottom: 12px; color: var(--brand); font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.info-block p, .info-block li { color: var(--muted); font-size: .88rem; line-height: 1.7; }
.site-footer { display: flex; align-items: start; gap: 40px; margin-top: 80px; padding: 32px 0 40px; border-top: 1px solid var(--line-strong); }
.footer-brand { color: var(--ink-strong); font-size: 1.5rem; font-weight: 700; line-height: 1; letter-spacing: -.06em; }
.site-footer p { color: var(--muted); font-size: .76rem; }
.site-footer .text-action { margin-left: auto; min-height: 30px; font-size: .76rem; }
.print-note { display: none; }
.fatal-error { max-width: 780px; margin: 48px auto; padding: 24px; border: 1px solid var(--ink-strong); background: var(--surface-soft); color: var(--ink-strong); }

@media (min-width: 1600px) {
  .instrument-header { padding-block: 64px; }
  .hero-art { max-width: 530px; }
}
@media (max-width: 1200px) {
  .brand-description { display: none; }
  .nav-btn { gap: 8px; padding-inline: 14px; font-size: .76rem; }
  .nav-btn::after { right: 14px; left: 14px; }
  .instrument-header { gap: 50px; }
  h1 { font-size: clamp(4.8rem, 7.8vw, 6rem); }
  .atlas-overview { gap: 24px; }
  .atlas-index div { gap: 10px; padding-inline: 18px; }
  .atlas-index dt { font-size: 2.3rem; }
  .atlas-index dd { font-size: .72rem; }
  .section-head { display: block; }
  .toolbar { margin-top: 22px; }
  .segmented { width: fit-content; }
  .spectrum-scanner { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
  .scanner-foot { display: block; }
  .scanner-foot .quiet-action { margin-top: 8px; }
  .pokedex-card { padding: 22px 20px 18px; }
  .pokedex-card h3 { font-size: 1.5rem; }
  .result-title { display: block; }
  .result-meta { justify-content: flex-start; margin-top: 16px; }
}
@media (max-width: 900px) {
  :root { --page-gutter: 28px; --header-offset: 132px; }
  .masthead { min-height: 80px; gap: 20px; }
  .brand strong { font-size: 1.65rem; }
  .brand-mark { width: 28px; height: 28px; }
  .search-panel { width: 270px; }
  .theme-btn { width: 44px; justify-content: center; padding: 0; }
  .theme-btn #theme-label { display: none; }
  .nav-btn { min-height: 51px; }
  .instrument-header { grid-template-columns: 1.2fr 1fr; gap: 32px; padding-block: 36px; }
  h1 { font-size: clamp(3.6rem, 8.7vw, 4.8rem); }
  .lead { font-size: .9rem; }
  .instrument-copy .eyebrow { font-size: .59rem; letter-spacing: .07em; }
  .header-actions { gap: 10px 20px; }
  .primary-action { gap: 16px; padding-inline: 15px; font-size: .75rem; }
  .text-action { font-size: .75rem; gap: 10px; }
  .art-caption { gap: 8px; padding: 0 16px 14px; font-size: .51rem; }
  .atlas-overview { grid-template-columns: 1fr; gap: 22px; padding-block: 22px; }
  .atlas-index div { gap: 15px; }
  .atlas-index dt { font-size: 2.5rem; }
  .atlas-index dd { font-size: .8rem; }
  .clinical-boundary { display: flex; align-items: baseline; gap: 12px; padding-left: 12px; }
  .clinical-boundary p { max-width: none; }
  .spectrum-scanner { display: block; margin-bottom: 48px; padding-block: 24px; }
  .scanner-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
  .scanner-head h2 { max-width: none; margin-bottom: 0; }
  .scanner-picker { min-width: 240px; }
  .scanner-foot { display: flex; }
  .scanner-foot .quiet-action { margin-top: 0; }
  .map-row { grid-template-columns: 1fr; gap: 16px; }
  .classification-row { grid-template-columns: minmax(180px, .5fr) minmax(0, 1fr); }
  .morph-lane + .morph-lane { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .organism-grid, .antibiotic-grid, .mechanism-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warning-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warning-card:nth-child(3) { border-left: 0; }
  .warning-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .wizard { gap: 24px; grid-template-columns: minmax(200px, .45fr) minmax(0, 1fr); }
  .wizard-panel { padding: 20px; }
  .answer-grid { grid-template-columns: 1fr; gap: 8px; }
  .site-footer { gap: 24px; }
}
@media (max-width: 620px) {
  :root { --page-gutter: 20px; --header-offset: 164px; }
  .masthead { position: relative; min-height: 114px; flex-wrap: wrap; align-content: start; gap: 0; padding-top: 16px; padding-bottom: 12px; }
  .brand { gap: 9px; }
  .brand strong { font-size: 1.5rem; }
  .brand-mark { width: 25px; height: 25px; }
  .header-tools { display: contents; }
  .theme-btn { position: absolute; top: 7px; right: -8px; }
  .search-panel { width: 100%; margin-top: 13px; }
  .search-box { min-height: 36px; padding-inline: 10px; }
  .search-box input { padding-block: 8px; font-size: 16px; }
  .search-box kbd { display: none; }
  .nav-btn { min-height: 47px; gap: 7px; padding-inline: 15px; font-size: .75rem; }
  .instrument-header { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 28px; }
  .instrument-copy .eyebrow { margin-bottom: 20px; font-size: .61rem; }
  h1 { margin-bottom: 22px; font-size: clamp(3.5rem, 15.3vw, 6.8rem); }
  .lead { max-width: 450px; font-size: .91rem; }
  .header-actions { margin-top: 22px; gap: 18px; }
  .primary-action { min-height: 46px; gap: 22px; padding-inline: 17px; font-size: .79rem; }
  .text-action { font-size: .79rem; }
  .hero-art { max-width: none; height: 185px; }
  .coverage-art { position: absolute; width: 280px; height: 245px; top: -36px; right: 6px; }
  .art-caption { position: relative; z-index: 1; flex-direction: column; align-items: flex-start; gap: 4px; width: 110px; padding: 18px 0 0 16px; font-size: .52rem; }
  .atlas-overview { gap: 20px; }
  .atlas-index div { display: block; padding-inline: 20px; }
  .atlas-index dt { margin-bottom: 6px; font-size: 2.3rem; }
  .atlas-index dd { font-size: .72rem; }
  .clinical-boundary { display: block; }
  .clinical-boundary strong { font-size: .78rem; }
  .clinical-boundary p { margin-top: 4px; font-size: .74rem; }
  .spectrum-scanner { margin-bottom: 40px; padding-block: 26px; }
  .scanner-head { display: block; }
  .scanner-head h2 { font-size: 1.65rem; }
  .scanner-picker { min-width: 0; margin-top: 18px; }
  .scanner-picker select { font-size: 16px; }
  .scanner-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 0; }
  .scanner-cell { min-height: 78px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  .scanner-target { font-size: .58rem; }
  .scanner-cell .cov { font-size: 1.35rem; }
  .scanner-foot { display: block; margin-top: 14px; }
  .scanner-foot p { font-size: .78rem; }
  .scanner-foot .quiet-action { margin-top: 10px; min-height: 40px; font-size: .77rem; }
  .section-head { margin-bottom: 22px; }
  .section-head p { font-size: .85rem; }
  .section-head h2 { max-width: 400px; font-size: 2rem; }
  .section-head .eyebrow { font-size: .61rem; }
  .segmented { width: 100%; max-width: 100%; overflow-x: auto; }
  .segmented button { flex: 1 0 auto; padding-inline: 10px; font-size: .73rem; }
  .map-row { margin-bottom: 22px; padding: 18px; }
  .lane-items { column-gap: 18px; }
  .lane-chip { min-height: 34px; font-size: .75rem; }
  .classification-tools { grid-template-columns: 1fr; gap: 18px; padding: 18px; }
  .classification-tools input { font-size: 16px; }
  .classification-row { grid-template-columns: 1fr; }
  .classification-group > h3 { padding: 18px; font-size: 1.2rem; }
  .classification-criteria { padding: 16px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .classification-content { padding: 18px; }
  .classification-taxa { font-size: .92rem; }
  .organism-grid, .antibiotic-grid, .mechanism-grid, .case-grid { grid-template-columns: 1fr; }
  .pokedex-card { padding: 24px 22px 18px; }
  .pokedex-card h3 { margin-top: 16px; font-size: 1.8rem; }
  .card-subtitle { min-height: 0; margin-bottom: 20px; font-size: .85rem; }
  .mini-row { font-size: .82rem; }
  .mini-row b { font-size: .72rem; }
  .card-link { margin-top: 18px; font-size: .77rem; }
  .warning-stack { grid-template-columns: 1fr; }
  .warning-card { padding: 20px; border-left: 0; border-top: 1px solid var(--line); }
  .warning-card:first-child { border-top: 0; }
  .warning-card p { font-size: .8rem; }
  .warning-card strong { font-size: .85rem; }
  .coverage-matrix th:first-child { width: 164px; min-width: 164px; }
  .wizard { grid-template-columns: 1fr; gap: 30px; }
  .field select { font-size: 16px; }
  .answer-grid { grid-template-columns: 1fr; }
  .case-card { padding: 25px 22px; }
  .source-details summary { padding-block: 20px; font-size: .95rem; }
  .detail-drawer { width: calc(100vw - 10px); }
  #detail-content { padding: 32px 25px 40px; }
  .drawer-close { top: 12px; margin: 12px 14px 0 0; }
  .drawer-title { font-size: 2.2rem; }
  .site-footer { flex-wrap: wrap; gap: 20px; margin-top: 52px; padding-block: 28px; }
  .site-footer p { width: calc(100% - 150px); }
  .site-footer .text-action { margin-left: 0; }
}
@media (max-width: 360px) {
  :root { --page-gutter: 16px; }
  .header-actions { gap: 12px; }
  .primary-action { gap: 10px; padding-inline: 12px; }
  .hero-art { height: 165px; }
  .coverage-art { right: -25px; top: -42px; }
  .art-caption { padding-left: 12px; font-size: .48rem; }
  .atlas-index div { padding-inline: 14px; }
  .site-footer p { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .nav-btn.active { border-bottom: 3px solid Highlight; }
  .segmented button.active { outline: 2px solid Highlight; outline-offset: -3px; }
  .cov { border: 1px solid currentColor; }
  .pokedex-card:focus-visible { outline: 2px solid Highlight; }
}
@media print {
  :root, [data-theme="dark"] { color-scheme: light; --canvas: #fff; --surface: #fff; --surface-soft: #f7f7f8; --surface-hover: #fff; --ink: #222; --ink-strong: #000; --muted: #444; --line: #bbb; --line-strong: #888; --brand: #002fa7; --brand-soft: #edf1fb; }
  .skip-link, .site-header, .instrument-header, .atlas-overview, .spectrum-scanner, .section:not(.active), .toolbar, .site-footer, .drawer-close, .card-link { display: none !important; }
  .main { padding: 0; }
  .section.active { display: block; }
  .section-head { margin-bottom: 20px; }
  .section-head h2 { font-size: 24px; }
  .grid, .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pokedex-card, .case-card, .warning-card, .wizard-panel, .answer-box { break-inside: avoid; }
  .pokedex-card { padding: 16px; }
  .pokedex-card h3 { font-size: 20px; }
  .card-subtitle, .mini-row { font-size: 10px; }
  .mini-row b { font-size: 9px; }
  .matrix-wrap { max-height: none; overflow: visible; }
  .coverage-matrix { min-width: 0; font-size: 8px; }
  .coverage-matrix th, .coverage-matrix td { height: auto; padding: 4px 2px; }
  .coverage-matrix thead th, .coverage-matrix th:first-child { position: static; min-width: 0; width: auto; height: auto; }
  .coverage-matrix th:first-child { width: 24%; }
  .coverage-matrix tr { break-inside: avoid; }
  .coverage-matrix .matrix-group { break-after: avoid; }
  .coverage-matrix thead th, .matrix-drug { font-size: 8px; }
  .coverage-matrix .matrix-group th, .coverage-matrix .matrix-group td { background: #eee; color: #000; font-size: 8px; }
  .classification-tools, .classification-status, .classification-links { display: none; }
  .classification-group { break-inside: auto; margin-bottom: 20px; }
  .classification-group > h3 { break-after: avoid; padding: 10px 12px; background: #eee; color: #000; font-size: 15px; }
  .classification-row { grid-template-columns: 28% minmax(0, 1fr); break-inside: avoid; }
  .classification-criteria, .classification-content { padding: 10px 12px; }
  .classification-criteria h4, .classification-taxa { font-size: 11px; }
  .classification-criteria p, .classification-note { font-size: 9px; }
  .cov { width: 18px; height: 18px; background: transparent !important; color: #111 !important; }
  .print-note { display: block; margin-top: 24px; font-size: 10px; }
  .detail-drawer[open] { position: absolute; width: 100%; max-height: none; height: auto; border: 0; overflow: visible; }
  body:has(.detail-drawer[open]) { overflow: visible; }
  body:has(.detail-drawer[open]) .app-shell { display: none; }
}
