/* =============================================================
   Mis cuentas · estilos de la app («Mezcla»: el vaso y el tacto de C,
   vestidos con el cielo y el cristal de A). Sacado de propuestas/d-mezcla.
   Regla del tacto: lo que tiene canto (un filo translúcido debajo) se puede pulsar.
   Los colores viven en paletas ([data-paleta] en <html>); se eligen en Ajustes → Apariencia.
   CSP estricta: aquí todo; app.js solo pone clases, atributos y variables.
   ============================================================= */

@font-face {
  font-family: "Encode Sans";
  src: url("fuentes/EncodeSans-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

/* ---------- Colores registrados: así el navegador los funde poco a poco
   (al cambiar de paleta y cuando el cielo «cambia de tiempo») ---------- */
@property --fondo { syntax: "<color>"; inherits: true; initial-value: #0E0905; }
@property --texto { syntax: "<color>"; inherits: true; initial-value: #FFF6E6; }
@property --texto-2 { syntax: "<color>"; inherits: true; initial-value: rgb(255 246 230 / .8); }
@property --texto-3 { syntax: "<color>"; inherits: true; initial-value: rgb(255 246 230 / .72); }
@property --ingreso { syntax: "<color>"; inherits: true; initial-value: #8FE0A8; }
@property --gasto { syntax: "<color>"; inherits: true; initial-value: #FFB2AC; }
@property --suscripcion { syntax: "<color>"; inherits: true; initial-value: #DCC6FF; }
@property --ingreso-vivo { syntax: "<color>"; inherits: true; initial-value: #8FE0A8; }
@property --gasto-vivo { syntax: "<color>"; inherits: true; initial-value: #FFB2AC; }
@property --suscripcion-vivo { syntax: "<color>"; inherits: true; initial-value: #DCC6FF; }
@property --sobre-vivo { syntax: "<color>"; inherits: true; initial-value: #2A1600; }
@property --liquido { syntax: "<color>"; inherits: true; initial-value: #A65C00; }
@property --liquido-2 { syntax: "<color>"; inherits: true; initial-value: #B8700E; }
@property --liquido-medio { syntax: "<color>"; inherits: true; initial-value: #82450A; }
@property --liquido-hondo { syntax: "<color>"; inherits: true; initial-value: #5A2A04; }
@property --liquido-luz { syntax: "<color>"; inherits: true; initial-value: #FFCB52; }
@property --tinta-vaso { syntax: "<color>"; inherits: true; initial-value: #FFF8EC; }
@property --apuntar-1 { syntax: "<color>"; inherits: true; initial-value: #FFDE85; }
@property --apuntar-2 { syntax: "<color>"; inherits: true; initial-value: #FFA42E; }
@property --apuntar-texto { syntax: "<color>"; inherits: true; initial-value: #2A1600; }
@property --apuntar-canto { syntax: "<color>"; inherits: true; initial-value: #B86A0A; }
@property --aviso { syntax: "<color>"; inherits: true; initial-value: #FFC56B; }
@property --negativo { syntax: "<color>"; inherits: true; initial-value: #FFB4A8; }
@property --cristal-tinte { syntax: "<color>"; inherits: true; initial-value: rgb(14 9 5 / .48); }
@property --cristal-luz { syntax: "<color>"; inherits: true; initial-value: rgb(255 255 255 / .42); }
@property --cristal-borde { syntax: "<color>"; inherits: true; initial-value: rgb(255 255 255 / .06); }
@property --linea { syntax: "<color>"; inherits: true; initial-value: rgb(255 255 255 / .09); }
@property --sombra { syntax: "<color>"; inherits: true; initial-value: rgb(0 0 0 / .6); }
@property --gema-canto { syntax: "<color>"; inherits: true; initial-value: rgb(255 246 230 / .16); }
@property --foco { syntax: "<color>"; inherits: true; initial-value: #FFF6E6; }
@property --cifra-alto { syntax: "<color>"; inherits: true; initial-value: #FFFFFF; }
@property --vaso-tinte { syntax: "<color>"; inherits: true; initial-value: rgb(14 9 5 / .34); }
@property --chip-fondo { syntax: "<color>"; inherits: true; initial-value: rgb(14 9 5 / .6); }
@property --halo { syntax: "<color>"; inherits: true; initial-value: rgb(14 9 5 / .85); }
@property --campo-fondo { syntax: "<color>"; inherits: true; initial-value: rgb(255 255 255 / .07); }
@property --campo-borde { syntax: "<color>"; inherits: true; initial-value: rgb(255 255 255 / .13); }
@property --seria-1 { syntax: "<color>"; inherits: true; initial-value: #FFFFFF; }
@property --seria-2 { syntax: "<color>"; inherits: true; initial-value: #E8DFD0; }
@property --seria-texto { syntax: "<color>"; inherits: true; initial-value: #0E0905; }
@property --seria-canto { syntax: "<color>"; inherits: true; initial-value: rgb(255 246 230 / .34); }
@property --tostada-fondo { syntax: "<color>"; inherits: true; initial-value: rgb(14 9 5 / .78); }
@property --tostada-texto { syntax: "<color>"; inherits: true; initial-value: #FFF6E6; }
@property --tostada-accion { syntax: "<color>"; inherits: true; initial-value: #FFCB52; }
@property --hoja-fondo { syntax: "<color>"; inherits: true; initial-value: rgb(14 9 5 / .84); }
@property --velo { syntax: "<color>"; inherits: true; initial-value: rgb(0 0 0 / .45); }

/* El cielo (en <body>: cambia con lo que te queda) */
@property --cielo-alto { syntax: "<color>"; inherits: true; initial-value: #0E0905; }
@property --cielo-bajo { syntax: "<color>"; inherits: true; initial-value: #1E1308; }
@property --cielo-a { syntax: "<color>"; inherits: true; initial-value: #A8661E; }
@property --cielo-b { syntax: "<color>"; inherits: true; initial-value: #5A3416; }
@property --cielo-c { syntax: "<color>"; inherits: true; initial-value: #A87A24; }
@property --cielo-luz { syntax: "<color>"; inherits: true; initial-value: #D89A2A; }
@property --estado { syntax: "<color>"; inherits: true; initial-value: #8FE0A8; }
@property --pie-cifra { syntax: "<color>"; inherits: true; initial-value: rgb(255 233 196 / .8); }
@property --brillo-cifra { syntax: "<color>"; inherits: true; initial-value: rgb(255 203 82 / .34); }

/* Números que se animan */
@property --nivel { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --luz { syntax: "<number>"; inherits: false; initial-value: 0; }

:root {
  --curva-ios: cubic-bezier(.32, .72, 0, 1);
  --suave: cubic-bezier(.2, .8, .2, 1);
  --muelle: cubic-bezier(.34, 1.56, .64, 1);
  --muelle-suave: cubic-bezier(.3, 1.3, .5, 1);
  --fuente: "Encode Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --teclado: 0px;

  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--fondo);
  /* Cambio de paleta: todo funde en algo más de medio segundo */
  transition:
    --fondo 700ms ease, --texto 700ms ease, --texto-2 700ms ease, --texto-3 700ms ease,
    --ingreso 700ms ease, --gasto 700ms ease, --suscripcion 700ms ease,
    --ingreso-vivo 700ms ease, --gasto-vivo 700ms ease, --suscripcion-vivo 700ms ease, --sobre-vivo 700ms ease,
    --liquido 900ms ease, --liquido-2 900ms ease, --liquido-medio 900ms ease, --liquido-hondo 900ms ease, --liquido-luz 900ms ease, --tinta-vaso 700ms ease,
    --apuntar-1 700ms ease, --apuntar-2 700ms ease, --apuntar-texto 700ms ease, --apuntar-canto 700ms ease,
    --aviso 700ms ease, --negativo 700ms ease,
    --cristal-tinte 700ms ease, --cristal-luz 700ms ease, --cristal-borde 700ms ease, --linea 700ms ease, --sombra 700ms ease,
    --gema-canto 700ms ease, --foco 700ms ease, --cifra-alto 700ms ease, --vaso-tinte 700ms ease, --chip-fondo 700ms ease,
    --halo 700ms ease, --campo-fondo 700ms ease, --campo-borde 700ms ease,
    --seria-1 700ms ease, --seria-2 700ms ease, --seria-texto 700ms ease, --seria-canto 700ms ease,
    --tostada-fondo 700ms ease, --tostada-texto 700ms ease, --tostada-accion 700ms ease,
    --hoja-fondo 700ms ease, --velo 700ms ease;
}

/* ===== Paletas: una por [data-paleta] en <html>; el cielo, según lo que queda (body[data-estado]) ===== */

/* ---- Aurora ---- */
[data-paleta="aurora"] {
  color-scheme: dark;
  --fondo: #030817;
  --texto: #F2F5FF;
  --texto-2: rgb(242 245 255 / 0.8);
  --texto-3: rgb(242 245 255 / 0.72);
  --ingreso: #5EE6D0;
  --gasto: #FF9A8C;
  --suscripcion: #C3B4FF;
  --ingreso-vivo: #5EE6D0;
  --gasto-vivo: #FF9A8C;
  --suscripcion-vivo: #C3B4FF;
  --sobre-vivo: #06122A;
  --liquido: #127A72;
  --liquido-2: #1A6585;
  --liquido-hondo: #1C2C7A;
  --liquido-luz: #5EE6D0;
  --tinta-vaso: #F4F8FF;
  --apuntar-1: #157F78;
  --apuntar-2: #4A3CCB;
  --apuntar-texto: #FFFFFF;
  --apuntar-canto: #2A2290;
  --aviso: #FFC56B;
  --negativo: #FFB4A8;
  --cristal-tinte: rgb(3 8 23 / 0.48);
  --cristal-luz: rgb(255 255 255 / .42);
  --linea: rgb(255 255 255 / .09);
  --sombra: rgb(0 0 0 / .6);
  --gema-canto: rgb(242 245 255 / 0.16);
  --foco: #F2F5FF;
  --detras: #000000;
  --cifra-alto: #FFFFFF;
  --vaso-tinte: rgb(3 8 23 / 0.34);
  --chip-fondo: rgb(3 8 23 / 0.6);
  --liquido-medio: #175776;
  --cristal-borde: rgb(255 255 255 / .06);
  --halo: rgb(3 8 23 / 0.85);
  --campo-fondo: rgb(255 255 255 / .07);
  --campo-borde: rgb(255 255 255 / .13);
  --seria-1: #FFFFFF;
  --seria-2: #DADDE8;
  --seria-texto: #030817;
  --seria-canto: rgb(242 245 255 / 0.34);
  --tostada-fondo: rgb(3 8 23 / 0.78);
  --tostada-texto: #F2F5FF;
  --tostada-accion: #5EE6D0;
  --hoja-fondo: rgb(3 8 23 / 0.84);
  --velo: rgb(0 0 0 / .45);
}
[data-paleta="aurora"] body {
  --cielo-alto: #030817; --cielo-bajo: #081233; --cielo-a: #0E7C74; --cielo-b: #2A2C9C; --cielo-c: #3C1C7E; --cielo-luz: #139C8F;
  --estado: #5EE6D0; --pie-cifra: rgb(200 226 255 / 0.8); --brillo-cifra: rgb(94 230 208 / 0.34);
}
[data-paleta="aurora"] body[data-estado="justo"] {
  --cielo-alto: #0B0517; --cielo-bajo: #1C0A26; --cielo-a: #7C2C6C; --cielo-b: #43208C; --cielo-c: #8C3A1A; --cielo-luz: #B8691C;
  --estado: #FFC56B; --pie-cifra: rgb(255 228 200 / 0.8); --brillo-cifra: rgb(255 176 110 / 0.34);
}
[data-paleta="aurora"] body[data-estado="pasas"] {
  --cielo-alto: #0E0309; --cielo-bajo: #1E0611; --cielo-a: #8E1838; --cielo-b: #571042; --cielo-c: #8F2A12; --cielo-luz: #C8303C;
  --estado: #FFB4A8; --pie-cifra: rgb(255 200 190 / 0.8); --brillo-cifra: rgb(255 90 90 / 0.42);
}

/* ---- Atardecer ---- */
[data-paleta="atardecer"] {
  color-scheme: dark;
  --fondo: #14061A;
  --texto: #FFF3EF;
  --texto-2: rgb(255 243 239 / 0.8);
  --texto-3: rgb(255 243 239 / 0.72);
  --ingreso: #7CE6BE;
  --gasto: #FFAA9C;
  --suscripcion: #E0C4FF;
  --ingreso-vivo: #7CE6BE;
  --gasto-vivo: #FFAA9C;
  --suscripcion-vivo: #E0C4FF;
  --sobre-vivo: #2A0A1E;
  --liquido: #B0405C;
  --liquido-2: #C2584C;
  --liquido-hondo: #5E1848;
  --liquido-luz: #FFB894;
  --tinta-vaso: #FFF6F2;
  --apuntar-1: #FFCDA2;
  --apuntar-2: #FF7F72;
  --apuntar-texto: #2A0A1E;
  --apuntar-canto: #B8463E;
  --aviso: #FFC56B;
  --negativo: #FFB4A8;
  --cristal-tinte: rgb(20 6 26 / 0.48);
  --cristal-luz: rgb(255 255 255 / .42);
  --linea: rgb(255 255 255 / .09);
  --sombra: rgb(0 0 0 / .6);
  --gema-canto: rgb(255 243 239 / 0.16);
  --foco: #FFF3EF;
  --detras: #000000;
  --cifra-alto: #FFFFFF;
  --vaso-tinte: rgb(20 6 26 / 0.34);
  --chip-fondo: rgb(20 6 26 / 0.6);
  --liquido-medio: #8B2E53;
  --cristal-borde: rgb(255 255 255 / .06);
  --halo: rgb(20 6 26 / 0.85);
  --campo-fondo: rgb(255 255 255 / .07);
  --campo-borde: rgb(255 255 255 / .13);
  --seria-1: #FFFFFF;
  --seria-2: #E8DBDA;
  --seria-texto: #14061A;
  --seria-canto: rgb(255 243 239 / 0.34);
  --tostada-fondo: rgb(20 6 26 / 0.78);
  --tostada-texto: #FFF3EF;
  --tostada-accion: #FFB894;
  --hoja-fondo: rgb(20 6 26 / 0.84);
  --velo: rgb(0 0 0 / .45);
}
[data-paleta="atardecer"] body {
  --cielo-alto: #14061A; --cielo-bajo: #2C0B30; --cielo-a: #C24D6A; --cielo-b: #6A2A80; --cielo-c: #B8664A; --cielo-luz: #EE7A68;
  --estado: #7CE6BE; --pie-cifra: rgb(255 220 208 / 0.8); --brillo-cifra: rgb(255 184 148 / 0.34);
}
[data-paleta="atardecer"] body[data-estado="justo"] {
  --cielo-alto: #120612; --cielo-bajo: #241016; --cielo-a: #A85A28; --cielo-b: #55204A; --cielo-c: #B88A34; --cielo-luz: #CC7E2C;
  --estado: #FFC56B; --pie-cifra: rgb(255 230 196 / 0.8); --brillo-cifra: rgb(255 176 110 / 0.34);
}
[data-paleta="atardecer"] body[data-estado="pasas"] {
  --cielo-alto: #110306; --cielo-bajo: #22060C; --cielo-a: #9A1428; --cielo-b: #4A0A26; --cielo-c: #7A1A0C; --cielo-luz: #CC2A34;
  --estado: #FFB4A8; --pie-cifra: rgb(255 198 190 / 0.8); --brillo-cifra: rgb(255 90 90 / 0.42);
}

/* ---- Miel ---- */
[data-paleta="miel"] {
  color-scheme: dark;
  --fondo: #0E0905;
  --texto: #FFF6E6;
  --texto-2: rgb(255 246 230 / 0.8);
  --texto-3: rgb(255 246 230 / 0.72);
  --ingreso: #8FE0A8;
  --gasto: #FFB2AC;
  --suscripcion: #DCC6FF;
  --ingreso-vivo: #8FE0A8;
  --gasto-vivo: #FFB2AC;
  --suscripcion-vivo: #DCC6FF;
  --sobre-vivo: #2A1600;
  --liquido: #A65C00;
  --liquido-2: #B8700E;
  --liquido-hondo: #5A2A04;
  --liquido-luz: #FFCB52;
  --tinta-vaso: #FFF8EC;
  --apuntar-1: #FFDE85;
  --apuntar-2: #FFA42E;
  --apuntar-texto: #2A1600;
  --apuntar-canto: #B86A0A;
  --aviso: #FFC56B;
  --negativo: #FFB4A8;
  --cristal-tinte: rgb(14 9 5 / 0.48);
  --cristal-luz: rgb(255 255 255 / .42);
  --linea: rgb(255 255 255 / .09);
  --sombra: rgb(0 0 0 / .6);
  --gema-canto: rgb(255 246 230 / 0.16);
  --foco: #FFF6E6;
  --detras: #000000;
  --cifra-alto: #FFFFFF;
  --vaso-tinte: rgb(14 9 5 / 0.34);
  --chip-fondo: rgb(14 9 5 / 0.6);
  --liquido-medio: #844602;
  --cristal-borde: rgb(255 255 255 / .06);
  --halo: rgb(14 9 5 / 0.85);
  --campo-fondo: rgb(255 255 255 / .07);
  --campo-borde: rgb(255 255 255 / .13);
  --seria-1: #FFFFFF;
  --seria-2: #E7DED0;
  --seria-texto: #0E0905;
  --seria-canto: rgb(255 246 230 / 0.34);
  --tostada-fondo: rgb(14 9 5 / 0.78);
  --tostada-texto: #FFF6E6;
  --tostada-accion: #FFCB52;
  --hoja-fondo: rgb(14 9 5 / 0.84);
  --velo: rgb(0 0 0 / .45);
}
[data-paleta="miel"] body {
  --cielo-alto: #0E0905; --cielo-bajo: #1E1308; --cielo-a: #A8661E; --cielo-b: #5A3416; --cielo-c: #A87A24; --cielo-luz: #D89A2A;
  --estado: #8FE0A8; --pie-cifra: rgb(255 233 196 / 0.8); --brillo-cifra: rgb(255 203 82 / 0.34);
}
[data-paleta="miel"] body[data-estado="justo"] {
  --cielo-alto: #0E0806; --cielo-bajo: #1C0E08; --cielo-a: #7E3A14; --cielo-b: #3E1C0C; --cielo-c: #8E4A16; --cielo-luz: #A65A1C;
  --estado: #FFC56B; --pie-cifra: rgb(255 220 192 / 0.8); --brillo-cifra: rgb(255 176 110 / 0.34);
}
[data-paleta="miel"] body[data-estado="pasas"] {
  --cielo-alto: #100405; --cielo-bajo: #200709; --cielo-a: #962016; --cielo-b: #420C0C; --cielo-c: #7A1A10; --cielo-luz: #C4302A;
  --estado: #FFB4A8; --pie-cifra: rgb(255 198 190 / 0.8); --brillo-cifra: rgb(255 90 90 / 0.42);
}

/* ---- Esmeralda ---- */
[data-paleta="esmeralda"] {
  color-scheme: dark;
  --fondo: #03100B;
  --texto: #EEFFF5;
  --texto-2: rgb(238 255 245 / 0.8);
  --texto-3: rgb(238 255 245 / 0.72);
  --ingreso: #F2E27A;
  --gasto: #FFA6B4;
  --suscripcion: #9FD8FF;
  --ingreso-vivo: #F2E27A;
  --gasto-vivo: #FFA6B4;
  --suscripcion-vivo: #9FD8FF;
  --sobre-vivo: #04140C;
  --liquido: #0E7A56;
  --liquido-2: #14866A;
  --liquido-hondo: #05402E;
  --liquido-luz: #72F2BA;
  --tinta-vaso: #F0FFF7;
  --apuntar-1: #A4F6D0;
  --apuntar-2: #2FCB8E;
  --apuntar-texto: #032016;
  --apuntar-canto: #13875C;
  --aviso: #FFC56B;
  --negativo: #FFB4A8;
  --cristal-tinte: rgb(3 16 11 / 0.48);
  --cristal-luz: rgb(255 255 255 / .42);
  --linea: rgb(255 255 255 / .09);
  --sombra: rgb(0 0 0 / .6);
  --gema-canto: rgb(238 255 245 / 0.16);
  --foco: #EEFFF5;
  --detras: #000000;
  --cifra-alto: #FFFFFF;
  --vaso-tinte: rgb(3 16 11 / 0.34);
  --chip-fondo: rgb(3 16 11 / 0.6);
  --liquido-medio: #0A6044;
  --cristal-borde: rgb(255 255 255 / .06);
  --halo: rgb(3 16 11 / 0.85);
  --campo-fondo: rgb(255 255 255 / .07);
  --campo-borde: rgb(255 255 255 / .13);
  --seria-1: #FFFFFF;
  --seria-2: #D7E7DE;
  --seria-texto: #03100B;
  --seria-canto: rgb(238 255 245 / 0.34);
  --tostada-fondo: rgb(3 16 11 / 0.78);
  --tostada-texto: #EEFFF5;
  --tostada-accion: #72F2BA;
  --hoja-fondo: rgb(3 16 11 / 0.84);
  --velo: rgb(0 0 0 / .45);
}
[data-paleta="esmeralda"] body {
  --cielo-alto: #03100B; --cielo-bajo: #072218; --cielo-a: #0F7A52; --cielo-b: #0B4D44; --cielo-c: #2F6E2A; --cielo-luz: #18A070;
  --estado: #72F2BA; --pie-cifra: rgb(210 255 232 / 0.8); --brillo-cifra: rgb(114 242 186 / 0.34);
}
[data-paleta="esmeralda"] body[data-estado="justo"] {
  --cielo-alto: #0C0F05; --cielo-bajo: #1B1E08; --cielo-a: #7A7418; --cielo-b: #384212; --cielo-c: #9A6C18; --cielo-luz: #AA8C1C;
  --estado: #FFC56B; --pie-cifra: rgb(255 240 196 / 0.8); --brillo-cifra: rgb(255 176 110 / 0.34);
}
[data-paleta="esmeralda"] body[data-estado="pasas"] {
  --cielo-alto: #120605; --cielo-bajo: #220A08; --cielo-a: #8A2618; --cielo-b: #3A1410; --cielo-c: #761818; --cielo-luz: #C03C2A;
  --estado: #FFB4A8; --pie-cifra: rgb(255 198 190 / 0.8); --brillo-cifra: rgb(255 90 90 / 0.42);
}

/* ---- Malva ---- */
[data-paleta="malva"] {
  color-scheme: dark;
  --fondo: #0D0718;
  --texto: #F8F0FF;
  --texto-2: rgb(248 240 255 / 0.8);
  --texto-3: rgb(248 240 255 / 0.72);
  --ingreso: #7EEBC4;
  --gasto: #FFA48C;
  --suscripcion: #E8E27E;
  --ingreso-vivo: #7EEBC4;
  --gasto-vivo: #FFA48C;
  --suscripcion-vivo: #E8E27E;
  --sobre-vivo: #1E0A33;
  --liquido: #8A3FB8;
  --liquido-2: #A44A9E;
  --liquido-hondo: #3C1A78;
  --liquido-luz: #E6B8FF;
  --tinta-vaso: #FBF5FF;
  --apuntar-1: #EFD0FF;
  --apuntar-2: #B57BFF;
  --apuntar-texto: #1E0A33;
  --apuntar-canto: #7A44C8;
  --aviso: #FFC56B;
  --negativo: #FFB4A8;
  --cristal-tinte: rgb(13 7 24 / 0.48);
  --cristal-luz: rgb(255 255 255 / .42);
  --linea: rgb(255 255 255 / .09);
  --sombra: rgb(0 0 0 / .6);
  --gema-canto: rgb(248 240 255 / 0.16);
  --foco: #F8F0FF;
  --detras: #000000;
  --cifra-alto: #FFFFFF;
  --vaso-tinte: rgb(13 7 24 / 0.34);
  --chip-fondo: rgb(13 7 24 / 0.6);
  --liquido-medio: #672E9B;
  --cristal-borde: rgb(255 255 255 / .06);
  --halo: rgb(13 7 24 / 0.85);
  --campo-fondo: rgb(255 255 255 / .07);
  --campo-borde: rgb(255 255 255 / .13);
  --seria-1: #FFFFFF;
  --seria-2: #E1D9E8;
  --seria-texto: #0D0718;
  --seria-canto: rgb(248 240 255 / 0.34);
  --tostada-fondo: rgb(13 7 24 / 0.78);
  --tostada-texto: #F8F0FF;
  --tostada-accion: #E6B8FF;
  --hoja-fondo: rgb(13 7 24 / 0.84);
  --velo: rgb(0 0 0 / .45);
}
[data-paleta="malva"] body {
  --cielo-alto: #0D0718; --cielo-bajo: #1D0F35; --cielo-a: #8A4EC4; --cielo-b: #4A2A8C; --cielo-c: #C07AA8; --cielo-luz: #A868D8;
  --estado: #7EEBC4; --pie-cifra: rgb(238 220 255 / 0.8); --brillo-cifra: rgb(230 184 255 / 0.34);
}
[data-paleta="malva"] body[data-estado="justo"] {
  --cielo-alto: #110714; --cielo-bajo: #22101E; --cielo-a: #A8507A; --cielo-b: #5A2A62; --cielo-c: #B8783A; --cielo-luz: #C87A52;
  --estado: #FFC56B; --pie-cifra: rgb(255 226 204 / 0.8); --brillo-cifra: rgb(255 176 110 / 0.34);
}
[data-paleta="malva"] body[data-estado="pasas"] {
  --cielo-alto: #120410; --cielo-bajo: #240818; --cielo-a: #A01E40; --cielo-b: #4A0E32; --cielo-c: #8A1A22; --cielo-luz: #D03048;
  --estado: #FFB4A8; --pie-cifra: rgb(255 198 200 / 0.8); --brillo-cifra: rgb(255 90 90 / 0.42);
}

/* ---- Cobre ---- */
[data-paleta="cobre"] {
  color-scheme: dark;
  --fondo: #0B0B0C;
  --texto: #F4F1EE;
  --texto-2: rgb(244 241 238 / 0.8);
  --texto-3: rgb(244 241 238 / 0.72);
  --ingreso: #8EDDB0;
  --gasto: #FFA68E;
  --suscripcion: #C8B8F0;
  --ingreso-vivo: #8EDDB0;
  --gasto-vivo: #FFA68E;
  --suscripcion-vivo: #C8B8F0;
  --sobre-vivo: #1F0E05;
  --liquido: #A44E3E;
  --liquido-2: #B8674E;
  --liquido-hondo: #3E1E18;
  --liquido-luz: #FFBFA0;
  --tinta-vaso: #FFF7F0;
  --apuntar-1: #F8D2BE;
  --apuntar-2: #C8785C;
  --apuntar-texto: #1F0E05;
  --apuntar-canto: #7A3C2A;
  --aviso: #FFC56B;
  --negativo: #FFB4A8;
  --cristal-tinte: rgb(11 11 12 / 0.48);
  --cristal-luz: rgb(255 255 255 / .42);
  --linea: rgb(255 255 255 / .09);
  --sombra: rgb(0 0 0 / .6);
  --gema-canto: rgb(244 241 238 / 0.16);
  --foco: #F4F1EE;
  --detras: #000000;
  --cifra-alto: #FFFFFF;
  --vaso-tinte: rgb(11 11 12 / 0.34);
  --chip-fondo: rgb(11 11 12 / 0.6);
  --liquido-medio: #76382D;
  --cristal-borde: rgb(255 255 255 / .06);
  --halo: rgb(11 11 12 / 0.85);
  --campo-fondo: rgb(255 255 255 / .07);
  --campo-borde: rgb(255 255 255 / .13);
  --seria-1: #FFFFFF;
  --seria-2: #DDDAD7;
  --seria-texto: #0B0B0C;
  --seria-canto: rgb(244 241 238 / 0.34);
  --tostada-fondo: rgb(11 11 12 / 0.78);
  --tostada-texto: #F4F1EE;
  --tostada-accion: #FFBFA0;
  --hoja-fondo: rgb(11 11 12 / 0.84);
  --velo: rgb(0 0 0 / .45);
}
[data-paleta="cobre"] body {
  --cielo-alto: #0B0B0C; --cielo-bajo: #18181A; --cielo-a: #6A4C40; --cielo-b: #34343A; --cielo-c: #5A4A3E; --cielo-luz: #94604A;
  --estado: #8EDDB0; --pie-cifra: rgb(255 230 216 / 0.8); --brillo-cifra: rgb(255 191 160 / 0.34);
}
[data-paleta="cobre"] body[data-estado="justo"] {
  --cielo-alto: #0D0B08; --cielo-bajo: #1C1710; --cielo-a: #8A6A28; --cielo-b: #3A3220; --cielo-c: #9A7A30; --cielo-luz: #B08838;
  --estado: #FFC56B; --pie-cifra: rgb(255 240 200 / 0.8); --brillo-cifra: rgb(255 176 110 / 0.34);
}
[data-paleta="cobre"] body[data-estado="pasas"] {
  --cielo-alto: #100707; --cielo-bajo: #1E0C0A; --cielo-a: #8A2418; --cielo-b: #3A1612; --cielo-c: #6A1A14; --cielo-luz: #B8382A;
  --estado: #FFB4A8; --pie-cifra: rgb(255 198 190 / 0.8); --brillo-cifra: rgb(255 90 90 / 0.42);
}

/* ---- Cereza ---- */
[data-paleta="cereza"] {
  color-scheme: dark;
  --fondo: #120307;
  --texto: #FFF0F2;
  --texto-2: rgb(255 240 242 / 0.8);
  --texto-3: rgb(255 240 242 / 0.72);
  --ingreso: #86E8B8;
  --gasto: #FFB68C;
  --suscripcion: #E2C4FF;
  --ingreso-vivo: #86E8B8;
  --gasto-vivo: #FFB68C;
  --suscripcion-vivo: #E2C4FF;
  --sobre-vivo: #3A0612;
  --liquido: #B0123A;
  --liquido-2: #C42A4C;
  --liquido-hondo: #560420;
  --liquido-luz: #FF8AA4;
  --tinta-vaso: #FFF4F6;
  --apuntar-1: #FFE8EC;
  --apuntar-2: #FF8FAB;
  --apuntar-texto: #3A0612;
  --apuntar-canto: #B23258;
  --aviso: #FFC56B;
  --negativo: #FFC2A0;
  --cristal-tinte: rgb(18 3 7 / 0.48);
  --cristal-luz: rgb(255 255 255 / .42);
  --linea: rgb(255 255 255 / .09);
  --sombra: rgb(0 0 0 / .6);
  --gema-canto: rgb(255 240 242 / 0.16);
  --foco: #FFF0F2;
  --detras: #000000;
  --cifra-alto: #FFFFFF;
  --vaso-tinte: rgb(18 3 7 / 0.34);
  --chip-fondo: rgb(18 3 7 / 0.6);
  --liquido-medio: #880C2E;
  --cristal-borde: rgb(255 255 255 / .06);
  --halo: rgb(18 3 7 / 0.85);
  --campo-fondo: rgb(255 255 255 / .07);
  --campo-borde: rgb(255 255 255 / .13);
  --seria-1: #FFFFFF;
  --seria-2: #E7D8DB;
  --seria-texto: #120307;
  --seria-canto: rgb(255 240 242 / 0.34);
  --tostada-fondo: rgb(18 3 7 / 0.78);
  --tostada-texto: #FFF0F2;
  --tostada-accion: #FF8AA4;
  --hoja-fondo: rgb(18 3 7 / 0.84);
  --velo: rgb(0 0 0 / .45);
}
[data-paleta="cereza"] body {
  --cielo-alto: #120307; --cielo-bajo: #250712; --cielo-a: #B02040; --cielo-b: #5C0B2A; --cielo-c: #D06A82; --cielo-luz: #E04A64;
  --estado: #86E8B8; --pie-cifra: rgb(255 221 228 / 0.8); --brillo-cifra: rgb(255 138 164 / 0.34);
}
[data-paleta="cereza"] body[data-estado="justo"] {
  --cielo-alto: #120605; --cielo-bajo: #22100A; --cielo-a: #B05A26; --cielo-b: #561C16; --cielo-c: #C08A2E; --cielo-luz: #CC7030;
  --estado: #FFC56B; --pie-cifra: rgb(255 230 196 / 0.8); --brillo-cifra: rgb(255 176 110 / 0.34);
}
[data-paleta="cereza"] body[data-estado="pasas"] {
  --cielo-alto: #0A0204; --cielo-bajo: #160305; --cielo-a: #6A0E0A; --cielo-b: #26040A; --cielo-c: #A0360C; --cielo-luz: #E0461A;
  --estado: #FF9EAE; --pie-cifra: rgb(255 200 176 / 0.8); --brillo-cifra: rgb(255 90 90 / 0.42);
}

/* ---- Perla (clara) ---- */
[data-paleta="perla"] {
  color-scheme: light;
  --fondo: #F7F1F5;
  --texto: #2A2238;
  --texto-2: rgb(42 34 56 / 0.8);
  --texto-3: rgb(42 34 56 / 0.72);
  --ingreso: #0B7550;
  --gasto: #BD3128;
  --suscripcion: #6A40D0;
  --ingreso-vivo: #3CCF98;
  --gasto-vivo: #FF8577;
  --suscripcion-vivo: #B49CFF;
  --sobre-vivo: #2A2238;
  --liquido: #F6C6DE;
  --liquido-2: #DCCEFF;
  --liquido-hondo: #C2EBDF;
  --liquido-luz: #FFFFFF;
  --tinta-vaso: #2A2238;
  --apuntar-1: #FFA3C0;
  --apuntar-2: #A98BFF;
  --apuntar-texto: #241433;
  --apuntar-canto: #8A6AD8;
  --aviso: #8A5A00;
  --negativo: #B3261E;
  --cristal-tinte: rgb(255 255 255 / .58);
  --cristal-luz: rgb(255 255 255 / .95);
  --linea: rgb(42 34 56 / 0.1);
  --sombra: rgb(42 34 56 / 0.22);
  --gema-canto: rgb(42 34 56 / 0.16);
  --foco: #2A2238;
  --detras: #121016;
  --cifra-alto: #2A2238;
  --vaso-tinte: rgb(255 255 255 / .34);
  --chip-fondo: rgb(255 255 255 / .8);
  --liquido-medio: #DCCEFF;
  --cristal-borde: rgb(42 34 56 / 0.09);
  --halo: rgb(255 255 255 / .85);
  --campo-fondo: rgb(255 255 255 / .78);
  --campo-borde: rgb(42 34 56 / 0.16);
  --seria-1: #4C4558;
  --seria-2: #2A2238;
  --seria-texto: #FFFFFF;
  --seria-canto: rgb(42 34 56 / 0.42);
  --tostada-fondo: rgb(42 34 56 / 0.9);
  --tostada-texto: #FFFFFF;
  --tostada-accion: #FFB8CF;
  --hoja-fondo: rgb(255 255 255 / .86);
  --velo: rgb(42 34 56 / 0.3);
}
[data-paleta="perla"] body {
  --cielo-alto: #FBF7FA; --cielo-bajo: #F1EAF2; --cielo-a: #F6C2D4; --cielo-b: #CDC4FF; --cielo-c: #BDEEDC; --cielo-luz: #FFE4EE;
  --estado: #0B7550; --pie-cifra: #5A4A7A; --brillo-cifra: rgb(255 228 238 / 0);
}
[data-paleta="perla"] body[data-estado="justo"] {
  --cielo-alto: #FCF7F1; --cielo-bajo: #F4EBE0; --cielo-a: #FFD0A4; --cielo-b: #F2D0C0; --cielo-c: #FFE6A0; --cielo-luz: #FFE2C2;
  --estado: #8A5A00; --pie-cifra: #7A4A20; --brillo-cifra: rgb(255 226 194 / 0);
}
[data-paleta="perla"] body[data-estado="pasas"] {
  --cielo-alto: #FCF3F3; --cielo-bajo: #F6E4E6; --cielo-a: #FF9E9A; --cielo-b: #F4B0C4; --cielo-c: #FFAE8C; --cielo-luz: #FFC8C2;
  --estado: #B3261E; --pie-cifra: #8A2A2A; --brillo-cifra: rgb(255 200 194 / 0);
}

/* ---- Mediterráneo (clara) ---- */
[data-paleta="mediterraneo"] {
  color-scheme: light;
  --fondo: #F6F1E6;
  --texto: #0F2A3A;
  --texto-2: rgb(15 42 58 / 0.8);
  --texto-3: rgb(15 42 58 / 0.72);
  --ingreso: #0A7356;
  --gasto: #B5361F;
  --suscripcion: #3446C4;
  --ingreso-vivo: #2FD0A6;
  --gasto-vivo: #FF8A6E;
  --suscripcion-vivo: #8FA0FF;
  --sobre-vivo: #0F2A3A;
  --liquido: #78DED8;
  --liquido-2: #9CD0FF;
  --liquido-hondo: #3AB4C8;
  --liquido-luz: #F0FFFD;
  --tinta-vaso: #062633;
  --apuntar-1: #2A50CC;
  --apuntar-2: #127E96;
  --apuntar-texto: #FFFFFF;
  --apuntar-canto: #0E4E7A;
  --aviso: #8A5400;
  --negativo: #B3261E;
  --cristal-tinte: rgb(255 255 255 / .58);
  --cristal-luz: rgb(255 255 255 / .95);
  --linea: rgb(15 42 58 / 0.1);
  --sombra: rgb(15 42 58 / 0.22);
  --gema-canto: rgb(15 42 58 / 0.16);
  --foco: #0F2A3A;
  --detras: #121016;
  --cifra-alto: #0F2A3A;
  --vaso-tinte: rgb(255 255 255 / .34);
  --chip-fondo: rgb(255 255 255 / .8);
  --liquido-medio: #5ACCD2;
  --cristal-borde: rgb(15 42 58 / 0.09);
  --halo: rgb(255 255 255 / .85);
  --campo-fondo: rgb(255 255 255 / .78);
  --campo-borde: rgb(15 42 58 / 0.16);
  --seria-1: #354C5A;
  --seria-2: #0F2A3A;
  --seria-texto: #FFFFFF;
  --seria-canto: rgb(15 42 58 / 0.42);
  --tostada-fondo: rgb(15 42 58 / 0.9);
  --tostada-texto: #FFFFFF;
  --tostada-accion: #8FE8E2;
  --hoja-fondo: rgb(255 255 255 / .86);
  --velo: rgb(15 42 58 / 0.3);
}
[data-paleta="mediterraneo"] body {
  --cielo-alto: #F9F6EE; --cielo-bajo: #EEE5D2; --cielo-a: #9FE4DE; --cielo-b: #B8CCFF; --cielo-c: #FFDF9C; --cielo-luz: #D4F5F0;
  --estado: #0A7356; --pie-cifra: #2A4A6A; --brillo-cifra: rgb(212 245 240 / 0);
}
[data-paleta="mediterraneo"] body[data-estado="justo"] {
  --cielo-alto: #FBF5EA; --cielo-bajo: #F2E4CC; --cielo-a: #FFD49A; --cielo-b: #F0D2AE; --cielo-c: #FFC488; --cielo-luz: #FFE4BC;
  --estado: #8A5400; --pie-cifra: #6A4A1A; --brillo-cifra: rgb(255 228 188 / 0);
}
[data-paleta="mediterraneo"] body[data-estado="pasas"] {
  --cielo-alto: #FBF1EE; --cielo-bajo: #F4E0DA; --cielo-a: #FFA894; --cielo-b: #F2B6AE; --cielo-c: #FF9878; --cielo-luz: #FFC6B6;
  --estado: #B3261E; --pie-cifra: #8A2A1E; --brillo-cifra: rgb(255 198 182 / 0);
}

/* ---- Muestras del selector ---- */
[data-muestra="aurora"] { --m-fondo: #081233; --m-a: #0E7C74; --m-b: #2A2C9C; --m-c: #3C1C7E; --m-liquido: #127A72; --m-luz: #5EE6D0; }
[data-muestra="atardecer"] { --m-fondo: #2C0B30; --m-a: #C24D6A; --m-b: #6A2A80; --m-c: #B8664A; --m-liquido: #B0405C; --m-luz: #FFB894; }
[data-muestra="miel"] { --m-fondo: #1E1308; --m-a: #A8661E; --m-b: #5A3416; --m-c: #A87A24; --m-liquido: #A65C00; --m-luz: #FFCB52; }
[data-muestra="esmeralda"] { --m-fondo: #072218; --m-a: #0F7A52; --m-b: #0B4D44; --m-c: #2F6E2A; --m-liquido: #0E7A56; --m-luz: #72F2BA; }
[data-muestra="malva"] { --m-fondo: #1D0F35; --m-a: #8A4EC4; --m-b: #4A2A8C; --m-c: #C07AA8; --m-liquido: #8A3FB8; --m-luz: #E6B8FF; }
[data-muestra="cobre"] { --m-fondo: #18181A; --m-a: #6A4C40; --m-b: #34343A; --m-c: #5A4A3E; --m-liquido: #A44E3E; --m-luz: #FFBFA0; }
[data-muestra="cereza"] { --m-fondo: #250712; --m-a: #B02040; --m-b: #5C0B2A; --m-c: #D06A82; --m-liquido: #B0123A; --m-luz: #FF8AA4; }
[data-muestra="perla"] { --m-fondo: #F1EAF2; --m-a: #F6C2D4; --m-b: #CDC4FF; --m-c: #BDEEDC; --m-liquido: #F6C6DE; --m-luz: #FFFFFF; }
[data-muestra="mediterraneo"] { --m-fondo: #EEE5D2; --m-a: #9FE4DE; --m-b: #B8CCFF; --m-c: #FFDF9C; --m-liquido: #78DED8; --m-luz: #F0FFFD; }
/* ===== Fin de las paletas ===== */

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

html.con-hoja { background-color: var(--detras); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 17px;
  font-weight: 430;
  font-stretch: 100%;
  line-height: 1.38;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  /* El cielo cambia de tiempo despacio (como en A) */
  transition:
    --cielo-alto 1800ms ease, --cielo-bajo 1800ms ease, --cielo-a 1800ms ease,
    --cielo-b 1800ms ease, --cielo-c 1800ms ease, --cielo-luz 1800ms ease,
    --estado 1200ms ease, --pie-cifra 1200ms ease, --brillo-cifra 1200ms ease;
}
/* Al cambiar de paleta, el cielo va al mismo paso que lo demás */
html.cambiando-paleta body { transition-duration: 800ms; }

h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
[hidden] { display: none !important; }

:focus-visible { outline: 2.5px solid var(--foco); outline-offset: 3px; border-radius: 14px; }
::selection { background: color-mix(in srgb, var(--liquido-luz) 40%, transparent); }

.solo-lectores {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icono {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.3;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Colores por grupo: --color para texto (con contraste) y --vivo para rellenos */
[data-grupo="ingreso"], [data-tipo="ingreso"] { --color: var(--ingreso); --vivo: var(--ingreso-vivo); }
[data-grupo="gasto"], [data-tipo="gasto"] { --color: var(--gasto); --vivo: var(--gasto-vivo); }
[data-grupo="suscripcion"], [data-tipo="suscripcion"] { --color: var(--suscripcion); --vivo: var(--suscripcion-vivo); }

/* =============================================================
   El cielo: una capa de luces que derivan muy despacio (de A)
   ============================================================= */
.cielo {
  --apagado: 0; /* app.js lo sube al bajar: la luz se calma para leer las listas */
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% 112%, color-mix(in srgb, var(--cielo-c) 38%, transparent), transparent 70%),
    linear-gradient(180deg, var(--cielo-alto) 0%, var(--cielo-alto) 14%, var(--cielo-bajo) 100%);
  transform-origin: 50% 50%;
  transition: transform 520ms var(--curva-ios), border-radius 520ms var(--curva-ios);
}
.orbe {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--c) 0%, color-mix(in srgb, var(--c) 52%, transparent) 46%, color-mix(in srgb, var(--c) 14%, transparent) 76%, transparent 100%);
}
.orbe-1 {
  --c: var(--cielo-a);
  width: 150vw; height: 62vw; max-width: 900px; max-height: 380px;
  top: calc(env(safe-area-inset-top) + 4vh);
  left: -46vw;
  opacity: calc(.9 - var(--apagado) * .55);
  animation: deriva-a 30s ease-in-out infinite alternate;
}
.orbe-2 {
  --c: var(--cielo-b);
  width: 120vw; height: 120vw; max-width: 760px; max-height: 760px;
  top: -24vh; right: -62vw;
  animation: deriva-b 36s ease-in-out infinite alternate;
}
.orbe-3 {
  --c: var(--cielo-c);
  width: 130vw; height: 110vw; max-width: 820px; max-height: 700px;
  bottom: -40vh; left: -40vw;
  opacity: calc(.85 - var(--apagado) * .25);
  animation: deriva-c 42s ease-in-out infinite alternate;
}
/* La luz que hay detrás del vaso: el cristal la recoge */
.orbe-luz {
  --c: var(--cielo-luz);
  width: min(112vw, 600px); height: min(80vw, 420px);
  top: calc(env(safe-area-inset-top) + 120px);
  left: 50%;
  margin-left: calc(min(112vw, 600px) / -2);
  opacity: calc(.62 - var(--apagado) * .42);
}
.cielo-grano {
  position: absolute;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes deriva-a {
  from { transform: translate3d(-4%, -6%, 0) rotate(-22deg) scale(1); }
  to   { transform: translate3d(14%, 8%, 0) rotate(-12deg) scale(1.12); }
}
@keyframes deriva-b {
  from { transform: translate3d(6%, -4%, 0) scale(1.06); }
  to   { transform: translate3d(-14%, 8%, 0) scale(.92); }
}
@keyframes deriva-c {
  from { transform: translate3d(-6%, 6%, 0) scale(1); }
  to   { transform: translate3d(12%, -8%, 0) scale(1.16); }
}

/* =============================================================
   Cristal: tinte, brillo y borde de luz (sin desenfoque: detrás solo hay degradado)
   ============================================================= */
.vidrio {
  position: relative;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / .09), rgb(255 255 255 / .035) 40%, rgb(255 255 255 / .03)),
    var(--cristal-tinte);
  box-shadow: inset 0 0 0 1px var(--cristal-borde), 0 28px 50px -34px var(--sombra);
}
.vidrio::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(162deg, var(--cristal-luz), rgb(255 255 255 / .1) 26%, rgb(255 255 255 / .03) 60%, rgb(255 255 255 / .16));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* =============================================================
   Gemas: botones de cristal que se hunden (canto de C + luz de A)
   --luz se enciende al pulsar desde el dedo (--x, --y) y se apaga despacio.
   ============================================================= */
.gema {
  --g-1: var(--apuntar-1);
  --g-2: var(--apuntar-2);
  --g-texto: var(--apuntar-texto);
  --g-canto: var(--apuntar-canto);
  --g-halo: transparent;
  --alto-canto: 5px;
  --brillo-luz: 255 255 255;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  margin: 0 0 var(--alto-canto);
  padding: 0 22px;
  border: 0;
  border-radius: 20px;
  color: var(--g-texto);
  font-size: 17px;
  font-weight: 640;
  font-stretch: 106%;
  letter-spacing: -.005em;
  line-height: 1.1;
  text-align: center;
  background:
    radial-gradient(150px circle at var(--x, 50%) var(--y, 50%), rgb(var(--brillo-luz) / var(--luz)), transparent 62%),
    radial-gradient(120% 140% at 14% -34%, rgb(255 255 255 / .38), transparent 52%),
    linear-gradient(180deg, var(--g-1), var(--g-2));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .6),
    inset 0 0 0 1px rgb(255 255 255 / .16),
    inset 0 -2px 5px rgb(0 0 0 / .1),
    0 var(--alto-canto) 0 color-mix(in srgb, var(--g-canto) 78%, transparent),
    0 16px 30px -14px var(--g-halo);
  transform: translateY(0);
  transition:
    transform 460ms var(--muelle),
    box-shadow 460ms var(--muelle),
    --luz 700ms ease,
    filter 200ms ease;
}
/* Hundida: baja lo que mide el canto, el canto desaparece y la luz se enciende.
   .pulsado lo pone app.js para que se vea hundirse aunque el toque sea rapidísimo. */
.gema:active,
.gema.pulsado {
  --luz: .55;
  transform: translateY(var(--alto-canto));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .75),
    inset 0 0 0 1px rgb(255 255 255 / .3),
    inset 0 -2px 5px rgb(0 0 0 / .06),
    0 0 0 color-mix(in srgb, var(--g-canto) 78%, transparent),
    0 6px 26px -8px var(--g-halo);
  transition-duration: 70ms, 70ms, 90ms, 200ms;
  transition-timing-function: ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .gema:hover { filter: brightness(1.05) saturate(1.05); }
}
.gema-ancha { display: flex; width: 100%; }
.gema-mini { min-height: 44px; padding: 0 16px; border-radius: 15px; font-size: 16px; --alto-canto: 4px; }
.gema-texto { display: inline-flex; align-items: center; gap: 8px; }

.gema-apuntar { --g-halo: color-mix(in srgb, var(--apuntar-2) 70%, transparent); }
.gema-seria {
  --g-1: var(--seria-1);
  --g-2: var(--seria-2);
  --g-texto: var(--seria-texto);
  --g-canto: var(--seria-canto);
}
.gema-fantasma {
  --g-1: rgb(255 255 255 / .13);
  --g-2: rgb(255 255 255 / .05);
  --g-texto: var(--texto);
  --g-canto: var(--gema-canto);
  background:
    radial-gradient(150px circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / calc(var(--luz) * .5)), transparent 62%),
    linear-gradient(180deg, var(--g-1), var(--g-2)),
    var(--campo-fondo);
}
.gema-grupo {
  --g-1: color-mix(in srgb, var(--vivo) 72%, #fff);
  --g-2: var(--vivo);
  --g-texto: var(--sobre-vivo);
  --g-canto: color-mix(in srgb, var(--vivo) 62%, #000);
  --g-halo: color-mix(in srgb, var(--vivo) 55%, transparent);
}
.gema-borrar {
  --g-1: color-mix(in srgb, var(--gasto-vivo) 22%, transparent);
  --g-2: color-mix(in srgb, var(--gasto-vivo) 12%, transparent);
  --g-texto: var(--gasto);
  --g-canto: color-mix(in srgb, var(--gasto-vivo) 40%, transparent);
  background:
    radial-gradient(150px circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / calc(var(--luz) * .4)), transparent 62%),
    linear-gradient(180deg, var(--g-1), var(--g-2));
}
.gema.hecho {
  --g-1: color-mix(in srgb, var(--ingreso-vivo) 70%, #fff);
  --g-2: var(--ingreso-vivo);
  --g-texto: var(--sobre-vivo);
  --g-canto: color-mix(in srgb, var(--ingreso-vivo) 60%, #000);
}
.gema[disabled] { opacity: .5; pointer-events: none; }

/* Botón redondo de cristal (flechas, +) */
.redondo {
  --r-canto: var(--gema-canto);
  --alto-canto: 4px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: var(--alto-canto);
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--texto);
  background:
    radial-gradient(90px circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / calc(var(--luz) * .7)), transparent 64%),
    linear-gradient(180deg, rgb(255 255 255 / .16), rgb(255 255 255 / .05)),
    var(--chip-fondo);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .32),
    inset 0 0 0 1px rgb(255 255 255 / .11),
    0 var(--alto-canto) 0 var(--r-canto),
    0 8px 18px -10px var(--sombra);
  transition: transform 460ms var(--muelle), box-shadow 460ms var(--muelle), --luz 700ms ease;
}
.redondo:active,
.redondo.pulsado {
  --luz: .55;
  transform: translateY(var(--alto-canto));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .55),
    inset 0 0 0 1px rgb(255 255 255 / .3),
    0 0 0 var(--r-canto),
    0 4px 16px -8px var(--sombra);
  transition-duration: 70ms, 70ms, 90ms;
  transition-timing-function: ease-out;
}
.redondo-color {
  --r-canto: color-mix(in srgb, var(--vivo) 50%, transparent);
  color: var(--color);
  background:
    radial-gradient(90px circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / calc(var(--luz) * .7)), transparent 64%),
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--vivo) 42%, transparent), color-mix(in srgb, var(--vivo) 16%, transparent) 72%),
    var(--chip-fondo);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .3),
    inset 0 0 0 1px color-mix(in srgb, var(--vivo) 40%, transparent),
    0 var(--alto-canto) 0 var(--r-canto),
    0 8px 20px -10px color-mix(in srgb, var(--vivo) 50%, transparent);
}
.redondo-color.pulsado,
.redondo-color:active {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .5),
    inset 0 0 0 1px color-mix(in srgb, var(--vivo) 80%, transparent),
    0 0 0 var(--r-canto),
    0 0 24px -4px color-mix(in srgb, var(--vivo) 70%, transparent);
}
.redondo-color .icono { stroke-width: 2.8; }
.redondo-mini { width: 40px; height: 40px; border-radius: 14px; --alto-canto: 3px; }
.redondo-mini .icono { width: 20px; height: 20px; }

.boton-texto {
  min-height: 44px;
  min-width: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--texto-2);
  font-size: 17px;
  font-weight: 520;
  border-radius: 12px;
  transition: color 150ms, transform 300ms var(--muelle);
}
.boton-texto:active { color: var(--texto); transform: scale(.94); transition-duration: 60ms; }

/* =============================================================
   Cabecera
   ============================================================= */
.escena {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  transform-origin: 50% var(--origen-y, 50vh);
  transition: transform 520ms var(--curva-ios);
}
html.con-hoja .escena,
html.con-hoja .cielo { transform: scale(.93); }
html.con-hoja .cielo { border-radius: 34px; }
/* Solo se recorta el trozo que se ve: así la página de detrás es una tarjeta
   con esquinas redondas aunque hayas bajado (las variables las pone app.js). */
html.recortada .escena {
  clip-path: inset(var(--recorte-arriba, 0px) 0 var(--recorte-abajo, 0px) 0 round 34px);
}

.columna {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 14px)
    max(16px, env(safe-area-inset-right))
    calc(env(safe-area-inset-bottom) + 140px)
    max(16px, env(safe-area-inset-left));
}

/* Año y Ajustes arriba; mes y flechas abajo
   (con tres botones en la fila del mes, «Septiembre» no cabría a 375 px) */
.cabecera {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "anio ajustes"
    "mes  flechas";
  align-items: end;
  gap: 2px 12px;
  padding: 0 2px 18px;
  text-shadow: 0 1px 14px var(--halo);
}
.cabecera-anio {
  grid-area: anio;
  align-self: center;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: var(--texto-2);
  font-size: 17px;
  font-weight: 480;
  font-stretch: 110%;
  font-variant-numeric: tabular-nums;
}
.chip-hoy {
  --g-1: var(--apuntar-1);
  --g-2: var(--apuntar-2);
  position: relative;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--apuntar-texto);
  font-size: 14px;
  font-weight: 640;
  font-stretch: 104%;
  text-shadow: none;
  background:
    radial-gradient(120% 140% at 14% -34%, rgb(255 255 255 / .38), transparent 52%),
    linear-gradient(180deg, var(--g-1), var(--g-2));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), 0 3px 0 color-mix(in srgb, var(--apuntar-canto) 78%, transparent);
  transform: translateY(0);
  transition: transform 400ms var(--muelle), box-shadow 400ms var(--muelle);
  animation: entrar-chip 420ms var(--muelle);
}
.chip-hoy::after { content: ""; position: absolute; inset: -8px -4px; } /* zona táctil de 44 px */
.chip-hoy:active,
.chip-hoy.pulsado { transform: translateY(3px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), 0 0 0 transparent; transition-duration: 70ms; }
@keyframes entrar-chip { from { transform: scale(.6); opacity: 0; } }

.cabecera-mes { grid-area: mes; min-width: 0; line-height: 1; }
.titulo-mes {
  display: block;
  margin: 0 0 0 -4px;
  padding: 2px 4px 4px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--texto);
  font-size: clamp(31px, 9.4vw, 38px);
  font-weight: 600;
  font-stretch: 108%;
  letter-spacing: -.03em;
  line-height: 1.02;
  text-align: left;
  white-space: nowrap;
  transition: transform 300ms var(--muelle);
}
.titulo-mes:active { transform: scale(.97); transition-duration: 60ms; }
.cabecera-flechas { grid-area: flechas; display: flex; gap: 10px; flex: none; padding-bottom: 2px; text-shadow: none; }

/* ---------- Barra fija (al bajar): cristal que se desvanece hacia abajo ---------- */
.barra-fija {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  transform: translateY(-110%);
  transition: transform 420ms var(--curva-ios);
}
.barra-fija::before {
  content: "";
  position: absolute;
  inset: 0 0 -22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cielo-alto) 80%, transparent), color-mix(in srgb, var(--cielo-alto) 50%, transparent) 72%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-mask-image: linear-gradient(180deg, #000 64%, transparent);
  mask-image: linear-gradient(180deg, #000 64%, transparent);
  pointer-events: none;
}
.barra-fija.visible { transform: translateY(0); }
html.con-hoja .barra-fija { transform: translateY(-110%); }
.barra-fija-dentro {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
  padding: 8px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
}
.barra-fija-texto { display: grid; text-align: center; line-height: 1.2; min-width: 0; }
.barra-fija-mes { font-size: 17px; font-weight: 620; font-stretch: 110%; letter-spacing: -.01em; }
.barra-fija-queda { font-size: 14px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.barra-fija-queda b { color: var(--estado); font-weight: 640; }

/* =============================================================
   El vaso de cristal (el «momento»)
   ============================================================= */
.vaso {
  --vaso-canto: color-mix(in srgb, var(--liquido-luz) 26%, var(--gema-canto));
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 318px;
  margin-bottom: 8px;
  padding: 22px 18px 18px;
  border-radius: 36px 36px 46px 46px;
  color: var(--tinta-vaso);
  /* Cristal: más denso en los bordes (como un vaso redondo visto de frente) */
  background:
    linear-gradient(90deg, rgb(255 255 255 / .16), rgb(255 255 255 / .04) 14%, rgb(255 255 255 / 0) 46%, rgb(255 255 255 / .03) 82%, rgb(255 255 255 / .13)),
    var(--vaso-tinte);
  -webkit-backdrop-filter: blur(12px) saturate(165%);
  backdrop-filter: blur(12px) saturate(165%);
  box-shadow:
    inset 0 1.5px 0 rgb(255 255 255 / .55),
    inset 0 0 0 1px rgb(255 255 255 / .12),
    inset 10px 0 18px -14px rgb(255 255 255 / .35),
    inset -10px 0 18px -14px rgb(255 255 255 / .28),
    0 6px 0 var(--vaso-canto),
    0 34px 70px -30px color-mix(in srgb, var(--liquido-luz) 60%, transparent),
    0 24px 44px -26px var(--sombra);
  transform: translateY(0);
  transition:
    --nivel 1300ms cubic-bezier(.3, 1.25, .45, 1),
    box-shadow 600ms ease,
    transform 500ms var(--muelle);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.vaso.pulsado {
  transform: translateY(4px);
  box-shadow:
    inset 0 1.5px 0 rgb(255 255 255 / .55),
    inset 0 0 0 1px rgb(255 255 255 / .12),
    inset 10px 0 18px -14px rgb(255 255 255 / .35),
    inset -10px 0 18px -14px rgb(255 255 255 / .28),
    0 2px 0 var(--vaso-canto),
    0 28px 60px -30px color-mix(in srgb, var(--liquido-luz) 70%, transparent),
    0 18px 36px -26px var(--sombra);
  transition-duration: 1300ms, 600ms, 90ms;
}
/* Borde de luz del cristal, por encima del líquido */
.vaso::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(160deg, rgb(255 255 255 / .7), rgb(255 255 255 / .12) 24%, rgb(255 255 255 / .04) 58%, rgb(255 255 255 / .3) 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.vaso-liquido {
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translateY(calc((1 - var(--nivel)) * 100%));
  pointer-events: none;
}
.vaso-agita {
  position: absolute;
  inset: 0 -12% -40% -12%;
  transform-origin: 50% 0;
}
.olas { position: absolute; left: 0; right: 0; top: -21px; height: 24px; transform-origin: 50% 100%; }
/* Luz que sube del líquido al cristal */
.olas::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 70px;
  background: linear-gradient(to top, color-mix(in srgb, var(--liquido-luz) 24%, transparent), transparent);
}
.ola {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200%;
  height: 100%;
  animation: ola 5.2s linear infinite;
}
/* La ola de delante, del mismo tono que la superficie del líquido (sin escalón de color bajo la cresta) */
.ola path { fill: color-mix(in srgb, var(--liquido-luz) 32%, var(--liquido)); }
.ola-atras { bottom: 5px; animation-duration: 8.5s; animation-direction: reverse; opacity: .85; }
.ola-atras path { fill: var(--liquido-2); }
/* El menisco: un hilo de luz con su halo que sigue la cresta de la ola */
.ola-brillo { overflow: visible; }
.ola-brillo path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ola-brillo .ola-halo { stroke: color-mix(in srgb, var(--liquido-luz) 45%, transparent); stroke-width: 7px; }
.ola-brillo .ola-hilo { stroke: color-mix(in srgb, var(--liquido-luz) 55%, #fff); stroke-width: 2.2px; }
@keyframes ola { to { transform: translateX(-50%); } }

.liquido-cuerpo {
  position: absolute;
  inset: 2px 0 0 0;
  /* Más luminoso en la superficie, más hondo abajo y más oscuro en los cantos:
     un líquido que brilla dentro de un vaso redondo, no un rectángulo.
     (La caja es un 12 % más ancha que el vaso a cada lado: los cantos se ven en el 10 % y el 90 %.) */
  background:
    linear-gradient(90deg, transparent 8%, color-mix(in srgb, var(--liquido-hondo) 70%, transparent) 10%, transparent 27%, transparent 73%, color-mix(in srgb, var(--liquido-hondo) 70%, transparent) 90%, transparent 92%),
    radial-gradient(70% 90px at 50% 0, color-mix(in srgb, var(--liquido-luz) 26%, transparent), transparent),
    radial-gradient(34% 130px at 50% 70px, color-mix(in srgb, var(--liquido-luz) 14%, transparent), transparent),
    linear-gradient(to bottom, color-mix(in srgb, var(--liquido-luz) 32%, var(--liquido)) 0, var(--liquido) 24px, var(--liquido-medio) 120px, var(--liquido-hondo) 260px);
}

/* Burbujas: suben despacio del fondo y se deshacen al llegar a la superficie
   (la caja va de la superficie al fondo y recorta lo que sale por arriba) */
.burbujas {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(max(var(--nivel), 0) * 100%);
  overflow: hidden;
}
.carril {
  position: absolute;
  bottom: 0;
  width: 12px;
  height: 12px;
  animation: subir 9s linear infinite;
}
.carril:nth-child(1) { left: 13%; animation-duration: 8.2s; }
.carril:nth-child(2) { left: 31%; animation-duration: 11s; animation-delay: -4s; }
.carril:nth-child(3) { left: 64%; animation-duration: 9.6s; animation-delay: -7s; }
.carril:nth-child(4) { left: 83%; animation-duration: 12.4s; animation-delay: -2s; }
.burbuja {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .6);
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / .8) 0 18%, rgb(255 255 255 / .08) 55%);
  animation: vaiven 2.4s ease-in-out infinite alternate;
}
.carril:nth-child(2) .burbuja { width: 5px; height: 5px; animation-duration: 1.9s; }
.carril:nth-child(3) .burbuja { width: 9px; height: 9px; animation-duration: 2.8s; }
.carril:nth-child(4) .burbuja { width: 4px; height: 4px; }
/* En píxeles y no en %: así el recorrido no depende del nivel (que cambia) */
@keyframes subir {
  0% { transform: translateY(12px); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(-340px); opacity: 1; }
}
@keyframes vaiven { from { transform: translateX(-3px); } to { transform: translateX(3px); } }

/* Gotas que saltan al tocar el vaso (las crea app.js) */
.vaso-gotas { position: absolute; left: 0; right: 0; top: -8px; height: 0; }
.gota {
  position: absolute;
  top: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--liquido-luz) 60%, #fff) 0 22%, var(--liquido) 70%);
  box-shadow: 0 0 8px color-mix(in srgb, var(--liquido-luz) 55%, transparent);
}

/* Reflejos del cristal: lo que convierte la tarjeta en un vaso.
   Un filo de luz que abraza la esquina de arriba a la derecha y se apaga al bajar,
   y un resplandor ancho y difuso en el canto izquierdo, que sigue su curva.
   Van por encima del líquido, porque el brillo es del cristal. */
.vaso-reflejo,
.vaso-reflejo-suave {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  transition: opacity 600ms;
}
.vaso-reflejo {
  top: 7px;
  right: 7px;
  width: 92px;
  height: 46%;
  border: 2.5px solid transparent;
  border-top-color: rgb(255 255 255 / .85);
  border-right-color: rgb(255 255 255 / .85);
  border-top-right-radius: 29px;
  /* Nace a la izquierda, brilla en la curva y se apaga hacia abajo */
  -webkit-mask: linear-gradient(90deg, transparent 8%, #000 70%), linear-gradient(180deg, #000 30%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(90deg, transparent 8%, #000 70%), linear-gradient(180deg, #000 30%, transparent 100%);
  mask-composite: intersect;
  filter: drop-shadow(0 0 3px rgb(255 255 255 / .5));
}
.vaso-reflejo-suave {
  top: 6px;
  bottom: 8px;
  left: 6px;
  width: 26px;
  border-radius: 30px 0 0 40px / 30px 0 0 40px;
  background: linear-gradient(90deg, rgb(255 255 255 / .26), rgb(255 255 255 / .06) 45%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / .55) 45%, rgb(0 0 0 / .2) 75%, rgb(0 0 0 / .5) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / .55) 45%, rgb(0 0 0 / .2) 75%, rgb(0 0 0 / .5) 100%);
}

.vaso-contenido {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 278px;
  text-align: center;
  /* Halo suave: el texto se lee aunque la ola pase por detrás */
  text-shadow: 0 1px 10px color-mix(in srgb, var(--halo) 70%, transparent);
}
.vaso-titulo {
  font-size: 17px;
  font-weight: 560;
  font-stretch: 112%;
  letter-spacing: .005em;
}

/* La cifra: enorme, fina y ancha, con letras de cristal (de A) */
.cifra-caja {
  display: flex;
  justify-content: center;
  max-width: 100%;
  margin-top: 4px;
  font-size: clamp(66px, 23vw, 100px);
}
.cifra {
  --escala: 1;
  display: inline-flex;
  align-items: flex-start;
  font-size: calc(var(--escala) * 1em);
  font-weight: 180;
  font-stretch: 116%;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: .04em .06em .08em;
  background:
    linear-gradient(102deg, transparent 38%, rgb(255 255 255 / .95) 48%, transparent 58%) no-repeat,
    linear-gradient(180deg, var(--cifra-alto) 8%, color-mix(in srgb, var(--cifra-alto) 94%, var(--pie-cifra)) 46%, var(--pie-cifra) 100%);
  background-size: 260% 100%, 100% 100%;
  background-position: 130% 0, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none; /* con letras transparentes, la sombra se vería a través */
  filter: drop-shadow(0 0 28px var(--brillo-cifra)) drop-shadow(0 2px 1px rgb(0 0 0 / .2));
}
.cifra.destello { animation: destello 1300ms cubic-bezier(.4, 0, .2, 1) both; }
@keyframes destello {
  from { background-position: 130% 0, 0 0; }
  to   { background-position: -30% 0, 0 0; }
}
.cifra-signo { font-weight: 200; margin-right: .02em; }
/* Céntimos en alto, como en las etiquetas de precio: 923,⁶⁶ € */
.cifra-coma { font-variant-numeric: normal; letter-spacing: 0; margin: 0 -.07em 0 -.02em; }
.cifra-cent,
.cifra-euro { font-size: .4em; font-weight: 260; letter-spacing: -.01em; margin-top: .2em; }
.cifra-euro { margin-left: .16em; font-stretch: 100%; }
.vaso.negativo .cifra { --cifra-alto: var(--negativo); --pie-cifra: color-mix(in srgb, var(--negativo) 80%, var(--tinta-vaso)); }

/* La frase, debajo del vaso como un pie de foto; empieza por cómo vas, en el color del estado */
.vaso-frase {
  max-width: 32ch;
  margin: 14px auto 0;
  color: var(--texto-2);
  font-size: 15.5px;
  font-weight: 460;
  line-height: 1.38;
  text-align: center;
  text-shadow: 0 1px 12px var(--halo);
}
.frase-estado { color: var(--estado); font-weight: 640; }

.vaso-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
}
.chip-cifra {
  /* sin min-width: 0 a propósito: si una cifra no cabe, el chip baja a otra línea en vez de cortarse */
  flex: 1 1 140px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-bottom: 4px;
  padding: 8px 10px 8px 9px;
  border: 0;
  border-radius: 19px;
  color: var(--texto);
  text-align: left;
  text-shadow: none;
  background:
    radial-gradient(110px circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / calc(var(--luz) * .45)), transparent 64%),
    linear-gradient(180deg, rgb(255 255 255 / .12), rgb(255 255 255 / .03)),
    var(--chip-fondo);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .28),
    inset 0 0 0 1px rgb(255 255 255 / .1),
    0 4px 0 var(--gema-canto);
  transition: transform 460ms var(--muelle), box-shadow 460ms var(--muelle), --luz 700ms ease;
}
.chip-cifra:active,
.chip-cifra.pulsado {
  --luz: .6;
  transform: translateY(4px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), inset 0 0 0 1px rgb(255 255 255 / .22), 0 0 0 var(--gema-canto);
  transition-duration: 70ms;
}
/* Gema del signo: una bolita de color con brillo */
.chip-signo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  color: var(--sobre-vivo);
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--vivo) 40%, #fff) 0 12%, var(--vivo) 52%, color-mix(in oklab, var(--vivo) 72%, #000) 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 0 14px -2px color-mix(in srgb, var(--vivo) 70%, transparent);
}
.chip-signo .icono { width: 18px; height: 18px; stroke-width: 3; }
.chip-textos { display: grid; min-width: 0; line-height: 1.15; }
.chip-titulo { font-size: 13px; font-weight: 520; color: var(--texto-2); }
.chip-valor {
  font-size: clamp(15px, 4.35vw, 17px);
  font-weight: 620;
  font-stretch: 104%;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Te has pasado: el vaso se queda vacío y el canto se calienta */
.vaso.negativo { --vaso-canto: color-mix(in srgb, var(--negativo) 40%, transparent); }
.vaso.negativo .vaso-reflejo,
.vaso.negativo .vaso-reflejo-suave { opacity: .7; }
.vaso.sin-datos { --vaso-canto: var(--gema-canto); }

/* =============================================================
   Aviso de copia
   ============================================================= */
.plegable {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 420ms var(--suave), opacity 300ms ease;
}
.plegable-dentro { min-height: 0; overflow: hidden; }
.plegable.plegado { grid-template-rows: 0fr; opacity: 0; }

.aviso-copia-caja {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px 12px;
  margin-top: 22px;
  padding: 14px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--aviso) 10%, transparent), color-mix(in srgb, var(--aviso) 4%, transparent)),
    var(--cristal-tinte);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aviso) 34%, transparent), inset 0 1px 0 rgb(255 255 255 / .14);
}
.aviso-copia-icono {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--aviso);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--aviso) 30%, transparent), color-mix(in srgb, var(--aviso) 10%, transparent) 72%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), inset 0 0 0 1px color-mix(in srgb, var(--aviso) 34%, transparent);
}
.aviso-copia-texto { font-size: 15px; line-height: 1.38; color: var(--texto-2); }
.aviso-copia-texto strong { color: var(--texto); font-weight: 640; }
.aviso-copia-caja .gema { grid-column: 2; justify-self: start; }

/* =============================================================
   Grupos
   ============================================================= */
.grupo { margin-top: 34px; scroll-margin-top: calc(env(safe-area-inset-top) + 76px); }
.grupo-cabecera {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 0 4px 12px 6px;
  /* Halo suave: el texto se lee aunque pase por delante de la luz del cielo */
  text-shadow: 0 1px 14px var(--halo), 0 0 4px var(--halo);
}
.grupo-titulos { flex: 1; min-width: 0; }
.grupo-titulos h2 {
  font-size: 26px;
  font-weight: 600;
  font-stretch: 110%;
  letter-spacing: -.025em;
  line-height: 1.06;
}
.seccion-cabecera h2,
.copia h2 {
  font-size: 22px;
  font-weight: 600;
  font-stretch: 110%;
  letter-spacing: -.02em;
  line-height: 1.12;
}
.grupo-total {
  margin-top: 3px;
  color: var(--color);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.grupo-cabecera .redondo { text-shadow: none; }

.lista { padding: 6px; }
.fila {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 380ms var(--suave), opacity 260ms ease;
}
.fila-dentro { position: relative; min-height: 0; overflow: hidden; }
.fila.saliendo { grid-template-rows: 0fr; opacity: 0; }

/* Raya fina entre filas, que empieza donde empieza el texto (como en iOS) */
.fila + .fila .fila-dentro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 69px;
  right: 12px;
  height: 1px;
  background: var(--linea);
}
.fila-boton {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 10px 12px 10px 9px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--texto);
  text-align: left;
  transition: transform 420ms var(--muelle), background-color 220ms ease;
}
.fila-boton:focus-visible { outline-offset: -2px; }
.fila-boton:active {
  transform: scale(.975);
  background: rgb(255 255 255 / .07);
  transition-duration: 90ms;
}
@media (hover: hover) and (pointer: fine) {
  .fila-boton:hover { background: rgb(255 255 255 / .05); }
}
/* La fecha, en una cuenta de cristal del color del grupo */
.dia {
  display: grid;
  place-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  color: var(--color);
  text-align: center;
  line-height: 1;
  background: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--vivo) 34%, transparent), color-mix(in srgb, var(--vivo) 9%, transparent) 74%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .22),
    inset 0 0 0 1px color-mix(in srgb, var(--vivo) 30%, transparent);
}
.dia b { font-size: 18px; font-weight: 640; font-stretch: 108%; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dia small { margin-top: 2px; font-size: 12px; font-weight: 560; }
.nombre {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 17px;
  font-weight: 470;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.cantidad {
  font-size: 17px;
  font-weight: 560;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cantidad.positiva { color: var(--ingreso); }

/* Entrada de filas, escalonada */
.fila.entra .fila-dentro { animation: fila-entra 460ms var(--suave) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes fila-entra { from { opacity: 0; transform: translateY(10px); } }

/* Fila recién guardada: aparece abriendo hueco y con un destello de su color */
.fila.nueva { animation: abrir-hueco 460ms var(--suave) both; }
.fila.nueva .fila-boton { animation: destello-fila 1700ms ease-out 200ms both; }
@keyframes abrir-hueco { from { grid-template-rows: 0fr; opacity: 0; } }
@keyframes destello-fila {
  0%, 26% { background: color-mix(in srgb, var(--vivo) 26%, transparent); }
  100% { background: transparent; }
}

.vacio {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 22px 16px 20px;
  color: var(--texto-2);
  font-size: 15px;
  text-align: center;
}
.vacio strong { color: var(--texto); font-size: 16px; font-weight: 600; }

/* =============================================================
   Gráfico
   ============================================================= */
.grafico-seccion { margin-top: 40px; }
.seccion-cabecera {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  margin: 0 4px 12px 6px;
  text-shadow: 0 1px 14px var(--halo), 0 0 4px var(--halo);
}
.leyenda { display: flex; gap: 14px; color: var(--texto-2); font-size: 15px; font-weight: 500; }
.leyenda li { display: flex; align-items: center; gap: 7px; }
.leyenda-punto {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 14%, var(--vivo) 48%, color-mix(in oklab, var(--vivo) 60%, #000) 100%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--vivo) 70%, transparent);
}
.grafico-caja { padding: 14px 8px 12px; }
.grafico {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}
.barra-mes {
  display: grid;
  grid-template-rows: 150px auto;
  gap: 10px;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--texto);
  transition: background-color 250ms, transform 400ms var(--muelle);
}
.barra-mes:active { transform: scale(.95); transition-duration: 80ms; }
.barra-mes.actual {
  background: linear-gradient(180deg, rgb(255 255 255 / .02), rgb(255 255 255 / .08));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07);
}
.barras { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 150px; }
.barra {
  width: 13px;
  height: calc(var(--h, 0) * 100%);
  min-height: 6px;
  overflow: hidden;
  border-radius: 999px;
  transition: height 700ms var(--suave); /* al apuntar algo, la barra del mes se estira */
}
.barra-relleno {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--vivo) 72%, #fff), var(--vivo) 40%, color-mix(in oklab, var(--vivo) 72%, #000));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55);
  transform: translateY(101%);
  transition: transform 900ms var(--muelle-suave);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.grafico.visible .barra-relleno { transform: translateY(0); }
.barra-mes:not(.actual) .barra { opacity: .6; }
.barra-mes.actual .barra { box-shadow: 0 0 14px -2px color-mix(in srgb, var(--vivo) 70%, transparent); }
.barra-vacia .barra-relleno { background: var(--linea); box-shadow: none; }
.barra-etiqueta {
  justify-self: center;
  min-width: 40px;
  padding: 4px 6px;
  border-radius: 999px;
  color: var(--texto-2);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.1;
}
.barra-mes.actual .barra-etiqueta { background: var(--texto); color: var(--fondo); font-weight: 640; }
.grafico-frase {
  margin: 12px 8px 2px;
  color: var(--texto-2);
  font-size: 15px;
  line-height: 1.4;
}
.grafico-frase strong { color: var(--texto); font-weight: 620; font-variant-numeric: tabular-nums; }

/* =============================================================
   Copia de seguridad
   ============================================================= */
.copia { margin-top: 40px; padding: 18px 16px 16px; border-radius: 28px; }
.copia-cabecera { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.copia-icono {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  color: var(--texto-2);
  background: rgb(255 255 255 / .07);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), inset 0 0 0 1px rgb(255 255 255 / .09), inset 0 0 0 1px var(--cristal-borde);
}
.copia-ultima { margin-top: 3px; color: var(--texto-2); font-size: 15px; }
.copia-ultima.antigua { color: var(--aviso); font-weight: 560; }
.copia-botones { display: grid; gap: 8px; }
.ayuda { margin-top: 8px; color: var(--texto-2); font-size: 14px; line-height: 1.4; text-align: center; }

.pie { margin-top: 36px; color: var(--texto-3); font-size: 13px; text-align: center; text-shadow: 0 1px 10px var(--halo); }

/* =============================================================
   Botón Apuntar, velo de abajo y selector de colores
   ============================================================= */
.borde-inferior {
  position: fixed;
  inset: auto 0 0;
  height: calc(env(safe-area-inset-bottom) + 112px);
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(0deg, color-mix(in srgb, var(--fondo) 82%, transparent), color-mix(in srgb, var(--fondo) 42%, transparent) 55%, transparent);
  transition: opacity 300ms ease;
}
.zona-apuntar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 14px);
  pointer-events: none;
  transition: opacity 300ms ease, transform 420ms var(--curva-ios);
}
html.con-hoja .zona-apuntar { opacity: 0; transform: translateY(30px); pointer-events: none; }
html.con-hoja .borde-inferior { opacity: 0; }
.apuntar {
  pointer-events: auto;
  min-height: 60px;
  padding: 0 30px 0 24px;
  border-radius: 30px;
  font-size: 19px;
  font-weight: 650;
  --alto-canto: 6px;
}
.apuntar .icono { width: 24px; height: 24px; stroke-width: 2.6; }

/* =============================================================
   Tostada
   ============================================================= */
.tostada {
  position: fixed;
  inset: auto 0 calc(env(safe-area-inset-bottom) + 96px) 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}
.tostada-caja {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  max-width: 100%;
  padding: 6px 8px 6px 20px;
  overflow: hidden;
  border-radius: 22px;
  color: var(--tostada-texto);
  background: var(--tostada-fondo);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), inset 0 0 0 1px rgb(255 255 255 / .1), 0 18px 40px -12px rgb(0 0 0 / .55);
  opacity: 0;
  transform: translateY(24px) scale(.92);
  transition: opacity 220ms ease, transform 520ms var(--muelle);
}
.tostada.visible .tostada-caja { opacity: 1; transform: none; pointer-events: auto; }
.tostada-texto { font-size: 16px; font-weight: 520; }
.tostada-accion {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--tostada-accion);
  font-size: 16px;
  font-weight: 660;
  transition: transform 300ms var(--muelle), background-color 150ms;
}
.tostada-accion:active { transform: scale(.94); background: rgb(255 255 255 / .1); transition-duration: 60ms; }
.tostada-accion:focus-visible { outline-color: var(--tostada-accion); }
.tostada-cuenta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--tostada-accion), var(--apuntar-1));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* =============================================================
   Hoja de apuntar / editar
   ============================================================= */
.hoja {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: var(--texto);
}
.hoja::backdrop { background: transparent; }
.hoja-velo {
  position: absolute;
  inset: 0;
  background: var(--velo);
  opacity: 0;
  transition: opacity 420ms ease;
}
.hoja.abierta .hoja-velo { opacity: 1; }

.hoja-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--teclado);
  display: flex;
  flex-direction: column;
  max-width: 520px;
  /* --alto-visible = lo que se ve de verdad (lo pone app.js): encoge con el teclado */
  max-height: calc(var(--alto-visible, 100%) - env(safe-area-inset-top) - 18px);
  margin: 0 auto;
  border-radius: 34px 34px 0 0;
  background:
    radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--vivo) 14%, transparent), transparent 70%),
    linear-gradient(180deg, rgb(255 255 255 / .1), rgb(255 255 255 / .03) 30%),
    var(--hoja-fondo);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  backdrop-filter: blur(34px) saturate(170%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 0 0 1px rgb(255 255 255 / .08), 0 -20px 60px -20px rgb(0 0 0 / .6);
  transform: translateY(105%);
  transition: transform 540ms var(--curva-ios), background 400ms ease;
}
.hoja.abierta .hoja-panel { transform: translateY(0); }
.hoja-panel.arrastrando { transition: none; }

.hoja-arriba {
  flex: none;
  padding: 8px 16px 8px;
  touch-action: none;
  cursor: grab;
}
.hoja-asa {
  display: block;
  width: 40px;
  height: 5px;
  margin: 0 auto 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--texto) 30%, transparent);
}
.hoja-barra {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.hoja-barra .boton-texto { justify-self: start; }
.hoja-barra .guardar { justify-self: end; margin-bottom: 4px; }
.hoja-titulo {
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 620;
  font-stretch: 108%;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guardar { min-width: 104px; overflow: hidden; }
.guardar-check {
  position: absolute;
  inset: 0;
  margin: auto;
  stroke-width: 3.2;
  opacity: 0;
  transform: scale(.3) rotate(-20deg);
  transition: transform 420ms var(--muelle), opacity 160ms;
}
.guardar-texto { transition: transform 300ms var(--suave), opacity 160ms; }
.guardar.hecho .guardar-texto { opacity: 0; transform: translateY(-14px); }
.guardar.hecho .guardar-check { opacity: 1; transform: none; }

.hoja-cuerpo {
  display: grid;
  gap: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 24px);
}

/* Segmentado: la píldora es una gema del color del tipo */
.segmentado {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  margin: 0;
  padding: 5px 5px 8px;
  border: 0;
  border-radius: 20px;
  background: var(--campo-fondo);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / .25), inset 0 0 0 1px var(--campo-borde);
}
.seg-pildora {
  position: absolute;
  top: 5px;
  left: 5px;
  bottom: 9px;
  width: calc((100% - 10px) / 3);
  border-radius: 15px;
  background:
    radial-gradient(120% 140% at 14% -34%, rgb(255 255 255 / .4), transparent 52%),
    linear-gradient(180deg, color-mix(in srgb, var(--vivo) 72%, #fff), var(--vivo));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .6),
    0 4px 0 color-mix(in srgb, var(--vivo) 62%, #000),
    0 8px 20px -8px color-mix(in srgb, var(--vivo) 70%, transparent);
  will-change: transform;
}
.seg-opcion {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 15px;
  color: var(--texto-2);
  font-size: 16px;
  font-weight: 560;
  font-stretch: 104%;
  cursor: pointer;
  transition: color 250ms ease, transform 300ms var(--muelle);
}
.seg-opcion:active,
.seg-opcion.pulsado { transform: scale(.95); transition-duration: 70ms; }
.seg-opcion input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg-opcion:has(input:checked) { color: var(--sobre-vivo); font-weight: 660; }
.seg-opcion:has(input:focus-visible) { outline: 2.5px solid var(--foco); outline-offset: 2px; }

/* Campos */
.campo { display: grid; gap: 8px; }
.campo-etiqueta { color: var(--texto-2); font-size: 15px; font-weight: 540; padding-left: 4px; }
.campo-cantidad { justify-items: center; text-align: center; gap: 2px; }
.campo-cantidad .campo-etiqueta { padding-left: 0; }
/* Cantidad enorme, con la misma letra fina de la cifra de «Te queda» */
.cantidad-grande {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-width: 100%;
  padding: 0 8px 6px;
  color: var(--color);
}
.cantidad-grande input {
  width: 4.4ch;
  min-width: 2ch;
  max-width: 9.5ch;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-size: 60px;
  font-weight: 220;
  font-stretch: 114%;
  letter-spacing: -.035em;
  line-height: 1.1;
  text-align: right;
  font-variant-numeric: tabular-nums;
  caret-color: var(--vivo);
}
.cantidad-grande.larga input { font-size: 44px; }
.cantidad-grande input::placeholder { color: var(--color); opacity: .45; }
.cantidad-grande input:focus { outline: none; }
/* Foco como el de los otros campos: aro de luz del color del tipo (el aro crema se veía al tocar) */
.cantidad-grande:has(input:focus-visible) {
  border-radius: 18px;
  box-shadow: inset 0 0 0 1.5px var(--vivo), 0 0 0 4px color-mix(in srgb, var(--vivo) 24%, transparent);
}
/* Raya de luz bajo la cantidad mientras se escribe (de A) */
.cantidad-grande::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 150px;
  height: 2px;
  margin-left: -75px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, var(--vivo), transparent);
  opacity: 0;
  transform: scaleX(.3);
  transition: opacity 300ms ease, transform 500ms var(--curva-ios);
}
.cantidad-grande:focus-within::after { opacity: 1; transform: none; }
.cantidad-euro { margin: 12px 0 0 6px; font-size: 28px; font-weight: 300; opacity: .75; }

.entrada {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 17px;
  background: var(--campo-fondo);
  color: var(--texto);
  font-size: 17px;
  font-weight: 460;
  box-shadow: inset 0 0 0 1px var(--campo-borde);
  transition: box-shadow 200ms ease, background-color 200ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.entrada::placeholder { color: var(--texto-2); opacity: .85; }
.entrada:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--vivo), 0 0 0 4px color-mix(in srgb, var(--vivo) 24%, transparent); }
.entrada-fecha { display: flex; align-items: center; text-align: left; font-variant-numeric: tabular-nums; }
.entrada-fecha::-webkit-date-and-time-value { text-align: left; }
.entrada-fecha::-webkit-calendar-picker-indicator { opacity: .7; cursor: pointer; }
.campo.con-error .entrada { box-shadow: inset 0 0 0 1.5px var(--gasto); }
.error { color: var(--gasto); font-size: 15px; font-weight: 560; padding-left: 4px; }

/* Sugerencias de nombre: gemitas del color del tipo */
.sugerencias {
  display: flex;
  gap: 8px;
  margin: 2px -16px 0;
  padding: 2px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sugerencias::-webkit-scrollbar { display: none; }
.sugerencias:empty { display: none; }
.sugerencia {
  flex: none;
  max-width: 220px;
  min-height: 44px;
  margin-bottom: 3px;
  padding: 0 16px;
  overflow: hidden;
  border: 0;
  border-radius: 15px;
  color: var(--color);
  font-size: 15px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
  background:
    radial-gradient(100px circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / calc(var(--luz) * .5)), transparent 64%),
    linear-gradient(180deg, color-mix(in srgb, var(--vivo) 20%, transparent), color-mix(in srgb, var(--vivo) 9%, transparent)),
    var(--campo-fondo);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), inset 0 0 0 1px color-mix(in srgb, var(--vivo) 32%, transparent), 0 3px 0 color-mix(in srgb, var(--vivo) 42%, transparent);
  transition: transform 420ms var(--muelle), box-shadow 420ms var(--muelle), --luz 700ms ease;
}
.sugerencia:active,
.sugerencia.pulsado {
  --luz: .6;
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 0 0 1px color-mix(in srgb, var(--vivo) 60%, transparent), 0 0 0 transparent;
  transition-duration: 70ms;
}

/* =============================================================
   Chispas al guardar (celebración)
   ============================================================= */
.chispas { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.chispa {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.chispa.rombo { border-radius: 2px; transform: rotate(45deg); }
.anillo {
  position: absolute;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 18px;
  border: 2px solid currentColor;
  box-shadow: 0 0 14px currentColor, inset 0 0 10px currentColor;
}

/* =============================================================
   PC: centrado y digno
   ============================================================= */
@media (min-width: 700px) {
  .columna { padding-top: 40px; }
  .orbe-1 { left: calc(50% - 640px); }
  .orbe-2 { right: calc(50% - 700px); }
  .orbe-3 { left: calc(50% - 620px); }
}
@media (max-width: 380px) {
  .fila-boton { gap: 11px; grid-template-columns: 44px minmax(0, 1fr) auto; }
  .dia { width: 44px; height: 44px; }
  .fila + .fila .fila-dentro::before { left: 64px; }
  .grupo-titulos h2 { font-size: 24px; }
}

/* =============================================================
   Muestras de las paletas (Ajustes → Apariencia): cada una es un cielo
   en miniatura con una gota de su líquido
   ============================================================= */
.muestra-bola {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 24% 26%, var(--m-a) 0, transparent 62%),
    radial-gradient(circle at 82% 30%, var(--m-b) 0, transparent 60%),
    radial-gradient(circle at 50% 110%, var(--m-c) 0, transparent 70%),
    var(--m-fondo);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), inset 0 0 0 1px rgb(255 255 255 / .16), 0 4px 10px -4px rgb(0 0 0 / .5);
}
.muestra-bola::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--m-luz) 0 20%, var(--m-liquido) 70%);
  box-shadow: 0 0 0 1.5px rgb(255 255 255 / .7), 0 0 8px var(--m-luz);
}

