/* Element Systems · Licencias
   La misma hoja del sitio: papel frío, tinta casi negra y reglas finas.
   Solo tipografías sans (Plus Jakarta Sans para el texto, Montserrat para la firma); se cargan desde lib/panel.php.
   El único elemento con vida es el avatar de Bismuto. */

:root {
  --paper: #fbfafd;
  --paper-2: #f2f0f7;
  --surface: #fff;
  --ink: #17181a;
  --graphite: #5c5f66;
  --faint: #8d9097;
  --rule: rgba(23, 24, 26, .11);
  --rule-strong: rgba(23, 24, 26, .28);
  --brand: #414897;
  --brand-ink: #343a80;
  --brand-soft: rgba(65, 72, 151, .1);
  --ok: #1d7a4d;
  --warn: #a8650a;
  --bad: #c9373c;
  --ok-bg: rgba(29, 122, 77, .08);
  --warn-bg: rgba(184, 115, 13, .09);
  --bad-bg: rgba(229, 72, 77, .08);
  --bar: #414897;
  --bar-hover: #343a80;
  --shadow: 0 1px 2px rgba(23, 24, 26, .04), 0 12px 32px -18px rgba(23, 24, 26, .28);
  --shadow-pop: 0 2px 4px rgba(23, 24, 26, .04), 0 18px 48px -12px rgba(23, 24, 26, .22);
  --grain-op: .04;
  --grain-blend: multiply;
  --f-display: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  --f-brand: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0f0e14;
  --paper-2: #1b1a22;
  --surface: #17161d;
  --ink: #eceef2;
  --graphite: #9ca0a9;
  --faint: #70747d;
  --rule: rgba(236, 238, 242, .1);
  --rule-strong: rgba(236, 238, 242, .26);
  --brand-ink: #8b85ff;
  --brand-soft: rgba(139, 133, 255, .12);
  --ok: #3ecf8e;
  --warn: #e6a740;
  --bad: #f0686c;
  --ok-bg: rgba(62, 207, 142, .11);
  --warn-bg: rgba(230, 167, 64, .11);
  --bad-bg: rgba(240, 104, 108, .11);
  --bar: #6f69e0;
  --bar-hover: #8b85ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -18px rgba(0, 0, 0, .7);
  --shadow-pop: 0 2px 4px rgba(0, 0, 0, .3), 0 22px 56px -14px rgba(0, 0, 0, .75);
  --grain-op: .05;
  --grain-blend: screen;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15.5px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; min-height: 100vh; display: flex; flex-direction: column; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--grain-op); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
main, header, footer { position: relative; z-index: 1; }
main { flex: 1; padding-bottom: 64px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: max(16px, 4vw); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -.025em; }
h1 { font-size: clamp(1.75rem, 1.25rem + 1.8vw, 2.5rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: 1.3rem; line-height: 1.25; }
h3 { font-size: 1.02rem; line-height: 1.3; letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
code, .mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: .02em; }
.mute { color: var(--graphite); }
.block { display: block; }
small { font-size: .84em; }
small.block, td small { color: var(--graphite); }
.note { color: var(--graphite); font-size: .98rem; line-height: 1.5; }
.kicker { font: 600 .68rem/1.2 var(--f-brand); letter-spacing: .24em; text-transform: uppercase; color: var(--graphite); margin-bottom: 12px; }
.kicker a { text-decoration: none; }
.kicker a:hover { color: var(--ink); }
.hint { color: var(--graphite); font-size: .88rem; margin-top: 10px; }
.empty { color: var(--graphite); padding: 18px 0; border-top: 1px solid var(--rule); font-size: .95rem; }
.empty a { color: var(--ink); }
.prose { max-width: 64ch; }
.quote { border-left: 2px solid var(--brand); padding: 2px 0 2px 14px; margin: 6px 0 18px; color: var(--graphite); }

/* Cabecera: fila 1 con la firma, el buscador y tus herramientas; fila 2 con las secciones y sus menús.
   En pantallas angostas la fila 2 pasa a un menú lateral y el buscador se abre sobre la fila 1. */
svg.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 60; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; color: var(--paper); }
.runhead { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.bar1 { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); min-height: 60px; }
/* La firma usa la proporción del pie: el isotipo mide 1em, igual que las letras (ver .es-iso). */
.firma { display: inline-flex; align-items: center; gap: .62em; flex: none; text-decoration: none; color: var(--ink); font: 600 .86rem/1 var(--f-brand); letter-spacing: .24em; text-transform: uppercase; }
.firma:hover { color: var(--ink); }
.firma b { font-weight: 600; color: var(--brand-ink); padding-left: .8em; margin-left: .1em; border-left: 1px solid var(--rule-strong); }
.tools { display: flex; align-items: center; gap: 8px; flex: none; }
.icon { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; transition: background .2s; }
.icon:hover { background: var(--paper-2); color: var(--ink); }
.icon svg.ic { width: 19px; height: 19px; }
.only-m { display: none; }
.tema { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .25s, color .25s; }
.tema:hover { background: var(--ink); color: var(--paper); }
.tema svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; transition: opacity .25s, transform .4s cubic-bezier(.16, 1, .3, 1); }
.tema .i-sol { opacity: 0; transform: rotate(-60deg) scale(.6); }
:root[data-theme="dark"] .tema .i-sol { opacity: 1; transform: none; }
:root[data-theme="dark"] .tema .i-luna { opacity: 0; transform: rotate(60deg) scale(.6); }
.ava-btn { border: 0; background: none; padding: 0; border-radius: 11px; cursor: pointer; display: block; }
.ava-btn .ava { width: 36px; height: 36px; transition: box-shadow .2s; }
.ava-btn:hover .ava, .ava-btn[aria-expanded="true"] .ava { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--rule-strong); }

/* Buscador */
.busca { position: relative; flex: 1 1 auto; min-width: 0; max-width: 540px; margin-left: auto; display: flex; align-items: center; gap: 6px; }
.busca-f { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 14px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface); cursor: text; font-weight: 400; transition: border-color .2s, box-shadow .2s; }
.busca-f:hover { border-color: var(--graphite); }
.busca-f:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--brand-soft); }
.busca-f > svg.ic { width: 17px; height: 17px; color: var(--graphite); }
.busca-f input { flex: 1; min-width: 0; height: 100%; border: 0; border-radius: 0; background: none; padding: 0; font-size: .92rem; }
.busca-f input:focus { outline: none; }
.busca-f input::-webkit-search-cancel-button { display: none; }
kbd { font: 500 .72rem/1 var(--f-body); color: var(--graphite); border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px 2px; background: var(--paper); white-space: nowrap; }
.busca-x { display: none; }
.busca-pop { position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; right: 0; min-width: 380px; max-height: min(72vh, 560px); overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 16px; box-shadow: var(--shadow-pop); padding: 6px; }
.busca-pop .g { font: 600 .66rem/1.2 var(--f-brand); letter-spacing: .18em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 6px; display: flex; justify-content: space-between; gap: 10px; }
.busca-pop .g:first-child { padding-top: 8px; }
.busca-pop .g a { font: 500 .78rem var(--f-body); letter-spacing: 0; text-transform: none; color: var(--brand-ink); text-decoration: none; }
.opt { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 0 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); cursor: pointer; }
.opt > svg.ic { color: var(--faint); width: 16px; height: 16px; }
.opt span { display: grid; min-width: 0; }
.opt b { font-weight: 500; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt b.mono { font-family: var(--f-mono); font-size: .86rem; }
.opt mark { background: none; color: inherit; font-weight: 700; }
.opt small mark { color: var(--ink); font-weight: 600; }
.opt small { color: var(--graphite); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt kbd { visibility: hidden; }
.opt[aria-selected="true"] { background: var(--paper-2); color: var(--ink); }
.opt[aria-selected="true"] kbd { visibility: visible; }
.opt[aria-selected="true"] > svg.ic { color: var(--brand-ink); }
.busca-pop .none { padding: 14px 12px; color: var(--graphite); font-size: .9rem; }
.busca-pop .foot { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; border-top: 1px solid var(--rule); margin: 6px -6px -6px; padding: 9px 14px; color: var(--faint); font-size: .76rem; }
.busca-pop .foot span { display: inline-flex; gap: 6px; align-items: center; }
.busca-pop .foot kbd { font-size: .68rem; padding: 2px 5px 1px; }

/* Secciones y menús */
.nav { list-style: none; margin: 0 0 0 -12px; padding: 0; display: flex; gap: 2px; min-height: 44px; align-items: stretch; }
.nav > li { position: relative; display: flex; }
.nav-g { position: relative; }
.nav-a { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; border: 0; background: none; font: 500 .9rem/1 var(--f-body); color: var(--graphite); cursor: pointer; text-decoration: none; }
.nav-a:hover, .nav-g.open > .nav-a { color: var(--ink); }
.nav-a.on { color: var(--ink); font-weight: 600; }
.nav-a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px 2px 0 0; }
.nav-a svg.ic { width: 14px; height: 14px; color: var(--faint); transition: transform .2s; }
.nav-g.open > .nav-a svg.ic { transform: rotate(180deg); color: var(--ink); }
.nav-a:focus-visible { outline-offset: -4px; border-radius: 10px; }
.pop { position: absolute; z-index: 40; top: calc(100% + 1px); left: 0; width: max-content; min-width: 260px; max-width: min(360px, calc(100vw - 32px)); display: none;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 16px; box-shadow: var(--shadow-pop); padding: 6px; }
.pop::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* puente para que el puntero no lo cierre al bajar */
.pop-end { left: auto; right: 0; top: calc(100% + 10px); }
.nav-g.open > .pop { display: block; animation: pop-in .16s cubic-bezier(.16, 1, .3, 1); }
:root:not(.js) .nav-g:hover > .pop, :root:not(.js) .nav-g:focus-within > .pop { display: block; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.pop-list { list-style: none; margin: 0; padding: 0; display: grid; }
.pop-list a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.pop-list a b { font-weight: 600; font-size: .92rem; }
.pop-list a small { color: var(--graphite); font-size: .8rem; line-height: 1.35; }
.pop-list a:hover, .pop-list a:focus-visible { background: var(--paper-2); color: var(--ink); outline-offset: -2px; }
.pop-list a[aria-current="page"] { background: var(--brand-soft); }
.pop-list a[aria-current="page"] b { color: var(--brand-ink); }
.pop-list.create { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 6px; }
.pop-list.create a, .pop-list.flat a, .pop-list .sub a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: .88rem; font-weight: 500; }
.pop-list .sub a { padding-left: 14px; color: var(--graphite); }
.pop-list .sub a:hover { color: var(--ink); }
.pop-list a svg.ic { width: 15px; height: 15px; color: var(--faint); }
.pop-list.create a svg.ic { color: var(--brand-ink); }
.pop-who { display: grid; gap: 3px; padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--rule); }
.pop-who b { font-size: .95rem; }
.pop-who small { color: var(--graphite); font-size: .8rem; }
.pop .salir { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 6px; }
.salir button { border: 0; background: none; color: var(--graphite); font: 500 .88rem/1 var(--f-body); cursor: pointer; padding: 10px 12px; border-radius: 10px; }
.pop .salir button { width: 100%; text-align: left; color: var(--bad); }
.pop .salir button:hover { background: var(--bad-bg); }

/* Menú lateral (celular y tableta) */
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(88vw, 380px); height: 100%; max-height: none; max-width: none; padding: 0; border: 0; border-left: 1px solid var(--rule-strong);
  background: var(--paper); color: var(--ink); flex-direction: column; box-shadow: var(--shadow-pop); }
.drawer[open] { display: flex; animation: drawer-in .26s cubic-bezier(.16, 1, .3, 1); }
.drawer::backdrop { background: rgba(12, 12, 22, .42); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 20px; min-height: 60px; border-bottom: 1px solid var(--rule); }
.drawer-h .firma { font-size: .8rem; }
.drawer nav { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 8px 10px 20px; }
.dr-a { display: grid; gap: 2px; padding: 12px; border-radius: 10px; text-decoration: none; }
.dr-a b { font-weight: 600; }
.dr-a small { color: var(--graphite); font-size: .8rem; }
.dr-a:hover { background: var(--paper-2); color: var(--ink); }
.dr-a[aria-current="page"] { background: var(--brand-soft); }
.dr-a[aria-current="page"] b { color: var(--brand-ink); }
.dr-g { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 4px; }
.dr-g h2 { font: 600 .66rem/1.2 var(--f-brand); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 4px; }
.dr-g.on h2 { color: var(--ink); }
.drawer-f { display: flex; align-items: center; gap: 12px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)) 20px; border-top: 1px solid var(--rule); }
.drawer-f > span { display: grid; min-width: 0; line-height: 1.3; }
.drawer-f small { color: var(--graphite); }
.drawer-f .salir { margin-left: auto; }
.drawer-f .salir button { border: 1px solid var(--rule-strong); border-radius: 999px; }
html.drawer-open { overflow: hidden; }

