/* Konomic · Área de Cliente — sistema de diseño (v0 aprobado, brand-spec.md).
   Marca #192942; derivados oklch tono ~258°; Outfit (titulares), IBM Plex Sans
   (texto), IBM Plex Mono (NIF, CSV, SHA-256, identificadores). Base 8 px,
   radios 10/8 px, dos sombras, 160–220 ms cubic-bezier(.2,.7,.2,1).
   Sin estilos en línea (CSP style-src 'self'). */

/* ── Fuentes (alojadas aquí: sin peticiones a terceros) ── */
@font-face { font-family: "Outfit"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/outfit-latin-500-normal.c5138e4c72ea.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/outfit-latin-600-normal.778dd8bec372.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.77bc02670657.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.f7016cd446d2.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.79936b18df9f.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.b1c8a895f5fd.woff2") format("woff2"); }

/* ── Tokens ── */
:root {
  color-scheme: light;
  --brand: #192942;
  --ink: oklch(24% 0.045 258);
  --ink-2: oklch(42% 0.035 258);
  --muted: oklch(52% 0.02 258);          /* ≥ 4.8:1 también sobre superficies tintadas */
  --line: oklch(90.5% 0.008 258);
  --line-strong: oklch(82% 0.012 258);   /* separadores decorativos */
  --line-ctl: oklch(62% 0.02 258);       /* bordes de controles: ≥ 3:1 (WCAG 1.4.11) */
  --bg: oklch(98.4% 0.005 85);
  --surface: #fff;
  --surface-2: oklch(97% 0.006 258);
  --primary: var(--brand);
  --primary-hover: oklch(34% 0.06 258);
  --on-primary: #fff;
  --danger: oklch(55% 0.18 27);
  --on-danger: #fff;
  --danger-soft: oklch(96% 0.025 27);
  --warn: oklch(72% 0.14 70);
  --warn-soft: oklch(97% 0.035 85);
  --ok: oklch(56% 0.11 160);
  --ok-soft: oklch(96.5% 0.03 160);
  --focus: var(--ink);
  --r-card: 10px; --r-ctl: 8px;
  --sh-1: 0 1px 2px oklch(24% 0.045 258 / .06), 0 1px 1px oklch(24% 0.045 258 / .04);
  --sh-2: 0 12px 40px oklch(24% 0.045 258 / .16), 0 2px 8px oklch(24% 0.045 258 / .08);
  --ease: cubic-bezier(.2,.7,.2,1);
  --f-head: "Outfit", ui-sans-serif, sans-serif;
  --f-body: "IBM Plex Sans", ui-sans-serif, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  --topbar-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: oklch(88% 0.03 258);
    --ink: oklch(94% 0.01 258);
    --ink-2: oklch(80% 0.02 258);
    --muted: oklch(68% 0.02 258);
    --line: oklch(32% 0.02 258);
    --line-strong: oklch(40% 0.025 258);
    --line-ctl: oklch(55% 0.025 258);
    --bg: oklch(17% 0.02 258);
    --surface: oklch(21% 0.022 258);
    --surface-2: oklch(24% 0.022 258);
    --primary: oklch(86% 0.035 258);
    --primary-hover: oklch(92% 0.025 258);
    --on-primary: oklch(20% 0.04 258);
    --danger: oklch(68% 0.16 27);
    --on-danger: oklch(18% 0.04 27);
    --danger-soft: oklch(28% 0.06 27);
    --warn-soft: oklch(29% 0.05 75);
    --ok: oklch(70% 0.11 160);
    --ok-soft: oklch(28% 0.04 160);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: oklch(88% 0.03 258);
  --ink: oklch(94% 0.01 258);
  --ink-2: oklch(80% 0.02 258);
  --muted: oklch(68% 0.02 258);
  --line: oklch(32% 0.02 258);
  --line-strong: oklch(40% 0.025 258);
  --line-ctl: oklch(55% 0.025 258);
  --bg: oklch(17% 0.02 258);
  --surface: oklch(21% 0.022 258);
  --surface-2: oklch(24% 0.022 258);
  --primary: oklch(86% 0.035 258);
  --primary-hover: oklch(92% 0.025 258);
  --on-primary: oklch(20% 0.04 258);
  --danger: oklch(68% 0.16 27);
  --on-danger: oklch(18% 0.04 27);
  --danger-soft: oklch(28% 0.06 27);
  --warn-soft: oklch(29% 0.05 75);
  --ok: oklch(70% 0.11 160);
  --ok-soft: oklch(28% 0.04 160);
}

/* ── Base ── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body { font: 15px/1.55 var(--f-body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(26px, 2.4vw, 32px); line-height: 1.15; }
h2 { font-size: 19px; line-height: 1.3; }
h3 { font-size: 15px; font-family: var(--f-body); font-weight: 600; letter-spacing: 0; }
p { margin: 0; text-wrap: pretty; }
.mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Foco visible: anillo sólido de 2 px con el color de tinta (contraste alto
   sobre papel, superficie y botones); respeta forced-colors. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; border-color: var(--ink); }
.btn-primary:focus-visible, .btn-danger:focus-visible { outline-offset: 3px; }

.skip-link { position: absolute; left: -999px; top: 12px; z-index: 50; padding: 10px 14px; border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); box-shadow: var(--sh-2); font-weight: 600; }
.skip-link:focus { left: 16px; }

/* ── Shell ── */
.topbar { position: sticky; top: 0; z-index: 5; min-height: var(--topbar-h); display: flex; align-items: center; gap: 18px; padding: 0 24px; background: color-mix(in oklch, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.lockup { display: flex; align-items: center; gap: 12px; color: var(--brand); text-decoration: none; min-height: 44px; }
.lockup .sym { height: 26px; width: auto; fill: currentColor; }
.lockup .word { height: 11px; width: auto; fill: currentColor; }
.lockup .sep { width: 1px; height: 18px; background: var(--line-strong); }
.lockup .area { font: 500 13px var(--f-body); color: var(--ink-2); }
.topbar .spacer { flex: 1; }
.org { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font: 600 12px var(--f-body); color: var(--ink); flex: none; }

.menu { position: relative; }
.menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 6px 4px 10px; border-radius: var(--r-ctl); cursor: pointer; color: var(--ink-2); font-size: 13px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin: 0 4px 0 2px; }
.menu[open] > summary { background: var(--surface-2); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-2); display: grid; gap: 2px; z-index: 10; }
.menu-panel .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.menu-panel .menu-head strong { display: block; color: var(--ink); font-weight: 600; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; min-height: 40px; padding: 8px 10px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink); font: 500 14px var(--f-body); text-align: left; text-decoration: none; cursor: pointer; }
.menu-panel form { margin: 0; }
.menu-panel .menu-label { padding: 10px 10px 4px; font: 600 11px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.menu-panel [aria-current="true"] { background: var(--surface-2); }
.menu-panel [aria-current="true"] .muted, .menu-panel .nif-org { color: var(--ink-2); }

.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.side { border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; }
.side h2.side-title { margin: 0 8px 8px; font: 600 11px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.steps, .nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps > li, .nav-list > li { position: relative; }  /* contiene los .sr-only: sin desbordar la página */
.step-link { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 9px 10px; border-radius: var(--r-ctl); color: var(--ink-2); font: 500 14px var(--f-body); text-decoration: none; transition: background .16s var(--ease); }
a.step-link[aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.step-link.is-disabled { opacity: .55; cursor: not-allowed; }
.dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 600 11px var(--f-mono); border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--surface); }
.is-done .dot { background: var(--ink); border-color: var(--ink); color: var(--bg); }
[aria-current="step"] .dot { border-color: var(--ink); color: var(--ink); }
.side .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; }

