:root {
  --bg: #050505;
  --card: rgba(255, 255, 255, .032);
  --card-2: rgba(255, 255, 255, .06);
  --stroke: rgba(255, 255, 255, .07);
  --stroke-2: rgba(255, 255, 255, .12);
  --text: #f3eee5;
  --mute: rgba(243, 238, 229, .52);
  --faint: rgba(243, 238, 229, .26);
  /* Tema por defecto: NOIR (negro + champagne) */
  --violet: #d8b679;
  --green: #9fd8b4;
  --red: #e8897c;
  --amber: #e8a25c;
  --grad: linear-gradient(135deg, #f7e9c6 0%, #d6b06b 38%, #9c7638 70%, #e8cd93 100%);
  --g1: #f7e9c6; --g2: #d6b06b; --g3: #9c7638;
  --glow-rgb: 214 176 107;
  --acc-rgb: 216 182 121;
  --on-grad: #15110a;
  --on-grad-rgb: 21 17 10;
  --blob1: rgba(214, 176, 107, .13);
  --blob2: rgba(255, 255, 255, .035);
  --blob3: rgba(156, 118, 56, .10);
  --conic: conic-gradient(from 0deg, #f7e9c6, #b8904d, #4d3a1f, #d6b06b, #f7e9c6);
  --conic-soft: conic-gradient(from 0deg, rgba(214, 176, 107, .35), rgba(255, 255, 255, .07), rgba(156, 118, 56, .28), rgba(214, 176, 107, .35));
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --serif: "Instrument Serif", "New York", Georgia, serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  font-family: var(--sans);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow-x: hidden;
  -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Fondo vivo ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; opacity: .5; will-change: transform; }
.aurora i:nth-child(1) { background: radial-gradient(circle, var(--blob1), transparent 60%); top: -45vmax; left: -30vmax; animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: radial-gradient(circle, var(--blob2), transparent 60%); top: -20vmax; right: -50vmax; animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: radial-gradient(circle, var(--blob3), transparent 60%); bottom: -55vmax; left: -20vmax; animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(18vmax, 12vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-22vmax, 18vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(14vmax, -16vmax) scale(1.15); } }
.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Splash ---------- */
#splash { position: fixed; inset: 0; z-index: 100; background: #030304; display: grid; place-items: center; transition: opacity .7s var(--ease), transform .9s var(--ease), filter .7s; }
#splash.out { opacity: 0; transform: scale(1.08); filter: blur(12px); pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo { position: relative; width: 74px; height: 74px; margin: 0 auto 30px; filter: drop-shadow(0 0 26px rgb(var(--glow-rgb) / .55)); }
.splash-ring { position: absolute; inset: 0; border-radius: 50%;
  background: var(--conic);
  -webkit-mask: radial-gradient(circle, transparent 25px, #000 26px); mask: radial-gradient(circle, transparent 25px, #000 26px);
  animation: ringIn 1.1s var(--spring) both, spin 6s linear infinite; }
.splash-dot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 20px #fff; animation: dotIn .6s .5s var(--spring) both; }
@keyframes ringIn { from { transform: scale(.2) rotate(-120deg); opacity: 0; } }
@keyframes dotIn { from { transform: scale(0); } }
@keyframes spin { to { rotate: 360deg; } }
.splash-word { margin: 0; font-weight: 800; font-size: clamp(54px, 17vw, 96px); letter-spacing: -.05em; line-height: .9;
  background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, .55)); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: wordIn 1.1s .25s var(--ease) both; }
@keyframes wordIn { from { letter-spacing: .4em; opacity: 0; filter: blur(14px); } }
.splash-sub { margin: 18px 0 0; font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--mute); animation: fadeUp .8s .9s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Layout ---------- */
#app { position: relative; z-index: 2; max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 120px); }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; padding: 8px 4px 18px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--mute); font-weight: 600; }
.title { margin: 4px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -.04em; }
.title em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--stroke-2); font-weight: 700; font-size: 15px; display: grid; place-items: center; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

