/* ===== Meezan v20 — private-banking dark, jade/teal =====
   Dark is primary; light mirrors it in cool ivory. Money is set in the
   system serif (New York on iPhone — no font download, works offline). */
:root{
  --bg:#080c0b; --bg-glow:rgba(52,196,166,.075);
  --surface:#0f1513; --surface-2:#161e1b; --surface-hi:#1b2521;
  --ink:#eef3f0; --ink-2:#c1ccc6; --muted:#83918a;
  --line:rgba(220,255,240,.075); --track:#1f2925; --track-2:#2a3631;
  --accent:#3cc4a6; --accent-2:#86dcc8; --accent-soft:rgba(60,196,166,.14); --on-accent:#03201a;
  --pos:#9ad6a6; --neg:#ef8b7d; --warn:#e0b25e;
  --shadow-sm:0 1px 0 rgba(255,255,255,.035) inset;
  --shadow:0 1px 0 rgba(255,255,255,.04) inset,0 14px 34px rgba(0,0,0,.42);
  --shadow-lg:0 26px 64px rgba(0,0,0,.65);
  --r-sm:14px; --r-md:22px; --r-lg:28px;
  --serif:"New York",ui-serif,"Iowan Old Style","Palatino Linotype",Georgia,serif;
  --num:"tnum" 1,"lnum" 1;
  color-scheme:dark;
}
@media (prefers-color-scheme: light){
  :root{
    --bg:#f3f6f4; --bg-glow:rgba(15,125,108,.07);
    --surface:#fcfefd; --surface-2:#ecf1ee; --surface-hi:#ffffff;
    --ink:#0f1a16; --ink-2:#3e4c46; --muted:#7c8a84;
    --line:rgba(15,26,22,.085); --track:#e2e9e5; --track-2:#d2dcd7;
    --accent:#0f7d6c; --accent-2:#2a9d88; --accent-soft:rgba(15,125,108,.11); --on-accent:#ffffff;
    --pos:#2c8754; --neg:#c4473a; --warn:#a87516;
    --shadow-sm:0 1px 2px rgba(10,40,30,.05);
    --shadow:0 1px 2px rgba(10,40,30,.04),0 12px 30px rgba(10,40,30,.06);
    --shadow-lg:0 20px 50px rgba(10,40,30,.16);
    color-scheme:light;
  }
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--ink); -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
body::before{content:"";position:fixed;top:-30%;left:50%;transform:translateX(-50%);
  width:120%;height:60%;background:radial-gradient(50% 60% at 50% 0,var(--bg-glow),transparent 70%);
  pointer-events:none;z-index:0}
#app{position:relative;z-index:1;max-width:520px;margin:0 auto;min-height:100vh;padding-bottom:104px}
.tabular,.hero-num b,.stat strong,.tx-amt,.leg-val,.grp strong,.donut-val,.line strong,.cat-row-top span:last-child{font-feature-settings:var(--num)}

/* ---------- top bar ---------- */
.topbar{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;
  padding:calc(env(safe-area-inset-top) + 18px) 20px 12px;
  background:linear-gradient(var(--bg) 62%,transparent)}
.greet .hi{margin:0;font-size:12.5px;color:var(--muted);font-weight:500;letter-spacing:.01em}
.greet h1{margin:2px 0 0;font-size:23px;font-weight:750;letter-spacing:-.025em;display:flex;align-items:baseline;gap:8px}
.greet h1 .ar{font-size:14px;color:var(--muted);font-weight:500}
.icon-btn{width:44px;height:44px;border:none;border-radius:15px;background:var(--surface);color:var(--ink);
  font-size:20px;box-shadow:var(--shadow-sm);cursor:pointer;display:grid;place-items:center;transition:transform .15s,box-shadow .15s}
.icon-btn:active{transform:scale(.92)}
.topbar .icon-btn{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#04231f;font-size:26px;font-weight:700;
  box-shadow:0 6px 18px -4px color-mix(in srgb,var(--accent) 60%,transparent)}

.screen{padding:6px 16px 24px;display:flex;flex-direction:column;gap:14px;animation:screen .34s cubic-bezier(.22,1,.36,1)}
@keyframes screen{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- month pill ---------- */
.month-switch{display:inline-flex;align-self:center;align-items:center;gap:2px;background:var(--surface);
  border:1px solid var(--line);border-radius:999px;padding:4px;box-shadow:var(--shadow-sm)}
.month-label{font-weight:650;font-size:14px;min-width:104px;text-align:center}
.chip{width:32px;height:32px;border:none;background:transparent;border-radius:999px;color:var(--ink-2);font-size:17px;cursor:pointer;transition:background .15s}
.chip:active{background:var(--surface-2)} .chip:disabled{opacity:.3}

/* ---------- hero ---------- */
.hero{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:20px;box-shadow:var(--shadow);
  position:relative;overflow:hidden}
.hero::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:radial-gradient(120% 80% at 100% 0,var(--accent-soft),transparent 55%)}
.hero-top{display:flex;align-items:center;justify-content:space-between;position:relative;z-index:1;margin-bottom:6px}
.hero-top .lbl{font-size:12.5px;color:var(--muted);font-weight:600;letter-spacing:.02em;text-transform:uppercase}
.hero-main{display:flex;align-items:center;justify-content:space-between;gap:16px;position:relative;z-index:1}
.hero-num{font-size:15px;color:var(--muted);font-weight:600}
.hero-num b{display:block;font-size:40px;font-weight:800;letter-spacing:-.03em;color:var(--ink);line-height:1.05;margin-top:2px}
.hero-num .cur{font-size:15px;color:var(--muted);font-weight:600;letter-spacing:0}
.hero-delta{margin-top:8px;font-size:12.5px;font-weight:600;display:inline-flex;align-items:center;gap:5px;
  padding:3px 9px;border-radius:999px;background:var(--surface-2)}
.hero-delta.up{color:var(--neg)} .hero-delta.down{color:var(--pos)}
.ring{width:96px;height:96px;flex:0 0 auto}
.ring-pct{fill:var(--ink);font-size:19px;font-weight:800;font-feature-settings:var(--num)}
.ring-lbl{fill:var(--muted);font-size:8.5px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}
.hero-stats{display:flex;gap:10px;margin-top:18px;position:relative;z-index:1}
.hero-stats .hs{flex:1;background:var(--surface-2);border-radius:var(--r-sm);padding:11px 12px}
.hero-stats .hs span{font-size:11.5px;color:var(--muted);display:block}
.hero-stats .hs strong{font-size:16px;font-weight:700;letter-spacing:-.01em;font-feature-settings:var(--num)}
.hs .pos{color:var(--pos)} .hs .neg{color:var(--neg)}

/* ---------- panels ---------- */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);padding:18px;box-shadow:var(--shadow)}
.panel h2{margin:0 0 14px;font-size:14.5px;font-weight:700;letter-spacing:-.01em}
.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.panel-head h2{margin:0}
.link{border:none;background:none;color:var(--accent);font-size:13px;font-weight:650;cursor:pointer;padding:4px 0}
.muted{color:var(--muted)} .small{font-size:12px;line-height:1.5} .center{text-align:center;padding:20px 0}