main { padding: 40px clamp(20px, 4vw, 56px) 80px; }
main:focus { outline: none; }
.screen { max-width: 860px; }
.screen.wide { max-width: 1120px; }
.eyebrow { font: 600 11px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.lede { margin-top: 10px; color: var(--ink-2); max-width: 62ch; font-size: 16px; }
.stack { display: grid; gap: 16px; }
.head { margin-bottom: 28px; }
.head-row { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }

/* Páginas públicas (acceso, alta, 2FA): una columna centrada */
.publico { min-height: calc(100vh - var(--topbar-h)); display: grid; justify-items: center; align-content: start; padding: clamp(32px, 7vh, 72px) 16px 64px; }
.publico .screen { width: min(100%, 520px); }
.publico .screen.medio { width: min(100%, 640px); }
.publico .pie { margin-top: 32px; font-size: 12px; color: var(--muted); text-align: center; }

/* ── Tarjetas y formularios ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-1); }
.card-pad { padding: 24px; }
.card + .card { margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field legend { font: 500 13px var(--f-body); color: var(--ink-2); padding: 0; }
.field .helptext { font-size: 12px; color: var(--muted); }
.field fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.field-error { display: flex; gap: 6px; align-items: baseline; margin: 0; font-size: 13px; color: var(--danger); font-weight: 500; }
.field-error::before { content: "!"; flex: none; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--danger); color: var(--on-danger); font: 700 11px/1 var(--f-body); transform: translateY(2px); }
.form-stack { display: grid; gap: 20px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], input[type="number"], select, textarea { min-height: 44px; width: 100%; padding: 0 12px; border: 1px solid var(--line-ctl); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: 400 16px var(--f-body); transition: border-color .16s, box-shadow .16s; }
textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.input-nif { max-width: 16ch; font-family: var(--f-mono); letter-spacing: .02em; text-transform: uppercase; }
.input-otp { max-width: 11ch; font-family: var(--f-mono); letter-spacing: .3em; text-align: center; font-size: 20px; }
.input-recuperacion { max-width: 26ch; font-family: var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.pass-wrap { display: flex; gap: 8px; align-items: stretch; }
.pass-wrap input { flex: 1; }
.pass-wrap .btn { flex: none; height: auto; min-height: 44px; }

/* Radio/checkbox como tarjetas (patrón .check del v0) */
.choices { display: grid; gap: 8px; }
.choices.inline { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-ctl); cursor: pointer; transition: border-color .16s, background .16s; background: var(--surface); }
.check:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.check:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.check small { display: block; color: var(--muted); margin-top: 2px; }
.check:has(input[aria-invalid="true"]) { border-color: var(--danger); border-width: 2px; }
.is-invalid .choices .check { border-color: var(--danger); }
.helptext-check { margin-left: 48px; }
.check input { flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-ctl); border: 1px solid transparent; font: 600 14px var(--f-body); cursor: pointer; transition: background .16s var(--ease), transform .08s, opacity .16s; text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-ctl); }
.btn-danger { background: var(--danger); color: var(--on-danger); }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn .spin { display: none; }
.btn[aria-busy="true"] .spin { display: inline-block; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.actions.tight { margin-top: 0; }

.note { display: grid; grid-template-columns: 4px 1fr; gap: 14px; padding: 14px 16px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.note::before { content: ""; border-radius: 2px; background: var(--line-strong); }
.note.warn { background: var(--warn-soft); color: var(--ink); } .note.warn::before { background: var(--warn); }
.note.ok { background: var(--ok-soft); color: var(--ink); } .note.ok::before { background: var(--ok); }
.note.danger { background: var(--danger-soft); color: var(--ink); } .note.danger::before { background: var(--danger); }
.note strong { color: var(--ink); }
.note ul { margin: 6px 0 0; padding-left: 18px; }

ol.flow { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
ol.flow > li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
ol.flow > li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--f-mono); border: 1.5px solid var(--line-strong); color: var(--ink-2); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.status { display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--f-body); padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.ok { background: var(--ok-soft); color: var(--ink); } .status.ok::before { background: var(--ok); }
.status.warn { background: var(--warn-soft); color: var(--ink); } .status.warn::before { background: var(--warn); }
.status.danger { background: var(--danger-soft); color: var(--ink); } .status.danger::before { background: var(--danger); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); flex: none; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.checklist li::before { content: "✓"; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--f-body); background: var(--ok-soft); color: var(--ok); flex: none; }
.checklist li.pending::before { content: "…"; background: var(--surface-2); color: var(--muted); }

.placeholder-chip { font: 500 11px var(--f-mono); padding: 2px 6px; border: 1px dashed var(--line-strong); border-radius: 4px; color: var(--muted); }
.fineprint { font: 400 11px var(--f-mono); color: var(--muted); }

/* ── Tablas y bandeja ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px 20px; }
.stat .n { font: 600 34px/1 var(--f-head); margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat.alert .n { color: var(--danger); }
.toolbar { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar select { min-height: 36px; width: auto; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 11px var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; font: 600 11px var(--f-body); letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; }
.tag.notif { background: var(--danger-soft); color: var(--danger); }
.tag.com { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.due { font-variant-numeric: tabular-nums; }
.due.hot { color: var(--danger); font-weight: 600; }

.doc-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.doc-row:first-child { border-top: 0; }
.doc-ic { width: 40px; height: 48px; border: 1px solid var(--line-strong); border-radius: 4px 10px 4px 4px; display: grid; place-items: end center; padding-bottom: 5px; font: 600 9px var(--f-mono); color: var(--muted); background: var(--surface-2); }
.doc-meta { font-size: 12px; color: var(--muted); }

/* ── Modal (usar <dialog>: trampa de foco y Escape nativos) ── */
dialog.modal { width: min(640px, calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; overflow: auto; overscroll-behavior: contain; background: var(--surface); color: var(--ink); border-radius: 14px; box-shadow: var(--sh-2); }
dialog.modal::backdrop { background: oklch(20% 0.04 258 / .42); }
.modal header { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal .body { padding: 20px 24px; display: grid; gap: 16px; font-size: 14px; }
.modal footer { padding: 16px 24px 22px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.warn-banner { padding: 14px 16px; border-radius: var(--r-ctl); background: var(--danger-soft); color: var(--ink); font-weight: 600; display: grid; grid-template-columns: 4px 1fr; gap: 14px; }
.warn-banner::before { content: ""; background: var(--danger); border-radius: 2px; }
.legal ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }

/* ── Mensajes (región de estado estable) ── */
.mensajes .messages { display: grid; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.mensajes .messages:empty { margin: 0; }  /* nunca display:none: región viva siempre en el árbol */
.message:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.message { grid-template-columns: 4px 1fr auto; align-items: start; }
.message .cerrar { min-height: 32px; min-width: 32px; padding: 0 8px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink-2); font: 500 13px var(--f-body); cursor: pointer; }
.error-summary { margin-bottom: 20px; }

/* ── 2FA ── */
.qr-box { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.qr-frame { padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); width: max-content; }
.qr-frame svg.qr { display: block; width: 184px; height: 184px; }
.secreto { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 15px var(--f-mono); letter-spacing: .06em; overflow-wrap: anywhere; word-break: normal; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--line-ctl); border-radius: var(--r-ctl); user-select: all; }
.secreto span { white-space: nowrap; }
.codigos { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 32px; margin: 0; padding: 16px 20px; list-style: none; background: var(--surface-2); border-radius: var(--r-ctl); font: 500 16px var(--f-mono); letter-spacing: .04em; }
.eventos { list-style: none; margin: 0; padding: 0; display: grid; }
.eventos li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.eventos li:first-child { border-top: 0; }

/* ── Errores ── */
.error-code { font: 600 13px var(--f-mono); color: var(--muted); }

/* ── Interacción: hover solo con puntero fino; movimiento opcional ── */
@media (hover: hover) {
  .step-link:not(.is-disabled):hover, .menu > summary:hover, .menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
  .btn-primary:hover { background: var(--primary-hover); }
  .btn-ghost:hover { background: var(--surface-2); }
  .check:hover { border-color: var(--line-strong); }
  tbody tr:hover { background: var(--surface-2); }
  tbody tr:hover .muted { color: var(--ink-2); }
  .message .cerrar:hover { background: color-mix(in oklch, var(--ink) 8%, transparent); }
}
@media (prefers-reduced-motion: no-preference) {
  .screen { animation: rise .22s var(--ease); }
  dialog.modal[open] { animation: pop .2s var(--ease); }
  .btn:active { transform: translateY(1px); }
  .spin { animation: sp .8s linear infinite; }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sp { to { transform: rotate(360deg); } }
@media (forced-colors: active) {
  .status::before, .dot, .note::before, .warn-banner::before { forced-color-adjust: auto; }
  .btn { border-color: ButtonText; }
}

/* ── Responsivo ── */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 12px; min-width: 0; }
  .steps { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  /* Etiquetas visibles para lectores de pantalla (sr-only, nunca display:none);
     a la vista, la del paso actual y la línea «Paso N de 5 · …». */
  .steps .lbl, .side h2.side-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .steps [aria-current] .lbl { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; }
  .side .foot { display: none; }
  .nav-list { display: flex; flex-wrap: wrap; gap: 2px 8px; }
  .nav-list > li { min-width: 0; }
  .nav-list .motivo { padding: 0 10px 6px; }
  .stats { grid-template-columns: 1fr; }
  .lockup .word, .lockup .sep { display: none; }
  .org-name { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .hide-sm { display: none; }
  .qr-box { grid-template-columns: 1fr; }
  .eventos li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 420px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .lockup .area { display: none; }
  .codigos { grid-template-columns: 1fr; }
  main { padding: 28px 16px 64px; }
}
@media print {
  .topbar, .side, .skip-link, .actions, .mensajes { display: none !important; }
  .layout { display: block; }
  body { background: #fff; }
}
.eyebrow:empty, .lede:empty, .head h1:empty { display: none; }

/* ── Añadidos: pie legal, paso compacto, documentos legales, bandeja ── */
.paso-compacto { display: none; margin: 0 8px; font: 600 13px var(--f-body); color: var(--ink); }
@media (max-width: 900px) { .paso-compacto { display: block; } }
.nav-list .motivo { display: block; padding: 0 10px 6px 44px; }
.pie-legal { margin: 48px auto 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: grid; gap: 4px; max-width: 1120px; }
.publico .pie-legal { width: min(100%, 640px); text-align: center; }
.pie-legal a { color: var(--ink-2); }
.publico .screen.ancho { width: min(100%, 860px); }
.h3 { font-size: 15px; font-family: var(--f-body); font-weight: 600; letter-spacing: 0; }
.espacio-arriba { margin-top: 20px; }
.doc-acciones { margin-bottom: 16px; gap: 16px; }
.lista-pasos { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.doc-detalle { margin: 4px 0 12px 54px; }
.doc-detalle > summary { cursor: pointer; min-height: 32px; font-size: 14px; }
.doc-texto { max-height: 420px; overflow: auto; overscroll-behavior: contain; padding: 12px 16px; border: 1px solid var(--line-ctl); border-radius: var(--r-ctl); background: var(--surface); }
.legal-texto { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.legal-texto h1 { font-size: 22px; margin: 8px 0 12px; }
.legal-texto h2 { font-size: 18px; margin: 24px 0 8px; }
.legal-texto h3, .legal-texto h4 { font-size: 15px; margin: 18px 0 6px; }
.legal-texto p, .legal-texto ul, .legal-texto ol, .legal-texto blockquote, .legal-texto table { margin: 0 0 10px; }
.legal-texto blockquote { padding: 8px 14px; border-left: 3px solid var(--line-ctl); background: var(--surface-2); }
.legal-texto table { display: block; overflow-x: auto; }
.legal-texto code { font-family: var(--f-mono); font-size: .92em; }
mark.destacada { background: var(--warn-soft); color: var(--ink); padding: 0 4px; border-radius: 3px; font-weight: 600; }
.acto + .acto { border-top: 1px solid var(--line); padding-top: 12px; }
.advertencia { white-space: pre-wrap; }
.advertencia-texto { display: grid; gap: 10px; font-size: 14px; }
.advertencia-texto p { margin: 0; }
.instruccion-estado { display: grid; gap: 12px; }
.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filtros .field { min-width: 180px; }
.tabla-envios td .muted { display: block; font-size: 12px; }
.anexo-usuarios td, .anexo-usuarios th { vertical-align: middle; }
.en-linea { display: inline; margin: 0 0 0 8px; }
.check-sola { display: inline-grid; grid-template-columns: 20px; padding: 10px; }
.anexo-usuarios th[scope="row"] .muted { display: block; font-weight: 400; }
.anexo-usuarios select { width: auto; }
.legal-texto th, .legal-texto td { min-width: 12ch; overflow-wrap: normal; word-break: normal; }
.note + .note, .note + section, .note + .card, .note + form { margin-top: 16px; }
@media (max-width: 560px) {
  .doc-row { grid-template-columns: 40px minmax(0, 1fr); }
  .doc-row > :last-child { grid-column: 2; justify-self: start; }
  .doc-detalle { margin-left: 0; }
}
.is-done [aria-current="step"] .dot { color: var(--bg); }
@media (max-width: 560px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dt { margin-top: 8px; }
  .kv dt:first-child { margin-top: 0; }
}
.toolbar select { max-width: 100%; }
.stats .card + .card { margin-top: 0; }
.stack > *, .form-stack > * { min-width: 0; }
.fineprint, .doc-meta, .mono { overflow-wrap: anywhere; }
