/* Manual de usuario de eGestiona (/documentacion).
   Se carga después de styles.css y reutiliza sus variables, botones, barra superior y fuentes.
   Cada portal tiene su color: Empresa (violeta), Colaborador (verde azulado), Cliente (naranja). */

body.dx {
  --pc: var(--violet);
  --pc-solid: #5b45e0;
  --pc-fg: var(--violet-fg);
  --pc-50: var(--violet-50);
  --pc-100: var(--violet-100);
  --side-w: 288px;
  --toc-w: 232px;
  --measure: 70ch;
  --outline: oklch(0 0 0 / 0.1);
  padding-top: var(--bar-h);
  background: var(--bg);
  font-size: 1.0625rem;
  line-height: 1.65;
}
:root[data-theme="dark"] body.dx { --outline: oklch(1 0 0 / 0.1); }
body.dx[data-portal="colaborador"] { --pc: var(--teal); --pc-solid: #07675f; --pc-fg: var(--teal-ink); --pc-50: var(--teal-50); --pc-100: rgb(14 159 150 / 0.3); }
body.dx[data-portal="cliente"] { --pc: var(--orange); --pc-solid: #cc440b; --pc-fg: var(--orange-ink); --pc-50: var(--amber-50); --pc-100: rgb(255 122 47 / 0.32); }
:root[data-theme="dark"] body.dx[data-portal="colaborador"] { --pc-solid: #0e9f96; }
:root[data-theme="dark"] body.dx[data-portal="cliente"] { --pc-solid: #e0581b; }
.dx [data-portal="empresa"] { --d: var(--violet); }
.dx [data-portal="colaborador"] { --d: var(--teal); }
.dx [data-portal="cliente"] { --d: var(--orange); }

/* ---------- barra superior ---------- */
.dx-top-in { display: flex; align-items: center; gap: 12px; height: var(--bar-h); padding-inline: clamp(12px, 2vw, 28px); max-width: 1680px; margin-inline: auto; }
.dx-doc-label { padding: 6px 12px; border-radius: 999px; background: var(--violet-50); color: var(--violet-fg); font-size: 0.88rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.dx-doc-label:hover { background: var(--violet-100); }
.dx-portals { display: flex; gap: 2px; margin-left: auto; }
.dx-portals a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: 0.92rem; font-weight: 600; color: var(--muted); text-decoration: none; transition: color var(--quick) var(--ease-out), background-color var(--quick) var(--ease-out); }
.dx-portals a:hover { color: var(--ink); background: var(--bg); }
.dx-portals a.is-current { color: var(--ink); background: var(--bg-2); }
.dx-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--d); }
.dx-search-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 14px; border: 0; border-radius: 12px; background: var(--bg); color: var(--muted); font-size: 0.92rem; font-weight: 600; cursor: pointer; transition: background-color var(--quick) var(--ease-out), color var(--quick) var(--ease-out); }
.dx-search-btn:hover { background: var(--bg-2); color: var(--ink); }
.dx-search-btn .ico { width: 1.25em; height: 1.25em; }
.dx-search-txt { min-width: 4.5em; text-align: left; }
.dx kbd { font-family: var(--body); font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface); color: var(--muted); box-shadow: 0 0 0 1px var(--line), 0 1px 0 var(--line); white-space: nowrap; }
.dx-menu-btn { display: none; place-items: center; align-content: center; gap: 6px; width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: var(--bg); cursor: pointer; }
.dx-menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform var(--fast) var(--ease-out); }
.dx-menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.dx-menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- estructura: índice | lectura | en esta página ---------- */
.dx-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); max-width: 1680px; margin-inline: auto; align-items: start; }
.dx-shell:not(:has(.dx-toc)) { grid-template-columns: var(--side-w) minmax(0, 1fr); }

.dx-side { position: sticky; top: var(--bar-h); height: calc(100dvh - var(--bar-h)); overflow-y: auto; overscroll-behavior: contain; padding: 24px 12px 40px 20px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.dx-side-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px; text-decoration: none; background: var(--pc-50); color: var(--ink); transition: background-color var(--quick) var(--ease-out); }
.dx-side-head:hover { background: var(--pc-100); }
.dx-side-head strong { display: block; font-family: var(--display); font-size: 1.02rem; line-height: 1.2; }
.dx-side-head small { display: block; margin-top: 2px; font-size: 0.8rem; line-height: 1.3; color: var(--muted); }
.dx-chip { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--pc-solid); color: #fff; }
.dx-chip .ico { width: 1.3em; height: 1.3em; stroke-width: 1.75; }
.dx-side-portales { display: none; }
.dx-grp { margin-top: 4px; }
.dx-grp summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer; list-style: none; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); user-select: none; transition: background-color var(--quick) var(--ease-out), color var(--quick) var(--ease-out); }
.dx-grp summary::-webkit-details-marker { display: none; }
.dx-grp summary:hover { background: var(--bg-2); color: var(--ink); }
.dx-chev { width: 1.1em; height: 1.1em; transition: transform var(--fast) var(--ease-out); }
.dx-grp[open] .dx-chev { transform: rotate(180deg); }
.dx-grp ul { padding: 2px 0 8px; }
.dx-grp li a { display: flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: 10px; font-size: 0.95rem; font-weight: 550; line-height: 1.3; color: var(--ink-2); text-decoration: none; transition: background-color var(--quick) var(--ease-out), color var(--quick) var(--ease-out); }
.dx-grp li a:hover { background: var(--bg-2); color: var(--ink); }
.dx-grp li a[aria-current="page"] { background: var(--pc-50); color: var(--pc-fg); font-weight: 700; }