/* ---------- donut ---------- */
.donut-wrap{display:flex;gap:18px;align-items:center;flex-wrap:wrap}
.donut{width:132px;height:132px;flex:0 0 auto}
.donut .seg{transition:stroke-dashoffset .5s cubic-bezier(.22,1,.36,1)}
.donut-val{fill:var(--ink);font-size:17px;font-weight:800;font-feature-settings:var(--num)}
.donut-lbl{fill:var(--muted);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.06em}
.legend{flex:1;min-width:150px;display:flex;flex-direction:column;gap:10px}
.leg{display:flex;align-items:center;gap:9px;font-size:13px}
.leg .dot{width:9px;height:9px;border-radius:3px;flex:0 0 auto}
.leg-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2);font-weight:500}
.leg-val{color:var(--ink);font-weight:600}

/* ---------- transactions ---------- */
.tx{display:flex;align-items:center;gap:13px;padding:11px 6px;border-radius:14px;cursor:pointer;transition:background .15s,transform .1s}
.tx:active{transform:scale(.985);background:var(--surface-2)}
.tx + .tx{border-top:1px solid var(--line)}
.tx-ic{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;font-size:19px;flex:0 0 auto}
.tx-mid{flex:1;min-width:0}
.tx-merchant{font-weight:650;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}
.tx-sub{font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:1px}
.tx-amt{text-align:right;font-size:14.5px;font-weight:700;letter-spacing:-.01em}
.tx-amt .pos{color:var(--pos)}
.tx-amt .orig{display:block;font-size:11px;color:var(--muted);font-weight:500;margin-top:1px}
.day-head{font-size:11.5px;color:var(--muted);font-weight:700;margin:16px 4px 4px;text-transform:uppercase;letter-spacing:.06em}

/* ---------- filters ---------- */
.filters{display:flex;gap:10px}
.filters.wrap{flex-wrap:wrap}
.filters.wrap .search{flex:1 1 100%}
.filters.wrap .select.half{flex:1 1 0;min-width:0}
.back-chip{background:var(--surface);border:1px solid var(--line);margin-right:12px;flex:0 0 auto;
  width:38px;height:38px;font-size:20px;box-shadow:var(--shadow-sm)}
.topbar{gap:0}
.linky{cursor:pointer;user-select:none;-webkit-user-select:none}
.linky:active{opacity:.65}
/* ---- everything-clickable pass (v16) ---- */
.grp-caret{display:inline-block;transition:transform .18s ease;color:var(--muted);font-weight:700;margin-right:2px}
.grp-caret.open{transform:rotate(90deg)}
.acct-grp-list{background:var(--surface-2);border-radius:var(--r-sm);padding:0 12px;margin:2px 0 6px;
  animation:acctIn .18s ease}
@keyframes acctIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.acct-sub{font-size:13px;padding:10px 0}
.acct-grp-list .line:last-child{border-bottom:none}
.icard.linky:active{transform:scale(.985)}
.icard-go{color:var(--muted);font-size:16px;font-weight:700;margin-left:6px}
.hs.linky:active{transform:scale(.97)}
.panel-head.linky:active h2{opacity:.65}
.month-label.linky{color:var(--accent)}
.bill-chip-sub{display:flex;justify-content:space-between;align-items:center;gap:8px}
.bill-chip .mini-add{flex:0 0 auto}
svg .seg.linky{pointer-events:visibleStroke}
svg .seg.linky:active{opacity:.65}
/* ---- gestures (v17): swipe / long-press / pull-to-refresh ---- */
.swipe-wrap{position:relative;overflow:hidden;border-radius:var(--r-sm)}
.swipe-wrap .tx{position:relative;z-index:1;background:var(--surface);touch-action:pan-y;
  transition:transform .18s ease,background .15s;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.swipe-wrap .tx:active{background:var(--surface-2)}
.swipe-wrap .tx.swiping{transition:none}
.swipe-wrap + .swipe-wrap .tx{border-top:1px solid var(--line)} /* keep the row separators */
.swipe-under{position:absolute;inset:0;display:flex;align-items:center;font-size:12.5px;font-weight:700;
  color:#fff;opacity:0;transition:opacity .12s;pointer-events:none}
.swipe-under.left{justify-content:flex-end;padding-right:16px;background:var(--neg)}
.swipe-under.right{justify-content:flex-start;padding-left:16px;background:var(--accent)}
.swipe-wrap.will-del .swipe-under.left{opacity:1}
.swipe-wrap.will-cat .swipe-under.right{opacity:1}
.cat-pick{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cat-pick-btn{display:flex;align-items:center;gap:9px;padding:11px 12px;border-radius:var(--r-sm);
  border:1px solid var(--line);background:var(--surface-2);color:var(--text);font-size:13.5px;font-weight:600;
  text-align:left;cursor:pointer}
.cat-pick-btn:active{transform:scale(.97)}
.cat-pick-btn.cur{border-color:var(--accent);background:var(--accent-soft)}
.cpb-ic{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;font-size:15px;flex:0 0 auto}
.pick-all{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--muted);margin-bottom:12px;cursor:pointer}
.pick-all input{width:17px;height:17px;accent-color:var(--accent)}
.ptr{position:fixed;top:0;left:50%;transform:translate(-50%,-46px);z-index:60;width:38px;height:38px;
  border-radius:50%;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow-sm);
  display:grid;place-items:center;font-size:19px;color:var(--muted);opacity:0;pointer-events:none}
.ptr.armed{color:var(--accent);border-color:var(--accent)}
.ptr.spin{animation:ptrSpin .7s linear infinite}
@keyframes ptrSpin{to{transform:translate(-50%,34px) rotate(360deg)}}
.toast-act{margin-left:12px;padding:5px 12px;border-radius:999px;border:none;cursor:pointer;
  background:var(--accent);color:#04211d;font-weight:750;font-size:12.5px}
.area-tap{cursor:pointer}
/* ---- bills calendar (v18) ---- */
.seg{display:flex;background:var(--surface-2);border-radius:999px;padding:3px;gap:2px}
.seg-btn{border:none;background:transparent;color:var(--muted);font-size:12.5px;font-weight:650;
  padding:5px 12px;border-radius:999px;cursor:pointer}
.seg-btn.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
.bills-cal{margin:4px 0 10px}
.bc-head{display:grid;grid-template-columns:repeat(7,1fr);text-align:center;
  font-size:10.5px;font-weight:650;color:var(--muted);margin-bottom:4px}
.bc-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.bc-cell{position:relative;min-height:44px;border-radius:10px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:2px;font-size:13px;font-feature-settings:var(--num)}
.bc-cell.off{visibility:hidden}
.bc-cell.today{box-shadow:inset 0 0 0 1.5px var(--accent);font-weight:750}
.bc-cell.has{background:var(--surface-2)}
.bc-cell.sel{background:var(--accent-soft);box-shadow:inset 0 0 0 1.5px var(--accent)}
.bc-dots{display:flex;gap:2.5px}
.bc-dot{width:5.5px;height:5.5px;border-radius:50%;display:inline-block}
.bc-dot.paid{background:var(--accent)}
.bc-dot.upcoming{background:transparent;box-shadow:inset 0 0 0 1.4px var(--accent)}
.bc-dot.overdue{background:var(--neg)}
.bills-cal.bc-mini .bc-cell{min-height:30px;font-size:11px;border-radius:7px}
.bills-cal.bc-mini .bc-dot{width:4.5px;height:4.5px}
.bills-cal.bc-mini{margin-bottom:6px}
.tx-summary{display:flex;justify-content:space-between;align-items:center;font-size:12.5px;color:var(--muted);
  font-weight:600;padding:0 4px;font-feature-settings:var(--num)}
.tx-summary .pos{color:var(--pos)}
.acct-jumpbar{display:flex;justify-content:space-between;align-items:center;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r-sm);padding:10px 13px;font-size:13px}
.acct-jumpbar b{font-feature-settings:var(--num)}
.acct-jumpbar span:last-child{display:flex;gap:8px}
.day-head{display:flex;justify-content:space-between;align-items:baseline}
.day-tot{font-size:11px;font-weight:600;color:var(--muted);font-feature-settings:var(--num);text-transform:none;letter-spacing:0}
.day-tot .pos{color:var(--pos)}
.search{flex:1;padding:12px 15px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font-size:14px}
.search:focus,input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.select,select{padding:12px 12px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font-size:14px}

/* ---------- analysis ---------- */
.bars{width:100%;display:block}
.bar-x{fill:var(--muted);font-size:3.6px;font-weight:600} .bar-x.on{fill:var(--ink)}
.cat-row{margin-bottom:14px}
.cat-row-top{display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px;font-weight:500}
.cat-row-top span:last-child{color:var(--muted);font-weight:600}
.meter{height:9px;background:var(--track);border-radius:7px;overflow:hidden}
.meter-fill{height:100%;border-radius:7px;transition:width .5s cubic-bezier(.22,1,.36,1)}
.line{display:flex;justify-content:space-between;align-items:center;padding:11px 0;border-bottom:1px solid var(--line);font-size:14px}
.line:last-child{border-bottom:none}
.line strong{font-weight:700}
.badge{background:var(--surface-2);border-radius:999px;padding:3px 11px;font-size:12px;color:var(--ink-2);font-weight:600}
.grp-summary{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin-bottom:16px}
.grp{background:var(--surface-2);border-radius:var(--r-sm);padding:12px}
.grp span{font-size:11px;color:var(--muted);display:block;margin-bottom:3px}
.grp strong{font-size:15.5px;font-weight:750;letter-spacing:-.01em}
.grp .pos{color:var(--pos)} .grp .neg{color:var(--neg)}

/* ---------- settings ---------- */
.field{display:flex;flex-direction:column;gap:7px;margin-bottom:14px}
.field>span{font-size:12px;color:var(--muted);font-weight:500}
.field input,.field select,.field textarea,.rev input,.rev select{
  padding:12px 13px;border:1px solid var(--line);border-radius:13px;background:var(--surface-2);color:var(--ink);font-size:14px;width:100%;font-family:inherit}
.rate-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.rate{display:flex;align-items:center;gap:8px;background:var(--surface-2);border:1px solid var(--line);border-radius:13px;padding:7px 12px}
.rate span{font-size:13px;width:40px;color:var(--muted);font-weight:600}
.rate input{border:none;background:none;color:var(--ink);width:100%;font-size:14px;padding:4px 0}
.rate input:focus{box-shadow:none}
.cat-edit{display:grid;grid-template-columns:44px 38px 1fr 96px 30px;gap:7px;align-items:center;margin-bottom:11px;padding-bottom:11px;border-bottom:1px solid var(--line)}
.cat-edit input,.cat-edit select{padding:9px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--ink);font-size:13px;width:100%}
.cat-color{padding:2px !important;height:38px}
.cat-group{font-size:12px !important;padding:9px 4px !important}
.cat-kw{grid-column:1/-1}
.row-btns{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px}
.btn{padding:12px 17px;border-radius:14px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink);
  font-size:14px;font-weight:650;cursor:pointer;transition:transform .12s,filter .15s}
