/* Mis Finanzas · Sin Jaula — sistema visual */
:root {
  --bg: #050D0B;
  --bg-2: #08140F;
  --surface: #0D1A16;
  --surface-2: #12231E;
  --surface-3: #183029;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .11);
  --text: #F2F0E8;
  --text-2: #C9D1CC;
  --muted: #84958E;
  --faint: #56665F;
  --gold: #FBC50A;
  --gold-2: #E6B10A;
  --gold-soft: rgba(251, 197, 10, .12);
  --green: #004037;
  --green-2: #0A5446;
  --green-soft: rgba(10, 84, 70, .35);
  --pos: #5FD3A0;
  --pos-soft: rgba(95, 211, 160, .12);
  --neg: #FF7D6E;
  --neg-soft: rgba(255, 125, 110, .12);
  --warn: #FFB547;
  --warn-soft: rgba(255, 181, 71, .12);
  --info: #8FA8FF;
  --info-soft: rgba(143, 168, 255, .12);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nav-bg: rgba(8, 18, 15, .82);
  --glow-1: rgba(10, 84, 70, .45);
  --glow-2: rgba(251, 197, 10, .05);
  --alert-text: #FFD9D3;
  --alert-warn-text: #FFE6C2;
  --toast-err: #3A1512;
  --mark: url(../icons/mark-gold.png);
  color-scheme: dark;
}

/* ── Modo día ── */
:root[data-theme="light"] {
  --bg: #F4F2EB;
  --bg-2: #FBFAF6;
  --surface: #FFFFFF;
  --surface-2: #F4F2EC;
  --surface-3: #EAE6DB;
  --line: rgba(0, 48, 40, .08);
  --line-2: rgba(0, 48, 40, .15);
  --text: #0F201B;
  --text-2: #2F433C;
  --muted: #62736C;
  --faint: #98A49E;
  --gold: #A87D00;
  --gold-2: #E2AE06;
  --gold-soft: rgba(226, 174, 6, .16);
  --pos: #0E8A57;
  --pos-soft: rgba(14, 138, 87, .1);
  --neg: #CF3F33;
  --neg-soft: rgba(207, 63, 51, .09);
  --warn: #B26A00;
  --warn-soft: rgba(226, 150, 20, .13);
  --info: #3D5BD1;
  --info-soft: rgba(61, 91, 209, .09);
  --shadow: 0 18px 50px rgba(0, 48, 40, .12);
  --nav-bg: rgba(251, 250, 246, .86);
  --glow-1: rgba(10, 84, 70, .10);
  --glow-2: rgba(226, 174, 6, .08);
  --alert-text: #5A1A13;
  --alert-warn-text: #5A3A00;
  --toast-err: #FBE3DF;
  --mark: url(../icons/mark-green.png);
  color-scheme: light;
}
:root[data-theme="light"] .row .ic, :root[data-theme="light"] .pocket { box-shadow: none; }
:root[data-theme="light"] .list, :root[data-theme="light"] .card, :root[data-theme="light"] .pocket, :root[data-theme="light"] .kpis { box-shadow: 0 1px 2px rgba(0, 48, 40, .04); }
:root[data-theme="light"] .alert b { color: inherit; }
:root[data-theme="light"] .scrim { background: rgba(10, 30, 25, .35); }