/* Migas de pan: el lugar del "antetítulo" de cada página. En el celular solo queda "← la página anterior". */
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; margin-bottom: 12px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 0; min-width: 0; }
.crumbs li { display: inline-flex; align-items: baseline; min-width: 0; }
.crumbs li + li::before { content: "›"; margin: 0 .75em; color: var(--faint); letter-spacing: 0; }
.crumbs a { color: var(--graphite); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs li > span { display: block; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs li[aria-current] { color: var(--ink); }
.crumbs .meta { color: var(--faint); }
.crumbs .meta::before { content: "·"; margin: 0 .75em; }
[id] { scroll-margin-top: 124px; }
#main:focus { outline: none; }

@media (max-width: 900px) {
  .bar2, .only-d, .busca, .firma b { display: none; }
  .only-m { display: grid; }
  .bar1 { min-height: 58px; gap: 8px; }
  .tools { margin-left: auto; gap: 2px; }
  .tools .tema { margin: 0 4px; }
  .runhead.searching .firma, .runhead.searching .tools { display: none; }
  .runhead.searching .busca { display: flex; max-width: none; margin: 0; }
  .busca-x { display: grid; }
  .busca-k { display: none; }
  .busca-pop { position: fixed; top: 64px; left: 8px; right: 8px; min-width: 0; max-height: calc(100dvh - 76px); }
  .busca-pop .foot { display: none; }
  [id] { scroll-margin-top: 76px; }
}
@media (max-width: 640px) {
  .crumbs li { display: none; }
  .crumbs li.up, .crumbs.top li[aria-current] { display: inline-flex; }
  .crumbs li.up::before { content: "←"; margin: 0 .6em 0 0; }
  .crumbs li.up a { color: var(--ink); }
  .crumbs.top li[aria-current]::before { content: none; }
  .crumbs.top .meta { display: inline; }
  .crumbs.top .meta::before { content: none; }
  .crumbs.top { flex-direction: column; align-items: flex-start; }
  .crumbs:not(.top) .meta { display: none; }
}
@media (max-width: 360px) { .firma { letter-spacing: .16em; font-size: .8rem; } }

/* Botones */
.acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 10px; font: 600 .88rem/1 var(--f-body); padding: 12px 18px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; transition: background .2s, color .2s, border-color .2s; white-space: nowrap; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: transparent; color: var(--ink); }
.btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
:root[data-theme="dark"] .btn .dot { background: #8b85ff; }
.btn.quiet { border-color: var(--rule-strong); color: var(--graphite); font-weight: 500; }
.btn.quiet:hover { background: var(--paper-2); color: var(--ink); }
.btn.bad { border-color: var(--bad); color: var(--bad); }
.btn.bad:hover { background: var(--bad); color: #fff; }
.mini { font: 500 .78rem/1 var(--f-body); padding: 7px 11px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color .2s; }
.mini:hover { border-color: var(--ink); color: var(--ink); }
.mini.done { border-color: var(--ok); color: var(--ok); }

/* Mensajes */
.flash { margin: 20px 0 0; padding: 12px 16px; border-left: 2px solid var(--ok); border-radius: 0 10px 10px 0; background: var(--ok-bg); font-size: .93rem; }
.flash.bad { border-color: var(--bad); background: var(--bad-bg); }
.flash.warn { border-color: var(--warn); background: var(--warn-bg); margin: 0 0 16px; }

/* Encabezado de página */
.page-h { padding: clamp(32px, 5vw, 56px) 0 clamp(24px, 3vw, 36px); display: grid; gap: 12px; }
.page-h .acts { margin-top: 10px; }
.page-h.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px; }
.page-h.row .acts { margin-top: 0; }
.page-h.row .note { margin-top: 10px; }

/* Ficha de cifras */
.ficha { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--rule-strong); }
.ficha > div { padding: 16px 18px 18px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.ficha > div + div { padding-left: 18px; border-left: 1px solid var(--rule); }
.ficha dt { font-size: .78rem; font-weight: 500; letter-spacing: .01em; color: var(--graphite); }
.ficha dd { margin: 6px 0 0; }
.ficha dd.big { font: 600 clamp(1.65rem, 1.2rem + 1.3vw, 2.25rem)/1.1 var(--f-display); letter-spacing: -.035em; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.ficha .of { color: var(--faint); font-size: .55em; font-weight: 500; letter-spacing: 0; }
.ficha small { color: var(--graphite); }
@media (max-width: 820px) {
  .ficha { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ficha > div:nth-child(odd) { padding-left: 0; border-left: 0; }
}

/* Partes */
.part { padding-top: clamp(40px, 5vw, 60px); }
.part.tight { padding-top: 8px; }
.part.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); }
@media (max-width: 880px) { .part.two { grid-template-columns: 1fr; } }
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--ink); }
.sec-h h3 { margin-top: 22px; }
.sec-h .mute { font-size: .88rem; }
.more { font-size: .88rem; font-weight: 500; color: var(--graphite); text-decoration: none; }
.more:hover { color: var(--brand-ink); }
.grid-side { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); border-top: 1px solid var(--rule-strong); margin-top: clamp(28px, 4vw, 44px); padding-top: 22px; }
.margin { font-family: var(--f-display); }
.margin .n { font-size: 2.2rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; display: block; font-variant-numeric: tabular-nums; }
.margin .t { display: block; color: var(--graphite); margin-top: 8px; font-size: .95rem; }
@media (max-width: 760px) { .grid-side { grid-template-columns: 1fr; gap: 12px; } .margin .n { font-size: 1.7rem; } }

/* Tablas */
.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
.t th { text-align: left; font: 600 .68rem/1.2 var(--f-brand); letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); padding: 12px 12px 10px 0; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.t td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.t .n { text-align: right; font-variant-numeric: tabular-nums; }
.t .end { text-align: right; }
.t tr.dim td { color: var(--faint); }
.t a { text-decoration: none; }
.t a:hover { text-decoration: underline; }
.t.list tbody tr:hover td { background: color-mix(in srgb, var(--paper-2) 60%, transparent); }
@media (max-width: 760px) {
  .t.list thead { display: none; }
  .t.list, .t.list tbody, .t.list tr, .t.list td { display: block; }
  .t.list tr { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .t.list td { border: 0; padding: 0; }
  .t.list td:first-child { grid-column: 1 / -1; }
  .t.list .n { text-align: left; }
}
.who { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.who > span:last-child { display: grid; }
.who small { color: var(--graphite); }
.who.big { align-items: flex-start; gap: 18px; }
.ava { --h: 260; width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; font: 600 .76rem/1 var(--f-body); letter-spacing: .02em;
  color: hsl(var(--h) 45% 28%); background: hsl(var(--h) 55% 92%); box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 70% / .45); }
:root[data-theme="dark"] .ava { color: hsl(var(--h) 70% 82%); background: hsl(var(--h) 30% 20%); box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 50% / .4); }
.who.big .ava { width: 64px; height: 64px; border-radius: 16px; font-size: 1.25rem; margin-top: 4px; }
@media (max-width: 600px) { .who.big .ava { display: none; } }

/* Estado */
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 500; white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip.ok { color: var(--ok); }
.chip.warn { color: var(--warn); }
.chip.bad { color: var(--bad); }
.chip.mute { color: var(--faint); }
.chip.warn i { border-radius: 2px; transform: rotate(45deg) scale(.85); }
.chip.bad i { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.chip.mute i { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.ver.old { color: var(--warn); }
.ver.old::after { content: " · desactualizado"; font-size: .82em; }

/* Casilla del elemento: una ficha limpia con el avatar de Bismuto adentro (lo dibuja panel.js) */
.el { --s: 64px; width: var(--s); height: calc(var(--s) * 1.12); flex: none; position: relative; display: grid; place-items: center; border-radius: calc(var(--s) * .16);
  background: var(--surface); border: 1px solid var(--rule-strong); color: var(--graphite); box-shadow: var(--shadow); overflow: hidden; }
.el canvas.av { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.el small { position: absolute; z-index: 1; left: 9%; top: 6%; font: 600 calc(var(--s) * .14)/1 var(--f-body); color: var(--graphite); }
.el b { position: relative; z-index: 1; font: 600 calc(var(--s) * .38)/1 var(--f-body); letter-spacing: -.03em; color: var(--ink); }
.el em { position: absolute; z-index: 1; left: 0; right: 0; bottom: 6%; text-align: center; font: 500 calc(var(--s) * .12)/1 var(--f-body); font-style: normal; color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6%; }
/* Con el avatar puesto, el símbolo "Bi" ya no hace falta */
.el.has-av b { display: none; }
.el.sm { --s: 34px; box-shadow: none; border-radius: 9px; }
.el.sm small, .el.sm em { display: none; }
.el.xl { --s: 132px; }

/* Licencia */
.lic-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; padding: clamp(32px, 5vw, 56px) 0 clamp(26px, 3vw, 36px); }
.lic-main { display: grid; gap: 14px; min-width: 0; }
.lic-main .kicker { margin: 0; }
.keyline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.key { font: 500 clamp(1.25rem, .9rem + 1.5vw, 2rem)/1.15 var(--f-mono); letter-spacing: .04em; overflow-wrap: anywhere; }
.state { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--graphite); font-size: .93rem; }
@media (max-width: 640px) { .lic-hero { grid-template-columns: 1fr; } .el.xl { --s: 92px; } }
.keycell { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; margin-top: 16px; }
.lic-card { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.lic-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow); color: inherit; }
.lic-card > div { display: grid; gap: 4px; min-width: 0; font-size: .88rem; }
.lic-card .mono { font-weight: 500; font-size: .93rem; white-space: nowrap; }
@media (max-width: 440px) { .lic-card .el { --s: 44px; } .lic-card .el small, .lic-card .el em { display: none; } .lic-card .mono { font-size: .84rem; } }