.btn:active{transform:scale(.97)}
.btn.primary{background:linear-gradient(135deg,var(--accent),var(--accent-2));border-color:transparent;color:#04231f;
  box-shadow:0 8px 20px -6px color-mix(in srgb,var(--accent) 55%,transparent)}
.btn.ghost{background:var(--surface-2)}
.btn.danger-outline{color:var(--neg);border-color:color-mix(in srgb,var(--neg) 35%,transparent);background:transparent}
.mini{border:none;border-radius:10px;background:var(--surface-2);color:var(--muted);cursor:pointer;height:36px}
.mini.danger{color:var(--neg)}

/* ---------- floating tab bar ---------- */
.tabbar{position:fixed;bottom:calc(env(safe-area-inset-bottom) + 14px);left:16px;right:16px;max-width:488px;margin:0 auto;
  display:flex;background:color-mix(in srgb,var(--surface) 86%,transparent);backdrop-filter:blur(18px) saturate(1.4);
  -webkit-backdrop-filter:blur(18px) saturate(1.4);border:1px solid var(--line);border-radius:22px;
  padding:8px 6px;z-index:6;box-shadow:var(--shadow-lg)}
.tab{flex:1;border:none;background:none;color:var(--muted);font-size:10px;display:flex;flex-direction:column;
  align-items:center;gap:4px;padding:5px 0;cursor:pointer;font-weight:650;border-radius:15px;transition:color .15s}
.tab span{font-size:19px;transition:transform .2s}
.tab.active{color:var(--accent)}
.tab.active span{transform:translateY(-1px) scale(1.06)}

/* ---------- modal / sheet ---------- */
.overlay{position:fixed;inset:0;background:rgba(4,8,14,.55);backdrop-filter:blur(4px);display:flex;
  align-items:flex-end;justify-content:center;z-index:20;animation:fade .2s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}
.sheet{background:var(--surface);width:100%;max-width:520px;max-height:92vh;border-radius:26px 26px 0 0;
  display:flex;flex-direction:column;overflow:hidden;box-shadow:var(--shadow-lg);border:1px solid var(--line);border-bottom:none;
  animation:slideup .34s cubic-bezier(.22,1,.36,1)}
@keyframes slideup{from{transform:translateY(100%)}to{transform:none}}
.sheet::before{content:"";width:38px;height:4px;border-radius:99px;background:var(--track-2);position:absolute;top:9px;left:50%;transform:translateX(-50%)}
.sheet-head{display:flex;align-items:center;justify-content:space-between;padding:22px 20px 8px}
.sheet-head h2{margin:0;font-size:18px;font-weight:750;letter-spacing:-.02em}
.sheet-body{padding:8px 20px 20px;overflow-y:auto}
.sheet-foot{display:flex;gap:10px;padding:14px 20px calc(env(safe-area-inset-bottom) + 16px);border-top:1px solid var(--line)}
.sheet-foot .btn{flex:1;padding:14px} .sheet-foot .btn.primary{flex:2}

.drop{display:block;border:1.5px dashed var(--track-2);border-radius:18px;padding:26px;text-align:center;cursor:pointer;
  background:var(--surface-2);transition:border-color .15s,background .15s}
.drop:active{border-color:var(--accent);background:var(--accent-soft)}
.drop-inner{display:flex;flex-direction:column;gap:6px;align-items:center}
.drop-ic{font-size:36px}
.drop strong{font-size:15px;font-weight:700}
.drop span{font-size:12px;color:var(--muted);max-width:260px}
.or{text-align:center;color:var(--muted);font-size:12px;margin:16px 0;position:relative}
textarea{resize:vertical}