/* La tarjeta principal siempre es verde Sin Jaula */
.hero { --text: #F2F0E8; --text-2: #C9D1CC; --muted: #A9B8B2; --gold: #FBC50A; --pos: #5FD3A0; --neg: #FF9A8D; --line: rgba(255,255,255,.08); color: var(--text); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--glow-1), transparent 60%),
    radial-gradient(600px 400px at -10% 10%, var(--glow-2), transparent 60%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--gold); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .gold { color: var(--gold); } .warn { color: var(--warn); }
.hide { display: none !important; }

/* ── Layout ── */
#app { position: relative; z-index: 1; min-height: 100%; }
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 0 18px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1180px; margin: 0 auto; width: 100%; }
.view { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 0 8px; padding-top: max(18px, env(safe-area-inset-top)); }
.topbar .mark { width: 30px; height: 42px; background: var(--mark) center/contain no-repeat; flex: none; }
.topbar h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.topbar .sub { font-size: 12.5px; color: var(--muted); }
.topbar .sub::first-letter { text-transform: uppercase; }
.topbar .grow { flex: 1; min-width: 0; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); transition: background .2s; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* ── Bottom nav / rail ── */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--nav-bg); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--faint); letter-spacing: .02em; padding: 8px 0; transition: color .2s; }
.nav a svg { width: 23px; height: 23px; }
.nav a.on { color: var(--gold); }
.nav .fab-slot { display: grid; place-items: center; }
.fab {
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; transform: translateY(-10px);
  background: linear-gradient(145deg, #FFD43B, var(--gold-2)); color: #1A1400;
  box-shadow: 0 10px 30px rgba(251, 197, 10, .35), inset 0 1px 0 rgba(255, 255, 255, .5); transition: transform .2s var(--ease);
}
.fab:active { transform: translateY(-10px) scale(.94); }
.fab svg { width: 28px; height: 28px; }
.rail-brand, .nav .lbl-long { display: none; }

@media (min-width: 900px) {
  .shell { padding-left: 232px; }
  .nav {
    top: 0; bottom: 0; right: auto; width: 232px; height: auto; padding: 26px 16px; grid-template-columns: 1fr; grid-auto-rows: min-content; gap: 4px;
    border-top: 0; border-right: 1px solid var(--line); align-content: start;
  }
  .topbar > .mark { display: none; }
  .rail-brand { order: -2; display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
  .rail-brand .mark { width: 30px; height: 42px; background: var(--mark) center/contain no-repeat; }
  .rail-brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
  .rail-brand span { font-size: 11.5px; color: var(--muted); }
  .nav a { flex-direction: row; gap: 14px; font-size: 14px; padding: 12px 14px; border-radius: 14px; color: var(--muted); }
  .nav a:hover { background: var(--surface); color: var(--text); }
  .nav a.on { background: var(--gold-soft); color: var(--gold); }
  .nav .fab-slot { order: -1; display: block; margin-bottom: 18px; }
  .fab { width: 100%; height: 50px; border-radius: 16px; transform: none; display: flex; gap: 10px; font-weight: 700; font-size: 14.5px; }
  .fab:active { transform: scale(.98); }
  .fab svg { width: 22px; height: 22px; }
  .nav .lbl-long { display: inline; }
  .main { padding: 10px 40px 60px; }
  .topbar { padding-top: 26px; }
}

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 26px 24px 22px; margin: 12px 0 14px;
  background: linear-gradient(160deg, #0B4A3F 0%, #063A31 45%, #04261F 100%);
  border: 1px solid rgba(251, 197, 10, .14); box-shadow: var(--shadow); cursor: pointer;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -30px; width: 210px; height: 290px; opacity: .07;
  background: url(../icons/mark-gold.png) center/contain no-repeat; transform: rotate(8deg);
}
.hero .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(242, 240, 232, .65); }
.hero .big { font-size: clamp(46px, 13vw, 68px); font-weight: 700; letter-spacing: -.045em; line-height: 1.02; margin: 8px 0 6px; color: var(--gold); }
.hero .big small { font-size: .42em; letter-spacing: -.02em; color: rgba(251, 197, 10, .7); margin-right: 2px; vertical-align: .6em; }
.hero .why { font-size: 14px; color: var(--text-2); max-width: 46ch; }
.hero .why b { color: var(--text); font-weight: 600; white-space: nowrap; }
.hero.zero .big { color: var(--text); }
.hero .spark { margin: 16px -4px 0; height: 54px; display: block; width: calc(100% + 8px); }
.hero .chip-row { margin-top: 14px; }

.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; margin: 0 0 14px;
  background: var(--neg-soft); border: 1px solid rgba(255, 125, 110, .18); font-size: 14px; color: var(--alert-text);
}
.alert.warn { background: var(--warn-soft); border-color: rgba(255, 181, 71, .2); color: var(--alert-warn-text); }
.alert .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neg); margin-top: 7px; flex: none; box-shadow: 0 0 0 4px rgba(255, 125, 110, .15); }
.alert.warn .dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(255, 181, 71, .15); }
.alert b { color: inherit; font-weight: 700; }