/* Clave-valor */
.kv { display: grid; grid-template-columns: minmax(140px, max-content) minmax(0, 1fr); gap: 0; margin: 8px 0 0; }
.kv dt { padding-right: 24px !important; }
.kv dt, .kv dd { padding: 11px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.kv dt { color: var(--graphite); font-size: .88rem; font-weight: 500; }
.kv code.wrap { overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dt { border: 0; padding-bottom: 0; } }

/* Atención y registro */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.todo li > i { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: var(--faint); }
.todo li.bad > i { background: var(--bad); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.todo li.warn > i { background: var(--warn); border-radius: 1px; transform: rotate(45deg) scale(.85); }
.todo li div { display: grid; gap: 2px; font-size: .91rem; }
.todo li div a { text-decoration: none; font-weight: 500; }
.todo li span { color: var(--graphite); }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 110px 150px minmax(0, 1fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.log time { color: var(--faint); font-variant-numeric: tabular-nums; }
.log .k { font-weight: 600; }
.log li.warn .k { color: var(--warn); }
.log .m { color: var(--graphite); overflow-wrap: anywhere; }
.log .m a { color: var(--ink); text-decoration: none; }
.part.two .log li { grid-template-columns: 96px minmax(0, 1fr); gap: 2px 14px; }
.part.two .log time { grid-row: span 2; }
.part.two .log .k, .part.two .log .m { grid-column: 2; }
@media (max-width: 640px) { .log li { grid-template-columns: 1fr; gap: 2px; } .part.two .log .m, .log .m { grid-column: auto; } }

/* Gráfico */
.chart { position: relative; margin: 18px 0 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 170px auto; }
.plot { position: relative; grid-column: 2; }
.bars { width: 100%; height: 100%; display: block; overflow: visible; }
.bars .grid { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bars .base { stroke: var(--rule-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bars .bar { fill: var(--bar); transition: fill .15s; }
.bars .hit { fill: transparent; }
.bars .b:hover .bar { fill: var(--bar-hover); }
.bars .b:hover .hit { fill: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.y-ax { position: relative; grid-column: 1; grid-row: 1; }
.y-ax span { position: absolute; right: 10px; transform: translateY(50%); font-size: .72rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.x-ax { position: relative; grid-column: 2; height: 24px; }
.x-ax span { position: absolute; top: 6px; transform: translateX(-50%); font-size: .72rem; color: var(--faint); white-space: nowrap; }
.x-ax span.first { transform: none; }
.x-ax span.last { transform: translateX(-100%); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--paper); font-size: .8rem; font-weight: 500; padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; z-index: 5; }

/* Pestañas y búsqueda */
.tabs { display: flex; gap: 4px 22px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.tabs a { font: 500 .92rem/1 var(--f-display); padding: 10px 0 12px; color: var(--graphite); text-decoration: none; position: relative; }
.tabs a:hover { color: var(--ink); }
.tabs a small { font: 500 .74rem var(--f-body); color: var(--faint); margin-left: 3px; }
.tabs a[aria-current] { color: var(--ink); font-weight: 600; }
.tabs a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.search { margin-bottom: 8px; }
.search input { width: 100%; max-width: 460px; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 24px; }

/* Formularios */
.form { display: grid; gap: 16px; max-width: 760px; }
.form.narrow { max-width: 380px; margin-top: 22px; }
.form label { display: grid; gap: 6px; font-size: .86rem; font-weight: 600; align-content: start; }
.form label small { font-weight: 400; color: var(--graphite); }
.form h3 { margin-bottom: 2px; }
input, select, textarea { font: 400 .95rem/1.4 var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 12px; padding: 11px 14px; width: 100%; min-width: 0; transition: border-color .2s; }
input:hover, select:hover, textarea:hover { border-color: var(--graphite); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: transparent; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--ink); }
input[type="file"] { padding: 9px; }
textarea { resize: vertical; }
fieldset { border: 0; border-top: 1px solid var(--rule-strong); padding: 18px 0 4px; margin: 0; min-width: 0; }
legend { font: 600 1.02rem/1 var(--f-display); letter-spacing: -.02em; padding: 0 12px 0 0; }
fieldset > p { font-size: .88rem; margin-bottom: 12px; }
.grid2, .grid3 { display: grid; gap: 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } .grid3 > span:empty { display: none; } }
.lic-form { max-width: 820px; gap: 26px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.plan { position: relative; cursor: pointer; }
.plan input { position: absolute; opacity: 0; }
.plan span { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--rule-strong); border-radius: 14px; background: var(--surface); height: 100%; transition: border-color .15s, box-shadow .15s; }
.plan b { font: 600 1rem/1.2 var(--f-display); letter-spacing: -.015em; }
.plan small { color: var(--graphite); font-weight: 400; }
.plan input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.plan input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.managed { display: grid; border-top: 1px solid var(--rule); }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.mrow input:not([type="checkbox"]), .mrow select { opacity: .4; pointer-events: none; }
.mrow.on input:not([type="checkbox"]), .mrow.on select { opacity: 1; pointer-events: auto; }
.form .sw { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.sw input { margin-top: 4px; }
.sw span { display: grid; gap: 2px; }
@media (max-width: 640px) { .mrow { grid-template-columns: 1fr; gap: 8px; } }
.form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; max-width: none; }
.form.inline p { width: 100%; font-size: .91rem; }
.form.inline input { max-width: 260px; }
.two-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 28px; }
@media (max-width: 760px) { .two-forms { grid-template-columns: 1fr; } }

/* Acciones */
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); border-top: 1px solid var(--rule); margin-top: 8px; }
.act { padding: 18px 20px 20px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; min-width: 0; }
.act b { font: 600 1rem/1.2 var(--f-display); letter-spacing: -.015em; }
.act p { font-size: .88rem; color: var(--graphite); }
.act .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.act p, .act b { overflow-wrap: anywhere; }
.act select { width: auto; padding: 9px 12px; border-radius: 999px; }
details.danger { margin-top: 22px; }
details.danger summary { cursor: pointer; color: var(--bad); font-size: .9rem; font-weight: 500; width: max-content; }
details.danger form { margin-top: 14px; }

/* Acceso */
.auth { display: grid; grid-template-columns: auto minmax(0, 420px); gap: clamp(28px, 6vw, 80px); align-items: center; justify-content: center; min-height: calc(100vh - 160px); padding: 40px 0; }
.auth h1 { margin-bottom: 8px; }
@media (max-width: 640px) { .auth { grid-template-columns: 1fr; justify-items: start; min-height: 0; } .auth .el.xl { --s: 84px; } }

.pie { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-block: 22px 28px; border-top: 1px solid var(--rule); color: var(--faint); font-size: .8rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (forced-colors: active) { .el { background: Canvas; border: 1px solid CanvasText; } .bars .bar { fill: CanvasText; } }

/* Isotipo de Element Systems (casillas en el color del texto, Bi en el acento de la marca).
   Mide en "em" con la proporción del pie: alto = 1.02 veces el tamaño de letra de al lado. */
.es-iso { flex: none; display: inline-block; vertical-align: middle; overflow: visible; height: 1.02em; width: 1.284em; }
.es-iso .c { fill: currentColor; } .es-iso .b { fill: #414897; }
:root[data-theme="dark"] .es-iso .b { fill: #8b85ff; }
.pie-marca, .kicker-marca { display: inline-flex; align-items: center; gap: .62em; }
.kicker.kicker-marca { font-size: .78rem; color: var(--ink); }
/* Animación: la tabla se completa casilla por casilla y al final se enciende Bi. Solo la primera vez del día (assets/theme.js). */
:root[data-iso-anim] .es-iso.anim .c, :root[data-iso-anim] .es-iso.anim .b { fill-opacity: 0; stroke: currentColor; stroke-width: .9; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: es-traza .45s cubic-bezier(.65,0,.35,1) forwards, es-llena .3s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 55ms + 100ms), calc(var(--i, 0) * 55ms + 380ms); }
:root[data-iso-anim] .es-iso.anim .b { stroke: #414897; transform-box: fill-box; transform-origin: 50% 50%;
  animation: es-traza .45s cubic-bezier(.65,0,.35,1) forwards, es-llena .3s ease-out forwards, es-enciende 1s cubic-bezier(.16,1,.3,1) forwards;
  animation-delay: 1.05s, 1.3s, 1.3s; }
:root[data-theme="dark"][data-iso-anim] .es-iso.anim .b { stroke: #8b85ff; }
@keyframes es-traza { to { stroke-dashoffset: 0; } }
@keyframes es-llena { to { fill-opacity: 1; stroke-width: 0; } }
@keyframes es-enciende { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { :root[data-iso-anim] .es-iso.anim .c, :root[data-iso-anim] .es-iso.anim .b { animation: none; fill-opacity: 1; stroke-width: 0; } }

/* ===== Sección Demo (Moodle de demostración de Bismuto) ===== */
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.form.wide { max-width: none; }
.form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.form legend { font-size: .86rem; font-weight: 600; margin-bottom: 8px; }
.checks { display: grid; gap: 8px; }
.form label.check, label.check { display: flex; align-items: baseline; gap: 10px; font-weight: 500; }
.check input { accent-color: var(--brand); }
.plan small { color: var(--graphite); font-size: .8rem; }
.more-opts { margin: 6px 0 14px; }
.more-opts summary { cursor: pointer; color: var(--brand-ink); font-size: .88rem; font-weight: 600; }
.more-opts[open] summary { margin-bottom: 10px; }
.prose.small { font-size: .88rem; color: var(--graphite); }
.prose.small li { margin: 3px 0; }
textarea.mono { font-family: var(--f-mono); font-size: .86rem; line-height: 1.55; }
.todo li.ok > i { background: var(--ok); }

/* Usuarios: menú de acciones por fila. */
.users td { vertical-align: top; }
.menu { position: relative; display: inline-block; text-align: left; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 10px; min-width: 300px; padding: 14px;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 14px; box-shadow: var(--shadow); }
form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .82rem; }
form.inline > span { color: var(--graphite); margin-right: 2px; }
form.inline input { font: inherit; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); }
form.inline.danger { border-top: 1px solid var(--rule); padding-top: 10px; }
form.inline.danger .mini { border-color: var(--bad); color: var(--bad); }

/* Cursos. */
.units { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.units .u { width: 14px; height: 14px; border-radius: 4px; background: var(--faint); opacity: .5; }
.units .u.ok { background: var(--ok); opacity: 1; }
.units .u.warn { background: var(--warn); opacity: 1; }
.units .u.bad { background: var(--bad); opacity: 1; }
.unitlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.unitlist li { display: flex; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.unitlist .chip { min-width: 110px; }
form.act { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; }
form.act .btn { justify-self: start; margin-top: 4px; }
.danger-zone .margin .n { color: var(--bad); }
.slider { display: grid; grid-template-columns: minmax(0, 1fr) 3ch; gap: 4px 12px; align-items: center; }
.slider input { grid-column: 1 / -1; accent-color: var(--brand); }
.slider output, label output { font-variant-numeric: tabular-nums; color: var(--brand-ink); font-weight: 600; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.preview { margin: 0; padding-left: 1.2rem; display: grid; gap: 14px; }
.preview ul { list-style: none; padding: 6px 0 0; margin: 0; display: grid; gap: 4px; }
.preview .kind { display: inline-block; min-width: 92px; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-ink); font-weight: 600; }

/* Credenciales (se muestran una vez). */
.creds { border: 1px solid var(--rule-strong); border-radius: 18px; padding: 22px clamp(16px, 3vw, 28px) 24px; margin-top: 28px; background: var(--surface); }
.creds textarea { width: 100%; font: inherit; font-size: .9rem; margin-top: 14px; }
.creds code { font-size: .95rem; }
code.brk { overflow-wrap: anywhere; }
.role-descs + .acts { margin-top: 14px; }
.pager { display: flex; gap: 10px; justify-content: space-between; margin-top: 24px; }
@media (max-width: 760px) {
  .menu-body { position: static; min-width: 0; margin-top: 8px; }
  .users thead { display: none; }
  .users tr { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .users td { border: 0 !important; padding: 0 !important; text-align: left !important; }
}
.actions-grid a.act { text-decoration: none; }
.actions-grid a.act:hover b { color: var(--brand-ink); }
.kv code.wrap { display: inline; white-space: normal; }

h3.sub { margin: 30px 0 12px; }

/* Resultados de búsqueda y mapa del panel */
.results { list-style: none; margin: 0; padding: 0; display: grid; }
.results a { display: grid; gap: 2px; padding: 13px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.results a b { font-weight: 600; }
.results a b.mono { font-weight: 500; }
.results a small { color: var(--graphite); }
.results a:hover b { color: var(--brand-ink); text-decoration: underline; }
.sitemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 28px clamp(20px, 3vw, 40px); border-top: 1px solid var(--rule-strong); padding-top: 24px; }
.sitemap h2 { font-size: 1.1rem; margin-bottom: 6px; }
.sitemap h2 a { text-decoration: none; }
.sitemap > section > p { font-size: .88rem; margin-bottom: 6px; }
.sitemap .pop-list { margin-left: -12px; }
.part.res { padding-top: 28px; }

/* ===== 1.3: dos espacios (Bismuto y Plataforma) ===== */
.espacios { display: inline-flex; flex: none; padding: 3px; border-radius: 999px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); }
.espacios a { padding: 6px 14px; border-radius: 999px; font: 600 .82rem/1 var(--f-body); color: var(--graphite); text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.espacios a:hover { color: var(--ink); }
.espacios a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 24, 26, .08), 0 0 0 1px var(--rule); }
.espacio-solo { flex: none; font: 600 .82rem/1 var(--f-body); color: var(--graphite); padding-left: 14px; border-left: 1px solid var(--rule-strong); }
.pop-state { margin-left: auto; color: var(--faint); font-size: .76rem; }
.pop-list.flat a { justify-content: flex-start; }
.dr-space { border-top: 1px solid var(--rule); padding: 4px 0 8px; }
.dr-space:first-child { border-top: 0; }
.dr-space > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 12px; border-radius: 10px; }
.dr-space > summary::-webkit-details-marker { display: none; }
.dr-space > summary span { font: 600 .7rem/1.2 var(--f-brand); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.dr-space > summary small { color: var(--graphite); font-size: .8rem; }
.dr-space .dr-g { margin-left: 4px; }
.drawer-f > a { display: grid; min-width: 0; line-height: 1.3; text-decoration: none; }
@media (max-width: 1100px) { .espacios a { padding: 6px 11px; } }
@media (max-width: 900px) { .espacios { margin-left: auto; } .espacio-solo { display: none; } .runhead.searching .espacios { display: none; } .tools { margin-left: 4px; } }
@media (max-width: 600px) { .bar1 .firma-n { display: none; } .bar1 .firma .es-iso { height: 1.75em; width: auto; } }

/* ===== Ingreso ===== */
.auth-box { display: grid; gap: 0; }
.auth-box .note { margin-bottom: 4px; }
.auth-form { gap: 14px; }
.pw-field { display: grid; gap: 6px; }
.pw-field > label, .pw-head label { font-size: .86rem; font-weight: 600; }
.pw-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pw-head a { font-size: .84rem; color: var(--graphite); }
.pw-head a:hover { color: var(--ink); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--graphite); display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: var(--paper-2); }
.pw-eye[aria-pressed="true"] { color: var(--brand-ink); }
.pw-eye svg.ic { width: 19px; height: 19px; }
.caps { margin: 0; font-size: .82rem; color: var(--warn); font-weight: 500; }
.meter { margin: 2px 0 0; display: grid; gap: 6px; font-size: .82rem; color: var(--graphite); }
.meter i { display: block; height: 4px; border-radius: 4px; background: var(--rule); position: relative; overflow: hidden; }
.meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--c, var(--faint)); border-radius: 4px; transition: width .25s, background .25s; }
.block-btn { width: 100%; justify-content: center; }
.code-input { font: 500 1.4rem/1 var(--f-mono); letter-spacing: .3em; text-align: center; }
.auth-foot { margin-top: 18px; }
input.mismatch { border-color: var(--bad); }
.steps { margin: 6px 0 0; padding-left: 1.2rem; display: grid; gap: 14px; }
.steps li::marker { font-weight: 600; color: var(--graphite); }
.steps .form.narrow { margin-top: 4px; }

/* ===== Plataforma ===== */
.tight-top { padding-top: 22px; }
.spaced { margin-top: 18px; }
.hint.first, h3.sub.first { margin-top: 0; }
.form.wide-ish { max-width: 460px; margin-top: 0; }
.people .who .ava { width: 34px; height: 34px; }
.mail-state { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 14px 0 0; font-size: .9rem; }
.mail-send { margin-top: 16px; }
.mail-send input[type=email] { max-width: 300px; }
.mail-send small { flex-basis: 100%; }
.role-descs { list-style: none; margin: -4px 0 0; padding: 0; font-size: .86rem; color: var(--graphite); }
.role-descs li { display: none; }
.role-descs li.on, :root:not(.js) .role-descs li { display: block; }
.role-descs a { margin-left: 4px; }
fieldset[disabled] { opacity: .7; }
.matrix-wrap { overflow-x: auto; border-top: 1px solid var(--rule-strong); }
.matrix { min-width: 640px; }
.matrix th, .matrix td { vertical-align: middle; }
.matrix thead th { font: 600 .9rem/1.25 var(--f-display); text-transform: none; letter-spacing: -.01em; color: var(--ink); }
.matrix thead th small { display: block; font: 400 .74rem var(--f-body); color: var(--faint); margin-top: 3px; }
.matrix thead th a { text-decoration: none; }
.matrix thead th a:hover { text-decoration: underline; }
.matrix tbody th { text-align: left; font: 400 .9rem/1.4 var(--f-body); letter-spacing: 0; text-transform: none; white-space: normal; color: var(--ink); padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); }
.matrix thead th { white-space: nowrap; }
.matrix thead th:first-child { width: 100%; }
.matrix tbody th b { display: block; font-weight: 600; font-size: .9rem; }
.matrix tbody th small { display: block; color: var(--graphite); font-size: .8rem; margin-top: 2px; }
.matrix tr.grp th { font: 600 .66rem/1.2 var(--f-brand); letter-spacing: .2em; text-transform: uppercase; color: var(--graphite); padding-top: 22px; border-bottom: 1px solid var(--rule-strong); }
.matrix .c { text-align: center; min-width: 96px; padding-left: 8px; padding-right: 8px; }
.matrix .yes { color: var(--ok); font-weight: 700; }
.matrix .no { color: var(--faint); }
.perm-group { border-top: 1px solid var(--rule-strong) !important; padding-top: 14px !important; margin-top: 8px !important; }
.perm-group legend { display: flex; align-items: center; gap: 12px; font: 600 1rem/1 var(--f-display); }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.form label.perm { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 400; transition: border-color .15s; }
.form label.perm:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.form label.perm input { margin-top: 3px; }
.form label.perm span { display: grid; gap: 2px; }
.form label.perm b { font-weight: 600; font-size: .92rem; }
.form label.perm small { color: var(--graphite); font-size: .8rem; font-weight: 400; }
.form label.perm.off { opacity: .55; cursor: not-allowed; }
.tpl-list a { padding: 16px 0; }
.tpl-list .tpl-meta { color: var(--faint); margin-top: 2px; }
.tpl-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; margin-top: 18px; }
.tpl-form { max-width: none; }
.tpl-form textarea { min-height: 320px; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tpl-vars p { width: 100%; margin: 0; font-size: .86rem; font-weight: 600; }
.tpl-vars p small { font-weight: 400; color: var(--graphite); }
.tpl-vars .mini { font-family: var(--f-mono); font-size: .76rem; }
.tpl-preview { position: sticky; top: 124px; display: grid; gap: 8px; }
.tpl-preview .kicker { margin: 0; }
.tpl-subj { font-size: .9rem; color: var(--graphite); }
.tpl-mail { border: 1px solid var(--rule-strong); border-radius: 14px; overflow: hidden; background: #f4f3ef; color: #17181a; max-height: 640px; overflow-y: auto; }
.tpl-mail > table { width: 100%; }
.subtabs { border-bottom: 0; margin-top: -2px; }
.subtabs a { font-size: .86rem; }
@media (max-width: 960px) { .tpl-edit { grid-template-columns: minmax(0, 1fr); } .tpl-preview { position: static; } }

/* ===== Documentación (vista docs) ===== */
.doc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; margin-top: 8px; }
.doc-toc { position: sticky; top: 124px; max-height: calc(100vh - 140px); overflow-y: auto; }
.doc-toc summary { list-style: none; font: 600 .68rem/1.2 var(--f-brand); letter-spacing: .2em; text-transform: uppercase; color: var(--graphite); padding: 6px 0 10px; cursor: default; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.doc-toc li a { display: grid; grid-template-columns: 1.8em minmax(0, 1fr); padding: 8px 8px 8px 0; font-size: .88rem; color: var(--graphite); text-decoration: none; border-bottom: 1px solid var(--rule); }
.doc-toc li a span { color: var(--faint); font-variant-numeric: tabular-nums; }
.doc-toc li a:hover { color: var(--ink); }
.doc-toc li a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.doc-toc li a[aria-current="true"] span { color: var(--brand-ink); }
.doc-body { min-width: 0; max-width: 820px; }
.doc-sec { padding: 8px 0 44px; border-top: 1px solid var(--ink); margin-top: 8px; }
.doc-sec:first-child { margin-top: 0; }
.doc-sec > .kicker { margin: 14px 0 8px; }
.doc-sec h2 { font-size: clamp(1.45rem, 1.15rem + 1vw, 1.9rem); margin-bottom: 14px; }
.doc-sec h3 { font-size: 1.1rem; margin: 30px 0 10px; }
.doc-sec h4 { font-size: .98rem; margin: 22px 0 8px; color: var(--graphite); }
.doc-sec p { margin: 0 0 1em; }
.doc-sec > p:first-of-type { color: var(--graphite); font-size: 1.02rem; }
.doc-sec ul, .doc-sec ol { margin: 0 0 1.1em; padding-left: 1.2em; }
.doc-sec li { margin: .3em 0; }
.doc-sec code { font-size: .86em; background: var(--paper-2); border-radius: 4px; padding: .08em .36em; overflow-wrap: anywhere; }
.doc-sec pre { margin: 0 0 1.2em; padding: 14px 16px; background: var(--paper-2); border-radius: 10px; overflow-x: auto; font: 400 .82rem/1.6 var(--f-mono); }
.doc-sec pre code { background: none; padding: 0; }
.doc-sec .ruta { font-weight: 600; }
.doc-sec .tabla { overflow-x: auto; border-top: 1px solid var(--rule-strong); margin: 6px 0 1.4em; }
.doc-sec table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .88rem; line-height: 1.5; }
.doc-sec th, .doc-sec td { text-align: left; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc-sec th { font: 600 .66rem/1.2 var(--f-brand); letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); }
.doc-sec td:first-child { font-weight: 600; }
.doc-sec td.n, .doc-sec th.n { white-space: nowrap; }
.doc-sec .defs { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); margin: 6px 0 1.4em; border-top: 1px solid var(--rule-strong); }
.doc-sec .defs dt, .doc-sec .defs dd { padding: 11px 0; border-bottom: 1px solid var(--rule); margin: 0; font-size: .92rem; }
.doc-sec .defs dt { font-weight: 600; padding-right: 20px; }
.doc-sec .aviso { margin: 0 0 1.4em; padding: 12px 16px; border-left: 2px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; font-size: .92rem; }
.doc-sec .aviso.neutro { border-color: var(--rule-strong); background: var(--paper-2); }
.doc-sec .aviso p:last-child { margin: 0; }
.doc-sec .pasos { counter-reset: p; list-style: none; padding: 0; }
.doc-sec .pasos > li { counter-increment: p; position: relative; margin: 0; padding: 5px 0 5px 2em; }
.doc-sec .pasos > li::before { content: counter(p) "."; position: absolute; left: 0; top: 5px; font-weight: 600; color: var(--brand-ink); }
.doc-sec code { overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { position: static; max-height: none; border: 1px solid var(--rule-strong); border-radius: 12px; padding: 4px 14px; }
  .doc-toc summary { cursor: pointer; padding: 10px 0; }
  .doc-toc summary::after { content: " +"; }
  .doc-toc details[open] summary::after { content: " −"; }
  .doc-sec .defs { grid-template-columns: minmax(0, 1fr); }
  .doc-sec .defs dt { border-bottom: 0; padding-bottom: 0; }
}
@media print {
  .runhead, .drawer, .pie, .doc-toc, .page-h .acts, .skip, .flash { display: none !important; }
  body::before { display: none; }
  body { background: #fff; color: #000; }
  .doc { display: block; }
  .doc-sec { break-inside: auto; }
  .doc-sec .tabla { overflow: visible; }
  .doc-sec table { min-width: 0; }
}
.map-space { margin: 34px 0 14px; font-size: 1.3rem; } .map-space small { font: 400 .9rem var(--f-body); color: var(--graphite); margin-left: 8px; } .sitemap h3 { font-size: 1.05rem; margin-bottom: 4px; } .sitemap h3 a { text-decoration: none; }

/* ===================================================================== 1.4 · Ingreso
   Dos mitades como el aula de Element: la marca sobre una trama de casillas y un elemento que flota; el formulario a la
   derecha. Hanken Grotesk (ligera) para los titulares y JetBrains Mono para las notas, como en el sitio. */
:root {
  --f-el: "Hanken Grotesk", "Plus Jakarta Sans", system-ui, sans-serif;
  --f-code: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --acc-left: #e4e2f3; --acc-cell: rgba(255, 255, 255, .5); --acc-right: #f2f1f5; --acc-ink: #15152a; --acc-mute: #5c5e78;
  --acc-ac: #414897; --acc-ac-hover: #343a80; --acc-ac-ink: #fff; --acc-hl: #414897; --acc-field: #f8f7fb;
  --acc-line: rgba(21, 21, 42, .2); --acc-el: #8b85ff; --acc-el-ink: #15152a; --acc-split: rgba(21, 21, 42, .1);
}
:root[data-theme="dark"] {
  --acc-left: #1b1b34; --acc-cell: rgba(11, 11, 24, .42); --acc-right: #15152a; --acc-ink: #f4f3f6; --acc-mute: #a9a8c6;
  --acc-ac: #8b85ff; --acc-ac-hover: #a49fff; --acc-ac-ink: #15152a; --acc-hl: #8b85ff; --acc-field: #1a1a35;
  --acc-line: rgba(200, 197, 255, .22); --acc-el: #8b85ff; --acc-el-ink: #15152a; --acc-split: rgba(200, 197, 255, .12);
}
.acceso-body { background: var(--acc-right); color: var(--acc-ink); min-height: 100vh; }
.acceso { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.acc-escena { position: relative; overflow: hidden; background: var(--acc-left); border-right: 1px solid var(--acc-split);
  display: grid; grid-template-rows: auto 1fr auto; padding: clamp(28px, 4vw, 56px) clamp(24px, 4vw, 76px); isolation: isolate; }
.acc-escena::before { content: ""; position: absolute; inset: -2px; z-index: -1; background: var(--acc-cell);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 128'%3E%3Cpath transform='translate(8 8)' d='M18 0H52V15H70V97H52V112H18V97H0V15H18Z'/%3E%3C/svg%3E") 0 0 / 52px 77px repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 128'%3E%3Cpath transform='translate(8 8)' d='M18 0H52V15H70V97H52V112H18V97H0V15H18Z'/%3E%3C/svg%3E") 0 0 / 52px 77px repeat; }
.acc-firma { color: var(--acc-ink); font-size: .9rem; gap: .9em; }
.acc-firma .es-iso { height: 2.9em; width: auto; }
.acc-copy { align-self: center; max-width: 30rem; position: relative; z-index: 1; }
.acc-kick { font: 400 .78rem/1.3 var(--f-code); letter-spacing: .2em; text-transform: uppercase; color: var(--acc-hl); margin: 0 0 22px; }
:root[data-theme="dark"] .acc-kick { color: #c8c5ff; }
.acc-h { font: 200 clamp(3rem, 5.6vw, 5.4rem)/1.02 var(--f-el); letter-spacing: -.025em; margin: 0; }
.acc-h em { font-style: normal; font-weight: 500; color: var(--acc-hl); display: block; }
.acc-sub { font: 300 1.12rem/1.6 var(--f-el); color: var(--acc-mute); margin: 26px 0 0; max-width: 26rem; }
.acc-url { font: 400 .8rem/1 var(--f-code); color: var(--acc-mute); letter-spacing: .04em; margin: 0; }
/* El elemento: una casilla con número y símbolo, encendida, que flota despacio. */
.acc-el { position: absolute; left: var(--x, 64%); top: var(--y, 56%); width: 84px; height: 110px; animation: acc-flota 9s ease-in-out infinite;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--acc-el) 75%, transparent)) drop-shadow(0 0 42px color-mix(in srgb, var(--acc-el) 35%, transparent)); }
.acc-el-c { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; background: var(--acc-el); color: var(--acc-el-ink); font-family: var(--f-el);
  clip-path: polygon(25.7% 0, 74.3% 0, 74.3% 10%, 100% 10%, 100% 90%, 74.3% 90%, 74.3% 100%, 25.7% 100%, 25.7% 90%, 0 90%, 0 10%, 25.7% 10%); }
.acc-el small { font: 400 .72rem/1 var(--f-code); margin-bottom: 6px; }
.acc-el b { font-weight: 300; font-size: 2.6rem; line-height: 1; }
@keyframes acc-flota { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-8px, -14px); } }
@media (prefers-reduced-motion: reduce) { .acc-el { animation: none; } }

.acc-main { position: relative; display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: clamp(24px, 4vw, 56px) clamp(20px, 5vw, 80px) 24px; outline: none; }
.acc-tema { position: fixed; top: 16px; right: 16px; z-index: 5; color: var(--acc-ink); border-color: var(--acc-line); }
.acc-tema:hover { background: var(--acc-ink); color: var(--acc-right); }
.acc-box { align-self: center; width: min(100%, 440px); padding: 56px 0 24px; }
.acc-box h1 { font: 300 clamp(2.1rem, 3.4vw, 2.9rem)/1.08 var(--f-el); letter-spacing: -.02em; color: var(--acc-ink); }
.acc-mono { font: 400 .84rem/1.4 var(--f-code); color: var(--acc-mute); margin: 10px 0 28px; letter-spacing: .01em; }
.acc-box .note { color: var(--acc-mute); margin: -12px 0 22px; }
.acc-box .form { max-width: none; gap: 18px; }
.acc-box .form label, .acc-box .pw-field > label, .acc-box .pw-head label { font: 500 .92rem/1.3 var(--f-el); color: var(--acc-ink); }
.acc-box .form label small { font-family: var(--f-el); color: var(--acc-mute); }
.acc-box input:not([type=checkbox]):not([type=radio]) { background: var(--acc-field); border-color: var(--acc-line); color: var(--acc-ink); border-radius: 10px; padding: 15px 16px; font: 400 1rem/1.3 var(--f-el); }
.acc-box input::placeholder { color: color-mix(in srgb, var(--acc-mute) 80%, transparent); }
.acc-box input:focus { outline: 2px solid var(--acc-ac); outline-offset: 1px; border-color: transparent; }
.acc-box .pw-head a { color: var(--acc-hl); font: 400 .9rem var(--f-el); text-decoration: none; }
.acc-box .pw-head a:hover { text-decoration: underline; }
:root[data-theme="dark"] .acc-box .pw-head a { color: #a49fff; }
.acc-box .pw-eye { color: var(--acc-mute); }
.acc-box .btn { font-family: var(--f-el); font-weight: 500; font-size: 1rem; }
.acc-box .btn.solid { background: var(--acc-ac); border-color: var(--acc-ac); color: var(--acc-ac-ink); padding: 17px 24px; }
.acc-box .btn.solid:hover { background: var(--acc-ac-hover); border-color: var(--acc-ac-hover); color: var(--acc-ac-ink); }
.acc-box .btn.quiet { border-color: var(--acc-line); color: var(--acc-mute); }
.acc-box .btn.quiet:hover { background: transparent; color: var(--acc-ink); border-color: var(--acc-ink); }
.acc-box .block-btn { justify-content: center; width: 100%; }
.acc-box .hint, .acc-box .auth-foot { color: var(--acc-mute); font: 400 .86rem/1.55 var(--f-el); }
.acc-box .flash { margin: 0 0 22px; }
.acc-box .meter span { font-family: var(--f-el); }
.acc-pie { font: 400 .74rem/1 var(--f-code); color: var(--acc-mute); letter-spacing: .04em; margin: 0; }
@media (max-width: 900px) {
  .acceso { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .acc-escena { border-right: 0; border-bottom: 1px solid var(--acc-split); grid-template-rows: auto auto; gap: 26px; padding: 22px 20px 26px; }
  .acc-h { font-size: clamp(2.2rem, 9vw, 3rem); }
  .acc-h em { display: inline; }
  .acc-sub, .acc-url { display: none; }
  .acc-kick { margin-bottom: 12px; font-size: .7rem; }
  .acc-el { left: auto; right: 22px; top: auto; bottom: 20px; width: 50px; height: 66px; }
  .acc-el small { font-size: .6rem; margin-bottom: 3px; }
  .acc-el b { font-size: 1.6rem; }
  .acc-tema { top: 14px; right: 14px; width: 34px; height: 34px; }
  .acc-firma .es-iso { height: 2.2em; }
  .acc-main { padding: 8px 20px 24px; }
  .acc-box { padding-top: 30px; align-self: start; }
}

/* ===================================================================== 1.4 · Foto de perfil */
.ava.foto { padding: 0; overflow: hidden; background: var(--paper-2); }
.ava.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-edit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px 28px; align-items: start; padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--rule); }
.foto-prev { width: 132px; height: 132px; position: relative; }
.foto-prev .ava { width: 132px; height: 132px; border-radius: 28px; font-size: 2.4rem; }
.foto-prev [hidden] { display: none !important; }
.foto-prev canvas { width: 132px; height: 132px; border-radius: 28px; cursor: grab; touch-action: none; display: block; box-shadow: 0 0 0 1px var(--rule-strong); }
.foto-prev canvas:active { cursor: grabbing; }
.foto-prev canvas:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.foto-ctl .hint { margin: 4px 0 14px; }
.foto-pick { position: relative; overflow: hidden; }
.foto-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.foto-pick:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.con-js .foto-save { display: none; }
.con-js .foto-save.on { display: inline-flex; }
.foto-zoom { display: flex; align-items: center; gap: 12px; font-size: .86rem; font-weight: 600; margin-top: 14px; max-width: 320px; }
.foto-help { margin-top: 6px; }
.foto-quitar { margin-top: 10px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: .86rem; color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--bad); }
@media (max-width: 600px) { .foto-edit { grid-template-columns: 1fr; } .who.big .ava.foto { display: block; } }

/* ===================================================================== 1.4 · Áreas
   Cada área es una casilla de la tabla (número y símbolo) con su color: Bismuto en naranja Bismuto, Marketing en lavanda.
   La administración va en tinta: es el panel, no un área de trabajo. El color del área marca también la sección activa. */
[data-area="bismuto"] { --area: #ff7a01; --area-ink: #15152a; }
[data-area="marketing"] { --area: #8b85ff; --area-ink: #15152a; }
[data-area="plataforma"] { --area: var(--ink); --area-ink: var(--paper); }
body[data-area] .nav-a.on::after { background: var(--area, var(--ink)); height: 3px; }
.area-el { --s: 26px; position: relative; flex: none; width: var(--s); height: calc(var(--s) * 1.3); display: grid; align-content: center; justify-items: center;
  background: var(--area, var(--ink)); color: var(--area-ink, var(--paper)); font-family: var(--f-el); line-height: 1;
  clip-path: polygon(25.7% 0, 74.3% 0, 74.3% 10%, 100% 10%, 100% 90%, 74.3% 90%, 74.3% 100%, 25.7% 100%, 25.7% 90%, 0 90%, 0 10%, 25.7% 10%); }
.area-el small { font: 400 calc(var(--s) * .2)/1 var(--f-code); margin-bottom: calc(var(--s) * .06); opacity: .8; }
.area-el b { font-weight: 400; font-size: calc(var(--s) * .46); letter-spacing: -.02em; }
.area-el.vacio { background: var(--paper-2); color: var(--faint); box-shadow: none; }
.area-el.xl { --s: 104px; }
.area-el:not(.xl) small { display: none; }
.area-el:not(.xl) b { font-weight: 500; font-size: calc(var(--s) * .5); }
.picker-n { font-weight: 600; color: var(--graphite); }
.area-el.xl b { font-weight: 200; }
.area-g { flex: none; }
.area-btn { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface);
  font: 600 .88rem/1 var(--f-body); color: var(--ink); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.area-btn:hover, .area-g.open .area-btn { border-color: var(--rule-strong); box-shadow: var(--shadow); }
.area-btn .area-el { --s: 24px; }
.area-btn svg.ic { width: 14px; height: 14px; color: var(--faint); transition: transform .2s; }
.area-g.open .area-btn svg.ic { transform: rotate(180deg); }
.pop-areas { min-width: 320px; padding: 8px; top: calc(100% + 10px); }
.pop-areas .pop-h, .pop-h { font: 600 .64rem/1.2 var(--f-brand); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin: 6px 12px 6px; }
.pop-areas .pop-list a { display: flex; align-items: center; gap: 14px; padding: 9px 10px; }
.pop-areas .pop-list a > span:last-child { display: grid; gap: 2px; }
.pop-areas .area-el { --s: 30px; }
.pop-areas .pop-list a[aria-current] { background: var(--paper-2); }
.pop-sep { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 6px; }
.pop-foot { display: block; margin-top: 6px; padding: 10px 12px 6px; border-top: 1px solid var(--rule); font-size: .84rem; font-weight: 500; color: var(--graphite); text-decoration: none; }
.pop-foot:hover { color: var(--ink); text-decoration: underline; }
.espacio-solo { display: inline-flex; align-items: center; gap: 10px; border-left: 0; padding-left: 0; color: var(--ink); }
.espacio-solo .area-el { --s: 22px; }
@media (max-width: 900px) {
  .area-g { margin-left: auto; }
  .area-btn { padding: 4px 8px 4px 5px; gap: 8px; }
  .runhead.searching .area-g { display: none; }
  .pop-areas { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; min-width: 0; max-width: none; }
  .pop-areas .pop-list small { white-space: normal; }
}
@media (max-width: 359px) { .area-btn .area-n { display: none; } }

/* ¿Dónde trabajas hoy? */
.areas-pick { min-height: calc(100vh - 220px); display: grid; align-content: center; justify-items: center; padding: clamp(28px, 6vh, 72px) 0; text-align: center; }
.areas-h .kicker { margin-bottom: 14px; }
.areas-h h1 { font: 200 clamp(2.4rem, 5vw, 3.8rem)/1.05 var(--f-el); letter-spacing: -.025em; margin-bottom: clamp(28px, 5vh, 52px); }
.areas-form { display: grid; justify-items: center; gap: 22px; width: 100%; }
.areas-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(16px, 3vw, 32px); }
.area-card { width: 240px; min-height: 300px; display: grid; justify-items: center; align-content: start; gap: 10px; padding: 30px 20px 22px; border-radius: 22px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; text-align: center;
  transition: transform .25s cubic-bezier(.16, 1, .3, 1), border-color .2s, box-shadow .25s; }
.area-card .area-el { margin-bottom: 10px; transition: filter .3s; }
.area-card:hover, .area-card:focus-visible { transform: translateY(-4px); border-color: color-mix(in srgb, var(--area) 55%, transparent); box-shadow: var(--shadow-pop); outline: none; }
.area-card:hover .area-el, .area-card:focus-visible .area-el { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--area) 60%, transparent)); }
.area-card:focus-visible { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--area); }
.area-card-n { font: 400 1.5rem/1.1 var(--f-el); letter-spacing: -.01em; }
.area-card-d { font-size: .86rem; color: var(--graphite); line-height: 1.45; }
.area-card-s { display: grid; gap: 4px; margin-top: 6px; font-size: .8rem; color: var(--graphite); }
.area-card-s .warn { color: var(--warn); }
.area-card-s .bad { color: var(--bad); }
.area-card-fija { font: 400 .7rem/1 var(--f-code); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 6px 10px; margin-top: 6px; }
.areas-recordar { font-size: .88rem; color: var(--graphite); }
.areas-admin { width: min(100%, 560px); border-top: 1px solid var(--rule); padding-top: 22px; margin-top: 6px; }
.admin-link { width: 100%; display: flex; align-items: center; gap: 16px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid transparent; background: none;
  color: var(--ink); font: inherit; cursor: pointer; }
.admin-link:hover, .admin-link:focus-visible { border-color: var(--rule-strong); background: var(--surface); outline: none; }
.admin-link .area-el { --s: 34px; }
.admin-link > span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.admin-link b { font-weight: 600; }
.admin-link small { color: var(--graphite); font-size: .82rem; }
.admin-link .area-card-s { margin: 0; text-align: right; }
@media (max-width: 600px) {
  .areas-pick { min-height: 0; align-content: start; }
  .areas-grid { display: grid; grid-template-columns: 1fr; width: 100%; gap: 12px; }
  .area-card { width: 100%; min-height: 0; grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; gap: 4px 18px; padding: 18px; }
  .area-card .area-el.xl { --s: 64px; grid-row: span 4; margin: 0; }
  .admin-link { flex-wrap: wrap; }
  .admin-link .area-card-s { width: 100%; text-align: left; padding-left: 50px; }
}

/* ===================================================================== 1.4 · Biblioteca e integraciones */
.lib-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; }
.lib-tools .tabs small { color: var(--faint); font-weight: 500; margin-left: 2px; }
.lib-search input { width: min(280px, 100%); padding: 9px 14px; border-radius: 999px; }
.lib-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 18px; }
.lib-card { position: relative; display: grid; gap: 10px; align-content: start; min-width: 0; }
.lib-thumb { display: grid; place-items: center; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; border: 1px solid var(--rule);
  background: var(--paper-2); color: var(--faint); text-decoration: none;
  transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s; }
.lib-thumb img { max-width: 86%; max-height: 90%; display: block; box-shadow: var(--shadow); }
.lib-thumb span { font: 400 .74rem var(--f-code); letter-spacing: .08em; text-transform: uppercase; }
.lib-thumb:hover, .lib-thumb:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.lib-body { display: grid; gap: 4px; min-width: 0; padding-right: 30px; }
.lib-kind { font: 400 .66rem/1 var(--f-code); letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); }
.lib-name { font-weight: 600; font-size: .94rem; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-name:hover { text-decoration: underline; }
.lib-by { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--graphite); min-width: 0; }
.lib-by .ava { width: 22px; height: 22px; border-radius: 7px; font-size: .56rem; }
.lib-more { position: absolute; right: 0; bottom: 6px; }
.lib-more summary { list-style: none; cursor: pointer; padding: 4px 8px; border-radius: 8px; color: var(--graphite); font-weight: 700; letter-spacing: .1em; }
.lib-more summary::-webkit-details-marker { display: none; }
.lib-more summary:hover, .lib-more[open] summary { background: var(--paper-2); color: var(--ink); }
.lib-menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; width: 250px; display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--rule-strong); box-shadow: var(--shadow-pop); }
.lib-menu .form { gap: 8px; }
.lib-empty { padding: 48px 0; text-align: center; border-top: 1px solid var(--rule); }
.lib-empty p:first-child { font: 300 1.6rem/1.2 var(--f-el); margin: 0 0 8px; }
.lead-s { margin: 0 0 16px; color: var(--graphite); max-width: 62ch; }
.inline-test { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 600px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; } .lib-search, .lib-search input { width: 100%; } }

/* ===================================================================== 1.5 · Salud y Derecho
   Dos áreas más, con el acento de cada producto (01 §1): Salud en verde, Derecho en terracota. Comparten las mismas
   pantallas; cambia solo el color de la casilla y el subrayado de la sección activa. */