/* =============================================================
   Arranque: mientras <html> lleva «arrancando», no se pinta nada.
   app.js pone antes la paleta elegida (sin fundidos) y quita la clase.
   Si el programa no llegara a arrancar, a los 2,5 s se enseña igualmente.
   ============================================================= */
html.arrancando,
html.arrancando body { transition: none !important; }
html.arrancando body {
  visibility: hidden;
  animation: mostrar-igualmente 0s linear 2.5s forwards;
}
@keyframes mostrar-igualmente { to { visibility: visible; } }
@keyframes ocultar-ya { to { visibility: hidden; } }

/* Si a los 2,5 s no ha arrancado, NO se enseña la página sin datos («0,00 €», «Aún nada
   este mes»: parecería que se ha borrado todo): solo el cielo y un aviso. Primero
   «Cargando…» y, si a los 6 s sigue sin arrancar, que no se ha podido abrir.
   html.sin-arrancar lo pone app.js si falla a mitad de arranque: el aviso sale ya. */
.arranque { display: none; }
html.arrancando body > :not(.cielo, .franja-estado, .arranque),
html.sin-arrancar body > :not(.cielo, .franja-estado, .arranque) { visibility: hidden !important; }
html.arrancando .arranque,
html.sin-arrancar .arranque {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 16px) max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 16px) max(16px, env(safe-area-inset-left));
}
.arranque-caja {
  display: grid;
  max-width: 360px;
  padding: 18px 20px;
  border-radius: 24px;
  color: var(--texto-2);
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
}
.arranque-caja strong { display: block; margin-bottom: 4px; color: var(--texto); font-weight: 640; }
.arranque-cargando,
.arranque-fallo { grid-area: 1 / 1; }
.arranque-sin-js { display: block; margin-top: 10px; color: var(--texto); }
html.arrancando .arranque-cargando { animation: ocultar-ya 0s linear 6s forwards; }
html.arrancando .arranque-fallo { visibility: hidden; animation: mostrar-igualmente 0s linear 6s forwards; }
html.sin-arrancar .arranque-cargando { visibility: hidden; }
html.sin-arrancar .arranque-fallo { visibility: visible; animation: none; }