/* ── Pockets strip ── */
.strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
@media (min-width: 640px) { .strip { grid-template-columns: repeat(4, 1fr); } }
.pocket { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: left; transition: background .2s, transform .2s var(--ease); }
.pocket:active { transform: scale(.98); }
.pocket:hover { background: var(--surface-2); }
.pocket .k { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.pocket .k i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pocket .v { font-size: 20px; font-weight: 700; margin-top: 4px; }
.pocket.lock .v { color: var(--info); }

/* ── Sections ── */
.grid2 { display: grid; gap: 0 28px; }
@media (min-width: 1000px) { .grid2 { grid-template-columns: 1.15fr 1fr; } }
.sec { margin: 6px 0 26px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.sec-h h2 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.sec-h .more { font-size: 13px; font-weight: 600; color: var(--gold); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 13px; padding: 13px 16px; width: 100%; text-align: left; transition: background .15s; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 1px solid var(--line); }
.row:hover { background: rgba(255, 255, 255, .02); }
.row:active { background: rgba(255, 255, 255, .04); }
.row .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); font-size: 17px; flex: none; color: var(--text-2); }
.row .ic svg { width: 19px; height: 19px; }
.row .ic.neg { background: var(--neg-soft); color: var(--neg); } .row .ic.pos { background: var(--pos-soft); color: var(--pos); }
.row .ic.gold { background: var(--gold-soft); color: var(--gold); } .row .ic.info { background: var(--info-soft); color: var(--info); } .row .ic.warn { background: var(--warn-soft); color: var(--warn); }
.row .tx { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-weight: 700; font-size: 15px; text-align: right; flex: none; }
.row .amt small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.empty { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 14px; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; letter-spacing: .02em; background: var(--surface-3); color: var(--text-2); }
.tag.neg { background: var(--neg-soft); color: var(--neg); } .tag.pos { background: var(--pos-soft); color: var(--pos); }
.tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.gold { background: var(--gold-soft); color: var(--gold); } .tag.info { background: var(--info-soft); color: var(--info); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 13px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); transition: all .15s; white-space: nowrap; }
.chip.on { background: var(--gold); color: #1A1400; border-color: var(--gold); }
.chip.ghost { background: rgba(0, 0, 0, .2); border-color: rgba(255, 255, 255, .1); }

/* ── Cards / budgets / gap ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 10px; }
.bud { padding: 14px 16px; }
.bud + .bud { border-top: 1px solid var(--line); }
.bud .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.bud .top b { font-weight: 600; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 9px 0 6px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--pos); transition: width .8s var(--ease); }
.bar i.warn { background: var(--warn); } .bar i.neg { background: var(--neg); } .bar i.gold { background: var(--gold); }
.bud .foot { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

.gap-card { padding: 20px; }
.gap-line { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; font-size: 14px; }
.gap-line .v { font-weight: 700; font-size: 17px; }
.gap-bars { display: grid; gap: 8px; margin: 14px 0; }
.gap-bars .lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.gap-bars .b { height: 12px; border-radius: 99px; }
.gap-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.gap-total .v { font-size: 22px; font-weight: 700; }

.domino { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.domino::-webkit-scrollbar { display: none; }
.dom { flex: none; min-width: 150px; padding: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.dom .m { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.dom .f { font-size: 18px; font-weight: 700; color: var(--pos); margin: 2px 0; }
.dom .n { font-size: 12px; color: var(--text-2); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.kpi { background: var(--surface); padding: 14px; }
.kpi .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 17px; font-weight: 700; margin-top: 2px; }

/* ── Segmented / tabs ── */
.seg { display: flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 1; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: all .2s; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }

.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 14px; margin: 6px 0 12px; }
.search svg { width: 18px; color: var(--muted); }
.search input { flex: 1; background: none; border: 0; outline: 0; padding: 13px 0; font-size: 15px; }
.day-h { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 18px 4px 8px; text-transform: capitalize; }