.busy{display:flex;align-items:center;gap:12px;padding:14px 20px;color:var(--ink-2);font-size:14px}
.spin{width:20px;height:20px;border:2.5px solid var(--track);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.err{margin:0 20px 8px;background:color-mix(in srgb,var(--neg) 12%,var(--surface));color:var(--neg);
  border:1px solid color-mix(in srgb,var(--neg) 30%,transparent);padding:11px 13px;border-radius:13px;font-size:13px;line-height:1.4}

/* =============== v3 additions =============== */

/* svg tab icons */
.tab-ic{display:block;width:21px;height:21px}
.tab-ic svg{width:100%;height:100%}
.tab.active .tab-ic{filter:drop-shadow(0 2px 6px color-mix(in srgb,var(--accent) 50%,transparent))}

/* insight cards carousel */
.carousel{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding:2px 2px 6px;
  margin:0 -16px;padding-left:16px;padding-right:16px;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.carousel::-webkit-scrollbar{display:none}
.icard{flex:0 0 78%;max-width:300px;scroll-snap-align:start;border-radius:var(--r-md);padding:14px 15px;
  border:1px solid var(--line);background:var(--surface);box-shadow:var(--shadow);position:relative;overflow:hidden}
.icard::before{content:"";position:absolute;inset:0;opacity:.16;pointer-events:none}
.icard.bad::before{background:radial-gradient(120% 100% at 100% 0,var(--neg),transparent 60%)}
.icard.warn::before{background:radial-gradient(120% 100% at 100% 0,#f59e0b,transparent 60%)}
.icard.good::before{background:radial-gradient(120% 100% at 100% 0,var(--pos),transparent 60%)}
.icard.info::before{background:radial-gradient(120% 100% at 100% 0,var(--accent),transparent 60%)}
.icard-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.icard-ic{font-size:20px}
.icard-stat{font-weight:800;font-size:15px;letter-spacing:-.01em;font-feature-settings:var(--num)}
.icard.bad .icard-stat{color:var(--neg)} .icard.warn .icard-stat{color:#d97706}
.icard.good .icard-stat{color:var(--pos)} .icard.info .icard-stat{color:var(--accent)}
.icard-title{font-weight:700;font-size:13.5px;letter-spacing:-.01em;margin-bottom:3px}
.icard-body{font-size:12px;color:var(--muted);line-height:1.45}

/* bills strip */
.bills-strip{display:flex;gap:10px;overflow-x:auto;margin:0 -16px;padding:2px 16px 6px;scrollbar-width:none}
.bills-strip::-webkit-scrollbar{display:none}
.bill-chip{flex:0 0 auto;min-width:170px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-sm);
  padding:11px 13px;box-shadow:var(--shadow-sm);cursor:pointer}
.bill-chip.overdue{border-color:color-mix(in srgb,var(--neg) 45%,transparent)}
.bill-chip-top{display:flex;justify-content:space-between;gap:10px;font-size:13px;font-weight:650}
.bill-chip-top b{font-feature-settings:var(--num)}
.bill-chip-sub{font-size:11px;color:var(--muted);margin-top:3px}
.bill-chip.overdue .bill-chip-sub{color:var(--neg)}

/* hero projection */
.hero-proj{margin-top:8px;font-size:12.5px;color:var(--muted)}
.hero-proj b{color:var(--ink);font-feature-settings:var(--num)}

/* budgets */
.brow{margin-bottom:13px}
.brow:last-child{margin-bottom:2px}
.brow-top{display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px;font-weight:500}
.brow-top span:last-child{color:var(--muted);font-weight:600;font-feature-settings:var(--num)}
.brow-top .neg-t{color:var(--neg)}
.meter{position:relative}
.pace-tick{position:absolute;top:-2px;bottom:-2px;width:2px;border-radius:2px;background:var(--ink-2);opacity:.55}
.budget-edit{display:grid;grid-template-columns:1fr auto 92px;gap:10px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line)}
.budget-edit:last-of-type{border-bottom:none}
.be-name{font-size:13.5px;font-weight:550}
.be-used{font-size:11px;color:var(--muted);font-feature-settings:var(--num)}
.budget-edit input{padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--ink);font-size:13.5px;text-align:right}

/* more hub */
.menu-item{display:flex;align-items:center;gap:14px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-md);padding:15px 16px;box-shadow:var(--shadow-sm);cursor:pointer;transition:transform .12s}
.menu-item:active{transform:scale(.985)}
.menu-ic{font-size:22px;width:40px;height:40px;display:grid;place-items:center;background:var(--surface-2);border-radius:12px}
.menu-mid{flex:1;display:flex;flex-direction:column;gap:1px}
.menu-mid b{font-size:14.5px;letter-spacing:-.01em}
.menu-mid small{font-size:11.5px;color:var(--muted)}
.menu-chev{color:var(--muted);font-size:20px}
.sub-head{display:flex;align-items:center;gap:12px;margin-bottom:2px}
.sub-head h2{margin:0;font-size:18px;font-weight:750;letter-spacing:-.02em}
.sub-head .chip{background:var(--surface);border:1px solid var(--line)}

/* goals */
.goals-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.goal{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r-sm);padding:12px;cursor:pointer}
.goal-top{display:flex;align-items:center;gap:8px;margin-bottom:9px}
.goal-ic{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;font-size:14px}
.goal-top b{font-size:13px;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.goal-nums{margin-top:7px;font-size:12.5px;font-weight:700;font-feature-settings:var(--num)}
.goal-nums span{color:var(--muted);font-weight:500}

.grp-total{font-size:13.5px;font-weight:700;font-feature-settings:var(--num);color:var(--pos)}
.grp-total.neg-t,.neg-t{color:var(--neg)}
/* home: accounts + income panels */
.acct-net{display:flex;justify-content:space-between;align-items:center;background:var(--surface-2);
  border-radius:var(--r-sm);padding:11px 13px;margin-bottom:8px}
.acct-net span{font-size:12px;color:var(--muted);font-weight:600}
.acct-net strong{font-size:16px;font-weight:750;letter-spacing:-.01em;font-feature-settings:var(--num)}
.acct-net .pos{color:var(--pos)} .acct-net .neg{color:var(--neg)}
.inc-total{font-size:15px;font-weight:750;font-feature-settings:var(--num)}
.inc-total.pos{color:var(--pos)}

/* lines & small buttons */
.line-right{display:flex;align-items:center;gap:8px}
.mini-add{border:1px solid var(--line);background:var(--surface-2);color:var(--accent);border-radius:999px;
  padding:5px 11px;font-size:12px;font-weight:650;cursor:pointer}
.mini-add.paid{color:var(--pos);border-color:color-mix(in srgb,var(--pos) 40%,transparent)}
.panel.tight{padding:6px 14px}
.spark{vertical-align:middle;margin-left:6px;opacity:.9}

/* chat */
.chat-screen{min-height:calc(100vh - 210px);display:flex;flex-direction:column;gap:10px}
.chat-list{flex:1;display:flex;flex-direction:column;gap:10px;overflow-y:auto;padding-bottom:120px}
.chat-msg{display:flex}
.chat-msg.user{justify-content:flex-end}
.bubble{max-width:82%;padding:11px 14px;border-radius:18px;font-size:14px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.chat-msg.assistant .bubble{background:var(--surface);border:1px solid var(--line);border-bottom-left-radius:6px;box-shadow:var(--shadow-sm)}
.chat-msg.user .bubble{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#04231f;border-bottom-right-radius:6px;font-weight:550}
.chips-row{display:flex;flex-wrap:wrap;gap:8px;padding-bottom:120px}
.sugg{border:1px solid var(--line);background:var(--surface);color:var(--ink-2);border-radius:999px;
  padding:9px 14px;font-size:12.5px;font-weight:550;cursor:pointer;box-shadow:var(--shadow-sm)}
.sugg:active{background:var(--accent-soft)}
.chat-input{position:fixed;left:16px;right:16px;bottom:calc(env(safe-area-inset-bottom) + 88px);max-width:488px;margin:0 auto;
  display:flex;gap:8px;background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(16px);
  border:1px solid var(--line);border-radius:18px;padding:8px;box-shadow:var(--shadow-lg);z-index:5}
.chat-input input{flex:1;border:none;background:none;color:var(--ink);font-size:14px;padding:8px 10px}
.chat-input input:focus{box-shadow:none}
.send-btn{width:40px;height:40px;border:none;border-radius:13px;background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#04231f;font-size:18px;font-weight:800;cursor:pointer}
.send-btn:disabled{opacity:.4}
.dots{display:inline-flex;gap:4px;padding:4px 2px}
.dots i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:blink 1.2s infinite}
.dots i:nth-child(2){animation-delay:.2s}.dots i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-2px)}}

