/* ───────── Tokens ───────── */
:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #f1f1f3;
  --fill: rgba(118, 118, 128, .12);
  --text: #0b0b0c;
  --text-2: #6b6b70;
  --text-3: #a3a3a8;
  --line: rgba(0, 0, 0, .07);
  --accent: #0b0b0c;
  --on-accent: #ffffff;
  --hero: #0b0b0c;
  --hero-text: #ffffff;
  --hero-2: rgba(255, 255, 255, .58);
  --hero-fill: rgba(255, 255, 255, .09);
  --pos: #178a4c;
  --neg: #d93a40;
  --warn: #c97a06;
  --bar: rgba(255, 255, 255, .78);
  --seg-thumb: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 28px rgba(0, 0, 0, .045);
  --chip-ink: #000;
  --chip-bg: 17%;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #141416;
  --surface-2: #1e1e21;
  --fill: rgba(118, 118, 128, .24);
  --text: #f5f5f7;
  --text-2: #9a9aa0;
  --text-3: #5f5f65;
  --line: rgba(255, 255, 255, .09);
  --accent: #f5f5f7;
  --on-accent: #0b0b0c;
  --hero: #141416;
  --pos: #3dd68c;
  --neg: #ff6369;
  --warn: #ffb224;
  --bar: rgba(22, 22, 24, .78);
  --seg-thumb: #55555b;
  --shadow: none;
  --chip-ink: #fff;
  --chip-bg: 22%;
}

/* ───────── Base ───────── */
* { box-sizing: border-box; }
html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  height: 100%; margin: 0;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
/* Cambio de tema: un fundido único de toda la pantalla (View Transitions), sin animar cada elemento. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; animation-timing-function: ease; }

/* Pantalla de carga: la C se dibuja y al final aparece el punto. Solo transform, opacity y trazo. */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .3s ease; }
#splash .logo { display: block; transition: transform .3s var(--ease-out); }
#splash svg { display: block; animation: splashIn .32s var(--ease-out) both; }
#splash rect { fill: #0b0b0c; }
:root[data-theme="dark"] #splash rect { fill: #1a1a1d; }
#splash .c { stroke-dasharray: 1 2; stroke-dashoffset: 1; animation: splashDraw .58s cubic-bezier(.65, 0, .35, 1) .12s both; }
#splash .d { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: splashDot .34s cubic-bezier(.34, 1.56, .64, 1) .68s both; }
#splash.out { opacity: 0; pointer-events: none; }
#splash.out .logo { transform: scale(1.06); }
@keyframes splashIn { from { opacity: 0; transform: scale(.9); } }
@keyframes splashDraw { 0% { stroke-dashoffset: 1; opacity: 0; } 3% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes splashDot { to { transform: scale(1); } }
button, a, [role="button"] {
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  font: inherit; color: inherit; cursor: pointer;
}
button { border: 0; background: none; padding: 0; margin: 0; }
input, select, textarea { font: inherit; font-size: 16px; color: inherit; }
h1, h2, h3, p { margin: 0; }
small { font-size: 12px; color: var(--text-2); }
.ic { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 8px; }
.amt { font-variant-numeric: tabular-nums; transition: filter .25s ease; }
body.hide-amounts .amt { filter: blur(9px); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--text-2); }

/* ───────── Shell ───────── */
#app {
  position: relative; height: 100dvh; max-width: 480px; margin: 0 auto;
  overflow: hidden; background: var(--bg);
}
@media (min-width: 520px) {
  body { background: color-mix(in srgb, var(--bg) 92%, var(--text)); }
  #app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .12); }
}
.view {
  height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--safe-t) + 14px) 16px calc(118px + var(--safe-b));
  scrollbar-width: none;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.view::-webkit-scrollbar, .hscroll::-webkit-scrollbar, .sheet-body::-webkit-scrollbar, .page-body::-webkit-scrollbar { display: none; }
#app.pushed .view { transform: translateX(-22%); opacity: .6; }
#app.pushed #tabbar { opacity: 0; pointer-events: none; }

.view.enter > :not(.top) { animation: rise .55s var(--ease-out) backwards; }
.view.enter > :nth-child(2) { animation-delay: 20ms; }
.view.enter > :nth-child(3) { animation-delay: 60ms; }
.view.enter > :nth-child(4) { animation-delay: 100ms; }
.view.enter > :nth-child(5) { animation-delay: 140ms; }
.view.enter > :nth-child(6) { animation-delay: 180ms; }
.view.enter > :nth-child(7) { animation-delay: 220ms; }
.view.enter > :nth-child(n+8) { animation-delay: 260ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes growX { from { transform: scaleX(0); } }
@keyframes growY { from { transform: scaleY(0); } }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ───────── Encabezado ───────── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-bottom: 14px; }
.top h1 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.top-r { display: flex; align-items: center; gap: 8px; }
.iconbtn {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--shadow); flex: none;
  transition: transform .15s var(--ease-out), background .15s;
}
:root[data-theme="dark"] .iconbtn { background: var(--surface-2); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.sm { width: 28px; height: 28px; background: var(--fill); box-shadow: none; }
.pnav { display: flex; align-items: center; height: 34px; border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); padding: 0 2px; }
:root[data-theme="dark"] .pnav { background: var(--surface-2); }
.pnav button { height: 34px; min-width: 28px; display: grid; place-items: center; color: var(--text-2); border-radius: 20px; transition: transform .15s, color .15s; }
.pnav button:active { transform: scale(.9); color: var(--text); }
.pnav .pnav-l { padding: 0 3px; font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; }

/* ───────── Barra inferior ───────── */
#tabbar {
  position: absolute; left: 14px; right: 14px; bottom: calc(12px + var(--safe-b)); height: 58px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  border-radius: 32px; padding: 0 6px;
  background: var(--bar); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .1);
  transition: opacity .3s ease; z-index: 5;
}
.tab { height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 10px; font-weight: 600; border-radius: 20px; transition: color .2s, transform .15s var(--ease-out); }
.tab:active { transform: scale(.92); }
.tab.on { color: var(--text); }
.tab.on .ic { animation: pop .35s var(--ease-out); }
.fab {
  justify-self: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
  transition: transform .2s var(--ease-out);
}
.fab:active { transform: scale(.9) rotate(90deg); }

/* ───────── Tarjetas y listas ───────── */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.section { margin-top: 22px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; margin-bottom: 10px; }
.section-h h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.link { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 6px 2px; }
.link:active { color: var(--text); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }

.list { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 14px; text-align: left; min-height: 54px; transition: background .12s;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--line); }
.row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-main b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.row-amt { font-size: 14px; font-weight: 600; white-space: nowrap; }
.row-val { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.row > .ic { color: var(--text-3); }
.row.danger b { color: var(--neg); }

.chip {
  --c: #8e8e93; width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) var(--chip-bg), var(--surface));
  color: color-mix(in srgb, var(--c) 72%, var(--chip-ink));
}
.chip.sm { width: 28px; height: 28px; border-radius: 9px; }
.chip.lg { width: 48px; height: 48px; border-radius: 16px; }
.chip.xs { width: 22px; height: 22px; border-radius: 7px; }

.pillbtn { height: 32px; padding: 0 14px; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; transition: transform .15s var(--ease-out); flex: none; }
.pillbtn:active { transform: scale(.94); }
.pillbtn.soft { background: var(--fill); color: var(--text); }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 16px; font-size: 15px; font-weight: 600; transition: transform .15s var(--ease-out), opacity .15s; }
.btn:active { transform: scale(.975); }
.btn.primary { background: var(--accent); color: var(--on-accent); margin-top: 18px; }
.btn.soft { background: var(--surface); box-shadow: var(--shadow); }
.btn.ghost { height: 48px; color: var(--text-2); margin-top: 4px; font-size: 15px; }
.btn.danger { color: var(--neg); }
.btn.dashed { border: 1.5px dashed color-mix(in srgb, var(--text) 18%, transparent); color: var(--text-2); margin-top: 12px; height: 50px; font-size: 15px; }

.empty { text-align: center; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .chip { margin-bottom: 8px; }
.empty b { font-size: 17px; }
.empty p { color: var(--text-2); font-size: 14.5px; max-width: 280px; }
.empty .btn { margin-top: 14px; }

/* ───────── Control segmentado ───────── */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 13px; padding: 3px; margin-bottom: 14px; }
.seg::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n));
  border-radius: 10px; background: var(--seg-thumb); box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
  transform: translateX(calc(var(--i) * 100%)); transition: transform .4s var(--ease);
}
.seg.no-tr::before { transition: none; }
.seg button { position: relative; z-index: 1; height: 32px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: color .2s; white-space: nowrap; }
.seg button.on { color: var(--text); }
.seg.sm { margin: 0; width: 190px; }
.seg.sm button { height: 30px; font-size: 13px; }