.dx-toc { position: sticky; top: var(--bar-h); max-height: calc(100dvh - var(--bar-h)); overflow-y: auto; padding: 40px 20px 40px 8px; scrollbar-width: thin; }
.dx-toc-t { margin-bottom: 10px; font-size: 0.82rem; font-weight: 750; color: var(--ink); }
.dx-toc ul { display: grid; gap: 1px; box-shadow: -1px 0 0 var(--line); }
.dx-toc a { display: block; padding: 5px 0 5px 14px; font-size: 0.88rem; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color var(--quick) var(--ease-out); }
.dx-toc .n3 a { padding-left: 28px; font-size: 0.84rem; }
.dx-toc a:hover { color: var(--ink); }
.dx-toc a.is-active { color: var(--pc-fg); font-weight: 700; }

/* ---------- artículo ---------- */
.dx-main { min-width: 0; outline: none; }
.dx-art { max-width: 940px; margin-inline: auto; padding: 32px clamp(20px, 4vw, 56px) 72px; }
.dx-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 0.88rem; color: var(--muted); }
.dx-crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line); }
.dx-crumbs a { color: var(--muted); text-decoration: none; }
.dx-crumbs a:hover { color: var(--pc-fg); text-decoration: underline; }
.dx-crumbs [aria-current] { color: var(--ink-2); font-weight: 600; }
.dx-art h1, .dx-home h1 { margin-top: 18px; font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 750; line-height: 1.08; letter-spacing: -0.03em; }
.dx-lead { margin-top: 14px; max-width: 62ch; font-size: clamp(1.08rem, 1.5vw, 1.22rem); line-height: 1.6; color: var(--ink-2); }

.dx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; margin-top: 26px; border-radius: var(--r-md); overflow: hidden; background: var(--line); box-shadow: var(--e1); }
.dx-facts div { padding: 14px 18px; background: var(--surface); }
.dx-facts dt { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.dx-facts dd { margin-top: 3px; font-size: 0.95rem; line-height: 1.45; color: var(--ink); }

.dx-prosa { margin-top: 28px; }
.dx-prosa > * + * { margin-top: 1.1em; }
.dx-prosa p, .dx-prosa ul, .dx-prosa ol { max-width: var(--measure); }
.dx-prosa h2 { margin-top: 2.4em; padding-top: 0; font-size: clamp(1.45rem, 2.4vw, 1.85rem); font-weight: 750; line-height: 1.2; letter-spacing: -0.02em; }
.dx-prosa h3 { margin-top: 0; font-size: clamp(1.18rem, 1.8vw, 1.38rem); font-weight: 720; line-height: 1.25; letter-spacing: -0.015em; }
.dx-prosa h2, .dx-prosa h3 { scroll-margin-top: calc(var(--bar-h) + 20px); }
.dx-prosa a { color: var(--pc-fg); font-weight: 600; text-decoration-color: color-mix(in oklab, var(--pc-fg) 40%, transparent); }
.dx-prosa a:hover { text-decoration-color: currentColor; }
.dx-prosa ul { display: grid; gap: 0.5em; padding-left: 1.3em; list-style: disc; }
.dx-prosa ul li::marker { color: var(--pc-fg); }
.dx-prosa ol { display: grid; gap: 0.5em; padding-left: 1.4em; list-style: decimal; }
.dx-prosa strong { font-weight: 700; color: var(--ink); }
.dx-prosa code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.88em; padding: 2px 6px; border-radius: 6px; background: var(--bg-2); color: var(--ink); }
.dx-tabla { max-width: 100%; overflow-x: auto; border-radius: var(--r-md); box-shadow: var(--e1); background: var(--surface); }
.dx-prosa table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.dx-prosa th, .dx-prosa td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.dx-prosa th { font-size: 0.82rem; font-weight: 750; color: var(--muted); background: var(--bg-2); white-space: nowrap; }
.dx-prosa tbody tr:last-child td { border-bottom: 0; }
.dx-prosa td:first-child { white-space: nowrap; }

/* una acción = un bloque, separado por espacio y una línea fina (sin tarjetas anidadas) */
.dx-accion { margin-top: 2.2em; padding-top: 2em; border-top: 1px solid var(--line); }
.dx-accion > * + * { margin-top: 1em; }
.dx-accion > h3 + * { margin-top: 0.7em; }
.dx-prosa > .dx-accion:first-of-type { margin-top: 1.4em; }

