/* Ruta de trámites CR
   Paleta tomada del documento base: ultramar, azul obra, pervinca y cielo. */

@font-face {
  font-family: "Urbanist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/urbanist-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/urbanist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Urbanist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/urbanist-latin-ext-wght-normal.woff2") format("woff2-variations"), url("fonts/urbanist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ultra: #1800AD;
  --navy: #002195;
  --blue: #2E52C4;
  --peri: #7089E2;
  --sky: #95CCFF;
  --mist: #EEF0FA;
  --mist-2: #F6F7FC;
  --line: #D7DFEF;
  --ink: #1B1838;
  --ink-2: #2D2A4A;
  --slate: #55516E;
  --white: #FFFFFF;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --font: "Urbanist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --top: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  font-feature-settings: "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
button { font: inherit; color: inherit; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--ultra); }
p { margin: 0 0 .75em; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ultra); color: #fff; padding: 10px 14px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  width: min(1120px, 100% - 40px); margin-inline: auto;
  height: var(--top); display: flex; align-items: center; gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand-mark { width: 40px; height: 20px; }
.brand-mark path { fill: none; stroke-width: 4; stroke-linecap: round; }
.mainnav { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  position: relative; padding: 10px 14px; border-radius: 10px;
  color: var(--slate); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.mainnav a:hover { color: var(--ultra); background: var(--mist-2); }
.mainnav .sm { display: none; }
.mainnav a[aria-current="page"] { color: var(--ultra); }
.mainnav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px; border-radius: 3px;
  background: var(--ultra); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.mainnav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Tipografía de sección (como el documento: mayúsculas + subtítulo ligero) ---------- */
.display { margin: 0; line-height: .98; letter-spacing: -.01em; }
.display-strong, .display-light { display: block; text-transform: uppercase; color: var(--ultra); }
.display-strong { font-weight: 800; font-size: clamp(2.3rem, 6vw, 4.1rem); }
.display-light { font-weight: 300; font-size: clamp(1.45rem, 3.6vw, 2.45rem); margin-top: .12em; }
.lede { color: var(--slate); font-size: 1.15rem; max-width: 56ch; margin-top: 18px; }

.sec-title { margin: 0 0 4px; line-height: 1.1; }
.sec-title .t-strong { display: block; font-weight: 800; text-transform: uppercase; color: var(--ink-2); font-size: 1.35rem; letter-spacing: .01em; }
.sec-title .t-light { display: block; font-weight: 300; color: var(--slate); font-size: 1.05rem; }
.sec-title.big .t-strong { font-size: clamp(1.8rem, 4.4vw, 2.8rem); color: var(--ultra); }
.sec-title.big .t-light { font-size: clamp(1.1rem, 2.6vw, 1.5rem); }

/* ---------- Hero y stepper ---------- */
.hero { padding: 48px 0 6px; }
.stepper-wrap { margin: 14px 0 6px; }
#stepper svg { width: 100%; max-width: 780px; height: auto; margin: 0 auto; overflow: visible; }
.stepper-caption { text-align: center; color: var(--slate); font-weight: 600; margin: 4px 0 0; min-height: 1.5em; }
.st-label { font-family: var(--font); font-weight: 700; font-size: 22px; fill: var(--ink-2); transition: fill .3s; }
.st-label.is-future { fill: #9AA3C7; }
.st-track { fill: none; stroke: #E4E9F7; stroke-width: 18; stroke-linecap: butt; }
.st-seg { fill: none; stroke-width: 18; stroke-linecap: butt; }
.st-arrow { transition: fill .35s; }
.st-node { cursor: default; transform-box: fill-box; transform-origin: center; animation: nodeIn .6s var(--ease) both; animation-delay: calc(var(--k, 0) * 90ms + 120ms); }
@keyframes nodeIn { from { opacity: 0; transform: scale(.55); } }
.st-node.is-clickable { cursor: pointer; }
.st-node .st-circle { transition: fill .35s var(--ease), stroke .35s; }
.st-node .st-icon { transition: color .35s; }
.st-node.is-clickable:hover .st-circle { filter: brightness(1.04); }
.st-node:focus { outline: none; }
.st-node:focus-visible .st-ring { stroke: var(--sky); stroke-width: 5; }
.st-ring { fill: none; stroke: transparent; }
.st-pulse { fill: none; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.st-node.is-current .st-pulse { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { opacity: .55; transform: scale(1); } 70% { opacity: 0; transform: scale(1.32); } 100% { opacity: 0; } }

#view-guia.compact .hero { padding-top: 26px; }
#view-guia.compact .lede { display: none; }
#view-guia.compact .display-strong { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
#view-guia.compact .display-light { font-size: clamp(1.05rem, 2.2vw, 1.45rem); }
#view-guia.compact #stepper svg { max-width: 620px; }

/* ---------- Escenario del asistente ---------- */
.stage { position: relative; min-height: 300px; padding: 20px 0 8px; }
.step { max-width: 980px; margin: 0 auto; }
.step.in-fwd { animation: inFwd .38s var(--ease) both; }
.step.in-back { animation: inBack .38s var(--ease) both; }
.step.out { animation: out .16s ease-in both; }
@keyframes inFwd { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes inBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes out { to { opacity: 0; transform: translateY(6px); } }

.q-title { font-size: clamp(1.5rem, 3.2vw, 2.05rem); font-weight: 800; color: var(--ink-2); margin: 0; line-height: 1.15; }
.q-title:focus { outline: none; }
.q-help { color: var(--slate); margin: 6px 0 22px; max-width: 62ch; }

.opts { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt {
  appearance: none; display: flex; gap: 16px; align-items: flex-start; width: 100%;
  padding: 22px 22px 24px; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .2s, background-color .28s var(--ease), color .28s, transform .15s;
}
.opt:hover { border-color: var(--peri); }
.opt:active { transform: scale(.985); }
.opt[aria-pressed="true"] { background: var(--ultra); border-color: var(--ultra); color: #fff; }
.opt-letter {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem; background: var(--mist); color: var(--ultra);
  transition: background-color .28s, color .28s, transform .3s var(--ease);
}
.opt[aria-pressed="true"] .opt-letter { background: #fff; transform: scale(1.06); }
.opt-main { flex: 1; min-width: 0; }
.opt-title { display: block; font-weight: 800; font-size: 1.22rem; line-height: 1.2; }
.opt-text { display: block; margin-top: 6px; color: var(--slate); font-size: .98rem; transition: color .28s; }
.opt[aria-pressed="true"] .opt-text { color: #D9DDFF; }
.opt-icon { flex: none; width: 46px; height: 46px; color: var(--peri); transition: color .28s; }
.opt[aria-pressed="true"] .opt-icon { color: var(--sky); }

.subq { margin-top: 28px; padding-top: 22px; border-top: 1px dashed var(--line); }
.subq-label { font-weight: 700; margin: 0 0 10px; color: var(--ink-2); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--mist); border-radius: 14px; }
.seg button {
  border: 0; background: transparent; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  font-weight: 700; color: var(--slate); transition: background-color .22s, color .22s;
}
.seg button:hover { color: var(--ultra); }
.seg button[aria-pressed="true"] { background: var(--ultra); color: #fff; }
.seg.small button { padding: 7px 14px; font-size: .92rem; }

.note {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px 16px;
  background: var(--mist-2); border-left: 4px solid var(--sky); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink-2);
}
.note svg { flex: none; width: 22px; height: 22px; color: var(--blue); margin-top: 2px; }
.note p { margin: 0; }
.note.pop { animation: rise .4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Panel de alcance */
.alcance { margin-top: 26px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--mist-2); }
.alcance h3 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; color: var(--ink-2); }
.alcance > p { color: var(--slate); margin-bottom: 14px; }
.meter-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 26px; }
.meter-list li { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: baseline; }
.meter { display: inline-flex; gap: 4px; }
.meter i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--peri); display: inline-block; }
.meter i.on { background: var(--ultra); border-color: var(--ultra); }
.meter-name { font-weight: 700; display: block; }
.meter-note { color: var(--slate); font-size: .92rem; display: block; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: .88rem; color: var(--slate); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Clasificador */
.classify-toggle { margin-top: 18px; }
.quiz { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; align-items: start; }
.quiz-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.quiz-list li { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.quiz-list li:last-child { border-bottom: 0; }
.quiz-q { margin: 0; }
.quiz-list .seg { flex-wrap: nowrap; flex: none; }
.verdict {
  position: sticky; top: calc(var(--top) + 16px);
  padding: 22px; border-radius: var(--r-lg); background: var(--mist); text-align: center;
  transition: background-color .35s var(--ease), color .35s;
}
.verdict-k { font-size: .9rem; font-weight: 600; color: var(--slate); margin: 0; transition: color .35s; }
.verdict-v { display: block; font-size: 1.7rem; font-weight: 800; margin: 4px 0 6px; line-height: 1.1; }
.verdict-why { font-size: .92rem; margin: 0; color: var(--slate); transition: color .35s; }
.verdict.is-mayor { background: var(--navy); color: #fff; }
.verdict.is-menor { background: var(--sky); color: var(--navy); }
.verdict.is-mayor .verdict-k, .verdict.is-mayor .verdict-why { color: #CFD8FF; }
.verdict.is-menor .verdict-k, .verdict.is-menor .verdict-why { color: #12306E; }
.verdict-v.swap { animation: swap .42s var(--ease); }
@keyframes swap { 0% { opacity: 0; transform: translateY(8px) scale(.96); } 100% { opacity: 1; transform: none; } }

/* Navegación del asistente */
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 980px; margin: 18px auto 0; padding-bottom: 64px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 13px 24px; font-weight: 800; cursor: pointer; border: 1.5px solid transparent;
  text-decoration: none; transition: background-color .2s, color .2s, border-color .2s, transform .15s, opacity .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ultra); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-primary[disabled] { opacity: .35; cursor: not-allowed; transform: none; }
.btn-primary.ready { animation: ready .6s var(--ease); }
@keyframes ready { 40% { transform: scale(1.05); } }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--peri); color: var(--ultra); }
.btn-soft { background: #fff; color: var(--ultra); border-color: var(--line); padding: 10px 16px; font-size: .95rem; }
.btn-soft:hover { border-color: var(--ultra); }
.wizard-nav .spacer { flex: 1; }

/* ---------- Resultado ---------- */
.result { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 40px; align-items: start; max-width: none; }
.summary {
  position: sticky; top: calc(var(--top) + 18px);
  padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--mist-2);
}
.summary h2 { margin: 0 0 12px; font-size: 1.2rem; font-weight: 800; color: var(--ink-2); }
.summary h3 { margin: 22px 0 10px; font-size: .98rem; font-weight: 800; color: var(--ink-2); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.pill svg { width: 14px; height: 14px; color: var(--peri); }
.pill:hover { border-color: var(--ultra); color: var(--ultra); }
.progress { margin-top: 18px; }
.progress-k { display: flex; justify-content: space-between; font-size: .92rem; font-weight: 700; color: var(--ink-2); }
.progress-bar { height: 8px; border-radius: 8px; background: var(--mist); overflow: hidden; margin-top: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--sky), var(--peri), var(--ultra)); transition: width .5s var(--ease); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; font-size: .9rem; }
.bars .bar-k { font-weight: 700; }
.bars .bar-t { position: relative; height: 24px; background: #fff; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.bars .bar-f { position: absolute; inset: 0 auto 0 0; border-radius: 6px; transform-origin: left; animation: grow .7s var(--ease) both; }
.bars .bar-v { position: relative; z-index: 1; padding: 0 8px; line-height: 24px; font-weight: 700; font-size: .82rem; white-space: nowrap; }
@keyframes grow { from { transform: scaleX(0); } }
.total { margin: 8px 0 0; font-size: .92rem; color: var(--slate); }
.total strong { color: var(--ink-2); }
.actions { display: grid; gap: 8px; margin-top: 22px; }
.actions .btn { justify-content: flex-start; }
.mini-meter { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.mini-meter li { display: flex; gap: 10px; align-items: center; }

.route-head { margin-bottom: 8px; }
.callout {
  margin: 0 0 22px; padding: 16px 18px; border-radius: var(--r-md);
  background: var(--navy); color: #fff;
}
.callout p { margin: 0; }
.callout .cite summary, .callout .cite { color: #CFD8FF; }
.callout .cite-k { color: var(--sky); }
.callout .cite-list { background: rgba(255, 255, 255, .08); border-color: var(--sky); color: #fff; }
.callout .cite-list a { color: var(--sky); }

.route { position: relative; }
.route::before {
  content: ""; position: absolute; left: 19px; top: 10px; bottom: 30px; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--sky), var(--peri) 35%, var(--blue) 70%, var(--navy));
}
.phase { position: relative; margin: 26px 0 14px 58px; }
.phase:first-child { margin-top: 0; }
.phase-sec > summary { list-style: none; cursor: pointer; }
.phase-sec > summary::-webkit-details-marker { display: none; }
.phase-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .88rem; font-weight: 700; color: var(--blue); }
.phase-toggle svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.phase-sec[open] .phase-toggle svg { transform: rotate(90deg); }
.phase-skip { color: var(--slate); font-size: .9rem; margin: 4px 0 0; }
.phase-sec > summary.phase { padding: 14px 16px; margin-left: 58px; border: 1px dashed var(--peri); border-radius: var(--r-md); background: #fff; transition: background-color .2s, border-color .2s; }
.phase-sec > summary.phase:hover { background: var(--mist-2); border-color: var(--ultra); }
.phase-sec[open] > summary.phase { border-style: solid; border-color: var(--line); margin-bottom: 14px; }
.phase-sec > summary .phase-toggle .when-open { display: none; }
.phase-sec[open] > summary .phase-toggle .when-open { display: inline; }
.phase-sec[open] > summary .phase-toggle .when-closed { display: none; }
.tr-marker.is-letter { border-style: dashed; }

.tr-list { list-style: none; margin: 0; padding: 0; }
.tr { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; margin: 0 0 16px; }
.reveal .tr { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.tr-marker {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 3px solid var(--peri);
  font-weight: 800; color: var(--ultra); transition: background-color .3s, border-color .3s, color .3s;
}
.tr-marker svg { width: 20px; height: 20px; }
.tr.is-done .tr-marker { background: var(--ultra); border-color: var(--ultra); color: #fff; }
.tr-card {
  min-width: 0; padding: 18px 20px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff;
  transition: border-color .25s, background-color .25s;
}
.tr.is-done .tr-card { background: var(--mist-2); }
.tr-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.tr-title { margin: 0; font-size: 1.12rem; font-weight: 800; line-height: 1.25; color: var(--ink-2); transition: color .25s; }
.tr.is-done .tr-title { color: var(--slate); }
.done-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--slate);
  transition: border-color .2s, color .2s, background-color .2s;
}
.done-toggle .box { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--peri); display: grid; place-items: center; transition: background-color .2s, border-color .2s; }
.done-toggle .box svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s var(--ease); }
.done-toggle[aria-pressed="true"] { color: var(--ultra); border-color: var(--ultra); }
.done-toggle[aria-pressed="true"] .box { background: var(--ultra); border-color: var(--ultra); }
.done-toggle[aria-pressed="true"] .box svg { opacity: 1; transform: none; }
.inst-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 10px; padding: 0; list-style: none; }
.inst { font-size: .8rem; font-weight: 700; color: var(--navy); background: var(--mist); padding: 4px 10px; border-radius: 999px; }
.tr-body p { margin: 0 0 .55em; max-width: 72ch; }
.tr-role { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--mist-2); font-size: .95rem; }
.tr-role strong { color: var(--ultra); }

/* Citas */
.cite { margin-top: 10px; font-size: .86rem; color: var(--slate); }
.cite > summary { display: block; cursor: pointer; list-style: none; border-radius: 6px; line-height: 1.5; }
.cite > summary::-webkit-details-marker { display: none; }
.cite > summary::after { content: "ver referencia"; font-weight: 600; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.cite[open] > summary::after { content: "ocultar"; }
.cite-k { font-weight: 800; color: var(--blue); }
.cite-list {
  list-style: none; margin: 8px 0 0; padding: 12px 14px; background: var(--mist-2);
  border-left: 3px solid var(--sky); border-radius: 0 10px 10px 0; color: var(--ink-2);
  animation: rise .3s var(--ease) both;
}
.cite-list li { padding-left: 1.8em; text-indent: -1.8em; margin: 0 0 8px; overflow-wrap: anywhere; line-height: 1.45; }
.cite-list li:last-child { margin-bottom: 0; }

/* ---------- Vistas secundarias ---------- */
.view-head { padding: 48px 0 10px; }
.view-head .lede { margin-top: 14px; }
.block { margin: 46px 0; }
.block-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; justify-content: space-between; margin-bottom: 18px; }

/* Lo que se suma (salud) */
.extras { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 30px; }
.extras li { padding-top: 16px; border-top: 2px solid var(--line); }
.extras .x-letter { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--ultra); margin-bottom: 10px; }
.extras h3 { margin: 0 0 4px; font-size: 1.08rem; font-weight: 800; color: var(--ink-2); }
.extras p { margin: 0; color: var(--slate); }

/* Matriz de roles (salud) */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.role-col { padding: 20px 22px 22px; border-right: 1px solid var(--line); position: relative; }
.role-col:last-child { border-right: 0; }
.role-col::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--c, var(--peri)); }
.role-col h3 { margin: 6px 0 8px; font-weight: 800; font-size: 1.2rem; color: var(--ink-2); }
.role-col p { margin: 0; }
.role-col p.swap { animation: swap .4s var(--ease); }
.roles-note { margin-top: 16px; font-weight: 600; color: var(--ink-2); max-width: 80ch; }