/* ───────── Inicio ───────── */
.hero { background: var(--hero); color: var(--hero-text); border-radius: 30px; padding: 20px 18px 16px; position: relative; overflow: hidden; }
:root[data-theme="dark"] .hero { border: 1px solid var(--line); }
.hero .eyebrow { color: var(--hero-2); }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-eye { color: var(--hero-2); width: 36px; height: 36px; margin: -8px -8px -8px 0; display: grid; place-items: center; border-radius: 50%; }
.hero-eye:active { background: var(--hero-fill); }
.hero-amt { font-size: 40px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; margin-top: 2px; white-space: nowrap; }
.hero-amt.long { font-size: 32px; }
.sym { font-weight: 500; opacity: .75; margin-right: 1px; }
.dec { font-size: .45em; font-weight: 600; vertical-align: .95em; margin-left: 2px; opacity: .7; letter-spacing: 0; }
.hero-sub { color: var(--hero-2); font-size: 13.5px; margin-top: 4px; }
.spark { position: relative; height: 74px; margin: 14px 0 4px; }
.spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: reveal 1.1s var(--ease-out) .1s backwards; }
.spark path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.spark .now { stroke: #fff; stroke-width: 2; }
.spark .prev { stroke: rgba(255, 255, 255, .32); stroke-width: 1.5; stroke-dasharray: 2 4; }
.spark .dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); animation: fade .4s ease .9s backwards; }
@keyframes reveal { from { clip-path: inset(-10px 100% -10px -10px); } to { clip-path: inset(-10px); } }
.spark-legend { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--hero-2); }
.spark-legend .tagline { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--hero-fill); color: #fff; font-weight: 600; }
.spark-legend .tagline i { width: 6px; height: 6px; border-radius: 50%; background: #3dd68c; }
.spark-legend .tagline.up i { background: #ffb224; }
.spark-legend .keys { display: flex; gap: 10px; white-space: nowrap; }
.spark-legend .keys span::before { content: ""; display: inline-block; width: 12px; height: 2px; border-radius: 1px; background: #fff; vertical-align: middle; margin-right: 5px; }
.spark-legend .keys span.p::before { background: rgba(255, 255, 255, .4); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.hero-stats div { background: var(--hero-fill); border-radius: 16px; padding: 10px 9px 10px 11px; min-width: 0; }
.hero-stats b.sm { font-size: 12.5px; line-height: 21px; letter-spacing: -.01em; }
.trio b.sm { font-size: 14.5px; line-height: 24px; }
.hero-stats small { color: var(--hero-2); display: block; font-size: 12px; }
.hero-stats b { font-size: 15px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.hscroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.hscroll > * { scroll-snap-align: start; scroll-margin-left: 16px; flex: none; }
.acc-card { width: 132px; background: var(--surface); border-radius: 20px; padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); transition: transform .15s var(--ease-out); }
.acc-card:active { transform: scale(.96); }
.acc-card .chip { margin-bottom: 10px; }
.acc-card small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-card b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-card.add { align-items: center; justify-content: center; gap: 8px; background: none; box-shadow: none; border: 1.5px dashed color-mix(in srgb, var(--text) 18%, transparent); color: var(--text-2); width: 120px; }

.ring { width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: transform .15s var(--ease-out); }
.ring:active { transform: scale(.94); }
.ring-g { position: relative; width: 58px; height: 58px; display: grid; place-items: center; }
.ring-g svg.r { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-g circle { fill: none; stroke-width: 5; }
.ring-g .trk { stroke: var(--fill); }
.ring-g .val { stroke: var(--st); stroke-linecap: round; animation: ringIn .9s var(--ease-out) backwards; }
@keyframes ringIn { from { stroke-dasharray: 0 200; } }
.ring-g .in { color: color-mix(in srgb, var(--c) 72%, var(--chip-ink)); }
.ring b { font-size: 13.5px; font-weight: 650; white-space: nowrap; }
.ring small { font-size: 11.5px; margin-top: -3px; }
.st-ok { --st: var(--pos); } .st-fast { --st: var(--warn); } .st-over { --st: var(--neg); }

/* ───────── Movimientos ───────── */
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--fill); color: var(--text-2); margin-bottom: 10px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; }
.search input::placeholder { color: var(--text-2); }
.filters { display: flex; gap: 8px; margin: 0 -16px 6px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.tagchip { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: background .2s, color .2s, transform .15s var(--ease-out); flex: none; }
:root[data-theme="dark"] .tagchip:not(.on) { background: var(--surface-2); }
.tagchip:active { transform: scale(.94); }
.tagchip.on { background: var(--accent); color: var(--on-accent); }
.day-h { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 6px 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.summary-line { font-size: 13.5px; color: var(--text-2); padding: 6px 6px 0; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head b { font-size: 17px; font-weight: 700; }
.cal-head div { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding-bottom: 6px; }
.cal-d { position: relative; aspect-ratio: 1 / 1.12; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: transform .15s var(--ease-out), background .2s, color .2s; overflow: hidden; }
.cal-d::before { content: ""; position: absolute; inset: 0; background: var(--text); opacity: calc(var(--h, 0) * .13); border-radius: inherit; }
.cal-d:active { transform: scale(.9); }
.cal-d .n { position: relative; font-size: 15px; font-weight: 600; }
.cal-d .v { position: relative; font-size: 10px; font-weight: 600; color: var(--text-2); height: 12px; line-height: 12px; font-variant-numeric: tabular-nums; }
.cal-d.today .n { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cal-d.sel { background: var(--accent); color: var(--on-accent); }
.cal-d.sel::before { opacity: 0; }
.cal-d.sel .v { color: inherit; opacity: .7; }
.cal-d .due { position: absolute; top: 5px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--warn); }
.cal-d.future .n { color: var(--text-3); }
.cal-d.sel.future .n { color: inherit; }
.cal-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.cal-foot b { color: var(--text); font-weight: 600; }

/* ───────── Análisis ───────── */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.trio > div { min-width: 0; }
.trio small { display: flex; align-items: center; gap: 4px; }
.trio b { display: block; font-size: 15.5px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.rate { margin-top: 14px; }
.rate-bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.rate-bar i { display: block; height: 100%; border-radius: 4px; background: var(--text); transform-origin: left; animation: growX .8s var(--ease-out) backwards; }
.rate p { font-size: 13.5px; color: var(--text-2); margin-top: 8px; }
.rate p b { color: var(--text); font-weight: 600; }

.donut { position: relative; width: 196px; height: 196px; margin: 4px auto 14px; }
.donut svg { width: 100%; height: 100%; display: block; }
.donut .arcs circle { animation: arc .9s var(--ease-out) backwards; }
@keyframes arc { from { stroke-dasharray: 0 302; } }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fade .6s ease .2s backwards; }
.donut-c b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.brk { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 0; transition: opacity .15s; }
.brk:active { opacity: .6; }
.brk-main { flex: 1; min-width: 0; }
.brk-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 600; }
.brk-top span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brk-main, .brk-bar { display: block; }
.brk-bar { height: 6px; border-radius: 3px; background: var(--fill); margin-top: 6px; overflow: hidden; }
.brk-bar i { display: block; height: 100%; border-radius: 3px; background: var(--c); transform-origin: left; animation: growX .8s var(--ease-out) backwards; }
.brk small { display: block; margin-top: 4px; font-size: 12px; }

.chart-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 8px; }
.chart-h b { font-size: 16px; font-weight: 700; }
.chart-h span { font-size: 13px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--text); opacity: .28; transform-origin: bottom; animation: growY .7s var(--ease-out) backwards; transition: opacity .15s; }
.bar.hi i, .bar.sel i { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .bar:hover i { opacity: .7; } .link:hover { color: var(--text); } }
.bars-x { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { background: var(--surface); border-radius: 22px; padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.mini small { display: block; font-size: 12.5px; }
.mini b { display: block; font-size: 18px; font-weight: 650; letter-spacing: -.015em; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini span { font-size: 12px; color: var(--text-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────── Planes ───────── */
.bud { display: block; width: 100%; text-align: left; background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px 16px; box-shadow: var(--shadow); margin-bottom: 10px; transition: transform .15s var(--ease-out); }
.bud:active { transform: scale(.98); }
.bud-top { display: flex; align-items: center; gap: 12px; }
.bud-top .row-main small { gap: 5px; }
.bud-r { text-align: right; }
.bud-r b { display: block; font-size: 16px; font-weight: 650; }
.bud-r small { font-size: 12px; }
.bbar { position: relative; height: 8px; border-radius: 4px; background: var(--fill); margin-top: 14px; }
.bbar i { display: block; height: 100%; border-radius: 4px; background: var(--st); transform-origin: left; animation: growX .8s var(--ease-out) backwards; max-width: 100%; }
.bbar u { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.bud-foot { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12.5px; color: var(--text-2); }
.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.big-num { font-size: 28px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; margin-top: 4px; }
.big-sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.card .bbar { margin-top: 14px; }

/* ───────── Capas: hojas y páginas ───────── */
#overlays { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.overlay { position: absolute; inset: 0; pointer-events: auto; }
.overlay.closing { pointer-events: none; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .4s ease; }
.overlay.open .backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--safe-t) - 28px);
  display: flex; flex-direction: column; background: var(--bg);
  border-radius: 30px 30px 0 0; transform: translateY(105%);
  transition: transform .5s var(--ease); box-shadow: 0 -12px 44px rgba(0, 0, 0, .2); will-change: transform;
}
:root[data-theme="dark"] .sheet { background: #0d0d0f; border-top: 1px solid var(--line); }
.overlay.open .sheet { transform: none; }
.sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 22px 16px 10px 20px; touch-action: none; cursor: grab; flex: none; }
.sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--text-3); opacity: .5; }
.sheet-head b { font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px 16px calc(22px + var(--safe-b)); scrollbar-width: none; }
.page { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .5s var(--ease); will-change: transform; }
.overlay.open .page { transform: none; }
.page-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: calc(var(--safe-t) + 10px) 14px 8px; flex: none; }
.page-head b { text-align: center; font-size: 17px; font-weight: 700; }
.page-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(36px + var(--safe-b)); scrollbar-width: none; }
.group-h { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 20px 8px 8px; letter-spacing: .01em; }
.foot-note { text-align: center; font-size: 12.5px; color: var(--text-3); padding: 24px 20px 0; line-height: 1.5; }

/* ───────── Formularios ───────── */
.amount { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 10px 0 16px; font-size: 40px; font-weight: 650; letter-spacing: -.03em; }
.amount span { color: var(--text-3); font-weight: 500; }
.amount input { width: 1ch; min-width: 1ch; max-width: 80%; border: 0; background: none; outline: none; font: inherit; font-size: 40px; letter-spacing: inherit; padding: 0; caret-color: var(--text); font-variant-numeric: tabular-nums; }
.amount input::placeholder { color: var(--text-3); }
.amount.income input { color: var(--pos); }
.shake { animation: shake .4s ease; }
.flabel { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); padding: 14px 6px 7px; }
.pickgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 10px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 8px; border-radius: 18px; border: 1.5px solid transparent; font-size: 11.5px; font-weight: 600; color: var(--text-2); min-width: 0; transition: transform .15s var(--ease-out), background .2s, border-color .2s; }
.pick span:last-child { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.pick:active { transform: scale(.93); }
.pick.on { background: var(--surface); border-color: var(--text); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; animation: rise .35s var(--ease-out); }
.form { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 4px; }
.frow { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 14px; width: 100%; text-align: left; }
.frow + .frow::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.frow > span { font-size: 14px; font-weight: 500; white-space: nowrap; }
.frow .frow-val { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.frow .frow-val.set { color: var(--text); font-weight: 500; }
.frow .frow-val > .ic { color: var(--text-3); }
button.frow:active { background: var(--fill); }
.frow input[type="text"], .frow input[type="email"], .frow input[type="password"], .frow input[type="date"], .frow input[type="number"], .frow select, .frow input:not([type]) {
  flex: 1; min-width: 0; height: 48px; border: 0; background: none; outline: none; text-align: right; color: var(--text-2);
  -webkit-appearance: none; appearance: none; padding: 0;
}
.frow input:focus, .frow select:focus { color: var(--text); }
.frow select { direction: rtl; text-align-last: right; }
.frow select option { direction: ltr; color: #000; background: #fff; }
.frow input::placeholder { color: var(--text-3); }
.frow input[type="date"]::-webkit-calendar-picker-indicator { opacity: .45; margin-left: 6px; }
:root[data-theme="dark"] .frow input[type="date"] { color-scheme: dark; }
.form + .form, .seg + .form { margin-top: 12px; }
.frow input.left { text-align: left !important; color: var(--text) !important; }
.seg + .btn.primary { margin-top: 18px; }
.hint { font-size: 12.5px; color: var(--text-2); padding: 8px 8px 0; line-height: 1.45; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .22); transition: transform .3s var(--ease); }
.switch input:checked + i { background: var(--pos); }
.switch input:checked + i::after { transform: translateX(20px); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 4px 12px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--c); position: relative; transition: transform .15s var(--ease-out); }
.swatch:active { transform: scale(.88); }
.swatch.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--text); }
.icongrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 12px; }
.icongrid button { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); transition: transform .15s var(--ease-out), background .2s; }
.icongrid button:active { transform: scale(.88); }
.icongrid button.on { background: color-mix(in srgb, var(--c) var(--chip-bg), var(--surface)); color: color-mix(in srgb, var(--c) 72%, var(--chip-ink)); }
.subrow input { text-align: left !important; color: var(--text) !important; }
.subrow button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); flex: none; }
.subrow button.addb { background: var(--accent); color: var(--on-accent); }
.preview { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 14px; }
.preview .chip { transition: background .25s, color .25s; }
.opt { justify-content: space-between; }
.opt .ic { color: var(--text); }
.confirm p { color: var(--text-2); font-size: 15px; padding: 0 6px 6px; line-height: 1.45; }
.confirm .btn.primary.danger { background: var(--neg); color: #fff; }

/* ───────── Inicio (v1.1), perfil y bienvenida ───────── */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; font-weight: 700; letter-spacing: .01em;
  background: color-mix(in srgb, var(--c) var(--chip-bg), var(--surface)); color: color-mix(in srgb, var(--c) 72%, var(--chip-ink)); }
.hello { display: flex; align-items: center; gap: 10px; text-align: left; min-width: 0; transition: opacity .15s; }
.hello:active { opacity: .6; }
.hello span:last-child { display: flex; flex-direction: column; min-width: 0; }
.hello small { font-size: 11.5px; }
.hello b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balance { padding: 6px 4px 0; }
.balance-top { display: flex; align-items: center; gap: 2px; }
.balance .hero-eye { color: var(--text-3); width: 32px; height: 32px; margin: -6px 0; display: grid; place-items: center; border-radius: 50%; }
.balance .hero-eye:active { background: var(--fill); }
.quick { display: flex; gap: 8px; margin-top: 16px; }
.qbtn { flex: 1; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600;
  background: var(--surface); box-shadow: var(--shadow); transition: transform .15s var(--ease-out); }
.qbtn:active { transform: scale(.95); }
.qbtn.primary { background: var(--accent); color: var(--on-accent); }
.flow { padding: 14px 16px; }
.flow-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.flow-net { font-size: 12.5px; color: var(--text-2); text-align: right; }
.flow-net b { font-size: 14px; font-weight: 650; }
.flow-row { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 10px; height: 26px; }
.flow-l { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.flow-bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.flow-bar i { display: block; height: 100%; border-radius: 4px; background: var(--text); transform-origin: left; animation: growX .8s var(--ease-out) backwards; }
.flow-bar.out i { background: var(--text-3); animation-delay: 80ms; }
.flow-row b { font-size: 13.5px; font-weight: 600; min-width: 64px; text-align: right; }
.card.tight { padding: 6px 14px; }
.card.tight .brk small { display: inline; margin: 0; font-weight: 400; }
.profile { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; transition: transform .15s var(--ease-out); }
.profile:active { transform: scale(.98); }
.profile .row-main b { font-size: 16px; }
.profile > .ic { color: var(--text-3); }
.chips.sub { padding: 2px 14px 10px 60px; margin: 0; }
.chips.sub .tagchip { background: var(--fill); box-shadow: none; }
.chips.sub .tagchip.on { background: var(--accent); }
.overlay.bare .page-head { visibility: hidden; height: calc(var(--safe-t) + 12px); padding: 0; }
.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 8vh; }
.welcome h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 18px; }
.welcome > p { color: var(--text-2); font-size: 14px; margin: 6px 0 22px; max-width: 280px; }
.welcome .form, .welcome .seg { width: 100%; text-align: left; }
.welcome .hint { text-align: center; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.welcome .btn.primary { margin-top: 16px; }

/* ───────── v1.2: tarjeta de balance, filas de selección y calendario ───────── */
.bcard { position: relative; overflow: hidden; background: var(--hero); color: #fff; border-radius: 28px; padding: 16px 18px 14px; }
:root[data-theme="dark"] .bcard { border: 1px solid var(--line); }
.bcard::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 88% -12%, rgba(61, 214, 140, .30), transparent 56%); }
.bcard::after { content: ""; position: absolute; right: -70px; top: -90px; width: 230px; height: 230px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 0 0 34px rgba(255, 255, 255, .025); pointer-events: none; }
.bcard > * { position: relative; z-index: 1; }
.bcard-top { display: flex; align-items: center; justify-content: space-between; }
.seg.onink { background: rgba(255, 255, 255, .1); width: 204px; }
.seg.onink::before { background: rgba(255, 255, 255, .2); box-shadow: none; }
.seg.onink button { color: rgba(255, 255, 255, .6); }
.seg.onink button.on { color: #fff; }
.bcard .hero-amt { margin-top: 16px; }
.bcard-sub { color: var(--hero-2); font-size: 12.5px; margin-top: 4px; min-height: 18px; }
.bcard-acc { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: rgba(255, 255, 255, .78); text-align: left; }
.bcard-acc span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard-acc b { color: #fff; font-weight: 600; }
.bcard-acc .chip { background: rgba(255, 255, 255, .12); color: #fff; }
.bcard-acc:active { opacity: .7; }
.demo-tag { display: block; width: 100%; margin-bottom: 10px; padding: 9px 12px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--text); font-size: 12px; font-weight: 600; text-align: center; }

.pickrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 9px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: left; transition: transform .15s var(--ease-out); }
button.pickrow:active { transform: scale(.98); }
.pickrow-t { flex: 1; min-width: 0; font-size: 14.5px; color: var(--text-3); }
.pickrow-t.set { color: var(--text); font-weight: 600; }
.pickrow select { flex: 1; min-width: 0; height: 36px; border: 0; background: none; outline: none; font-weight: 600; color: var(--text); -webkit-appearance: none; appearance: none; padding: 0; }
.pickrow select option { color: #000; background: #fff; }
.pickrow > .ic { color: var(--text-3); }
.chip.ghost { background: none; border: 1.5px dashed color-mix(in srgb, var(--text) 22%, transparent); color: var(--text-3); }
.chips.subpick { margin: 10px 0 0; align-items: center; }
.chips-l { width: 100%; font-size: 11.5px; color: var(--text-2); padding-left: 6px; }
.datechips { display: flex; flex-wrap: wrap; gap: 8px; }
.dcal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 12px 12px 10px; margin-top: 10px; animation: rise .3s var(--ease-out); }
.dcal-h { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.dcal-h b { font-size: 14.5px; font-weight: 700; }
.dcal-h span { display: flex; gap: 6px; }
.dcal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; justify-items: center; }
.dcal-wd { font-size: 10.5px; font-weight: 600; color: var(--text-3); padding-bottom: 4px; }
.dcal-g button { width: 36px; height: 36px; border-radius: 50%; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; transition: background .15s, transform .15s var(--ease-out); }
.dcal-g button:active { transform: scale(.88); }
.dcal-g button.today { box-shadow: inset 0 0 0 1.5px var(--text-3); }
.dcal-g button.on { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: none; }
.chart-h { align-items: center; margin-bottom: 4px; }
.chart-h .seg.sm { width: 150px; }
.chart-cap { font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.bars.wide { gap: 12px; }
.bars.wide .bar i { border-radius: 6px 6px 0 0; }
.icongrid { max-height: 248px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }

/* ───────── v1.4: esquinas más sobrias (la barra inferior, botones y barras no cambian) ───────── */
:root { --r-lg: 18px; --r-md: 14px; }
.bcard { border-radius: 20px; }
.acc-card, .mini, .form, .dcal { border-radius: 16px; }
.pickrow, .search { border-radius: 14px; }
.sheet { border-radius: 22px 22px 0 0; }
.demo-tag { border-radius: 12px; }
.chip { border-radius: 9px; }
.chip.sm { border-radius: 7px; }
.chip.lg { border-radius: 12px; }
.chip.xs { border-radius: 6px; }
.icongrid button { border-radius: 9px; }
.cal-d { border-radius: 10px; }

/* Animación: las barras y gráficas solo crecen al entrar a una pantalla, no en cada cambio. */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.view.enter > :not(.top) { animation-duration: .42s; }
.view.enter > :nth-child(2) { animation-delay: 0ms; }
.view.enter > :nth-child(3) { animation-delay: 35ms; }
.view.enter > :nth-child(4) { animation-delay: 70ms; }
.view.enter > :nth-child(5) { animation-delay: 105ms; }
.view.enter > :nth-child(6) { animation-delay: 140ms; }
.view.enter > :nth-child(n+7) { animation-delay: 170ms; }
.tab.on .ic, .chips, .brk-bar i, .rate-bar i, .bbar i, .flow-bar i, .bar i, .donut .arcs circle, .donut-c, .ring-g .val { animation: none; }
.enter .brk-bar i, .enter .rate-bar i, .enter .bbar i, .enter .flow-bar i { animation: growX .7s var(--ease-out) backwards; }
.enter .bar i { animation: growY .55s var(--ease-out) backwards; }
.enter .donut .arcs circle { animation: arc .8s var(--ease-out) backwards; }
.enter .donut-c { animation: fade .5s ease .15s backwards; }
/* Profundidad: al abrir una hoja, la pantalla de atrás se aleja un poco. */
#app.sheeted .view { transform: scale(.972); }
#app.pushed .view { transform: translateX(-22%); }
.tab .ic { transition: transform .25s var(--ease); }
.tab.on .ic { transform: translateY(-1px) scale(1.06); }
.sheet { transition: transform .46s var(--ease); }
.backdrop { transition: opacity .3s ease; }

/* Selector discreto de la tarjeta de balance */
.metric-btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; margin-left: -2px; padding: 0 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--hero-2); transition: color .15s; }
.metric-btn:active { color: #fff; }
.metric-btn .ic { opacity: .7; }

/* Calendario: el día y, debajo, una marca cuyo ancho indica cuánto se gastó */
.cal-d { aspect-ratio: 1 / 1.05; gap: 5px; }
.cal-d::before { display: none; }
.cal-d .n { font-size: 14px; }
.cal-d .m { position: relative; width: 18px; height: 3px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.cal-d .m i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--text); }
.cal-d .m.none { background: none; }
.cal-d.sel .m { background: color-mix(in srgb, var(--on-accent) 25%, transparent); }
.cal-d.sel .m i { background: var(--on-accent); }
.cal-d .due { top: 4px; right: 5px; }
.cal-legend { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--text-2); margin-top: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .k1 { width: 14px; height: 3px; border-radius: 2px; background: var(--text); }
.cal-legend .k2 { width: 5px; height: 5px; border-radius: 50%; background: var(--warn); }
.day-total { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }

/* Sugerencias para secciones sin contenido */
.nudge { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: var(--r-lg); text-align: left; border: 1.5px dashed color-mix(in srgb, var(--text) 16%, transparent); transition: transform .15s var(--ease-out), background .15s; }
.nudge:active { transform: scale(.98); background: var(--fill); }
.nudge b { display: block; font-size: 14px; font-weight: 600; }
.nudge small { display: block; }
.nudge > .ic { color: var(--text-3); }
.nudge .row-main { gap: 1px; }

/* Detalle de cuenta y grupos de categoría */
.acc-head { display: flex; align-items: center; gap: 12px; }
.acc-head .big-num { margin: 0; }
.acc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.acc-actions .btn { height: 44px; font-size: 14px; margin: 0; }
.group-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.swatches { gap: 9px; }
.swatch { width: 30px; height: 30px; }

/* ───────── v1.5: los dos balances a la vista, pequeños; el no elegido va atenuado ───────── */
.metric-tabs { display: flex; gap: 14px; }
.metric-tabs button { height: 24px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #fff; opacity: .38; transition: opacity .2s ease; }
.metric-tabs button.on { opacity: .95; }
.brk.on .brk-top span:first-child { font-weight: 700; }
.brk > .ic { color: var(--text); flex: none; }

/* ───────── v1.6 ───────── */
/* El botón principal de una hoja queda siempre a la vista, pegado abajo. */
.sheet-body > .btn.primary[data-primary] { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 0 0 12px var(--bg), 0 26px 0 12px var(--bg); }
:root[data-theme="dark"] .sheet-body > .btn.primary[data-primary] { box-shadow: 0 0 0 12px #0d0d0f, 0 26px 0 12px #0d0d0f; }
.sheet-body > .btn.ghost { position: relative; z-index: 4; }
.icongrid { scrollbar-width: none; }
.icongrid::-webkit-scrollbar { display: none; }
.tagchip.withic { display: inline-flex; align-items: center; gap: 4px; }

/* Calendario de rango (periodo personalizado) */
.range-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.range-head div { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 9px 12px; border: 1.5px solid transparent; transition: border-color .2s; }
.range-head div.on { border-color: var(--text); }
.range-head small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.range-head b { font-size: 15px; font-weight: 650; }
.dcal-g.range { gap: 2px 0; justify-items: stretch; }
.dcal-g.range button { width: 100%; border-radius: 0; position: relative; }
.dcal-g.range button.in { background: var(--fill); }
.dcal-g.range button.on { background: var(--accent); }
.dcal-g.range button.a { border-radius: 18px 0 0 18px; }
.dcal-g.range button.b { border-radius: 0 18px 18px 0; }
.dcal-g.range button.a.b { border-radius: 18px; }
.dcal-g.range button.today:not(.on):not(.in) { border-radius: 18px; }
.dcal-g.range button.today.in { box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }

/* Calendario mensual: la marca cambia de tono según el monto (rojo = gasto, verde = día con más ingresos que gastos) */
.cal-d .m { background: none; }
.cal-d .m i { inset: 0; background: var(--neg); opacity: calc(.22 + .78 * var(--k, 1)); }
.cal-d .m.inc i { background: var(--pos); }
.cal-d.sel .m { background: none; }
.cal-d.sel .m i { background: var(--neg); filter: brightness(1.35); opacity: calc(.45 + .55 * var(--k, 1)); }
.cal-d.sel .m.inc i { background: var(--pos); }
.cal-legend .ramp { display: inline-flex; gap: 2px; }
.cal-legend .ramp i { width: 9px; height: 3px; border-radius: 2px; background: var(--neg); }
.cal-legend .ramp.inc i { background: var(--pos); }
.cal-legend .ramp i:nth-child(1) { opacity: .25; } .cal-legend .ramp i:nth-child(2) { opacity: .6; }

/* Detalle del día elegido en la gráfica */
.bar-day { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bar-day-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.bar-day .row { padding-left: 0; padding-right: 0; min-height: 50px; }
.bar-day .row + .row::before { left: 46px; }
.bar.sel i { opacity: 1; }
.bars .bar.hi:not(.sel) i { opacity: .55; }

/* ───────── v1.7: gráfica por día con navegación propia ───────── */
.chart-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 14px; }
.chart-nav span { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.chart-nav b { font-size: 13.5px; font-weight: 650; }
.chart-nav small { font-size: 11.5px; }
.bar.fut i { opacity: .14; }
.bars-x.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; text-align: center; }
.chart-tip { font-size: 11.5px; color: var(--text-3); text-align: center; margin: 10px 0 0; }

/* ───────── v1.8 ───────── */
/* Selector de tipo: tres botones con icono; el elegido toma su color */
.typeseg { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; margin-bottom: 6px; }
.typeseg button { display: flex; align-items: center; justify-content: center; gap: 7px; height: 44px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); border: 1.5px solid transparent; font-size: 13px; font-weight: 600; color: var(--text-2); transition: transform .15s var(--ease-out), background .2s, color .2s, border-color .2s; }
.typeseg button:active { transform: scale(.96); }
.typeseg .ti { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); transition: background .2s, color .2s; }
.typeseg button.on { color: var(--text); border-color: var(--tc); background: color-mix(in srgb, var(--tc) 9%, var(--surface)); }
.typeseg button.on .ti { background: var(--tc); color: #fff; }
.typeseg .t-expense { --tc: var(--neg); } .typeseg .t-income { --tc: var(--pos); } .typeseg .t-transfer { --tc: var(--text); }
.typeseg .t-transfer.on .ti { color: var(--on-accent); }

/* Colores en una sola fila deslizable (sin barra); iconos con barra fina y discreta */
.swatches { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 6px 20px 12px; overscroll-behavior-x: contain; }
.swatches::-webkit-scrollbar { display: none; }
.swatch { flex: none; }
.icongrid { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; padding-right: 6px; }
.icongrid::-webkit-scrollbar { display: block; width: 4px; }
.icongrid::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 22%, transparent); border-radius: 2px; }
.icongrid::-webkit-scrollbar-track { background: transparent; }


