/* Portal de continuidad familiar. Cálido y sereno: nada de alarma salvo cuando de verdad hace falta.
   Sin recursos externos (la CSP solo permite los propios): Inter propia y la serif del sistema para los títulos.
   Movimiento: solo transform y opacity, curvas con carácter, 150–260 ms, prefers-reduced-motion respetado. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f7f4ef; --bg-2: #efeae2; --surface: #ffffff; --surface-2: #f6f2ec; --border: #e2dbd0; --border-soft: #ede8df;
  --text: #22201c; --text-2: #514c43; --muted: #6b6459;
  --accent: #0f6e64; --accent-hover: #0b5951; --accent-soft: #e0f0ec; --accent-glow: rgba(15, 110, 100, .2); --on-accent: #ffffff;
  --calido: #f2d7b6; --calido-soft: #fbefe0; --hondo: #123a36; --hondo-2: #1b4f49; --on-hondo: #f4efe7; --menta: #9fd8cd;
  --ok: #0f6e64; --ok-soft: #e0f0ec; --warn: #85560a; --warn-soft: #fbedd0; --danger: #a8321f; --danger-soft: #fae5e0;
  --shadow-1: 0 1px 2px rgba(60, 45, 25, .06), 0 1px 1px rgba(60, 45, 25, .04);
  --shadow-2: 0 18px 40px -18px rgba(60, 45, 25, .3), 0 2px 8px rgba(60, 45, 25, .06);
  --radius: 18px; --radius-sm: 12px;
  --ease-out: cubic-bezier(.23, 1, .32, 1); --ease-in-out: cubic-bezier(.77, 0, .175, 1); --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110f; --bg-2: #191713; --surface: #1c1a17; --surface-2: #24211d; --border: #37322b; --border-soft: #2b2722;
    --text: #f0ebe3; --text-2: #cbc3b6; --muted: #a0978a;
    --accent: #7fd1c3; --accent-hover: #9fe0d5; --accent-soft: #14332f; --accent-glow: rgba(127, 209, 195, .22); --on-accent: #062520;
    --calido: #5a4630; --calido-soft: #2d2419; --hondo: #0e2c29; --hondo-2: #153c37; --on-hondo: #f0ebe3; --menta: #7fd1c3;
    --ok: #7fd1c3; --ok-soft: #14332f; --warn: #efc374; --warn-soft: #33270f; --danger: #ff9d8c; --danger-soft: #3d1a14;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 18px 40px -18px rgba(0, 0, 0, .75), 0 2px 8px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100dvh; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.15rem); }
h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- disposición ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { gap: 8px; } .stack-lg { gap: 22px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.arriba { align-items: start; }
.muted, .ayuda { color: var(--muted); } .ayuda { font-size: .875rem; line-height: 1.45; }
.text-2 { color: var(--text-2); }
.centrado { text-align: center; }

.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-1); }
.rotulo { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }

/* ---------- botones ---------- */
.btn { --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  font: 600 .95rem/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd); border-radius: 999px;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primario { --b-bg: var(--accent); --b-fg: var(--on-accent); --b-bd: var(--accent); }
.btn.calido { --b-bg: var(--calido); --b-fg: var(--text); --b-bd: var(--calido); }
.btn.fantasma { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text-2); }
.btn.peligro { --b-fg: var(--danger); --b-bd: var(--danger-soft); --b-bg: var(--danger-soft); }
.btn.grande { min-height: 56px; padding: 14px 30px; font-size: 1.08rem; }
.btn.chico { min-height: 44px; padding: 8px 12px; font-size: .875rem; }
.btn.bloque { width: 100%; }
.btn__txt { display: inline-flex; align-items: center; gap: 8px; transition: opacity 160ms ease; }
.btn[data-cargando] { position: relative; }
.btn[data-cargando] .btn__txt { opacity: 0; }
.btn[data-cargando]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: giro .6s linear infinite; }
@keyframes giro { to { transform: rotate(1turn); } }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { --b-bg: var(--surface-2); }
  .btn.primario:hover:not(:disabled) { --b-bg: var(--accent-hover); --b-bd: var(--accent-hover); }
  .btn.calido:hover:not(:disabled) { --b-bg: var(--calido); transform: translateY(-1px); }
  .btn.peligro:hover:not(:disabled) { --b-bg: var(--danger-soft); border-color: var(--danger); }
}
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- formularios ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .campo > .campo__titulo { font-weight: 600; font-size: .9rem; }
.input { width: 100%; min-height: 46px; padding: 10px 14px; font: 400 16px/1.4 var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color 150ms ease, box-shadow 150ms ease; }
textarea.input { resize: vertical; min-height: 76px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.input.mono { font-family: var(--mono); }
.input.codigo { font: 600 1.8rem/1.2 var(--mono); letter-spacing: .35em; text-align: center; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.conmutador { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: .95rem; }
.conmutador input { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--border); position: relative; flex: none; cursor: pointer; margin: 0; transition: background-color 160ms ease; }
.conmutador input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 180ms var(--ease-out); }
.conmutador input:checked { background: var(--accent); }
.conmutador input:checked::after { transform: translateX(18px); }
.segmentos { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.segmentos button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: 600 .875rem/1.25 var(--font); cursor: pointer; padding: 8px; }
.segmentos button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 500 .875rem/1.2 var(--font); cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease; }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--hondo); border-color: var(--hondo); color: var(--on-hondo); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 600; line-height: 1.5; background: var(--surface-2); color: var(--text-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.n1 { background: var(--calido-soft); color: var(--text); border: 1px solid var(--calido); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: .93rem; }
.banner > .icon { margin-top: 2px; }
.banner.ok { background: var(--ok-soft); color: var(--text); }
.banner.warn { background: var(--warn-soft); color: var(--text); }
.banner.danger { background: var(--danger-soft); color: var(--text); }
.banner.danger > .icon { color: var(--danger); } .banner.warn > .icon { color: var(--warn); } .banner.ok > .icon { color: var(--ok); }

.progreso { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progreso i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 600ms var(--ease-out); }

/* ---------- cabecera y navegación ---------- */
.barra { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border-soft); padding-top: env(safe-area-inset-top); }
.barra__in { max-width: 1080px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 12px; }
.marca { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-family: var(--serif); font-weight: 600; line-height: 1.15; }
.marca small { display: block; font: 500 .78rem/1.3 var(--font); color: var(--muted); }
.marca__logo { width: 40px; height: 40px; border-radius: 14px; background: var(--hondo); color: var(--calido); display: grid; place-items: center; flex: none; }
:root[data-theme="dark"] .marca__logo { color: var(--menta); }
.tabs { max-width: 1080px; margin: 0 auto; padding: 0 12px 8px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; padding: 9px 14px; border-radius: 99px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: .9rem; min-height: 40px; display: inline-flex; align-items: center; }
.tab[aria-current="page"] { background: var(--hondo); color: var(--on-hondo); }
@media (hover: hover) and (pointer: fine) { .tab:not([aria-current]):hover { background: var(--surface-2); } }
.nav-movil { display: none; }
.principal { max-width: 1080px; margin: 0 auto; padding: 24px 18px 56px; }
@media (max-width: 720px) {
  .tabs { display: none; }
  .nav-movil { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border-soft); }
  .nav-movil a, .nav-movil button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; border: 0; background: transparent; border-radius: 14px; color: var(--muted); text-decoration: none; font: 600 .7rem/1.1 var(--font); cursor: pointer; transition: transform 160ms var(--ease-out); }
  .nav-movil a:active, .nav-movil button:active { transform: scale(.95); }
  .nav-movil [aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .principal { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}
.cabecera-pagina { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.cabecera-pagina p { color: var(--text-2); max-width: 62ch; margin-top: 6px; }

/* ---------- estado principal ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 28px; background: linear-gradient(135deg, var(--surface) 40%, var(--accent-soft)); }
.hero[data-nivel="warn"] { background: linear-gradient(135deg, var(--surface) 40%, var(--warn-soft)); }
.hero[data-nivel="danger"] { background: linear-gradient(135deg, var(--surface) 40%, var(--danger-soft)); }
.hero[data-nivel="neutro"] { background: linear-gradient(135deg, var(--surface) 40%, var(--calido-soft)); }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 24px 18px; gap: 18px; } .hero .row { justify-content: center; } }
.anillo { position: relative; width: 156px; height: 156px; flex: none; color: var(--ok); }
.anillo[data-nivel="warn"] { color: var(--warn); } .anillo[data-nivel="danger"] { color: var(--danger); } .anillo[data-nivel="neutro"] { color: var(--muted); }
.anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.anillo .pista { stroke: var(--border-soft); }
.anillo .valor { stroke: currentColor; stroke-dasharray: 326.73; stroke-dashoffset: var(--off, 326.73); transition: stroke-dashoffset 900ms var(--ease-out); }
.anillo__centro { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--text); }
.anillo__centro b { font: 600 2.1rem/1 var(--serif); }
.anillo__centro span { font-size: .78rem; color: var(--muted); max-width: 11ch; line-height: 1.25; margin-top: 4px; }

/* ---------- línea de tiempo ---------- */
.linea { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; }
.linea li { display: grid; grid-template-columns: 58px 18px 1fr; gap: 10px; align-items: start; min-height: 48px; position: relative; }
.linea li::before { content: ""; position: absolute; left: 76px; top: 16px; bottom: -6px; width: 2px; background: var(--border); }
.linea li:last-child::before { display: none; }
.linea .dia { font-weight: 700; font-size: .85rem; text-align: right; padding-top: 1px; font-variant-numeric: tabular-nums; }
.linea .nodo { width: 14px; height: 14px; border-radius: 50%; margin: 4px 2px 0; background: var(--surface); border: 3px solid var(--border); z-index: 1; }
.linea .que { font-size: .92rem; color: var(--text-2); padding-bottom: 12px; }
.linea li.pasado .nodo { background: var(--warn); border-color: var(--warn); }
.linea li.pasado::before { background: var(--warn); }
.linea li.siguiente .nodo { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-glow); }
.linea li.siguiente .que { color: var(--text); font-weight: 600; }
.linea li[data-tipo="nivel1"] .dia, .linea li[data-tipo="nivel2"] .dia { color: var(--accent); }

/* ---------- listas y tarjetas ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.lista > li:first-child { border-top: 0; }
.punto { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.punto.ok { background: var(--ok-soft); color: var(--ok); } .punto.warn { background: var(--warn-soft); color: var(--warn); } .punto.danger { background: var(--danger-soft); color: var(--danger); }

.pasos-config { list-style: none; margin: 0; padding: 0; counter-reset: paso; display: flex; flex-direction: column; gap: 6px; }
.pasos-config li { counter-increment: paso; display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--radius-sm); }
.pasos-config li::before { content: counter(paso); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; border: 2px solid var(--border); color: var(--muted); flex: none; }
.pasos-config li[data-hecho="1"]::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pasos-config li[data-hecho="1"] b { color: var(--muted); font-weight: 500; }
.pasos-config li[data-siguiente="1"] { background: var(--accent-soft); }
.pasos-config li[data-siguiente="1"]::before { border-color: var(--accent); color: var(--accent); }
.pasos-config .ayuda { display: block; }

button.entrada { text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 8px; width: 100%; transition: transform 160ms var(--ease-out), border-color 150ms ease; }
button.entrada:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { button.entrada:hover { border-color: var(--accent); transform: translateY(-2px); } button.entrada:hover:active { transform: scale(.985); } }
.entrada p { font-size: .875rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entrada .chips { margin-top: auto; gap: 6px; }
.grupo h2 { margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.vacio { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 20px; text-align: center; color: var(--muted); }
.vacio .icon { width: 36px; height: 36px; }

.secreto { display: flex; align-items: center; gap: 4px; padding: 10px 6px 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.secreto .etiqueta, .dato .etiqueta { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.secreto__valor { font-family: var(--mono); font-size: .98rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dato > div:last-child { white-space: pre-wrap; overflow-wrap: anywhere; }
.mini-anillo { width: 30px; height: 30px; flex: none; color: var(--accent); }
.mini-anillo svg { transform: rotate(-90deg); }
.mini-anillo circle { fill: none; stroke-width: 5; }
.mini-anillo .pista { stroke: var(--border); }
.mini-anillo .valor { stroke: currentColor; stroke-dasharray: 100.5; stroke-dashoffset: var(--off, 0); transition: stroke-dashoffset 1s linear; }

/* ---------- guías ---------- */
.guias-rejilla { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 820px) { .guias-rejilla { grid-template-columns: 1fr; } }
.guia-boton { justify-content: flex-start; text-align: left; border-radius: var(--radius-sm); }
.guia-boton[aria-pressed="true"] { --b-bg: var(--accent-soft); --b-fg: var(--text); }
.prosa { max-width: 70ch; scroll-margin-top: 120px; overflow-wrap: break-word; }
.prosa h2 { font-size: 1.6rem; margin: 0 0 14px; } .prosa h3 { margin: 22px 0 8px; } .prosa h4 { margin: 18px 0 6px; }
.prosa p, .prosa ul, .prosa ol, .prosa blockquote, .prosa table { margin: 0 0 12px; }
.prosa ul, .prosa ol { padding-left: 22px; } .prosa li { margin-bottom: 6px; }
.prosa blockquote { padding: 12px 16px; border-left: 4px solid var(--calido); background: var(--calido-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prosa table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prosa th, .prosa td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.prosa code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.prosa pre { overflow-x: auto; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); }
.prosa hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

.zona-archivo { border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.zona-archivo[data-sobre="1"] { border-color: var(--accent); background: var(--accent-soft); }
.zona-archivo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.zona-archivo:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.tabla-envoltura { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th { text-align: left; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.tabla th, .tabla td { padding: 11px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }

/* ---------- pantallas de entrada ---------- */
.centro { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom)); background: radial-gradient(900px 500px at 50% -10%, var(--calido-soft), transparent 70%); }
.tarjeta-entrada { width: 100%; max-width: 460px; padding: 30px 24px; box-shadow: var(--shadow-2); }
.tarjeta-entrada.ancha { max-width: 620px; }
.entrada-cab { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; text-align: center; }
.entrada-cab .marca__logo { width: 56px; height: 56px; border-radius: 20px; }
.entrada-cab .marca__logo .icon { width: 30px; height: 30px; }
.pie-entrada { font-size: .8rem; color: var(--muted); text-align: center; max-width: 40ch; }
.personas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.persona { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font: 600 1.05rem var(--serif); cursor: pointer; transition: transform 160ms var(--ease-out), border-color 150ms ease; }
.persona:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .persona:hover { border-color: var(--accent); transform: translateY(-2px); } }
.avatar { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font: 600 1.6rem var(--serif); background: var(--accent-soft); color: var(--accent); }
.persona:nth-child(2) .avatar { background: var(--calido-soft); color: var(--text); }
.tres-pasos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; list-style: none; padding: 0; margin: 0; counter-reset: p; }
.tres-pasos li { counter-increment: p; text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); padding-top: 10px; border-top: 4px solid var(--border); line-height: 1.3; }
.tres-pasos li::before { content: counter(p) ". "; }
.tres-pasos li.hecho { border-color: var(--accent); }
.tres-pasos li.actual { border-color: var(--accent); color: var(--text); }
.cuenta-atras { font: 600 2.4rem/1.1 var(--serif); text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- cajón, diálogo y avisos ---------- */
.cajon:focus, .dialogo-caja:focus { outline: none; }
.velo { position: fixed; inset: 0; background: rgba(25, 18, 8, .45); z-index: 40; opacity: 0; transition: opacity 220ms ease; }
.velo[data-abierto="1"] { opacity: 1; }
.cajon { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); box-shadow: var(--shadow-2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 260ms var(--ease-drawer); }
.cajon[data-abierto="1"] { transform: none; }
.cajon__cab { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 14px 12px 20px; border-bottom: 1px solid var(--border-soft); }
.cajon__cuerpo { flex: 1; overflow-y: auto; padding: 18px 20px 24px; overscroll-behavior: contain; }
.cajon__pie { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-soft); }
.cajon__pie > :last-child { margin-left: auto; }
@media (max-width: 640px) {
  .cajon { top: auto; left: 0; width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; transform: translateY(100%); }
}
.dialogo-caja { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; pointer-events: none; }
.dialogo { pointer-events: auto; width: min(420px, 100%); background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-2); opacity: 0; transform: scale(.96); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.dialogo-caja[data-abierto="1"] .dialogo { opacity: 1; transform: none; }
.velo.alto { z-index: 49; }

