/* Presupuesto de la casa · registro rápido de gastos y presupuesto del mes de una pareja.
   Dirección visual: fintech oscura (referencia: tokens de Revolut en awesome-design-md, sin copiar marca).
   Lienzo negro, violeta cobalto como acento, botones píldora, cifra protagonista sobre degradé.
   Ver DESIGN.md. Tema: oscuro por defecto; claro y automático en Ajustes (app/tema.js pone data-tema). */
:root {
  color-scheme: light;
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #ececf0;
  --line: #e2e2e7;
  --line-fuerte: #c9c9cd;
  --fg: #191c1f;
  --muted: #505a63;
  --accent: #494fdf;
  --accent-ink: #ffffff;
  --accent-soft: #e9eafc;
  --accent-tinta: #3a40c4;
  --c-proteina: #c2475f;
  --c-vegetales: #2f8a4c;
  --c-carbohidratos: #b97e0e;
  --c-frutas: #d0562a;
  --c-otros: #7a7f8c;
  --good: #00795b;
  --warn: #b25c00;
  --bad: #c9283a;
  --heroe: linear-gradient(135deg, #3a40c4 0%, #494fdf 45%, #7c45e6 100%);
  --sombra: 0 1px 2px rgb(25 28 31 / 0.05), 0 8px 20px -10px rgb(25 28 31 / 0.14);
  --sombra-flota: 0 14px 36px -12px rgb(25 28 31 / 0.4);
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --nav-h: 66px;
  --radio: 20px;
  --radio-chico: 12px;
  --salida: cubic-bezier(0.16, 1, 0.3, 1);
  --resorte: cubic-bezier(0.34, 1.4, 0.64, 1);
}
:root[data-tema="oscuro"] {
    color-scheme: dark;
    --bg: #000000; --surface: #111315; --surface-2: #1c1f23; --line: #23272b; --line-fuerte: #363b41;
    --fg: #ffffff; --muted: #9aa3ab;
    --accent: #4f55f1; --accent-ink: #ffffff; --accent-soft: #181a3f; --accent-tinta: #a9acff;
    --c-proteina: #ff7d95; --c-vegetales: #5fd38d; --c-carbohidratos: #ffc155; --c-frutas: #ff9160; --c-otros: #a3a8b5;
    --good: #19d3a2; --warn: #ffa64d; --bad: #ff6b7a;
    --heroe: linear-gradient(135deg, #3a40c4 0%, #4f55f1 45%, #8a4bf0 100%);
    --sombra: 0 1px 0 rgb(255 255 255 / 0.04) inset;
    --sombra-flota: 0 16px 40px -12px rgb(0 0 0 / 0.9);
}
@media (prefers-color-scheme: dark) {
  :root[data-tema="auto"] {
    color-scheme: dark;
    --bg: #000000; --surface: #111315; --surface-2: #1c1f23; --line: #23272b; --line-fuerte: #363b41;
    --fg: #ffffff; --muted: #9aa3ab;
    --accent: #4f55f1; --accent-ink: #ffffff; --accent-soft: #181a3f; --accent-tinta: #a9acff;
    --c-proteina: #ff7d95; --c-vegetales: #5fd38d; --c-carbohidratos: #ffc155; --c-frutas: #ff9160; --c-otros: #a3a8b5;
    --good: #19d3a2; --warn: #ffa64d; --bad: #ff6b7a;
    --heroe: linear-gradient(135deg, #3a40c4 0%, #4f55f1 45%, #8a4bf0 100%);
    --sombra: 0 1px 0 rgb(255 255 255 / 0.04) inset;
    --sombra-flota: 0 16px 40px -12px rgb(0 0 0 / 0.9);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; caret-color: var(--accent); accent-color: var(--accent); }
::selection { background: var(--accent-soft); color: var(--fg); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.015em; text-wrap: balance; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.08rem; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-tinta); text-underline-offset: 3px; text-decoration-thickness: 1px; }
code { font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.etiqueta { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.pista { font-size: 0.84rem; color: var(--muted); }
.icono { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-fuerte); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* Pantallas */
.pantalla.centro { min-height: 100dvh; display: grid; place-items: center; gap: 12px; align-content: center; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.marca-grande { width: 56px; height: 56px; border-radius: 16px; background: var(--accent) url("favicon.svg") center / 70% no-repeat; box-shadow: var(--sombra); }
.login { width: min(400px, 100%); }
.contenedor { max-width: 600px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(var(--nav-h) + 36px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.demo-banda { background: var(--accent-soft); color: var(--accent-tinta); font-size: 0.8rem; text-align: center; padding: calc(6px + env(safe-area-inset-top)) 16px 6px; }
.demo-banda .enlace { font-size: 0.8rem; padding: 0; }
.demo-banda + .contenedor { padding-top: 16px; }
.vista { display: flex; flex-direction: column; gap: 22px; }
.bloque { display: flex; flex-direction: column; gap: 10px; }
.cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }

/* Tarjetas y formularios */
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--sombra); }
.campo { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.campo label, .campo .etq { font-size: 0.86rem; font-weight: 600; }
.fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fila3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; min-height: 46px; padding: 11px 13px; border-radius: var(--radio-chico); border: 1px solid var(--line); background: var(--bg); color: var(--fg); min-width: 0; transition: border-color .15s ease, background-color .15s ease; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:hover, select:hover, textarea:hover { border-color: var(--line-fuerte); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { font: inherit; font-weight: 600; min-height: 48px; padding: 13px 20px; border-radius: 99px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .12s ease, background-color .15s ease, opacity .15s ease; }
.btn:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn.fantasma { background: transparent; color: var(--fg); border-color: var(--line-fuerte); }
.btn.fantasma:hover { background: var(--surface-2); }
.btn.peligro { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.peligro:hover { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.btn.chico { min-height: 38px; padding: 8px 15px; font-size: 0.86rem; }
.btn-grande { min-height: 56px; font-size: 1.05rem; }
.botones { display: flex; gap: 10px; flex-wrap: wrap; }
.botones .btn { flex: 1; }
.botones-cab { display: flex; gap: 8px; }
.enlace { font: inherit; font-size: 0.9rem; background: none; border: none; padding: 8px 0; color: var(--accent-tinta); cursor: pointer; font-weight: 600; text-align: left; }
.enlace:hover { text-decoration: underline; text-underline-offset: 3px; }
.enlace.peligro { color: var(--bad); }
.aviso { font-size: 0.9rem; padding: 11px 13px; border-radius: var(--radio-chico); background: var(--accent-soft); color: var(--accent-tinta); }
.aviso b { color: var(--fg); }
.aviso.error { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 0.88rem; min-height: 38px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s ease; }
.chip:hover { border-color: var(--line-fuerte); }
.chip:active { transform: scale(0.96); }
.chip.activo { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.activo .punto { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.clave-caja { position: relative; }
.clave-caja input { padding-right: 84px; }
.ver-clave { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--accent-tinta); background: var(--surface-2); border: none; border-radius: 9px; padding: 7px 10px; cursor: pointer; min-width: 68px; }
.en-linea { display: flex; gap: 10px; align-items: stretch; }
.en-linea input { flex: 1; }

/* Selector de mes */
.mes { display: flex; align-items: center; gap: 8px; }
.mes b { font-family: var(--display); font-weight: 600; font-size: 1.02rem; min-width: 0; text-align: center; flex: 1; }
.icono-btn { width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; display: grid; place-items: center; transition: background-color .15s ease; }
.icono-btn:hover { background: var(--surface-2); }

/* Resumen del mes: lo que queda manda */
.resumen { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 18px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--sombra); }
.resumen-cab { display: flex; flex-direction: column; gap: 2px; }
.grande { font-family: var(--display); font-size: clamp(2.1rem, 9vw, 2.6rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.resumen.pasado .grande { color: var(--bad); }
.barra { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; display: flex; }
.barra > i { display: block; height: 100%; background: var(--accent); transition: width .5s var(--salida); }
.barra > i:first-child { border-radius: 99px 0 0 99px; }
.barra > i:only-child { border-radius: 99px; }
.barra > i.nueva { background: color-mix(in srgb, var(--accent) 45%, var(--surface-2)); }
.barra.pasada > i { background: var(--bad); }
.barra.pasada > i.nueva { background: color-mix(in srgb, var(--bad) 45%, var(--surface-2)); }
.barra .marca-ritmo { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fg); opacity: .45; border-radius: 2px; }
.datos2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.datos2 > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.datos2 .v { font-family: var(--display); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; }
.estado { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 0.82rem; font-weight: 600; background: var(--accent-soft); color: var(--accent-tinta); align-self: flex-start; }
.estado.alerta { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.estado.mal { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.sin-presupuesto { border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: var(--accent-soft); border-radius: var(--radio); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sin-presupuesto .chip { background: var(--surface); }

/* Filas (categorías, tiendas, listas) */
.filas { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.fila { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: center; }
.fila .nombre { display: flex; align-items: center; gap: 9px; font-weight: 600; min-width: 0; }
.fila .nombre span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila .barra { grid-column: 1 / -1; height: 6px; }
.fila .barra > i { background: var(--cc, var(--accent)); border-radius: 99px; }
.fila .sub { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.punto { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--c-otros); display: inline-block; }

/* Lista de compras */
.grupo { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 2px 2px; }
.grupo b { font-family: var(--display); font-weight: 600; }
.compra { width: 100%; font: inherit; color: inherit; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 13px 15px; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; cursor: pointer; transition: border-color .15s ease, transform .12s ease; }
.compra:hover { border-color: var(--line-fuerte); }
.compra:active { transform: scale(0.99); }
.compra .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compra .monto { font-family: var(--display); font-weight: 600; text-align: right; }
.compra .det { grid-column: 1 / -1; font-size: 0.84rem; color: var(--muted); }
.compra .cats { grid-column: 1 / -1; display: flex; gap: 3px; height: 4px; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.compra .cats i { display: block; height: 100%; }
.lista { display: flex; flex-direction: column; gap: 8px; }
.vacio { text-align: center; padding: 34px 12px; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* Nueva compra rápida */
.monto-grande { font-family: var(--display); font-size: 1.9rem; font-weight: 600; min-height: 64px; padding: 10px 14px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fecha-linea { flex-direction: row; align-items: center; gap: 12px; }
.fecha-linea label { flex: none; }
.fecha-linea input { max-width: 200px; }
.detalle-compra { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.pres-compra { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--radio); background: var(--surface); border: 1px solid var(--line); }
.pres-compra.sin { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--accent-soft); border-color: transparent; color: var(--accent-tinta); font-size: 0.9rem; }
.pres-compra.sin .enlace { padding: 0; }
.pres-linea { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 0.9rem; }
.pres-linea b { font-family: var(--display); font-weight: 600; }
.pres-despues { font-weight: 600; color: var(--accent-tinta); font-size: 0.95rem; }
.pres-compra.alerta .pres-despues { color: var(--warn); }
.pres-compra.pasado { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.pres-compra.pasado .pres-despues { color: var(--bad); }
.linea { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.linea .fila3 { grid-column: 1 / -1; }
.linea .quitar { width: 44px; height: 46px; border-radius: var(--radio-chico); border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; align-self: end; display: grid; place-items: center; }
.linea .quitar:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.linea .ppk { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); }
.linea .ppk b { color: var(--fg); }
.linea input, .linea select { background: var(--surface); }
.total-compra { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px; }
.total-compra b { font-family: var(--display); font-size: 1.5rem; }

/* Buscador desplegable */
.combo { position: relative; }
.sugerencias { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25; background: var(--surface); border: 1px solid var(--line-fuerte); border-radius: 14px; box-shadow: var(--sombra-flota); max-height: 300px; overflow-y: auto; padding: 6px; transform-origin: top center; animation: abre .18s var(--salida); }
.linea .sugerencias { right: -54px; }
.sugerencia { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 1px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.sugerencia:not(:has(.punto)) { grid-template-columns: 1fr; }
.sugerencia .sg-detalle { grid-column: -2 / -1; }
.sugerencia:hover, .sugerencia.activa { background: var(--surface-2); }
.sg-valor { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-detalle { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugerencia.nueva .sg-valor { color: var(--accent-tinta); font-weight: 600; }
@keyframes abre { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

/* Banco: avisos por revisar */
.banda-banco { width: 100%; font: inherit; color: inherit; text-align: left; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--radio); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); cursor: pointer; }
.banda-banco .bb-icono { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); flex: none; }
.banda-banco .bb-texto { flex: 1; min-width: 0; }
.banda-banco > .icono { color: var(--warn); }
.aviso-banco { background: color-mix(in srgb, var(--warn) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: 15px; padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; }
.aviso-banco .cab { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.aviso-banco .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aviso-banco .monto { font-family: var(--display); font-weight: 600; }
.aviso-banco .det { font-size: 0.84rem; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.texto-aviso { font-size: 0.82rem; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; max-height: 180px; overflow: auto; }
details > summary { cursor: pointer; color: var(--accent-tinta); font-weight: 600; font-size: 0.88rem; padding: 4px 0; }
textarea { resize: vertical; min-height: 110px; }

/* Precios */
.producto { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; }
.producto .cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.producto .cab .nombre { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.precio-tienda { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 0.9rem; padding: 7px 0; border-top: 1px solid var(--line); }
.precio-tienda .f { font-size: 0.78rem; color: var(--muted); }
.mejor { color: var(--good); font-weight: 600; }
.insignia { font-size: 0.74rem; font-weight: 700; color: var(--accent-tinta); background: var(--accent-soft); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }

/* Plan */
.tabla-cont { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
th, td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
tfoot td { font-weight: 700; border-bottom: none; }
.perro { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: center; }
.perro .n { font-weight: 600; }
.perro .d { font-size: 0.84rem; color: var(--muted); grid-column: 1; }
.perro .acc { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 12px; }
.pct-fila { display: grid; grid-template-columns: 1fr 80px 104px; gap: 10px; align-items: center; }
.pct-fila .nombre { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }

/* Pestañas */
.pestanas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.pestanas-in { max-width: 600px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); }
.pestanas button { font: inherit; font-size: 0.7rem; font-weight: 600; background: none; border: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; min-width: 0; transition: color .15s ease; }
.pestanas button > svg, .pestanas .mas { height: 30px; }
.pestanas svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pestanas button[aria-current="page"] { color: var(--accent-tinta); }
.pestanas .mas { width: 46px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 3px 8px -3px rgb(0 0 0 / 0.35); transition: transform .12s ease; }
.pestanas .mas svg { width: 18px; height: 18px; stroke-width: 2.5; }
.pestanas button:active .mas { transform: scale(0.94); }

/* Aviso flotante: el único momento con movimiento propio */
.aviso-flotante { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: var(--fg); color: var(--bg); padding: 11px 16px; border-radius: 13px; font-size: 0.9rem; font-weight: 500; z-index: 30; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--sombra-flota); animation: sube .35s var(--salida); }
@keyframes sube { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 380px) {
  .fila3 { grid-template-columns: 1fr 1fr; }
  .fila3 > .campo:first-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Modo compra en el supermercado */
.pregunta-sesion { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--accent-soft); color: var(--fg); }
.pregunta-sesion .pista { color: var(--accent-tinta); }
.pregunta-sesion input { background: var(--surface); }
.banda-sesion { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radio); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.banda-sesion .bs-icono { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.banda-sesion .bs-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.banda-sesion .bs-texto .pista { color: var(--accent-tinta); }
.banda-sesion .btn { flex: none; background: var(--surface); }
.banda-sesion.estatica { cursor: default; }
.banda-sesion > .icono { color: var(--accent-tinta); }
.item-lista .il-monto { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.il-quitar { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.il-quitar:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.il-quitar .icono { width: 16px; height: 16px; }
.total-lista { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.monto-medio { font-family: var(--display); font-size: 1.35rem; font-weight: 600; min-height: 54px; font-variant-numeric: tabular-nums; }

/* Presupuesto de la casa */
.segmentos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.segmento { font: inherit; font-weight: 600; font-size: 0.92rem; min-height: 42px; border: none; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background-color .15s ease, color .15s ease; }
.segmento .icono { width: 18px; height: 18px; }
.segmento.activo { background: var(--surface); color: var(--fg); box-shadow: var(--sombra); }
.bolsillo-chip .icono { width: 17px; height: 17px; }
.fila-icono { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.fila-icono .icono { width: 17px; height: 17px; }
.estado-fijo { font-size: 0.74rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); white-space: nowrap; }
.estado-fijo.pagado { background: var(--accent-soft); color: var(--accent-tinta); }
.acciones-fila { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.il-quitar.confirmar { color: var(--bad); border-color: var(--bad); }
.aviso.alerta { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.compra .t { display: flex; align-items: center; gap: 8px; }
.insignia.bolsillo-personal { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.insignia.bolsillo-hormiga { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.insignia.bolsillo-fijos { background: var(--surface-2); color: var(--muted); }
.estado-fijo.extra { background: var(--surface-2); color: var(--muted); }
.campos-pago { display: flex; flex-direction: column; gap: 12px; }

/* Configuración inicial */
.config-progreso { display: flex; flex-direction: column; gap: 6px; }
.config-progreso .barra { height: 6px; }
.config-cuerpo { gap: 14px; }
.config-cuerpo .marca-grande { margin-bottom: 4px; }
.config-cuerpo h1 { font-size: 1.6rem; }
.fila-config .campo:first-child .etq { font-family: var(--display); font-size: 1rem; }
.fila-config > .campo, .fila-config > .fila2 { grid-column: 1 / -1; }
.fila-config > .campo:first-child { grid-column: 1; align-self: center; }
.config-nav { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); }
.chip[disabled] { opacity: .45; cursor: default; }
.arrastre .filas { background: var(--surface); border-radius: 12px; padding: 0 12px; border-top: none; }
.arrastre .fila:last-child { border-bottom: none; }

/* ── Rediseño: cifra protagonista sobre degradé ── */
.resumen { background: var(--heroe); border: none; color: #fff; border-radius: 26px; padding: 22px 20px; position: relative; overflow: hidden; box-shadow: 0 18px 40px -22px #4f55f1; }
.resumen::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 100% 0%, rgb(255 255 255 / 0.18), transparent 60%); pointer-events: none; }
.resumen > * { position: relative; z-index: 1; }
.resumen .etiqueta, .resumen .muted, .resumen .pista { color: rgb(255 255 255 / 0.82); }
.resumen .grande { font-size: clamp(2.5rem, 12vw, 3.2rem); }
.resumen.pasado { background: linear-gradient(135deg, #8b1d2c 0%, #c9283a 55%, #e2553f 100%); box-shadow: 0 18px 40px -22px #c9283a; }
.resumen.pasado .grande { color: #fff; }
.resumen .barra { background: rgb(255 255 255 / 0.22); }
.resumen .barra > i, .resumen .barra.pasada > i { background: #fff; }
.resumen .barra .marca-ritmo { background: #fff; opacity: .7; }
.resumen .estado, .resumen .estado.alerta, .resumen .estado.mal { background: rgb(255 255 255 / 0.16); color: #fff; }
.resumen .datos2 { border-top-color: rgb(255 255 255 / 0.2); }

/* Anillos por bolsillo */
.anillos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.anillo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.anillo svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.anillo circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.anillo .pista-anillo { stroke: var(--surface-2); }
.anillo .avance { stroke: var(--ca, var(--accent)); stroke-dasharray: 163.4; stroke-dashoffset: var(--o, 163.4); animation: anillo 1s var(--salida) backwards; }
.anillo .centro { position: relative; display: grid; place-items: center; }
.anillo .pct { position: absolute; font-family: var(--display); font-weight: 600; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.anillo .an-nombre { font-size: 0.8rem; font-weight: 600; }
.anillo .an-monto { font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.anillo.pasado .pct { color: var(--bad); }
@keyframes anillo { from { stroke-dashoffset: 163.4; } }

/* Teclado numérico propio */
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.tecla { font-family: var(--display); font-size: 1.45rem; font-weight: 500; min-height: 58px; border-radius: 16px; border: none; background: var(--surface-2); color: var(--fg); cursor: pointer; display: grid; place-items: center; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform .1s ease, background-color .12s ease; }
.tecla:active { transform: scale(0.94); background: var(--accent); color: var(--accent-ink); }
.tecla.suave { background: transparent; color: var(--muted); font-size: 1.1rem; }
.monto-grande { text-align: center; font-size: 2.6rem; min-height: 76px; border-color: transparent; background: transparent; }
.monto-grande:focus { background: transparent; border-color: transparent; box-shadow: none; }
.monto-grande.pulso { animation: pulso .18s var(--resorte); }
@keyframes pulso { from { transform: scale(1.06); } }
.guardar-fijo { position: sticky; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: var(--sombra-flota); }

/* Movimiento: entrada de vista */
.vista.entra { animation: entra .32s var(--salida); }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } }
.segmento.activo { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.chip { background: var(--surface-2); border-color: transparent; }
.pestanas { background: color-mix(in srgb, var(--bg) 78%, transparent); }
.marca-grande { background: url("favicon.svg") center / cover no-repeat; box-shadow: none; }
.anillo .an-monto { white-space: normal; overflow: visible; line-height: 1.25; }

/* ── Etapa 2: hoja inferior ── */
body.con-hoja { overflow: hidden; }
#telon { position: fixed; inset: 0; z-index: 14; background: rgb(0 0 0 / 0.6); animation: aparece .25s ease; }
@keyframes aparece { from { opacity: 0; } }
.vista.hoja { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 34px); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15; max-width: 600px; margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 28px 28px 0 0; border: 1px solid var(--line-fuerte); border-bottom: none; padding: 12px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); gap: 16px; }
.vista.hoja::before { content: ""; flex: none; align-self: center; width: 42px; height: 5px; border-radius: 99px; background: var(--line-fuerte); }
.vista.hoja.sube { animation: sube .45s var(--salida); }
@keyframes sube { from { transform: translateY(100%); } }
.hoja .tarjeta { background: transparent; border: none; box-shadow: none; padding: 0; }
.hoja .pres-compra, .hoja .linea { background: var(--surface-2); border-color: transparent; }
.hoja input, .hoja select, .hoja textarea { background: var(--surface-2); }
.hoja .monto-grande, .hoja .monto-grande:focus { background: transparent; }
.hoja .linea input, .hoja .linea select { background: var(--surface); }
.hoja .guardar-fijo { bottom: 0; }
.hoja .tecla { background: var(--surface-2); }

/* El gasto que vuela a su bolsillo */
.ficha-vuelo { position: fixed; z-index: 40; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 600; font-size: 1.05rem; pointer-events: none; white-space: nowrap; }

/* Lista: filas deslizables */
.item-lista { touch-action: pan-y; background: var(--surface); }

/* La casa: barras enfrentadas */
.duelo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.duelo-nombres { display: flex; justify-content: space-between; font-family: var(--display); }
.duelo-fila { display: grid; grid-template-columns: minmax(64px, auto) 1fr auto 1fr minmax(64px, auto); align-items: center; gap: 8px; font-size: 0.82rem; }
.duelo-fila .d-etq { color: var(--muted); font-weight: 600; min-width: 58px; text-align: center; }
.duelo-fila .d-monto { color: var(--muted); }
.duelo-fila .d-monto:last-child { text-align: right; }
.duelo-fila .d-monto.mas { color: var(--fg); font-weight: 700; }
.d-barra { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.d-barra.izq { justify-content: flex-end; }
.d-barra i { display: block; height: 100%; width: 100%; border-radius: 99px; transform: scaleX(var(--w, 0)); animation: crece .7s var(--salida) backwards; }
.d-barra.izq i { background: var(--accent); transform-origin: right; }
.d-barra.der i { background: var(--good); transform-origin: left; }
.duelo-fila.total { padding-top: 12px; border-top: 1px solid var(--line); }
@keyframes crece { from { transform: scaleX(0); } }

/* Carga: esqueleto */
.esqueleto { display: flex; flex-direction: column; gap: 16px; }
.esqueleto i { display: block; border-radius: 16px; background: var(--surface-2); animation: late 1.2s ease-in-out infinite alternate; }
.esqueleto .e-linea { height: 42px; }
.esqueleto .e-heroe { height: 190px; border-radius: 26px; }
.esqueleto .e-tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.esqueleto .e-tres i { height: 130px; border-radius: 20px; }
.esqueleto .e-fila { height: 56px; }
@keyframes late { from { opacity: .45; } to { opacity: 1; } }
/* Hoja compacta: el monto manda */
.campo-monto { align-items: center; gap: 0; }
.campo-monto label { color: var(--muted); font-weight: 500; }
.hoja .pres-compra { padding: 10px 14px; gap: 4px; }
.hoja .pres-compra .barra, .hoja .pres-compra .pres-linea:first-child { display: none; }
.hoja .pres-despues { font-size: 0.86rem; }
.hoja .tecla { min-height: 50px; font-size: 1.3rem; }
.hoja .teclado { gap: 6px; }
.hoja .campo { gap: 6px; }
.vista.hoja { gap: 12px; }
.hoja .tarjeta { gap: 12px; }
.hoja .chip { min-height: 34px; padding: 5px 12px; }

/* ── Portada (inicio de sesión): siempre oscura, fondo animado y demo en vivo ── */
.portada { color-scheme: dark; position: relative; overflow: hidden; min-height: 100dvh; display: flex; flex-direction: column; gap: 24px; background: #000; color: #fff;
  padding: max(22px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.portada > :not(.aurora) { position: relative; z-index: 1; }
.aurora { position: absolute; inset: 0; pointer-events: none; }
.aurora i { position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%; filter: blur(90px); opacity: .6; will-change: transform; animation: deriva 20s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: #4f55f1; top: -28vmax; left: -18vmax; }
.aurora i:nth-child(2) { background: #8a4bf0; bottom: -34vmax; right: -22vmax; animation-duration: 26s; animation-delay: -8s; }
.aurora i:nth-child(3) { background: #19d3a2; width: 34vmax; height: 34vmax; top: 38%; left: 42%; opacity: .2; animation-duration: 32s; animation-delay: -14s; }
@keyframes deriva { to { transform: translate(9vmax, 7vmax) scale(1.18); } }
.portada-marca { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1rem; width: 100%; max-width: 1080px; margin: 0 auto; }
.portada-marca .marca-grande { width: 34px; height: 34px; border-radius: 10px; }
.portada-cuerpo { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; display: grid; gap: 28px; align-content: center; }
.portada-texto { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.portada-texto h1 { font-size: clamp(2.5rem, 9vw, 4.8rem); line-height: 0.98; letter-spacing: -0.04em; font-weight: 600; }
.portada-texto > p { color: rgb(255 255 255 / 0.78); max-width: 44ch; font-size: 1.05rem; }
.demo { position: relative; margin-top: 14px; width: min(380px, 100%); display: grid; gap: 10px; }
.demo-heroe { background: linear-gradient(135deg, #3a40c4 0%, #4f55f1 45%, #8a4bf0 100%); border-radius: 22px; padding: 16px 18px 18px; display: grid; gap: 4px; }
.demo-heroe span { font-size: 0.84rem; color: rgb(255 255 255 / 0.82); }
.demo-heroe b { font-family: var(--display); font-size: 2.1rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.demo-barra { height: 8px; border-radius: 99px; background: rgb(255 255 255 / 0.2); overflow: hidden; margin-top: 8px; }
.demo-barra i { display: block; height: 100%; width: 100%; background: #fff; border-radius: 99px; transform-origin: left; transform: scaleX(var(--w, 0.17)); transition: transform .8s var(--salida); }
.demo-filas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.demo-filas > div { background: rgb(255 255 255 / 0.07); border: 1px solid rgb(255 255 255 / 0.1); border-radius: 14px; padding: 10px 12px; font-size: 0.8rem; color: rgb(255 255 255 / 0.85); }
.demo-filas .demo-barra { height: 6px; background: rgb(255 255 255 / 0.12); }
.demo-barra.v i { background: #19d3a2; } .demo-barra.a i { background: #a9acff; } .demo-barra.n i { background: #ffa64d; }
.demo-ficha { position: absolute; right: 10px; top: -16px; z-index: 2; background: #fff; color: #111; padding: 7px 13px; border-radius: 99px; font-weight: 700; font-size: 0.84rem; opacity: 0; box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.7); }
.demo-ficha.va { animation: ficha 2.3s var(--salida); }
@keyframes ficha { 0% { opacity: 0; transform: translateY(-18px) scale(.9); } 14% { opacity: 1; transform: none; } 60% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(26px) scale(.8); } }
.portada .login { width: 100%; display: flex; flex-direction: column; gap: 14px; background: rgb(14 15 18 / 0.72); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); border: 1px solid rgb(255 255 255 / 0.12); border-radius: 26px; padding: 26px 22px 20px; }
.portada .login h2 { font-size: 1.5rem; }
.portada .login .muted { color: rgb(255 255 255 / 0.7); margin-top: -8px; }
.portada .login input { background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.14); color: #fff; min-height: 52px; }
.portada .login input::placeholder { color: rgb(255 255 255 / 0.4); }
.portada .login input:focus { background: rgb(255 255 255 / 0.1); border-color: #a9acff; }
.portada .ver-clave { background: rgb(255 255 255 / 0.1); color: #fff; }
.portada .enlace { color: #c3c5ff; align-self: center; }
.portada .aviso { background: rgb(255 255 255 / 0.1); color: #fff; }
.portada .aviso.error { background: rgb(255 107 122 / 0.16); color: #ffb3bb; }
@media (min-width: 900px) {
  .portada { padding: 32px 48px 40px; }
  .portada-cuerpo { grid-template-columns: 1.15fr 400px; gap: 72px; align-items: center; }
  .demo { margin-top: 26px; }
}
@media (max-width: 899px) {
  .demo-filas { display: none; }
  .portada-texto > p { font-size: 0.98rem; }
  .demo-heroe b { font-size: 1.8rem; }
}

/* ── Ajustes: lista plegable (una sección abierta a la vez) ── */
.aj-grupo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); overflow: hidden; }
.aj-sec + .aj-sec { border-top: 1px solid var(--line); }
.aj-sec > summary, .aj-enlace { list-style: none; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 13px 14px 13px 16px; min-height: 66px; cursor: pointer; color: var(--fg); font: inherit; font-weight: 400; width: 100%; background: none; text-align: left; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease; }
.aj-enlace { border: 0; border-top: 1px solid var(--line); }
.aj-sec > summary::-webkit-details-marker { display: none; }
.aj-sec > summary:active, .aj-enlace:active { background: var(--surface-2); }
@media (hover: hover) { .aj-sec > summary:hover, .aj-enlace:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); } }
.aj-sec > summary:focus-visible, .aj-enlace:focus-visible { outline-offset: -3px; border-radius: var(--radio); }
.aj-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-tinta); }
.aj-tit { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.aj-tit b { font-weight: 600; }
.aj-tit span { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aj-valor { font-family: var(--display); font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.aj-chev { color: var(--muted); display: grid; place-items: center; transition: transform .2s var(--salida); }
.aj-chev .icono { width: 16px; height: 16px; }
.aj-sec[open] > summary .aj-chev { transform: rotate(90deg); }
.aj-cuerpo { padding: 2px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.aj-sec[open] > .aj-cuerpo { animation: entra .26s var(--salida); }
.aj-cuerpo .tarjeta { background: transparent; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.aj-cuerpo .filas:empty { display: none; }
.aj-cuerpo .btn { width: 100%; }
.aj-cuerpo .en-linea .btn { width: auto; }

/* Compras: filtros en una sola fila que se desliza */
.chips-fila { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-snap-type: x proximity; }
.chips-fila::-webkit-scrollbar { display: none; }
.chips-fila .chip { flex: none; scroll-snap-align: start; }

/* Asistente inicial */
.config-segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.config-segs i { height: 5px; border-radius: 99px; background: var(--surface-2); transition: background-color .3s ease; }
.config-segs i.hecho { background: var(--accent); }
.config-paso { display: flex; justify-content: space-between; align-items: baseline; }
.config-paso b { font-family: var(--display); font-weight: 600; font-size: 0.9rem; color: var(--accent-tinta); }
.config-cuerpo { padding: 22px 18px; }
.config-cuerpo h2 { font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1.15; }
.config-cuerpo.bienvenida { background: var(--heroe); border-color: transparent; color: #fff; padding: 30px 22px 28px; border-radius: 26px; }
.config-cuerpo.bienvenida h1 { font-size: 2.1rem; letter-spacing: -0.03em; }
.config-cuerpo.bienvenida .pista { color: rgb(255 255 255 / 0.8); }
.config-cuerpo.bienvenida .marca-grande { background-color: rgb(255 255 255 / 0.16); background-size: 70%; }
@media (prefers-reduced-motion: reduce) { .aj-sec[open] > .aj-cuerpo { animation: none; } .aj-chev { transition: none; } }

/* Portada en celular: todo en una pantalla, sin desplazarse */
@media (max-width: 899px) {
  .portada { gap: 14px; padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .portada-marca .marca-grande { width: 28px; height: 28px; border-radius: 8px; }
  .portada-marca { font-size: 0.92rem; }
  .portada-cuerpo { gap: 14px; }
  .portada-texto { gap: 8px; }
  .portada-texto h1 { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  .portada-texto > p { font-size: 0.9rem; line-height: 1.4; }
  .demo { margin-top: 6px; width: 100%; }
  .demo-heroe { padding: 11px 16px 13px; border-radius: 18px; gap: 2px; }
  .demo-heroe span { font-size: 0.78rem; }
  .demo-heroe b { font-size: 1.55rem; }
  .demo-barra { height: 6px; margin-top: 5px; }
  .portada .login { gap: 10px; padding: 16px 16px 10px; border-radius: 22px; }
  .portada .login h2 { font-size: 1.2rem; }
  .portada .login .muted { margin-top: -6px; font-size: 0.84rem; }
  .portada .login .campo { gap: 4px; }
  .portada .login label { font-size: 0.8rem; }
  .portada .login input { min-height: 46px; }
  .portada .login .btn-grande { min-height: 48px; }
  .portada .login .enlace { min-height: 36px; padding-block: 4px; }
}
@media (max-width: 899px) and (max-height: 700px) { .portada-texto > p { display: none; } }
@media (max-width: 899px) and (max-height: 590px) { .demo { display: none; } .portada-texto h1 { font-size: 1.6rem; } }