/* ── Sheets ── */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-2); border-top: 1px solid var(--line-2); border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(24px + var(--safe-b)); transform: translateY(100%); transition: transform .38s var(--ease);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
}
.sheet.on { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h3 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.02em; }
.sheet .lead { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
@media (min-width: 900px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw); max-height: 86vh; border-radius: 26px; border: 1px solid var(--line-2);
    transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .3s var(--ease), opacity .25s; }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
}

/* ── Forms ── */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 2px 6px; letter-spacing: .02em; }
.inp, select.inp, textarea.inp {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 13px 14px; font-size: 15.5px; outline: none; transition: border .15s, background .15s;
  appearance: none; -webkit-appearance: none;
}
select.inp { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.inp:focus { border-color: rgba(251, 197, 10, .55); background: var(--surface-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.amount-in { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 8px 0 14px; }
.amount-in span { font-size: 30px; color: var(--muted); font-weight: 600; }
.amount-in input { width: 2.2ch; min-width: 1.2ch; max-width: 100%; background: none; border: 0; outline: 0; font-size: 52px; font-weight: 700; letter-spacing: -.04em; text-align: left; color: var(--text); }
.amount-in input::placeholder { color: var(--faint); }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); font-size: 14.5px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 18px; border-radius: 16px; font-weight: 700; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line-2); transition: transform .15s, background .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(145deg, #FFD43B, var(--gold-2)); color: #1A1400; border: 0; box-shadow: 0 8px 24px rgba(251, 197, 10, .22); }
.btn.danger { color: var(--neg); background: var(--neg-soft); border-color: transparent; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions .btn { flex: 1; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
.quick button { padding: 16px 8px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; transition: transform .15s, background .2s; }
.quick button:active { transform: scale(.96); }
.quick button:hover { background: var(--surface-2); }
.quick .qi { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; }
.quick .qi svg { width: 21px; height: 21px; }
.nl { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid rgba(251, 197, 10, .25); border-radius: 18px; padding: 6px 6px 6px 14px; }
.nl input { flex: 1; background: none; border: 0; outline: 0; font-size: 15.5px; padding: 10px 0; min-width: 0; }
.nl button { width: 44px; height: 44px; border-radius: 14px; background: var(--gold); color: #1A1400; display: grid; place-items: center; flex: none; }
.nl button svg { width: 20px; height: 20px; }
.nl-hint { font-size: 12px; color: var(--muted); margin: 8px 4px 0; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--gold); background: var(--gold-soft); padding: 4px 9px; border-radius: 99px; }

.breakdown .line { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.breakdown .line small { display: block; color: var(--muted); font-size: 12px; }
.breakdown .line.total { border: 0; font-weight: 700; font-size: 17px; }

/* ── Auth ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 30px 22px; }
.auth-box { width: min(400px, 100%); text-align: center; }
.auth-logo { width: 86px; height: 86px; margin: 0 auto 18px; border-radius: 50%; background: url(../icons/icon-192.png) center/cover; box-shadow: 0 16px 50px rgba(251, 197, 10, .18); }
.auth h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.03em; }
.auth p { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.auth form { text-align: left; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 10px 0 26px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); transition: all .15s; }
.pin-dots i.on { background: var(--gold); border-color: var(--gold); transform: scale(1.1); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; justify-content: center; }
.keypad button { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-size: 26px; font-weight: 600; transition: background .1s, transform .1s; }
.keypad button:active { background: var(--surface-3); transform: scale(.94); }
.keypad button.fn { background: none; border: 0; font-size: 13px; color: var(--muted); }

/* ── Toast ── */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); transform: translate(-50%, 20px); z-index: 60; opacity: 0; transition: all .3s var(--ease);
  background: var(--surface-3); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--toast-err); border-color: rgba(255, 125, 110, .3); color: var(--alert-text); }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + 116px); } }