.dx-pasos { max-width: var(--measure); }
.dx-pasos ol { counter-reset: paso; gap: 10px; padding-left: 0; list-style: none; }
.dx-pasos li { position: relative; counter-increment: paso; min-height: 32px; padding-left: 46px; padding-top: 3px; }
.dx-pasos li::before { content: counter(paso); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--pc-50); color: var(--pc-fg); font-size: 0.92rem; font-weight: 750; font-variant-numeric: tabular-nums; }

.dx-aviso { max-width: var(--measure); padding: 14px 18px 16px; border-radius: var(--r-md); background: var(--bg-2); }
.dx-aviso-t { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 750; color: var(--ink); }
.dx-aviso-t .ico { width: 1.25em; height: 1.25em; }
.dx-aviso-c { margin-top: 6px; font-size: 0.98rem; line-height: 1.6; color: var(--ink-2); }
.dx-aviso-c > * + * { margin-top: 0.6em; }
.dx-aviso-c a { color: var(--pc-fg); font-weight: 600; }
.dx-consejo { background: var(--teal-50); }
.dx-consejo .dx-aviso-t .ico { color: var(--teal-ink); }
.dx-ojo { background: var(--amber-50); }
.dx-ojo .dx-aviso-t .ico { color: var(--orange-ink); }
.dx-porque { background: var(--pc-50); }
.dx-porque .dx-aviso-t .ico { color: var(--pc-fg); }
.dx-nota .dx-aviso-t .ico { color: var(--violet-fg); }

.dx-campos { max-width: var(--measure); padding: 6px 20px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e1); }
.dx-campos h4 { margin-top: 1.5em; font-family: var(--display); font-size: 1rem; font-weight: 720; color: var(--pc-fg); }
.dx-campos h4:first-child { margin-top: 0.9em; }
.dx-campos p, .dx-campos ul { margin-top: 0.5em; font-size: 0.97rem; }

/* ---------- captura anotada ---------- */
.dx-shot { margin: 1.6em 0 0; }
.dx-shot-win { overflow: hidden; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e3); }
.dx-shot-bar { display: flex; align-items: center; gap: 6px; padding: 9px 14px; background: var(--bg-2); font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.dx-shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
:root[data-theme="dark"] .dx-shot-bar i { background: rgb(255 255 255 / 0.22); }
.dx-shot-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-shot-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.dx-shot-stage { position: relative; }
.dx-hint { display: none; }
@media (max-width: 700px) {
  .dx-shot-stage { min-width: 760px; }
  .dx-hint { display: inline; }
}
.dx-shot-stage img { width: 100%; height: auto; outline: 1px solid var(--outline); outline-offset: -1px; }
.dx-pin { position: absolute; left: var(--x); top: var(--y); z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: var(--pc-solid); color: #fff; font-size: 0.8rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; cursor: pointer; translate: -50% -50%; scale: 1; box-shadow: 0 0 0 3px rgb(255 255 255 / 0.92), 0 3px 8px rgb(20 33 66 / 0.35); transition: scale var(--quick) var(--ease-out), box-shadow var(--quick) var(--ease-out); }
.dx-pin::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; }
.dx-pin:hover, .dx-pin.is-on { scale: 1.18; box-shadow: 0 0 0 3px #fff, 0 0 0 6px color-mix(in oklab, var(--pc-solid) 35%, transparent), 0 4px 10px rgb(20 33 66 / 0.4); }
.dx-pin:active { scale: 0.96; }
.dx-prosa .dx-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin-top: 14px; padding: 0; list-style: none; max-width: none; }
.dx-legend li { display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; transition: background-color var(--quick) var(--ease-out); }
.dx-legend li.is-on { background: var(--pc-50); }
.dx-n { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--pc-solid); color: #fff; font-size: 0.8rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.dx-legend strong { display: block; font-size: 0.98rem; line-height: 1.3; }
.dx-legend p { margin-top: 2px; max-width: none; font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); }
.dx-shot figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }

/* ---------- mapa del portal ---------- */
.dx-mapa { display: grid; gap: 28px; margin-top: 4px; }
.dx-mapa-g h3 { font-size: 1.05rem; }
.dx-mapa ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; margin-top: 10px; padding: 0; list-style: none; max-width: none; }
.dx-mapa li { margin: 0; }
.dx-mapa a, .dx-mapa .is-pend > div { position: relative; display: block; height: 100%; padding: 14px 44px 14px 16px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--e1); text-decoration: none; color: var(--ink); font-weight: 400; transition: box-shadow var(--fast) var(--ease-out), background-color var(--quick) var(--ease-out); }
.dx-mapa a:hover { box-shadow: var(--e2); background: var(--pc-50); }
.dx-mapa strong { display: block; font-size: 1rem; line-height: 1.3; }
.dx-mapa span { display: block; margin-top: 3px; font-size: 0.88rem; line-height: 1.45; color: var(--muted); }
.dx-go { position: absolute; right: 14px; top: 50%; translate: 0 -50%; color: var(--pc-fg); transition: transform var(--fast) var(--ease-out); }
.dx-mapa a:hover .dx-go { transform: translateX(3px); }
.dx-mapa .is-pend > div { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.dx-mapa .is-pend strong { color: var(--muted); font-weight: 600; }

/* ---------- anterior / siguiente ---------- */
.dx-vecinos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.dx-vecinos a { display: block; padding: 16px 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e1); text-decoration: none; color: var(--ink); transition: box-shadow var(--fast) var(--ease-out), background-color var(--quick) var(--ease-out); }
.dx-vecinos a:hover { box-shadow: var(--e2); background: var(--pc-50); }
.dx-vecinos small { display: block; font-size: 0.82rem; color: var(--muted); }
.dx-vecinos strong { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; font-family: var(--display); font-size: 1.05rem; }
.dx-vecinos .ico { color: var(--pc-fg); transition: transform var(--fast) var(--ease-out); }
.dx-nav-s { text-align: right; }
.dx-nav-s strong { justify-content: flex-end; }
.dx-nav-s:hover .ico { transform: translateX(3px); }
.dx-nav-a:hover .ico { transform: scaleX(-1) translateX(3px); }
.dx-flip { transform: scaleX(-1); }