/* ───────── v1.9: pestañas tipo píldora (contenedor gris, la elegida en blanco con borde suave) ───────── */
.seg { border-radius: 999px; padding: 4px; }
.seg::before {
  top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n));
  border-radius: 999px; background: var(--seg-thumb);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .07), 0 1px 3px rgba(0, 0, 0, .10);
}
:root[data-theme="dark"] .seg::before { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 1px 3px rgba(0, 0, 0, .4); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--text-2); min-width: 0; }
.seg button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button .ic { flex: none; opacity: .75; transition: color .2s, opacity .2s; }
.seg button.on { color: var(--text); font-weight: 600; }
.seg button.on .ic { opacity: 1; }
.seg.sm { display: inline-grid; width: auto; margin: 0; }
.chart-h .seg.sm { width: auto; }
.seg.sm button { height: 28px; padding: 0 11px; gap: 5px; font-size: 12px; }
.seg.sm button .ic { width: 13px; height: 13px; }
.row .seg.sm { flex: none; }
.row .seg.sm button { padding: 0 8px; gap: 4px; }
.row:has(.seg.sm) .row-main { min-width: 40px; }
/* Tipo de movimiento: el icono del elegido se pinta de su color */
.seg.kinds { margin-bottom: 6px; }
.seg.kinds button.on[data-v="expense"] .ic { color: var(--neg); }
.seg.kinds button.on[data-v="income"] .ic { color: var(--pos); }