/* =============================================================
   Franja detrás de la hora del iPhone (paletas claras)
   La barra de arriba va siempre en black-translucent (letras blancas): el iPhone no
   relee ese ajuste con la app abierta. Sobre el cielo casi blanco de Perla y Mediterráneo
   no se leerían, así que detrás de la hora se oscurece una franja que se funde con el cielo.
   Solo ocupa la zona segura de arriba: en Safari o en el PC (zona 0) no se ve.
   ============================================================= */
.franja-estado { display: none; }
[data-paleta="perla"] .franja-estado,
[data-paleta="mediterraneo"] .franja-estado,
[data-paleta="perla"] .hoja::before,
[data-paleta="mediterraneo"] .hoja::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: block;
  height: calc(env(safe-area-inset-top, 0px) * 1.2);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--texto) 66%, transparent) 0%,
    color-mix(in srgb, var(--texto) 50%, transparent) 55%,
    transparent 100%);
  pointer-events: none;
}
/* Dentro de una hoja abierta (que va por encima de todo) hace falta otra igual */
[data-paleta="perla"] .hoja::before,
[data-paleta="mediterraneo"] .hoja::before { position: absolute; }

.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* =============================================================
   Botón de Ajustes (en la cabecera, junto al año)
   ============================================================= */
/* Ajustes: una gema redonda como las flechas, algo más pequeña; la zona táctil sigue siendo de 46 px */
.redondo-ajustes {
  grid-area: ajustes;
  align-self: center;
  justify-self: end;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  --alto-canto: 3px;
  text-shadow: none;
}
.redondo-ajustes::after { content: ""; position: absolute; inset: -3px -3px -6px; }
.redondo-ajustes .icono { width: 22px; height: 22px; stroke-width: 1.9; }

