/* Ualets — sistema de diseño "Cobalto"
   Azul cobalto (marca), menta (acción y progreso), coral (alertas), fondo gris azulado. */

:root {
  --tinta: #0D1330;
  --tinta-2: #5A6383;
  --marca: #2B4BF2;
  --marca-osc: #1F38C9;
  --marca-suave: #E8ECFF;
  --papel: #F4F6FB;
  --blanco: #FFFFFF;
  --linea: #E3E7F2;
  --linea-fuerte: #CDD3E5;
  --menta: #2EE6A6;
  --ingreso: #0E9F6E;
  --alerta: #D97706;
  --peligro: #E5484D;
  --hover: #F7F8FD;

  --display: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radio: 16px;
  --radio-s: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, dl, dd, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
a { color: var(--marca); }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--blanco); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

.muted { color: var(--tinta-2); }
.small { font-size: 13px; margin-top: 12px; }
.icon { flex: none; }

/* ---------- Marca ---------- */

.brand {
  display: inline-flex; align-items: center;
  font-size: 26px;
  color: var(--marca-osc);
  text-decoration: none;
  line-height: 1;
}
/* El logo mide en em: con font-size se escala igual que antes la palabra */
.logo { display: block; height: 0.82em; width: auto; overflow: visible; }
.logo-dot { fill: var(--menta); }
.brand-light { color: var(--blanco); }

/* ---------- Estructura de la app ---------- */

.side { display: none; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--papel) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.top-me {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blanco);
  border: 1px solid var(--linea);
  color: var(--tinta);
}
.top-me.is-active { background: var(--tinta); color: var(--blanco); border-color: var(--tinta); }

.main {
  max-width: 600px;
  margin: 0 auto;
  padding: 4px 16px calc(108px + env(safe-area-inset-bottom));
}

/* ---------- Barra de abajo: cápsula de vidrio flotante con una lente que se arrastra ---------- */
.tabs {
  position: fixed; z-index: 20;
  left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto;
  padding: 0 14px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
/* Un velo suave abajo para que lo que pasa detrás no compita con la barra */
.tabs::before {
  content: ''; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0;
  height: calc(96px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, color-mix(in srgb, var(--papel) 82%, transparent) 30%, transparent);
  pointer-events: none;
}
.is-home .tabs::before { background: linear-gradient(to top, rgba(255, 255, 255, 0.85) 30%, rgba(255, 255, 255, 0)); }
.tabs-cap, .tabs .tab-add { pointer-events: auto; }

.tabs-cap {
  position: relative; isolation: isolate; flex: 1; min-width: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: 64px; padding: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.56));
  -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  box-shadow:
    0 0 0 0.5px rgba(13, 19, 48, 0.1),
    0 12px 32px rgba(13, 19, 48, 0.14),
    0 2px 6px rgba(13, 19, 48, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(13, 19, 48, 0.04);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
/* Brillo del vidrio: una luz suave que entra por arriba a la izquierda */
.tabs-cap::after {
  content: ''; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 90% at 18% -10%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 55%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabs-cap { background: rgba(255, 255, 255, 0.97); }
}

.tabs-lens {
  position: absolute; z-index: -1; top: 5px; bottom: 5px; left: 5px;
  width: calc((100% - 10px) / 4);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(43, 75, 242, 0.13), rgba(43, 75, 242, 0.08));
  box-shadow: inset 0 0 0 0.5px rgba(43, 75, 242, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(43, 75, 242, 0.08);
  transform: translateX(calc(var(--i, 0) * 100%));
  will-change: transform;
}
.tabs-cap.is-ready .tabs-lens { transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1), scale 0.28s cubic-bezier(0.32, 0.72, 0, 1), background 0.28s ease; }
/* Mientras arrastras, la lente se infla un poco y se vuelve más clara, como una gota */
.tabs-cap.is-dragging .tabs-lens {
  scale: 1.1 1.14;
  background: linear-gradient(180deg, rgba(43, 75, 242, 0.16), rgba(43, 75, 242, 0.1));
  transition: scale 0.28s cubic-bezier(0.32, 0.72, 0, 1), background 0.28s ease;
}

.tab {
  position: relative;
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-width: 0; border-radius: 999px;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--tinta-2);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent; -webkit-user-drag: none;
  transition: color 0.25s ease;
}
.tab > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab .icon { transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.tab.is-active { color: var(--marca); font-weight: 600; }
.tab.is-active .icon { transform: scale(1.06); }
.tab-add {
  justify-self: center;
  display: grid; place-items: center;
  width: 58px; height: 58px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--menta);
  color: var(--tinta);
  box-shadow: 0 6px 16px rgba(13, 19, 48, 0.22), 0 0 0 5px var(--blanco);
  transition: transform 0.12s ease;
}
.tab-add:active { transform: scale(0.94); }
.tabs .tab-add {
  flex: none; justify-self: auto;
  width: 64px; height: 64px; margin: 0;
  background: linear-gradient(180deg, rgb(110, 242, 198), rgb(46, 230, 166));
  box-shadow:
    0 0 0 0.5px rgba(11, 122, 85, 0.25),
    0 12px 28px rgba(46, 230, 166, 0.4),
    0 2px 6px rgba(13, 19, 48, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -2px 4px rgba(11, 122, 85, 0.12);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.tabs .tab-add:active { transform: scale(0.92); }

@media (min-width: 960px) {
  body.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
  .top, .tabs { display: none; }
  .side {
    display: block;
    position: sticky; top: 0; align-self: start;
    height: 100vh;
    padding: 30px 18px;
    background: var(--blanco);
    border-right: 1px solid var(--linea);
  }
  .side .brand { padding-left: 12px; }
  .side-add { width: 100%; margin: 26px 0 16px; }
  .side-link {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--tinta-2);
    font-size: 15px; font-weight: 500;
    text-decoration: none;
  }
  .side-link:hover { background: var(--papel); }
  .side-link { position: relative; isolation: isolate; }
  .side-link.is-active { color: var(--tinta); font-weight: 600; }
  .side-link .nav-pill { position: absolute; z-index: -1; inset: 0; width: auto; height: auto; transform: none; animation: none; border-radius: 10px; background: var(--papel); view-transition-name: side-pill; }
  .main { max-width: 720px; width: 100%; padding: 40px 32px 64px; }
}

/* ---------- Encabezados ---------- */

.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 4px 0 14px;
}
.page-head h1 {
  font-family: var(--display); font-weight: 700;
  font-size: 27px; letter-spacing: -0.02em; line-height: 1.1;
}
.hello {
  font-family: var(--display); font-weight: 500;
  font-size: 21px; letter-spacing: -0.01em;
  margin: 2px 0 12px;
}
.block { margin-top: 28px; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 2px 10px;
}
.block-head h2 { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.block-head a { font-size: 13.5px; font-weight: 500; text-decoration: none; }
.day { font-size: 13.5px; font-weight: 600; color: var(--tinta-2); margin: 22px 4px 8px; }

/* ---------- Resumen del inicio ---------- */

/* La regla: una marca por día del periodo; la más alta es hoy */
.ruler {
  display: flex; align-items: flex-end; gap: 3px;
  height: 24px;
  margin-top: 20px;
}
.ruler i {
  flex: 1;
  height: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}
.ruler i.is-past { background: var(--menta); }
.ruler i.is-today { height: 24px; }

.hero-period {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; opacity: 0.82;
  margin-top: 8px;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 10px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.hero-stats dt { font-size: 12px; opacity: 0.72; }
.hero-stats dd {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(12.5px, 3.7vw, 18px);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Periodo ---------- */

.period { margin: 16px 0 4px; }
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.period-arrow {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blanco);
  border: 1px solid var(--linea);
  color: var(--tinta);
}
.period-label { position: relative; display: grid; justify-items: center; line-height: 1.25; min-width: 0; }
.period-today { font-size: 12.5px; }
.period-types, .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--linea);
  background: var(--blanco);
  color: var(--tinta);
  font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.pill.is-active { background: var(--tinta); border-color: var(--tinta); color: var(--blanco); }

/* Desplegable del tipo de periodo */
.period-menu summary, .period-custom summary { list-style: none; }
.period-menu summary::-webkit-details-marker, .period-custom summary::-webkit-details-marker { display: none; }
.period-trigger {
  display: grid; justify-items: center; gap: 1px;
  padding: 4px 14px;
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.period-trigger:hover { background: var(--blanco); }
.period-trigger strong { font-family: var(--display); font-size: 17px; font-weight: 700; }
.period-kind { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--marca); }
.period-kind .icon { transition: transform 0.2s ease; }
.period-menu[open] .period-kind .icon { transform: rotate(180deg); }
.period-pop {
  position: absolute; z-index: 30;
  top: calc(100% + 6px); left: 50%;
  width: 230px;
  margin-left: -115px;
  display: grid; gap: 2px;
  padding: 6px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(13, 19, 48, 0.14), 0 2px 6px rgba(13, 19, 48, 0.06);
  text-align: left;
  animation: period-pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  transform-origin: top center;
}
@keyframes period-pop { from { opacity: 0; transform: translateY(-4px) scale(0.97); } to { opacity: 1; transform: none; } }
.period-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--tinta);
  font-size: 14.5px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.period-option > span { display: inline-flex; align-items: center; gap: 8px; }
.period-option:hover { background: var(--hover); }
.period-option.is-active { color: var(--marca); font-weight: 600; background: var(--marca-suave); }
.period-custom { border-top: 1px solid var(--linea); margin-top: 4px; padding-top: 4px; }
.period-range {
  display: grid; gap: 8px;
  padding: 8px 6px 4px;
}
.period-range label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; }

/* Filtro de periodo en una línea: tira de periodos con una píldora sobre el actual y el tipo al final */
.period.ps { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.ps-strip {
  position: relative; flex: 1; min-width: 0; overflow: hidden;
  padding: 4px; border-radius: 99px;
  background: color-mix(in srgb, var(--tinta) 5%, transparent);
  touch-action: pan-y;
}
/* Nueve periodos en la tira; se ven cinco. La píldora queda fija en el centro y la tira pasa por debajo */
.ps-track { position: relative; display: grid; width: 100%; grid-template-columns: repeat(9, 20%); margin-left: -40%; will-change: transform; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ps-lens {
  position: absolute; top: 4px; bottom: 4px; left: calc(4px + (100% - 8px) * 0.4); width: calc((100% - 8px) / 5);
  border-radius: 99px; background: var(--marca);
  box-shadow: 0 4px 12px rgba(43, 75, 242, 0.28);
  will-change: transform;
}
.ps-track { transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1); }
.ps-track.is-dragging { transition: none; }
.ps-item { -webkit-user-drag: none; }
.ps-item {
  position: relative; z-index: 1;
  display: grid; justify-items: center; align-content: center;
  height: 38px; border-radius: 99px;
  color: var(--tinta-2); font-size: 13.5px; font-weight: 500; line-height: 1.1;
  text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s ease;
}
.ps-item small { font-size: 10px; font-weight: 500; opacity: 0.75; }
.ps-item.is-active { color: var(--blanco); font-weight: 600; }
/* El periodo de hoy lleva un punto, para no perderse al viajar a otros meses */
.ps-item.is-today::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--marca); transition: background 0.3s ease; }
.ps-item.is-today.is-active::after { background: var(--menta); }
.ps-custom { display: flex; align-items: center; justify-content: space-between; }
.ps-custom > span { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-arrow { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; color: var(--tinta); }

.ps-menu { position: relative; flex: none; }
.ps-chip {
  display: inline-flex; align-items: center; gap: 3px;
  height: 46px; padding: 0 12px 0 14px; border-radius: 99px;
  background: color-mix(in srgb, var(--tinta) 5%, transparent);
  color: var(--tinta); font-size: 13px; font-weight: 600;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ps-chip .icon { color: var(--tinta-2); transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.ps-menu[open] .ps-chip .icon { transform: rotate(180deg); }
.ps-pop { left: auto; right: 0; margin-left: 0; transform-origin: top right; }
.ps-back { color: var(--marca); font-weight: 600; }
.ps-nav .main { animation: none; }

/* ---------- Listas y filas ---------- */

.list {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  overflow: hidden;
}
.mov, .share {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  color: var(--tinta);
  text-decoration: none;
}
.mov + .mov, .share + .share { border-top: 1px solid var(--linea); }
a.mov:hover, a.share:hover { background: var(--hover); }
.mov > .icon { color: var(--linea-fuerte); }
.mov-child { padding-left: 66px; padding-top: 9px; padding-bottom: 9px; }
.mov-child .mov-name { font-size: 14px; font-weight: 400; }

.ico {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c, #64748B) 13%, white);
  color: var(--c, #64748B);
  line-height: 1;
}
.ico-plain { background: var(--papel); color: var(--tinta); }

.mov-text { flex: 1; min-width: 0; display: grid; }
.mov-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mov-meta { font-size: 12.5px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mov-amount { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mov-income { color: var(--ingreso); }
.mov-transfer { color: var(--tinta-2); }

.totals {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 14px 0;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
}
.totals div { padding: 11px 12px; min-width: 0; }
.totals div + div { border-left: 1px solid var(--linea); }
.totals-4 { grid-template-columns: 1fr 1fr; }
.totals-4 div:nth-child(3) { border-left: 0; }
.totals-4 div:nth-child(n+3) { border-top: 1px solid var(--linea); }
.totals dt { font-size: 12px; color: var(--tinta-2); }
.totals dd {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(13.5px, 4vw, 17px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ---------- Presupuestos y barras ---------- */

.stack { display: grid; gap: 10px; }
.budget {
  display: grid; gap: 8px;
  padding: 14px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  color: var(--tinta);
  text-decoration: none;
}
.budget-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.budget-name { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; }
.budget-name .icon { color: var(--c); }
.budget-left { font-size: 13.5px; color: var(--tinta-2); }
.budget-left strong { color: var(--tinta); font-variant-numeric: tabular-nums; }
.budget-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--tinta-2); font-variant-numeric: tabular-nums; }
.budget-hint { font-size: 12.5px; color: #6B4A05; background: #FFF3D6; padding: 7px 10px; border-radius: 8px; }

.bar { display: block; height: 8px; border-radius: 99px; background: #E7EBF7; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--marca)); }
.budget-near .bar > span { background: var(--alerta); }
.budget-over .bar > span { background: var(--peligro); }
.budget-over .budget-left strong { color: var(--peligro); }

.share { align-items: flex-start; }
.share-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.share-top { display: flex; justify-content: space-between; gap: 10px; }
.share-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--tinta-2); }

.insight {
  padding: 12px 14px;
  background: #FFF4E0;
  border-radius: var(--radio-s);
  font-size: 14.5px;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radio-s);
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--marca); color: var(--blanco); }
.btn-primary:hover { background: var(--marca-osc); }
.btn-accent { background: var(--menta); color: var(--tinta); }
.btn-ghost { background: var(--blanco); border-color: var(--linea-fuerte); color: var(--tinta); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: var(--blanco); border-color: #F8C9CB; color: var(--peligro); }
.btn-small { padding: 8px 12px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- Formularios ---------- */

.form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field > legend { font-size: 13.5px; font-weight: 600; padding: 0; }
.field > legend { margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--tinta-2); }
.hint { font-size: 12.5px; color: var(--tinta-2); }
.error { font-size: 13px; color: var(--peligro); font-weight: 500; }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio-s);
  background: var(--blanco);
  font-size: 16px;
  min-height: 48px;
}
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6383' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
textarea.input { resize: vertical; }
.input:focus { outline: 2px solid var(--marca); outline-offset: 1px; border-color: var(--marca); }
.has-error .input { border-color: var(--peligro); }

.grid-2 { display: grid; gap: 20px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.amount {
  display: flex; align-items: baseline; gap: 6px;
  border-bottom: 2px solid var(--tinta);
  padding-bottom: 2px;
}
.amount:focus-within { border-color: var(--marca); }
.amount > span { font-family: var(--display); font-size: 28px; font-weight: 500; color: var(--tinta-2); }
.amount input {
  flex: 1; min-width: 0; width: 100%;
  border: 0; background: transparent; outline: none;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(36px, 11vw, 46px);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.amount input::placeholder { color: var(--linea-fuerte); }
.has-error .amount { border-color: var(--peligro); }

/* Selector segmentado */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: #E7EBF7; border-radius: 14px; }
.seg-item { position: relative; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-item span { display: block; text-align: center; padding: 9px 6px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--tinta-2); }
.seg-item input:checked + span { background: var(--blanco); color: var(--tinta); box-shadow: 0 1px 3px rgba(13, 19, 48, 0.14); }
.seg-item input:focus-visible + span { outline: 2px solid var(--marca); outline-offset: 1px; }
.seg-income input:checked + span { color: var(--ingreso); }
.seg-transfer input:checked + span { color: var(--marca); }
.seg-expense input:checked + span { color: var(--tinta); }

/* Fichas de categoría y tipo */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip > span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--linea-fuerte);
  border-radius: 999px;
  background: var(--blanco);
  font-size: 14px;
}
.chip > span .icon { color: var(--c); }
.chip input:checked + span {
  background: color-mix(in srgb, var(--c) 14%, white);
  border-color: var(--c);
  font-weight: 600;
}
.chip input:focus-visible + span { outline: 2px solid var(--marca); outline-offset: 2px; }

.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatch > span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--papel), 0 0 0 5px var(--c); }
.swatch input:focus-visible + span { outline: 2px solid var(--tinta); outline-offset: 6px; }


.form-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.transfer-note { font-size: 13px; color: var(--tinta-2); }

/* ---------- Filtros ---------- */

/* Filtros de movimientos: cerrados en un botón; al abrir, un panel suave */
.filter-menu { margin: 4px 0 8px; }
.filter-menu > summary { list-style: none; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--linea); border-radius: 99px;
  background: var(--blanco); color: var(--tinta);
  font-size: 14px; font-weight: 600;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.filter-toggle:hover { border-color: var(--linea-fuerte); }
.filter-toggle .icon:first-child { color: var(--marca); }
.filter-toggle .icon:last-child { color: var(--tinta-2); transition: transform 0.2s ease; }
.filter-menu[open] .filter-toggle .icon:last-child { transform: rotate(180deg); }
.filter-count {
  min-width: 19px; padding: 1px 6px; border-radius: 99px;
  background: var(--marca); color: var(--blanco);
  font-size: 11.5px; font-weight: 700; text-align: center;
}
.filter-panel {
  display: grid; gap: 12px;
  margin-top: 8px; padding: 14px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(13, 19, 48, 0.08);
  animation: period-pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  transform-origin: top left;
}
.filter-panel .field { display: grid; gap: 6px; margin: 0; }
.filter-panel .pills { margin-top: 0; }
.filter-label { font-size: 12.5px; font-weight: 600; color: var(--tinta-2); }
.pill-radio { position: relative; }
.pill-radio input { position: absolute; opacity: 0; pointer-events: none; }
.pill-radio input:checked + .pill { background: var(--tinta); border-color: var(--tinta); color: var(--blanco); }
.pill-radio input:focus-visible + .pill { outline: 2px solid var(--marca); outline-offset: 2px; }
.filter-actions { display: flex; gap: 8px; justify-content: flex-end; }
.filter-actions .btn-primary { flex: 1; }
@media (min-width: 640px) { .filter-actions .btn-primary { flex: 0 0 auto; } }
.filter-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.filter-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px 5px 11px;
  border-radius: 99px;
  background: var(--marca-suave); color: var(--marca);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.filter-tag .icon { opacity: 0.75; }
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--blanco);
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio-s);
  color: var(--tinta-2);
}
.search:focus-within { outline: 2px solid var(--marca); outline-offset: 1px; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 12px 0; font-size: 16px; color: var(--tinta); }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