/* ───────── v2.0: animaciones más ligeras ───────── */
/* Ocultar montos: el desenfoque se aplica al instante (animar muchos filtros a la vez es costoso). */
.amt { transition: none; }
/* Barra inferior: desenfoque más corto, mismo efecto y menos trabajo al desplazar. */
#tabbar { -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
/* Transiciones de hojas y páginas algo más ágiles. */
.view { transition: transform .42s var(--ease), opacity .42s var(--ease); }
.page { transition: transform .42s var(--ease); }
.sheet { transition: transform .42s var(--ease); }
/* Listas largas de movimientos: el navegador solo dibuja los días que están en pantalla. */
#mov-list > .list { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.card, .mini, .bud, .acc-card { contain: layout paint; }
.bcard { contain: paint; }

/* ───────── v2.1 ───────── */
/* Ocultar montos: puntos en vez de desenfoque */
body.hide-amounts .amt { filter: none; }
.dots { letter-spacing: .08em; }

/* Dona: entra con un solo barrido continuo; al elegir una categoría las demás se atenúan */
/* Cada arco crece a velocidad constante y el siguiente arranca donde termina el anterior (tiempos en línea). */
.enter .donut .arcs circle { animation-name: arc; animation-timing-function: linear; animation-fill-mode: backwards; }
.enter .donut-c { animation: fade .35s ease .15s backwards; }
/* Aro invisible encima de cada arco para tocarlo con el dedo; el texto del centro no bloquea el toque. */
.donut .hit { cursor: pointer; pointer-events: stroke; }
.donut-c { pointer-events: none; }

/* Sugerencias del formulario */
.qrow { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; overscroll-behavior-x: contain; }
.qrow::-webkit-scrollbar { display: none; }
.qrow > * { flex: none; }
.qcat { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 7px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; transition: transform .15s var(--ease-out); }
.qcat:active { transform: scale(.95); }
:root[data-theme="dark"] .qcat { background: var(--surface-2); }

/* ───────── v2.3 ───────── */
/* Gráfica: año (12 meses) y gastos con ingresos juntos (dos barras finas por día o mes) */
.chart-h { gap: 10px; }
.chart-h > b { min-width: 0; line-height: 1.25; }
.chart-h .seg.sm { flex: none; }
.bars-x.year { grid-template-columns: repeat(12, 1fr); gap: 10px; }
.bar.duo { gap: 2px; background: none; }
.bar.duo i { flex: 1; width: auto; }
.bar.duo i.in, .bars .bar.duo i.in { background: var(--pos); opacity: .55; }
.bar.duo.hi i.in, .bar.duo.sel i.in { opacity: 1; }
/* Título de la gráfica con mini menú: Gastos / Ingresos / Gastos e ingresos */
.chart-card { contain: layout; position: relative; overflow: visible; }
.chart-card .chart-h { position: relative; z-index: 5; }
.kind-wrap { position: relative; min-width: 0; flex: 1; }
.kind-btn { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 15px; font-weight: 700; letter-spacing: -.01em; padding: 4px 6px 4px 0; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.chart-card .chart-h .seg.sm button { padding: 0 9px; }
.kind-btn small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.kind-btn .ic { color: var(--text-3); transition: transform .2s var(--ease-out); }
.kind-btn.open .ic { transform: rotate(180deg); }
.kind-btn:active { opacity: .6; }
.kind-menu { position: absolute; top: calc(100% + 6px); left: -6px; z-index: 20; min-width: 210px; padding: 5px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, .16); transform-origin: top left; animation: menuIn .16s var(--ease-out); }
:root[data-theme="dark"] .kind-menu { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, .5); }
.kind-menu.closing { animation: menuOut .14s ease forwards; }
@keyframes menuIn { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
@keyframes menuOut { to { opacity: 0; transform: scale(.96) translateY(-3px); } }
.kind-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text-2); text-align: left; }
.kind-menu button span { flex: 1; text-align: left; font-size: 14px; color: inherit; }
.kind-menu button.on { color: var(--text); font-weight: 600; }
.kind-menu button:active { background: var(--fill); }
@media (hover: hover) and (pointer: fine) { .kind-menu button:hover { background: var(--fill); } }
.chart-nav .lgd { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; }
.chart-nav .lgd i { width: 7px; height: 7px; border-radius: 2px; background: var(--text); opacity: .3; }
.chart-nav .lgd.in i { background: var(--pos); opacity: .8; }
/* Eje del año: nombres cortos y más pequeños */
.bars-x.year span { font-size: 9.5px; }
.chart-tip { margin-top: 8px; }
.bar-sub { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); margin: 10px 0 2px; }
.bar-day .brk { padding: 7px 0; }
.bar-day .sel-more { height: 40px; font-size: 13px; margin-top: 10px; background: var(--fill); box-shadow: none; }

/* Proyección de fin de mes */
.proj-h { display: flex; align-items: center; justify-content: space-between; color: var(--text-3); }
.proj-n { font-size: 28px; font-weight: 650; letter-spacing: -.03em; margin-top: 4px; }
.proj-rows { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.proj-l { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); }
.proj-l b { font-weight: 600; color: var(--text); }
.proj-l b.pos { color: var(--pos); }



/* ───────── v2.4 ───────── */
/* Un poco más de aire en filas y tarjetas */
.section { margin-top: 26px; }
.row { padding: 12px 16px; min-height: 60px; gap: 13px; }
.row + .row::before { left: 63px; }
.row-main { gap: 3px; }
.day-h { padding: 20px 6px 9px; }
.card.tight { padding: 8px 16px; }
.card.tight .brk { padding: 12px 0; gap: 13px; }
.card.tight .brk + .brk { border-top: 1px solid var(--line); }
.card.tight .brk-bar { margin-top: 9px; }
.brk-top small { font-size: 11.5px; font-weight: 500; color: var(--text-2); margin-right: 3px; }