.view-enter > * { animation: rise .6s var(--ease) both; }
.view-enter > *:nth-child(2) { animation-delay: .05s; }
.view-enter > *:nth-child(3) { animation-delay: .1s; }
.view-enter > *:nth-child(4) { animation-delay: .15s; }
.view-enter > *:nth-child(5) { animation-delay: .2s; }
.view-enter > *:nth-child(n+6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }

.card { position: relative; background: var(--card); border: 1px solid var(--stroke); border-radius: 26px; padding: 18px; margin-bottom: 14px;
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), transparent 40%); }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-t { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.link { font-size: 13px; color: var(--violet); font-weight: 600; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.tiny { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pressable { transition: transform .25s var(--ease), background .25s; }
.pressable:active { transform: scale(.97); }

/* ---------- Hero de hoy ---------- */
.hero { padding: 22px; }
.hero .big { font-size: 46px; font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.hero .quote { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.15; margin: 4px 0 0; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring .track { stroke: rgba(255, 255, 255, .07); }
.ring .bar { transition: stroke-dashoffset 1.2s var(--ease); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { font-size: 26px; font-weight: 700; letter-spacing: -.04em; display: block; }
.ring .lbl small { font-size: 10px; color: var(--mute); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.stat { background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke); border-radius: 16px; padding: 10px 12px; }
.stat b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.stat span { font-size: 11px; color: var(--mute); }

/* ---------- Items / tareas ---------- */
.item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--stroke); transition: opacity .4s, transform .4s var(--ease); }
.item:first-child { border-top: 0; }
.item.done .it-title { color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--stroke-2); flex: none; display: grid; place-items: center; transition: all .35s var(--spring); }
.check svg { width: 14px; height: 14px; stroke: #111; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.4); transition: all .35s var(--spring); }
.item.done .check { background: var(--grad); border-color: transparent; box-shadow: 0 0 18px rgb(var(--glow-rgb) / .4); }
.item.done .check svg { opacity: 1; transform: scale(1); }
.ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; flex: none; background: rgba(255, 255, 255, .06); border: 1px solid var(--stroke); }
.it-title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.it-sub { font-size: 12.5px; color: var(--mute); margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: var(--mute); }
.pill.hot { background: rgba(255, 107, 139, .14); color: var(--red); }
.pill.cool { background: rgb(var(--acc-rgb) / .14); color: var(--violet); }
.lock-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--on-grad); background: var(--grad); box-shadow: 0 6px 20px rgb(var(--glow-rgb) / .3); letter-spacing: .01em; }
.lock-btn svg { width: 12px; height: 12px; fill: currentColor; }
.empty { text-align: center; padding: 26px 10px 10px; color: var(--mute); }
.empty .serif { font-size: 26px; color: var(--text); font-style: italic; display: block; margin-bottom: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 16px; font-weight: 700; background: var(--card-2); border: 1px solid var(--stroke-2); transition: transform .2s var(--ease), opacity .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--grad); color: var(--on-grad); border: 0; box-shadow: 0 10px 30px rgb(var(--glow-rgb) / .28); }
.btn.block { width: 100%; height: 56px; font-size: 16px; border-radius: 18px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }

/* ---------- Misiones ---------- */
.mini-missions { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 14px; padding: 0 16px 4px; scroll-padding: 0 16px; scrollbar-width: none; }
.mini-missions::-webkit-scrollbar { display: none; }
.mini-m { scroll-snap-align: start; flex: 0 0 74%; margin: 0; }
.mission-head { display: flex; align-items: center; gap: 12px; }
.mission-emoji { width: 50px; height: 50px; border-radius: 17px; display: grid; place-items: center; font-size: 25px; flex: none; }
.mission-name { font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.bar-line { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-top: 14px; }
.bar-line i { display: block; height: 100%; border-radius: inherit; transition: width 1.2s var(--ease); }
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17px, 1fr)); gap: 5px; margin-top: 16px; }
.dsq { aspect-ratio: 1; border-radius: 5px; background: rgba(255, 255, 255, .06); transition: transform .3s var(--spring), background .3s; }
.dsq.off { background: transparent; border: 1px dashed rgba(255, 255, 255, .06); }
.dsq.miss { background: rgba(255, 107, 139, .18); }
.dsq.today { outline: 2px solid #fff; outline-offset: 1px; animation: pulse 2s ease-in-out infinite; }
.dsq.on { box-shadow: 0 0 10px var(--c); }
@keyframes pulse { 50% { outline-color: rgba(255, 255, 255, .35); } }
.legend { display: flex; gap: 14px; margin-top: 12px; font-size: 11.5px; color: var(--mute); flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.mission-big-num { font-size: 52px; font-weight: 700; letter-spacing: -.06em; line-height: 1; }
.countdown { display: flex; gap: 8px; margin-top: 14px; }
.countdown div { flex: 1; text-align: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke); border-radius: 14px; padding: 10px 4px; }
.countdown b { font-size: 20px; font-weight: 700; display: block; letter-spacing: -.03em; }
.countdown span { font-size: 10.5px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.finished-banner { background: var(--grad); color: var(--on-grad); border: 0; }
.finished-banner .muted { color: rgb(var(--on-grad-rgb) / .65); }

/* ---------- Dinero ---------- */
.balance { font-size: 50px; font-weight: 700; letter-spacing: -.06em; line-height: 1; margin: 6px 0 2px; }
.balance small { font-size: 26px; color: var(--mute); font-weight: 600; }
.inout { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.inout div { border-radius: 18px; padding: 12px 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke); }
.inout b { display: block; font-size: 19px; letter-spacing: -.03em; margin-top: 2px; }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 74px; margin-top: 18px; }
.spark div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.spark i { width: 100%; border-radius: 7px; background: rgba(255, 255, 255, .1); min-height: 4px; transition: height 1s var(--ease); }
.spark div.today i { background: var(--grad); }
.spark span { font-size: 10px; color: var(--faint); font-weight: 600; }
.catbar { margin-top: 12px; }
.catbar .row { margin-bottom: 6px; font-size: 13.5px; }
.catbar .bar-line { margin-top: 0; height: 5px; }
.tx-amt { font-weight: 700; letter-spacing: -.02em; }
.tx-amt.inc { color: var(--green); }
.day-label { font-size: 12px; color: var(--mute); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin: 18px 4px 6px; }
.goal { display: flex; align-items: center; gap: 14px; }
.goal .ring { width: 64px; height: 64px; }
.goal .ring circle { stroke-width: 8; }
.goal .ring .lbl b { font-size: 14px; }
.quick-chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Calendario ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h3 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.03em; text-transform: capitalize; }
.cal-head h3 em { font-family: var(--serif); font-weight: 400; color: var(--mute); }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); border: 1px solid var(--stroke); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 11px; color: var(--faint); font-weight: 700; padding-bottom: 6px; }
.cal .d { position: relative; aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; transition: background .25s, transform .25s var(--spring); }
.cal .d:active { transform: scale(.9); }
.cal .d.other { color: var(--faint); opacity: .45; }
.cal .d.today { color: #fff; }
.cal .d.today::after { content: ""; position: absolute; inset: 3px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .5); }
.cal .d.sel { background: var(--grad); color: var(--on-grad); box-shadow: 0 8px 24px rgb(var(--glow-rgb) / .35); }
.cal .dots { display: flex; gap: 3px; height: 5px; margin-top: 3px; }
.cal .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.cal .d.sel .dots i { background: var(--on-grad); }