/* ---------- inicio de la documentación ---------- */
.dx-home { max-width: 1240px; margin-inline: auto; padding: 48px clamp(16px, 4vw, 40px) 72px; outline: none; }
.dx-home-head { max-width: 760px; }
.dx-home-search { display: flex; align-items: center; gap: 12px; width: min(100%, 520px); min-height: 56px; margin-top: 26px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--e2), inset 0 0 0 1.5px var(--violet-100); color: var(--muted); font-size: 1.02rem; text-align: left; cursor: pointer; transition: box-shadow var(--fast) var(--ease-out); }
.dx-home-search:hover { box-shadow: var(--e3), inset 0 0 0 1.5px var(--violet); }
.dx-home-search span { flex: 1; }
.dx-home-search .ico { color: var(--violet-fg); width: 1.35em; height: 1.35em; }
.dx-home-portales { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; margin-top: 48px; }
.dx-portal-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--e2); grid-column: span 6; transition: box-shadow var(--fast) var(--ease-out); }
.dx-portal-card:hover { box-shadow: var(--e3); }
.dx-portal-card:first-child { grid-column: span 12; flex-direction: row; }
.dx-portal-img { display: block; flex: 0 0 56%; background: var(--bg-2); }
.dx-portal-card:not(:first-child) .dx-portal-img { flex: none; aspect-ratio: 16 / 9; }
.dx-portal-img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; outline: 1px solid var(--outline); outline-offset: -1px; }
.dx-portal-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: clamp(20px, 3vw, 36px); }
.dx-portal-body h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 750; }
.dx-portal-card .dx-chip { background: var(--pc-solid); }
.dx-portal-card[data-portal="empresa"] { --pc-solid: #5b45e0; --pc-fg: var(--violet-fg); }
.dx-portal-card[data-portal="colaborador"] { --pc-solid: #07675f; --pc-fg: var(--teal-ink); }
.dx-portal-card[data-portal="cliente"] { --pc-solid: #cc440b; --pc-fg: var(--orange-ink); }
.dx-portal-para { color: var(--ink-2); }
.dx-portal-links { display: grid; gap: 4px; padding: 0; list-style: none; }
.dx-portal-links a { font-weight: 600; color: var(--pc-fg); text-decoration: none; }
.dx-portal-links a:hover { text-decoration: underline; }
.dx-portal-body .btn { margin-top: auto; }
.dx-home-prosa { max-width: 860px; margin-top: 64px; }

/* ---------- búsqueda ---------- */
.dx-search { width: min(640px, calc(100% - 24px)); max-height: min(560px, 80dvh); margin: 12dvh auto auto; padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--e3), 0 0 0 1px var(--line); overflow: hidden; }
.dx-search[open] { display: flex; flex-direction: column; animation: dx-in 180ms var(--ease-out); }
.dx-search::backdrop { background: rgb(20 33 66 / 0.45); backdrop-filter: blur(3px); }
@keyframes dx-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.dx-search-field { display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); }
.dx-search-field .ico { color: var(--muted); width: 1.4em; height: 1.4em; }
.dx-search-field input { flex: 1; min-width: 0; height: 60px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.08rem; outline: none; }
.dx-search-field input::placeholder { color: var(--muted); }
.dx-search-field input::-webkit-search-cancel-button { display: none; }
.dx-search-x { padding: 4px 8px; border: 0; border-radius: 8px; background: var(--bg-2); color: var(--muted); font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.dx-res { flex: 1; overflow-y: auto; margin: 0; padding: 8px; list-style: none; }
.dx-res a { display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.dx-res a:hover, .dx-res a.is-sel { background: var(--violet-50); }
.dx-res strong { display: block; font-size: 0.98rem; line-height: 1.3; }
.dx-res small { display: block; margin-top: 1px; font-size: 0.8rem; color: var(--muted); }
.dx-res p { margin-top: 3px; font-size: 0.86rem; line-height: 1.45; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dx-res mark { background: var(--violet-100); color: inherit; border-radius: 3px; padding: 0 1px; }
.dx-search-pie { padding: 10px 18px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }

/* ---------- pie ---------- */
.dx-foot { padding: 28px 0 36px; border-top: 1px solid var(--line); background: var(--band-1); color: var(--muted); font-size: 0.88rem; }
.dx-foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; max-width: 1680px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 28px); }

/* ---------- pantallas medianas y pequeñas ---------- */
@media (max-width: 1240px) {
  .dx-shell, .dx-shell:not(:has(.dx-toc)) { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .dx-toc { display: none; }
}
@media (max-width: 1100px) {
  .dx-search-txt, .dx-search-btn kbd { display: none; }
  .dx-search-btn { padding: 0 12px; }
  .dx-sitio { display: none; }
}
@media (max-width: 900px) {
  .dx-shell, .dx-shell:not(:has(.dx-toc)) { display: block; }
  .dx-menu-btn { display: grid; }
  .dx-side { position: fixed; z-index: 45; top: var(--bar-h); left: 0; bottom: 0; width: min(340px, 88vw); height: auto; padding: 16px 12px 32px; background: var(--surface); box-shadow: var(--e3); translate: -102% 0; visibility: hidden; transition: translate var(--fast) var(--ease-out), visibility 0s linear var(--fast); }
  body.dx-menu-abierto .dx-side { translate: 0 0; visibility: visible; transition: translate var(--fast) var(--ease-out), visibility 0s; }
  body.dx-menu-abierto::after { content: ""; position: fixed; inset: var(--bar-h) 0 0 0; z-index: 44; background: rgb(20 33 66 / 0.4); }
  .dx-side-portales { display: flex; gap: 6px; margin-bottom: 12px; }
  .dx-side-portales a { flex: 1; display: grid; place-items: center; min-height: 44px; border-radius: 10px; background: var(--bg-2); font-size: 0.88rem; font-weight: 650; color: var(--ink-2); text-decoration: none; }
  .dx-side-portales a.is-current { background: var(--pc-50); color: var(--pc-fg); }
  .dx-portals { display: none; }
  .dx-top .brand { margin-right: auto; }
  .dx-doc-label { display: none; }
  .dx-legend { grid-template-columns: 1fr; }
  .dx-home-portales { grid-template-columns: 1fr; }
  .dx-portal-card, .dx-portal-card:first-child { grid-column: auto; flex-direction: column; }
  .dx-portal-img, .dx-portal-card:first-child .dx-portal-img { flex: none; aspect-ratio: 16 / 9; }
}
@media (max-width: 560px) {
  body.dx { font-size: 1rem; }
  .dx-art { padding-top: 20px; }
  .dx-vecinos { grid-template-columns: 1fr; }
  .dx-nav-s, .dx-nav-s strong { text-align: left; justify-content: flex-start; }
  .dx-pin { width: 22px; height: 22px; font-size: 0.7rem; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.92), 0 2px 6px rgb(20 33 66 / 0.35); }
  .dx-shot-win { margin-inline: -8px; border-radius: 12px; }
  .dx-search { margin-top: 8dvh; }
  .dx-top .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dx *, .dx *::before, .dx *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Ampliar captura ---------- */
.dx-shot-win { position: relative; }
.dx-zoom { position: absolute; top: 3px; right: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 0.78rem; font-weight: 650; cursor: pointer; transition: background-color var(--quick) var(--ease-out), color var(--quick) var(--ease-out), scale var(--quick) var(--ease-out); }
.dx-zoom:hover { background: var(--surface); color: var(--ink); }
.dx-zoom:active { scale: 0.96; }
.dx-zoom .ico { width: 15px; height: 15px; }
.dx-zoom::after { content: ""; position: absolute; inset: -7px -4px; }
.dx-lightbox { width: min(96vw, 1720px); max-width: none; max-height: 94vh; padding: 0; border: 0; border-radius: var(--r-md); background: var(--surface); color: var(--ink); box-shadow: var(--e3); overflow: hidden; }
.dx-lightbox::backdrop { background: oklch(0.2 0.02 270 / 0.72); }
.dx-lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; background: var(--bg-2); font-size: 0.86rem; font-weight: 650; color: var(--muted); }
.dx-lightbox-x { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.dx-lightbox-x:hover { background: var(--line); }
.dx-lightbox-img { max-height: calc(94vh - 60px); overflow: auto; }
.dx-lightbox-img img { display: block; width: 100%; height: auto; outline: 1px solid var(--outline); outline-offset: -1px; }
@media (hover: none) { .dx-zoom span { display: none; } .dx-zoom { min-width: 36px; justify-content: center; } }

/* ---------- Preguntas frecuentes ---------- */
.dx-ayuda .dx-prosa { max-width: 820px; }
.dx-faq { margin: 10px 0; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.dx-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 12px 18px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.dx-faq summary::-webkit-details-marker { display: none; }
.dx-faq summary .ico { flex: none; width: 1.2em; height: 1.2em; transition: rotate var(--quick) var(--ease-out); }
.dx-faq[open] summary .ico { rotate: 180deg; }
.dx-faq summary:hover { color: var(--pc-fg); }
.dx-faq-c { padding: 0 18px 16px; color: var(--ink-2); line-height: 1.65; }
.dx-faq-c > * + * { margin-top: 0.7em; }

/* ================= Estructura visual: aprovechar el ancho, centrar y respirar ================= */
:root { --measure: 74ch; }
body.dx h1, body.dx h2, body.dx h3, .dx-portal-body h2, .dx-toc-t { text-wrap: balance; }
.dx-prosa p, .dx-prosa li, .dx-lead, .dx-faq-c p { text-wrap: pretty; }
.dx-prosa td, .dx-prosa th, .dx-facts dd { text-wrap: pretty; }
.dx-art { max-width: 1000px; }

/* portada: cabecera centrada, secciones a todo el ancho de la página */
.dx-home { max-width: 1240px; padding-top: clamp(32px, 5vw, 64px); }
.dx-home-head { max-width: 780px; margin-inline: auto; text-align: center; }
.dx-home-head .dx-lead { margin-inline: auto; }
.dx-home-search { margin-inline: auto; }
.dx-home-portales { margin-top: clamp(32px, 5vw, 56px); }
.dx-home-prosa { max-width: none; margin-top: clamp(48px, 7vw, 88px); }
.dx-home-prosa > h2 { margin-top: 0; }
.dx-home-prosa > * + h2 { margin-top: clamp(40px, 5vw, 64px); }
.dx-home-prosa > h2 + * { margin-top: 18px; }
.dx-home-prosa .dx-tabla { max-width: none; }
.dx-home-prosa td:first-child { white-space: normal; }
.dx-home-prosa td:last-child, .dx-home-prosa th:last-child { white-space: nowrap; width: 1%; }

.dx-orden ol, .dx-ideas, .dx-enlaces ul { display: grid; gap: 16px; padding: 0; list-style: none; max-width: none; }
.dx-orden ol { grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: orden; }
.dx-orden li { position: relative; counter-increment: orden; padding: 52px 20px 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e1); line-height: 1.55; }
.dx-orden li::before { content: counter(orden); position: absolute; left: 20px; top: 16px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--violet-50); color: var(--violet-fg); font-size: 0.86rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.dx-orden li strong { display: block; margin-bottom: 4px; }
.dx-ideas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dx-ideas p { max-width: none; padding: 22px 22px 24px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e1), inset 0 3px 0 var(--acento, var(--violet)); line-height: 1.6; color: var(--ink-2); }
.dx-ideas p:nth-child(2) { --acento: var(--teal); }
.dx-ideas p:nth-child(3) { --acento: var(--orange); }
.dx-ideas p > strong:first-child { display: block; margin-bottom: 6px; font-size: 1.05rem; line-height: 1.3; }
.dx-enlaces ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dx-enlaces li { display: block; padding: 18px 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--e1); line-height: 1.5; color: var(--ink-2); transition: box-shadow var(--quick) var(--ease-out); }
.dx-enlaces li:hover { box-shadow: var(--e2); }
.dx-enlaces li a { display: block; margin-bottom: 2px; font-size: 1.05rem; }
.dx-enlaces li::marker { content: none; }

/* preguntas frecuentes y glosario: una columna centrada y con aire */
.dx-ayuda { max-width: 1000px; }
.dx-ayuda .dx-prosa { max-width: none; margin-top: 36px; }
.dx-ayuda .dx-prosa h2 { margin-top: 2em; margin-bottom: 0.5em; font-size: clamp(1.25rem, 2vw, 1.5rem); }
.dx-ayuda .dx-prosa > h2:first-child { margin-top: 0; }
.dx-ayuda .dx-faq { max-width: none; }
.dx-ayuda .dx-faq-c p { max-width: 68ch; }
.dx-faq { transition: box-shadow var(--quick) var(--ease-out); }
.dx-faq:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--violet) 35%, var(--line)); }
.dx-faq summary { transition: background-color var(--quick) var(--ease-out); border-radius: var(--r-md); }
.dx-faq summary:active { background: var(--bg-2); }
.dx-ayuda .dx-prosa td:first-child { width: 28%; min-width: 150px; white-space: normal; }
.dx-ayuda .dx-prosa td:last-child { white-space: normal; }