/* En Movimientos: mismo aire entre filas, pero título y detalle más juntos */
#mov-list .row-main, .bar-day .row-main, .sheet .list .row-main { gap: 1px; }
button.mini { text-align: left; display: block; width: 100%; transition: transform .15s var(--ease-out); }
button.mini:active { transform: scale(.97); }

/* Gráfica por día: gastos en rojo oscuro, ingresos en verde */
:root { --expc: #A93434; }
:root[data-theme="dark"] { --expc: #C8494A; }
.bars .bar i.out { background: var(--expc); opacity: .5; }
.bars .bar i.in { background: var(--pos); opacity: .5; }
.bars .bar.hi i.out, .bars .bar.hi i.in { opacity: .8; }
.bars .bar.sel i.out, .bars .bar.sel i.in { opacity: 1; }
.bars .bar.fut i { opacity: .2; }
.chart-nav .lgd i { background: var(--expc); opacity: .8; }

/* Leyenda de gastos e ingresos y pastillas del día */
.chart-nav .lgds { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 14px; margin-top: 3px; font-size: 11.5px; color: var(--text-2); }
.chart-nav .lgds .lgd { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; }
.chart-nav .lgds .lgd i { width: 8px; height: 8px; border-radius: 50%; opacity: 1; }
.chart-nav .lgds .lgd.in i { background: var(--pos); }
.chart-nav .lgds b { font-weight: 600; color: var(--text); }
.pills { display: inline-flex; gap: 6px; }
.pills button { height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid transparent; transition: background .15s, color .15s; }
.pills .pill-out { color: var(--expc); background: color-mix(in srgb, var(--expc) 14%, transparent); }
.pills .pill-in { color: var(--pos); background: color-mix(in srgb, var(--pos) 14%, transparent); }
.pills .pill-out.on { background: var(--expc); color: #fff; }
.pills .pill-in.on { background: var(--pos); color: #fff; }
.bar-day-h { align-items: center; }

/* Indicadores: texto a la izquierda, icono grande sin fondo a la derecha, centrado en alto */
.ind-sec { margin-top: 6px; }
.mini.ind { position: relative; display: block; }
.mini.ind .ind-txt { display: flex; flex-direction: column; min-width: 0; color: var(--text); white-space: normal; overflow: visible; }
.mini.ind .ind-txt small { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini.ind .ind-txt b { margin-top: 6px; padding-right: 32px; color: var(--text); }
.mini.ind .ind-txt .ind-sub { color: var(--text-2); }
.mini.ind .ind-txt b.neg { color: var(--neg); } .mini.ind .ind-txt b.pos { color: var(--pos); }
.mini.ind .ind-ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; }

/* Detalle del gasto diario */
.avg-hero { border-radius: var(--r-lg); padding: 16px; background: color-mix(in srgb, #4D96FF 12%, var(--surface)); box-shadow: var(--shadow); }
.avg-n { display: flex; align-items: baseline; gap: 6px; font-size: 34px; font-weight: 650; letter-spacing: -.03em; margin-top: 6px; }
.avg-n small { font-size: 14px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.avg-eq { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.avg-eq span { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.avg-eq b { font-size: 14.5px; font-weight: 650; }
.avg-eq small { font-size: 11px; }
.avg-eq i { font-style: normal; color: var(--text-3); font-weight: 600; }
.avg-cmp { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12.5px; font-weight: 600; }
.avg-cmp.up { color: var(--neg); } .avg-cmp.down { color: var(--pos); }

/* Monto: texto dibujado + campo invisible encima; cursor propio a la derecha */
.amount { position: relative; cursor: text; }
.amount .cur { color: var(--text-3); font-weight: 500; }
.amount .amt-view { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount .amt-view.empty { color: var(--text-3); }
.amount.income .amt-view:not(.empty) { color: var(--pos); }
.amount .caret { align-self: center; width: 2.5px; height: .82em; margin-left: 1px; border-radius: 2px; background: var(--text); opacity: 0; }
.amount:focus-within .caret { animation: caretBlink 1.05s steps(1, end) infinite; }
@keyframes caretBlink { 0% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .amount:focus-within .caret { animation-name: none; opacity: 1; } }
.amount .amt-input { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; min-width: 0; margin: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; color: transparent; caret-color: transparent; background: none; cursor: text; }

/* Movimientos con filtro Ingresos: solo el total del día va en verde */
#mov-list.f-income .row-amt.pos { color: var(--text); }
.explain { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 0 6px; line-height: 1.5; }
.explain .ic { flex: none; margin-top: 2px; color: var(--text-3); }

/* Balance del mes */
.proj-nav { margin: 0 0 12px; }
.proj-nav button[disabled] { opacity: .3; pointer-events: none; }
.proj-legend { display: flex; gap: 14px; justify-content: flex-end; font-size: 11px; color: var(--text-2); margin-top: 2px; }
.proj-legend span { display: inline-flex; align-items: center; gap: 5px; }
.proj-legend .ln { width: 14px; height: 0; border-top: 2px solid var(--text); }
.proj-legend .ln.dash { border-top-style: dashed; border-color: var(--text-3); }

/* Tendencia de la proyección */
.proj-chart { position: relative; height: 92px; margin: 14px 0 4px; color: var(--text); }
.proj-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.proj-chart path, .proj-chart line { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.proj-chart .area { fill: url(#proj-fill); stroke: none; }
.proj-chart .real { stroke: var(--text); stroke-width: 2; }
.proj-chart .proj { stroke-width: 2.25; stroke-dasharray: 3 4; }
.proj-chart .dot.now { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; box-shadow: none; }
.proj-chart .dot.end { width: 8px; height: 8px; margin: -4px 0 0 -4px; box-shadow: 0 0 0 2px var(--surface); }
.proj-chart .proj.up { stroke: var(--pos); } .proj-chart .proj.down { stroke: var(--neg); }
.proj-chart .zero { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.proj-chart .dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--surface); }
.proj-chart .dot.end.up { background: var(--pos); } .proj-chart .dot.end.down { background: var(--neg); }
.enter .proj-chart svg { animation: reveal .9s var(--ease-out) backwards; }
.enter .proj-chart .dot { animation: fade .3s ease .7s backwards; }
.proj-x { position: relative; display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); height: 16px; }
.proj-x span[style] { position: absolute; transform: translateX(-50%); color: var(--text-2); font-weight: 600; }

/* ───────── Aviso ───────── */
#toast {
  position: absolute; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: 22px; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  transition: transform .45s var(--ease), opacity .3s ease;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ───────── Accesibilidad ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  #tabbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