/* ---------- Avisos y vacíos ---------- */

.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  border-radius: var(--radio-s);
  font-size: 14.5px; font-weight: 500;
}
.flash form { margin: 0; }
.flash-success { background: #DDFBF0; color: #07714E; }
.flash-error { background: #FFE8E8; color: #B4232A; }
.flash-info { background: #FFF3D6; color: #6B4A05; }
.flash-action { background: none; border: 0; padding: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }

/* Confirmaciones flotantes: entran desde abajo y se van solas */
.toasts {
  position: fixed; z-index: 70;
  left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom));
  display: grid; justify-items: center; gap: 8px;
  pointer-events: none;
}
body.auth .toasts { bottom: calc(20px + env(safe-area-inset-bottom)); }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  width: min(100%, 420px);
  padding: 10px 8px 10px 12px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(13, 19, 48, 0.12), 0 2px 6px rgba(13, 19, 48, 0.06);
  font-size: 14.5px; font-weight: 500; line-height: 1.35;
  color: var(--tinta);
  animation: toast-entra 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.toast.is-leaving { animation: toast-sale 0.22s ease both; }
.toast form { margin: 0; }
.toast-ico {
  flex: none; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
}
.toast-success .toast-ico { background: #DDFBF0; color: var(--ingreso); }
.toast-error .toast-ico { background: #FFE8E8; color: var(--peligro); }
.toast-info .toast-ico { background: var(--marca-suave); color: var(--marca); }
.toast-text { flex: 1; min-width: 0; }
.toast-action {
  flex: none; padding: 6px 10px;
  background: var(--marca-suave); color: var(--marca);
  border: 0; border-radius: 999px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.toast-close {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px;
  background: none; border: 0; border-radius: 50%;
  color: var(--tinta-2); cursor: pointer;
}
.toast-close:hover { background: var(--hover); color: var(--tinta); }
@keyframes toast-entra { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-sale { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
@media (min-width: 960px) {
  .toasts { left: auto; right: 28px; bottom: 28px; justify-items: end; }
  body.auth .toasts { left: 0; right: 0; justify-items: center; }
}

.empty {
  display: grid; justify-items: center; gap: 12px;
  padding: 24px 20px;
  background: var(--blanco);
  border: 1px dashed var(--linea-fuerte);
  border-radius: var(--radio);
  text-align: center;
}
.empty p { color: var(--tinta-2); font-size: 14.5px; max-width: 36ch; }

/* ---------- Entrar y registro ---------- */

.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; }
.auth-brand { display: none; }
.auth-panel { width: 100%; max-width: 440px; margin: 0 auto; padding: 32px 20px 48px; align-self: center; }
.auth-logo { display: inline-block; margin-bottom: 30px; }
.auth-title { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 8px; }
.auth-panel .form { margin-top: 22px; }
.auth-panel > p { margin-bottom: 14px; }
.auth-links { display: grid; gap: 8px; margin-top: 20px; font-size: 14.5px; color: var(--tinta-2); }

@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr 1fr; }
  .auth-brand {
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 56px;
    background:
      radial-gradient(90% 70% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
      var(--marca);
    color: var(--blanco);
  }
  .auth-brand .brand { position: absolute; top: 48px; font-size: 30px; }
  .auth-claim { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 4.6vw, 62px); letter-spacing: -0.04em; line-height: 1; }
  .ruler-demo { max-width: 380px; margin-top: 36px; }
  .auth-note { font-size: 14px; opacity: 0.78; margin-top: 10px; }
  .auth-logo { display: none; }
}



/* ---------- Selector de íconos ---------- */

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-pick { position: relative; cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.icon-pick > span {
  display: grid; place-items: center;
  height: 44px;
  border: 1px solid var(--linea);
  border-radius: 10px;
  background: var(--blanco);
  color: var(--tinta-2);
}
.icon-pick:hover > span { border-color: var(--linea-fuerte); }
.icon-pick input:checked + span {
  background: color-mix(in srgb, var(--c) 12%, white);
  border-color: var(--c);
  color: var(--c);
}
.icon-pick input:focus-visible + span { outline: 2px solid var(--marca); outline-offset: 2px; }

/* ---------- Calendario (rango o un solo día) ---------- */

body.rp-open { overflow: hidden; }
.period-custom.is-enhanced .period-range { display: none; }

.rp-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(13, 19, 48, 0.42);
}
.rp {
  width: 100%; max-width: 420px; max-height: 92vh; overflow-y: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--blanco);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(13, 19, 48, 0.18);
  animation: rp-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rp-up { from { transform: translateY(28px); opacity: 0; } }
@media (min-width: 640px) {
  .rp-backdrop { align-items: center; }
  .rp { border-radius: 22px; padding: 22px; }
}

.rp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rp-head strong { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.rp-icon {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--linea); border-radius: 50%;
  background: var(--blanco); color: var(--tinta);
  cursor: pointer;
}
.rp-icon:hover { background: var(--hover); }

.rp-presets {
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px 14px; padding: 0 16px 2px;
}
.rp-presets::-webkit-scrollbar { display: none; }

.rp-summary { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 16px; }
.rp-field {
  display: grid; gap: 1px;
  padding: 9px 12px;
  text-align: left;
  border: 1px solid var(--linea-fuerte); border-radius: var(--radio-s);
  background: var(--blanco);
  cursor: pointer;
}
.rp-field span { font-size: 12px; color: var(--tinta-2); }
.rp-field strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-field.is-active { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.rp-arrow { color: var(--tinta-2); display: grid; }

.rp-month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rp-month strong { font-family: var(--display); font-weight: 700; font-size: 16px; }
.rp-week, .rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.rp-week span { padding: 6px 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--tinta-2); }
.rp-grid { row-gap: 4px; }

.rp-day {
  position: relative; z-index: 0;
  height: 42px; padding: 0;
  border: 0; background: none;
  color: var(--tinta);
  font-size: 15px; font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.rp-day::before { content: ''; position: absolute; inset: 3px 0; z-index: -1; }
.rp-day::after {
  content: ''; position: absolute; z-index: -1;
  top: 50%; left: 50%; width: 38px; height: 38px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.rp-day:hover::after { background: var(--papel); }
.rp-day:focus-visible { outline: none; }
.rp-day:focus-visible::after { box-shadow: 0 0 0 2px var(--marca); }
.rp-day.is-today { color: var(--marca); font-weight: 700; }
.rp-day.is-in::before { background: var(--marca-suave); }
.rp-day.is-start::before { background: linear-gradient(90deg, transparent 50%, var(--marca-suave) 50%); }
.rp-day.is-end::before { background: linear-gradient(90deg, var(--marca-suave) 50%, transparent 50%); }
.rp-day.is-start.is-end::before { background: none; }
.rp-day.is-start, .rp-day.is-end { color: var(--blanco); font-weight: 600; }
.rp-day.is-start::after, .rp-day.is-end::after { background: var(--marca); }
.rp-previewing .rp-day.is-end:not(.is-start) { color: var(--marca); }
.rp-previewing .rp-day.is-end:not(.is-start)::after { background: var(--blanco); box-shadow: inset 0 0 0 2px var(--marca); }

.rp-hint { margin-top: 10px; text-align: center; font-size: 13px; color: var(--peligro); }
.rp-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 16px; }

.input-date { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.input-date .icon { color: var(--marca); }

/* ---------- Transiciones entre pantallas ----------
   El navegador mantiene quietas las barras y solo cambia el contenido; el indicador
   de la pestaña activa se desliza de una a otra. Sin soporte, solo queda la entrada suave. */

/* Solo en computador: en el iPhone la transición entre páginas congela la pantalla un momento
   mientras llega la siguiente, y la barra de abajo parece trabada */
@media (prefers-reduced-motion: no-preference) and (min-width: 960px) {
  @view-transition { navigation: auto; }
}
/* Las barras fijas del celular no se nombran: Safari del iPhone las deja descolocadas
   después de la transición si la página estaba desplazada. Son iguales en las dos pantallas,
   así que igual se ven quietas. El menú lateral del computador sí se nombra. */
@media (min-width: 960px) { .side { view-transition-name: side; } }
.tabs { transform: translateZ(0); -webkit-transform: translateZ(0); }
.main { view-transition-name: contenido; animation: ua-entra 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

::view-transition-old(root) { animation: ua-sale 0.12s ease both; }
::view-transition-new(root) { animation: none; }
/* El contenido viejo se desvanece; el nuevo entra con su propia animación (.main) */
::view-transition-old(contenido) { animation: ua-sale 0.14s ease both; }
::view-transition-new(contenido) { animation: none; }
::view-transition-group(side-pill) { animation-duration: 0.34s; animation-timing-function: cubic-bezier(0.3, 1.25, 0.5, 1); }

@keyframes ua-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ua-sale { to { opacity: 0; } }
@keyframes ua-pop { 0% { transform: scale(0.82); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }


/* ---------- Tutorial de bienvenida ---------- */

.tg {
  position: fixed; inset: 0; z-index: 180;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--papel);
  animation: tg-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.tg.is-leaving { animation: tg-out 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.tg-top { display: flex; align-items: center; justify-content: space-between; padding: max(16px, env(safe-area-inset-top)) 18px 8px; }
.tg-top .brand { font-size: 22px; }
.tg-skip { padding: 8px 4px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--tinta-2); cursor: pointer; }
.tg-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tg-track::-webkit-scrollbar { display: none; }
.tg-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 0 28px; text-align: center; }
.tg-slide h2 { margin: 0; font-family: var(--display); font-size: 25px; letter-spacing: -0.02em; line-height: 1.15; }
.tg-slide p { margin: 0; max-width: 310px; font-size: 15px; line-height: 1.5; color: var(--tinta-2); }
.tg-art { display: grid; place-items: center; width: 100%; max-width: 330px; min-height: 210px; margin-bottom: 10px; }
.tg-wallet { width: 100%; text-align: left; }
.tg-slide .tg-wallet .wallet-amount { max-width: none; margin-top: 6px; font-size: 36px; line-height: 1.05; color: var(--blanco); }
.tg-add { display: grid; justify-items: center; gap: 16px; }
.tg-add-button { position: static; width: 80px; height: 80px; margin: 0; box-shadow: 0 12px 28px rgba(13, 19, 48, 0.25); animation: tg-bob 2.4s ease-in-out infinite; }
.tg-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 99px; background: var(--blanco); border: 1px solid var(--linea); font-size: 14px; font-weight: 600; }
.tg-budgets { display: flex; gap: 10px; }
.tg-budgets .bcard { width: 132px; height: 172px; }
.tg-rows { display: grid; gap: 8px; width: 100%; }
.tg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--blanco); border: 1px solid var(--linea); font-size: 14px; text-align: left; }
.tg-row span { display: inline-flex; align-items: center; gap: 8px; }
.tg-row strong { font-family: var(--display); }
.tg-row-soft { background: transparent; }
.tg-row .avatar { width: 26px; height: 26px; font-size: 10px; }
.tg-foot { display: grid; gap: 16px; padding: 16px 22px calc(24px + env(safe-area-inset-bottom)); }
.tg-dots { display: flex; justify-content: center; gap: 6px; }
.tg-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--linea-fuerte); transition: width 0.25s ease, background 0.25s ease; }
.tg-dot.is-on { width: 22px; background: var(--marca); }
@media (min-width: 960px) { .tg-slide { padding: 0 25%; } }
@keyframes tg-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes tg-out { to { opacity: 0; transform: scale(1.03); visibility: hidden; } }
@keyframes tg-bob { 50% { transform: translateY(-6px); } }

/* ---------- Invitación a instalar la app ---------- */

.inst {
  position: fixed; inset: 0; z-index: 175;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--papel);
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.inst.is-open { opacity: 1; transform: none; }
.inst[hidden] { display: none; }
.inst-top { display: flex; justify-content: center; padding: max(22px, env(safe-area-inset-top)) 0 0; }
.inst-top .brand { font-size: 22px; }
.inst-body { display: grid; align-content: center; justify-items: center; gap: 12px; padding: 0 24px; text-align: center; }
.inst-body[hidden] { display: none; }
.inst-body h2 { margin: 6px 0 0; font-family: var(--display); font-size: 25px; letter-spacing: -0.02em; line-height: 1.15; }
.inst-body > p { margin: 0; max-width: 320px; font-size: 15px; line-height: 1.5; color: var(--tinta-2); }
.inst-app { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 14px 30px rgba(13, 19, 48, 0.22); }
.inst-perks, .inst-steps { display: grid; gap: 8px; width: 100%; max-width: 360px; margin-top: 6px; text-align: left; }
.inst-perks div { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--blanco); border: 1px solid var(--linea); font-size: 14px; }
.inst-perks .icon { flex: none; color: var(--marca); }
.inst-steps > div { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--blanco); border: 1px solid var(--linea); font-size: 14.5px; line-height: 1.4; }
.inst-num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--marca); color: var(--blanco); font-size: 13px; font-weight: 700; }
.inst-key { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; background: var(--papel); border: 1px solid var(--linea); font-weight: 600; color: var(--marca-osc); white-space: nowrap; vertical-align: middle; }
.inst-note { margin: 4px 0 0; max-width: 320px; font-size: 13px; line-height: 1.45; color: var(--tinta-2); }
.inst-foot { display: grid; gap: 10px; padding: 14px 22px calc(26px + env(safe-area-inset-bottom)); }
.inst-foot [hidden] { display: none; }
.inst-later { padding: 8px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--tinta-2); cursor: pointer; }
.inst-pointer { position: absolute; left: 50%; bottom: max(6px, env(safe-area-inset-bottom)); margin: 0; display: grid; justify-items: center; font-size: 12.5px; font-weight: 600; color: var(--marca); transform: translateX(-50%); animation: inst-bob 1.4s ease-in-out infinite; }
.inst-pointer[hidden] { display: none; }
@keyframes inst-bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- Guías sobre la pantalla ---------- */