/* skeleton shimmer */
.skel{height:120px;border-radius:16px;background:linear-gradient(100deg,var(--surface-2) 40%,var(--track-2) 50%,var(--surface-2) 60%);
  background-size:200% 100%;animation:shimmer 1.3s infinite linear}
@keyframes shimmer{to{background-position:-200% 0}}

/* toast */
.toast{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom) + 96px);transform:translateX(-50%) translateY(16px);
  background:var(--ink);color:var(--bg);padding:11px 18px;border-radius:999px;font-size:13.5px;font-weight:600;
  box-shadow:var(--shadow-lg);opacity:0;transition:opacity .25s,transform .3s cubic-bezier(.22,1,.36,1);z-index:40;max-width:88%;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.good{background:var(--pos);color:#fff}
.toast.warn{background:#d97706;color:#fff}
.toast.bad{background:var(--neg);color:#fff}

.areachart{width:100%;display:block}
/* area chart animation */
.area-line{stroke-dasharray:1;stroke-dashoffset:1;animation:draw 1s cubic-bezier(.3,.7,.3,1) forwards}
@keyframes draw{to{stroke-dashoffset:0}}
.area-fill{opacity:0;animation:fadein .8s .25s forwards}
.area-dot{opacity:0;animation:fadein .4s .85s forwards}
@keyframes fadein{to{opacity:1}}

/* workbook + report */
.wb-text{width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;
  border:1px solid var(--line);border-radius:13px;background:var(--surface-2);color:var(--ink);padding:12px}
.report{background:#fff;color:#111827;border-radius:16px;padding:22px;border:1px solid var(--line)}
.rep-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:2px solid #111827;padding-bottom:12px;margin-bottom:14px}
.rep-brand{font-size:20px;font-weight:800;letter-spacing:-.02em}
.rep-brand span{font-size:13px;font-weight:500;color:#6b7280}
.rep-sub{font-size:11px;color:#6b7280;text-transform:uppercase;letter-spacing:.06em;margin-top:2px}
.rep-month{font-size:16px;font-weight:750}
.rep-hero{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px}
.rep-hero>div{background:#f3f4f6;border-radius:10px;padding:10px}
.rep-hero span{display:block;font-size:10px;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
.rep-hero b{font-size:14px;font-feature-settings:"tnum" 1}
.rep-hero .rp{color:#0f9d58}.rep-hero .rn{color:#dc2626}
.report h3{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:#6b7280;margin:16px 0 6px}
.rep-table{width:100%;border-collapse:collapse;font-size:13px}
.rep-table td{padding:6px 4px;border-bottom:1px solid #e5e7eb}
.rep-table .num{text-align:right;font-feature-settings:"tnum" 1;white-space:nowrap}
.rep-foot{margin-top:18px;font-size:10.5px;color:#9ca3af;text-align:center}
@media print{
  body>#app,.tabbar,.no-print,.toast{display:none !important}
  body::before{display:none}
  #modal-root .overlay{position:static;background:#fff;backdrop-filter:none;display:block}
  #modal-root .sheet{max-height:none;box-shadow:none;border:none;border-radius:0;animation:none;max-width:none}
  #modal-root .sheet::before{display:none}
  #modal-root .sheet-body{overflow:visible;padding:0}
  .report{border:none;border-radius:0}
}

.review-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.review-head strong{font-size:15px}
.review-list{display:flex;flex-direction:column;gap:12px}
.rev{background:var(--surface-2);border:1px solid var(--line);border-radius:16px;padding:13px;display:flex;flex-direction:column;gap:9px}
.rev input,.rev select{background:var(--surface)}
.rev-line{display:flex;gap:8px;align-items:center}
.rev-merchant{font-weight:650}
.rev-amt{max-width:120px} .rev-cur{max-width:92px} .rev-date{max-width:150px}
.rev-bhd{font-size:12px;color:var(--muted);white-space:nowrap;font-weight:600;font-feature-settings:var(--num)}

/* v12: transfers */
.transfer-line .tl-lbl{font-size:12px;color:var(--muted);font-weight:600;width:42px;flex:0 0 auto}
.tx-amt .xfer{color:var(--accent);font-weight:700}


/* =====================================================================
   v20 — editorial redesign layer
   ===================================================================== */
body{letter-spacing:-.005em}
.ic{width:20px;height:20px;display:block;flex:0 0 auto}
.btn .ic,.link .ic,.mini-add .ic{width:16px;height:16px;display:inline-block;vertical-align:-3px;margin-right:4px}
.emo{font-size:17px;line-height:1}

/* money: serif, tabular, muted fils */
.money,.hero-num b,.tile b,.acct-net strong,.grp-total,.inc-total,.tx-amt,.leg-val,.cl-val,.hb-v,.ev-amt,.sub-right b,
.card-top b,.donut-val,.ring-pct,.goal-nums,.tr-val,.hs strong,.grp strong{font-family:var(--serif);font-feature-settings:var(--num)}
.money{display:block;font-size:22px;font-weight:500;letter-spacing:-.02em;color:var(--ink)}
.money .cur{font-family:-apple-system,BlinkMacSystemFont,sans-serif;font-size:11px;font-weight:600;color:var(--muted);letter-spacing:.06em;margin-right:5px;vertical-align:3px}
.money .fils{color:var(--muted);font-size:.72em}
.money.neg{color:var(--neg)}

/* top bar */
.topbar{background:linear-gradient(var(--bg) 66%,transparent)}
.greet .hi{font-size:12px;letter-spacing:.04em;text-transform:uppercase;font-weight:600;color:var(--muted)}
.greet h1{font-family:var(--serif);font-weight:500;font-size:27px;letter-spacing:-.02em;align-items:center;gap:9px;margin-top:3px}
.greet h1 .mark{width:26px;height:26px;color:var(--accent);display:inline-grid;place-items:center}
.greet h1 .mark .ic{width:26px;height:26px}
.greet h1 .ar{font-family:"Geeza Pro","Noto Naskh Arabic",var(--serif);font-size:17px;color:var(--accent);opacity:.85;font-weight:400}
.topbar .add-btn{background:var(--accent);color:var(--on-accent);border-radius:16px;width:46px;height:46px;
  box-shadow:0 10px 26px -8px color-mix(in srgb,var(--accent) 70%,transparent)}
.topbar .add-btn .ic{width:22px;height:22px;stroke-width:2.2}
.back-chip{background:var(--surface);border-color:var(--line)}

/* month / period switcher */
.month-switch{background:var(--surface);border-color:var(--line);box-shadow:none}
.month-label{display:flex;flex-direction:column;align-items:center;line-height:1.15;min-width:130px}
.month-label span{font-family:var(--serif);font-size:15px;font-weight:500;letter-spacing:-.01em}
.month-label small{font-size:10.5px;color:var(--muted);font-weight:600;margin-top:1px}
.month-label.linky span{color:var(--accent)}
.month-switch.future{border-color:color-mix(in srgb,var(--accent) 40%,transparent)}

/* hero */
.hero{background:linear-gradient(160deg,var(--surface-hi),var(--surface) 60%);border-color:var(--line);border-radius:var(--r-lg);padding:22px 22px 18px}
.hero::after{background:radial-gradient(90% 70% at 100% 0,var(--accent-soft),transparent 60%)}
.hero-top{justify-content:space-between}
.hero-top .lbl{font-size:11.5px;letter-spacing:.1em;color:var(--muted)}
.hero-num{display:flex;align-items:baseline;gap:7px}
.hero-num .cur{font-size:12px;letter-spacing:.08em;font-weight:600;color:var(--muted)}
.hero-num b{font-size:46px;font-weight:500;letter-spacing:-.03em;margin:0}
.hero-delta{background:transparent;border:1px solid var(--line);font-size:11.5px}
.hero-delta.up{color:var(--neg)} .hero-delta.down{color:var(--pos)}
.hero-proj{font-size:12.5px}
.hero-stats .hs{background:color-mix(in srgb,var(--surface-2) 80%,transparent);border:1px solid var(--line);padding:11px 12px}
.hero-stats .hs span{font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;font-weight:600}
.hero-stats .hs strong{font-size:17px;font-weight:500}
.ring-pct{font-weight:500}

/* panels & headings */
.panel{border-radius:var(--r-md);padding:18px 18px 16px;border-color:var(--line)}
.panel h2,.sub-head h2,.sheet-head h2{font-family:var(--serif);font-weight:500;font-size:17px;letter-spacing:-.01em}
.panel h2 .muted{font-family:-apple-system,BlinkMacSystemFont,sans-serif}
.with-ic{display:flex;align-items:center;gap:9px}
.link{color:var(--accent)}
.empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:22px 10px;text-align:center;color:var(--muted)}
.empty .ic{width:30px;height:30px;color:var(--accent);opacity:.75}
.empty p{margin:0;font-size:13px;line-height:1.5}

/* icon chips */
.tx-ic{width:40px;height:40px;border-radius:13px;color:var(--c,var(--accent));
  background:color-mix(in srgb,var(--c,var(--accent)) 15%,transparent)}
.tx-ic .ic{width:20px;height:20px}
.tx-ic.acct-ic{--c:var(--ink-2);background:var(--surface-2)}
.tx-ic.xfer-ic{--c:var(--accent)}
.mini-ic{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:8px;flex:0 0 auto;margin-right:9px;
  color:var(--c,var(--ink-2));background:color-mix(in srgb,var(--c,var(--ink-2)) 14%,transparent);font-style:normal;vertical-align:middle}
.mini-ic .ic{width:15px;height:15px}
.grp-name,.brow-name{display:inline-flex;align-items:center}
.brow-top em{color:var(--muted);font-style:normal;font-weight:500}
.cpb-ic{color:var(--c);background:color-mix(in srgb,var(--c) 15%,transparent)}
.cpb-ic .ic{width:17px;height:17px}
.menu{display:flex;flex-direction:column;gap:10px}
.menu-ic{color:var(--accent);background:var(--accent-soft)}
.menu-ic .ic{width:21px;height:21px}
.edit-btn{width:34px;height:34px}

/* transactions */
.tx-merchant{font-weight:600;font-size:14.5px}
.tx-merchant .arrow{color:var(--muted)}
.tx-amt{font-size:15.5px;font-weight:500}
.tx-amt .pos{color:var(--pos)}
.tx-amt .xfer{color:var(--accent);font-weight:500}
.tx.future{opacity:.88}
.tx.future .tx-amt{color:var(--muted)}
.sched{display:inline-flex;align-items:center;gap:3px;color:var(--accent);font-weight:700;margin-right:5px;
  font-size:10.5px;letter-spacing:.03em;text-transform:uppercase}
.sched .ic{width:12px;height:12px}
.hero-top .sched{font-size:10.5px}
.day-head{font-size:11px;letter-spacing:.08em}
.day-head.future span:first-child{color:var(--accent);display:inline-flex;align-items:center;gap:4px}
.day-head .ic{width:12px;height:12px}
.swipe-under{gap:6px} .swipe-under .ic{width:16px;height:16px}
.swipe-under.right{color:var(--on-accent)}
.search{background:var(--surface);border-color:var(--line)}
.search::-webkit-search-cancel-button{filter:grayscale(1)}
.select,select{background:var(--surface);border-color:var(--line)}

/* insight cards */
.icard{background:var(--surface);border-color:var(--line)}
.icard::before{opacity:.12}
.icard.warn::before{background:radial-gradient(120% 100% at 100% 0,var(--warn),transparent 60%)}
.icard.info::before{background:radial-gradient(120% 100% at 100% 0,var(--accent),transparent 60%)}
.icard-ic{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:var(--surface-2);color:var(--ink-2)}
.icard-ic .ic{width:18px;height:18px}
.icard.bad .icard-ic{color:var(--neg)} .icard.warn .icard-ic{color:var(--warn)} .icard.good .icard-ic{color:var(--pos)}
.icard.warn .icard-stat{color:var(--warn)}
.icard-stat{font-family:var(--serif);font-weight:500;font-size:16px}
.icard-title{font-weight:650}

/* tabs bar */
.tabbar{background:color-mix(in srgb,var(--surface) 82%,transparent);border-color:var(--line);border-radius:24px}
.tab.active{color:var(--accent)}
.tab.active .tab-ic{filter:none}

/* insights section tabs */
.ins-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;background:var(--surface);border:1px solid var(--line);
  border-radius:16px;padding:4px;position:sticky;top:calc(env(safe-area-inset-top) + 84px);z-index:4;
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.ins-tab{border:none;background:transparent;color:var(--muted);border-radius:12px;padding:8px 2px;display:flex;flex-direction:column;
  align-items:center;gap:3px;font-size:11px;font-weight:650;cursor:pointer;transition:background .15s,color .15s}
.ins-tab .ic{width:18px;height:18px}
.ins-tab.on{background:var(--accent-soft);color:var(--accent)}

/* stat tiles */
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}
.tile{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:11px 11px 10px;min-width:0}
.tile .k{display:block;font-size:10px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:650;margin-bottom:4px}
.tile b{display:block;font-size:17px;font-weight:500;letter-spacing:-.015em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tile b.pos{color:var(--pos)} .tile b.neg{color:var(--neg)}
.tile small{display:block;font-size:11px;color:var(--muted);margin-top:2px}

/* split bar + legend */
.split-bar{display:flex;height:10px;border-radius:6px;overflow:hidden;background:var(--track);gap:2px;margin:4px 0 10px}
.split-bar i{display:block;height:100%}
.chart-legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:11.5px;color:var(--muted);margin-top:8px}
.chart-legend span{display:inline-flex;align-items:center;gap:6px}
.chart-legend i{width:9px;height:9px;border-radius:3px;display:inline-block}

/* horizontal bars */
.hbars{display:flex;flex-direction:column;gap:12px}
.hb-top{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:6px;gap:10px}
.hb-l{display:inline-flex;align-items:center;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}
.hb-l small{color:var(--muted);margin-left:6px;font-weight:500}
.hb-v{font-size:14px;color:var(--ink)}
.hb-track{height:7px;background:var(--track);border-radius:5px;overflow:hidden}
.hb-fill{height:100%;border-radius:5px}

/* category list under the big donut */
.donut-wrap.big{justify-content:center;margin:4px 0 14px}
.donut-wrap.big .donut{width:190px;height:190px}
.cat-list{display:flex;flex-direction:column}
.cat-li{display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:6px;padding:9px 0;border-top:1px solid var(--line);font-size:13.5px}
.cl-name{font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cl-pct{color:var(--muted);font-size:12px;width:38px;text-align:right}
.cl-val{min-width:72px;text-align:right;font-size:14.5px}

/* trends */
.trend-row{display:grid;grid-template-columns:1fr auto auto 64px;align-items:center;gap:10px;padding:9px 0;border-top:1px solid var(--line);font-size:13px}
.trend-row:first-of-type{border-top:none}
.tr-name{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:550}
.tr-name .dot{width:8px;height:8px;border-radius:50%;flex:0 0 auto}
.tr-val{font-size:14px;text-align:right}
.trend-row .spark{margin:0}
.chip-delta{font-size:11px;font-weight:700;padding:3px 7px;border-radius:999px;text-align:center;background:var(--surface-2);color:var(--muted)}
.chip-delta.up{color:var(--neg);background:color-mix(in srgb,var(--neg) 13%,transparent)}
.chip-delta.down{color:var(--pos);background:color-mix(in srgb,var(--pos) 13%,transparent)}

/* event / anomaly / subscription rows */
.ev-row,.anom,.sub-row{display:flex;align-items:center;gap:11px;padding:10px 0;border-top:1px solid var(--line)}
.ev-row:first-of-type,.anom:first-of-type,.sub-row:first-of-type{border-top:none}
.ev-ic{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;flex:0 0 auto;background:var(--surface-2);color:var(--warn)}
.ev-ic .ic{width:17px;height:17px}
.ev-ic.in,.ev-ic.expected{color:var(--pos);background:color-mix(in srgb,var(--pos) 13%,transparent)}
.ev-ic.overdue{color:var(--neg);background:color-mix(in srgb,var(--neg) 13%,transparent)}
.ev-ic.bill,.ev-ic.scheduled{color:var(--accent);background:var(--accent-soft)}
.ev-mid{flex:1;min-width:0;display:flex;flex-direction:column}
.ev-mid b{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ev-mid small{font-size:11.5px;color:var(--muted);margin-top:1px}
.ev-amt{font-size:15px;white-space:nowrap}
.ev-amt.pos{color:var(--pos)}
.sub-right{display:flex;flex-direction:column;align-items:flex-end}
.sub-right b{font-size:15px;font-weight:500} .sub-right small{font-size:10.5px;color:var(--muted)}
.sub-row .mini-add{padding:5px 7px}
.sub-row .mini-add .ic{margin:0}

/* credit cards */
.card-row{padding:12px 0;border-top:1px solid var(--line)}
.card-row:first-of-type{border-top:none;padding-top:4px}
.card-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.card-name{display:inline-flex;align-items:center;font-weight:600;font-size:14px}
.card-top b{font-size:17px;font-weight:500}
.card-sub{display:flex;justify-content:space-between;font-size:11.5px;color:var(--muted);margin-top:7px}
.card-sub .link{font-size:11.5px;padding:0}
.card-spent{font-size:11.5px;color:var(--muted);margin-top:3px}

/* forecast */
.fc-strip .fc-row{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin:4px 0 8px}
.fc-strip .k{display:block;font-size:10px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:650;margin-bottom:3px}
.fc-strip .fc-row>div:last-child{text-align:right}
.fc-arrow{color:var(--accent);font-size:20px;padding-bottom:4px}
.fc-strip .spark{width:100%;height:38px;margin:0;display:block}
.fc-warn{display:flex;gap:8px;align-items:flex-start;color:var(--neg);font-size:12.5px;line-height:1.45;margin:10px 0 4px;
  background:color-mix(in srgb,var(--neg) 10%,transparent);border-radius:12px;padding:10px 12px}
.fc-warn .ic{width:16px;height:16px;flex:0 0 auto;margin-top:1px}
.fcchart{margin-top:4px}
.fc-line{stroke:var(--accent);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fc-zero{stroke:var(--neg);stroke-width:1;stroke-dasharray:3 3;opacity:.55}
.fc-end{stroke:var(--muted);stroke-width:1;stroke-dasharray:2 3;opacity:.6}
.fc-neg-zone{fill:var(--neg);opacity:.07}
.fc-ev{stroke:var(--surface);stroke-width:1.2}
.fc-ev.in{fill:var(--pos)} .fc-ev.out{fill:var(--warn)} .fc-ev.od{fill:var(--neg)}
.fc-now{fill:var(--accent)}
.fc-low{fill:none;stroke:var(--ink-2);stroke-width:.8}
.fc-low.neg{stroke:var(--neg)}
.sb-line{stroke:var(--pos);stroke-width:1.3;stroke-dasharray:2.5 2}
.sb-dot{fill:var(--pos)}

/* goals */
.goal{background:var(--surface-2);border-color:var(--line)}
.goal-ic{color:var(--c);background:color-mix(in srgb,var(--c) 16%,transparent)}
.goal-ic .ic{width:15px;height:15px}
.live{margin-left:auto;font-size:9.5px;font-weight:750;text-transform:uppercase;letter-spacing:.06em;color:var(--accent);
  border:1px solid color-mix(in srgb,var(--accent) 45%,transparent);border-radius:999px;padding:1px 6px}
.goal-nums{font-weight:500}

/* buttons & inputs */
.btn.primary{background:var(--accent);color:var(--on-accent);box-shadow:0 10px 24px -10px color-mix(in srgb,var(--accent) 80%,transparent)}
.btn.primary .ic{stroke:var(--on-accent)}
.mini-add{color:var(--accent);background:transparent;border-color:color-mix(in srgb,var(--accent) 35%,transparent)}
.mini-add.paid{color:var(--pos)}
.send-btn,.chat-msg.user .bubble{background:var(--accent);color:var(--on-accent)}
.toast-act{background:var(--accent);color:var(--on-accent)}
.toast.warn{background:var(--warn);color:#1b1406}
.seg-btn.on{color:var(--ink)}
.bc-cell.today{box-shadow:inset 0 0 0 1.5px var(--accent)}

/* bottom-sheet polish */
.sheet{background:var(--surface);border-color:var(--line)}
.overlay{background:rgba(3,3,5,.62)}

/* =====  App lock  ===== */
.lock{position:fixed;inset:0;z-index:200;display:grid;place-items:center;
  background:radial-gradient(120% 80% at 50% 0,color-mix(in srgb,var(--accent) 12%,var(--bg)),var(--bg) 60%);
  animation:fade .2s ease;padding:24px}
.lock.out{opacity:0;transition:opacity .25s}
.lock-in{width:100%;max-width:320px;display:flex;flex-direction:column;align-items:center;text-align:center}
.lock-mark{width:64px;height:64px;border-radius:20px;display:grid;place-items:center;color:var(--accent);
  background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 30%,transparent);margin-bottom:18px}
.lock-mark .ic{width:34px;height:34px}
.lock-title{font-family:var(--serif);font-weight:500;font-size:26px;letter-spacing:-.02em;margin:0;color:var(--ink)}
.lock-sub{color:var(--muted);font-size:13px;margin:6px 0 22px}
.lock-dots{display:flex;gap:14px;margin-bottom:26px;min-height:14px}
.lock-dots i{width:12px;height:12px;border-radius:50%;border:1.5px solid var(--muted);transition:background .12s,border-color .12s}
.lock-dots i.on{background:var(--accent);border-color:var(--accent)}
.lock-dots.shake{animation:shake .4s}
@keyframes shake{20%,60%{transform:translateX(-8px)}40%,80%{transform:translateX(8px)}}
.lock-pad{display:grid;grid-template-columns:repeat(3,72px);gap:14px 22px}
.lock-pad button{width:72px;height:72px;border-radius:50%;border:1px solid var(--line);background:var(--surface);
  color:var(--ink);font-family:var(--serif);font-size:28px;font-weight:400;cursor:pointer;display:grid;place-items:center}
.lock-pad button:active{background:var(--surface-2);transform:scale(.95)}
.lock-pad .lock-face{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 40%,transparent)}
.lock-pad .lock-face .ic{width:30px;height:30px}
.lock-pad [data-del]{font-family:-apple-system,BlinkMacSystemFont,sans-serif;font-size:22px;background:transparent;border-color:transparent}
.lock-msg{color:var(--neg);font-size:12.5px;min-height:18px;margin:18px 0 0}
body.locked{overflow:hidden}
body.locked #app,body.privacy #app{filter:blur(22px);pointer-events:none}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.001ms !important;transition-duration:.001ms !important}
}
@media (max-width:360px){
  .hero-num b{font-size:38px}
  .tiles{gap:6px} .tile b{font-size:15px}
  .lock-pad{grid-template-columns:repeat(3,64px);gap:12px 18px}
  .lock-pad button{width:64px;height:64px}
}
.hero-stats{gap:8px}
.hero-stats .hs{min-width:0;padding:10px 10px}
.hero-stats .hs strong{display:block;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hero-stats .hs span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hs strong .fils,.tile b .fils{font-size:.68em;color:var(--muted);letter-spacing:0}
.hs strong.pos .fils,.tile b.pos .fils{color:color-mix(in srgb,var(--pos) 60%,var(--muted))}
/* hero fit at phone widths: figure shrinks before the ring is pushed out */
.hero-main{gap:10px}
.hero-figure{flex:1;min-width:0}
.hero-num b{font-size:clamp(32px,10.5vw,46px)}
.hero .ring{width:80px;height:80px;flex:0 0 80px}
.hero-stats .hs strong{font-size:14.5px;letter-spacing:-.02em}
.hero-stats .hs{padding:9px 9px}
.tile b .fils,.hs strong .fils{display:inline;margin:0}
.fcchart .fc-ev{r:1.6px}
/* forecast dots — round caps on zero-length paths */
.fc-ev,.fc-now,.fc-low,.fc-low-in{fill:none;stroke-linecap:round}
.fc-ev{stroke-width:8px}
.fc-ev.in{stroke:var(--pos)} .fc-ev.out{stroke:var(--warn)} .fc-ev.od{stroke:var(--neg)}
.fc-now{stroke:var(--accent);stroke-width:10px}
.fc-low{stroke:var(--ink-2);stroke-width:11px}
.fc-low.neg{stroke:var(--neg)}
.fc-low-in{stroke:var(--surface);stroke-width:6px}
.trend-row{grid-template-columns:minmax(0,1fr) 52px auto 58px;gap:8px}

/* =====  v32 — backup & sync  ===== */
.sync-card{background:var(--surface-2);border:1px solid var(--line);border-radius:16px;padding:14px;margin-bottom:6px}
.sync-card.ok{border-color:color-mix(in srgb,var(--accent) 40%,transparent)}
.sync-card.warn{border-color:color-mix(in srgb,var(--warn) 45%,transparent)}
.sync-top{display:flex;flex-direction:column;gap:2px;margin-bottom:8px}
.sync-top b{font-family:var(--serif);font-weight:500;font-size:16px}
.sync-top span{font-size:12px;color:var(--muted)}
.sync-card.ok .sync-top span{color:var(--accent)}
.sync-card.warn .sync-top span{color:var(--warn)}
.sync-meta{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin-bottom:6px}
.sync-meta b{color:var(--ink);font-weight:600}
.drive-setup{margin-top:12px;border-top:1px solid var(--line);padding-top:10px}
.drive-setup summary{cursor:pointer;font-size:13px;font-weight:650;color:var(--accent);list-style:none}
.drive-setup summary::-webkit-details-marker{display:none}
.drive-setup summary::before{content:'›';display:inline-block;margin-right:6px;transition:transform .15s}
.drive-setup[open] summary::before{transform:rotate(90deg)}
.drive-setup ol{padding-left:18px;margin:10px 0;line-height:1.6}
.drive-setup code{font-size:11px;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:1px 5px;word-break:break-all}
.mono,input.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;width:100%;padding:11px 12px;
  border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink)}
.sub-h{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:700;margin:14px 0 4px}
.snap-row{display:flex;align-items:center;gap:11px;padding:9px 0;border-top:1px solid var(--line)}
.snap-row:first-of-type{border-top:none}
.restore-opt{display:block;width:100%;text-align:left;background:var(--surface-2);border:1px solid var(--line);border-radius:16px;
  padding:14px;margin-top:10px;color:var(--ink);cursor:pointer;font:inherit}
.restore-opt b{display:flex;align-items:center;gap:7px;font-size:15px;font-weight:650;margin-bottom:4px}
.restore-opt b .ic{width:17px;height:17px}
.restore-opt small{display:block;font-size:12.5px;color:var(--muted);line-height:1.45}
.restore-opt.rec{border-color:color-mix(in srgb,var(--accent) 50%,transparent);background:var(--accent-soft)}
.restore-opt.rec b{color:var(--accent)}
.restore-opt:active{transform:scale(.985)}
.sync-banner{display:flex;align-items:center;gap:12px;width:100%;text-align:left;font:inherit;cursor:pointer;
  background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 40%,transparent);border-radius:18px;
  padding:12px 14px;color:var(--ink)}
.sync-banner .ic{width:22px;height:22px;color:var(--accent);flex:0 0 auto}
.sync-banner span{flex:1;display:flex;flex-direction:column}
.sync-banner b{font-weight:650;font-size:14px} .sync-banner small{font-size:11.5px;color:var(--muted)}
.sync-banner em{font-style:normal;color:var(--accent);font-size:20px}
.btn:disabled{opacity:.45;cursor:not-allowed}

/* =====  v32 — Ask screen  ===== */
.ask-hero{background:linear-gradient(160deg,var(--surface-hi),var(--surface) 65%);border:1px solid var(--line);
  border-radius:var(--r-lg);padding:20px;position:relative;overflow:hidden}
.ask-hero::after{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(80% 70% at 100% 0,var(--accent-soft),transparent 60%)}
.ask-hero .mark{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent);margin-bottom:12px}
.ask-hero .mark .ic{width:24px;height:24px}
.ask-hero h3{font-family:var(--serif);font-weight:500;font-size:22px;letter-spacing:-.02em;margin:0 0 6px;position:relative}
.ask-hero p{font-size:13px;color:var(--muted);line-height:1.5;margin:0;position:relative}
.ask-hero .model-tag{display:inline-flex;align-items:center;gap:5px;margin-top:12px;font-size:11px;font-weight:650;color:var(--accent);
  border:1px solid color-mix(in srgb,var(--accent) 35%,transparent);border-radius:999px;padding:3px 9px;position:relative}
.sugg-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.sugg-grid .sugg{display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;border-radius:16px;padding:12px;
  background:var(--surface);font-size:12.5px;line-height:1.35;color:var(--ink-2)}
.sugg-grid .sugg .ic{width:17px;height:17px;color:var(--accent)}
.chat-msg.assistant .bubble{background:var(--surface);border-color:var(--line)}
.chat-msg.user .bubble{font-weight:550}
.chat-input{background:color-mix(in srgb,var(--surface) 90%,transparent);border-color:var(--line);border-radius:20px}
.send-btn{border-radius:14px}