/* =============================================================
   Avisos importantes (instalar, no se ha podido guardar, datos dañados)
   ============================================================= */
.avisos { display: grid; gap: 12px; }
.avisos > :last-child:not([hidden]) { margin-bottom: 16px; }
.aviso {
  --tono: var(--aviso);
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 22px;
  color: var(--texto-2);
  font-size: 15px;
  line-height: 1.4;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tono) 12%, transparent), color-mix(in srgb, var(--tono) 5%, transparent)),
    var(--cristal-tinte);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tono) 38%, transparent), inset 0 1px 0 rgb(255 255 255 / .14);
}
.aviso strong { color: var(--texto); font-weight: 640; }
.aviso-error { --tono: var(--negativo); }
.aviso-pie { display: grid; gap: 10px; }
.aviso .gema { justify-self: start; }
noscript .aviso { margin-bottom: 16px; }

/* =============================================================
   Tu dinero (encima del vaso): grande, pero el vaso sigue siendo el momento
   ============================================================= */
.dinero { margin-bottom: 14px; }
.dinero-caja {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-height: 68px;
  padding: 12px 18px 12px 12px;
  border-radius: 24px;
}
.dinero-icono {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  color: var(--liquido-luz);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--liquido-luz) 30%, transparent), color-mix(in srgb, var(--liquido-luz) 8%, transparent) 72%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), inset 0 0 0 1px color-mix(in srgb, var(--liquido-luz) 34%, transparent);
}
[data-paleta="perla"] .dinero-icono,
[data-paleta="mediterraneo"] .dinero-icono { color: var(--suscripcion); }
.dinero-icono .icono { width: 22px; height: 22px; stroke-width: 2; }
.dinero-textos { display: grid; flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.dinero-nombre { font-size: 16px; font-weight: 600; font-stretch: 108%; letter-spacing: -.005em; }
.dinero-cuando { margin-top: 2px; color: var(--texto-2); font-size: 13.5px; font-weight: 480; }
.dinero-cifra {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--texto);
  font-size: clamp(26px, 7.8vw, 31px);
  font-weight: 300;
  font-stretch: 112%;
  letter-spacing: -.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 0 22px var(--brillo-cifra);
}
.dinero-cent { font-size: .6em; font-weight: 360; letter-spacing: -.01em; margin-left: .04em; }
.dinero-caja.negativo .dinero-cifra { color: var(--negativo); }
.dinero-aviso {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  padding: 14px 16px 14px 12px;
  border-radius: 24px;
}
.dinero-aviso-texto { min-width: 0; color: var(--texto-2); font-size: 15px; line-height: 1.38; }
.dinero-aviso-texto strong { color: var(--texto); font-weight: 640; }
.dinero-aviso .gema { grid-column: 2; justify-self: start; }
/* Al aparecer (o al guardar el dinero de partida) la caja sube un poco */
.dinero > :not([hidden]) { animation: dinero-entra 520ms var(--suave) both; }
@keyframes dinero-entra { from { opacity: 0; transform: translateY(8px); } }

/* =============================================================
   Copia: «¿Se ha guardado?», mensajes y datos apartados
   ============================================================= */
.copia-confirmar { margin: 2px 0 4px; }
.botones-pareja { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.botones-pareja .gema { width: 100%; }
.mensaje-copia { margin-top: 12px; color: var(--texto-2); font-size: 15px; line-height: 1.4; }
.mensaje-copia.es-error { color: var(--negativo); font-weight: 560; }
.apartados { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--linea); }
.apartados-titulo { font-size: 17px; font-weight: 620; font-stretch: 106%; }
.apartados-ayuda { margin-top: 2px; color: var(--texto-2); font-size: 14px; line-height: 1.4; }
.apartado { padding: 12px 0; border-bottom: 1px solid var(--linea); }
.apartado:last-child { border-bottom: 0; padding-bottom: 0; }
.apartado-titulo { font-weight: 600; }
.apartado-detalle { margin: 2px 0 10px; color: var(--texto-2); font-size: 14px; }
.apartado-botones { display: flex; flex-wrap: wrap; gap: 8px; }

/* =============================================================
   Hoja de Ajustes (mismo cristal que la de apuntar)
   ============================================================= */
.hoja-ajustes { --vivo: var(--liquido-luz); --color: var(--texto); }
.hoja-barra .boton-listo { justify-self: end; color: var(--texto); font-weight: 640; }
.hoja-barra > span[aria-hidden="true"] { min-width: 44px; }
.ajustes-cuerpo { gap: 30px; }
.ajustes-seccion { display: grid; gap: 12px; min-width: 0; }
.ajustes-titulo { font-size: 21px; font-weight: 600; font-stretch: 110%; letter-spacing: -.02em; line-height: 1.12; padding-left: 4px; }
.ajustes-ayuda { margin-top: -6px; color: var(--texto-2); font-size: 15px; line-height: 1.4; padding-left: 4px; }
.ajustes-pie { color: var(--texto-3); font-size: 13px; text-align: center; }

.paletas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.paleta {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  min-width: 0;
  min-height: 112px;
  margin-bottom: 3px;
  padding: 12px 4px 10px;
  border: 0;
  border-radius: 20px;
  color: var(--texto);
  background:
    radial-gradient(100px circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / calc(var(--luz) * .45)), transparent 64%),
    var(--campo-fondo);
  box-shadow: inset 0 0 0 1px var(--campo-borde), inset 0 1px 0 rgb(255 255 255 / .12), 0 3px 0 var(--gema-canto);
  transition: transform 420ms var(--muelle), box-shadow 300ms ease, --luz 700ms ease;
}
.paleta:active,
.paleta.pulsado {
  --luz: .55;
  transform: translateY(3px);
  box-shadow: inset 0 0 0 1px var(--campo-borde), inset 0 1px 0 rgb(255 255 255 / .2), 0 0 0 var(--gema-canto);
  transition-duration: 70ms;
}
.paleta[aria-pressed="true"] {
  background:
    radial-gradient(100px circle at var(--x, 50%) var(--y, 50%), rgb(255 255 255 / calc(var(--luz) * .45)), transparent 64%),
    color-mix(in srgb, var(--texto) 10%, var(--campo-fondo));
  box-shadow: inset 0 0 0 2px var(--texto), inset 0 1px 0 rgb(255 255 255 / .2), 0 3px 0 var(--gema-canto);
}
.paleta-nombre {
  max-width: 100%;
  overflow: hidden;
  font-size: 15px;
  font-weight: 560;
  font-stretch: 104%;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paleta-clara {
  margin-top: -3px;
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--texto-2);
  font-size: 12px;
  font-weight: 560;
  line-height: 1.4;
  box-shadow: inset 0 0 0 1px var(--campo-borde);
}
.paleta-marca {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--fondo);
  background: var(--texto);
  opacity: 0;
  transform: scale(.4);
  transition: opacity 160ms ease, transform 420ms var(--muelle);
}
.paleta-marca .icono { width: 14px; height: 14px; stroke-width: 3.4; }
.paleta[aria-pressed="true"] .paleta-marca { opacity: 1; transform: none; }