.avisos { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (max-width: 720px) { .avisos { bottom: calc(86px + env(safe-area-inset-bottom)); } }
.aviso { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 99px; background: var(--hondo); color: var(--on-hondo); font-size: .92rem; font-weight: 500; box-shadow: var(--shadow-2); transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }
.aviso.error { background: var(--danger); color: var(--surface); border-radius: var(--radius-sm); }
@starting-style { .aviso { opacity: 0; transform: translateY(12px) scale(.98); } }
.aviso[data-sale] { opacity: 0; transform: translateY(8px); transition-duration: 160ms; }

/* ---------- entrada en pantalla (solo la primera vez que se pinta una sección) ---------- */
.entra { animation: entra 220ms var(--ease-out) both; }
.escalonado > * { animation: entra 240ms var(--ease-out) both; }
.escalonado > :nth-child(2) { animation-delay: 40ms; } .escalonado > :nth-child(3) { animation-delay: 80ms; }
.escalonado > :nth-child(4) { animation-delay: 120ms; } .escalonado > :nth-child(5) { animation-delay: 160ms; }
.escalonado > :nth-child(n+6) { animation-delay: 200ms; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.esqueleto { border-radius: var(--radius-sm); background: var(--bg-2); animation: pulso 1.2s ease-in-out infinite alternate; }
.esq-inicial { width: min(420px, 90vw); height: 240px; }
@keyframes pulso { to { opacity: .5; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-property: opacity, background-color, border-color, color !important; scroll-behavior: auto !important; }
  .btn[data-cargando]::after { animation-duration: 1.4s !important; animation-iteration-count: infinite; }
}