/* ---------- Tab bar ---------- */
.tabbar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 12px); width: min(calc(100% - 24px), 440px);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 70px; padding: 0 8px; border-radius: 28px;
  background: rgba(18, 17, 24, .62); border: 1px solid var(--stroke-2);
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--faint); transition: color .3s, transform .3s var(--ease); }
.tabbar button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button span { font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.tabbar button.active { color: var(--text); }
.tabbar button:active { transform: scale(.88); }
.tabbar .fab { width: 58px; height: 58px; margin: 0 auto; border-radius: 21px; background: var(--grad); color: var(--on-grad); justify-content: center;
  box-shadow: 0 10px 30px rgb(var(--glow-rgb) / .45), inset 0 1px 0 rgba(255, 255, 255, .5); transform: translateY(-14px); }
.tabbar .fab svg { width: 26px; height: 26px; stroke-width: 2.6; transition: transform .4s var(--spring); }
.tabbar .fab:active { transform: translateY(-14px) scale(.9); }
body.sheet-open .tabbar .fab svg { transform: rotate(45deg); }

/* ---------- Sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .4s var(--ease); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet { position: absolute; left: 50%; bottom: 0; width: min(100%, 560px); max-height: 92vh; overflow-y: auto; transform: translate(-50%, 105%);
  padding: 8px 18px calc(var(--safe-b) + 22px); border-radius: 32px 32px 0 0;
  background: rgba(20, 19, 27, .86); border: 1px solid var(--stroke-2); border-bottom: 0;
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  transition: transform .5s var(--ease); overscroll-behavior: contain; }
.sheet-wrap.open { pointer-events: auto; }
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: translate(-50%, 0); }
.grabber { width: 40px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .2); margin: 4px auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -.04em; }
.sheet h3 em { font-family: var(--serif); font-weight: 400; }
.sheet .label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin: 18px 0 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -18px; padding: 0 18px 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 15px; border-radius: 14px; font-size: 14px; font-weight: 600;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--stroke); transition: all .25s var(--ease); white-space: nowrap; }
.chip:active { transform: scale(.94); }
.chip.on { background: #fff; color: #111; border-color: #fff; box-shadow: 0 6px 20px rgba(255, 255, 255, .15); }
.chip.emoji { width: 48px; height: 48px; padding: 0; justify-content: center; font-size: 22px; border-radius: 16px; }
.chip.color { width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--c); border: 3px solid transparent; }
.chip.color.on { border-color: #fff; box-shadow: 0 0 0 2px var(--bg) inset; }
.field { width: 100%; height: 54px; border-radius: 16px; padding: 0 16px; font-size: 17px; background: rgba(255, 255, 255, .05); border: 1px solid var(--stroke); outline: none; transition: border .2s, background .2s; }
.field:focus { border-color: rgb(var(--acc-rgb) / .6); background: rgba(255, 255, 255, .08); }
.field::placeholder { color: var(--faint); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(255, 255, 255, .05); border-radius: 15px; padding: 4px; border: 1px solid var(--stroke); }
.seg button { height: 38px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--mute); transition: all .3s var(--ease); }
.seg button.on { background: rgba(255, 255, 255, .12); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.amount-display { text-align: center; font-size: 64px; font-weight: 700; letter-spacing: -.06em; margin: 14px 0 4px; min-height: 76px; transition: color .3s; }
.amount-display small { font-size: 32px; color: var(--mute); font-weight: 600; margin-right: 2px; }
.amount-display.bump { animation: bump .25s var(--ease); }
@keyframes bump { 50% { transform: scale(1.04); } }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.numpad button { height: 56px; border-radius: 18px; font-size: 24px; font-weight: 500; background: rgba(255, 255, 255, .045); transition: background .15s, transform .15s; }
.numpad button:active { background: rgba(255, 255, 255, .14); transform: scale(.94); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.quick-tile { aspect-ratio: 1; border-radius: 24px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; text-align: left;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--stroke); transition: transform .3s var(--spring), background .2s; animation: pop .5s var(--spring) both; }
.quick-tile:active { transform: scale(.93); background: rgba(255, 255, 255, .1); }
.quick-tile .qi { font-size: 26px; }
.quick-tile b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.quick-tile small { display: block; font-size: 11px; color: var(--mute); font-weight: 500; }
@keyframes pop { from { opacity: 0; transform: scale(.7) translateY(20px); } }
.actions-list button { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 6px; font-size: 16px; font-weight: 600; border-top: 1px solid var(--stroke); text-align: left; }
.actions-list button:first-child { border-top: 0; }
.actions-list .ai { width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, .06); display: grid; place-items: center; font-size: 17px; }

/* ---------- Focus (Lock in) ---------- */
.focus { position: fixed; inset: 0; z-index: 80; background: #030304; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 30px) 24px calc(var(--safe-b) + 34px); opacity: 0; pointer-events: none; transform: scale(1.05); transition: opacity .6s var(--ease), transform .7s var(--ease); overflow: hidden; }
.focus.open { opacity: 1; pointer-events: auto; transform: none; }
.focus .orb { position: absolute; width: 140vmin; height: 140vmin; left: 50%; top: 50%; margin: -70vmin 0 0 -70vmin; border-radius: 50%;
  background: var(--conic-soft);
  filter: blur(70px); opacity: .45; animation: spin 18s linear infinite, breathe 8s ease-in-out infinite; }
.focus.paused .orb { animation-play-state: paused; opacity: .18; }
@keyframes breathe { 50% { transform: scale(.82); opacity: .3; } }
.focus > *:not(.orb) { position: relative; z-index: 1; }
.focus .f-top { text-align: center; }
.focus .f-kicker { font-size: 12px; font-weight: 800; letter-spacing: .4em; color: rgba(255, 255, 255, .6); }
.focus .f-title { font-family: var(--serif); font-style: italic; font-size: clamp(38px, 11vw, 58px); line-height: 1; margin: 14px 0 0; }
.focus .f-ring { position: relative; width: min(78vw, 330px); aspect-ratio: 1; }
.focus .f-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.focus .f-ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.focus .f-ring .track { stroke: rgba(255, 255, 255, .08); }
.focus .f-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.focus .f-time b { font-size: clamp(64px, 20vw, 92px); font-weight: 300; letter-spacing: -.05em; line-height: 1; }
.focus .f-time span { margin-top: 8px; font-size: 13px; color: var(--mute); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.focus .f-quote { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--mute); text-align: center; min-height: 26px; transition: opacity .6s; }
.focus .f-ctrl { display: flex; gap: 14px; align-items: center; }
.focus .f-ctrl .btn { height: 58px; border-radius: 20px; padding: 0 24px; }
.focus .round { width: 58px; padding: 0; }
.focus.done-state .f-ring { animation: celebrate 1s var(--spring); }
@keyframes celebrate { 40% { transform: scale(1.08); } }

/* ---------- Recap ---------- */
.recap { position: fixed; inset: 0; z-index: 85; background: #040405; overflow-y: auto; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 30px); opacity: 0; pointer-events: none; transition: opacity .6s var(--ease); }
.recap.open { opacity: 1; pointer-events: auto; }
.recap-inner { max-width: 520px; margin: 0 auto; }
.recap .r-kicker { font-size: 12px; font-weight: 800; letter-spacing: .35em; color: var(--mute); text-align: center; }
.recap .r-title { font-size: clamp(48px, 15vw, 76px); font-weight: 800; letter-spacing: -.06em; line-height: .9; text-align: center; margin: 18px 0 8px; }
.recap .r-sub { text-align: center; font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--mute); }
.recap .r-big { text-align: center; margin: 30px 0; }
.recap .r-big b { font-size: 110px; font-weight: 800; letter-spacing: -.08em; line-height: 1; }
.recap .r-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.recap .r-stats .card { margin: 0; }
.recap .r-stats b { font-size: 30px; font-weight: 700; letter-spacing: -.04em; display: block; }
.recap .r-anim > * { animation: rise .8s var(--ease) both; }
.recap .r-anim > *:nth-child(2) { animation-delay: .15s; } .recap .r-anim > *:nth-child(3) { animation-delay: .3s; }
.recap .r-anim > *:nth-child(4) { animation-delay: .45s; } .recap .r-anim > *:nth-child(5) { animation-delay: .6s; }
.recap .r-anim > *:nth-child(n+6) { animation-delay: .75s; }

/* ---------- Toast ---------- */
.toast { position: fixed; z-index: 120; left: 50%; top: calc(var(--safe-t) + 14px); transform: translate(-50%, -150%); padding: 12px 18px; border-radius: 99px;
  background: rgba(30, 28, 38, .85); border: 1px solid var(--stroke-2); font-weight: 600; font-size: 14px; white-space: nowrap;
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); transition: transform .5s var(--spring); }
.toast.show { transform: translate(-50%, 0); }

/* Confeti */
.confetti { position: fixed; z-index: 130; pointer-events: none; width: 8px; height: 12px; border-radius: 2px; top: 40%; left: 50%; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* =========================================================
   TEMA NOIR — lujo: negro profundo, champagne, vidrio fino
   ========================================================= */
html[data-theme="noir"] body { background: radial-gradient(120% 60% at 50% -10%, rgba(214, 176, 107, .10), transparent 60%), var(--bg); }
html[data-theme="noir"] .aurora i { opacity: .9; }
html[data-theme="noir"] .grain { opacity: .08; }
/* tipografía: serif editorial + números finos */
html[data-theme="noir"] .title { font-family: var(--serif); font-weight: 400; font-size: 40px; letter-spacing: -.015em; line-height: 1; }
html[data-theme="noir"] .title em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 4px; }
html[data-theme="noir"] .eyebrow,
html[data-theme="noir"] .card-t,
html[data-theme="noir"] .tiny,
html[data-theme="noir"] .sheet .label { letter-spacing: .24em; font-weight: 500; font-size: 10.5px; }
html[data-theme="noir"] :is(.balance, .mission-big-num, .ring .lbl b, .amount-display, .recap .r-big b, .focus .f-time b, .countdown b, .stat b, .inout b, .recap .r-stats b) { font-weight: 300; letter-spacing: -.04em; }
html[data-theme="noir"] .focus .f-time b { font-weight: 200; }
html[data-theme="noir"] .sheet h3, html[data-theme="noir"] .mission-name, html[data-theme="noir"] .cal-head h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; font-size: 30px; }
html[data-theme="noir"] .mission-name { font-size: 26px; }
html[data-theme="noir"] .cal-head h3 { text-transform: capitalize; }
/* vidrio con filo de luz */
html[data-theme="noir"] .card { border-color: rgba(255, 255, 255, .06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 60px -30px rgba(0, 0, 0, .8); }
html[data-theme="noir"] .card::before { background: linear-gradient(160deg, rgba(247, 233, 198, .07), transparent 35%); }
html[data-theme="noir"] .card::after { content: ""; position: absolute; left: 18%; right: 18%; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(247, 233, 198, .45), transparent); }
html[data-theme="noir"] .finished-banner::after { display: none; }
/* íconos monocromos = más sobrio */
html[data-theme="noir"] :is(.ico, .mission-emoji, .quick-tile .qi, .chip.emoji, .splash-emoji) { filter: grayscale(1) contrast(1.05) brightness(1.15); }
html[data-theme="noir"] .chip.emoji.on { filter: grayscale(1) brightness(.9); }
html[data-theme="noir"] .chip.on { background: var(--text); color: var(--on-grad); border-color: var(--text); box-shadow: 0 6px 22px rgba(247, 233, 198, .12); }
html[data-theme="noir"] .seg button.on { background: rgba(247, 233, 198, .12); }
html[data-theme="noir"] .btn.primary, html[data-theme="noir"] .lock-btn, html[data-theme="noir"] .tabbar .fab {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .25), 0 10px 30px rgb(var(--glow-rgb) / .22); }
html[data-theme="noir"] .tabbar { background: rgba(12, 11, 10, .7); border-color: rgba(255, 255, 255, .08); }
html[data-theme="noir"] .tabbar button.active { color: var(--violet); }
html[data-theme="noir"] .dsq.on { box-shadow: 0 0 8px var(--c); }
html[data-theme="noir"] .item.done .check { box-shadow: 0 0 14px rgb(var(--glow-rgb) / .35); }
html[data-theme="noir"] .hero .quote, html[data-theme="noir"] .empty .serif { color: var(--text); }
/* intro: logo fino y espaciado */
html[data-theme="noir"] #splash { background: radial-gradient(80% 50% at 50% 45%, rgba(214, 176, 107, .08), transparent 70%), #030303; }
html[data-theme="noir"] .splash-word { font-weight: 300; font-size: clamp(38px, 12.5vw, 66px); letter-spacing: .32em; margin-right: -.32em;
  background: linear-gradient(180deg, #fbf3df 0%, #d6b06b 55%, #8e6a33 100%); -webkit-background-clip: text; background-clip: text; animation-name: wordInNoir; }
@keyframes wordInNoir { from { letter-spacing: .9em; opacity: 0; filter: blur(14px); } }
html[data-theme="noir"] .splash-logo { width: 64px; height: 64px; }
html[data-theme="noir"] .splash-ring { -webkit-mask: radial-gradient(circle, transparent 29px, #000 30px); mask: radial-gradient(circle, transparent 29px, #000 30px); }
html[data-theme="noir"] .splash-dot { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #f7e9c6; box-shadow: 0 0 18px #d6b06b; }
html[data-theme="noir"] .splash-sub { letter-spacing: .02em; }
html[data-theme="noir"] .focus { background: radial-gradient(90% 60% at 50% 50%, #0d0b08, #020202); }
html[data-theme="noir"] .focus .f-kicker { color: var(--violet); }
html[data-theme="noir"] .recap { background: radial-gradient(100% 50% at 50% 0%, rgba(214, 176, 107, .12), transparent 60%), #030303; }

/* =========================================================
   TEMA AURORA — el original (violeta, rosa, durazno)
   ========================================================= */
html[data-theme="aurora"] {
  --bg: #060608; --card: rgba(255, 255, 255, .045); --card-2: rgba(255, 255, 255, .07);
  --stroke: rgba(255, 255, 255, .08); --stroke-2: rgba(255, 255, 255, .14);
  --text: #f4f3f7; --mute: rgba(244, 243, 247, .56); --faint: rgba(244, 243, 247, .28);
  --violet: #b69cff; --green: #5ef2c0; --red: #ff6b8b; --amber: #ffc86b;
  --grad: linear-gradient(135deg, #b69cff 0%, #ff7ac6 55%, #ffb36b 100%);
  --g1: #b69cff; --g2: #ff7ac6; --g3: #ffb36b;
  --glow-rgb: 255 122 198; --acc-rgb: 182 156 255; --on-grad: #160e20; --on-grad-rgb: 22 14 32;
  --blob1: rgba(140, 100, 255, .35); --blob2: rgba(255, 90, 170, .22); --blob3: rgba(255, 160, 90, .14);
  --conic: conic-gradient(from 0deg, #b69cff, #ff7ac6, #ffb36b, #b69cff);
  --conic-soft: conic-gradient(from 0deg, rgba(182, 156, 255, .5), rgba(255, 122, 198, .45), rgba(255, 179, 107, .35), rgba(182, 156, 255, .5));
}
html[data-theme="aurora"] .chip.on { background: #fff; }

/* Selector de estilo */
.theme-card { text-align: left; padding: 10px; border-radius: 20px; border: 1px solid var(--stroke); background: var(--card); transition: border-color .3s, transform .25s var(--ease); }
.theme-card:active { transform: scale(.96); }
.theme-card.on { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet) inset; }
.theme-card i { display: block; height: 64px; border-radius: 14px; margin-bottom: 10px; border: 1px solid rgba(255, 255, 255, .08); }
.theme-card[data-theme-prev="noir"] i { background: radial-gradient(60% 80% at 30% 20%, rgba(214, 176, 107, .45), transparent 70%), linear-gradient(135deg, #15120c, #050505); }
.theme-card[data-theme-prev="aurora"] i { background: radial-gradient(60% 80% at 30% 20%, rgba(182, 156, 255, .7), transparent 70%), radial-gradient(60% 80% at 80% 90%, rgba(255, 122, 198, .55), transparent 70%), #0a0810; }
.theme-card b { display: block; font-size: 15px; }
.theme-card small { font-size: 11.5px; color: var(--mute); }
html[data-theme="noir"] .sheet { background: rgba(15, 14, 12, .9); }
html[data-theme="noir"] .toast { background: rgba(24, 22, 18, .88); }
html[data-theme="noir"] .dsq.miss { background: rgba(232, 137, 124, .16); }