.guide { position: fixed; inset: 0; z-index: 170; animation: hola-fade 0.25s ease both; }
.guide.is-leaving { animation: tg-out 0.25s ease forwards; }
.guide-hole {
  position: fixed; border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(11, 19, 66, 0.62), 0 0 0 3px rgba(255, 255, 255, 0.85);
  transition: left 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 0.35s ease;
  pointer-events: none;
}
.guide-tip {
  position: fixed; left: 16px; right: 16px;
  max-width: 420px; margin: 0 auto;
  padding: 16px;
  background: var(--blanco); border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.guide-tip.is-in { opacity: 1; transform: none; }
.guide-count { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--marca); }
.guide-title { margin: 0 0 4px; font-family: var(--display); font-size: 17px; }
.guide-text { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: var(--tinta-2); }
.guide-actions { display: flex; align-items: center; justify-content: space-between; }
.guide-skip { padding: 6px 2px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--tinta-2); cursor: pointer; }

/* Botón "?" de la barra de arriba y pantalla de Ayuda */
.top-help { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linea); background: var(--blanco); color: var(--tinta); cursor: pointer; }
/* Ajustes: menú agrupado */
.st-profile { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px; border-radius: 22px; background: var(--blanco); border: 1px solid var(--linea); color: var(--tinta); text-decoration: none; }
.st-avatar { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--marca); color: var(--blanco); font-family: var(--display); font-size: 18px; font-weight: 700; }
.st-profile-text { flex: 1; min-width: 0; display: grid; }
.st-profile-text strong { font-size: 17px; }
.st-profile-text small { font-size: 13px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-profile > .icon { flex: none; color: var(--tinta-2); }
.st-label { margin: 0 4px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tinta-2); }
.st-label-gap { margin-top: 18px; }
.st-group { display: grid; margin-bottom: 16px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; overflow: hidden; }
.st-group > form { margin: 0; }
.st-group > * + * { border-top: 1px solid var(--linea); }
.st-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; font: inherit; color: var(--tinta); text-align: left; text-decoration: none; cursor: pointer; }
.st-row:hover { background: var(--hover); }
.st-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, var(--blanco)); color: var(--c); }
.st-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; }
.st-value { flex: none; font-size: 13.5px; color: var(--tinta-2); }
.st-row > .icon:last-child { flex: none; color: var(--linea-fuerte); }
.st-row-static { cursor: default; }
.st-row-static:hover { background: none; }
.st-sub { display: block; margin-top: 1px; font-size: 12.5px; font-weight: 400; color: var(--tinta-2); }
.st-danger { display: block; padding: 14px; text-align: center; font-size: 14.5px; font-weight: 600; color: var(--peligro); text-decoration: none; }
.tz-suggest { margin: 4px 0 0; font-size: 13px; color: var(--tinta-2); }
.tz-suggest .link-button { font-weight: 600; color: var(--marca); text-decoration: none; }
.st-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--marca); text-decoration: none; }

.help-hero { display: flex; align-items: center; gap: 12px; padding: 16px; margin-bottom: 8px; border-radius: 20px; background: var(--tinta); color: var(--blanco); text-decoration: none; }
.help-hero > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.help-hero small { font-size: 12.5px; color: #C9D3FF; }
.help-hero-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--menta); color: var(--tinta); }
.help-faq { display: grid; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; overflow: hidden; }
.help-faq details + details { border-top: 1px solid var(--linea); }
.help-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; font-size: 14.5px; font-weight: 600; cursor: pointer; list-style: none; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary .icon { flex: none; color: var(--tinta-2); transition: transform 0.2s ease; }
.help-faq details[open] summary .icon { transform: rotate(180deg); }
.help-faq p { margin: 0; padding: 0 14px 14px; font-size: 14px; line-height: 1.5; color: var(--tinta-2); }

/* ---------- Saludo de la primera apertura del día ----------
   Línea de tiempo: el fondo aparece, "hola." se escribe letra por letra, suben el nombre
   y la frase, y todo se disuelve mientras la app entra enfocándose. Tocar adelanta la salida. */

