/* Despensa de los perros · registro rápido de compras y presupuesto del mes.
   App de uso diario en el celular: una columna, pestañas abajo, cifras grandes y tabulares.
   Verde hoja como acento; cada tipo de alimento tiene su color. Claro y oscuro según el teléfono. */
:root {
  color-scheme: light;
  --bg: #f2f4f0;
  --surface: #ffffff;
  --surface-2: #ebefe9;
  --line: #dbe1d8;
  --line-fuerte: #c6cec3;
  --fg: #16201a;
  --muted: #56645b;
  --accent: #1d7656;
  --accent-ink: #ffffff;
  --accent-soft: #dff0e7;
  --accent-tinta: #145a41;
  --c-proteina: #c2475f;
  --c-vegetales: #3d8a38;
  --c-carbohidratos: #b97e0e;
  --c-frutas: #d0562a;
  --c-otros: #7a7f8c;
  --good: #1d7656;
  --warn: #a85c0b;
  --bad: #b3263a;
  --sombra: 0 1px 2px rgb(22 32 26 / 0.06), 0 6px 16px -8px rgb(22 32 26 / 0.12);
  --sombra-flota: 0 10px 30px -12px rgb(22 32 26 / 0.35);
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --nav-h: 66px;
  --radio: 18px;
  --radio-chico: 12px;
  --salida: cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-tema="oscuro"] {
    color-scheme: dark;
    --bg: #0f1411; --surface: #171e1a; --surface-2: #1f2822; --line: #29332d; --line-fuerte: #36423a;
    --fg: #e7eee9; --muted: #9caaa2;
    --accent: #4cc497; --accent-ink: #082016; --accent-soft: #1a3128; --accent-tinta: #8de0bd;
    --c-proteina: #ec7d92; --c-vegetales: #7cc576; --c-carbohidratos: #e9b44c; --c-frutas: #f08a5d; --c-otros: #a3a8b5;
    --good: #4cc497; --warn: #e9a04c; --bad: #f2808f;
    --sombra: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 20px -10px rgb(0 0 0 / 0.5);
    --sombra-flota: 0 12px 32px -10px rgb(0 0 0 / 0.7);
  }
@media (prefers-color-scheme: dark) {
  :root[data-tema="auto"] {
    color-scheme: dark;
    --bg: #0f1411; --surface: #171e1a; --surface-2: #1f2822; --line: #29332d; --line-fuerte: #36423a;
    --fg: #e7eee9; --muted: #9caaa2;
    --accent: #4cc497; --accent-ink: #082016; --accent-soft: #1a3128; --accent-tinta: #8de0bd;
    --c-proteina: #ec7d92; --c-vegetales: #7cc576; --c-carbohidratos: #e9b44c; --c-frutas: #f08a5d; --c-otros: #a3a8b5;
    --good: #4cc497; --warn: #e9a04c; --bad: #f2808f;
    --sombra: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 20px -10px rgb(0 0 0 / 0.5);
    --sombra-flota: 0 12px 32px -10px rgb(0 0 0 / 0.7);
  }
}

* { 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); 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 16px; border-radius: 14px; 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 13px; font-size: 0.86rem; border-radius: 11px; }
.btn-grande { min-height: 54px; font-size: 1.05rem; border-radius: 16px; }
.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); 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); 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); 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); 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); }
.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; }