/* "En esta página" plegable (pantallas sin índice lateral) */
.dx-toc-m { display: none; margin-top: 22px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.dx-toc-m summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; list-style: none; font-weight: 700; color: var(--ink); cursor: pointer; border-radius: var(--r-md); transition: background-color var(--quick) var(--ease-out); -webkit-tap-highlight-color: transparent; }
.dx-toc-m summary::-webkit-details-marker { display: none; }
.dx-toc-m summary:active { background: var(--bg-2); }
.dx-toc-m summary span { flex: 1; }
.dx-toc-m summary b { min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); color: var(--muted); font-size: 0.78rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.dx-toc-m summary .ico { width: 1.2em; height: 1.2em; color: var(--muted); transition: rotate var(--quick) var(--ease-out); }
.dx-toc-m[open] summary .ico { rotate: 180deg; }
.dx-toc-m ul { display: grid; padding: 0 8px 10px; list-style: none; }
.dx-toc-m a { display: flex; align-items: center; min-height: 44px; padding: 6px 10px; border-radius: 10px; color: var(--ink-2); font-size: 0.96rem; line-height: 1.35; text-decoration: none; }
.dx-toc-m a:hover, .dx-toc-m a:active { background: var(--bg-2); color: var(--pc-fg, var(--ink)); }
.dx-toc-m .n3 a { padding-left: 26px; font-size: 0.9rem; color: var(--muted); }