.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; margin: 12px 0; }
@keyframes sk { to { background-position: -200% 0; } }
.offline-pill { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 70; background: var(--warn); color: #241600; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 99px; }
.pad-top { height: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.theme-seg { margin: 10px 0 0; }
html.theme-anim, html.theme-anim * { transition: background-color .35s, color .35s, border-color .35s !important; }

/* ── v1.2 ── */
.tools-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tools-row::-webkit-scrollbar { display: none; }
.tools-row .chip { color: var(--text-2); display: inline-flex; align-items: center; }
.split { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); margin: -4px 2px 14px; min-height: 18px; }
.split i, .lg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.split b { color: var(--text); }
.act-line { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; font-size: 14px; }
.act-n { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--gold-soft); color: var(--gold); }
.act-n.pos { background: var(--pos-soft); color: var(--pos); } .act-n.neg { background: var(--neg-soft); color: var(--neg); }
.week-card { border-color: rgba(251, 197, 10, .18); }
.nl .mic { background: var(--surface-3); color: var(--text-2); }
.nl .mic.on { background: var(--neg); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 125, 110, .15); } }

.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; min-height: 30vh; }
.msg { max-width: 86%; padding: 12px 15px; border-radius: 20px; font-size: 14.5px; line-height: 1.5; animation: viewIn .3s var(--ease); }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; } .msg ul { margin: 4px 0 6px; padding-left: 18px; } .msg li { margin: 2px 0; }
.msg.user { align-self: flex-end; background: linear-gradient(145deg, #FFD43B, var(--gold-2)); color: #1A1400; border-bottom-right-radius: 6px; font-weight: 500; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.err { color: var(--neg); }
.msg-sep { align-self: center; font-size: 11.5px; color: var(--faint); margin: 6px 0; }
.typing { display: flex; gap: 5px; padding: 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-sugg { margin: 12px 0; }
.chat-sugg .chip { white-space: normal; text-align: left; }
.chat-in { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); box-shadow: var(--shadow); background: var(--surface); z-index: 5; }
@media (min-width: 900px) { .chat-in { bottom: 20px; } .chat { max-width: 760px; } }

.ad-card + .ad-card { margin-top: 10px; }
.ad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 4px; }
.ad-grid div { display: flex; flex-direction: column; gap: 2px; } .ad-grid span { font-size: 11px; color: var(--muted); font-weight: 600; } .ad-grid b { font-size: 15px; }
@media (max-width: 420px) { .ad-grid { grid-template-columns: repeat(2, 1fr); } }

.sim-row { margin-bottom: 16px; }
.sim-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 8px; } .sim-top span { color: var(--text-2); }
input[type=range] { width: 100%; accent-color: var(--gold); height: 28px; }
.big-num { font-size: 38px; font-weight: 700; letter-spacing: -.04em; margin: 2px 0; }

.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.cal-h, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h span { text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); padding: 4px 0 8px; }
.cal-d { min-height: 64px; border-radius: 12px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface-2); transition: background .15s; }
.cal-d.empty { background: none; }
.cal-d:hover { background: var(--surface-3); }
.cal-d.past { opacity: .7; }
.cal-d.today { outline: 2px solid var(--gold); outline-offset: -2px; }
.cal-d .n { font-size: 13px; font-weight: 700; }
.cal-d .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.cal-d .dots i { width: 6px; height: 6px; border-radius: 50%; }
.cal-d .amt { font-size: 10px; font-weight: 700; }
@media (min-width: 900px) { .cal-d { min-height: 86px; } .cal-d .amt { font-size: 12px; } }

.tbars { display: flex; gap: 10px; align-items: flex-end; height: 150px; }
.tb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.tb-bars { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.tb-bars i { width: 42%; max-width: 18px; border-radius: 5px 5px 2px 2px; min-height: 2px; transition: height .6s var(--ease); }
.tb span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.cbar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); margin: 9px 0 6px; }
.cbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--gold); }
.cbar s, .cbar u { position: absolute; top: -3px; width: 2px; height: 14px; border-radius: 2px; }
.cbar s { background: var(--text-2); opacity: .55; } .cbar u { background: var(--neg); }
.kpis4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .kpis4 { grid-template-columns: repeat(4, 1fr); } }
.kpi .d { font-size: 12px; font-weight: 700; margin-top: 2px; }
details > summary { list-style: none; } details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '›'; display: inline-block; margin-right: 8px; transition: transform .2s; }
details[open] > summary::before { transform: rotate(90deg); }
.grid2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .grid2 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.grid2 > div { min-width: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }
