/* =============================================================
   Soy Labs — hoja de estilos
   Base: "Fichas de arranque" de DISENO.md. Todo color va por token; ningun
   componente escribe un hex salvo los semanticos. Los tokens se definen
   enteros en :root y solo se REDEFINEN en los dos bloques oscuros, para que
   el estado "sin data-theme con el sistema en oscuro" tambien quede cubierto.
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --surface-2: #f4f7fb;
  --surface-3: #eef3f9;
  --ink: #0f1720;
  --muted: #58657a;
  --brand: #1e6fe8;
  --brand-dark: #1a5fc8;
  --brand-tenue: rgba(30, 111, 232, .10);
  --line: #d5dbe1;
  --line-soft: #dde5ee;
  --line-strong: #b9c6d6;
  --hover-bg: #f1f5f9;
  --input-bg: #ffffff;
  --ring: rgba(30, 111, 232, .18);
  --ok: #0f7a55;
  --warn: #b3261e;
  --danger-ink: #b91c1c;
  --danger-line: #fca5a5;
  --on-brand: #ffffff;
  --nav-ink: #39414f;
  --nav-icon: #6b7480;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .04), 0 8px 20px rgba(16, 24, 40, .07);
  --radius: 8px;
  --radius-card: 12px;
  --field-h: 34px;
  --sidebar-w: 236px;
  /* Que icono ensena el interruptor de tema. Va por token para no definir
     comportamiento solo dentro de un @media. */
  --icono-luna: inline-flex;
  --icono-sol: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1119; --card: #1e293b; --surface-2: #16202c; --surface-3: #1b2733;
    --ink: #e8eef6; --muted: #93a2b5; --brand: #60a5fa; --brand-dark: #93c5fd;
    --brand-tenue: rgba(96, 165, 250, .14);
    --line: #334155; --line-soft: #243141; --line-strong: #3f5068;
    --hover-bg: #334155; --input-bg: #0f172a; --ring: rgba(96, 165, 250, .28);
    --ok: #34d399; --danger-ink: #fca5a5; --danger-line: #7f1d1d;
    --on-brand: #0b1119;
    --nav-ink: #cbd5e1; --nav-icon: #8b97a8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .35);
    --icono-luna: none;
    --icono-sol: inline-flex;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1119; --card: #1e293b; --surface-2: #16202c; --surface-3: #1b2733;
  --ink: #e8eef6; --muted: #93a2b5; --brand: #60a5fa; --brand-dark: #93c5fd;
  --brand-tenue: rgba(96, 165, 250, .14);
  --line: #334155; --line-soft: #243141; --line-strong: #3f5068;
  --hover-bg: #334155; --input-bg: #0f172a; --ring: rgba(96, 165, 250, .28);
  --ok: #34d399; --danger-ink: #fca5a5; --danger-line: #7f1d1d;
  --on-brand: #0b1119;
  --nav-ink: #cbd5e1; --nav-icon: #8b97a8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .35);
  --icono-luna: none;
  --icono-sol: inline-flex;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--surface-3);
  border-radius: 5px;
  padding: 1px 5px;
}

.icono { flex: none; vertical-align: -.15em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ---------- Armazón ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.content { min-width: 0; min-height: 100vh; padding: 0 0 64px; }
.page { padding: 24px 28px 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; padding: 20px 18px 18px; }
.brand:hover { text-decoration: none; }

/* ---------- Logotipo ----------
   El archivo es un PNG de tinta fija (#1c1c1c). Por defecto se pinta tal cual,
   que es lo correcto sobre fondo claro y lo unico que entienden los navegadores
   sin mascaras. Donde hay soporte de mascara —practicamente todos— se usa su
   canal alfa para recortar un fondo --ink, y entonces el mismo archivo sale en
   tinta sobre claro y en blanco sobre oscuro. */
.brand-mark, .auth-logo {
  display: block;
  aspect-ratio: 1990 / 929;
  background: url("img/logo.png") center / contain no-repeat;
}
.brand-mark { width: 98px; }
.auth-logo { width: 132px; }

@supports ((mask-image: url("img/logo.png")) or (-webkit-mask-image: url("img/logo.png"))) {
  .brand-mark, .auth-logo {
    background: var(--ink);
    -webkit-mask: url("img/logo.png") center / contain no-repeat;
    mask: url("img/logo.png") center / contain no-repeat;
  }
}

.nav-list { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; margin: 0; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  font-size: 14.5px; font-weight: 500;
  color: var(--nav-ink); text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}
.nav-link:hover { background: var(--hover-bg); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--brand-tenue); color: var(--brand); font-weight: 600; }
.nav-icon { display: inline-flex; width: 18px; justify-content: center; color: var(--nav-icon); }
.nav-link.active .nav-icon { color: var(--brand); }
.nav-sep { display: block; height: 1px; margin: 10px 11px; background: var(--line-soft); }

.sidebar-foot {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.usuario-caja { display: flex; align-items: center; gap: 10px; min-width: 0; }
.usuario-datos { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.usuario-nombre { font-size: 13px; font-weight: 600; }
.usuario-rol { font-size: 11.5px; color: var(--muted); }
.sidebar-acciones { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none;
  border-radius: 9px; background: var(--brand); color: var(--on-brand);
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
}
.avatar-sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }

.icono-boton {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--muted);
  cursor: pointer; opacity: .7;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
}
.icono-boton:hover { opacity: 1; color: var(--brand); background: var(--hover-bg); }
/* Sin JavaScript no hay interruptor que valga: se esconde en lugar de
   dejar un boton que no responde. */
#cambiar-tema { display: none; }
.js #cambiar-tema { display: inline-flex; }
.tema-claro { display: var(--icono-luna); }
.tema-oscuro { display: var(--icono-sol); }

/* ---------- Banda de cabecera ---------- */
.pagebar {
  margin: 0 -28px 22px;
  border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none;
  background: var(--card);
}
.page > .pagebar:first-child { margin-top: -24px; }
.pagebar-main {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 20px 28px;
}
.pagebar-heading { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pagebar-heading h1 {
  margin: 0; font-size: 19px; line-height: 1.5; font-weight: 660;
  letter-spacing: -.015em; text-wrap: balance;
}
.pagebar-heading p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.pagebar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagebar-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 12px 28px; background: var(--bg);
  border-top: 1px solid var(--line-soft);
}

/* ---------- Tarjeta ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.section-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
}
.section-card-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 650; color: var(--ink); min-width: 0;
}
.section-card-icon { color: var(--muted); display: inline-flex; }
.section-card-count {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--surface-3); border-radius: 999px;
  padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.card-vacio { margin: 0; padding: 18px 16px; font-size: 13px; color: var(--muted); }

/* ---------- Controles ---------- */
.button {
  display: inline-flex; align-items: center; gap: 8px;
  height: var(--field-h); padding: 0 14px;
  border-radius: var(--radius); border: 1px solid transparent;
  background: var(--brand); color: var(--on-brand);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
}
.button:hover { background: var(--brand-dark); text-decoration: none; color: var(--on-brand); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.button.secondary:hover { background: var(--hover-bg); border-color: var(--line-strong); color: var(--ink); }
.button.danger { background: #c0392f; color: #fff; }
.button.danger:hover { background: #a52a21; color: #fff; }

.linklike {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0; border: none; background: none;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--muted); cursor: pointer; text-decoration: none;
}
.linklike:hover { color: var(--brand); text-decoration: underline; }
.linklike.peligro { color: var(--danger-ink); }
.linklike.peligro:hover { color: var(--danger-ink); }

.input, .select {
  height: var(--field-h); padding: 0 11px;
  font-family: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--input-bg); color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.textarea {
  padding: 9px 11px; font-family: inherit; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--input-bg); color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring);
}

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.form label .input, .form label .select, .form label .textarea { font-weight: 400; color: var(--ink); }

input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; }

/* ---------- Pastillas y etiquetas ---------- */
.pchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 12.5px; font-weight: 550; color: var(--muted); text-decoration: none;
}
.pchip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
/* Pastilla que solo informa: no se pulsa, asi que tampoco reacciona al raton.
   Una pastilla que se ilumina y no lleva a ningun sitio se lee como rota. */
.pchip.is-static { cursor: default; }
.pchip.is-static:hover { border-color: var(--line); color: var(--muted); }
.pchip.is-active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.pchip.is-empty { opacity: .55; }
.pchip-n {
  min-width: 18px; padding: 0 6px; text-align: center; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pchip.is-active .pchip-n { background: rgba(127, 127, 127, .25); color: var(--on-brand); }

.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.etiqueta {
  display: inline-flex; align-items: center;
  padding: 0 6px; border-radius: 999px;
  background: var(--brand-tenue); color: var(--brand);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.estado {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 550; color: var(--muted); white-space: nowrap;
}
.estado-admin { color: var(--brand); }
.estado-off { color: var(--danger-ink); }

/* ---------- Tabla ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  padding: 10px 14px; text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border-bottom: 1px solid var(--line-soft);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover-bg); }

.tabla-usuarios .col-accion { text-align: right; white-space: nowrap; }
.fila-inactiva .celda-usuario-texto, .fila-inactiva .lista-secciones { opacity: .6; }

.celda-usuario { display: flex; align-items: center; gap: 10px; min-width: 0; }
.celda-usuario-texto { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.celda-nombre { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; }
.celda-email { font-size: 12px; color: var(--muted); }
.lista-secciones { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Aviso ---------- */
.notice {
  margin: 0 0 16px; padding: 11px 14px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--card); border: 1px solid var(--line-soft);
  border-left: 3px solid var(--brand); border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.notice-error { border-left-color: var(--danger-line); color: var(--danger-ink); }

/* ---------- Vacíos ---------- */
.vacio {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 28px 24px; color: var(--muted);
}
.vacio .icono { color: var(--muted); opacity: .75; }
.vacio h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.012em; color: var(--ink); }
.vacio p { margin: 0; max-width: 62ch; font-size: 13.5px; }
.vacio .button { margin-top: 6px; }

/* ---------- Portada: rejilla de secciones ---------- */
.rejilla-secciones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}
.seccion-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; color: inherit; text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.seccion-card:hover { text-decoration: none; border-color: var(--brand); background: var(--surface-2); }
.seccion-icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none;
  border-radius: 10px; background: var(--brand-tenue); color: var(--brand);
}
.seccion-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.seccion-nombre { font-size: 14px; font-weight: 650; color: var(--ink); }
.seccion-desc { font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* ---------- Lista tipo bandeja ---------- */
.lista-bandeja { list-style: none; margin: 0; padding: 0; }
.bandeja-fila {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--line-soft);
}
.bandeja-fila:last-child { border-bottom: 0; }
.bandeja-texto { font-size: 13.5px; line-height: 1.35; min-width: 0; }
.bandeja-meta {
  margin-left: auto; flex: none;
  font-size: 12px; color: var(--muted);
}