.saldo-actual { color: var(--texto-2); font-size: 15px; padding-left: 4px; }
.saldo-actual b { color: var(--texto); font-weight: 620; font-variant-numeric: tabular-nums; }
.saldo-fila { display: flex; align-items: flex-start; gap: 10px; }
.saldo-signo {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 17px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}
.saldo-signo[aria-pressed="true"] { color: var(--negativo); box-shadow: inset 0 1px 0 rgb(255 255 255 / .32), inset 0 0 0 1.5px var(--negativo), 0 var(--alto-canto) 0 var(--r-canto), 0 8px 18px -10px var(--sombra); }
.con-euro { position: relative; flex: 1 1 auto; min-width: 0; }
.con-euro .entrada { padding-right: 40px; font-variant-numeric: tabular-nums; }
.euro {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texto-2);
  pointer-events: none;
}
.saldo-botones { display: grid; gap: 8px; margin-top: 4px; }

/* Lo ya apuntado desde la fecha del saldo que se le sumará (lo pinta app.js) */
.saldo-calculo {
  margin-top: -6px;
  padding: 10px 14px;
  border-radius: 16px;
  color: var(--texto-2);
  font-size: 15px;
  line-height: 1.4;
  background: color-mix(in srgb, var(--aviso) 9%, var(--campo-fondo));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aviso) 30%, transparent);
}
.saldo-calculo b { color: var(--texto); font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Con el teclado abierto, la zona segura de abajo queda debajo del teclado: no se suma */
.teclado-abierto .hoja-cuerpo { padding-bottom: 20px; }

/* =============================================================
   Ordenador (y tableta): la misma app, aprovechando el ancho.
   Regla de oro: en el iPhone (menos de 600 px) NADA de esto cambia cómo se ve.
   - Las dos cajas de columnas (.panel-izq, .panel-der) no generan caja en el iPhone
     (display: contents): sus hijos se colocan como siempre.
   - Lo de pantalla ancha va en @media (min-width: 600px / 1024px). Lo de tableta (600–1023 px)
     pide además 500 px de alto, para que el iPhone tumbado no lo active.
   - Los estados al pasar el ratón van en @media (hover: hover) and (pointer: fine): el iPhone no los tiene.
   - «Ver copia» y su aviso solo salen fuera del iPhone (app.js: entorno.js dice que no es iOS).
   ============================================================= */
.panel-izq,
.panel-der { display: contents; }
.cabecera .apuntar-pc { display: none; }
.pie-atajos { display: none; }

/* ---------- Fuera del iPhone, sin nada apuntado: «Abre tu copia del iPhone» ---------- */
.ver-copia {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px 18px 18px 16px;
  border-radius: 28px;
  animation: dinero-entra 520ms var(--suave) both;
}
.ver-copia.vidrio {
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--liquido-luz) 16%, transparent), transparent 62%),
    linear-gradient(180deg, rgb(255 255 255 / .09), rgb(255 255 255 / .035) 40%, rgb(255 255 255 / .03)),
    var(--cristal-tinte);
}
.ver-copia-icono {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: var(--liquido-luz);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--liquido-luz) 32%, transparent), color-mix(in srgb, var(--liquido-luz) 8%, transparent) 72%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 0 0 1px color-mix(in srgb, var(--liquido-luz) 36%, transparent), 0 0 26px -6px color-mix(in srgb, var(--liquido-luz) 60%, transparent);
}
[data-paleta="perla"] .ver-copia-icono,
[data-paleta="mediterraneo"] .ver-copia-icono,
[data-paleta="perla"] .copia-abierta-icono,
[data-paleta="mediterraneo"] .copia-abierta-icono { color: var(--suscripcion); }
.ver-copia-icono .icono { width: 26px; height: 26px; stroke-width: 1.9; }
.ver-copia-textos { display: grid; gap: 6px; min-width: 0; }
.ver-copia-titulo { font-size: 22px; font-weight: 620; font-stretch: 110%; letter-spacing: -.02em; line-height: 1.12; }
.ver-copia-texto,
.ver-copia-donde { color: var(--texto-2); font-size: 15px; line-height: 1.42; }
.ver-copia-texto b { color: var(--texto); font-weight: 600; overflow-wrap: anywhere; }
.ver-copia-accion { grid-column: 1 / -1; display: grid; gap: 10px; }
.ver-copia-boton { width: 100%; }
.ver-copia-boton .icono { width: 22px; height: 22px; stroke-width: 2.1; }
.ver-copia-nota { color: var(--texto-2); font-size: 13.5px; line-height: 1.4; text-align: center; }