.hola {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  overflow: hidden;
  background: #0B1342;
  color: var(--blanco);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: hola-out 0.9s cubic-bezier(0.4, 0, 0.2, 1) 4.6s forwards;
}
.hola.is-leaving { animation: hola-out 0.75s cubic-bezier(0.4, 0, 0.2, 1) 0.18s forwards; }
.hola-orb { position: absolute; border-radius: 50%; filter: blur(64px); will-change: transform, opacity; }
.hola-orb-1 { width: 78vmax; height: 78vmax; left: -28vmax; top: -6vmax; background: #2B4BF2; --o: 0.9; animation: hola-orb-in 1.6s ease-out both, hola-drift-a 9s ease-in-out 1.6s infinite alternate; }
.hola-orb-2 { width: 62vmax; height: 62vmax; right: -30vmax; top: 22vh; background: #2EE6A6; --o: 0.5; animation: hola-orb-in 1.8s ease-out 0.15s both, hola-drift-b 10s ease-in-out 1.9s infinite alternate; }
.hola-orb-3 { width: 60vmax; height: 60vmax; left: -6vmax; bottom: -30vmax; background: #7C5CFF; --o: 0.6; animation: hola-orb-in 2s ease-out 0.3s both, hola-drift-a 11s ease-in-out 2.3s infinite alternate-reverse; }
.hola-orb-4 { width: 40vmax; height: 40vmax; right: -8vmax; top: -12vmax; background: #F59E8B; --o: 0.35; animation: hola-orb-in 2s ease-out 0.45s both, hola-drift-b 8s ease-in-out 2.45s infinite alternate; }
.hola-content {
  position: relative;
  display: grid; justify-items: center; gap: 14px;
  padding: 0 28px;
  text-align: center;
  animation: hola-breathe 2.6s cubic-bezier(0.2, 0.8, 0.2, 1) both, hola-lift 0.65s cubic-bezier(0.5, 0, 0.75, 0) 4.35s forwards;
}
.hola.is-leaving .hola-content { animation: hola-lift 0.5s cubic-bezier(0.5, 0, 0.75, 0) forwards; }
.hola-word { width: min(64vw, 280px); height: auto; overflow: visible; }
.hola-stroke {
  fill: none; stroke: var(--blanco); stroke-width: 26; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.hola-stroke-1 { animation: hola-draw 0.6s cubic-bezier(0.55, 0, 0.3, 1) 0.4s forwards; }
.hola-stroke-2 { animation: hola-draw 0.5s cubic-bezier(0.55, 0, 0.3, 1) 0.9s forwards; }
.hola-stroke-3 { animation: hola-draw 0.32s cubic-bezier(0.55, 0, 0.3, 1) 1.3s forwards; }
.hola-stroke-4 { animation: hola-draw 0.55s cubic-bezier(0.55, 0, 0.3, 1) 1.52s forwards; }
.hola-dot { fill: var(--menta); transform-box: fill-box; transform-origin: center; transform: scale(0); animation: hola-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 2.05s forwards; }
.hola-name, .hola-message { margin: 0; opacity: 0; }
.hola-name { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; animation: hola-rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 2.2s forwards; }
.hola-message { max-width: 300px; font-size: 15.5px; line-height: 1.5; color: rgba(255, 255, 255, 0.82); animation: hola-rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 2.5s forwards; }
.hola-tap { position: absolute; bottom: calc(34px + env(safe-area-inset-bottom)); margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.55); opacity: 0; animation: hola-fade 0.8s ease 3.1s forwards; }

/* La app entra enfocándose justo cuando el saludo se disuelve */
body.has-hola .main { animation: hola-app 1s cubic-bezier(0.2, 0.8, 0.2, 1) 4.7s both; }
body.has-hola .top, body.has-hola .tabs, body.has-hola .side { animation: hola-fade 0.9s ease 4.8s both; }
body.has-hola.hola-skip .main { animation-delay: 0.3s; }
body.has-hola.hola-skip .top, body.has-hola.hola-skip .tabs, body.has-hola.hola-skip .side { animation-delay: 0.4s; }

@keyframes hola-orb-in { from { opacity: 0; transform: scale(0.6); } to { opacity: var(--o); transform: none; } }
@keyframes hola-drift-a { to { transform: translate(10vmax, -5vmax) scale(1.1); } }
@keyframes hola-drift-b { to { transform: translate(-9vmax, 7vmax) scale(0.92); } }
@keyframes hola-breathe { from { transform: scale(0.94); } to { transform: none; } }
@keyframes hola-draw { to { stroke-dashoffset: 0; } }
@keyframes hola-pop { to { transform: scale(1); } }
@keyframes hola-rise { from { opacity: 0; transform: translateY(10px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes hola-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hola-lift { to { opacity: 0; transform: translateY(-18px) scale(1.03); filter: blur(10px); } }
@keyframes hola-out { 0% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes hola-app { from { opacity: 0; transform: scale(0.965); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  .hola { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Tarjeta billetera del inicio ---------- */

.wallet {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 22px 20px 20px;
  background: var(--marca);
  color: var(--blanco);
  border-radius: 26px;
}
.wallet-orb { position: absolute; z-index: -1; border-radius: 50%; }
.wallet-orb-1 { width: 260px; height: 260px; right: -90px; top: -120px; background: #3A58F4; }
.wallet-orb-2 { width: 160px; height: 160px; right: -40px; top: -62px; background: #4B67F6; }
.wallet-orb-3 { width: 130px; height: 130px; left: -55px; bottom: -70px; background: #2541DC; }

.wallet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wallet-label { font-size: 13.5px; color: #C9D3FF; }
.wallet-eye {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: #4B67F6; color: var(--blanco);
  cursor: pointer;
}
.wallet-eye .eye-off { display: none; }
.amounts-hidden .wallet-eye .eye-on { display: none; }
.amounts-hidden .wallet-eye .eye-off { display: grid; }
.wallet-eye > span { display: grid; }

.wallet-amount {
  margin-top: 6px;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(38px, 11.5vw, 54px);
  letter-spacing: -0.04em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.wallet-meta { margin-top: 4px; font-size: 13px; color: #C9D3FF; }

.wallet-flow {
  display: flex; gap: 3px;
  height: 10px; margin-top: 24px;
  border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}
.wallet-in { background: var(--menta); }
.wallet-out { background: #FF8A8D; }

.wallet-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.wallet-legend > div { display: grid; gap: 1px; }
.wallet-legend-end { text-align: right; justify-items: end; }
.wallet-legend span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #C9D3FF; }
.wallet-legend strong {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(15px, 4.4vw, 19px);
  font-variant-numeric: tabular-nums;
}
.wallet-in-text { color: var(--menta); }

/* Ahorro que no se toca: una tarjeta oscura guardada detrás de la billetera */
.wallet-stack.has-vault .wallet { position: relative; z-index: 2; }
.wallet-vault {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  margin: -22px 10px 0;
  padding: 32px 14px 12px;
  border-radius: 0 0 18px 18px;
  background: var(--tinta);
  color: var(--blanco);
  text-decoration: none;
  transition: transform 0.15s ease;
}
.wallet-vault:active { transform: translateY(2px); }
.wallet-vault > .icon { color: #C9D3FF; }
.wallet-vault-ico {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(46, 230, 166, 0.18); color: var(--menta);
}
.wallet-vault-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.wallet-vault-text span { font-size: 12px; color: #C9D3FF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-vault-text strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tag-reserved { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; background: var(--marca-suave); color: var(--marca); font-size: 11.5px; font-weight: 600; vertical-align: 1px; }
.switch-card { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio-s); }
.switch-card strong { display: inline-flex; align-items: center; gap: 6px; }
.wallet-out-text { color: #FFB3B5; }

.amounts-hidden [data-amount] { filter: blur(9px); user-select: none; }

/* ---------- Resumen del inicio: fondo cobalto, vidrio y hoja blanca ---------- */

/* El fondo detrás de la barra de estado del iPhone (y al estirar arriba) es el mismo cobalto, sin franja borrosa */
html.home-root { background: #2B4BF2; transition: background-color 1.1s ease; }
html.home-root.is-savings-root { background: #141C4A; }
/* Ya abajo en la página, el fondo de atrás es blanco: al estirar al final no se asoma el azul */
html.home-root.is-low, html.home-root.is-low.is-savings-root { background: var(--blanco); transition: none; }
@media (min-width: 960px) { html.home-root, html.home-root.is-savings-root { background: var(--papel); } }
body.is-home { background: transparent; }
/* Franja sólida detrás de la hora y la batería: el iPhone ya no difumina el contenido que pasa por debajo */
body.is-home::before {
  content: ''; position: fixed; z-index: 30; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px);
  background: #2B4BF2; transition: background-color 1.1s ease;
}
body.is-home.is-savings::before { background: #141C4A; }
.is-home .main { padding-bottom: 0; }
.aurora { position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 780px; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 60% at 90% 38%, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 60%), linear-gradient(180deg, #2B4BF2 0%, #2B4BF2 14%, #2645E8 55%, #1F3CD2 100%); }
/* En Ahorros el fondo pasa a la bóveda: el tinta de la marca con una luz menta tenue */
.aurora::before { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease;
  background: radial-gradient(80% 55% at 85% 15%, rgba(46, 230, 166, 0.22), rgba(46, 230, 166, 0) 60%), linear-gradient(180deg, #141C4A 0%, #141C4A 14%, #10184A 55%, #0B1135 100%); }
.is-savings .aurora::before { opacity: 1; }
.aurora-glow { display: none; }
.aurora-glow, .aurora-deep { position: absolute; border-radius: 50%; }
.aurora-glow { width: 440px; height: 440px; top: -80px; right: -190px; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0)); }
.aurora-deep { width: 340px; height: 340px; top: 170px; left: -160px; background: radial-gradient(closest-side, rgba(8, 16, 90, 0.35), rgba(8, 16, 90, 0)); animation-delay: -6s; }
@keyframes aurora-drift { to { translate: 24px 16px; scale: 1.08; } }
@media (min-width: 960px) { .aurora { left: 260px; } }

/* Arriba no hay barra fija: se va con el fondo al hacer scroll */
.is-home .top { position: relative; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.is-home .top .brand { color: var(--blanco); }
.is-home .top .space-chip, .is-home .top-help, .is-home .top-bell {
  background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); color: var(--blanco);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.is-home .top .space-chip .icon:first-child, .is-home .top .space-chip.is-shared .icon:first-child { color: var(--menta); }
.is-home .top .space-chip .icon:last-child { color: rgba(255, 255, 255, 0.7); }
.is-home .top-bell.has-unread::after { box-shadow: 0 0 0 2px #2B4BF2; }
.is-home .hello { color: var(--blanco); }

.glass {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.home-sheet {
  position: relative; min-height: 62vh;
  margin: 24px -16px 0; padding: 10px 16px calc(108px + env(safe-area-inset-bottom));
  background: var(--blanco);
  border-radius: 30px 30px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.9), 0 -12px 30px rgba(13, 19, 48, 0.18);
}
.home-sheet::before { content: ''; display: block; width: 36px; height: 4px; margin: 0 auto 14px; border-radius: 9px; background: var(--linea); }
@media (min-width: 960px) { .is-home .main { padding-bottom: 64px; } .home-sheet { margin: 28px 0 0; padding: 12px 24px 24px; border-radius: 30px; } }

.hero { position: relative; padding: 8px 2px 4px; color: var(--blanco); touch-action: pan-y; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-label { position: relative; display: grid; min-width: 0; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.82); }
.hero-label > span { grid-area: 1 / 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hero-label-alt, .is-savings .hero-label-main { opacity: 0; transform: translateY(6px); }
.is-savings .hero-label-alt { opacity: 1; transform: none; }

.hero-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 6px; border-radius: 99px; color: var(--blanco); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.hero-chip-ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blanco); color: var(--marca); transition: transform 0.6s cubic-bezier(0.3, 1.6, 0.4, 1); }
.hero-chip-ico > span { display: grid; }
.hero-chip-alt, .is-savings .hero-chip-main { display: none !important; }
.is-savings .hero-chip-alt { display: inline !important; }
.is-savings .hero-chip-ico > .hero-chip-alt { display: grid !important; }
.is-savings .hero-chip-ico { transform: rotate(-12deg) scale(1.06); background: var(--blanco); color: var(--tinta); }

/* Ahorros: el texto sigue blanco y el total va en menta */
.is-savings .hero-pane-alt .hero-amount { color: var(--menta); }
.is-savings.is-home .top-bell.has-unread::after { box-shadow: 0 0 0 2px #141C4A; }
.hero-chip:active, .hero-eye:active { transform: scale(0.96); }
.hero-eye { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; color: var(--blanco); cursor: pointer; }
.hero-eye > span { display: grid; }
.hero-eye .eye-off, .amounts-hidden .hero-eye .eye-on { display: none; }
.amounts-hidden .hero-eye .eye-off { display: grid; }

.hero-stage { display: grid; margin-top: 4px; }
.hero-pane { grid-area: 1 / 1; min-width: 0; transition: opacity 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.55s ease; }
.hero-pane-alt, .is-savings .hero-pane-main { opacity: 0; filter: blur(8px); pointer-events: none; }
.hero-pane-alt { transform: translateY(24px) scale(0.97); }
.is-savings .hero-pane-main { transform: translateY(-24px) scale(0.97); }
.is-savings .hero-pane-alt { opacity: 1; filter: none; transform: none; pointer-events: auto; }

.hero-amount {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(40px, 12.5vw, 56px); line-height: 1.1; letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}

.hero-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.hero-stat { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.hero-stat > span:last-child { display: grid; min-width: 0; }
.hero-stat-label { font-size: 12.5px; color: rgba(255, 255, 255, 0.72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-stat strong { font-family: var(--display); font-weight: 600; font-size: clamp(15px, 4.5vw, 18px); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-stat strong.is-in { color: var(--menta); }
.hero-stat strong.is-out { color: #FFB3B5; }
.hero-dot { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--blanco); }
.hero-dot.is-in { color: var(--menta); }
.hero-dot.is-out { color: #FFB3B5; }

.hero-dots { display: flex; justify-content: center; gap: 5px; margin-top: 16px; }
.hero-dots span { width: 6px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.35); transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.4s ease; }
.hero-dots span:first-child, .is-savings .hero-dots span:last-child { width: 18px; background: var(--blanco); }
.is-savings .hero-dots span:first-child { width: 6px; background: rgba(255, 255, 255, 0.35); }

/* Inicio: los pagos de los próximos días van arriba de los movimientos, punteados porque aún no salen */
.list-next { border-style: dashed; border-color: var(--linea-fuerte); background: #FAFBFE; }
.list-next .mov-amount { color: var(--tinta-2); font-weight: 500; }
.next-badge {
  display: inline-block; margin-left: 7px; padding: 2px 8px; border-radius: 99px;
  background: var(--marca-suave); color: var(--marca-osc);
  font-size: 11px; font-weight: 600; vertical-align: 2px; white-space: nowrap;
}
.home-sheet .day { margin-top: 14px; }
.home-sheet .type-head + .day { margin-top: 0; }

/* ---------- Presupuestos: tarjetas de vidrio en U con líquido difuminado ---------- */

.bcards {
  display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 10px;
  overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 4px 16px 14px;
}
.bcards::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .bcards { margin: 0; padding: 4px 0 14px; } }

.bcard {
  --liq: rgba(43, 75, 242, 0.7);
  --ink: var(--marca-osc);
  position: relative; isolation: isolate; overflow: hidden; contain: paint;
  display: block; height: 196px;
  /* Techo con esquinas suaves y fondo redondo: la U de Ualets */
  border-radius: 22px 22px 50% 50% / 22px 22px 36% 36%;
  background: var(--papel);
  box-shadow: 0 0 0 1px rgba(13, 19, 48, 0.06), 0 10px 24px rgba(31, 56, 201, 0.1);
  color: var(--tinta);
  text-decoration: none;
}
.bcard.is-fast { --liq: rgba(245, 158, 11, 0.75); --ink: #92510A; }
.bcard.is-over { --liq: rgba(229, 72, 77, 0.75); --ink: #C9262C; }
.bcard:focus-visible { outline: 2px solid var(--marca); outline-offset: 3px; }
.bcard-liq {
  position: absolute; z-index: -2; left: -25%; right: -25%; bottom: 0;
  height: var(--lv);
  border-radius: 40% 45% 0 0;
  background: var(--liq);
  filter: blur(13px);
  transition: height 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: bcard-ola 6s ease-in-out infinite alternate;
  will-change: transform;
}
.bcards.is-pending .bcard-liq, .bcards.is-offscreen .bcard-liq { animation-play-state: paused; }
@keyframes bcard-ola { from { transform: translateX(-6%) rotate(-2deg); } to { transform: translateX(6%) rotate(2deg); } }
/* El vidrio va encima del líquido */
.bcard::after {
  content: ''; position: absolute; z-index: -1; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 #fff;
}
/* Antes de verse, el líquido espera abajo; sube cuando la sección aparece */
.is-pending .bcard-liq { height: 0; }

.bcard-inner {
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  height: 100%; padding: 14px 10px 34px; text-align: center;
}
.bcard-ico {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.75); border: 1px solid #fff; color: var(--marca);
}
.bcard-bottom { display: grid; gap: 1px; min-width: 0; max-width: 100%; }
.bcard-name { font-size: 12px; font-weight: 500; color: #1F2A5C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard-left {
  font-family: var(--display); font-weight: 600;
  font-size: 22px; letter-spacing: -0.03em; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.bcard.is-over .bcard-left { color: #C9262C; }
.bcard-status { font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Títulos grandes de las secciones del inicio, con el punto del logo */
.type-head { align-items: center; }
.block-head .type-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 8vw, 32px); letter-spacing: -0.04em; line-height: 1.1;
  color: var(--tinta);
}
.type-dot { display: inline-block; width: 0.2em; height: 0.2em; margin-left: 0.06em; border-radius: 50%; background: var(--menta); }

/* ---------- Top gastos ---------- */

.top-card { display: grid; gap: 4px; padding: 8px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; }
.top-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: var(--tinta); text-decoration: none; }
.top-item:hover { background: var(--hover); }
.top-ico {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px;
  background: color-mix(in srgb, var(--c) 12%, white); color: var(--c);
}
.top-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.top-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.top-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row strong { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Desplegable de categorías ---------- */

.select-trigger { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.select-trigger .opt-ico { width: 30px; height: 30px; border-radius: 9px; }
.select-trigger .opt-text { flex: 1; min-width: 0; }
.select-trigger .opt-text small { display: none; }
.select-chevron { display: grid; color: var(--tinta-2); }

.sheet-search { margin-bottom: 10px; }
.sheet-list { display: grid; align-content: start; gap: 2px; height: min(56vh, 460px); overflow-y: auto; margin: 0 -6px; padding: 0 6px 4px; }
.sheet-empty { padding: 16px 4px; text-align: center; font-size: 14px; color: var(--tinta-2); }

.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 9px 10px;
  border: 0; border-radius: 12px; background: none;
  color: var(--tinta); text-align: left; font-size: 15px;
  cursor: pointer;
}
.opt:hover, .opt:focus-visible { background: var(--hover); outline: none; }
.opt:focus-visible { box-shadow: inset 0 0 0 2px var(--marca); }
.opt.is-selected { background: var(--marca-suave); font-weight: 600; }
.opt-child { padding-left: 30px; }
.opt-ico {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--c) 12%, white); color: var(--c);
}
.opt-text { display: grid; min-width: 0; }
.opt-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-text small { font-size: 12px; font-weight: 400; color: var(--tinta-2); }
.opt-check { margin-left: auto; display: grid; color: var(--marca); }

/* ---------- Recurrentes, pendientes y calendario ---------- */

.notice {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin: 14px 0 0;
  background: #FFF4E0; border: 1px solid #F8DDB0; border-radius: 16px;
  color: #92400E; text-decoration: none;
}
.notice-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--alerta); color: var(--blanco); }
.notice-text { flex: 1; min-width: 0; display: grid; }
.notice-text strong { font-size: 14.5px; font-weight: 600; }
.notice-text span { font-size: 12.5px; color: #B45309; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-go { font-size: 13.5px; font-weight: 600; }

.block-note { margin: -4px 2px 10px; font-size: 13px; color: var(--tinta-2); }
.block-note strong { color: var(--tinta); font-variant-numeric: tabular-nums; }

.rule-side { display: grid; justify-items: end; gap: 3px; }
.rule-chip {
  padding: 2px 8px; border-radius: 99px;
  background: var(--papel); color: var(--tinta-2);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.rule-chip.is-soon { background: var(--marca-suave); color: var(--marca-osc); }
.rule-chip.is-late { background: #FFE8E8; color: #B4232A; }
.rule-chip.is-off { background: #EEF1F8; color: #8A92AD; }
.mov-amount.is-planned { color: var(--tinta-2); font-weight: 500; }

.settings-card { display: grid; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--linea); }
.switch-row > span { display: grid; gap: 2px; }
.switch-row strong { font-size: 14.5px; font-weight: 600; }
.switch-row > span > span { font-size: 12.5px; color: var(--tinta-2); }
.input-compact { width: auto; min-height: 40px; padding: 8px 34px 8px 12px; font-size: 14px; flex: none; }

.switch {
  appearance: none; -webkit-appearance: none;
  flex: none; position: relative;
  width: 46px; height: 28px; margin: 0;
  border-radius: 99px; background: var(--linea-fuerte);
  cursor: pointer; transition: background 0.15s ease;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--blanco); box-shadow: 0 1px 3px rgba(13, 19, 48, 0.25);
  transition: transform 0.15s ease;
}
.switch:checked { background: var(--marca); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; }

.pending-card { display: grid; gap: 12px; padding: 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); }
.pending-head { display: flex; align-items: center; gap: 12px; }
.pending-form { display: flex; align-items: center; gap: 10px; }
.pending-amount {
  flex: 1; display: flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; border: 1px solid var(--linea-fuerte); border-radius: var(--radio-s);
}
.pending-amount:focus-within { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.pending-amount span { color: var(--tinta-2); font-family: var(--display); font-size: 18px; }
.pending-amount input {
  flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 0;
  font-family: var(--display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pending-skip { margin: -4px 0 0; }
.pending-form-wallet { flex-wrap: wrap; }
.pending-form-wallet .grid-2, .pending-account { flex: 1 1 100%; }
.pending-form-wallet .field { display: grid; gap: 6px; margin: 0; }
.pending-source { display: inline-flex; align-items: center; gap: 4px; }

/* Por confirmar en el inicio: cada pago se confirma con un toque */
.confirm-card {
  display: grid; gap: 10px;
  margin: 14px 0 0; padding: 14px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(13, 19, 48, 0.06);
}
.confirm-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 0; }
.confirm-head h2 { flex: 1; font-family: var(--display); font-size: 16px; font-weight: 700; }
.confirm-head a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.confirm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--alerta); box-shadow: 0 0 0 4px #FFF1D6; }
.confirm-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--papel); }
.confirm-item .ico { flex: none; }
.confirm-item form { margin: 0; flex: none; }
.confirm-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.confirm-text strong { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirm-text span { font-size: 12.5px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirm-amount { flex: none; font-family: var(--display); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.confirm-button {
  flex: none; display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: var(--marca); color: var(--blanco);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.confirm-button:hover { background: var(--marca-osc); }
.confirm-button:active { transform: scale(0.92); }
.confirm-button-soft { background: var(--marca-suave); color: var(--marca); }
.confirm-button-soft:hover { background: var(--marca-suave); color: var(--marca-osc); }
.confirm-note { margin: 0; padding: 0 2px; font-size: 12.5px; color: var(--tinta-2); }

/* Atajos del iPhone */
.sc-sub { margin: -8px 0 16px; color: var(--tinta-2); font-size: 14px; }
.sc-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc-tile { display: grid; gap: 10px; align-content: start; padding: 14px; border-radius: 20px; background: var(--blanco); border: 1px solid var(--linea); color: var(--tinta); text-decoration: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.sc-tile.is-active { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.sc-tile strong { font-size: 15px; }
.sc-tile small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--tinta-2); }
.sc-tile-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--tinta); color: var(--blanco); }
.sc-tile-ico.is-mint { background: var(--menta); color: var(--tinta); }
.sc-chip { display: inline-flex; align-items: center; gap: 4px; width: max-content; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--papel); color: var(--tinta-2); }
.sc-chip.is-ok { background: #DDFBF0; color: #07714E; }
.sc-chip.is-error { background: #FFE8E8; color: #B4232A; }
.sc-panel { display: grid; gap: 10px; margin-top: 14px; }
.sc-card { display: grid; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; overflow: hidden; margin: 0; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; margin: 0; }
.sc-row + .sc-row { border-top: 1px solid var(--linea); }
.sc-row > span, .sc-row > label { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.sc-row small { font-size: 12.5px; color: var(--tinta-2); }
.sc-row small.sc-error { color: #B4232A; }
.sc-row form { margin: 0; flex: none; }
.sc-row .input-compact { max-width: 52%; }
.sc-h { margin: 6px 2px 0; font-family: var(--display); font-size: 15px; font-weight: 700; }
.sc-install { display: flex; align-items: center; gap: 12px; padding: 14px; }
.sc-install p { flex: 1; margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--tinta-2); }
.sc-install .btn { flex: none; }
.sc-start { display: grid; gap: 12px; padding: 16px; }
.sc-start p { display: grid; gap: 4px; margin: 0; }
.sc-start p span { font-size: 13.5px; line-height: 1.45; color: var(--tinta-2); }
.sc-setup { border-radius: 20px; background: var(--blanco); border: 1px solid var(--linea); }
.sc-setup > summary { display: flex; align-items: center; gap: 8px; padding: 14px; font-size: 14.5px; font-weight: 600; cursor: pointer; list-style: none; }
.sc-setup > summary::-webkit-details-marker { display: none; }
.sc-setup > summary .icon:first-child { color: var(--marca); }
.sc-setup > summary .icon:last-child { margin-left: auto; color: var(--tinta-2); transition: transform 0.2s ease; }
.sc-setup[open] > summary .icon:last-child { transform: rotate(180deg); }
.sc-setup .wallet-steps { padding-top: 0; }
.wallet-steps { list-style: none; margin: 0; padding: 14px; display: grid; gap: 16px; }
.wallet-steps li { display: flex; gap: 12px; }
.wallet-steps li > div { flex: 1; min-width: 0; }
.wallet-steps p { margin: 2px 0 0; font-size: 14px; line-height: 1.5; }
.wallet-steps .hint { margin-top: 6px; }
.wallet-num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--marca-suave); color: var(--marca); font-size: 13px; font-weight: 700; }
.wallet-fields { display: grid; gap: 6px; margin-top: 8px; }
.wallet-fields code { padding: 6px 10px; border-radius: 10px; background: var(--papel); font-size: 13px; }
.wallet-install { margin-top: 10px; }
.sc-help > summary { cursor: pointer; padding: 4px 2px; font-size: 13.5px; font-weight: 600; color: var(--marca); list-style: none; }
.sc-help > summary::-webkit-details-marker { display: none; }
.sc-help ul { margin: 8px 0 0; padding: 14px 14px 14px 30px; display: grid; gap: 6px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 16px; font-size: 13.5px; line-height: 1.45; color: var(--tinta-2); }
.sc-key { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 14px; border-radius: 16px; background: var(--blanco); border: 1px solid var(--linea); }
.sc-key > .icon { flex: none; color: var(--marca); }
.sc-key > span { flex: 1; min-width: 0; display: grid; font-size: 12.5px; color: var(--tinta-2); }
.sc-key strong { font-size: 14px; color: var(--tinta); }
.sc-key form { margin: 0; flex: none; }
.sc-off { margin: 14px 2px 0; }
.sc-off .link-button { text-decoration: none; color: var(--peligro); font-weight: 600; }
.link-button { padding: 0; border: 0; background: none; color: var(--tinta-2); font-size: 13.5px; text-decoration: underline; cursor: pointer; }

.cal-nav { margin: 4px 0 12px; }
.cal-card { padding: 10px 8px 12px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-week span { padding: 4px 0 8px; font-size: 12px; font-weight: 600; color: var(--tinta-2); }
.cal-grid { row-gap: 4px; }
.cal-day {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 3px;
  height: 50px; padding-top: 7px; border-radius: 12px;
  color: var(--tinta); font-size: 15px; font-variant-numeric: tabular-nums; text-decoration: none;
}
.cal-day:hover { background: var(--hover); }
.cal-day.is-today > span:first-child { color: var(--marca); font-weight: 700; }
.cal-day.has-pending { background: #FFF4E0; }
.cal-day.is-selected { background: var(--marca); color: var(--blanco); }
.cal-day.is-selected > span:first-child { color: var(--blanco); font-weight: 700; }
.cal-dots { display: flex; gap: 3px; }
.cal-dots i, .cal-legend i, .state-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.cal-day.is-selected .cal-dots i { background: var(--blanco); opacity: 0.9; }
.dot-income { background: var(--ingreso); }
.dot-scheduled { background: var(--marca); }
.dot-pending { background: var(--alerta); }
.dot-paid { background: #94A3B8; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 4px 0; font-size: 12.5px; color: var(--tinta-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.state-dot { margin-right: 6px; vertical-align: 1px; }

.projection {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 4px; margin-top: 24px; padding: 18px;
  background: #141A2E; color: var(--blanco); border-radius: 20px;
}
.projection::before {
  content: ''; position: absolute; z-index: -1; width: 180px; height: 180px; right: -70px; top: -90px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.05);
}
.projection-label { font-size: 12.5px; color: #A7B0CF; }
.projection-amount { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.projection-meta { font-size: 12.5px; line-height: 1.5; color: #A7B0CF; }

/* ---------- Importar extractos ---------- */

.head-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.steps { display: flex; gap: 14px; margin: 4px 0 12px; padding: 0; list-style: none; font-size: 13px; color: var(--tinta-2); }
.steps li { display: inline-flex; align-items: center; gap: 6px; }
.steps-num {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #E7EBF7; color: var(--tinta-2); font-size: 11.5px; font-weight: 700;
}
.steps .is-current { color: var(--tinta); font-weight: 600; }
.steps .is-current .steps-num { background: var(--marca); color: var(--blanco); }
.steps .is-done .steps-num { background: var(--ingreso); color: var(--blanco); }

.dropzone {
  position: relative; display: grid; justify-items: center; gap: 4px;
  padding: 28px 16px; text-align: center;
  border: 1.5px dashed #AEBBFA; border-radius: 18px; background: #F5F7FF;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:focus-within { outline: 2px solid var(--marca); outline-offset: 2px; }
.dropzone.is-over { background: var(--marca-suave); border-color: var(--marca); }
.dropzone.has-file { background: #F0FBF6; border-color: var(--ingreso); border-style: solid; }
.dropzone-ico { color: var(--marca); }
.dropzone.has-file .dropzone-ico { color: var(--ingreso); }
.dropzone strong { font-size: 15px; }
.dropzone span:last-child { font-size: 12.5px; color: var(--tinta-2); }

.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radio-s); background: var(--marca-suave); color: var(--marca-osc); font-size: 13px; line-height: 1.45; }
.tip .icon { flex: none; margin-top: 1px; }
.tip-warn { background: #FFF4E0; color: #92400E; margin-bottom: 14px; }

.map-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.map-row + .map-row { border-top: 1px solid var(--linea); }
.map-text { flex: 1; min-width: 0; display: grid; }
.map-name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-sample { font-size: 12px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.input-compact.is-set { border-color: var(--marca); color: var(--marca-osc); font-weight: 600; }

.preview { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
.preview-title { padding: 10px 14px 0; font-size: 12.5px; color: var(--tinta-2); }
.preview-scroll { overflow-x: auto; }
.preview table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.preview th, .preview td { padding: 8px 14px; text-align: left; white-space: nowrap; border-top: 1px solid var(--linea); }
.preview th { font-weight: 600; color: var(--tinta-2); border-top: 0; }

.import-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.stat-pill { padding: 4px 10px; border-radius: 99px; background: #EEF1F8; color: var(--tinta-2); font-size: 12px; font-weight: 600; }
.stat-pill.is-new { background: var(--marca-suave); color: var(--marca-osc); }
.stat-pill.is-dup, .stat-pill.is-before { background: #FFF4E0; color: #92400E; }
.stat-pill.is-cat { background: #DDFBF0; color: #07714E; }

.import-tools { display: flex; gap: 16px; margin: 0 2px 8px; }
.import-row { display: flex; gap: 12px; padding: 12px 14px; }
.import-row + .import-row { border-top: 1px solid var(--linea); }
.import-row.is-flagged { background: #FFFBF2; }
.import-check { padding-top: 2px; }
.import-check input { width: 20px; height: 20px; accent-color: var(--marca); cursor: pointer; }
.import-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.import-top { display: flex; justify-content: space-between; gap: 10px; }
.import-name { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.import-date { font-size: 12.5px; color: var(--tinta-2); font-variant-numeric: tabular-nums; }
.import-cat { min-height: 34px; padding: 5px 30px 5px 10px; font-size: 13px; max-width: 100%; }
.import-submit { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); display: grid; gap: 6px; margin-top: 16px; padding: 12px 0 4px; background: linear-gradient(transparent, var(--papel) 30%); }
@media (min-width: 960px) { .import-submit { bottom: 0; } }

/* ---------- Metas de ahorro ---------- */

.goal-summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 14px; padding: 14px 16px;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio);
}
.goal-summary > div { display: grid; gap: 1px; }
.goal-summary-label { font-size: 12.5px; color: var(--tinta-2); }
.goal-summary strong { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.goal-summary-end { justify-items: end; font-size: 12.5px; color: var(--tinta-2); text-align: right; }


.goal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.goal-stats > div { display: grid; gap: 1px; min-width: 0; padding: 11px 12px; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio-s); }
.goal-stats span { font-size: 11.5px; color: var(--tinta-2); }
.goal-stats strong { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-stats small { font-size: 11.5px; color: var(--tinta-2); }
/* Retos */
.rc-hero { position: relative; overflow: hidden; isolation: isolate; display: grid; gap: 10px; margin-bottom: 4px; padding: 16px; border-radius: 22px; background: var(--tinta); color: var(--blanco); }
.rc-hero::before { content: ''; position: absolute; z-index: -1; right: -60px; top: -70px; width: 190px; height: 190px; border-radius: 50%; background: rgba(46, 230, 166, 0.18); }
.rc-hero small { font-size: 12.5px; color: #A7B0CF; }
.rc-hero strong { font-family: var(--display); font-size: 22px; }
.rc-weeks { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
.rc-weeks span { height: 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); }
.rc-weeks span.is-due { background: rgba(255, 201, 122, 0.55); }
.rc-weeks span.is-on { background: var(--menta); }
.rc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #C9D3FF; }
.rc-row b { color: var(--blanco); }
.rc-ok { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; color: var(--menta); font-weight: 600; }
.rc-card { display: grid; gap: 12px; margin-bottom: 4px; padding: 14px; border-radius: 20px; background: var(--blanco); border: 1px solid var(--linea); }
.rc-card form { margin: 0; }
.rc-card-top { display: flex; align-items: center; gap: 12px; }
.rc-card-top .ico { flex: none; }
.rc-card-text { display: grid; min-width: 0; }
.rc-card-text strong { font-size: 15px; }
.rc-card-text small { font-size: 12.5px; color: var(--tinta-2); }
.rc-progress { height: 8px; border-radius: 99px; background: #EEF1F8; overflow: hidden; }
.rc-progress span { display: block; height: 100%; border-radius: 99px; background: var(--menta); }
.rc-quit { margin: 0 0 12px; text-align: right; }
.rc-quit .link-button { font-size: 12.5px; text-decoration: none; }
.streak { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 14px; border-radius: 20px; background: var(--blanco); border: 1px solid var(--linea); }
.streak > span:last-child { display: grid; gap: 1px; }
.streak strong { font-family: var(--display); font-size: 19px; }
.streak small { font-size: 12.5px; color: var(--tinta-2); }
.streak-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #FFF3D6; color: var(--alerta); }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge { display: grid; justify-items: center; gap: 6px; font-size: 11.5px; text-align: center; color: var(--tinta-2); line-height: 1.3; }
.badge > span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--marca-suave); color: var(--marca); }
.badge.is-off > span { background: #EEF1F8; color: #B8BED3; }

/* Recordatorios del año */
.an-list { display: grid; gap: 8px; }
.an-item { border-radius: 18px; background: var(--blanco); border: 1px solid var(--linea); overflow: hidden; }
.an-item > summary { list-style: none; }
.an-item > summary::-webkit-details-marker { display: none; }
.an-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.an-row .ico { flex: none; }
.an-text { flex: 1; min-width: 0; display: grid; }
.an-text strong { font-size: 14.5px; }
.an-text small { font-size: 12.5px; color: var(--tinta-2); line-height: 1.35; }
.an-on { flex: none; padding: 3px 9px; border-radius: 99px; background: #DDFBF0; color: #07714E; font-size: 12px; font-weight: 600; }
.an-add { flex: none; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--linea); color: var(--marca); font-size: 12.5px; font-weight: 600; }
.an-item[open] .an-add { visibility: hidden; }
.an-form { display: grid; gap: 12px; padding: 4px 14px 14px; border-top: 1px solid var(--linea); animation: period-pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.an-form .field { margin: 0; }
.an-form > .field:first-of-type, .an-form > .hint:first-of-type { margin-top: 10px; }
.an-tip { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--marca-suave); color: var(--marca-osc); font-size: 13px; font-weight: 600; }
.an-tip[hidden] { display: none; }
.an-goal { padding: 0; }
.an-row-static { cursor: default; }
.an-row-static form { margin: 0; }
.an-new { margin-top: 12px; border-style: dashed; }
.an-icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.an-icons label { position: relative; }
.an-icons input { position: absolute; opacity: 0; }
.an-icons span { display: grid; place-items: center; height: 42px; border-radius: 12px; border: 1px solid var(--linea); color: var(--tinta-2); cursor: pointer; }
.an-icons input:checked + span { border-color: var(--marca); background: var(--marca-suave); color: var(--marca); }
.an-icons input:focus-visible + span { outline: 2px solid var(--marca); outline-offset: 2px; }
.an-off { margin: 0; padding: 0 14px 14px; text-align: center; }
.an-off .link-button { color: var(--peligro); font-weight: 600; text-decoration: none; }

/* Presupuestos sugeridos */
.sg { margin-top: 16px; }
.sg > summary { list-style: none; }
.sg > summary::-webkit-details-marker { display: none; }
.sg-toggle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--blanco); border: 1px solid var(--linea); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sg-toggle:hover { border-color: var(--linea-fuerte); }
.sg-toggle-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--marca-suave); color: var(--marca); }
.sg-toggle-text { flex: 1; min-width: 0; display: grid; }
.sg-toggle-text strong { font-size: 14.5px; }
.sg-toggle-text small { font-size: 12.5px; color: var(--tinta-2); }
.sg-toggle > .icon:last-child { flex: none; color: var(--tinta-2); transition: transform 0.2s ease; }
.sg[open] .sg-toggle > .icon:last-child { transform: rotate(180deg); }
.sg[open] > :not(summary) { animation: period-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.sg-sub { margin: 12px 2px 10px; font-size: 13px; line-height: 1.45; color: var(--tinta-2); }
.sg-list { display: grid; gap: 10px; }
.sg-card { display: grid; gap: 10px; padding: 14px; border-radius: 20px; background: var(--blanco); border: 1px solid var(--linea); }
.sg-top { display: flex; align-items: center; gap: 12px; }
.sg-top .ico { flex: none; }
.sg-text { flex: 1; min-width: 0; display: grid; }
.sg-text strong { font-size: 15px; }
.sg-text small { font-size: 12.5px; color: var(--tinta-2); }
.sg-reason { flex: none; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.sg-reason.is-ant { background: #FFF3D6; color: #92400E; }
.sg-reason.is-up { background: #FFE8E8; color: #B4232A; }
.sg-reason.is-rep { background: #EFEAFF; color: #5B3FD6; }
.sg-reason.is-big { background: #DDFBF0; color: #07714E; }
.sg-why { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--tinta-2); }
.sg-actions { display: flex; gap: 8px; }
.sg-actions form { margin: 0; }
.sg-yes { flex: 1; }
.sg-no { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--linea); background: var(--blanco); color: var(--tinta-2); cursor: pointer; }
.sg-edit { justify-self: center; font-size: 13px; font-weight: 600; text-decoration: none; }
.sg-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--linea); color: var(--tinta); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.sg-pill .icon { color: var(--marca); }
.budget-hero .bcard { height: 210px; pointer-events: none; }
.budget-hero .bcard-inner { padding-bottom: 46px; }
.budget-hero .bcard-left { font-size: clamp(30px, 9vw, 40px); }
.budget-hero .bcard-name { font-size: 13.5px; }
.budget-hero .bcard-status { font-size: 12.5px; }
.goal-stats strong.is-over-text { color: var(--peligro); }
.goal-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 14px; }
.goal-actions .btn:only-child { grid-column: 1 / -1; }

.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; color: var(--tinta-2); cursor: pointer; }
.icon-button:hover { background: #FFE8E8; color: var(--peligro); }

.seg-link { display: block; padding: 9px 6px; border-radius: 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--tinta-2); text-decoration: none; }
.seg-link.is-active { background: var(--blanco); color: var(--tinta); box-shadow: 0 1px 3px rgba(13, 19, 48, 0.14); }
.seg-link-in.is-active { color: var(--ingreso); }

/* Celebración discreta al cumplir una meta */
.celebrate {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; padding: 14px 16px;
  background: #DDFBF0; color: #07714E; border-radius: var(--radio);
  animation: celebrate-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.celebrate > span:last-child { display: grid; font-size: 13.5px; }
.celebrate strong { font-size: 15.5px; }
.celebrate-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ingreso); color: var(--blanco); flex: none; }
.celebrate-burst { position: absolute; left: 34px; top: 34px; pointer-events: none; }
.celebrate-burst i {
  position: absolute; width: 7px; height: 7px; border-radius: 2px;
  background: var(--c, var(--marca));
  animation: confeti 0.9s ease-out 0.15s both;
}
.celebrate-burst i:nth-child(2n) { background: var(--menta); }
.celebrate-burst i:nth-child(3n) { background: var(--alerta); border-radius: 50%; }
.celebrate-burst i:nth-child(1) { --x: 60px; --y: -26px; }
.celebrate-burst i:nth-child(2) { --x: 90px; --y: 10px; }
.celebrate-burst i:nth-child(3) { --x: 40px; --y: 30px; }
.celebrate-burst i:nth-child(4) { --x: 130px; --y: -14px; }
.celebrate-burst i:nth-child(5) { --x: 170px; --y: 22px; }
.celebrate-burst i:nth-child(6) { --x: 210px; --y: -20px; }
.celebrate-burst i:nth-child(7) { --x: 250px; --y: 14px; }
.celebrate-burst i:nth-child(8) { --x: 290px; --y: -8px; }
@keyframes celebrate-in { from { transform: scale(0.96); opacity: 0; } }
@keyframes confeti {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--x), var(--y)) rotate(200deg); opacity: 0; }
}

/* ---------- Metas como bolsillos de color ---------- */

.pcards {
  display: grid; grid-auto-flow: column; grid-auto-columns: 160px; gap: 10px;
  overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 0 16px 2px;
}
.pcards::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .pcards { margin: 0; padding: 0 0 2px; } }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }

.pcard {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  height: 156px; padding: 13px;
  border-radius: 20px;
  /* Un poco más oscuro que el color de la meta para que el texto blanco se lea bien */
  background: color-mix(in srgb, var(--c) 82%, #0D1330);
  color: var(--blanco);
  text-decoration: none;
}
.pcard:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }
.pcard-orb {
  position: absolute; z-index: -1;
  width: 120px; height: 120px; right: -42px; top: -48px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.16);
}
.pcard::after {
  content: ''; position: absolute; z-index: -1;
  width: 90px; height: 90px; left: -40px; bottom: -50px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.08);
}
.pcard-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pcard-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, 0.22); }
.pcard-status { padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.22); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.pcard-bottom { display: grid; gap: 2px; min-width: 0; }
.pcard-name { font-size: 12px; opacity: 0.92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-saved {
  font-family: var(--display); font-weight: 700;
  font-size: 24px; letter-spacing: -0.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.pcard-bar { display: block; height: 6px; margin-top: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.pcard-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--blanco); }
.pcard-meta { margin-top: 3px; font-size: 11px; opacity: 0.92; font-variant-numeric: tabular-nums; }
.pcard.is-done .pcard-status { background: var(--blanco); color: color-mix(in srgb, var(--c) 70%, #0D1330); }

.goal-hero .pcard, .pcard-large { height: 210px; padding: 18px; border-radius: 24px; }
.pcard-large .pcard-ico { width: 40px; height: 40px; border-radius: 12px; }
.pcard-large .pcard-orb { width: 200px; height: 200px; right: -70px; top: -90px; }
.pcard-large .pcard-name { font-size: 13.5px; }
.pcard-large .pcard-saved { font-size: clamp(30px, 9vw, 40px); }
.pcard-large .pcard-bar { height: 8px; margin-top: 10px; }
.pcard-large .pcard-meta { font-size: 12.5px; }

/* ---------- Deudas y tarjetas ---------- */

.wallet-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.debt-summary, .debt-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 2px; margin-bottom: 14px; padding: 18px;
  background: #141A2E; color: var(--blanco); border-radius: 22px;
}
.debt-summary::before, .debt-hero::before {
  content: ''; position: absolute; z-index: -1; width: 190px; height: 190px; right: -70px; top: -95px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.05);
}
.debt-summary-label, .debt-hero-label { font-size: 12.5px; color: #A7B0CF; }
.debt-summary > strong, .debt-hero > strong {
  font-family: var(--display); font-weight: 700; font-size: clamp(30px, 9vw, 40px);
  letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.debt-summary-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: #A7B0CF; }
.debt-summary-row b { color: var(--blanco); font-weight: 600; font-variant-numeric: tabular-nums; }
.debt-summary-row b.is-warm { color: #FCD9A0; }
.debt-hero-meta { font-size: 12.5px; color: #A7B0CF; }
.debt-hero .debt-bar { background: rgba(255, 255, 255, 0.14); margin-top: 14px; }
.debt-hero .debt-foot { color: #A7B0CF; }
.debt-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-top: 14px; }
.debt-facts > span { display: grid; gap: 1px; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); }
.debt-facts small { font-size: 11px; color: #A7B0CF; }
.debt-facts b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.debt-card { display: grid; gap: 8px; padding: 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); color: var(--tinta); text-decoration: none; }
.debt-card:hover { border-color: var(--linea-fuerte); }
.debt-head { display: flex; align-items: center; gap: 12px; }
.debt-side { display: grid; justify-items: end; text-align: right; }
.debt-side strong { font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.debt-side span { font-size: 11.5px; color: var(--tinta-2); white-space: nowrap; }
.debt-bar { height: 7px; }
.debt-bar-lg { height: 10px; }
.debt-foot { font-size: 12px; color: var(--tinta-2); }

.input-money, .input-suffix { position: relative; }
.input-money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tinta-2); pointer-events: none; }
.input-money .input { padding-left: 30px; font-variant-numeric: tabular-nums; }
.input-suffix > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--tinta-2); pointer-events: none; }
.input-suffix .input { padding-right: 34px; }

.split-card { display: grid; gap: 6px; padding: 12px 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio-s); }
.split-card > span { display: flex; justify-content: space-between; font-size: 14px; }
.split-card b { font-weight: 600; font-variant-numeric: tabular-nums; }
.split-card b.is-cost { color: var(--peligro); }
.projection-amount-sm { font-size: 22px; }

/* ---------- Patrimonio ---------- */

.wallet-networth {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 5px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.14);
  color: var(--blanco); font-size: 12.5px; text-decoration: none;
}
.wallet-networth strong { font-variant-numeric: tabular-nums; }

.networth-hero { margin-bottom: 14px; }
.networth-change {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  padding: 3px 10px; border-radius: 99px;
  background: rgba(46, 230, 166, 0.18); color: #9EF0CF;
  font-size: 12.5px; font-weight: 600;
}
.networth-change.is-down { background: rgba(255, 138, 141, 0.2); color: #FFC7C9; }

.chart-card { padding: 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.chart-head h2 { font-family: var(--display); font-weight: 700; font-size: 17px; }
.chart-head .small { margin: 0; }
.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart-grid { stroke: #EEF1F8; stroke-width: 1; }
.chart-zero { stroke: #CDD3E5; stroke-width: 1; stroke-dasharray: 3 3; }
.chart-axis { fill: #8A92AD; font-size: 10px; font-family: var(--body); font-variant-numeric: tabular-nums; }
.chart-area { fill: var(--marca); opacity: 0.08; }
.chart-line { fill: none; stroke: var(--marca); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-cross { stroke: #AEB6CF; stroke-width: 1; stroke-dasharray: 3 3; }
.chart-dot { fill: var(--marca); stroke: var(--blanco); stroke-width: 2; }
.chart-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 12px));
  padding: 6px 10px; border-radius: 10px;
  background: var(--tinta); color: var(--blanco);
  font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--marca); font-weight: 600; font-size: 13px; }
.chart-table table { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 7px 4px; text-align: right; border-top: 1px solid var(--linea); }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th { color: var(--tinta-2); font-weight: 600; font-size: 12px; border-top: 0; }

.block-total { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.block-total.is-owe { color: #B4232A; }
.mov-add .mov-name { color: var(--marca); font-weight: 600; }

.asset-hero { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; }
.asset-hero .ico { width: 48px; height: 48px; }
.asset-hero-text { display: grid; }
.asset-hero-text .small { margin: 0; }
.asset-hero strong { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.asset-update { margin-top: 18px; padding: 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; gap: 14px; }

/* ---------- Hogar compartido ---------- */

.top { gap: 10px; }
.space-chip {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 52vw;
  margin-left: auto; padding: 7px 10px 7px 9px;
  border: 1px solid var(--linea); border-radius: 99px; background: var(--blanco);
  color: var(--tinta); font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.space-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-chip .icon:first-child { color: var(--marca); }
.space-chip.is-shared .icon:first-child { color: var(--ingreso); }
.space-chip .icon:last-child { color: var(--tinta-2); }
.space-chip-side { display: flex; max-width: none; margin: 18px 0 0; }

.avatar {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c, var(--marca)); color: var(--blanco);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
}
.avatar-lg { width: 40px; height: 40px; font-size: 13.5px; }

.household-strip {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 16px;
  color: var(--tinta); text-decoration: none;
}
.household-strip > .icon { color: var(--tinta-2); flex: none; }
.household-strip-text { flex: 1; min-width: 0; display: grid; }
.household-strip-text strong { font-size: 14.5px; font-weight: 600; }
.household-strip-text span { font-size: 12.5px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.household-strip-amount { font-size: 15.5px; font-variant-numeric: tabular-nums; }

.household-balance { gap: 8px; }
.balance-line { display: flex; align-items: center; gap: 10px; }
.balance-text { flex: 1; font-size: 14.5px; }
.balance-line strong { font-family: var(--display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.balance-zero { font-family: var(--display); font-size: 22px; font-weight: 700; }

.settle-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); font-size: 14px; }
.member-row form { margin: 0; }

.invite-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 12px; padding: 14px; background: #F0FBF6; border: 1px solid #BFEBD8; border-radius: var(--radio); }
.invite-title { font-size: 14.5px; font-weight: 600; color: #07714E; }
.invite-link { padding: 10px 12px; border: 1px dashed #8FD9B9; border-radius: 10px; background: var(--blanco); font-size: 13px; word-break: break-all; overflow-wrap: anywhere; color: var(--tinta); }
.invite-actions { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; }
.invite-actions .btn { min-width: 0; padding-left: 10px; padding-right: 10px; }
.btn-whatsapp { background: #128C4B; color: var(--blanco); }
.btn-whatsapp:hover { background: #0E733D; }

.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; }

.space-row { margin: 0; }
.space-row + .space-row { border-top: 1px solid var(--linea); }
.space-button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--tinta); }
.space-button:hover { background: var(--hover); }
.space-row.is-current .space-button { background: var(--marca-suave); }
.space-check { color: var(--marca); display: grid; }

.split > legend { float: left; width: 100%; margin-bottom: 10px; }
.split > legend + * { clear: both; }
.split { padding: 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); gap: 10px; }
.split-list { display: grid; gap: 4px; }
.split-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.split-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-size: 14.5px; cursor: pointer; }
.split-who input { width: 18px; height: 18px; accent-color: var(--marca); }
.split-who.is-locked input { display: none; }
.split-equal { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.split-input { display: inline-flex; align-items: center; gap: 6px; }
.split-input .input { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }

.join-ico { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 18px; background: #DDFBF0; color: var(--ingreso); }

/* ---------- Legal y cuenta ---------- */

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--tinta-2); cursor: pointer; }
.consent input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--marca); }
.consent.has-error { color: var(--peligro); }
.auth-legal { margin-top: 18px; font-size: 12.5px; color: var(--tinta-2); }
.auth-legal a { color: inherit; }
.legal { max-width: 680px; }
.legal h2 { margin: 22px 0 6px; font-family: var(--display); font-size: 17px; font-weight: 700; }
.legal p, .legal li { font-size: 14.5px; line-height: 1.6; color: var(--tinta); }
.legal ul { margin: 6px 0; padding-left: 20px; }
.legal .muted { font-size: 13px; }
.danger-zone { margin-top: 28px; padding: 16px; border: 1px solid #F8C9CB; border-radius: var(--radio); background: #FFF7F7; display: grid; gap: 10px; }
.danger-zone h2 { font-family: var(--display); font-size: 16px; font-weight: 700; color: #B4232A; }
.danger-zone p { font-size: 13.5px; color: var(--tinta-2); }

/* ---------- Avisos ---------- */

.top-bell {
  position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blanco); border: 1px solid var(--linea); color: var(--tinta);
}
.top-bell.has-unread::after, .side-link.has-unread .icon { position: relative; }
.top-bell.has-unread::after {
  content: ''; position: absolute; top: 8px; right: 9px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--peligro); box-shadow: 0 0 0 2px var(--blanco);
}
/* En la barra de arriba el logo nunca se encoge: el que cede espacio es el nombre del espacio */
.top .brand { flex: none; white-space: nowrap; }
.top .space-chip { flex: 0 1 auto; max-width: none; margin-left: auto; }
.top .space-chip .icon { flex: none; }
.top-me { flex: none; }
.side-count {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 99px;
  background: var(--peligro); color: var(--blanco); font-size: 11.5px; font-weight: 700; text-align: center;
}
.mov.is-unread { background: #F5F7FF; }
.mov.is-unread .mov-name { font-weight: 600; }
.notice-time { flex: none; font-size: 12px; color: var(--tinta-2); font-variant-numeric: tabular-nums; }

.push-card { margin-bottom: 8px; }
.push-status { cursor: default; }
.push-prefs { display: grid; border-top: 1px solid var(--linea); }
.push-card > form.switch-row { border-top: 1px solid var(--linea); margin: 0; }
.push-ios { margin: 0 0 8px; }

/* ---------- Página pública ---------- */

body.public { background: var(--papel); }
.lp-container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.lp-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--blanco) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--linea); }
.lp-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.lp-nav-links { display: flex; align-items: center; gap: 14px; }
.lp-nav-login { color: var(--tinta-2); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.lp-nav-login:hover { color: var(--tinta); }

.lp-hero { background: var(--blanco); padding: 48px 0 56px; overflow: hidden; }
.lp-hero-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 900px) { .lp-hero-grid { grid-template-columns: 1.05fr 1fr; } .lp-hero { padding: 72px 0 84px; } }
.lp-hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(40px, 7vw, 66px); letter-spacing: -0.045em; line-height: 0.98;
}
.lp-hero h1 span { display: block; color: var(--marca); }
.lp-lead { margin-top: 18px; max-width: 34em; font-size: clamp(16px, 2vw, 18px); line-height: 1.55; color: var(--tinta-2); }
.lp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.lp-actions .btn { padding: 14px 22px; font-size: 15.5px; }
.lp-trust { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 13px; color: #8A92AD; }

.lp-preview { position: relative; height: 380px; max-width: 460px; width: 100%; justify-self: center; }
.lp-preview-wallet { position: absolute; left: 0; right: 36px; top: 0; padding: 20px; }
.lp-preview-wallet .wallet-amount { font-size: clamp(32px, 6vw, 42px); }
.lp-preview-budget { position: absolute; left: 6px; top: 196px; width: 150px; height: 178px; box-shadow: 0 0 0 5px var(--blanco), 0 18px 40px rgba(13, 19, 48, 0.18); transform: rotate(-3deg); }
.lp-preview-goal { position: absolute; left: 172px; top: 214px; width: 170px; height: 150px; box-shadow: 0 0 0 5px var(--blanco), 0 18px 40px rgba(13, 19, 48, 0.18); transform: rotate(2.5deg); }

/* Portada: insignia, chequeos y celular */
.lp-badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 6px 12px; border-radius: 99px; background: var(--marca-suave); color: var(--marca); font-size: 13px; font-weight: 600; }
.lp-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--tinta-2); }
.lp-checks li { display: inline-flex; align-items: center; gap: 6px; }
.lp-checks .icon { color: var(--ingreso); }
.lp-phone-wrap { position: relative; justify-self: center; width: min(100%, 340px); padding-top: 34px; }
.lp-phone {
  display: grid; gap: 12px;
  padding: 20px 14px 18px;
  border-radius: 40px;
  background: var(--papel);
  border: 8px solid var(--tinta);
  box-shadow: 0 30px 60px rgba(13, 19, 48, 0.22);
}
.lp-phone-hello { margin: 4px 4px 0; font-family: var(--display); font-size: 17px; font-weight: 700; }
.lp-phone .wallet { padding: 18px 16px 16px; border-radius: 22px; }
.lp-phone .wallet-amount { font-size: 32px; }
.lp-phone .wallet-legend strong { font-size: 15px; }
.lp-phone-confirm { margin: 0; padding: 12px; }
.lp-phone-confirm .confirm-head h2 { font-size: 14.5px; }
.lp-toast-demo {
  position: absolute; z-index: 2; top: 0; left: -14px; right: 18px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(13, 19, 48, 0.18);
  animation: lp-drop 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.6s both;
}
.lp-toast-demo > span:last-child { display: grid; min-width: 0; font-size: 13px; }
.lp-toast-demo small { color: var(--tinta-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-toast-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--marca); color: var(--blanco); }
@keyframes lp-drop { from { opacity: 0; transform: translateY(-18px) scale(0.96); } to { opacity: 1; transform: none; } }

/* Secciones nuevas */
.lp-sub { margin-top: 10px; max-width: 36em; font-size: 16px; line-height: 1.55; color: var(--tinta-2); }
.lp-capture { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 26px; }
.lp-feature-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lp-tag { padding: 3px 9px; border-radius: 99px; background: var(--papel); color: var(--tinta-2); font-size: 12px; font-weight: 600; }
.lp-split { display: grid; gap: 30px; align-items: center; }
@media (min-width: 900px) {
  .lp-split { grid-template-columns: 1fr 1fr; gap: 56px; }
  .lp-split-reverse > :first-child { order: 2; }
}
.lp-list { display: grid; gap: 16px; margin: 22px 0 0; padding: 0; list-style: none; }
.lp-list li { display: flex; gap: 14px; font-size: 14.5px; line-height: 1.5; color: var(--tinta-2); }
.lp-list li > span { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--marca-suave); color: var(--marca); }
.lp-list strong { display: block; margin-bottom: 2px; font-size: 15.5px; color: var(--tinta); }
.lp-visual { display: grid; gap: 12px; justify-items: stretch; max-width: 420px; width: 100%; justify-self: center; }
.lp-visual .confirm-card { margin: 0; }
.lp-visual-budgets { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: none; }
.lp-visual-budgets .bcard { width: 150px; height: 182px; }
.lp-visual-budgets .pcard { width: 150px; height: 182px; }
.lp-mail { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--blanco); border: 1px solid var(--linea); box-shadow: 0 10px 28px rgba(13, 19, 48, 0.06); }
.lp-mail > span:last-child { display: grid; gap: 2px; font-size: 14px; }
.lp-mail small { font-size: 12.5px; color: var(--ingreso); font-weight: 600; }
.lp-mail-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--tinta); color: var(--blanco); }
.lp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.lp-steps li { display: grid; gap: 6px; padding: 20px; border-radius: 20px; background: var(--blanco); border: 1px solid var(--linea); }
.lp-steps li > span { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 6px; border-radius: 50%; background: var(--marca); color: var(--blanco); font-family: var(--display); font-weight: 700; }
.lp-steps strong { font-family: var(--display); font-size: 18px; }
.lp-steps p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--tinta-2); }
.lp-faq-wrap { max-width: 720px; }
.lp-faq-wrap .help-faq { margin-top: 18px; }

.lp-section { padding: 56px 0; }
.lp-section-tight { padding-top: 0; }
.lp-eyebrow { font-size: 13px; font-weight: 700; color: var(--marca); letter-spacing: 0.01em; }
.lp-eyebrow-mint { color: var(--menta); }
.lp-title { margin-top: 6px; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.03em; line-height: 1.1; }
.lp-title-light { color: var(--blanco); }

.lp-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 26px; }
.lp-feature, .lp-value { padding: 20px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; }
.lp-feature-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--marca-suave); color: var(--marca); }
.lp-feature h3, .lp-value h3 { margin: 14px 0 6px; font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.lp-feature p, .lp-value p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--tinta-2); }

.lp-home {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 24px; align-items: center; padding: 32px;
  background: #141A2E; border-radius: 28px;
}
.lp-home::before { content: ''; position: absolute; z-index: -1; width: 320px; height: 320px; right: -110px; top: -150px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); }
@media (min-width: 820px) { .lp-home { grid-template-columns: 1.2fr 1fr; padding: 44px; } }
.lp-home-text { margin-top: 12px; font-size: 15.5px; line-height: 1.6; color: #A7B0CF; max-width: 30em; }
.lp-home-card { display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: rgba(255, 255, 255, 0.06); color: var(--blanco); }
.lp-home-card .balance-text { font-size: 15px; }
.lp-home-meta { font-size: 12.5px; color: #A7B0CF; }

.lp-values { display: grid; gap: 12px; }
@media (min-width: 720px) { .lp-values { grid-template-columns: 1fr 1fr; } }
.lp-value-blue { background: var(--marca-suave); border-color: transparent; }
.lp-value-mint { background: #DDFBF0; border-color: transparent; }
.lp-value-mint .lp-feature-ico { background: rgba(14, 159, 110, 0.14); color: var(--ingreso); }
.lp-value-blue p { color: #3A4A8A; }
.lp-value-mint p { color: #25614A; }

.lp-cta { padding: 64px 0 72px; text-align: center; background: var(--blanco); }
.lp-cta .lp-lead { margin: 10px auto 24px; }
.lp-cta .btn { padding: 14px 26px; font-size: 15.5px; }

.lp-footer { padding: 28px 0 36px; border-top: 1px solid var(--linea); background: var(--blanco); }
.lp-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.lp-footer nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13.5px; }
.lp-footer nav a { color: var(--tinta-2); text-decoration: none; }
.lp-footer nav a:hover { color: var(--tinta); }

@media (max-width: 420px) {
  .lp-preview { height: 350px; }
  .lp-preview-budget { width: 132px; height: 160px; top: 186px; }
  .lp-preview-goal { left: 146px; width: 150px; top: 200px; }
}

/* Enlaces de las pantallas de acceso: sin subrayado, en el color de marca */
.auth-panel a:not(.btn):not(.brand) { color: var(--marca); font-weight: 600; text-decoration: none; border-radius: 4px; }
.auth-panel a:not(.btn):not(.brand):hover { color: var(--marca-osc); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.auth-switch { margin: 4px 0 0; font-size: 15px; color: var(--tinta-2); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.label-row label { font-size: 13.5px; font-weight: 600; }
.label-link { font-size: 13.5px; }
.auth-panel .auth-legal { display: flex; gap: 8px; margin-top: 28px; font-size: 12.5px; color: #AEB6CF; }
.auth-panel .auth-legal a:not(.btn) { color: var(--tinta-2); font-weight: 500; }
.auth-panel .auth-links { display: block; }
.consent a:not(.btn) { font-weight: 600; }

/* Campo de contraseña con ojo */
.input-reveal { position: relative; display: block; }
.input-reveal .input { padding-right: 52px; }
.reveal-button {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: none; color: var(--tinta-2); cursor: pointer;
}
.reveal-button:hover { background: var(--hover); color: var(--tinta); }
.reveal-button:focus-visible { outline: 2px solid var(--marca); outline-offset: 0; }
.reveal-button[aria-pressed="true"] { color: var(--marca); }

/* ---------- Panel de superadministración ---------- */

.admin-body { background: var(--papel); }
.ad-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.ad-top { position: sticky; top: 0; z-index: 20; background: var(--blanco); border-bottom: 1px solid var(--linea); }
.ad-top-inner { display: flex; align-items: center; gap: 14px; height: 60px; }
.ad-top .brand { font-size: 24px; }
.ad-top-links { display: flex; align-items: center; gap: 16px; margin-left: auto; font-size: 14px; }
.ad-top-links a { color: var(--tinta-2); text-decoration: none; font-weight: 500; }
.ad-top-links form { margin: 0; }
.ad-top-links .link-button { text-decoration: none; font-weight: 600; color: var(--peligro); }
.ad-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--tinta); color: var(--blanco); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ad-main { padding-top: 24px; padding-bottom: 60px; }
.ad-head h1, .ad-profile h1 { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: -0.02em; }
.ad-tabs { display: flex; gap: 6px; margin: 16px 0 18px; overflow-x: auto; }
.ad-tabs a { padding: 8px 14px; border-radius: 99px; background: var(--blanco); border: 1px solid var(--linea); color: var(--tinta-2); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ad-tabs a.is-on { background: var(--tinta); border-color: var(--tinta); color: var(--blanco); }
.ad-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ad-kpi { display: grid; gap: 4px; padding: 16px; border-radius: 20px; background: var(--blanco); border: 1px solid var(--linea); }
.ad-kpi-label { margin-top: 6px; font-size: 13px; color: var(--tinta-2); }
.ad-kpi strong { font-family: var(--display); font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ad-kpi small { font-size: 12.5px; font-weight: 600; color: var(--ingreso); }
.ad-grid { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 900px) { .ad-grid { grid-template-columns: 1.4fr 1fr; } }
.ad-card { padding: 18px; border-radius: 20px; background: var(--blanco); border: 1px solid var(--linea); min-width: 0; }
.ad-card h2 { margin: 0 0 14px; font-family: var(--display); font-size: 16px; }
.ad-card-head { display: flex; align-items: baseline; justify-content: space-between; }
.ad-card-head a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.ad-space { margin-top: 12px; }
.ad-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; border-bottom: 1px solid var(--linea); }
.ad-bar { flex: 1; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--marca); }
.ad-bar:hover { background: var(--marca-osc); }
.ad-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--tinta-2); }
.ad-fun { display: grid; grid-template-columns: 1fr 1fr auto 44px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13.5px; }
.ad-fun-bar { height: 8px; border-radius: 99px; background: #EEF1F8; overflow: hidden; }
.ad-fun-bar span { display: block; height: 100%; border-radius: 99px; background: var(--menta); }
.ad-fun small { text-align: right; color: var(--tinta-2); }
.ad-card .sc-row { padding: 10px 0; }
.ad-card .sc-row + .sc-row { border-top: 1px solid var(--linea); }
.ad-scroll { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ad-table th { padding: 8px; border-bottom: 1px solid var(--linea); text-align: left; font-size: 12px; font-weight: 600; color: var(--tinta-2); white-space: nowrap; }
.ad-table td { padding: 10px 8px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.ad-num { font-variant-numeric: tabular-nums; }
.ad-person { display: flex; align-items: center; gap: 10px; color: var(--tinta); text-decoration: none; }
.ad-person > span:last-child { display: grid; }
.ad-person small { font-size: 12.5px; color: var(--tinta-2); }
.ad-person .avatar { --c: var(--marca); }
.ad-chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--papel); color: var(--tinta-2); white-space: nowrap; }
.ad-chip.is-ok { background: #DDFBF0; color: #07714E; }
.ad-chip.is-wait { background: #FFF3D6; color: #92400E; }
.ad-chip.is-off { background: #FFE8E8; color: #B4232A; }
.ad-search { display: flex; gap: 8px; margin-bottom: 8px; }
.ad-search .search { flex: 1; }
.ad-sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.ad-sys > div { padding: 12px; border-radius: 14px; background: var(--papel); font-size: 13px; color: var(--tinta-2); }
.ad-sys strong { display: block; margin-top: 2px; font-size: 15px; color: var(--tinta); }
.ad-sys strong.is-good { color: var(--ingreso); }
.ad-sys strong.is-bad { color: var(--peligro); }
.ad-log { max-height: 360px; overflow: auto; margin: 0; padding: 12px; border-radius: 12px; background: var(--tinta); color: #D7DCF0; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.ad-profile { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 4px; }
.ad-profile p { margin: 2px 0 0; font-size: 14px; }
.ad-profile .ad-chip { margin-left: auto; }
.ad-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.ad-facts > div { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: var(--papel); }
.ad-facts span { font-size: 12.5px; color: var(--tinta-2); }
.ad-facts strong { font-size: 15px; }
.ad-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-actions form { margin: 0; }
.ad-history { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 0; font-size: 12.5px; color: var(--tinta-2); }
.ad-unlock { display: grid; justify-items: center; gap: 10px; max-width: 380px; margin: 40px auto; text-align: center; }
.ad-unlock h1 { margin: 6px 0 0; font-family: var(--display); font-size: 24px; }
.ad-unlock p { margin: 0 0 8px; color: var(--tinta-2); font-size: 14.5px; line-height: 1.5; }
.ad-unlock .form { width: 100%; text-align: left; }
.ad-unlock-ico { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--tinta); color: var(--blanco); }
@media (max-width: 640px) { .ad-badge { display: none; } }

/* ---------- Tu mes en Ualets (historias) ---------- */

.story-body { margin: 0; background: #0B1342; overscroll-behavior: none; }
.story { position: fixed; inset: 0; overflow: hidden; color: var(--blanco); user-select: none; -webkit-user-select: none; }
.st-bars { position: absolute; z-index: 5; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 56px; display: flex; gap: 4px; }
.st-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.st-bars i { display: block; width: 0; height: 100%; background: var(--blanco); }
.st-bars span.is-done i { width: 100%; }
.st-bars span.is-now i { animation: st-fill var(--st-time, 6s) linear forwards; }
.story.is-paused .st-bars span.is-now i { animation-play-state: paused; }
@keyframes st-fill { to { width: 100%; } }
.st-close { position: absolute; z-index: 6; top: max(4px, calc(env(safe-area-inset-top) - 8px)); right: 8px; display: grid; place-items: center; width: 44px; height: 44px; color: var(--blanco); }
.st-slide { position: absolute; inset: 0; z-index: 1; isolation: isolate; overflow: hidden; display: grid; align-content: center; padding: 80px 28px 120px; opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0.35s; }
.st-slide[data-current] { opacity: 1; visibility: visible; }
.st-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); }
.st-orb-1 { width: 70vmax; height: 70vmax; left: -30vmax; top: 5vh; }
.st-orb-2 { width: 55vmax; height: 55vmax; right: -28vmax; bottom: 8vh; }
.st-intro { background: #0B1342; } .st-intro .st-orb-1 { background: #2B4BF2; } .st-intro .st-orb-2 { background: #2EE6A6; opacity: 0.45; }
.st-total { background: #1F38C9; } .st-total .st-orb-1 { background: #4B67F6; } .st-total .st-orb-2 { background: #2EE6A6; opacity: 0.35; }
.st-category { background: #0D1330; } .st-category .st-orb-1 { background: #7C5CFF; opacity: 0.7; } .st-category .st-orb-2 { background: #2B4BF2; }
.st-ant { background: #1F38C9; } .st-ant .st-orb-1 { background: #D97706; opacity: 0.6; } .st-ant .st-orb-2 { background: #F59E8B; opacity: 0.4; }
.st-wins { background: #0D1330; } .st-wins .st-orb-1 { background: #0E9F6E; opacity: 0.6; } .st-wins .st-orb-2 { background: #7C5CFF; opacity: 0.5; }
.st-end { background: #0B1342; } .st-end .st-orb-1 { background: #2B4BF2; } .st-end .st-orb-2 { background: #2EE6A6; opacity: 0.5; }
.st-content { display: grid; gap: 12px; max-width: 460px; }
.st-slide[data-current] .st-content > * { animation: hola-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.st-slide[data-current] .st-content > :nth-child(2) { animation-delay: 0.12s; }
.st-slide[data-current] .st-content > :nth-child(3) { animation-delay: 0.24s; }
.st-slide[data-current] .st-content > :nth-child(4) { animation-delay: 0.36s; }
.st-kick { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.75); }
.st-big { margin: 0; font-family: var(--display); font-size: clamp(40px, 13vw, 64px); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.st-text { margin: 0; font-size: 17px; line-height: 1.45; color: rgba(255, 255, 255, 0.88); }
.st-chip { width: max-content; padding: 5px 11px; border-radius: 99px; background: rgba(46, 230, 166, 0.2); color: var(--menta); font-size: 14px; font-weight: 600; }
.st-wins { display: grid; gap: 14px; }
.st-wins div { display: grid; gap: 6px; font-size: 16px; font-weight: 600; }
.st-wins i { display: block; height: 8px; border-radius: 99px; background: var(--menta); }
.st-wins i.is-warm { background: #FFC97A; }
.st-done { width: max-content; margin-top: 8px; position: relative; z-index: 4; }
.st-tap { position: absolute; z-index: 3; top: 0; bottom: 90px; width: 35%; border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.st-tap-prev { left: 0; }
.story.is-last .st-tap { display: none; }
.st-tap-next { right: 0; width: 65%; }
.st-foot { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px max(24px, env(safe-area-inset-bottom)); }
.st-foot .brand { font-size: 20px; color: var(--blanco); }
.st-share { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border: 0; border-radius: 99px; background: var(--blanco); color: var(--tinta); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

/* Tarjeta del inicio: el resumen del mes está listo */
.recap-card { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 14px 16px; border-radius: 20px; background: #0B1342; color: var(--blanco); text-decoration: none; }
.recap-card::before { content: ''; position: absolute; z-index: -1; right: -40px; top: -60px; width: 160px; height: 160px; border-radius: 50%; background: rgba(43, 75, 242, 0.7); filter: blur(30px); }
.recap-card-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--menta); color: var(--tinta); }
.recap-card > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.recap-card strong { font-size: 15px; }
.recap-card small { font-size: 12.5px; color: #C9D3FF; }

/* ---------- Más: espacio actual y grupos ---------- */

.mx-space { margin-top: 8px; position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--tinta); color: var(--blanco); text-decoration: none; }
.mx-space::before { content: ''; position: absolute; z-index: -1; right: -50px; top: -70px; width: 170px; height: 170px; border-radius: 50%; background: rgba(43, 75, 242, 0.55); filter: blur(24px); }
.mx-space-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--menta); color: var(--tinta); }
.mx-space-text { flex: 1; min-width: 0; display: grid; }
.mx-space-text strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-space-text small { font-size: 12.5px; color: #C9D3FF; }
.mx-change { flex: none; font-size: 13px; font-weight: 600; color: var(--menta); }
.mx-switch { display: inline-flex; align-items: center; gap: 6px; margin: 10px 4px 0; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.mx-label { margin: 24px 4px 4px; font-family: var(--display); font-size: 19px; font-weight: 700; }
.mx-group { display: grid; }
.mx-row { display: flex; align-items: center; gap: 16px; padding: 15px 4px; border-bottom: 1px solid var(--linea); color: var(--tinta); font-size: 16px; text-decoration: none; }
.mx-row span { flex: 1; }
.mx-row > .icon:last-child { color: var(--tinta-2); }
.mx-row:active { background: var(--hover); }
.mx-out { margin: 26px 0 0; text-align: center; }
.mx-out button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--peligro); cursor: pointer; }


/* ---------- Registrar un movimiento: se escribe como una frase sobre un blanco con un leve azul ---------- */

html.compose-root, .compose-body { background: #F7F9FF; }
.cx-bg, .compose-body {
  background:
    radial-gradient(110% 55% at 100% 100%, rgba(43, 75, 242, 0.16), rgba(43, 75, 242, 0) 65%),
    radial-gradient(90% 45% at 0% 0%, rgba(43, 75, 242, 0.07), rgba(43, 75, 242, 0) 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F7F9FF 55%, #EAEFFF 100%);
  min-height: 100vh;
}
.compose { min-height: 100vh; }
.cx {
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto;
  height: var(--cx-h, 100dvh); min-height: 480px;
  padding: max(16px, env(safe-area-inset-top)) 0 0;
}
.cx-glass {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(43, 75, 242, 0.1);
  box-shadow: 0 1px 2px rgba(13, 19, 48, 0.04), inset 0 1px 0 #fff;
}

.cx-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 18px; }
.cx-actions { display: flex; gap: 6px; flex: none; }
.cx-kind { min-width: 0; }
@media (max-width: 400px) { .cx-top:has(.cx-delete) .cx-kind-item span { padding: 7px 9px; font-size: 12px; } }
button.cx-close { padding: 0; font: inherit; cursor: pointer; }
.cx-delete { color: #C9262C; }
.cx-kind { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(43, 75, 242, 0.1); box-shadow: inset 0 1px 0 #fff; }
.cx-kind-item { position: relative; cursor: pointer; }
.cx-kind-item input { position: absolute; opacity: 0; pointer-events: none; }
.cx-kind-item span { display: block; padding: 7px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 500; color: var(--tinta-2); transition: background 0.25s ease, color 0.25s ease; }
.cx-kind-item input:checked + span { background: var(--marca); color: var(--blanco); font-weight: 600; }
.cx-kind-item input:focus-visible + span { outline: 2px solid var(--marca); outline-offset: 2px; }
.cx-close {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: var(--tinta); background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(43, 75, 242, 0.1); box-shadow: inset 0 1px 0 #fff;
}

.cx-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px 22px; overflow-y: auto; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cx-chip, .cx-chip-date .input-date {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 500; color: #1F2A5C;
  background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(43, 75, 242, 0.1); box-shadow: 0 1px 2px rgba(13, 19, 48, 0.04), inset 0 1px 0 #fff;
  cursor: pointer; width: auto;
}
/* Fecha y cuenta, el mismo chip exacto: se anula el alto y el relleno de los campos normales */
.cx-chip, .cx-chip-date .input-date { box-sizing: border-box; height: 34px; min-height: 0; margin: 0; padding: 0 11px; line-height: 1; font-family: inherit; border-radius: 99px; }
.cx-chip-date { display: inline-flex; }
.cx-chip-date .input-date { gap: 5px; }
.cx-chip-date .input-date:focus { outline: none; border-color: rgba(43, 75, 242, 0.1); box-shadow: 0 0 0 2px rgba(43, 75, 242, 0.35); }
.cx-chip select { line-height: 1; height: 100%; }
.cx-chip-date .input-date .icon { width: 14px; height: 14px; color: var(--marca); }
.cx-chip > .icon { color: #8A92AD; pointer-events: none; }
/* El select va encima del chip, invisible: al tocar se abre la lista nativa del teléfono */
.cx-chip select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; color: inherit; padding: 0; margin: 0; max-width: 150px; cursor: pointer; }
.cx-chip select:focus { outline: none; }
.cx-chip:focus-within { box-shadow: 0 0 0 2px rgba(43, 75, 242, 0.35); }
.cx-chip.has-error, .cx-chip-date.has-error .input-date { border-color: var(--peligro); }

.cx-desc, .cx-amount input, .cx-note textarea {
  display: block; width: 100%; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  -webkit-appearance: none; appearance: none;
  color: var(--tinta); caret-color: var(--marca);
}
.cx-desc:focus, .cx-desc:focus-visible, .cx-amount input:focus, .cx-amount input:focus-visible, .cx-note textarea:focus, .cx-note textarea:focus-visible { outline: none; box-shadow: none; }
.cx-desc::placeholder, .cx-amount input::placeholder, .cx-note textarea::placeholder { color: #B9C0D4; opacity: 1; }
.cx-desc { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 8vw, 32px); letter-spacing: -0.035em; line-height: 1.15; }
.cx-amount { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.cx-amount span { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 10vw, 44px); letter-spacing: -0.04em; color: #B9C0D4; transition: color 0.2s ease; }
.cx-amount:focus-within span, .cx-amount.has-value span { color: var(--tinta); }
.cx-amount input { flex: 1; min-width: 0; font-family: var(--display); font-weight: 600; font-size: clamp(36px, 11vw, 46px); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.cx-error { margin: 8px 0 0; font-size: 13px; color: #C9262C; }

.cx-cat { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cx-cat .field { margin: 0; }
.cx-cat .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cx-cat .select-trigger {
  display: inline-flex; width: auto; height: 38px; padding: 0 12px 0 6px; gap: 8px;
  border-radius: 99px; font-size: 13.5px; font-weight: 600; color: var(--tinta);
  background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(43, 75, 242, 0.12); box-shadow: 0 1px 2px rgba(13, 19, 48, 0.04), inset 0 1px 0 #fff;
}
.cx-cat .select-trigger .opt-ico { width: 28px; height: 28px; border-radius: 50%; }
.cx-cat .select-trigger .opt-text { flex: none; }
.cx-auto { font-size: 11.5px; font-weight: 500; color: #0B7A55; }
.cx-split { margin-top: 18px; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(43, 75, 242, 0.1); }
.cx-note { margin-top: 18px; }
.cx-note textarea { font-size: 15px; line-height: 1.4; resize: none; padding-bottom: 6px; border-bottom: 1px solid rgba(43, 75, 242, 0.18); }
.cx-hint { margin: 14px 0 0; font-size: 12.5px; color: var(--tinta-2); }

.cx-frequent { padding: 0 0 4px; }
.cx-frequent p { margin: 0 22px 8px; font-size: 11.5px; color: #8A92AD; }
.cx-frequent-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 18px; }
.cx-frequent-row::-webkit-scrollbar { display: none; }
.cx-pick {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 13px 0 11px; border-radius: 99px;
  font: inherit; font-size: 13px; color: #1F2A5C; cursor: pointer;
  background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(43, 75, 242, 0.1); box-shadow: 0 1px 2px rgba(13, 19, 48, 0.04), inset 0 1px 0 #fff;
  transition: background 0.2s ease, color 0.2s ease;
}
.cx-pick .icon { color: var(--marca); }
.cx-pick.is-on { background: var(--marca); border-color: var(--marca); color: var(--blanco); }
.cx-pick.is-on .icon { color: var(--blanco); }

.cx-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px max(18px, env(safe-area-inset-bottom)); }
.cx-addnote { display: inline-flex; align-items: center; gap: 6px; padding: 8px 4px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--tinta-2); cursor: pointer; }
.cx-addnote > span { display: inline-flex; align-items: center; gap: 6px; }
.cx-addnote-off, .cx-addnote[aria-expanded="true"] .cx-addnote-on { display: none !important; }
.cx-addnote[aria-expanded="true"] .cx-addnote-off { display: inline-flex !important; }
.cx-save {
  flex: none; display: grid; place-items: center; width: 60px; height: 60px; border: 0; border-radius: 50%;
  background: linear-gradient(180deg, #3A5BFF, #2B4BF2); color: var(--blanco); cursor: pointer;
  box-shadow: 0 10px 24px rgba(43, 75, 242, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
}
.cx-save:active { transform: scale(0.92); }
.cx-save:disabled { opacity: 0.5; }

.cx-extra { display: flex; justify-content: center; gap: 18px; max-width: 560px; margin: 0 auto; padding: 0 18px max(16px, env(safe-area-inset-bottom)); }
.cx-extra form { margin: 0; }
.cx-extra-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px; font: inherit; font-size: 13px; color: var(--tinta-2); text-decoration: none; cursor: pointer; }
.cx-extra-link.is-danger { color: #C9262C; }

/* Entrada: las piezas esperan quietas hasta que la pantalla está lista (fecha y categoría ya armadas)
   y luego suben en cascada, así nada salta ni parpadea. Si algo falla, aparecen igual al segundo. */
@keyframes cx-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes cx-show { to { opacity: 1; } }
.cx > .cx-top, .cx > .cx-frequent, .cx > .cx-foot, .cx-body > * { opacity: 0; animation: cx-show 0.01s linear 1.2s forwards; }
.cx.is-ready > .cx-top, .cx.is-ready > .cx-frequent, .cx.is-ready > .cx-foot, .cx.is-ready .cx-body > * {
  animation: cx-in 0.42s cubic-bezier(0.32, 0.72, 0, 1) both;
}
.cx.is-ready .cx-body > :nth-child(2), .cx.is-ready .cx-body > :nth-child(3) { animation-delay: 0.03s; }
.cx.is-ready .cx-body > :nth-child(4) { animation-delay: 0.06s; }
.cx.is-ready .cx-body > :nth-child(n+5) { animation-delay: 0.09s; }
.cx.is-ready > .cx-frequent { animation-delay: 0.12s; }
.cx.is-ready > .cx-foot { animation-delay: 0.15s; }
.cx-body > [hidden] { display: none; }
.cx.is-leaving { transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); opacity: 0; transform: translateY(18px); }

/* El + abre la pantalla de registrar precargada: un círculo con su mismo fondo crece desde el botón */
.cx-sheet {
  position: fixed; z-index: 400; left: 0; right: 0; top: 0; height: 100vh;
  box-sizing: border-box; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background:
    radial-gradient(110% 55% at 100% 100%, rgba(43, 75, 242, 0.16), rgba(43, 75, 242, 0) 65%),
    radial-gradient(90% 45% at 0% 0%, rgba(43, 75, 242, 0.07), rgba(43, 75, 242, 0) 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F7F9FF 55%, #EAEFFF 100%);
  clip-path: circle(0 at var(--x, 50%) var(--y, 100%));
  visibility: hidden; pointer-events: none;
  transition: clip-path 0.4s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s linear 0.4s;
  will-change: clip-path;
}
.cx-sheet.is-open { clip-path: circle(150vmax at var(--x, 50%) var(--y, 100%)); visibility: visible; pointer-events: auto; transition: clip-path 0.4s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s; }
.cx-sheet iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; opacity: 0; transition: opacity 0.15s ease; }
.cx-sheet.is-ready iframe { opacity: 1; }
html.cx-locked, html.cx-locked body { overflow: hidden; }
/* Dentro del marco el fondo lo pone la hoja de afuera, así es uno solo y continuo */
html.cx-framed, html.cx-framed .compose-body { background: transparent; }
html.cx-framed .cx { padding-top: 16px; }
html.cx-framed .cx-foot { padding-bottom: 18px; }

/* Hoja de cuentas: más corta que la de categorías y con grupos */
.rp-backdrop.is-short .sheet-list { height: auto; max-height: min(56vh, 460px); }
.sheet-group { margin: 10px 8px 4px; font-size: 12px; font-weight: 600; color: #8A92AD; }
.sheet-group:first-child { margin-top: 0; }
.cx-chip-text { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
