
/* Identidad Impulso Digital: oscuro y elegante, azul ambiental, títulos naranja a dorado.
   Layout: cabecera fija con tres vistas (mapa, diagnóstico, programa); el mapa es una rejilla pilar x nivel. */
:root {
  --bg: #EEEAE8; --surface: #FFFFFF; --surface-2: #E4DFDC; --text: #000000; --muted: #4A4542;
  --line: #CFC8C4; --primary: #12548A; --accent: #B83F0B; --gold: #D6A50E;
  --glow: 0 0 0 1px #12548a22, 0 12px 40px -12px #12548a55;
  --ok: #1E7A45; --mid: #A86A00; --bad: #B3261E;
  --display: "Roboto Slab", Roboto, Georgia, serif; --body: "Raleway", "Segoe UI", sans-serif;
  --r: 8px; color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --surface: #111111; --surface-2: #1A1A1A; --text: #EEEAE8; --muted: #A9A29E;
  --line: #2A2A2A; --primary: #4D8FC7; --accent: #E2622B; --gold: #D6A50E;
  --glow: 0 0 0 1px #12548a55, 0 14px 50px -10px #12548a99;
  --ok: #4CC07E; --mid: #E2A53A; --bad: #F06A5E; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #000000; --surface: #111111; --surface-2: #1A1A1A; --text: #EEEAE8; --muted: #A9A29E;
  --line: #2A2A2A; --primary: #4D8FC7; --accent: #E2622B; --gold: #D6A50E;
  --glow: 0 0 0 1px #12548a55, 0 14px 50px -10px #12548a99;
  --ok: #4CC07E; --mid: #E2A53A; --bad: #F06A5E; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--body); font-variant-numeric: lining-nums tabular-nums; }
body::before { content: ""; position: fixed; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, #12548a40, transparent); pointer-events: none; z-index: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; text-wrap: balance; margin: 0; }
.grad { background: linear-gradient(120deg, #D64A0E, #D6A50E); -webkit-background-clip: text; background-clip: text; color: transparent; }
a { color: var(--primary); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.wrap { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 19px; }
.logo { height: 38px; width: auto; display: block; }
.logo.l { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .logo.d { display: none; } :root:not([data-theme="dark"]) .logo.l { display: block; } }
:root[data-theme="light"] .logo.d { display: none; } :root[data-theme="light"] .logo.l { display: block; }
:root[data-theme="dark"] .logo.l { display: none; } :root[data-theme="dark"] .logo.d { display: block; }
nav.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
nav.tabs a { text-decoration: none; color: var(--muted); padding: 8px 14px; border-radius: var(--r); font-weight: 600; font-size: 15px; }
nav.tabs a:hover { color: var(--text); background: var(--surface-2); }
nav.tabs a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--glow); }

.intro { padding: 40px 0 24px; display: grid; gap: 12px; max-width: 820px; }
.intro h1 { font-size: clamp(30px, 4.4vw, 46px); }
.intro p { margin: 0; color: var(--muted); font-size: 18px; max-width: 68ch; }
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
section.view { display: none; padding-bottom: 64px; }
section.view.on { display: block; }

/* ---------- Mapa ---------- */
.mapa { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.rejilla { display: grid; grid-template-columns: 230px repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.rejilla > div { padding: 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.rejilla .h { background: var(--surface-2); font-weight: 600; font-size: 14px; }
.rejilla .h small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.pil { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.cod { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: #12548A; color: #EEEAE8; font-size: 15px; }
.pil b { display: block; font-size: 14.5px; line-height: 1.3; }
.pil > span:not(.cod) span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.celda { display: flex; flex-direction: column; gap: 6px; }
.chip { text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-size: 13.5px; line-height: 1.3; transition: border-color .15s, box-shadow .15s, transform .15s; }
.chip:hover { border-color: var(--primary); box-shadow: var(--glow); transform: translateY(-1px); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip .id { font-family: var(--display); font-size: 11.5px; color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.n1 .chip { font-weight: 600; }
.ficha { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--glow); display: grid; gap: 14px; }
.ficha h3 { font-size: 21px; }
.ficha .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.ficha h4 { margin: 0 0 4px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); font-family: var(--body); }
.ficha ul { margin: 0; padding-left: 18px; }
.ficha li { margin: 2px 0; }
.ficha p { margin: 0; }
.ligas { display: flex; flex-wrap: wrap; gap: 6px; }
.liga { font-size: 12.5px; border: 1px dashed var(--line); border-radius: 6px; padding: 2px 8px; background: transparent; }
.dep { margin-top: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dep div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; font-size: 14.5px; }
.dep b { font-family: var(--display); }

/* ---------- Diagnóstico ---------- */
.diag { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
.bloque { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; }
.bloque h3 { font-size: 18px; display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.bloque .sub { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.ctx { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ctx label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
select { font: inherit; font-weight: 400; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.preg { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.preg .num { font-family: var(--display); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.preg p { margin: 0; font-size: 15px; line-height: 1.45; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 10px; font-size: 13px; white-space: nowrap; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"][data-v="0"] { background: color-mix(in srgb, var(--bad) 22%, transparent); }
.seg button[aria-pressed="true"][data-v="1"] { background: color-mix(in srgb, var(--mid) 24%, transparent); }
.seg button[aria-pressed="true"][data-v="2"] { background: color-mix(in srgb, var(--ok) 22%, transparent); }
.resultado { position: sticky; top: 84px; display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel.glow { box-shadow: var(--glow); }
.panel h3 { font-size: 18px; margin-bottom: 8px; }
.aviso { font-size: 13px; color: var(--muted); margin: 0; }
.ejemplo { display: inline-block; font-size: 12.5px; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); border-radius: 999px; padding: 1px 10px; margin-bottom: 6px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 7px 12px; font-size: 14px; font-weight: 600; }
.btn.prim { background: #D64A0E; border-color: #D64A0E; color: #fff; }
.btn:hover { box-shadow: var(--glow); }
svg.radar { width: 100%; height: auto; display: block; }
svg.radar text { font-family: var(--body); fill: var(--muted); font-size: 11.5px; }
.sem { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 13.5px; margin-top: 8px; }
.sem div { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sem .pct { margin-left: auto; white-space: nowrap; color: var(--muted); }
ol.plan { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: p; }
ol.plan li { counter-increment: p; display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
ol.plan li::before { content: counter(p); font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 20px; line-height: 1.1; }
ol.plan b { display: block; }
ol.plan .id { font-family: var(--display); color: var(--muted); font-size: 12px; margin-right: 6px; }
ol.plan p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
ol.plan .tag { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); }
.trans { border-top: 1px dashed var(--line); padding-top: 10px; font-size: 13.5px; }

/* ---------- Programa ---------- */
.ciclo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.paso { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: relative; }
.paso .sem-n { font-size: 12.5px; color: var(--gold); font-weight: 600; letter-spacing: .04em; }
.paso h3 { font-size: 18px; margin: 4px 0 6px; }
.paso p { margin: 0; color: var(--muted); font-size: 14.5px; }
.paso:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 40%; color: var(--accent); font-weight: 700; }
.niveles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.niv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.niv.dest { box-shadow: var(--glow); border-color: var(--primary); }
.niv h3 { font-size: 20px; margin-bottom: 4px; }
.niv .para { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
.niv ul { margin: 0; padding-left: 18px; font-size: 14.5px; }
.principios { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.principios div { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; }
.principios b { display: block; font-family: var(--display); margin-bottom: 2px; }
.principios p { margin: 0; color: var(--muted); font-size: 14.5px; }
h2.sec { font-size: 24px; margin: 8px 0 14px; }
footer { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--muted); font-size: 13.5px; position: relative; z-index: 1; }
footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.oculto { position: absolute; left: -9999px; }

@media (max-width: 1080px) {
  .mapa, .diag { grid-template-columns: minmax(0, 1fr); }
  .ficha, .resultado { position: static; }
  .ciclo, .niveles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paso::after { display: none; }
}
@media (max-width: 760px) {
  .rejilla { grid-template-columns: minmax(0, 1fr); }
  .rejilla .h.lv { display: none; }
  .rejilla .celda::before { content: attr(data-nivel); font-size: 11.5px; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
  .preg { grid-template-columns: 22px minmax(0, 1fr); }
  .preg .seg { grid-column: 2; }
  .ciclo, .niveles { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