/* ---------- Fuera del iPhone, tras abrir una copia: aviso fijo en la cabecera ---------- */
.cabecera.con-copia-abierta {
  grid-template-areas:
    "anio ajustes"
    "mes  flechas"
    "abierta abierta";
}
.copia-abierta {
  grid-area: abierta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
  padding: 8px 8px 8px 10px;
  border-radius: 20px;
  color: var(--texto-2);
  font-size: 14px;
  line-height: 1.38;
  text-shadow: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--aviso) 10%, transparent), color-mix(in srgb, var(--aviso) 4%, transparent)),
    var(--cristal-tinte);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aviso) 30%, transparent), inset 0 1px 0 rgb(255 255 255 / .12);
  animation: dinero-entra 520ms var(--suave) both;
}
.copia-abierta-icono {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  color: var(--aviso);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--aviso) 30%, transparent), color-mix(in srgb, var(--aviso) 8%, transparent) 72%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aviso) 32%, transparent);
}
.copia-abierta-icono .icono { width: 19px; height: 19px; stroke-width: 2; }
.copia-abierta-texto { flex: 1 1 200px; min-width: 0; }
.copia-abierta-texto strong { color: var(--texto); font-weight: 620; }
.copia-abierta .gema { flex: none; margin-left: auto; }

/* Teclas de los atajos (solo se ven en pantalla ancha) */
.pie-atajos kbd {
  display: inline-block;
  min-width: 22px;
  margin: 0 1px;
  padding: 1px 6px;
  border-radius: 7px;
  color: var(--texto-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  background: var(--campo-fondo);
  box-shadow: inset 0 0 0 1px var(--campo-borde), 0 2px 0 var(--gema-canto);
}

/* ---------- Ratón: luz al pasar por encima (la misma luz que al pulsar, más suave).
   :where() deja estas reglas por debajo de las de pulsar (que siguen ganando). ---------- */
@media (hover: hover) and (pointer: fine) {
  :where(.gema, .redondo, .chip-cifra, .sugerencia, .paleta):hover { --luz: .2; }
  .chip-hoy:hover { filter: brightness(1.06) saturate(1.05); }
  .boton-texto:hover { color: var(--texto); }
  .titulo-mes:hover { color: color-mix(in srgb, var(--texto) 86%, var(--liquido-luz)); }
  .tostada-accion:hover { background: rgb(255 255 255 / .08); }
  .seg-opcion:hover { color: var(--texto); }
  .barra-mes:hover { background-color: rgb(255 255 255 / .05); }
  .barra-mes:not(.actual):hover .barra { opacity: .85; }
  .barra-mes:hover .barra-etiqueta { color: var(--texto); }
  .barra-mes.actual:hover .barra-etiqueta { color: var(--fondo); }
  .entrada:hover:not(:focus) { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--texto) 28%, transparent); }
  .fila-boton:hover .dia { box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 0 0 1px color-mix(in srgb, var(--vivo) 55%, transparent), 0 0 16px -6px color-mix(in srgb, var(--vivo) 70%, transparent); }
  .vaso { cursor: pointer; }
}

/* ---------- Tableta y ventanas medianas (600–1023 px): una columna más ancha ----------
   Con 500 px de alto como mínimo: el iPhone tumbado (874–956 px de ancho, 440 de alto como mucho)
   se sigue viendo como siempre, en una columna. El ordenador (1024 px o más) lo usa siempre. */
@media (min-width: 600px) and (min-height: 500px), (min-width: 1024px) {
  .columna {
    max-width: 760px;
    padding-left: max(28px, env(safe-area-inset-left));
    padding-right: max(28px, env(safe-area-inset-right));
  }
  .barra-fija-dentro { max-width: 760px; }
  /* El vaso sigue siendo un vaso (no una pecera): su ancho de siempre, centrado */
  .dinero,
  .vaso,
  .ver-copia { max-width: 560px; margin-left: auto; margin-right: auto; }
  .copia-botones { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
  .copia-confirmar { grid-column: 1 / -1; }
}

/* Listas en dos columnas: Ingresos y Suscripciones a la izquierda, Gastos (la más larga) a la derecha */
@media (min-width: 760px) and (max-width: 1023.98px) and (min-height: 500px), (min-width: 1200px) and (max-width: 1599.98px) {
  .mes-cuerpo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    column-gap: 20px;
  }
  #grupo-ingreso { grid-column: 1; grid-row: 1; }
  #grupo-suscripcion { grid-column: 1; grid-row: 2; align-self: start; }
  #grupo-gasto { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- Ordenador (1024 px o más): cabecera a lo ancho y dos columnas ---------- */
@media (min-width: 1024px) {
  :root {
    --pc-margen: clamp(24px, 2.8vw, 48px);
    --pc-izq: clamp(360px, 30vw, 440px);
    --pc-hueco: clamp(24px, 2.4vw, 40px);
  }
  .columna {
    max-width: 1680px;
    padding: 0 var(--pc-margen) 40px;
  }

  /* Cabecera: mes y año a la izquierda; flechas, Apuntar y Ajustes a la derecha. Se queda arriba. */
  .cabecera {
    position: sticky;
    top: 0;
    z-index: 25;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "mes anio . flechas apuntar ajustes";
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 8px;
    padding: 22px 0 18px;
  }
  .cabecera.con-copia-abierta {
    grid-template-areas:
      "mes anio . flechas apuntar ajustes"
      "abierta abierta abierta abierta abierta abierta";
  }
  /* Cristal detrás de la cabecera, de lado a lado; aparece al bajar (html.bajada, lo pone app.js) */
  .cabecera::before {
    content: "";
    position: absolute;
    inset: 0 calc(50% - 50vw) -24px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--cielo-alto) 84%, transparent), color-mix(in srgb, var(--cielo-alto) 58%, transparent) 72%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent);
    mask-image: linear-gradient(180deg, #000 68%, transparent);
    opacity: 0;
    transition: opacity 300ms ease;
  }
  html.bajada .cabecera::before { opacity: 1; }
  .titulo-mes { font-size: clamp(32px, 2.7vw, 42px); }
  .cabecera-anio {
    align-self: center;
    gap: 14px;
    min-height: 0;
    padding-top: 2px;
    color: var(--texto-3);
    font-size: clamp(32px, 2.7vw, 42px);
    font-weight: 260;
    letter-spacing: -.03em;
    line-height: 1;
  }
  .cabecera-flechas { padding-bottom: 0; }
  .redondo-ajustes { width: 46px; height: 46px; border-radius: 16px; --alto-canto: 4px; }
  .redondo-ajustes .icono { width: 23px; height: 23px; }
  .cabecera .apuntar-pc {
    display: inline-flex;
    grid-area: apuntar;
    min-height: 46px;
    padding: 0 20px 0 15px;
    border-radius: 16px;
    font-size: 16.5px;
  }
  .apuntar-pc .icono { width: 21px; height: 21px; stroke-width: 2.6; }
  .copia-abierta { margin-top: 2px; padding: 6px 6px 6px 8px; }

  /* Dos columnas: el resumen a la izquierda (se queda a la vista) y las listas a la derecha */
  #contenido {
    display: grid;
    grid-template-columns: var(--pc-izq) minmax(0, 1fr);
    grid-template-areas:
      "avisos avisos"
      "vercopia vercopia"
      "izq der"
      ". pie"
      ". atajos";
    column-gap: var(--pc-hueco);
    align-items: start;
  }
  .avisos { grid-area: avisos; }
  .ver-copia { grid-area: vercopia; }
  .panel-izq { grid-area: izq; display: block; min-width: 0; }
  .panel-der { grid-area: der; display: block; min-width: 0; }
  .pie { grid-area: pie; }
  .pie-atajos { grid-area: atajos; display: block; margin-top: 8px; color: var(--texto-3); font-size: 13px; text-align: center; }

  /* La columna del resumen acompaña al bajar. Si es más alta que la pantalla, baja con la página
     hasta que se ve su final y ahí se queda (--alto-cabecera y --alto-izq los mide app.js). */
  .panel-izq {
    position: sticky;
    top: min(calc(var(--alto-cabecera, 96px) + 6px), calc(100vh - var(--alto-izq, 0px) - 20px));
  }
  .vaso-frase { max-width: 46ch; }
  .panel-izq .grafico-seccion { margin-top: 28px; }
  .barra-mes { grid-template-rows: 128px auto; }
  .barras { height: 128px; }

  /* La derecha: aviso de copia, listas y copia de seguridad */
  .aviso-copia-caja { margin: 0 0 24px; }
  .panel-der .mes-cuerpo { display: grid; row-gap: 26px; }
  .panel-der .grupo { margin-top: 0; }
  .grupo { scroll-margin-top: calc(var(--alto-cabecera, 96px) + 12px); }
  .panel-der .copia { margin-top: 30px; padding: 20px 20px 18px; }

  /* «Abre tu copia del iPhone» a lo ancho, con el botón a la derecha */
  .ver-copia {
    grid-template-columns: auto minmax(0, 1fr) minmax(260px, 340px);
    align-items: center;
    gap: 22px;
    max-width: none;
    margin: 6px 0 28px;
    padding: 24px 28px 24px 24px;
  }
  .ver-copia-icono { width: 64px; height: 64px; }
  .ver-copia-icono .icono { width: 30px; height: 30px; }
  .ver-copia-titulo { font-size: 26px; }
  .ver-copia-textos { max-width: 68ch; }
  .ver-copia-accion { grid-column: auto; }

  /* Lo que en el iPhone flota abajo: aquí «Apuntar» está en la cabecera y la barra pequeña sobra */
  .zona-apuntar,
  .borde-inferior,
  .barra-fija { display: none; }
  .tostada { bottom: 32px; }

  /* La luz del cielo, detrás del vaso (columna izquierda) y sin apagarse al bajar: el vaso sigue a la vista */
  .orbe-luz {
    top: 150px;
    left: calc(max(0px, (100vw - 1680px) / 2) + var(--pc-margen) + var(--pc-izq) / 2);
    opacity: .62;
  }

  /* Hojas: paneles centrados de ancho razonable que aparecen con un pequeño impulso */
  html.con-hoja .escena,
  html.con-hoja .cielo { transform: scale(.965); }
  .hoja[open] { display: grid; place-items: center; padding: 32px 24px; }
  .hoja-panel {
    position: relative;
    inset: auto;
    width: min(540px, 100%);
    max-width: none;
    max-height: min(860px, calc(100vh - 64px));
    margin: 0;
    border-radius: 32px;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 0 0 1px rgb(255 255 255 / .1), 0 40px 90px -30px rgb(0 0 0 / .7);
    opacity: 0;
    transform: translateY(26px) scale(.965);
    transition: transform 520ms var(--curva-ios), opacity 280ms ease, background 400ms ease;
  }
  .hoja.abierta .hoja-panel { opacity: 1; transform: none; }
  .hoja-asa { display: none; }
  .hoja-arriba { padding: 16px 18px 10px; cursor: default; touch-action: auto; }
  .hoja-cuerpo { padding: 8px 24px 26px; }
  .hoja-ajustes .hoja-panel { width: min(940px, 100%); }
  .ajustes-cuerpo { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; column-gap: 36px; }
  .ajustes-pie { grid-column: 1 / -1; }
}

/* Pantallas muy anchas: las tres listas una al lado de otra */
@media (min-width: 1600px) {
  .mes-cuerpo {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 20px;
    align-items: start;
  }
}

/* =============================================================
   Ahorro de batería: lo que no se ve no se mueve
   Con una hoja abierta (la página queda detrás, encogida y velada) se paran el cielo y el
   líquido; con el vaso fuera de la vista (al bajar a las listas), sus olas y burbujas.
   Así el cristal desenfocado (backdrop-filter) no se recalcula en cada fotograma para nada.
   ============================================================= */
html.con-hoja .orbe,
html.con-hoja .ola,
html.con-hoja .carril,
html.con-hoja .burbuja,
html.vaso-fuera .ola,
html.vaso-fuera .carril,
html.vaso-fuera .burbuja { animation-play-state: paused; }

/* =============================================================
   Menos movimiento (la app de verdad lo respeta siempre)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  body *,
  body *::before,
  body *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  /* Solo se apagan los movimientos; los cambios de color siguen fundiendo (no mueven nada) */
  .gema,
  .redondo,
  .chip-cifra,
  .sugerencia,
  .chip-hoy,
  .seg-opcion,
  .paleta,
  .paleta-marca,
  .fila,
  .fila-boton,
  .plegable,
  .escena,
  .cielo,
  .barra-fija,
  .zona-apuntar,
  .barra,
  .barra-relleno,
  .tostada-caja,
  .hoja-panel,
  .guardar-check,
  .guardar-texto { transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .vaso { transition-duration: 1ms, 600ms, 1ms; }
  .ola,
  .orbe { animation: none !important; }
  .burbujas { display: none; }
  /* Con «html.» delante pesan igual que las de base (html.con-hoja .escena…) y ganan por ir después */
  html.con-hoja .escena,
  html.con-hoja .cielo { transform: none; border-radius: 0; }
  html.recortada .escena { clip-path: none; }
  /* El aviso de arranque tiene sus propios tiempos (no es movimiento): ver «Arranque» */
  html.arrancando .arranque-cargando,
  html.arrancando .arranque-fallo { animation-duration: 0s !important; animation-delay: 6s !important; }
}