[data-area="salud"] { --area: #6fc3a3; --area-ink: #0f2a20; }
[data-area="derecho"] { --area: #e39a7f; --area-ink: #2a1610; }
[data-area="cobalto"] { --area: #3b6fd8; --area-ink: #ffffff; }
[data-area="kari"] { --area: #c8336e; --area-ink: #ffffff; }

/* Casilla de una licencia de Salud o Derecho: su símbolo sobre el color del área (sin el avatar de Bismuto). */
.el.sx { background: color-mix(in srgb, var(--area) 22%, var(--surface)); border-color: color-mix(in srgb, var(--area) 60%, var(--rule-strong)); }
.el.sx b { color: var(--area-ink); }
:root[data-theme="dark"] .el.sx { background: color-mix(in srgb, var(--area) 30%, var(--surface)); }
:root[data-theme="dark"] .el.sx b, :root[data-theme="dark"] .el.sx small, :root[data-theme="dark"] .el.sx em { color: var(--ink); }

.warn-t { color: var(--warn); }
.bad-t, .btn.bad-t { color: var(--bad); }
.def { color: var(--warn); font-family: var(--f-mono); font-size: .82em; }
.spaced { margin-top: 12px; }
.grid4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps { margin: 0 0 16px; padding-left: 1.2em; display: grid; gap: 8px; color: var(--graphite); max-width: 70ch; }
.steps .keyline { margin-top: 6px; }
.steps .key { font-size: .95rem; }
.empty-card { border: 1px dashed var(--rule-strong); border-radius: 16px; padding: 22px 24px; background: var(--surface); }
.usage-bar { display: block; height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; margin-top: 6px; max-width: 220px; }
.usage-bar i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.usage-bar.warn i { background: var(--warn); }

/* Editor de límites y funciones (planes y excepciones por cliente) */
.form fieldset.ent-lim, .form fieldset.ent-feat, .form fieldset.ent-extra { border-top: 1px solid var(--rule-strong); padding-top: 16px; margin-top: 4px; }
.ent-lim label small { font-size: .76rem; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 16px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.frow > span { display: grid; gap: 2px; }
.frow > span small { color: var(--graphite); font-size: .8rem; }
.fctl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.fctl select { width: auto; }
.fsub { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.fsub label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.fsub input { width: 84px; }
.fsub[hidden] { display: none !important; }
.xrows { display: grid; gap: 8px; }
.xrow { display: grid; grid-template-columns: minmax(0, 1.2fr) 130px minmax(0, 1fr) 90px; gap: 10px; align-items: center; }
.xrow.nuevo input::placeholder { color: var(--faint); }
.changed { position: relative; }
.frow.changed, .xrow.changed, label.changed { box-shadow: inset 3px 0 0 var(--area, var(--brand)); padding-left: 12px; }
.kv dd.changed { font-weight: 600; }

/* Ajustes a distancia */
.sx-managed .mrow { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
.mlabel { display: grid; gap: 2px; font-weight: 600; font-size: .9rem; }
.mlabel small, .sx-managed .sw small { color: var(--graphite); font-weight: 400; font-size: .8rem; }
.msecret { display: grid; gap: 6px; }

/* Licencia: plan combinado y excepciones */
.plan-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.sx-adjust { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 14px; }
.sx-adjust > summary, .sx-new > summary { cursor: pointer; font-weight: 600; list-style: none; }
.sx-adjust > summary::before { content: "+ "; color: var(--graphite); }
.sx-adjust[open] > summary::before { content: "− "; }
.sx-adjust .form { margin-top: 14px; max-width: none; }
.sx-new > summary::-webkit-details-marker, .sx-adjust > summary::-webkit-details-marker { display: none; }
.sx-new > summary { display: inline-flex; margin-bottom: 18px; }
.sx-new .form { max-width: 880px; }
.sx-test { margin-top: 14px; }
.sx-test p.ok b { color: var(--ok); }
.sx-test p.warn b { color: var(--warn); }
.sx-lic-form .demo-flag { align-self: end; }
.sx-lic-form .demo-flag small { color: var(--graphite); font-weight: 400; }
.scope { display: grid; gap: 10px; }
.scope label.check { align-items: center; flex-wrap: wrap; }
.scope select { width: auto; max-width: 100%; }

/* Planes: comparativa en columnas y editor con la comparativa al lado */
.cmp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--rule-strong); }
.cmp-wrap:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cmp { min-width: 520px; }
.cmp th[scope="col"] { text-align: center; font: 600 1rem/1.2 var(--f-display); letter-spacing: -.015em; text-transform: none; color: var(--ink); padding: 14px 10px 12px; }
.cmp th[scope="col"] small { font: 400 .74rem var(--f-body); color: var(--faint); }
.cmp th[scope="col"].hl { box-shadow: inset 0 3px 0 var(--area, var(--ink)); }
.cmp th[scope="col"].off a { color: var(--faint); }
.cmp th[scope="row"] { text-transform: none; letter-spacing: 0; font: 500 .84rem/1.3 var(--f-body); color: var(--graphite); white-space: normal; border-bottom: 1px solid var(--rule); padding: 11px 12px 11px 0; }
.cmp td { text-align: center; padding: 11px 10px; font-variant-numeric: tabular-nums; }
.cmp td.no { color: var(--faint); }
.cmp tr.price td { font-weight: 700; font-size: 1rem; }
.plan-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(24px, 3vw, 40px); align-items: start; margin-top: 8px; }
.plan-edit > * { min-width: 0; }
.plan-edit .plan-form { max-width: none; }
.plan-side { position: sticky; top: 130px; }
.plan-side .cmp { min-width: 0; font-size: .78rem; }
.plan-side .cmp td, .plan-side .cmp th[scope="col"] { padding: 8px 4px; }
.plan-side .cmp th[scope="col"] { font-size: .86rem; }
.plan-side .cmp th[scope="row"] { font-size: .76rem; padding-right: 6px; }
.plan-side .cmp tr.price td { font-size: .86rem; }

/* Ficha remota de una instalación */
.sx-alerts { margin-top: 18px; }
.health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--rule); }
.health > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.health > div:not(:nth-child(4n + 1)) { padding-left: 16px; border-left: 1px solid var(--rule); }
.health dt { font-size: .78rem; color: var(--graphite); font-weight: 500; margin-bottom: 6px; }
.health dd { margin: 0; font-size: .92rem; }
.health small { color: var(--graphite); }
.sx-cmds .row { flex-wrap: wrap; }
.sx-cmds .row input, .sx-cmds .row select { flex: 1 1 140px; min-width: 0; padding: 9px 12px; border-radius: 999px; }
.sx-cmds .row .btn { padding: 10px 16px; }
.sx-cmds .btn[disabled], .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.danger-act b { color: var(--bad); }
.sx-res { margin: 0 0 18px; }
.sx-res .t { margin-top: 10px; background: transparent; }
.sx-res .keyline { margin-top: 10px; }
.sx-res .key { font-size: .95rem; }
.logs { margin-top: 10px; max-height: 360px; overflow: auto; padding: 12px 14px; border-radius: 10px; background: var(--paper-2); font: 400 .78rem/1.5 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.sx-cmdlog td { font-size: .86rem; }

/* Demos */
.demo-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.demo-row { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.demo-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .8fr); gap: 16px; align-items: center; }
.demo-main small { color: var(--graphite); }
.demo-more { margin-top: 8px; }
.demo-more > summary { cursor: pointer; font-size: .86rem; color: var(--graphite); width: max-content; }
.demo-more > summary:hover { color: var(--ink); }
.demo-acts { display: grid; gap: 14px; padding: 14px 0 4px; }
.demo-acts .form.inline b { min-width: 150px; }
.demo-acts select, .demo-acts input[type="date"] { width: auto; }

/* Alojamientos */
.host-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.host { border: 1px solid var(--rule-strong); border-radius: 16px; padding: 18px 20px; background: var(--surface); display: grid; gap: 10px; align-content: start; }
.host-h small { color: var(--graphite); }
.host-k { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.host-k dt { font-size: .74rem; color: var(--graphite); }
.host-k dd { margin: 2px 0 0; font-size: .88rem; font-weight: 600; }
.host .usage-bar { max-width: none; }
.host summary { cursor: pointer; font-size: .86rem; color: var(--graphite); }
.host-sites { margin: 8px 0 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: .88rem; }
.vers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .9rem; }

@media (max-width: 900px) {
  .plan-edit { grid-template-columns: 1fr; }
  .plan-side { position: static; }
  .health { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health > div:not(:nth-child(4n + 1)) { padding-left: 0; border-left: 0; }
  .health > div:nth-child(2n) { padding-left: 16px; border-left: 1px solid var(--rule); }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .frow { grid-template-columns: 1fr; gap: 8px; }
  .fctl { justify-content: flex-start; }
  .xrow { grid-template-columns: 1fr 1fr; }
  .plan-sum { grid-template-columns: 1fr; }
  .sx-managed .mrow { grid-template-columns: 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .health { grid-template-columns: 1fr; }
  .health > div:nth-child(2n) { padding-left: 0; border-left: 0; }
  .host-k { grid-template-columns: 1fr 1fr; }
  .demo-main { grid-template-columns: 1fr; gap: 8px; }
  .demo-acts .form.inline b { width: 100%; }
}

/* 1.5.1 · Celular: nada se sale de la pantalla, aunque los nombres, dominios, rutas o modelos sean largos. */
main .two > *, main .grid2 > *, main .grid3 > *, main .grid4 > *, main .actions-grid > *, main .ficha > div, main .kv > *, .todo li div { min-width: 0; }
main .t td, main .kv dd, .todo li div a, .todo li div span, .health dd, .host-k dd, .demo-main, .sx-res, .log .m { overflow-wrap: anywhere; }
main input, main select, main textarea { max-width: 100%; min-width: 0; }
.demo-flag span { display: grid; gap: 2px; font-weight: 500; }
.scope label.check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.scope label.check select { flex: 1 1 200px; width: auto; }
.sx-cmdlog td:first-child small { margin-top: 2px; }
@media (max-width: 760px) {
  /* Listas que se apilan: la columna de "Estado/Quién/Cuándo" queda en una fila debajo del título. */
  .t.list.sx-cmdlog tr { grid-template-columns: auto auto 1fr; align-items: baseline; }
  .t.list.sx-cmdlog td:last-child { text-align: right; color: var(--graphite); font-size: .84rem; }
  .sx-test .t.list tr, .sx-res .t.list tr { grid-template-columns: 1fr auto; }
  .sx-res .t.list td.mono, .sx-test .t.list td.mono { grid-column: 1 / -1; font-size: .82rem; }
}
@media (max-width: 600px) {
  .sx-cmds .row input, .sx-cmds .row select { flex: 1 1 100%; }
  .sx-cmds .row .btn { flex: 0 0 auto; }
  .act { padding-right: 0; }
  .xrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .xrow > :first-child { grid-column: 1 / -1; }
  .xrow > label.check, .xrow > span:last-child { grid-column: 1 / -1; }
  .frow.changed, .xrow.changed, label.changed { padding-left: 10px; }
  .fsub { flex-wrap: wrap; }
  .demo-acts .form.inline > * { flex: 1 1 auto; }
  .demo-acts .form.inline input[type="date"] { flex: 1 1 100%; }
  .plan-sum { gap: 0; }
  .keyline .key { font-size: 1.05rem; letter-spacing: .02em; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { padding-bottom: 0 !important; border-bottom: 0; }
  .kv dd { padding-top: 4px; }
  .sec-h { flex-wrap: wrap; gap: 4px 12px; }
}
.scope { grid-template-columns: minmax(0, 1fr); }
.scope > label { min-width: 0; }
.scope label.check select { min-width: 0; max-width: 100%; }
.demo-flag span { display: block; }
main input[type="checkbox"], main input[type="radio"] { flex: none; width: auto; }
/* Instalaciones (8 columnas): se apilan desde tableta, no solo en el celular. */
@media (max-width: 1000px) {
  .t.list.sx-sites thead { display: none; }
  .t.list.sx-sites, .t.list.sx-sites tbody, .t.list.sx-sites td { display: block; }
  .t.list.sx-sites tr { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; }
  .t.list.sx-sites td { border: 0; padding: 0; }
  .t.list.sx-sites td:first-child { grid-column: 1 / -1; }
  .t.list.sx-sites .n { text-align: left; }
  .t.list.sx-sites .n::before { content: attr(data-l) " "; color: var(--graphite); font-size: .84rem; }
}
@media (max-width: 1000px) { .t.list.sx-sites tbody tr:hover td { background: none; } }

/* ===================================================================== 1.6 · Notificaciones y aplicación */
.bell { position: relative; }
.bell.on { color: var(--ink); background: var(--paper-2); }
.bell-n { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center;
  font: 700 .62rem/1 var(--f-body); color: #fff; background: var(--bad); box-shadow: 0 0 0 2px var(--paper); pointer-events: none; }

/* Bandeja */
.notif-day { margin-top: 26px; }
.notif-day > h2 { margin: 0 0 6px; }
.notif-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.notif { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.notif.new .notif-dot { background: var(--area, var(--brand)); box-shadow: none; }
.notif-b { display: grid; gap: 3px; min-width: 0; }
.notif-k { margin: 0; font-size: .78rem; color: var(--graphite); }
.notif-k b { color: var(--ink); font-weight: 600; }
.notif-t { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.notif-t:hover { text-decoration: underline; }
.notif-x { margin: 0; color: var(--graphite); font-size: .92rem; overflow-wrap: anywhere; }
.notif[data-event="seguridad"].new .notif-dot { background: var(--bad); }
.notif-empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 56px 16px; border-top: 1px solid var(--rule); color: var(--graphite); }
.notif-empty-ic svg.ic { width: 34px; height: 34px; color: var(--faint); }
.notif-empty p { max-width: 46ch; margin: 0; }

/* Mi cuenta › Notificaciones y Aplicación */
.push-box { border: 1px solid var(--rule-strong); border-radius: 14px; padding: 16px 18px; background: var(--surface); display: grid; gap: 10px; max-width: 620px; }
.push-state { margin: 0; font-weight: 500; }
.push-state.ok { color: var(--ok); }
.push-state.warn { color: var(--warn); }
.push-state.bad { color: var(--bad); }
.push-devs { list-style: none; margin: 0; padding: 0; max-width: 620px; border-top: 1px solid var(--rule); }
.push-devs li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.push-devs li > span { min-width: 0; overflow-wrap: anywhere; }
.push-devs .this-dev { display: inline-block; margin-top: 3px; font-size: .74rem; font-weight: 600; color: var(--ok); }
.push-devs .this-dev[hidden] { display: none; }
.notif-prefs { max-width: 620px; }
.notif-prefs th.c, .notif-prefs td.c { text-align: center; width: 72px; }
.notif-prefs td small { font-size: .8rem; margin-top: 2px; }
.sw-mini { display: inline-flex; justify-content: center; cursor: pointer; }
.sw-mini input { width: 18px; height: 18px; accent-color: var(--brand); }
.push-test { margin-top: 4px; }
.pwa-box .acts { margin: 6px 0 4px; }
.pwa-how { margin: 6px 0 0; padding-left: 1.1em; display: grid; gap: 6px; color: var(--graphite); font-size: .92rem; max-width: 64ch; }
.pwa-how[hidden] { display: none; }

/* Administración › Notificaciones */
.notif-send { max-width: 820px; }
.notif-send .aud { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.aud-people, .aud-role { margin-top: 14px; }
.aud-people[hidden], .aud-role[hidden] { display: none !important; }
.pick-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.pick-people label.check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--surface); font-weight: 500; cursor: pointer; }
.pick-people label.check:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pick-people .ava { width: 30px; height: 30px; border-radius: 9px; font-size: .66rem; }
.pick-people span { display: grid; min-width: 0; }
.pick-people small { color: var(--graphite); font-weight: 400; font-size: .78rem; }
.chans { display: grid; gap: 8px; }
.chans small { font-weight: 400; }

/* Sin conexión (offline.html) */
.offline-body { min-height: 100vh; display: grid; place-items: center; background: var(--paper); }
.offline { max-width: 420px; padding: 32px 20px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.offline-ic { border-radius: 18px; }
.offline h1 { font: 600 2rem/1.1 var(--f-display); letter-spacing: -.03em; margin: 8px 0 0; }
.offline p { color: var(--graphite); margin: 0; }
.offline-pie { margin-top: 18px !important; font: 600 .66rem/1 var(--f-brand); letter-spacing: .24em; text-transform: uppercase; }
@media (max-width: 600px) {
  .push-devs li { align-items: flex-start; }
  .notif-prefs th.c, .notif-prefs td.c { width: 56px; }
  .t.list.notif-prefs tr { grid-template-columns: 1fr auto auto; }
}
/* Los botones y bloques que el JS muestra u oculta con "hidden" (los .btn tienen display propio). */
[data-push] [hidden], [data-pwa] [hidden], .push-devs [hidden] { display: none !important; }
/* 1.6 · Teléfonos angostos: con la campana, la cabecera de Administración no cabía en 390 px. */
@media (max-width: 420px) {
  .bar1 { gap: 6px; }
  .tools .icon, .tools .tema { width: 34px; height: 34px; }
  .tools .tema { margin: 0 2px; }
}
@media (max-width: 420px) {
  .area-g { flex: 0 1 auto; min-width: 0; }
  .area-btn { max-width: 100%; }
  .area-btn .area-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* 1.6 · Diagnóstico del push (Mi cuenta › Notificaciones). */
.push-diag { margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 14px; }
.push-diag summary { cursor: pointer; font-weight: 600; }
.push-diag h4 { margin: 16px 0 6px; font: 600 .82rem/1.2 var(--f-body); color: var(--graphite); text-transform: uppercase; letter-spacing: .06em; }
.diag { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.diag li { min-width: 0; overflow-wrap: anywhere; }
.diag .chip { white-space: normal; }
.diag .mini { white-space: normal; text-align: left; line-height: 1.3; }
/* 1.6.3 · iPhone y iPad: Safari hace zoom al tocar un campo con letra menor a 16 px. Solo en iOS (Android y computadora
   quedan igual) los campos usan 16 px; el zoom con dos dedos sigue disponible. */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not(.code-input),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* 1.8.0 · Cobalto */
.role-descs.static li { display: block; margin: 0 0 6px; }
label.radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; margin: 0 0 10px; cursor: pointer; }
label.radio input { margin-top: 4px; accent-color: var(--brand); }
label.radio > span { display: flex; flex-direction: column; gap: 3px; }
label.radio .radio-head { display: flex; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
label.radio small { color: var(--graphite); font-size: .86rem; }
label.radio:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.co-own { margin: 4px 0 6px 30px; }
.co-icons { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; }
.co-icon-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; }
.co-icon-opt input { position: absolute; opacity: 0; pointer-events: none; }
.co-icon-opt:has(input:checked) .co-tile { outline: 2px solid var(--brand); outline-offset: 4px; }
.co-icon-opt input:focus-visible + .co-tile { outline: 2px dashed var(--brand); outline-offset: 4px; }
.co-tile { position: relative; width: 104px; height: 124px; border-radius: 9px; display: block; box-shadow: inset 0 0 0 1px var(--tline); background: var(--tbg); color: var(--tink); }
.co-tile small { position: absolute; left: 11px; top: 10px; font: 500 10px/1 "JetBrains Mono", ui-monospace, monospace; color: var(--tnum); }
.co-tile b { position: absolute; left: 9px; top: 32px; font: 200 46px/1 "Hanken Grotesk", system-ui, sans-serif; letter-spacing: -.03em; display: flex; align-items: baseline; }
.co-tile b i { display: inline-block; width: 5px; height: 8px; margin-left: 3px; background: var(--tnum); clip-path: polygon(26% 0, 74% 0, 74% 13%, 100% 13%, 100% 87%, 74% 87%, 74% 100%, 26% 100%, 26% 87%, 0 87%, 0 13%, 26% 13%); }
.co-tile em { position: absolute; left: 11px; bottom: 10px; font: 400 8.5px/1 "Hanken Grotesk", system-ui, sans-serif; font-style: normal; }
.co-tile-noche { --tbg: #15152a; --tink: #f4f3f6; --tnum: #8b85ff; --tline: rgba(244, 243, 246, .55); }
.co-tile-niebla { --tbg: #f4f3f6; --tink: #15152a; --tnum: #414897; --tline: rgba(21, 21, 42, .7); }
.co-tile-indigo { --tbg: #414897; --tink: #fff; --tnum: #c8c5ff; --tline: rgba(255, 255, 255, .7); }
.co-test { margin-top: 22px; }

/* ===================================================================== 1.21 · Kari
   Fichas médicas personales. El nivel de cada dato se muestra con un medidor de cuatro casillas: más casillas encendidas,
   menos personas lo ven (Público → Solo el titular). Sin colores por nivel: el color del área es solo para la marca. */
.lvm { display: inline-flex; gap: 2px; flex: none; }
.lvm i { width: 6px; height: 11px; background: var(--rule-strong); clip-path: polygon(25% 0, 75% 0, 75% 12%, 100% 12%, 100% 88%, 75% 88%, 75% 100%, 25% 100%, 25% 88%, 0 88%, 0 12%, 25% 12%); }
.lvm[data-lv="publico"] i:nth-child(-n+1), .lvm[data-lv="medico"] i:nth-child(-n+2), .lvm[data-lv="privado"] i:nth-child(-n+3), .lvm[data-lv="titular"] i { background: var(--ink); }
.ka-gaps { margin: 12px 0 0; }
.ka-logged { margin: 6px 0 0; }
@media (max-width: 640px) {
}
.ka-rowacts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ka-rowacts form { margin: 0; }
.ka-log tr.ka-sos td { background: var(--bad-bg); }
.ava.foto img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* Quién ve qué: los niveles a la izquierda y la ficha en un teléfono a la derecha. */
.ka-levels { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: clamp(24px, 4vw, 56px); align-items: start; margin-top: 18px; }
.ka-lvlist { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.ka-lvlist a { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.ka-lvlist a > span:last-child { display: grid; }
.ka-lvlist small { color: var(--graphite); }
.ka-lvlist a:hover { background: var(--paper-2); }
.ka-lvlist a[aria-current] { background: var(--paper-2); box-shadow: inset 2px 0 0 var(--ink); }
.ka-levels-side h3.sub { margin: 26px 0 8px; }
.ka-phone { border: 1px solid var(--rule-strong); border-radius: 28px; padding: 10px; background: var(--surface); box-shadow: var(--shadow); position: sticky; top: 124px; }
.ka-phone-screen { border-radius: 20px; overflow: auto; max-height: min(78vh, 760px); border: 1px solid var(--rule); background: #fbfafd; }
:root[data-theme="dark"] .ka-phone-screen { background: #0f0e14; }
.ka-phone .kf { font-size: 15px; }
@media (max-width: 900px) { .ka-levels { grid-template-columns: 1fr; } .ka-phone { position: static; max-width: 420px; } }

/* Etiqueta */
.ka-tag-hero { grid-template-columns: 148px minmax(0, 1fr); }
.ka-qr { width: 148px; height: 148px; background: #fff; border: 1px solid var(--rule-strong); }
.ka-qr svg { display: block; width: 100%; height: 100%; }
@media (max-width: 640px) { .ka-tag-hero { grid-template-columns: 1fr; } }

/* Herramienta NFC */
.ka-nfc-state { margin: 0 0 18px; padding: 12px 16px; border-left: 2px solid var(--faint); background: var(--paper-2); font-size: .93rem; border-radius: 0 10px 10px 0; }
.ka-nfc-state.ok { border-color: var(--ok); background: var(--ok-bg); }
.ka-nfc-state.warn { border-color: var(--warn); background: var(--warn-bg); }
.ka-nfc-pane { padding-top: 18px; max-width: 760px; }
.ka-nfc-target { display: grid; gap: 6px; margin-bottom: 8px; }
.ka-nfc-out { margin-top: 18px; display: grid; gap: 8px; }
.ka-nfc-msg { font-size: .93rem; padding: 10px 14px; border-left: 2px solid var(--faint); }
.ka-nfc-msg.ok { border-color: var(--ok); }
.ka-nfc-msg.warn { border-color: var(--warn); }
.ka-nfc-msg.bad { border-color: var(--bad); color: var(--bad); }
.ka-serie { padding: 22px 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); margin-top: 14px; }
.ka-serie-n { color: var(--graphite); margin-bottom: 6px; }
.ka-serie .key { font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); }
.ka-start li b { color: var(--ink); }

/* Tarjeta CR80 (85,6 × 54 mm). En pantalla se ve a escala; al imprimir, una cara por hoja del tamaño exacto. */
.ka-card-opts { margin-bottom: 26px; }
.ka-print { display: flex; flex-wrap: wrap; gap: 28px; }
.ka-card { width: 85.6mm; height: 54mm; position: relative; overflow: hidden; background: #fff; color: #141518; border: 1px solid var(--rule-strong); border-radius: 3.2mm;
  font-family: "Hanken Grotesk", var(--f-body); box-shadow: var(--shadow); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ka-front { padding: 4.6mm 5mm; display: grid; grid-template-rows: auto 1fr auto; }
/* Firma de Element Systems con la proporción de la web: en el frente la de la cabecera (isotipo ≈ 1,39 veces la letra,
   separación .87em); en el dorso la del pie (isotipo ≈ 1,1 veces la letra, .76em). Montserrat 600, espaciado .32em. */
.ka-card .es-iso { width: auto; flex: none; display: inline-block; overflow: visible; }
.ka-card .es-iso .c { fill: #141518; } .ka-card .es-iso .b { fill: #414897; }
.ka-card-firma { display: inline-flex; align-items: center; gap: .87em; font: 600 2.3mm/1 "Montserrat", var(--f-brand); letter-spacing: .32em; text-transform: uppercase; color: #141518; }
.ka-card-firma .es-iso { height: 3.2mm; }
.ka-card-marca { position: absolute; left: 4mm; bottom: 3.2mm; }
.ka-card-marca .es-iso { height: 2.1mm; }
.ka-cas { width: 3.4mm; height: 4.4mm; display: inline-grid; place-items: center; background: #c8336e; color: #fff; margin-right: 1.4mm; flex: none;
  clip-path: polygon(25.7% 0, 74.3% 0, 74.3% 10%, 100% 10%, 100% 90%, 74.3% 90%, 74.3% 100%, 25.7% 100%, 25.7% 90%, 0 90%, 0 10%, 25.7% 10%); }
.ka-cas b { font-size: 1.7mm; font-weight: 500; }
.ka-card-nfc { position: absolute; top: 4.2mm; right: 4.6mm; width: 7mm; height: 7mm; fill: none; stroke: #141518; stroke-width: 1.6; stroke-linecap: round; }
.ka-card-nfc circle { fill: #141518; stroke: none; }
.ka-card-main { align-self: end; padding-bottom: 2.4mm; }
.ka-card-k { font-size: 2.7mm; color: #55585f; margin: 1.4mm 0 0; display: flex; align-items: center; }
.ka-card-name { font-size: 6mm; font-weight: 300; line-height: 1.05; letter-spacing: -.02em; margin: 0; }
.ka-card-alert { margin: 0 -5mm -4.6mm; padding: 2.2mm 5mm; background: #a3151c; color: #fff; font-size: 2.9mm; font-weight: 600; line-height: 1.2; }
.ka-back { display: grid; grid-template-columns: 32mm minmax(0, 1fr); gap: 4mm; align-items: center; padding: 3.6mm 4mm 7.5mm; }
.ka-card-qr { width: 32mm; height: 32mm; }
.ka-card-qr svg { width: 100%; height: 100%; display: block; }
.ka-card-txt p { margin: 0; }
.ka-card-h { font-size: 3.1mm; font-weight: 600; line-height: 1.25; }
.ka-card-s { font-size: 2.4mm; color: #55585f; margin-top: 1.4mm !important; line-height: 1.3; }
.ka-card-code { font: 400 3mm/1 "JetBrains Mono", var(--f-mono); letter-spacing: .08em; margin-top: 3mm !important; }
.ka-card-sos { font-size: 2.6mm; font-weight: 600; color: #a3151c; margin-top: 1.6mm !important; }
@media print {
  @page { size: 85.6mm 54mm; margin: 0; }
  body:has(.ka-print) > :not(main), body:has(.ka-print) main > :not(.ka-print) { display: none !important; }
  body:has(.ka-print), body:has(.ka-print) main { background: #fff; padding: 0; margin: 0; }
  body:has(.ka-print)::before { display: none; }
  .ka-print { display: block; }
  .ka-card { border: 0; border-radius: 0; box-shadow: none; page-break-after: always; break-after: page; }
}

:root[data-theme="dark"] { --es-bi: #8B85FF; }
.ka-card { --es-bi: #414897; }

/* ===================================================================== 1.23.3 · Responsivo
   En el celular: las pestañas van en una fila que se desliza (con el dedo o arrastrando con el mouse); los grupos de
   botones y los formularios en línea pasan a uno por fila y a todo el ancho, con la misma separación entre filas; las
   tablas de lista se vuelven bloques con sus acciones abajo, también a todo el ancho. */
@media (max-width: 760px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 0 22px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    margin-inline: calc(-1 * max(16px, 4vw)); padding-inline: max(16px, 4vw); scroll-padding-inline: max(16px, 4vw); cursor: grab; touch-action: pan-x pan-y; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs.dragging { cursor: grabbing; user-select: none; }
  .tabs.dragging a { pointer-events: none; }
  .tabs a { flex: none; white-space: nowrap; }
  .margin { display: flex; align-items: baseline; gap: 12px; }
  .margin .t { margin-top: 0; }
}
@media (max-width: 640px) {
  .acts { flex-direction: column; align-items: stretch; gap: 10px; }
  .acts > .btn, .acts > a.btn, .acts > form, .acts > form .btn { width: 100%; justify-content: center; }
  .page-h.row .acts { width: 100%; }
  .form.inline, form.form.inline { flex-direction: column; align-items: stretch; gap: 10px; }
  .form.inline input, .form.inline select, .form.inline .btn { max-width: none !important; width: 100%; }
  .form.inline .btn { justify-content: center; }
  .form.inline input, .form.inline select, form.inline input { padding: 11px 14px; border-radius: 12px; font-size: .95rem; }
  .form.inline p, .form.inline .hint { margin: 0; }
  .btn { padding: 14px 18px; }
  .mini { min-height: 38px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; }
  /* Listas */
  .t.list tr { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 0; }
  .t.list td.end, .t.list .ka-rowacts { text-align: left; }
  .t.list td.end:empty { display: none; }
  .t.list td.end form, .t.list td.end .mini, .t.list td.end a.mini { width: 100%; }
  .t.list td.end .mini { margin-top: 4px; }
  .ka-rowacts { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
  .ka-rowacts form, .ka-rowacts .mini { width: 100%; }
  .t.list td small.block { margin-top: 2px; }
  /* Editor de fichas */
  .two-forms { gap: 28px; }
  .actions-grid .act .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
  .actions-grid .act .row .mini { width: 100%; }
  .creds .acts { flex-direction: column; }
}

/* Aire entre el texto de una parte y su formulario. */
.grid-side .note + .form, .grid-side .note + form, .grid-side .hint + .form { margin-top: 14px; }

/* Los campos dentro de un fieldset guardan la misma separación que el resto del formulario. */
.form > fieldset { display: grid; gap: 16px; min-width: 0; }
.form > fieldset > legend + * { margin-top: 2px; }

/* Secciones de una sola columna: el título con su raya y el contenido debajo. Sin números al margen (ver DISENO.md). */
.part.sec > .sec-h { margin-bottom: 16px; }
.part.sec > .sec-h h2 { margin: 0; }
.part.sec .note + .form, .part.sec .note + form, .part.sec .hint + .form { margin-top: 14px; }
.part.sec.danger-zone > .sec-h { border-bottom-color: var(--bad); }
.part.sec.danger-zone > .sec-h h2 { color: var(--bad); }

/* Logos de bancos y Payphone (assets/pagos/): siempre en su ficha de 5:2, con su color de marca. */
.kpago-logo { display: inline-grid; place-items: center; width: 120px; aspect-ratio: 5 / 2; border-radius: 8px; overflow: hidden; background: #fff; flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.kpago-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kpago-logo.is-payphone img { object-fit: contain; padding: 10px 14px; box-sizing: border-box; }
.kpago-logo.is-otro { background: var(--ink); color: var(--paper); place-items: center; grid-auto-flow: row; gap: 0; text-align: center; padding: 4px; box-sizing: border-box; }
.kpago-logo.is-otro b { font-size: 1.05rem; line-height: 1; letter-spacing: .04em; }
.kpago-logo.is-otro small { font-size: .66rem; line-height: 1.15; opacity: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- Kari · Ayuda (app.php?v=ayuda y Kari › Tutoriales)
   Videos como miniaturas que abren un reproductor; guías como filas que se tocan y un artículo para leer con calma. */
.kh-search { margin: 4px 0 6px; max-width: 520px; }
.kh-search input { width: 100%; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 12px 18px 12px 44px; font-size: 1rem; background: var(--paper)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23857a8c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 16px 50% / 18px no-repeat; }
.kh-search input:focus { outline: none; border-color: #c8336e; box-shadow: 0 0 0 4px rgba(200, 51, 110, .15); }
.kh-sec { margin-top: 34px; }
.kh-sec > h2 { margin: 0 0 6px; font: 400 1.4rem/1.2 "Hanken Grotesk", var(--f-display); letter-spacing: -.015em; }
.kh-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.kh-list li { border-bottom: 1px solid var(--rule); }
.kh-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 15px 0; color: var(--ink); text-decoration: none; }
.kh-list a:hover b { color: #c8336e; }
.kh-main { display: grid; gap: 3px; min-width: 0; }
.kh-main b { font-weight: 600; font-size: 1.02rem; transition: color .15s; }
.kh-main small { color: var(--graphite); font-size: .88rem; }
.kh-min { color: var(--graphite); font-size: .8rem; white-space: nowrap; }
.ke-chev { width: 9px; height: 9px; border-right: 1.5px solid var(--graphite); border-bottom: 1.5px solid var(--graphite); transform: rotate(-45deg); margin-right: 4px; display: inline-block; }

/* Videos */
.kv-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px 22px; margin-top: 12px; }
.kv { margin: 0; }
.kv-big { margin: 22px 0; }
.kv-card { all: unset; box-sizing: border-box; display: grid; gap: 10px; cursor: pointer; width: 100%; }
.kv-card:focus-visible .kv-thumb { outline: 3px solid #c8336e; outline-offset: 3px; }
.kv-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #1d1424; }
.kv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.kv-card:hover .kv-thumb img { transform: scale(1.03); }
.kv-title-card { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 18px; color: #fbf7f4; }
.kv-title-card b { font: 400 1.25rem/1.15 "Hanken Grotesk", sans-serif; max-width: 85%; }
.kv-title-card .kf-cas { --s: 22px; width: var(--s); height: calc(var(--s) * 1.3); display: inline-grid; place-items: center; background: #c8336e; color: #fff;
  clip-path: polygon(25.7% 0, 74.3% 0, 74.3% 10%, 100% 10%, 100% 90%, 74.3% 90%, 74.3% 100%, 25.7% 100%, 25.7% 90%, 0 90%, 0 10%, 25.7% 10%); }
.kv-title-card .kf-cas b { font: 500 11px/1 "Hanken Grotesk", sans-serif; }
.kv-play { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(255, 255, 255, .94);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .3); transition: transform .2s; }
.kv-play::after { content: ""; position: absolute; left: 23px; top: 18px; border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent #1d1424; }
.kv-card:hover .kv-play { transform: scale(1.08); }
.kv-dur { position: absolute; right: 10px; bottom: 10px; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv-cap { display: grid; gap: 3px; }
.kv-cap b { font-weight: 600; font-size: 1rem; color: var(--ink); }
.kv-cap small { color: var(--graphite); font-size: .86rem; line-height: 1.4; }
.kv-big .kv-thumb { border-radius: 14px; }
/* Reproductor */
.kv-dlg { border: 0; padding: 0; width: min(1000px, calc(100vw - 32px)); max-height: 92vh; background: #0d0a10; color: #fbf7f4; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 90px rgba(0, 0, 0, .5); }
.kv-dlg::backdrop { background: rgba(8, 5, 12, .82); }
.kv-dlg[open] { animation: ke-in .2s ease-out; }
.kv-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px 12px 20px; }
.kv-top b { font-weight: 600; font-size: .98rem; }
.kv-x { all: unset; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.6rem; line-height: 1; color: #d9cfe0; border-radius: 50%; }
.kv-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.kv-stage { position: relative; background: #000; }
.kv-stage video { display: block; width: 100%; max-height: calc(92vh - 120px); background: #000; }
.kv-embed { position: relative; aspect-ratio: 16 / 9; }
.kv-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kv-sum { margin: 0; padding: 14px 20px 18px; color: #c9bfd0; font-size: .9rem; }
@keyframes ke-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Guía */
.kg { max-width: 680px; }
.kg-back { display: inline-flex; align-items: center; gap: 8px; color: var(--graphite); text-decoration: none; font-size: .9rem; margin: 6px 0 18px; }
.kg-back::before { content: ""; width: 8px; height: 8px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.kg-back:hover { color: var(--ink); }
.kg-kicker { display: block; font: 600 .72rem/1.2 "Montserrat", "Hanken Grotesk", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #c8336e; margin-bottom: 10px; }
.kg-head h1 { margin: 0; font: 400 clamp(1.9rem, 5vw, 2.6rem)/1.08 "Hanken Grotesk", var(--f-display); letter-spacing: -.025em; }
.kg-lead { margin: 12px 0 0; font-size: 1.12rem; line-height: 1.5; color: var(--graphite); }
.kg-meta { display: block; margin-top: 12px; font-size: .82rem; color: var(--graphite); }
.kg-body { margin-top: 26px; font-size: 1.05rem; line-height: 1.7; }
.kg-body p { margin: 0 0 16px; }
.kg-body h2 { margin: 34px 0 10px; font: 500 1.35rem/1.25 "Hanken Grotesk", var(--f-display); letter-spacing: -.01em; }
.kg-body h3 { margin: 24px 0 8px; font-size: 1.08rem; font-weight: 600; }
.kg-body a { color: inherit; text-decoration-color: #c8336e; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.kg-list { margin: 0 0 18px; padding-left: 1.2em; }
.kg-list li { margin: 6px 0; }
.kg-list li::marker { color: #c8336e; }
.kg-steps { list-style: none; counter-reset: kg; margin: 6px 0 20px; padding: 0; display: grid; gap: 14px; }
.kg-steps li { counter-increment: kg; position: relative; padding-left: 46px; min-height: 30px; }
.kg-steps li::before { content: counter(kg); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: #c8336e; color: #fff; font: 600 .9rem/1 "Hanken Grotesk", sans-serif; }
.kg-note { margin: 22px 0; padding: 0 0 0 0; }
.kg-note b { display: block; font: 600 .72rem/1.2 "Montserrat", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #c8336e; margin-bottom: 6px; }
.kg-note[data-k="importante"] b { color: var(--bad); }
.kg-note p { margin: 0; font: 400 1.18rem/1.5 "Hanken Grotesk", var(--f-display); color: var(--ink); }
.kg-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule); }
.kg-pn a { display: grid; gap: 4px; text-decoration: none; color: var(--ink); }
.kg-pn a:hover b { color: #c8336e; }
.kg-pn small { color: var(--graphite); font-size: .8rem; }
.kg-pn b { font-weight: 600; transition: color .15s; }
.kg-next { text-align: right; grid-column: 2; }
.kg-help { margin-top: 30px; color: var(--graphite); font-size: .92rem; }
@media (max-width: 760px) {
  .kv-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 12px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  .kv-row::-webkit-scrollbar { display: none; }
  .kv-row > * { scroll-snap-align: start; }
  .kv-dlg { width: 100%; max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; margin: 0; display: none; }
  .kv-dlg[open] { display: flex; flex-direction: column; justify-content: center; }
  .kv-stage video { max-height: 78vh; }
  .kg-body { font-size: 1.02rem; }
  .kg-pn { grid-template-columns: 1fr; }
  .kg-next { grid-column: 1; text-align: left; }
}

/* ---------------------------------------------------------------- Kari · editor de la ficha (views/_ka_editor.php)
   Como una app: pestañas (riel a la izquierda en pantallas anchas, barra deslizable arriba en el celular), una parte a la
   vez, filas que se tocan para editar en una hoja (dialog; desde abajo en el celular). El selector de nivel conserva sus
   colores. Sin cajas con fondo ni iconos decorativos (ver DISENO.md). */
.ke { --kc: #c8336e; --lv-publico: #2f8a62; --lv-medico: #2f6db5; --lv-privado: #b7791f; --lv-titular: #7a5aa6; margin-top: 6px; }
:root[data-theme="dark"] .ke { --kc: #ef6a9b; --lv-publico: #4fb487; --lv-medico: #5b93d6; --lv-privado: #d79a3a; --lv-titular: #a184cc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ke { --kc: #ef6a9b; --lv-publico: #4fb487; --lv-medico: #5b93d6; --lv-privado: #d79a3a; --lv-titular: #a184cc; } }
.ke .lvm[data-lv] i { background: var(--rule-strong); }
.ke .lvm[data-lv="publico"] i:nth-child(-n+1) { background: var(--lv-publico); }
.ke .lvm[data-lv="medico"] i:nth-child(-n+2) { background: var(--lv-medico); }
.ke .lvm[data-lv="privado"] i:nth-child(-n+3) { background: var(--lv-privado); }
.ke .lvm[data-lv="titular"] i { background: var(--lv-titular); }

/* Pestañas */
.ke-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); position: sticky; top: var(--ke-top, 60px); z-index: 6; background: var(--paper); }
.ke-tabs::-webkit-scrollbar { display: none; }
.ke-tabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 13px 14px 12px; color: var(--graphite); text-decoration: none; font-size: .92rem; font-weight: 500;
  box-shadow: inset 0 -2px 0 transparent; transition: color .15s, box-shadow .15s; }
.ke-tabs a:hover { color: var(--ink); }
.ke-tabs a[aria-selected="true"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--kc); }
.ke-tabs b { font-size: .72rem; font-weight: 600; color: var(--graphite); font-variant-numeric: tabular-nums; }
.ke-tabs a[aria-selected="true"] b { color: var(--kc); }
.ke-panels { min-width: 0; }
.ke-panel { padding-top: 22px; scroll-margin-top: 140px; }
.ke:not(.ke-js) .ke-panel + .ke-panel { margin-top: 30px; border-top: 1px solid var(--rule); }
.ke-panel[hidden] { display: none !important; }
@media (min-width: 900px) {
  .ke-js { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 0 48px; align-items: start; }
  .ke-js .ke-tabs { flex-direction: column; gap: 0; border-bottom: 0; overflow: visible; background: transparent; top: calc(var(--ke-top, 60px) + 20px); padding-top: 18px; }
  .ke-js .ke-tabs a { justify-content: space-between; padding: 11px 12px 11px 16px; font-size: .95rem; box-shadow: inset 2px 0 0 var(--rule); }
  .ke-js .ke-tabs a[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--kc); }
}

/* Cabecera de cada parte */
.ke-ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 14px; }
.ke-ph h2 { margin: 0; font: 400 1.75rem/1.1 "Hanken Grotesk", var(--f-display); letter-spacing: -.02em; }
.ke-ph p { margin: 6px 0 0; color: var(--graphite); font-size: .92rem; line-height: 1.5; max-width: 56ch; }
.ke .btn.solid { background: var(--kc); border-color: var(--kc); color: #fff; }
.ke .btn.solid:hover { filter: brightness(1.06); }
.ke-addbtn span { font-size: 1.15em; line-height: 0; margin-right: 2px; }
.ke-empty { padding: 34px 0 30px; display: grid; justify-items: start; gap: 14px; border-top: 1px solid var(--rule); }
.ke-empty p { margin: 0; color: var(--graphite); max-width: 52ch; line-height: 1.55; }

/* Filas */
.ke-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.ke-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; border-bottom: 1px solid var(--rule); }
.ke-open { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px 0; cursor: pointer; min-width: 0; }
.ke-open:focus-visible { outline: 2px solid var(--kc); outline-offset: 2px; }
.ke-open:hover b { color: var(--kc); }
.ke-main { display: grid; gap: 4px; min-width: 0; }
.ke-main b { font-weight: 600; font-size: 1.04rem; overflow-wrap: anywhere; transition: color .15s; }
.ke-main small { color: var(--graphite); overflow-wrap: anywhere; font-size: .88rem; }
.ke-badges { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ke-badges:empty { display: none; }
.ke-badge { font-size: .76rem; font-weight: 600; color: var(--graphite); display: inline-flex; align-items: center; gap: 6px; }
.ke-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ke-badge[data-tone="bad"] { color: var(--bad); }
.ke-badge[data-tone="warn"] { color: var(--warn); }
.ke-badge[data-tone="ok"] { color: var(--lv-publico); }
.ke-chev { width: 9px; height: 9px; border-right: 1.5px solid var(--graphite); border-bottom: 1.5px solid var(--graphite); transform: rotate(-45deg); margin-right: 4px; }
.ke-lv { margin: 0; }

/* Selector de nivel: cuatro botones de color (se guarda al tocarlo en la fila) */
.lvseg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 2px; background: var(--paper); gap: 2px; flex-wrap: nowrap; }
.lvseg label { position: relative; cursor: pointer; margin: 0; display: block; }
.lvseg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lvseg label > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--graphite); white-space: nowrap; transition: background .15s, color .15s; }
.lvseg label:hover > span { color: var(--ink); }
.lvseg .lvm { display: none; }
.lvseg label[data-lv="publico"] { --c: var(--lv-publico); } .lvseg label[data-lv="medico"] { --c: var(--lv-medico); }
.lvseg label[data-lv="privado"] { --c: var(--lv-privado); } .lvseg label[data-lv="titular"] { --c: var(--lv-titular); }
.lvseg input:checked + span { background: var(--c); color: #fff; font-weight: 600; }
.lvseg input:checked + span .lvm { display: inline-flex; }
.lvseg input:checked + span .lvm i { background: rgba(255, 255, 255, .45) !important; }
.lvseg input:checked + span .lvm[data-lv="publico"] i:nth-child(-n+1), .lvseg input:checked + span .lvm[data-lv="medico"] i:nth-child(-n+2),
.lvseg input:checked + span .lvm[data-lv="privado"] i:nth-child(-n+3), .lvseg input:checked + span .lvm[data-lv="titular"] i { background: #fff !important; }
.lvseg input:focus-visible + span { outline: 2px solid var(--c); outline-offset: 2px; }
.lvseg.is-saving { opacity: .55; pointer-events: none; }
.lvtag { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; color: var(--graphite); white-space: nowrap; }
.lvtag[data-lv="publico"] { color: var(--lv-publico); } .lvtag[data-lv="medico"] { color: var(--lv-medico); }
.lvtag[data-lv="privado"] { color: var(--lv-privado); } .lvtag[data-lv="titular"] { color: var(--lv-titular); }

/* Partes de una sola entrada: un resumen para leer, y «Editar» abre la hoja */
.ke-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--rule); }
.ke-fact { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 5px; min-width: 0; }
.ke-fact.wide { grid-column: 1 / -1; }
.ke-fact dt { font-size: .8rem; color: var(--graphite); }
.ke-fact dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; font-size: 1rem; }
.ke-val { overflow-wrap: anywhere; }
.ke-none { color: var(--graphite); font-style: italic; }

/* Hojas (formularios) */
.ke-sheet { border: 0; padding: 0; margin: auto; width: min(640px, calc(100vw - 32px)); max-height: min(88vh, 900px); background: var(--paper); color: var(--ink);
  border-radius: 18px; box-shadow: 0 24px 70px rgba(15, 8, 20, .28); overflow: hidden; }
.ke-sheet[open] { display: flex; animation: ke-in .18s ease-out; }
.ke-sheet::backdrop { background: rgba(18, 10, 24, .5); }
@keyframes ke-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ke-sform { display: flex; flex-direction: column; width: 100%; max-width: none; min-height: 0; margin: 0; gap: 0; }
.ke-sh { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--rule); }
.ke-kicker { display: block; font: 600 .7rem/1.2 "Montserrat", "Hanken Grotesk", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--kc); margin-bottom: 4px; }
.ke-sh h3 { margin: 0; font: 500 1.35rem/1.2 "Hanken Grotesk", var(--f-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.ke-x { all: unset; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.6rem; line-height: 1; color: var(--graphite); border-radius: 50%; flex: none; }
.ke-x:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.ke-x:focus-visible { outline: 2px solid var(--kc); }
.ke-sb { padding: 20px 24px 8px; overflow-y: auto; display: grid; gap: 20px; overscroll-behavior: contain; }
.ke-sf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--rule); background: var(--paper); }
.ke-sf .btn.solid { margin-right: auto; min-width: 120px; justify-content: center; }
.ke-del { color: var(--bad) !important; }

/* Campos */
.ke-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.ke-grid .span2 { grid-column: 1 / -1; }
.ke-field { display: grid !important; gap: 7px !important; font-weight: 400 !important; min-width: 0; }
.ke-flabel { font-size: .9rem; font-weight: 600; color: var(--ink); }
.ke-flabel em { font-style: normal; font-weight: 500; font-size: .76rem; color: var(--kc); margin-left: 6px; }
.ke-flabel small { display: block; font-weight: 400; color: var(--graphite); font-size: .8rem; margin-top: 2px; }
.ke-field > small { color: var(--graphite); font-size: .8rem; line-height: 1.4; }
.ke-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), .ke-sheet textarea, .ke-sheet select {
  width: 100%; min-width: 0; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--paper); padding: 12px 14px; font-size: 1rem; box-shadow: none;
  transition: border-color .15s, box-shadow .15s; }
.ke-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):hover, .ke-sheet textarea:hover { border-color: color-mix(in srgb, var(--ink) 40%, var(--rule-strong)); }
.ke-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):focus, .ke-sheet textarea:focus, .ke-sheet select:focus {
  outline: none; border-color: var(--kc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--kc) 16%, transparent); }
.ke-sheet input::placeholder, .ke-sheet textarea::placeholder { color: color-mix(in srgb, var(--graphite) 70%, transparent); }
.ke-sheet textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.ke-sheet input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 48px; }
.ke-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ke-chips label { position: relative; cursor: pointer; margin: 0; }
.ke-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ke-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border: 1px solid var(--rule-strong); border-radius: 999px; font-size: .9rem; font-weight: 500; color: var(--ink); transition: all .15s; }
.ke-chips label:hover span { border-color: var(--ink); }
.ke-chips input:checked + span { background: var(--kc); border-color: var(--kc); color: #fff; }
.ke-chips input:checked + span::before { content: ""; width: 8px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translateY(-1px); }
.ke-chips input:focus-visible + span { outline: 2px solid var(--kc); outline-offset: 2px; }
.ke-chips .ke-chip-none span { border-style: dashed; color: var(--graphite); }
.ke-chips .ke-chip-none input:checked + span { background: transparent !important; color: var(--ink) !important; border-color: var(--ink); border-style: dashed; }
.ke-chips .ke-chip-none input:checked + span::before { border-color: var(--ink); }
.ke-checks { display: grid; gap: 14px; }
.ke-switch { display: inline-flex !important; align-items: center; gap: 12px !important; cursor: pointer; font-weight: 500 !important; font-size: .95rem; position: relative; }
.ke-switch input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ke-switch i { width: 44px; height: 26px; border-radius: 999px; background: var(--rule-strong); position: relative; flex: none; transition: background .18s; }
.ke-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
.ke-switch input:checked + i { background: var(--kc); }
.ke-switch input:checked + i::after { transform: translateX(18px); }
.ke-switch input:focus-visible + i { outline: 2px solid var(--kc); outline-offset: 2px; }
.ke-lvrow { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--rule); }
.ke-lvrow .lvseg { justify-self: start; }
.ke-frow { display: grid; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.ke-frow:last-child { border-bottom: 0; }
.ke-frow-lv { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.ke-mini-l { font-size: .8rem; color: var(--graphite); }

/* Foto */
.ke-avatar { width: 88px; height: 88px; overflow: hidden; display: block; border-radius: 50%; background: color-mix(in srgb, var(--ink) 6%, var(--paper)); flex: none; }
.ke-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ke-avatar img[hidden] { display: none; }
.ke-nophoto { width: 100%; height: 100%; display: grid; place-items: center; color: var(--graphite); font-size: .74rem; }
.ke-nophoto[hidden] { display: none; }
.ke-photo { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 6px 18px; align-items: center; }
.ke-photo-txt { display: grid; gap: 6px; min-width: 0; }
.ke-photo-txt small { color: var(--graphite); font-size: .82rem; line-height: 1.4; }
.ke-photo-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ke-photo-acts .btn { position: relative; overflow: hidden; cursor: pointer; }
.ke-photo-acts .btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.ke-photo-acts .btn:focus-within { outline: 2px solid var(--kc); outline-offset: 2px; }

/* Leyenda de niveles */
.ke-levels { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .8rem; color: var(--graphite); margin: 26px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); }
.ke-levels > span { display: inline-flex; align-items: center; gap: 8px; }

/* Recortar la foto */
.kcrop { border: 0; border-radius: 18px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(15, 8, 20, .35); }
.kcrop::backdrop { background: rgba(12, 8, 16, .62); }
.kcrop-in { display: grid; gap: 14px; padding: 22px; }
.kcrop h2 { margin: 0; font: 500 1.3rem/1.2 "Hanken Grotesk", var(--f-display); }
.kcrop p { margin: 0; color: var(--graphite); font-size: .88rem; }
.kcrop-view { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #111; touch-action: none; cursor: grab; user-select: none; }
.kcrop-view:active { cursor: grabbing; }
.kcrop-view img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.kcrop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .45); outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -2px; pointer-events: none; }
.kcrop-zoom { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; font-size: .86rem; font-weight: 600; }
.kcrop-zoom input { accent-color: var(--kc, #c8336e); width: 100%; }
.kcrop-acts { display: flex; justify-content: flex-end; gap: 8px; }
.kcrop .btn.solid { background: #c8336e; border-color: #c8336e; color: #fff; }

.ke { --ke-top: 104px; }
.kapp .ke { --ke-top: 60px; }
@media (max-width: 760px) {
  .ke { --ke-top: 56px; }
  .kapp .ke { --ke-top: 60px; }
  .ke-tabs { margin: 0 -16px; padding: 0 8px; }
  .ke-tabs a { padding: 13px 11px 12px; font-size: .9rem; }
  .ke-ph h2 { font-size: 1.45rem; }
  .ke-ph .ke-addbtn { width: 100%; justify-content: center; }
  .ke-row { grid-template-columns: minmax(0, 1fr); gap: 0 0; padding-bottom: 14px; }
  .ke-open { padding: 14px 0 10px; }
  .ke-lv .lvseg { display: flex; width: 100%; }
  .lvseg label { flex: 1; }
  .ke-lv .lvseg label > span, .ke-sheet .lvseg label > span { width: 100%; justify-content: center; padding: 8px 2px; font-size: .74rem; }
  .ke-sheet .lvseg { display: flex; width: 100%; }
  .lvseg input:checked + span .lvm { display: none; }
  .ke-facts { grid-template-columns: 1fr; }
  .ke-grid { grid-template-columns: 1fr; }
  /* La hoja sale desde abajo, a lo ancho */
  .ke-sheet { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .ke-sheet[open] { animation: ke-up .22s ease-out; }
  .ke-sh, .ke-sb, .ke-sf { padding-left: 18px; padding-right: 18px; }
  .ke-sf { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .ke-sf .btn.solid { flex: 1 1 100%; order: -1; }
  .ke-photo { grid-template-columns: 72px minmax(0, 1fr); }
  .ke-photo .ke-avatar { width: 72px; height: 72px; }
}
@keyframes ke-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* Ajustes › PIN: quitarlo, separado de cambiarlo */
.pin-quitar{margin-top:14px}