/* tacto: respuesta al presionar */
.dx .btn, .dx-search-btn, .theme-btn, .dx-menu-btn, .dx-lightbox-x { transition-property: background-color, color, box-shadow, scale; transition-duration: var(--quick); transition-timing-function: var(--ease-out); }
.dx .btn:active, .dx-search-btn:active, .theme-btn:active, .dx-menu-btn:active, .dx-lightbox-x:active { scale: 0.96; }

@media (max-width: 1240px) {
  .dx-toc-m { display: block; }
}
@media (max-width: 1100px) {
  .dx-orden ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dx-ideas { grid-template-columns: 1fr; }
  .dx-enlaces ul { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dx-art { max-width: 760px; }
  .dx-ayuda { max-width: 760px; }
}
@media (max-width: 560px) {
  .dx-art, .dx-home, .dx-ayuda { padding-inline: 16px; }
  .dx-home { padding-top: 24px; padding-bottom: 48px; }
  .dx-home-head { text-align: left; margin-inline: 0; }
  .dx-home-head .dx-lead { margin-inline: 0; }
  .dx-home-search { margin-inline: 0; width: 100%; }
  .dx-orden ol { grid-template-columns: 1fr; gap: 10px; }
  .dx-orden li { padding: 16px 16px 16px 60px; }
  .dx-orden li::before { left: 16px; top: 16px; }
  .dx-ideas p { padding: 18px; }
  .dx-faq summary { padding: 12px 14px; }
  .dx-faq-c { padding: 0 14px 14px; }
  .dx-ayuda .dx-prosa td:first-child { width: auto; min-width: 0; }
  .dx-ayuda .dx-prosa th, .dx-ayuda .dx-prosa td { padding: 10px 12px; }
  .dx-facts { margin-top: 18px; }
}

/* ================= Secciones y apartados plegables ================= */
:root { --acc-expand: 250ms; --acc-collapse: 250ms; --acc-chevron: 250ms; --acc-ease: cubic-bezier(0.22, 1, 0.36, 1); }
.dx-art { max-width: 960px; }
.dx-lead { max-width: 72ch; }
.dx-prosa .dx-s2-c p, .dx-prosa .dx-s2-c ul, .dx-prosa .dx-s2-c ol, .dx-prosa .dx-pasos { max-width: none; }

/* mecánica: la altura se anima con grid 0fr -> 1fr (sin medir con JS) */
.dx-ap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--acc-collapse) var(--acc-ease); }
.dx-acc[data-open="true"] > .dx-ap { grid-template-rows: 1fr; transition: grid-template-rows var(--acc-expand) var(--acc-ease); }
.dx-ap-inner { min-height: 0; overflow: hidden; visibility: hidden; opacity: 0; filter: blur(2px); transition: opacity var(--acc-collapse) var(--acc-ease), filter var(--acc-collapse) var(--acc-ease), visibility 0s linear var(--acc-collapse); }
.dx-acc[data-open="true"] > .dx-ap > .dx-ap-inner { visibility: visible; opacity: 1; filter: blur(0); transition: opacity var(--acc-expand) var(--acc-ease), filter var(--acc-expand) var(--acc-ease), visibility 0s; }
.dx-ac-chev { display: inline-flex; transform: scaleY(1); transform-origin: center; transition: transform var(--acc-chevron) var(--acc-ease); }
.dx-ac-chev svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dx-ac-chev path { vector-effect: non-scaling-stroke; }
.dx-acc[data-open="true"] > h2 .dx-ac-chev, .dx-acc[data-open="true"] > h3 .dx-ac-chev { transform: scaleY(-1); }

