/* =====================================================================
   SpendCount · Aspecto de la app (copiado de docs/prototipo, ver docs/DISENO.md)
   NINGÚN color va escrito a mano en los componentes: todos salen de las
   variables (tokens) de abajo. El tema que elige el usuario las cambia
   todas a la vez desde app.js (función aplicarTema).
   ===================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/PlusJakartaSans.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Valores del tema por defecto («Blanco y azul»). app.js los recalcula. */
  --bg: #FFFFFF;
  --text: #0A3A8C;
  --accent: #0A3A8C;
  --on-accent: #FFFFFF;
  --nav: #F5F7FA;
  --surface: #F0F3F8;
  --surface-2: #E2E9F2;
  --surface-3: #DDE4EF;
  --chip: #E7ECF4;
  --chip-hover: #DAE2EE;
  --sheet: #FFFFFF;
  --muted: #4F71AC;
  --muted-2: #4669A6;
  --soft: #6F8BBB;
  --nav-text: #2A5199;
  --accent-2: #85A0C6;
  --border: #CED8E8;
  --good: #0B7A55;
  --bad: #B42318;
  --bad-bar: #F07A7F;

  /* Transparencias que salen del color de las letras */
  --track: color-mix(in srgb, var(--text) 16%, transparent);
  --future: color-mix(in srgb, var(--text) 16%, transparent);
  --zero: color-mix(in srgb, var(--text) 35%, transparent);
  --key: color-mix(in srgb, var(--text) 9%, transparent);
  --key-hover: color-mix(in srgb, var(--text) 15%, transparent);
  --key-press: color-mix(in srgb, var(--text) 28%, transparent);
  --hairline: color-mix(in srgb, var(--text) 8%, transparent);
  --divider: color-mix(in srgb, var(--text) 10%, transparent);
  --overlay: rgba(4, 22, 64, 0.72);
  --scrim: rgba(4, 22, 64, 0.6);

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }

/* ---------- Botones ---------- */
.btn {
  min-height: 54px; padding: 0 22px; border: none; border-radius: 16px;
  background: var(--accent); color: var(--on-accent);
  font-size: 16px; font-weight: 800; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.off { opacity: .45; }
.btn-big { min-height: 58px; border-radius: 18px; }
.btn-home { min-height: 56px; border-radius: 18px; font-size: 15px; font-weight: 700; }
.btn-2 { background: transparent; color: var(--text); border: 2px solid var(--accent); font-weight: 700; }
.btn-danger { min-height: 48px; background: transparent; color: var(--bad); border: 2px solid var(--bad-bar); border-radius: 18px; font-size: 15px; font-weight: 700; }
.btn-new {
  background: transparent; color: var(--text); border: 2px dashed var(--accent-2);
  border-radius: 18px; font-size: 15px; font-weight: 700;
}
.link {
  border: none; background: transparent; color: var(--muted); padding: 4px 0; min-height: 44px;
  font-size: 13px; font-weight: 600; text-decoration: underline;
}
.round {
  width: 44px; height: 44px; flex-shrink: 0; border: none; border-radius: 999px;
  background: var(--chip); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.round:hover { background: var(--chip-hover); }
.round.sm { width: 40px; height: 40px; }
.round[disabled] { opacity: .35; cursor: default; }
.pill {
  position: relative; flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: none;
  background: var(--chip); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: background .15s ease;
}
.pill::after { content: ''; position: absolute; inset: -4px 0; } /* zona pulsable de 44px */
.pill:hover { background: var(--chip-hover); }
.pill.on { background: var(--accent); color: var(--on-accent); }
.pill.static::after { display: none; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 13px; font-weight: 700; }
.lbl-soft { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-head { display: flex; justify-content: space-between; align-items: center; }
.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px; font-weight: 500;
}
.input.sm { height: 48px; }
.input::placeholder { color: var(--soft); }
.input:focus { outline: none; border-color: var(--text); }
.input.bad { border-color: var(--bad); }
input[type="date"].input { min-width: 0; }
.err { font-size: 12px; font-weight: 600; color: var(--bad); }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 56px; }
.pass-eye {
  position: absolute; right: 4px; top: 3px; width: 44px; height: 44px; border: none; border-radius: 10px;
  background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center;
}
.meter { display: flex; gap: 4px; }
.meter span { flex: 1; height: 5px; border-radius: 999px; background: var(--track); transition: background .2s; }
.hint { font-size: 12px; color: var(--muted); }
.banner-test {
  font-size: 12px; font-weight: 600; color: #0A1A33; background: #FFD66B;
  border-radius: 12px; padding: 8px 12px; line-height: 1.4;
}

/* ---------- Login (Login.dc.html) ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-wrap: wrap; align-items: stretch; }
.login-side {
  flex: 1 1 420px; min-width: 0; padding: 32px clamp(20px, 4vw, 56px); background: var(--nav);
  display: flex; flex-direction: column; gap: 28px;
}
.login-side .pitch { margin: auto 0; max-width: 460px; display: flex; flex-direction: column; gap: 18px; }
.login-side h1 { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.login-side .lead { font-size: 16px; color: var(--muted); line-height: 1.5; }
.login-side .perks { display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-weight: 600; }
.login-side .privacy { font-size: 12px; color: var(--soft); }
.login-main { flex: 1 1 420px; min-width: 0; padding: 40px clamp(20px, 4vw, 56px); display: flex; flex-direction: column; gap: 20px; }
.login-form { width: 100%; max-width: 420px; margin: auto; display: flex; flex-direction: column; gap: 18px; }
.login-form h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.login-form .sub { margin-top: 6px; font-size: 14px; color: var(--muted); }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); }
.tabs2 button { height: 42px; border: none; border-radius: 11px; background: transparent; color: var(--nav-text); font-size: 14px; font-weight: 700; }
.tabs2 button.on { background: var(--accent); color: var(--on-accent); }
.or { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.g-badge { width: 22px; height: 22px; border-radius: 999px; background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; }
.btn-google { min-height: 52px; border: 2px solid var(--border); background: transparent; color: var(--text); font-size: 15px; font-weight: 700; }
.fine { font-size: 12px; color: var(--soft); line-height: 1.5; }
.notice { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0; }
.notice .big { font-size: 54px; line-height: 1; }
.notice h2 { font-size: 26px; font-weight: 800; }
.notice p { font-size: 15px; color: var(--muted); line-height: 1.5; }
.brand.login-brand-mobile { display: none; }
@media (max-width: 899px) {
  .login-side { display: none; }
  .login-main { flex-basis: 100%; padding: calc(12px + var(--safe-top)) 20px 32px; }
  .brand.login-brand-mobile { display: flex; height: 44px; }
}

/* ---------- Marca (logo + nombre) ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 9px; display: block; flex-shrink: 0; }
.brand b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.brand small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted-2); font-weight: 500; }

/* ---------- Marco de la app ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.topbar, .bottomnav { display: none; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 230px;
  padding: 28px 18px; background: var(--nav);
  display: flex; flex-direction: column; gap: 22px; overflow-y: auto;
}
.sidebar .brand { padding: 0 6px; }
.sidenav { display: flex; flex-direction: column; gap: 4px; }
.sidenav a {
  display: flex; align-items: center; height: 46px; padding: 0 14px; border-radius: 14px;
  color: var(--nav-text); font-size: 15px; font-weight: 600; text-decoration: none; transition: background .15s ease;
}
.sidenav a:hover { background: var(--hairline); }
.sidenav a.on { background: var(--accent); color: var(--on-accent); }
.sidebar .who { margin-top: auto; padding: 16px; border-radius: 18px; background: var(--surface); font-size: 12px; }
.sidebar .who b { display: block; font-size: 15px; }
.sidebar .who span { color: var(--muted); overflow-wrap: anywhere; }
.main {
  margin-left: 230px; padding: 28px clamp(16px, 3vw, 40px) 48px; max-width: 1280px;
  display: flex; flex-direction: column; gap: 18px;
}
@media (max-width: 899px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 5;
    height: calc(56px + var(--safe-top)); padding: var(--safe-top) 16px 0 20px;
    align-items: center; justify-content: space-between; background: var(--bg);
  }
  .topbar .brand img { width: 30px; height: 30px; border-radius: 8px; }
  .topbar .brand b { font-size: 19px; }
  .topbar .round.on { background: var(--accent); color: var(--on-accent); }
  .main { margin-left: 0; padding: 8px 20px calc(96px + var(--safe-bottom)); gap: 18px; }
  .main.no-nav { padding-bottom: calc(24px + var(--safe-bottom)); }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    height: calc(72px + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
    background: var(--nav); border-top: 1px solid var(--hairline);
  }
  .bottomnav a {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 10px 0 12px; color: var(--soft); font-size: 11px; font-weight: 600; text-decoration: none;
  }
  .bottomnav a.on { color: var(--text); }
  .bottomnav a svg { transition: transform .2s ease; }
  .bottomnav a.on svg { transform: translateY(-2px); }
}

/* ---------- Cabeceras de pantalla ---------- */
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.h1 { margin-top: 2px; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; }
.head-sub { margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.back-head { display: flex; align-items: center; gap: 12px; }
.back-head h1 { font-size: 20px; font-weight: 800; }
@media (max-width: 899px) {
  .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  .h1 { font-size: 24px; }
}

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.card-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.card-h h2 { font-size: 16px; font-weight: 700; }
.card-h .note { font-size: 12px; color: var(--muted); }
.box2 { background: var(--surface-2); border-radius: 16px; padding: 12px; }
.box2 .k { font-size: 12px; color: var(--muted); }
.box2 .v { margin-top: 2px; font-size: 18px; font-weight: 700; }
.kpi { background: var(--surface); border-radius: 20px; padding: 16px 18px; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .v { margin-top: 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.kpi .s { margin-top: 4px; font-size: 12px; color: var(--muted); }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.big-num { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.progress { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--text); transition: width .5s ease; }
.progress.thin { height: 8px; }
.progress.thin > div { background: var(--accent-2); }
.progress > div.over { background: var(--bad-bar); }
.link-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  border: none; border-radius: 24px; padding: 18px 20px; text-align: left; text-decoration: none;
}
.link-card.inv { background: var(--surface-3); color: var(--text); }
.link-card.stats { background: var(--accent); color: var(--on-accent); }
.link-card .t1 { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.link-card .t2 { display: block; margin-top: 2px; font-size: 24px; font-weight: 800; }
.link-card.stats .t2 { font-size: 16px; margin-top: 0; }
.link-card.stats .t1 { margin-top: 2px; color: inherit; opacity: .8; }
.link-card .go { font-size: 14px; font-weight: 700; white-space: nowrap; }

/* Filas de lista (últimos gastos, ingresos) */
.list { display: flex; flex-direction: column; gap: 4px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 7px 8px; margin: 0 -8px;
  width: calc(100% + 16px); border: none; border-radius: 16px; background: transparent; color: var(--text); text-align: left;
}
.item:hover { background: var(--hairline); }
.item .bub { width: 42px; height: 42px; flex-shrink: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--surface-3); }
.item .txt { flex-grow: 1; min-width: 0; }
.item .t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .st { margin-top: 2px; font-size: 12px; color: var(--muted); }
.item .amt { font-size: 15px; font-weight: 700; white-space: nowrap; }
.day-h { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.day-h:first-child { margin-top: 0; }
.cat-line { display: flex; flex-direction: column; gap: 6px; }
.cat-line .r { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.cat-line .r b { font-weight: 700; }
.cat-line .r span:first-child { font-weight: 600; }
.empty { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Selector de mes ‹ › */
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-nav b { min-width: 0; flex: 1; text-align: center; font-size: 16px; font-weight: 800; }

/* Próximamente */
.soon { gap: 12px; align-items: flex-start; }
.soon .big { font-size: 44px; line-height: 1; animation: tfloat 2.6s ease-in-out infinite; }
.soon ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }

/* Ajustes */
.rows { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--divider); font-size: 15px; }
.row:last-child { border-bottom: none; }
.row .k { color: var(--muted); }
.row .k small { display: block; font-size: 12px; }
.row .v { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.switch {
  position: relative; width: 52px; height: 30px; flex-shrink: 0; padding: 3px; border: none; border-radius: 999px;
  background: var(--border); display: flex; justify-content: flex-start; align-items: center; transition: background .2s ease;
}
.switch::after { content: ''; position: absolute; inset: -7px -2px; }
.switch span { width: 24px; height: 24px; border-radius: 999px; background: var(--bg); transition: transform .2s ease; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] span { background: var(--on-accent); transform: translateX(22px); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: none; background: transparent; color: var(--text); font-size: 12px; font-weight: 700; }
.theme-sw { width: 100%; height: 64px; border-radius: 16px; border: 3px solid transparent; padding: 8px; display: flex; flex-direction: column; justify-content: space-between; }
.theme-opt.on .theme-sw { border-color: var(--accent); }
.theme-sw i { display: block; height: 12px; border-radius: 6px; }
.theme-sw em { display: block; width: 50%; height: 12px; border-radius: 6px; }

/* ---------- Cajitas de categoría ---------- */
.cajitas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cajitas.big { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
.cajita {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 86px; padding: 6px 4px; border-radius: 18px; border: 2px solid transparent;
  background: var(--chip); color: var(--text); font-size: 12px; font-weight: 700;
  transition: transform .15s ease, background .15s ease;
}
.cajitas.big .cajita { height: 100px; }
.cajita:hover { transform: translateY(-2px); background: var(--chip-hover); }
.cajita:active { transform: scale(.93); }
.cajita .bubble { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cajita .emo { display: inline-block; font-size: 24px; line-height: 1; }
.cajita .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cajita .tg { font-size: 10px; color: var(--muted); font-weight: 600; }
.cajita.sel { border-color: var(--text); background: var(--surface-3); }
.cajita.new { background: transparent; border: 2px dashed var(--accent-2); }
.cajita.new .plus { font-size: 24px; line-height: 1; font-weight: 500; }
.cajita.play { animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
.cajita.play.a-pop .emo { animation: cat-pop .7s ease both; }
.cajita.play.a-jump .emo { animation: cat-jump .7s ease both; }
.cajita.play.a-wiggle .emo { animation: cat-wiggle .7s ease both; }
.cajita.play.a-spin .emo { animation: cat-spin .7s ease both; }
.cajita.play.a-beat .emo { animation: cat-beat .7s ease both; }
.cajita.play.a-shake .emo { animation: cat-shake .7s ease both; }
.loop-pop { animation: cat-pop 1s ease infinite; }
.loop-jump { animation: cat-jump 1s ease infinite; }
.loop-wiggle { animation: cat-wiggle .9s ease infinite; }
.loop-spin { animation: cat-spin 1.2s ease infinite; }
.loop-beat { animation: cat-beat 1s ease infinite; }
.loop-shake { animation: cat-shake .9s ease infinite; }

/* ---------- Añadir gasto (Main.dc.html) ---------- */
.add { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 16px; }
.amount-box { text-align: center; padding: 4px 0; }
.amount-box p { font-size: 14px; color: var(--muted); font-weight: 600; }
.amount-box .amount { margin-top: 6px; font-size: 46px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: var(--text); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.key {
  height: 54px; border-radius: 16px; border: none; background: var(--key); color: var(--text);
  font-size: 22px; font-weight: 600; transition: transform .1s ease, background .1s ease;
}
.key:hover { background: var(--key-hover); }
.key:active, .key.pressed { background: var(--key-press); transform: scale(.94); }
.extra-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }

/* ---------- Packs ---------- */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pack {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border-radius: 16px;
  border: 2px solid transparent; background: var(--chip); color: var(--text); text-align: left;
}
.pack.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pack .n { font-size: 14px; font-weight: 700; }
.pack .p { font-size: 16px; letter-spacing: 2px; }
.pack .c { font-size: 12px; opacity: .8; }
.welcome { min-height: 100vh; min-height: 100dvh; padding: calc(16px + var(--safe-top)) 20px 32px; display: flex; flex-direction: column; gap: 20px; }
.welcome-in { width: 100%; max-width: 640px; margin: auto; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Hoja inferior / ventana ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 20; background: var(--scrim);
  display: flex; flex-direction: column; justify-content: flex-end; animation: fadeIn .25s ease;
}
.sheet {
  max-height: 92%; overflow-y: auto; background: var(--sheet); color: var(--text);
  border-radius: 28px 28px 0 0; padding: 12px 20px calc(24px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 16px; animation: sheetUp .35s cubic-bezier(.2,.9,.3,1);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 999px; background: var(--border); align-self: center; flex-shrink: 0; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-h h2 { font-size: 20px; font-weight: 800; }
.sheet p.txt { color: var(--muted); font-size: 15px; line-height: 1.5; }
.sheet .actions .btn { flex: 1; }
@media (min-width: 900px) {
  .scrim { justify-content: center; align-items: center; padding: 24px; }
  .sheet { width: 100%; max-width: 480px; max-height: 90vh; border-radius: 28px; padding: 12px 24px 24px; }
}
.preview-box { display: flex; justify-content: center; }
.preview-box > div {
  width: 110px; height: 110px; border-radius: 28px; border: 2px solid var(--text); background: var(--chip);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.preview-box .bubble { width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.preview-box .emo { display: inline-block; font-size: 34px; line-height: 1; }
.preview-box .nm { font-size: 14px; font-weight: 700; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emojis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.emo-btn { width: 100%; height: 46px; border-radius: 14px; border: 2px solid transparent; background: var(--chip); font-size: 22px; line-height: 1; padding: 0; }
.emo-btn.on { border-color: var(--text); background: var(--surface-3); }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; padding: 0; box-shadow: 0 0 0 2px var(--border); }
.swatch::after { content: ''; position: absolute; inset: -6px; }
.swatch.on { border-color: var(--sheet); box-shadow: 0 0 0 3px var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 420px) { .emojis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Animación de registrar (Main.dc.html) ---------- */
.ov {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; background: var(--overlay);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; animation: fade 1.65s ease forwards;
}
.bill {
  position: absolute; left: calc(50% - 36px); top: 47%; width: 72px; height: 38px; border-radius: 6px;
  background: #E6F0FF; border: 2px solid #8FB8FF; color: #0A3A8C; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center; opacity: 0; box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.b1 { animation: f1 1.15s ease-in .05s forwards; }
.b2 { animation: f2 1.15s ease-in .12s forwards; }
.b3 { animation: f3 1.15s ease-in .2s forwards; }
.b4 { animation: f4 1.15s ease-in .28s forwards; }
.b5 { animation: f5 1.15s ease-in .34s forwards; }
.b6 { animation: f6 1.15s ease-in .42s forwards; }
.minus { font-size: 46px; font-weight: 800; color: #FFA3A3; animation: drop 1.3s ease forwards; }
.ov .tag { font-size: 15px; font-weight: 600; color: #E6F0FF; animation: grow 1.3s ease .15s both; }

/* ---------- Aviso flotante ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 899px) { #toast { bottom: calc(88px + var(--safe-bottom)); } }

/* ---------- Animaciones (copiadas de docs/DISENO.md) ---------- */
.bar { transform-origin: bottom; animation: barIn .6s cubic-bezier(.2,.9,.3,1) both; }
@keyframes barIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes fade { 0% { opacity: 0; } 10% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes f1 { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(-220px,-460px) rotate(-60deg); } }
@keyframes f2 { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(190px,-480px) rotate(55deg); } }
@keyframes f3 { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(-70px,-540px) rotate(-25deg); } }
@keyframes f4 { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(250px,-360px) rotate(85deg); } }
@keyframes f5 { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(-260px,-300px) rotate(-95deg); } }
@keyframes f6 { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(60px,-560px) rotate(30deg); } }
@keyframes drop { 0% { transform: scale(.4); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 40% { transform: scale(1); } 100% { transform: translateY(36px); opacity: .85; } }
@keyframes grow { 0% { transform: scale(.3) translateY(30px); opacity: 0; } 40% { transform: scale(1.15); opacity: 1; } 60% { transform: scale(1); } 100% { transform: scale(1); } }
@keyframes cat-pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 70% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes cat-spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
@keyframes cat-beat { 0% { transform: scale(1); } 15% { transform: scale(1.28); } 30% { transform: scale(1); } 45% { transform: scale(1.2); } 60% { transform: scale(1); } }
@keyframes cat-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes cat-jump { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-20px); } 60% { transform: translateY(0); } 78% { transform: translateY(-7px); } }
@keyframes cat-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-18deg); } 50% { transform: rotate(14deg); } 75% { transform: rotate(-7deg); } }
@keyframes tin { 0% { opacity: 0; transform: translateY(18px) scale(.9); } 60% { opacity: 1; transform: translateY(-4px) scale(1.04); } 100% { opacity: 1; transform: none; } }
@keyframes tfade { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: none; } }
@keyframes tfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.enter { animation: tfade .3s ease both; }

/* Animaciones apagadas (Ajustes) o «reducir movimiento» del móvil */
.sin-anim *, .sin-anim *::before, .sin-anim *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Categorías: lista + editor (Categorias.dc.html) ---------- */
.cat-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cat-col-lista { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cat-editor { flex: 1 1 420px; min-width: 0; padding: 20px; gap: 18px; }
.ed-h { display: flex; align-items: center; gap: 12px; }
.ed-h h2 { font-size: 18px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-h .hint { margin-top: 2px; }
.only-movil { display: none !important; }
@media (max-width: 899px) { .only-movil { display: inline-flex !important; } }
.ed-preview { background: var(--surface-2); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ed-tile {
  width: 116px; height: 116px; border-radius: 24px; background: var(--accent); color: var(--on-accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.ed-tile .bubble { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.ed-tile .emo { display: inline-block; font-size: 32px; line-height: 1; }
.ed-tile .nm { font-size: 14px; font-weight: 800; max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-out {
  position: relative; height: 40px; padding: 0 16px; border: 2px solid var(--text); border-radius: 999px;
  background: transparent; color: var(--text); font-size: 13px; font-weight: 700;
}
.pill-out::after { content: ''; position: absolute; inset: -4px 0; }
.cat-editor .ed-in { background: var(--surface-2); }
.ed-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.ed-emoji { height: 44px; border-radius: 12px; border: 2px solid transparent; background: var(--chip); font-size: 22px; padding: 0; }
.ed-emoji.on { background: var(--accent); border-color: var(--accent); }
.ed-colores { display: flex; flex-wrap: wrap; gap: 10px; }
.ed-color { width: 44px; height: 44px; border-radius: 999px; border: 3px solid transparent; padding: 0; }
.ed-color.on { border-color: var(--text); box-shadow: inset 0 0 0 3px var(--surface); }
.ed-anims { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ed-anim { height: 44px; border-radius: 12px; border: 2px solid transparent; background: var(--chip); color: var(--text); font-size: 13px; font-weight: 700; }
.ed-anim.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ed-tipo { background: var(--surface-2); }
.ed-tipo button { font-size: 13px; }
.ed-borrar { padding-top: 14px; border-top: 1px solid var(--divider); display: flex; flex-direction: column; }
.btn-danger-fill { min-height: 44px; padding: 0 16px; border: none; border-radius: 14px; background: var(--bad-bar); color: #5A0A0A; font-size: 14px; font-weight: 800; }
.cajita .tg.bad { color: var(--bad); }
.cat-line .lim { font-size: 12px; color: var(--muted); }
.cat-line .lim.bad { color: var(--bad); font-weight: 700; }
.anim-pop { animation: cat-pop .7s ease both; }
.anim-jump { animation: cat-jump .7s ease both; }
.anim-wiggle { animation: cat-wiggle .7s ease both; }
.anim-spin { animation: cat-spin .7s ease both; }
.anim-beat { animation: cat-beat .7s ease both; }
.anim-shake { animation: cat-shake .7s ease both; }

/* =====================================================================
   Estadísticas y ahorros (fase 4) · docs/prototipo/Estadisticas.dc.html
   ===================================================================== */
.h2s { font-size: 20px; font-weight: 800; margin-top: 6px; }
.tabs-scroll {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface);
  overflow-x: auto; max-width: 100%; align-self: flex-start; scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll a {
  flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 600; color: var(--nav-text); text-decoration: none; white-space: nowrap;
}
.tabs-scroll a:hover { background: var(--chip); }
.tabs-scroll a.on { background: var(--accent); color: var(--on-accent); }
.period-nav { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; }
.period-nav .t { flex: 1; min-width: 0; text-align: center; }
.period-nav .t b { display: block; font-size: 18px; font-weight: 800; }
.period-nav .t span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* Gráfico de barras (sin ejes ni cuadrícula) */
.chart { display: flex; align-items: stretch; gap: 6px; height: 220px; }
.chart.dense { gap: 3px; }
.chart.week { height: 160px; gap: 8px; }
.chart .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.chart .val { font-size: 10px; font-weight: 700; white-space: nowrap; }
.chart .b { width: 100%; max-width: 44px; border-radius: 6px 6px 2px 2px; background: var(--text); }
.chart.week .b { max-width: 40px; }
.chart .b.dim { background: var(--accent-2); }
.chart .b.fut { height: 8px; background: var(--future); }
.chart .b.zero { height: 3px; background: var(--zero); }
.chart .lab { height: 14px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart.week .lab { font-size: 12px; font-weight: 600; }
@media (max-width: 899px) { .chart { gap: 2px; } .chart.dense { gap: 1px; } }

/* Ahorro: barras hacia arriba (ahorras) y hacia abajo (tiras de ahorros) */
.sav { display: flex; gap: 6px; }
.sav .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.sav .up { height: 120px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.sav .dn { height: 56px; width: 100%; display: flex; align-items: flex-start; justify-content: center; }
.sav .axis { height: 2px; width: 100%; background: var(--zero); }
.sav .p { width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px; background: var(--text); }
.sav .p.dim { background: var(--accent-2); }
.sav .p.none { background: var(--future); }
.sav .n { width: 100%; max-width: 40px; border-radius: 2px 2px 6px 6px; background: var(--bad-bar); transform-origin: top; animation: barIn .6s cubic-bezier(.2,.9,.3,1) both; }
.sav .lab { font-size: 10px; color: var(--muted); white-space: nowrap; }
.sav .val { font-size: 10px; font-weight: 700; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Calendario de calor */
.heat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.heat .h { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.heat .c { height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.heat .c.fut { border: 1px dashed var(--border); color: var(--muted); }

/* Fijos vs variables */
.split { height: 14px; border-radius: 999px; overflow: hidden; display: flex; background: var(--track); }
.split .f { background: var(--text); }
.split .v { background: var(--accent-2); }

/* Por categoría: cambio frente al periodo anterior */
.cat-line .r .nw { white-space: nowrap; }
.cat-line .r .chg { font-size: 12px; font-weight: 700; }

/* Récords */
.recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.rec { background: var(--surface-3); border-radius: 20px; padding: 16px 18px; }
.rec .e { font-size: 22px; line-height: 1; }
.rec .k { margin-top: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.rec .v { margin-top: 4px; font-size: 20px; font-weight: 800; }
.rec .s { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* Tapar los importes (botón del ojo, como en las apps del banco) */
.top-acts { display: flex; align-items: center; gap: 8px; }
.side-eye {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border: none; border-radius: 14px;
  background: transparent; color: var(--nav-text); font-size: 15px; font-weight: 600; text-align: left; transition: background .15s ease;
}
.side-eye:hover { background: var(--hairline); }
.side-eye[aria-pressed="true"] { background: var(--chip); color: var(--text); }

/* Botón de la cuenta de demostración (solo en modo de prueba) */
.btn-demo { min-height: 50px; background: var(--chip); color: var(--text); }
.btn-demo:hover { background: var(--chip-hover); }

/* =====================================================================
   Inversiones (fase 5) · docs/prototipo/Inversiones.dc.html
   ===================================================================== */
.btn-head { min-height: 46px; padding: 0 20px; font-size: 15px; font-weight: 700; }
.btn.sm { min-height: 44px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-3 .box2 .v { font-size: 15px; font-weight: 800; }

.inv-hero { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 18px 32px; padding: 22px; }
.inv-hero-main { flex: 1 1 240px; min-width: 0; }
.inv-hero-main .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.inv-hero-main .big-num { margin-top: 6px; }
.inv-hero-main .gain { margin-top: 8px; font-size: 15px; font-weight: 700; }
.inv-hero-kpis { flex: 2 1 320px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.inv-hero-kpis .box2 .v { font-size: 18px; font-weight: 800; }
.box2 .s { margin-top: 2px; font-size: 11px; color: var(--muted); }

/* Selector pequeño (6 meses / 1 año / Todo, Aportar / Retirar) */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.seg button { min-height: 36px; padding: 0 14px; border: none; border-radius: 999px; background: transparent; color: var(--nav-text); font-size: 13px; font-weight: 700; }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.seg.wide { background: var(--surface); }
.seg.wide button { flex: 1; min-height: 44px; font-size: 15px; }

/* Línea de evolución */
.line-chart { position: relative; }
.line-chart svg { display: block; width: 100%; height: 220px; }
.line-chart .y { position: absolute; left: 0; font-size: 11px; color: var(--muted); }
.line-chart .y.hi { top: 0; }
.line-chart .y.lo { bottom: 0; }
.x-labs { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.legend i.ln { width: 14px; height: 3px; border-radius: 2px; background: var(--text); vertical-align: middle; }
.legend i.ln.dash { height: 0; border-radius: 0; background: none; border-top: 3px dashed var(--accent-2); }

/* Reparto */
.reparto { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.donut { width: 150px; height: 150px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.donut > div { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut span { font-size: 11px; color: var(--muted); }
.donut b { font-size: 15px; font-weight: 800; }
.leg { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.leg-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.leg-row .dot { width: 12px; height: 12px; flex-shrink: 0; border-radius: 4px; }
.leg-row .n { flex: 1 1 auto; min-width: 0; font-weight: 600; }

/* Tarjetas de producto */
.prods { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.prod-card { gap: 10px; padding: 18px; }
.prod-h { display: flex; align-items: center; gap: 10px; }
.pbub { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.prod-h .pt { flex: 1 1 auto; min-width: 0; }
.prod-h .n { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-h .s { margin-top: 2px; font-size: 12px; color: var(--muted); }
.prod-v { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.prod-v .big { font-size: 24px; font-weight: 800; }
.prod-v .r { font-size: 15px; font-weight: 800; }
.prod-v .s { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.prod-v .s.good { color: var(--good); }
.prod-v .s.bad { color: var(--bad); }
.spark { display: block; width: 100%; height: 40px; }
.add-prod {
  min-height: 120px; border: 2px dashed var(--accent-2); background: transparent; color: var(--text);
  align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
}
.add-prod .plus { font-size: 28px; line-height: 1; font-weight: 500; }

/* Elegir producto al aportar */
.pboxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .pboxes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pbox {
  display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 8px 12px; border-radius: 18px;
  border: 2px solid transparent; background: var(--chip); color: var(--text); text-align: left; transition: transform .15s ease, background .15s ease;
}
.pbox:hover { background: var(--chip-hover); }
.pbox:active { transform: scale(.95); }
.pbox.sel { border-color: var(--text); }
.pbox.play { animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
.pbox.play .emo { display: inline-block; animation: cat-wiggle .55s ease; }
.pbox .pbub { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
.pbox .pt { min-width: 0; display: flex; flex-direction: column; }
.pbox .n { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbox .s { font-size: 12px; color: var(--muted); }
.pbox.new { border: 2px dashed var(--accent-2); background: transparent; }
.pbox.new .plus { width: 40px; text-align: center; font-size: 24px; }

/* Simulador */
.sim { background: var(--surface-3); gap: 16px; }
.sim-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.sim-in input[type=range] { width: 100%; height: 30px; accent-color: var(--text); }
.sim-out { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; }

/* Animación de registrar una inversión: monedas que suben */
.coin {
  position: absolute; bottom: -60px; width: 46px; height: 46px; border-radius: 50%;
  background: #FFD66B; border: 3px solid #F2B636; color: #7A4E00; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.c1 { left: 9%; animation: rise 1.3s ease-out 0s forwards; }
.c2 { left: 27%; animation: rise 1.3s ease-out .12s forwards; }
.c3 { left: 44%; animation: rise 1.3s ease-out .05s forwards; }
.c4 { left: 62%; animation: rise 1.3s ease-out .18s forwards; }
.c5 { left: 79%; animation: rise 1.3s ease-out .08s forwards; }
.c6 { left: 36%; animation: rise 1.3s ease-out .26s forwards; }
.plus-ov { font-size: 46px; font-weight: 800; color: #7CF0D2; animation: grow 1.3s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-110vh) scale(1.1); opacity: 0; } }

/* Aportación automática cada mes */
.auto-box { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.auto-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auto-h b { display: block; font-size: 14px; font-weight: 700; }
.auto-h small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
select.input { appearance: auto; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.auto-tag {
  align-self: flex-start; min-height: 36px; padding: 0 12px; border: none; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 700; text-align: left;
}
.auto-tag.off { background: transparent; border: 1px dashed var(--accent-2); color: var(--muted); }

/* ---------- Bloque 1: automáticos, habituales y buscador ---------- */
#toast.con-btn { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; }
.toast-btn {
  min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--on-accent); color: var(--accent); font: inherit; font-weight: 800; white-space: nowrap;
}
.item.static { cursor: default; }
.item.static:hover { background: transparent; }
.item.paused { opacity: .55; }
.row.total { border-top: 2px solid var(--divider); }
.row.total .k { color: var(--text); }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; min-height: 68px; min-width: 0;
  padding: 12px 14px; border: 0; border-radius: 16px; background: var(--surface-2); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: transform .12s ease, background .15s ease;
}
.quick-btn:hover { background: var(--hairline); }
.quick-btn:active { transform: scale(.96); }
.quick-btn .q-t { display: flex; align-items: flex-start; gap: 6px; width: 100%; min-width: 0; font-size: 14px; font-weight: 700; }
.quick-btn .q-t .emo { display: inline-block; flex-shrink: 0; font-size: 16px; line-height: 1; }
.quick-btn .q-n { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; overflow-wrap: anywhere; }
.quick-btn .q-v { font-size: 17px; font-weight: 800; white-space: nowrap; }

.search { position: relative; display: flex; align-items: center; }
.search .lupa { position: absolute; left: 16px; font-size: 16px; pointer-events: none; }
.search .input { padding-left: 46px; padding-right: 50px; }
.search .input::-webkit-search-cancel-button { display: none; }
.search .x { position: absolute; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ---------- Bloque 2: pestañas de ahorro ---------- */
.tabs-ahorro a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 10px; border-radius: 999px; color: var(--nav-text); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tabs-ahorro a.on { background: var(--accent); color: var(--on-accent); }
@media (max-width: 420px) { .tabs-ahorro a { font-size: 13px; padding: 0 6px; } }

/* ---------- Huchas ---------- */
.huchas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.hucha { gap: 10px; }
.hucha-top { display: flex; align-items: center; gap: 14px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hucha-top .txt { flex: 1; min-width: 0; }
.hucha-top b { display: block; font-size: 16px; font-weight: 700; }
.hucha-top small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.hucha-top .edit-ic { width: 32px; height: 32px; border-radius: 999px; background: var(--chip); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.jar {
  position: relative; width: 58px; height: 58px; flex-shrink: 0; border-radius: 20px 20px 24px 24px; overflow: hidden;
  background: var(--surface-2); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--hc) 55%, transparent);
}
.jar .fill { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--hc) 70%, transparent); animation: llenar 1s cubic-bezier(.2,.9,.3,1) both; }
.jar .fill::before { content: ''; position: absolute; left: -10%; right: -10%; top: -5px; height: 10px; border-radius: 50%; background: inherit; animation: ola 2.4s ease-in-out infinite; }
.jar-emo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.hucha.hecha .jar { box-shadow: inset 0 0 0 2px var(--hc), 0 0 0 4px color-mix(in srgb, var(--hc) 25%, transparent); }
.hucha-num { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.hucha-num span { font-size: 14px; font-weight: 600; color: var(--muted); }
.hucha-tip { font-size: 13px; line-height: 1.4; color: var(--muted); min-height: 36px; }
.hucha.hecha .hucha-tip { color: var(--good); font-weight: 700; }
@keyframes llenar { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ola { 0%, 100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }

.ov-hucha { animation-duration: 1.7s; }
.ov-hucha.completa { animation-duration: 2.6s; }
.ov-jar {
  position: relative; width: 110px; height: 110px; border-radius: 34px 34px 40px 40px; overflow: hidden; margin-bottom: 6px;
  background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 3px var(--hc); animation: grow .6s ease both;
}
.ov-jar .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: var(--hc); opacity: .8; animation: subir 1.2s ease .45s forwards; }
.ov-jar .jar-emo { font-size: 50px; }
.hcoin {
  position: absolute; left: calc(50% - 20px); top: -60px; width: 40px; height: 40px; border-radius: 50%;
  background: #FACC15; border: 3px solid #CA8A04; color: #713F12; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,.25); opacity: 0;
}
.hc1 { animation: caer 0.75s ease-in .05s forwards; } .hc2 { animation: caer 0.75s ease-in .18s forwards; margin-left: -30px; }
.hc3 { animation: caer 0.75s ease-in .3s forwards; margin-left: 28px; } .hc4 { animation: caer 0.75s ease-in .42s forwards; margin-left: -12px; }
.hc5 { animation: caer 0.75s ease-in .54s forwards; margin-left: 14px; }
.ov-hucha .minus { color: #7CF0D2; animation: grow 1.2s ease .3s both; }
@keyframes caer { 0% { opacity: 1; transform: translateY(0) rotate(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(calc(50vh + 10px)) rotate(200deg); } }
@keyframes subir { to { height: 72%; } }
.ov-hucha.completa .ov-jar .fill { animation-name: subirTodo; }
@keyframes subirTodo { to { height: 100%; } }
.confeti { position: absolute; inset: 0; }
.confeti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: confeti 2.2s ease-in forwards; }
.confeti i:nth-child(odd) { width: 8px; height: 8px; border-radius: 50%; animation-duration: 2.5s; }
@keyframes confeti { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(720deg); opacity: .9; } }

/* ---------- Patrimonio ---------- */
.split-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--track); }
.split-bar span:first-child { background: var(--text); }
.split-bar span:last-child { background: var(--accent-2); }

/* ---------- Ajustes ---------- */
.row-btn { width: 100%; border: 0; border-bottom: 1px solid var(--divider); background: transparent; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.row-btn:last-child { border-bottom: none; }
.row-btn:hover { background: var(--hairline); }
.row-btn .chev { font-size: 20px; color: var(--muted); margin-left: 4px; }
.row .seg button { min-height: 34px; padding: 0 12px; }
.theme-sw.arcoiris { background: conic-gradient(#F87171, #FACC15, #4ADE80, #38BDF8, #A78BFA, #F472B6, #F87171); }
.tema-prev { border-radius: 20px; padding: 14px; background: var(--bg); color: var(--text); display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 0 0 1px var(--border); }
.tema-prev .tp-top { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.tema-prev .round { width: 34px; height: 34px; }
.aviso-c { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bad-bar) 18%, transparent); color: var(--text); font-size: 13px; font-weight: 600; }
.ok-c { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--good); }
.swatch.libre { display: flex; align-items: center; justify-content: center; background: var(--chip); overflow: hidden; cursor: pointer; }
.swatch.libre input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.swatch.libre span { font-size: 20px; font-weight: 700; color: var(--text); pointer-events: none; }
.opciones { display: flex; flex-direction: column; gap: 8px; }
.opcion { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 14px; border: 2px solid transparent; border-radius: 16px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.opcion small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.opcion .sim { width: 44px; height: 44px; border-radius: 12px; background: var(--chip); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; flex-shrink: 0; }
.opcion.on { border-color: var(--accent); }
.imp-op { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.imp-op b { font-size: 15px; }
.imp-op p { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------- Tutorial ---------- */
.tuto { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--overlay); animation: fadeIn .2s ease; }
.tuto.fuera { opacity: 0; transition: opacity .2s; }
.tuto-card {
  width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px 20px; border-radius: 28px; background: var(--sheet); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.tuto-h { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
.tuto-n { font-size: 12px; font-weight: 700; color: var(--muted); }
.tuto-skip { min-height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.tuto-vis { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 190px; padding: 18px; border-radius: 22px; background: var(--surface); }
.tuto-e { width: 64px; height: 64px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; background: var(--accent); color: var(--on-accent); animation: tin .5s ease both, tfloat 3s ease-in-out .6s infinite; }
.tuto-mock { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: tfade .5s ease .15s both; }
.tuto-card h2 { font-size: 21px; font-weight: 800; line-height: 1.2; animation: tfade .4s ease both; }
.tuto-x { font-size: 15px; line-height: 1.5; color: var(--muted-2); animation: tfade .4s ease .08s both; }
.tuto-dots { display: flex; justify-content: center; gap: 6px; }
.tuto-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--track); transition: width .2s; }
.tuto-dots i.on { width: 22px; background: var(--text); }
.tuto-acts { display: flex; gap: 10px; }
.tuto-acts .btn { flex: 1; min-height: 52px; }
.tv-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tv-btn { min-height: 46px; padding: 0 22px; pointer-events: none; }
.tv-cats { display: flex; gap: 10px; }
.tv-cat { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; animation: tin .45s ease both; }
.tv-cat.loop { animation: tin .45s ease both, cat-jump 1.6s ease-in-out 1s infinite; }
.tv-card { width: 100%; max-width: 260px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.tv-k { font-size: 12px; color: var(--muted); }
.tv-v { font-size: 22px; font-weight: 800; }
.tv-v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.tv-grow { animation: tvgrow 1s cubic-bezier(.2,.9,.3,1) .3s both; }
@keyframes tvgrow { from { width: 0 !important; } }
.tv-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 280px; }
.tv-quick .quick-btn { pointer-events: none; background: var(--surface-2); }
.tv-bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
.tv-bars i { width: 18px; border-radius: 6px 6px 3px 3px; background: var(--text); transform-origin: bottom; animation: barIn .6s cubic-bezier(.2,.9,.3,1) both; }
.tv-line { width: 200px; height: 70px; color: var(--text); }
.tv-line path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: dibujar 1.2s ease .2s forwards; }
@keyframes dibujar { to { stroke-dashoffset: 0; } }
.tv-round { pointer-events: none; width: 52px; height: 52px; }

/* ---------- Pantalla de arranque (mientras se comprueba la sesión) ---------- */
.arranque { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; }
.arr-t { font-size: 18px; font-weight: 800; }
.arr-s { font-size: 14px; color: var(--muted); max-width: 300px; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--track); border-top-color: var(--text); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Sin conexión y confirmar correo ---------- */
#sin-red {
  position: fixed; left: 50%; top: calc(70px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 45; white-space: nowrap;
  max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 700; text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
@media (min-width: 900px) { #sin-red { top: 16px; } }
.aviso-correo { gap: 12px; border: 2px solid var(--accent-2); }
.aviso-correo p { font-size: 14px; line-height: 1.45; }
.fine a { color: inherit; font-weight: 700; }