/* Plazos (salud) */
.plazo-rows { display: grid; gap: 18px; }
.plazo-row h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 800; color: var(--ink-2); }
.timeline { display: flex; gap: 4px; height: 44px; }
.timeline > div {
  position: relative; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; overflow: hidden;
  font-weight: 700; font-size: .86rem; white-space: nowrap; color: #fff; transform-origin: left; animation: grow .7s var(--ease) both;
}
.timeline > div span { overflow: hidden; text-overflow: ellipsis; }
.timeline .c1 { background: var(--sky); color: var(--navy); }
.timeline .c2 { background: var(--peri); }
.timeline .c3 { background: var(--blue); }
.timeline .c4 { background: var(--ultra); }
.timeline .c5 { background: var(--navy); }

/* Caso aplicado */
.caso { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--mist); color: var(--navy); font-weight: 700; font-size: .82rem; }
.caso h3 { margin: 10px 0 2px; font-size: 1.45rem; font-weight: 800; color: var(--ultra); line-height: 1.15; }
.caso .where { color: var(--slate); margin-bottom: 14px; }
.why { padding: 14px 16px; border-radius: var(--r-md); background: var(--navy); color: #fff; font-weight: 600; }
.flow { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flow li { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.flow li span { padding: 8px 12px; border-radius: 10px; background: var(--mist); color: var(--navy); }
.flow li:last-child span { background: var(--sky); }
.flow li + li::before { content: ""; width: 14px; height: 14px; border-top: 3px solid var(--peri); border-right: 3px solid var(--peri); transform: rotate(45deg); margin-right: 4px; }
.lessons { margin: 18px 0 0; padding-left: 1.2em; }
.gantt { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gantt li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; font-size: .92rem; }
.gantt .g-k { font-weight: 700; }
.gantt .g-k span { font-weight: 400; color: var(--slate); }
.gantt .g-t { position: relative; height: 26px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--mist-2) 0 calc(100% / 13 - 1px), var(--line) calc(100% / 13 - 1px) calc(100% / 13)); }
.gantt .g-f { position: absolute; top: 0; bottom: 0; border-radius: 6px; transform-origin: left; animation: grow .6s var(--ease) both; }
.months { display: grid; grid-template-columns: 150px 1fr; gap: 12px; margin-top: 6px; }
.months > span:last-child { display: flex; justify-content: space-between; font-size: .78rem; color: var(--slate); }
.months b { font-weight: 600; }
.sum-more > summary { cursor: pointer; list-style: none; font-weight: 800; color: var(--ink-2); margin-top: 18px; display: flex; align-items: center; gap: 6px; }
.sum-more > summary::-webkit-details-marker { display: none; }
.sum-more > summary svg { width: 16px; height: 16px; color: var(--blue); transition: transform .25s var(--ease); }
.sum-more[open] > summary svg { transform: rotate(90deg); }
.sum-more > summary + h3 { margin-top: 12px; }
.lessons li { margin-bottom: 8px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* Tablas comparativas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.table-wrap.swap { animation: rise .35s var(--ease) both; }
table.cmp { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; font-size: .97rem; }
.cmp th, .cmp td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cmp tr:last-child th, .cmp tr:last-child td { border-bottom: 0; }
.cmp thead th { font-weight: 800; color: #fff; background: var(--ultra); position: relative; }
.cmp thead th:first-child { background: var(--mist); color: var(--ink-2); }
.cmp thead th.h1 { background: var(--blue); }
.cmp thead th.h2 { background: var(--ultra); }
.cmp thead th.h3 { background: var(--navy); }
.cmp tbody th { position: sticky; left: 0; z-index: 1; width: 190px; background: var(--mist-2); font-weight: 800; color: var(--ink-2); }
.cmp tbody tr:hover td { background: #FAFBFF; }
.cmp-note { margin-top: 12px; color: var(--slate); }

/* Fuentes */
.reflist { list-style: none; margin: 0; padding: 0; }
.reflist li { padding: 14px 0 14px 2em; text-indent: -2em; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; animation: rise .35s var(--ease) both; }
.reflist .grp { display: inline-block; text-indent: 0; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--mist); color: var(--navy); font-size: .74rem; font-weight: 700; vertical-align: 1px; }
.count { color: var(--slate); font-weight: 600; }

/* Pie y avisos */
.footer { border-top: 1px solid var(--line); background: var(--mist-2); color: var(--slate); font-size: .93rem; }
.footer-in { padding: 26px 0 34px; }
.footer p { max-width: 90ch; }
.noscript { padding: 40px 0; font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700;
  transition: opacity .25s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Adaptación ---------- */
@media (max-width: 980px) {
  .result { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .summary { position: static; }
  .extras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .caso { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .phase-sec > summary.phase { margin-left: 44px; }
  .brand span { display: none; }
  .mainnav .lg { display: none; }
  .mainnav .sm { display: inline; }
  .topbar-in { gap: 12px; }
  .mainnav a { padding: 10px 10px; font-size: .95rem; }
  .hero { padding-top: 30px; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .opt-icon { display: none; }
  .meter-list { grid-template-columns: minmax(0, 1fr); }
  .quiz { grid-template-columns: minmax(0, 1fr); }
  .verdict { position: static; }
  .quiz-list li { flex-direction: column; align-items: flex-start; gap: 10px; }
  .st-label { display: none; }
  .roles { grid-template-columns: minmax(0, 1fr); }
  .role-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .role-col:last-child { border-bottom: 0; }
  .extras { grid-template-columns: minmax(0, 1fr); }
  .tr { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .tr-marker { width: 32px; height: 32px; font-size: .9rem; border-width: 2px; }
  .route::before { left: 15px; }
  .phase { margin-left: 44px; }
  .tr-head { flex-direction: column; gap: 8px; }
  .wizard-nav { position: sticky; bottom: 0; padding: 12px 0 14px; background: linear-gradient(rgba(255,255,255,0), #fff 30%); }
  .timeline > div { font-size: .75rem; padding: 0 6px; }
  .gantt li, .months { grid-template-columns: 96px 1fr; }
}
@media (min-width: 761px) { .stepper-caption.desk-hide { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Impresión ---------- */
@media print {
  .topbar, .footer, .stepper-wrap, .wizard-nav, .actions, .hero .lede, .toast, .done-toggle, .skip, .pill svg { display: none !important; }
  body { font-size: 11pt; }
  .hero { padding-top: 0; }
  .display-strong { font-size: 22pt; }
  .display-light { font-size: 14pt; }
  .result { grid-template-columns: 1fr; gap: 12px; }
  .summary { position: static; background: none; border: 1px solid #ccc; }
  .tr, .tr-card, .alcance { break-inside: avoid; }
  .reveal .tr, .cite-list { animation: none !important; }
  .cite > summary::after, .cite[open] > summary::after { content: ""; }
  .callout { background: none; color: var(--ink); border: 1.5px solid var(--ultra); break-inside: avoid; }
  .callout .cite, .callout .cite summary { color: var(--slate); }
  .callout .cite-list { color: var(--ink-2); }
  .phase-sec > summary .phase-toggle, .phase-skip { display: none; }
  a { color: inherit; }
}