/* etiqueta que dice qué hará el botón */
.dx-lbl { display: inline-grid; }
.dx-lbl > span { grid-area: 1 / 1; text-align: right; }
.dx-lbl-off { visibility: hidden; }
.dx-acc[data-open="false"] > h2 .dx-lbl-on, .dx-acc[data-open="false"] > h3 .dx-lbl-on { visibility: hidden; }
.dx-acc[data-open="false"] > h2 .dx-lbl-off, .dx-acc[data-open="false"] > h3 .dx-lbl-off { visibility: visible; }

/* barra de herramientas */
.dx-acc-tools { display: flex; justify-content: flex-end; gap: 4px; margin-top: 2em; padding: 3px; width: max-content; margin-left: auto; border-radius: 999px; background: var(--bg-2); }
.dx-acc-tools button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 0.84rem; font-weight: 650; cursor: pointer; transition: background-color var(--quick) var(--ease-out), color var(--quick) var(--ease-out), box-shadow var(--quick) var(--ease-out), scale var(--quick) var(--ease-out); }
.dx-acc-tools button:hover { background: var(--surface); color: var(--ink); box-shadow: var(--e1); }
.dx-acc-tools button:active { scale: 0.96; }

/* nivel 1: cada sección es una tarjeta con encabezado que se puede pulsar */
.dx-s2 { margin-top: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--e1), inset 0 0 0 1px var(--line); }
.dx-acc-tools + .dx-s2 { margin-top: 12px; }
.dx-prosa h2.dx-s2-h, .dx-s2 > h2 { margin: 0; font-size: inherit; line-height: inherit; letter-spacing: 0; }
.dx-s2-head { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px 18px 14px 24px; border: 0; border-radius: var(--r-lg); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--quick) var(--ease-out); -webkit-tap-highlight-color: transparent; }
.dx-s2-head:hover { background: color-mix(in oklab, var(--bg-2) 55%, transparent); }
.dx-s2-head:focus-visible, .dx-s3-head:focus-visible, .dx-acc-tools button:focus-visible { outline: 2px solid var(--pc-fg, var(--violet)); outline-offset: 2px; }
.dx-s2-title { flex: 1; min-width: 0; font-size: clamp(1.25rem, 2vw, 1.55rem); font-weight: 750; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.dx-s2-meta { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--muted); font-size: 0.8rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.dx-s2-toggle { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 16px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-size: 0.86rem; font-weight: 700; transition: background-color var(--quick) var(--ease-out), color var(--quick) var(--ease-out), scale var(--quick) var(--ease-out); }
.dx-s2-toggle .dx-ac-chev { width: 18px; height: 18px; }
.dx-s2-head:hover .dx-s2-toggle { background: var(--pc-50, var(--violet-50)); color: var(--pc-fg, var(--violet-fg)); }
.dx-s2-head:active .dx-s2-toggle { scale: 0.96; }
.dx-s2-c { padding: 4px 24px 28px; border-top: 1px solid var(--line); }
.dx-s2-c > * + * { margin-top: 1.1em; }
.dx-s2-c > :first-child { margin-top: 22px; }

/* nivel 2: cada apartado es una fila dentro de la tarjeta, con una guía a la izquierda */
.dx-accion { margin-top: 0; padding-top: 0; border-top: 1px solid var(--line); }
.dx-s2-c > .dx-accion:first-child { border-top: 0; margin-top: 4px; }
.dx-prosa > .dx-accion:first-of-type { margin-top: 0; }
.dx-accion > * + * { margin-top: 0; }
.dx-prosa h3.dx-s3-h, .dx-accion > h3 { margin: 0; font-size: inherit; line-height: inherit; letter-spacing: 0; }
.dx-s3-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 6px 12px 0; border: 0; border-radius: var(--r-sm, 10px); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dx-s3-title { flex: 1; min-width: 0; font-size: clamp(1.1rem, 1.7vw, 1.28rem); font-weight: 720; line-height: 1.3; letter-spacing: -0.015em; text-wrap: balance; transition: color var(--quick) var(--ease-out); }
.dx-s3-head:hover .dx-s3-title { color: var(--pc-fg, var(--violet-fg)); }
.dx-s3-toggle { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.82rem; font-weight: 650; transition: color var(--quick) var(--ease-out); }
.dx-s3-toggle .dx-ac-chev { display: grid; place-items: center; width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--bg-2); transition: transform var(--acc-chevron) var(--acc-ease), background-color var(--quick) var(--ease-out), scale var(--quick) var(--ease-out); }
.dx-s3-head:hover .dx-s3-toggle { color: var(--pc-fg, var(--violet-fg)); }
.dx-s3-head:hover .dx-ac-chev { background: var(--pc-50, var(--violet-50)); }
.dx-s3-head:active .dx-ac-chev { scale: 0.92; }
.dx-s3-c { margin: 2px 0 22px 6px; padding-left: 18px; border-left: 2px solid color-mix(in oklab, var(--pc-fg, var(--violet)) 22%, var(--line)); }
.dx-s3-c > * + * { margin-top: 1em; }

@media (max-width: 700px) {
  .dx-s2-meta { display: none; }
  .dx-s2-head { min-height: 64px; gap: 10px; padding: 12px 12px 12px 16px; }
  .dx-s2-toggle { padding: 0 8px 0 12px; min-height: 36px; font-size: 0.82rem; }
  .dx-s2-c { padding: 2px 14px 22px; }
  .dx-s2-c > :first-child { margin-top: 16px; }
  .dx-s3-c { margin-left: 2px; padding-left: 12px; }
  .dx-acc-tools { margin-inline: 0 0; width: 100%; justify-content: stretch; }
  .dx-acc-tools button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dx-ap, .dx-ap-inner, .dx-ac-chev { transition: none !important; }
}