/* ---------- Panel de edición ---------- */
.panel-edicion { margin-bottom: 22px; }
.panel-peligro { border-color: var(--danger-line); }
.panel-form { padding: 18px 16px; }
.panel-form > p { margin: 0 0 14px; font-size: 13.5px; }

.form-fila {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}
.form-acciones { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ayuda { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); max-width: 68ch; }

.check-suelto {
  display: flex !important; align-items: center; gap: 8px;
  align-self: end; height: var(--field-h);
  font-size: 13px !important; font-weight: 500 !important; color: var(--ink) !important;
  cursor: pointer;
}

/* Casillas de permisos: la caja entera es pulsable, no solo el cuadradito. */
.permisos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 8px;
  margin: 4px 0 0; padding: 0; border: 0;
}
.permisos legend {
  padding: 0 0 8px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.permiso {
  display: flex !important; align-items: flex-start; gap: 9px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); cursor: pointer;
  font-weight: 400 !important; color: var(--ink) !important;
  transition: border-color 120ms ease, background 120ms ease;
}
.permiso:hover { border-color: var(--line-strong); background: var(--surface-2); }
.permiso:has(input:checked) { border-color: var(--brand); background: var(--brand-tenue); }
.permiso input { margin-top: 2px; flex: none; }
.permiso-cuerpo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.permiso-nombre { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.permiso-desc { font-size: 12px; line-height: 1.4; color: var(--muted); }

.panel-sub {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
}
.form-linea { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.form-linea-campo {
  display: grid; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.form-linea-campo .input { min-width: 220px; font-weight: 400; color: var(--ink); }

/* ---------- Login ---------- */
.body-auth { background: var(--bg); }
.auth-shell {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 20px;
}
.auth-caja {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  width: 100%; max-width: 400px;
}
.auth-card { width: 100%; padding: 26px 24px 24px; box-shadow: var(--shadow-md); }
.auth-encabezado { margin-bottom: 20px; }
.auth-encabezado h1 {
  margin: 0 0 4px; font-size: 22px; font-weight: 660;
  letter-spacing: -.02em; text-wrap: balance;
}
.auth-encabezado p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.auth-boton { width: 100%; justify-content: center; height: 38px; margin-top: 4px; }
.auth-pie {
  margin: 18px 0 0; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
.auth-legal { margin: 0; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

/* ---------- Utilidades ---------- */
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.nums { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scroll-x { overflow-x: auto; }

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px;
    border-right: 0; border-bottom: 1px solid var(--line-soft);
    padding: 10px 16px;
  }
  .brand { padding: 0; margin-right: auto; }
  .brand-mark { width: 74px; }
  .nav-list { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; padding: 4px 0 0; }
  .nav-link { font-size: 13.5px; padding: 7px 10px; }
  .nav-sep { display: none; }
  .sidebar-foot {
    margin-top: 0; padding: 0; border-top: 0;
    flex-direction: row; align-items: center; gap: 10px;
  }
  .usuario-datos { display: none; }
  .page { padding: 18px 16px 0; }
  .pagebar { margin-left: -16px; margin-right: -16px; }
  .page > .pagebar:first-child { margin-top: -18px; }
  .pagebar-main { padding: 16px; }
  .pagebar-row { padding: 10px 16px; }
  .panel-sub { flex-direction: column; align-items: stretch; }
  .form-linea-campo .input { min-width: 0; width: 100%; }
}

/* ---------- Segundo factor ---------- */
/* La clave se lee para copiarla a mano, asi que va grande, monoespaciada y con
   espacio entre grupos: un caracter mal copiado deja la cuenta sin activar. */
.clave-totp {
  margin: 6px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px; font-weight: 600; letter-spacing: .06em;
  overflow-wrap: anywhere;
  -webkit-user-select: all; user-select: all;
}
.rescate-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 8px;
  margin: 12px 0; padding: 0;
  list-style: none;
}
.rescate-lista li {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px; letter-spacing: .04em; text-align: center;
  -webkit-user-select: all; user-select: all;
}
/* Seis cifras y nada mas: campo corto, centrado y bien separado, que se teclea
   mirando el telefono y sin fijarse en la pantalla. */
.auth-codigo {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px; letter-spacing: .35em; text-align: center;
  height: 44px;
}
