/* Snap Money — app stylesheet.
   Layer 1: design-system tokens (static/sm-tokens.css)
   Layer 2: design-system components (static/sm.css, class prefix sm-)
   Layer 3 (this file): app shell, legacy class compatibility, screens. */

/* ---------- fonts ---------- */
@font-face{font-family:"Geist";src:url(/static/fonts/Geist-Regular.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"Geist";src:url(/static/fonts/Geist-Medium.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Geist";src:url(/static/fonts/Geist-SemiBold.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"Geist Mono";src:url(/static/fonts/GeistMono-Medium.woff2) format("woff2");font-weight:500;font-display:swap}

/* ---------- legacy aliases ----------
   The app's older markup uses --amber/--line/--muted/--r. They now resolve to
   design-system tokens so one palette drives every screen. */
:root{
  --amber:var(--brand-500);--amber-2:var(--brand-600);--amber-text:var(--accent-text);
  --amber-ink:var(--on-brand);--amber-wash:var(--surface-tint);
  --raised:var(--surface-sunken);--line:var(--border);--line2:var(--border-strong);
  --muted:var(--ink-muted);--dim:var(--ink-subtle);
  --moss:var(--income-text);--clay:var(--danger-text);
  --r:var(--radius-lg);--r-sm:var(--radius-md);--pill:var(--radius-full);
  --sans:var(--font-sans);--display:var(--font-sans);--mono:var(--font-mono);
  --ease:cubic-bezier(.2,.8,.2,1);
}
*{box-sizing:border-box}
html{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font-sans);font-size:14px;line-height:20px;-webkit-font-smoothing:antialiased}
a{color:inherit}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
input,select{font:inherit;color:var(--ink)}
/* Amounts are sans with tabular figures; the mono face is reserved for the
   compact numbers inside calendar cells and chart tooltips (numeric-sm). */
.mono{font-variant-numeric:tabular-nums}
.mono-sm{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:12px;font-weight:500}
.display{letter-spacing:-.01em}
.muted{color:var(--ink-muted)}.dim{color:var(--ink-subtle)}
.hidden{display:none!important}
.view{display:none}.view.on{display:block}
@keyframes rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.rise{animation:rise .28s var(--ease) both}
@keyframes shimmer{from{background-position:-200% 0}to{background-position:200% 0}}
.sk{background:linear-gradient(90deg,var(--surface-sunken) 25%,var(--border) 50%,var(--surface-sunken) 75%);background-size:200% 100%;animation:shimmer 1.2s linear infinite;border-radius:8px}
@media (prefers-reduced-motion:reduce){.rise,.sk{animation:none}*{transition-duration:.01ms!important}}

/* ---------- brand ---------- */
.brand{display:flex;align-items:center;gap:10px;text-decoration:none}
.brand img,.brand svg{width:32px;height:32px;flex:none}
.brand b{display:block;font-weight:600;font-size:15px;line-height:18px}
.brand small{display:block;color:var(--ink-subtle);font-size:11px;line-height:14px}

/* ---------- buttons (legacy .btn mapped onto sm-btn metrics) ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border-radius:var(--radius-md);font-weight:500;font-size:14px;text-decoration:none;border:1px solid transparent;transition:background .15s,border-color .15s,transform .1s;white-space:nowrap}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.45;cursor:not-allowed;transform:none}
.btn-primary{background:var(--brand-500);color:var(--on-brand)}
.btn-primary:hover:not(:disabled){background:var(--brand-600)}
.btn-ghost{background:var(--surface);border-color:var(--border-strong);color:var(--ink)}
.btn-ghost:hover:not(:disabled){background:var(--surface-sunken)}
.btn-danger{background:var(--danger-strong);color:#fff;border-color:transparent}
.btn-danger:hover:not(:disabled){background:var(--danger-text)}
.btn-sm{height:32px;padding:0 12px;font-size:13px}
.btn svg{width:16px;height:16px}
.pill{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:var(--radius-full);background:var(--surface);border:1px solid var(--border-strong);font-size:13px;font-weight:500;color:var(--ink)}
.pill:hover{background:var(--surface-sunken)}
.pill.on{background:var(--ink);color:var(--surface);border-color:var(--ink)}

/* ---------- cards ---------- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:var(--space-lg);box-shadow:var(--shadow-card)}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:var(--space-md)}
.card-h h3{margin:0;font-size:15px;line-height:22px;font-weight:600}
.card-h .sub{font-size:12px;color:var(--ink-subtle)}
.card.amber{background:var(--brand-500);color:var(--on-brand);border-color:var(--brand-500);border-radius:var(--radius-xl);box-shadow:var(--shadow-raised);position:relative;overflow:hidden}
.card.amber .lbl,.card.amber .sub{color:var(--on-brand);opacity:.8}
.lbl{font-size:13px;line-height:18px;color:var(--ink-muted);font-weight:500}
.big{font-weight:600;font-size:clamp(1.75rem,3vw,2.25rem);letter-spacing:-.01em;line-height:1.15;margin:6px 0 8px;font-variant-numeric:tabular-nums}
.mid{font-weight:600;font-size:22px;letter-spacing:-.01em;margin:4px 0 2px;font-variant-numeric:tabular-nums}
.stat-ic{width:32px;height:32px;border-radius:var(--radius-md);background:var(--surface-sunken);color:var(--ink-muted);display:grid;place-items:center}
.stat-ic svg{width:16px;height:16px}
.card.amber .stat-ic{background:rgba(32,33,36,.1);color:var(--on-brand)}

/* ---------- inputs ---------- */
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field label{font-size:12px;line-height:16px;color:var(--ink-muted);font-weight:500}
.inp{height:40px;width:100%;min-width:0;max-width:100%;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:0 12px;transition:border-color .15s,box-shadow .15s;-webkit-appearance:none;appearance:none}
.inp:hover{border-color:var(--border-strong)}
.inp[type="date"]{display:flex;align-items:center;line-height:1.2}
.inp[type="date"]::-webkit-datetime-edit{padding:0;line-height:1.2;display:flex;align-items:center}
.inp[type="date"]::-webkit-datetime-edit-fields-wrapper{padding:0}
.inp[type="date"]::-webkit-date-and-time-value{text-align:left}
.inp:focus{border-color:var(--brand-500);box-shadow:0 0 0 3px var(--surface-tint)}
.inp:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.inp::placeholder{color:var(--ink-subtle)}
.inp.err{border-color:var(--danger)}
.hint{font-size:12px;line-height:16px;color:var(--ink-subtle)}
.hint.err{color:var(--danger-text)}
select.inp{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236E7074' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:36px}
.seg{display:inline-grid;grid-auto-flow:column;gap:2px;background:var(--surface-sunken);border-radius:var(--radius-md);padding:3px}
.seg button{height:30px;padding:0 14px;border-radius:8px;font-weight:500;font-size:13px;color:var(--ink-muted)}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-card)}
.bar{height:8px;border-radius:var(--radius-full);background:var(--surface-sunken);overflow:hidden;position:relative}
.bar i{display:block;height:100%;background:var(--brand-500);border-radius:inherit;transform-origin:left;transition:transform .4s var(--ease)}
.card.amber .bar{background:rgba(32,33,36,.18)}.card.amber .bar i{background:var(--on-brand)}

/* ---------- app shell ---------- */
.shell{display:grid;grid-template-columns:232px 1fr;min-height:100dvh}
.side{position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;gap:4px;padding:var(--space-lg) var(--space-md);border-right:1px solid var(--border);background:var(--surface)}
.side nav{display:flex;flex-direction:column;gap:2px;margin-top:var(--space-md)}
.side nav a{display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;border-radius:var(--radius-md);color:var(--ink-muted);text-decoration:none;font-weight:500;font-size:14px}
.side nav a svg{width:18px;height:18px}
.side nav a:hover{background:var(--surface-sunken);color:var(--ink)}
.side nav a.on{background:var(--surface-tint);color:var(--ink);box-shadow:inset 0 0 0 1px var(--brand-100)}
html[data-theme="dark"] .side nav a.on{box-shadow:inset 0 0 0 1px var(--border-strong)}
.side nav a.on svg{color:var(--accent-text)}
.side .spacer{flex:1}
.plan-card{background:var(--surface-sunken);border:1px solid var(--border);border-radius:var(--radius-md);padding:12px}
.plan-card .t{font-size:12px;font-weight:600}
.plan-card .q{font-size:11px;color:var(--ink-muted);margin:4px 0 6px}
.main{padding:24px clamp(16px,3vw,32px) 96px;max-width:1440px;width:100%;margin:0 auto}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:var(--space-lg);flex-wrap:wrap}
.topbar h1{margin:0;font-size:28px;line-height:34px;font-weight:600;letter-spacing:-.01em}
.topbar .sub{font-size:14px;color:var(--ink-muted)}
.topbar .right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.monthnav{display:inline-flex;align-items:center;gap:2px;background:var(--surface-sunken);border-radius:var(--radius-md);padding:3px}
.monthnav button{width:34px;height:34px;border-radius:8px;color:var(--ink-muted);display:grid;place-items:center}
.monthnav button:hover{background:var(--surface);color:var(--ink)}
.monthnav span{font-size:13px;font-weight:500;padding:0 10px;min-width:84px;text-align:center}
.avatar{width:34px;height:34px;border-radius:var(--radius-full);background:var(--brand-500);color:var(--on-brand);display:grid;place-items:center;font-weight:600;font-size:13px}
.grid{display:grid;gap:var(--space-lg)}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g21{grid-template-columns:2fr 1fr}
.span2{grid-column:span 2}
section.sec{margin-top:var(--space-lg);scroll-margin-top:16px}
.sec-title{display:flex;align-items:center;justify-content:space-between;margin:var(--space-2xl) 0 var(--space-md)}
.sec-title h2{margin:0;font-size:22px;line-height:28px;font-weight:600}

/* ---------- charts ---------- */
.donut-wrap{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-xl)}
.donut{width:132px;height:132px;flex:none}
.legend{flex:1;min-width:200px;display:grid;gap:7px;font-size:13px}
.legend div{display:grid;grid-template-columns:10px 1fr 44px auto;gap:10px;align-items:center;font-variant-numeric:tabular-nums}
.legend div i{width:10px;height:10px;border-radius:50%;display:block}
.legend .pct{color:var(--ink-muted);text-align:right}
.legend .amt{text-align:right}
.ch{width:100%;height:auto;display:block;overflow:visible}
.ch text{font-family:var(--font-sans);font-size:11px;fill:var(--ink-subtle)}
.ch .grid line{stroke:var(--border);stroke-width:1}
.ch .cb{fill:var(--brand-100);rx:3}
html[data-theme="dark"] .ch .cb{fill:var(--heat-2)}
.ch .cb.dim{fill:var(--surface-sunken)}
.ch .cb.hi{fill:var(--brand-500)}
.ch .val{fill:var(--ink-muted);font-size:10px}
.ch .area{fill:var(--brand-500);opacity:.12}
.ch .line{fill:none;stroke:var(--brand-500);stroke-width:2;stroke-linejoin:round}
.ch .dot{fill:var(--brand-500)}
.hbar{display:grid;grid-template-columns:110px 1fr auto;gap:10px;align-items:center;padding:6px 0;font-size:13px}
.hbar .amt{font-variant-numeric:tabular-nums;font-size:12px;min-width:90px;text-align:right}

/* ---------- transactions ---------- */
.tx{display:grid;grid-template-columns:40px 1fr auto 28px;gap:12px;align-items:center;padding:12px 0;border-top:1px solid var(--border)}
.tx:first-child{border-top:0}
.tx .ic{width:40px;height:40px;border-radius:var(--radius-md);background:var(--brand-50);color:var(--brand-700);display:grid;place-items:center}
html[data-theme="dark"] .tx .ic{background:var(--surface-tint);color:var(--brand-400)}
.tx .ic.in{background:var(--success-tint);color:var(--income-text)}
.tx .ic svg{width:18px;height:18px}
.tx .d{min-width:0}
.tx .d b{display:block;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx .d span{font-size:12px;line-height:16px;color:var(--ink-muted)}
/* Expenses are ink, not red. Red stays reserved for over-budget and bills due. */
.tx .amt{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.tx .amt.in{color:var(--income-text)}
.tx .more{width:28px;height:28px;border-radius:8px;color:var(--ink-subtle);display:grid;place-items:center}
.tx .more:hover{background:var(--surface-sunken);color:var(--ink)}
.tx.editing,.tx.confirm{grid-template-columns:1fr;background:var(--surface-tint);border-radius:var(--radius-md);padding:12px;margin:4px 0;border-top:0}
.tx-actions{display:flex;gap:6px;justify-content:flex-end}
.confirm-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;background:var(--surface-sunken);border-radius:var(--radius-md);margin:4px 0;font-size:13px}
.empty{padding:var(--space-2xl) var(--space-xl);text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px}
.empty svg{width:26px;height:26px}
.empty .ico{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:var(--surface-sunken);color:var(--ink-muted);margin-bottom:8px}
.empty b{display:block;font-size:15px;font-weight:600}
.empty p{margin:0;color:var(--ink-muted);max-width:32ch}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.filters{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.filters>*{min-width:0}
.status{font-size:11px;color:var(--ink-subtle);margin-top:8px;display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
.errbar{display:flex;align-items:center;gap:10px;background:var(--danger-tint);border:1px solid var(--danger);border-radius:var(--radius-md);padding:10px 14px;margin-bottom:14px;font-size:13px;color:var(--danger-text);flex-wrap:wrap}
.errbar svg{width:16px;height:16px;flex:none}
.errbar span{flex:1;min-width:180px}
.stale{color:var(--ink-subtle)!important}

/* ---------- toast & modal ---------- */
.toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--surface);border-radius:var(--radius-lg);padding:12px 12px 12px 16px;display:flex;align-items:center;gap:12px;font-weight:500;z-index:60;box-shadow:var(--shadow-raised);max-width:min(420px,calc(100vw - 32px))}
.toast button{color:var(--brand-400);font-weight:600;font-size:13px;padding:6px 10px;border-radius:8px}
.toast button:hover{background:rgba(255,255,255,.08)}
html[data-theme="dark"] .toast button{color:var(--brand-800)}
@media(min-width:900px){.toast{left:auto;right:24px;bottom:24px;transform:none}}
.modal{position:fixed;inset:0;background:rgba(22,21,15,.45);display:grid;place-items:center;padding:16px;z-index:70}
.modal .box{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);padding:var(--space-xl);width:min(560px,100%);max-height:90dvh;overflow:auto;box-shadow:var(--shadow-raised)}
.sheet{position:fixed;inset:0;z-index:70;display:flex;flex-direction:column;justify-content:flex-end;background:rgba(22,21,15,.45)}
.sheet .box{background:var(--surface);border-radius:22px 22px 0 0;box-shadow:var(--shadow-sheet);padding:10px 16px calc(28px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:16px;max-height:92dvh;overflow:auto}
.sheet .grab{width:40px;height:4px;border-radius:2px;background:var(--border-strong);align-self:center;flex:none}
@media(min-width:900px){.sheet{place-items:center;justify-content:center}.sheet .box{width:min(520px,100%);border-radius:var(--radius-xl);padding:var(--space-xl)}.sheet .grab{display:none}}
.ways{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.way{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 8px;display:flex;flex-direction:column;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--ink)}
.way[aria-pressed="true"]{background:var(--surface-tint);border-color:var(--brand-500)}
.way[aria-pressed="true"] .sm-tile{background:var(--brand-500);color:var(--on-brand)}
.plans{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.plan{background:var(--surface-sunken);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px}
.plan.pro{border-color:var(--brand-500)}
.plan .p{font-size:20px;font-weight:600;margin:4px 0;font-variant-numeric:tabular-nums}
.plan .p small{color:var(--ink-muted);font-size:12px;font-weight:400}
.plan ul{list-style:none;padding:0;margin:8px 0 12px;color:var(--ink-muted);font-size:13px}
.plan li{padding:3px 0 3px 18px;position:relative}
.plan li:before{content:"";position:absolute;left:0;top:9px;width:9px;height:5px;border-left:1.5px solid var(--success);border-bottom:1.5px solid var(--success);transform:rotate(-45deg)}

/* ---------- mobile ---------- */
.mhead{display:none}
.bnav{display:none}
@media(max-width:900px){
  .inp,select.inp,input.inp{font-size:16px}
  /* Touch targets: the design system's 40px control is fine with a mouse, not a thumb. */
  .btn{height:44px}.btn-sm{height:36px}.pill{height:36px}.inp{height:44px}
  .shell{grid-template-columns:1fr}
  .side{display:none}
  .mhead{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 16px 0}
  .main{padding:12px 16px calc(110px + env(safe-area-inset-bottom,0px))}
  .topbar h1{font-size:24px;line-height:30px}
  .topbar .right .btn.wide{display:none}
  .g4,.g3,.g2,.g21{grid-template-columns:1fr}
  .span2{grid-column:auto}
  .g4 .mini{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .bnav{display:grid;grid-template-columns:repeat(5,1fr);align-items:end;position:fixed;left:0;right:0;bottom:0;background:var(--surface);border-top:1px solid var(--border);padding:8px 4px calc(8px + env(safe-area-inset-bottom,0px));z-index:50}
  .bnav a,.bnav button{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;line-height:14px;font-weight:500;color:var(--ink-subtle);text-decoration:none;padding:4px 0;min-height:44px;justify-content:flex-end}
  .bnav a svg{width:20px;height:20px}
  .bnav a.on{color:var(--ink)}
  .bnav a.on svg{color:var(--accent-text)}
  .bnav .fab{width:52px;height:52px;border-radius:var(--radius-full);background:var(--brand-500);color:var(--on-brand);border:4px solid var(--surface);display:grid;place-items:center;margin:-26px auto 0;box-shadow:var(--shadow-raised);min-height:0;padding:0}
  .bnav .fab svg{width:22px;height:22px}
  .donut{width:112px;height:112px}
  .ways{gap:8px}
}
@media(min-width:901px){.g4 .mini{display:contents}}

#list{max-height:640px;overflow:auto;scrollbar-width:thin}

/* ---------- receipt preview ---------- */
.rc-row{display:grid;grid-template-columns:1fr 1fr 32px;grid-template-areas:"d d d" "a c x";gap:6px 8px;padding:10px 0;border-top:1px solid var(--border);align-items:center}
.rc-row:first-of-type{border-top:0}
.rc-row>*{min-width:0}.rc-row .inp{height:40px}
.rc-d{grid-area:d;font-weight:500}.rc-a{grid-area:a}.rc-c{grid-area:c}.rc-x{grid-area:x;justify-self:end}
@media(min-width:900px){.rc-row{grid-template-columns:1fr 130px 150px 32px;grid-template-areas:"d a c x"}}

/* ---------- guard / budget rows ---------- */
.guard{display:flex;gap:12px;align-items:flex-start;background:var(--surface-tint);border:1px solid var(--brand-100);border-radius:var(--radius-lg);padding:12px 14px;margin-bottom:10px;line-height:20px}
.guard.over{background:var(--danger-tint);border-color:var(--danger)}
.guard b{display:block;font-size:13px;font-weight:600;color:var(--accent-text);margin-bottom:2px}
.guard.over b{color:var(--danger-text)}
.guard p{margin:0;color:var(--ink)}
.guard .dim{font-size:12px;margin-top:4px}
.guard a{margin-left:auto;white-space:nowrap;font-size:13px;color:var(--accent-text);text-decoration:none;font-weight:500}
.cb-row{display:grid;grid-template-columns:1fr auto auto;gap:6px 10px;align-items:center;padding:8px 0;border-top:1px solid var(--border);font-size:13px}
.cb-row:first-child{border-top:0}
.cb-row .bar{grid-column:1/-1}
.cb-row.over .bar i{background:var(--danger)}
.cb-row.warn .bar i{background:var(--warning)}
.cb-row .more{width:28px;height:28px;border-radius:8px;color:var(--ink-subtle);display:grid;place-items:center}
.cb-row .more svg{width:15px;height:15px}
.cb-row .more:hover{color:var(--danger-text);background:var(--surface-sunken)}

/* ---------- agent / coach log ---------- */
.ag-log{display:flex;flex-direction:column;gap:12px;max-height:380px;overflow-y:auto;margin:0 0 10px}
.ag-log:empty{display:none}
.ag-m{max-width:88%;padding:10px 14px;border-radius:18px;line-height:21px;white-space:pre-wrap}
.ag-m.me{align-self:flex-end;background:var(--brand-500);color:var(--on-brand);border-bottom-right-radius:6px}
.ag-m.bot{align-self:flex-start;background:var(--surface);border:1px solid var(--border);border-bottom-left-radius:6px}
.ag-p{align-self:flex-start;max-width:88%;border:1px solid var(--border);background:var(--surface);border-radius:var(--radius-lg);padding:12px;font-size:13px}
.ag-p p{margin:0 0 8px}
.ag-b{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.ag-b .ok{color:var(--income-text);font-weight:600}

.ob-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.ob-card{margin-bottom:14px;border-color:var(--brand-100);background:var(--surface-tint)}
@media(max-width:700px){.ob-grid{grid-template-columns:1fr}}

/* ==========================================================================
   v3 screens (canvas "Snap Money Screens"): dashboard, calendar, budgets,
   Snap desk + side panel, add sheet. Built on sm-* components.
   ========================================================================== */
.skip{position:absolute;left:12px;top:-60px;z-index:100;background:var(--ink);color:var(--surface);padding:10px 14px;border-radius:var(--radius-md);text-decoration:none;font-weight:500}
.skip:focus{top:12px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.col{min-width:0}
.grow{flex:1;min-width:0}
.flabel{font-size:12px;line-height:16px;color:var(--ink-muted);font-weight:500}
.btn.icon{width:32px;padding:0}
.btn kbd{font:500 11px/1 var(--font-mono);padding:3px 6px;border-radius:6px;background:var(--surface-sunken);border:1px solid var(--border);color:var(--ink-muted)}
.askbtn{background:var(--surface-tint);border-color:var(--brand-100)}
html[data-theme="dark"] .askbtn{border-color:var(--border-strong)}
.topbar .tt{min-width:0}
.t-mob{display:none}
.row{margin-top:var(--space-xl)}
.stats{gap:20px}
.stat-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.sm-stat-delta svg{width:13px;height:13px;stroke-width:2.25}
.sm-stat-delta span{font-weight:400;margin-left:4px}
.sm-card-highlight .sm-stat-icon svg,.sm-stat-icon svg{width:16px;height:16px}
.sm-card-highlight .sm-bar{background:rgba(32,33,36,.18)}.sm-card-highlight .sm-bar>i{background:var(--on-brand)}
.sm-link{font-size:13px;font-weight:500;color:var(--accent-text);text-decoration:none;background:none;border:0;cursor:pointer;padding:6px 0}
.sm-link:hover{text-decoration:underline}
.hint{font-size:12px;line-height:16px;color:var(--ink-subtle);margin:8px 0 0}
.d-hide{display:none}
#recent .tx{padding:10px 0}
.sm-empty svg,.sm-tile svg{width:20px;height:20px}
.sm-cal-detail .sm-tile svg{width:16px;height:16px}
.sm-chart.pick .bg{cursor:pointer;outline:none}
.sm-chart.pick .bg:hover .bar-lo{fill:var(--brand-400)}
.sm-chart.pick .bg:focus-visible rect:first-child{stroke:var(--focus-ring);stroke-width:2}
html[data-theme="dark"] .sm-chart .bar-lo{fill:var(--heat-2)}
.sm-budget-nums .more{width:28px;height:28px;border-radius:8px;color:var(--ink-subtle);display:inline-grid;place-items:center;vertical-align:middle;margin-left:4px}
.sm-budget-nums .more svg{width:15px;height:15px}
.sm-budget-nums .more:hover{color:var(--danger-text);background:var(--surface-sunken)}
.sm-bill-main{flex:1;min-width:0}
.sm-bill-end{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.sm-tx-meta svg{width:12px;height:12px;vertical-align:-1px}
.sm-badge svg{width:14px;height:14px}
.stack{display:flex;flex-direction:column;gap:20px;min-width:0}

/* calendar */
.cal-layout{display:grid;grid-template-columns:minmax(0,520px) minmax(0,1fr);gap:20px;align-items:start}
.sm-cal-legend .lg{display:inline-flex;align-items:center;gap:5px}
.sm-cal-legend .sm-dot{width:6px;height:6px}
.sm-cal-head .btn svg{width:18px;height:18px}

/* budgets */
.bud-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:20px;align-items:start}
.bl-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.bl-num{font-size:28px;line-height:34px;font-weight:600;font-variant-numeric:tabular-nums;margin:6px 0 12px;letter-spacing:-.01em}
.bl-msg{display:block;font-size:13px;margin-top:10px;color:var(--income-text)}
.bl-msg[data-state="warn"]{color:var(--warning-text)}.bl-msg[data-state="over"]{color:var(--danger-text)}
.bud-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:8px;align-items:end;margin-top:16px;padding-top:16px;border-top:1px solid var(--border)}
.bud-form.two{grid-template-columns:minmax(0,1fr) auto;margin-top:0;padding-top:0;border-top:0}

/* chat (shared by desk + panel) */
.chat-log{flex:1;min-height:0;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:14px;background:var(--bg)}
.chat-log .sm-msg{max-width:92%}
.chat-log .mcol{min-width:0;display:flex;flex-direction:column;gap:10px}
.chat-log .sm-bubble{white-space:pre-wrap;overflow-wrap:anywhere}
.chat-log .sm-avatar-sm svg{width:14px;height:14px}
.chat-log .sm-confirm{margin-top:0;min-width:0;max-width:360px}
.chat-log .ag-card{max-width:440px;width:100%}
.chat-log .sm-confirm .sm-tile svg{width:18px;height:18px}
.chat-empty{margin:auto;max-width:36ch;text-align:center;color:var(--ink-muted);font-size:14px;line-height:21px}
.chat-foot{background:var(--bg);flex:none}
.chat-foot .sm-quick{padding:10px 16px}
.sm-chip{white-space:nowrap}
.sm-avatar svg{width:18px;height:18px}
.sm-round svg{width:20px;height:20px}
.sm-round-send svg{width:18px;height:18px}
/* Receipt: the identity motif. A day's spending reads like the slip it came from. */
.rcpt{background:#FFFDF6;color:#202124;font-family:var(--font-mono);font-size:12px;line-height:19px;padding:16px 18px 26px;max-width:340px;filter:drop-shadow(0 6px 14px rgba(122,94,20,.14));-webkit-mask:conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/12px 100%;mask:conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/12px 100%}
.rcpt .rc-h{text-align:center;font-weight:500;letter-spacing:.12em}
.rline{display:flex;align-items:baseline;gap:6px}
.rline span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rline.rsub{color:#5F6166;padding-left:2ch}
.rlead{flex:1 1 12px;border-bottom:1px dotted #A8A69D;transform:translateY(-4px)}
.rcut{border-top:1px dashed #BBB9BA;margin:8px 0}

/* Snap desk */
.desk{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;height:calc(100dvh - 150px);min-height:520px}
.desk-chat{display:flex;flex-direction:column;min-height:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);overflow:hidden}
.desk-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--border)}
.desk-head .hint{margin:0}
.desk-chat .chat-log{padding:24px clamp(16px,4vw,40px)}
.desk-composer{display:flex;align-items:center;gap:6px;margin:0 16px 16px;background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-xl);padding:8px 8px 8px 16px;box-shadow:var(--shadow-card)}
.desk-composer:focus-within{border-color:var(--brand-500)}
.desk-composer textarea,.desk-composer input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:400 15px/22px var(--font-sans);color:var(--ink);padding:8px 0}
.desk-composer textarea::placeholder,.sm-composer-field textarea::placeholder,.desk-composer input::placeholder,.sm-composer-field input::placeholder{color:var(--ink-subtle)}
.desk-side{display:flex;flex-direction:column;gap:14px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);padding:20px;align-self:start}
.desk-side .hint{margin:2px 0 0}
.knows{display:flex;flex-direction:column;gap:10px}
.know{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid var(--border);border-radius:var(--radius-md);font-size:13px;line-height:19px}
.know .sm-tile{width:32px;height:32px}.know .sm-tile svg{width:16px;height:16px}
.know b{display:block;font-weight:600}.know span:not(.sm-tile){color:var(--ink-muted)}

/* side panel */
.shell.panel-open{grid-template-columns:232px minmax(0,1fr) 420px}
.panel{position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;background:var(--surface);border-left:1px solid var(--border);box-shadow:var(--shadow-sheet);min-width:0}
.panel[hidden]{display:none}
.panel-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--border)}
.panel-ctx{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 16px;border-bottom:1px solid var(--border);font-size:13px;color:var(--ink-muted)}
.panel-ctx svg{width:14px;height:14px}.panel-ctx .hint{margin:0}
.panel-ctx.hidden{display:none}
.panel .sm-composer{background:var(--bg);border-top:0}
.panel .sm-composer-field{background:var(--surface);border:1px solid var(--border-strong)}
.panel .sm-composer-field:focus-within{border-color:var(--brand-500)}

/* sheets */
.sheet-h{display:flex;justify-content:space-between;align-items:center;gap:12px}
.sheet-h h2{margin:0;font-size:20px;line-height:26px;font-weight:600}
.sheet-h h2:focus{outline:none}
.way .sm-tile svg{width:20px;height:20px}
.more-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.more-link{display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px 8px;border:1px solid var(--border);border-radius:var(--radius-lg);text-decoration:none;font-size:13px;font-weight:500;color:var(--ink);min-height:44px}
.more-link svg{width:20px;height:20px;color:var(--ink-muted)}
.more-link.on{background:var(--surface-tint);border-color:var(--brand-100)}

@media(max-width:1280px){
  .shell.panel-open{grid-template-columns:232px minmax(0,1fr) 380px}
  .desk{grid-template-columns:1fr}.desk-side{display:none}
}
@media(max-width:1100px){
  .cal-layout,.bud-layout{grid-template-columns:1fr}
  .shell.panel-open{grid-template-columns:232px minmax(0,1fr)}
  .panel{position:fixed;right:0;top:0;bottom:0;width:min(420px,100%);z-index:65}
}
@media(max-width:900px){
  .t-desk{display:none}.t-mob{display:inline}
  .topbar #avatar{display:none}
  .m-hide{display:none}.d-hide{display:block}
  .stats{gap:12px}
  .row{margin-top:12px}
  .g3>.m-first{order:-1}
  .shell.panel-open{grid-template-columns:1fr}
  .panel{width:100%;border-left:0;padding-top:env(safe-area-inset-top,0px)}
  body.panel-on{overflow:hidden}
  .desk{height:calc(100dvh - 210px - env(safe-area-inset-bottom,0px));min-height:420px;margin:0 -16px}
  .desk-chat{border-radius:0;border-left:0;border-right:0}
  .desk-composer{margin:0 12px 12px}
  .bud-form{grid-template-columns:1fr 1fr}.bud-form .btn{grid-column:1/-1}
  .bud-form.two{grid-template-columns:1fr auto}.bud-form.two .btn{grid-column:auto}
  .bnav a,.bnav>button:not(.fab){display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;line-height:14px;font-weight:500;color:var(--ink-subtle);text-decoration:none;padding:4px 0;min-height:44px;justify-content:flex-end}
  .bnav svg{width:20px;height:20px}
  .bnav a.on,.bnav>button.on{color:var(--ink)}
  .bnav a.on svg,.bnav>button.on svg{color:var(--accent-text)}
  .toast{bottom:calc(92px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:420px){.more-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar .right .monthnav span{min-width:64px}}
/* The main column narrows when the Snap panel opens; lay out by its width, not the viewport. */
.main{container-type:inline-size}
.sm-insight-eyebrow svg{width:15px;height:15px}
.sm-insight .btn svg{width:16px;height:16px}
.stat-empty{font-size:15px;line-height:22px;font-weight:500;color:var(--ink-muted);margin:12px 0 10px}
@container (max-width:1000px){
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g21{grid-template-columns:minmax(0,1fr)}
  .g3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g3>.m-first{grid-column:1/-1}
}
@container (max-width:620px){
  .g4,.g3,.g2{grid-template-columns:minmax(0,1fr)}
}
/* voice note recorder */
.rec{display:flex;align-items:center;gap:16px;padding:16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-sunken)}
.rec-btn{width:64px;height:64px;border-radius:50%;background:var(--brand-500);color:var(--on-brand);display:grid;place-items:center;flex:none;box-shadow:var(--shadow-raised)}
.rec-btn svg{width:26px;height:26px}
.rec-btn[aria-pressed="true"]{background:var(--danger-strong);color:#fff;animation:recpulse 1.4s ease-in-out infinite}
@keyframes recpulse{50%{box-shadow:0 0 0 8px var(--danger-tint)}}
@media (prefers-reduced-motion:reduce){.rec-btn[aria-pressed="true"]{animation:none}}
.rec-t{display:flex;flex-direction:column;gap:2px;min-width:0}.rec-t .hint{margin:0}
.vc-card{display:grid;gap:10px;padding:14px;border:1px solid var(--border);border-radius:var(--radius-lg)}
.err-t{margin:0;color:var(--danger-text);font-size:13px}
/* Snap desk on phones: a fixed full-screen chat between the status bar and the bottom
   nav, so there's no page scroll and no gap. Inputs are 16px so iOS doesn't zoom on focus. */
@media(max-width:900px){
  .desk-composer input,.sm-composer-field input,.desk-composer textarea,.sm-composer-field textarea{font-size:16px}
  body[data-view="assistant"] .mhead,body[data-view="assistant"] .topbar{display:none}
  body[data-view="assistant"] .desk{position:fixed;left:0;right:0;top:0;bottom:calc(61px + env(safe-area-inset-bottom,0px));height:auto;min-height:0;margin:0;z-index:40;display:flex}
  body[data-view="assistant"] .desk-chat{flex:1;border:0;border-radius:0;padding-top:env(safe-area-inset-top,0px)}
  body[data-view="assistant"] .main{padding:0}
  /* Keyboard open: drop the bottom nav so the composer sits right on the keyboard. */
  body.kb .bnav{display:none}
  body.kb[data-view="assistant"] .desk{bottom:0}
  body.kb .desk-composer{margin-bottom:8px}
}
/* Keyboard open on phones: pin the chat to the visible viewport (visualViewport), so the
   composer sits right on top of the keyboard instead of scrolling with the page. */
@media(max-width:900px){
  body.kb{overflow:hidden}
  body.kb[data-view="assistant"] .desk,body.kb .panel{top:var(--vv-top,0px);bottom:auto;height:var(--vv-h,100dvh)}
  body.kb .desk-chat{padding-top:0}
}
/* The generic bottom-nav rule sets justify-content:flex-end; on the grid FAB that shoved the icon right. */
.bnav .fab{justify-content:center;align-content:center;place-items:center}
/* Selected way: tinted surface works in both themes; the icon tile goes solid gold. */
.way{color:var(--ink)}
.ways .way[aria-pressed="true"] .sm-tile{background:var(--brand-500);color:var(--on-brand)}
[data-theme] .ways .way[aria-pressed="true"] .sm-tile{background:var(--brand-500);color:var(--on-brand)}
/* Sheets while typing on a phone: fill the visible area above the keyboard, box stuck to its bottom. */
@media(max-width:900px){
  body.kb .sheet{top:var(--vv-top,0px);bottom:auto;height:var(--vv-h,100dvh)}
  body.kb .sheet .box{max-height:100%;padding-bottom:12px}
}
.sm-round.mic[aria-pressed="true"]{background:var(--danger-strong);color:#fff;animation:recpulse 1.4s ease-in-out infinite}
.sm-round.mic:disabled{opacity:.5}
@media (prefers-reduced-motion:reduce){.sm-round.mic[aria-pressed="true"]{animation:none}}
/* Page locked while the keyboard is up (top offset set inline to keep the scroll position). */
@media(max-width:900px){body.kb{position:fixed;left:0;right:0;width:100%}}
@media(max-width:900px){body.kb .chat-log,body.kb .sheet .box{overscroll-behavior:contain}}
/* Snap avatar = logo mark on gold, with a small "AI" badge bottom-right so it's clear who's answering. */
.sm-avatar{position:relative}
.sm-avatar::after{content:"AI";position:absolute;right:-4px;bottom:-4px;min-width:16px;height:16px;padding:0 3px;box-sizing:border-box;border-radius:999px;background:var(--ink);color:var(--surface);font:700 8px/12px var(--font-sans);letter-spacing:.02em;display:grid;place-items:center;border:2px solid var(--surface)}
.sm-avatar-sm::after{min-width:13px;height:13px;right:-4px;bottom:-3px;font-size:6.5px;line-height:9px;padding:0 2px;border-width:1.5px}
.chat-log .sm-avatar::after{border-color:var(--bg)}
/* account deletion */
.danger-zone{margin-top:16px;border-color:var(--danger)}
.danger-zone .sm-card-title{color:var(--danger-text)}
.dz-row{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.dz-btn{color:var(--danger-text);border-color:var(--danger)}
.del-what{margin:0 0 12px;font-weight:500;line-height:21px}
.del-export{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;border-radius:var(--radius-md);background:var(--surface-sunken);margin-bottom:12px}
.del-how{margin:0 0 14px;padding-left:18px;color:var(--ink-muted);font-size:13px;line-height:20px}
.del-banner{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--danger-tint);border:1px solid var(--danger);color:var(--danger-text);border-radius:var(--radius-md);padding:10px 14px;margin-bottom:16px;font-size:13px;font-weight:500}
.del-banner svg{width:16px;height:16px;flex:none}.del-banner span{flex:1;min-width:200px}
/* Install banner (static/install.js): above the bottom nav on phones, top right on desktop. */
.inst-banner{position:fixed;z-index:60;left:12px;right:12px;bottom:calc(84px + env(safe-area-inset-bottom,0px));display:grid;grid-template-columns:36px 1fr;gap:10px 12px;align-items:center;padding:14px;background:var(--surface);color:var(--ink);border:1px solid var(--border);border-radius:var(--radius-xl,18px);box-shadow:var(--shadow-sheet);animation:instIn .24s cubic-bezier(.2,.8,.2,1)}
.inst-banner img{border-radius:10px}
.inst-banner p{margin:0;font-size:14px;line-height:1.4}
.inst-banner-act{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px}
@media(min-width:900px){.inst-banner{left:auto;right:24px;top:24px;bottom:auto;width:360px}}
@keyframes instIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.inst-banner{animation:none}}

/* kuota harian (Pengaturan > Paket) dan chip chat di header Snap AI */
.quota-chip{font-variant-numeric:tabular-nums}.quota-chip:empty{display:none}
.quota-list{margin-top:12px;display:flex;flex-direction:column;gap:10px}.quota-list:empty{display:none}
.q-head{font-size:12px;font-weight:600}
.q-row{display:flex;flex-direction:column;gap:5px}
.q-top{display:flex;justify-content:space-between;gap:8px;font-size:13px;color:var(--ink-muted)}.q-top b{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums}
.q-bar{height:4px;border-radius:99px;background:var(--surface-sunken);overflow:hidden}
.q-bar i{display:block;height:100%;background:var(--brand-500);transform-origin:left;transition:transform .3s}
.q-bar.warn i{background:var(--warning-text)}.q-bar.full i{background:var(--danger)}
.q-note{margin:0;font-size:12px;color:var(--ink-subtle)}
@media (prefers-reduced-motion:reduce){.q-bar i{transition:none}}
/* Mode sembunyikan nominal (static/privacy.js). Blur, bukan hapus, supaya layout tidak lompat. */
.amt-toggle{width:44px;height:44px;display:inline-grid;place-items:center;border:0;border-radius:var(--radius-md);background:transparent;color:var(--ink-muted);cursor:pointer;flex:none}
.amt-toggle:hover{background:var(--surface-sunken);color:var(--ink)}
.amt-toggle .i-off,html.hide-amt .amt-toggle .i-on{display:none}
html.hide-amt .amt-toggle .i-off{display:inline}
html.hide-amt .amt-toggle{color:var(--accent-text)}
/* Mode sembunyi: nominal diganti titik bulat (gaya kartu bank). Teks asli disembunyikan, titiknya ikut ukuran huruf sekitarnya. */
html.hide-amt span.pv:not(.peek){user-select:none;cursor:pointer;white-space:nowrap}
html.hide-amt span.pv:not(.peek) .amt-v{display:none}
html.hide-amt span.pv:not(.peek)::after{content:"\2022\2022\2022\2022\2022\2022";letter-spacing:.06em}
.amt{transition:filter .15s}
@media (prefers-reduced-motion:reduce){.amt{transition:none}}
.mhead .amt-toggle{margin-left:auto;margin-right:4px}
@media(max-width:900px){.topbar .amt-toggle{display:none}}
/* Akun dan jatah harian (ROADMAP E2, E3-S1). Logo resmi di latar putih supaya terbaca di kedua tema. */
.home-top{display:flex;flex-direction:column;gap:10px;margin-bottom:var(--space-md)}
.safe .sm-stat-value{font-size:30px;line-height:36px}
.safe-empty p,.safe-over .sm-stat-sub{margin:6px 0 0;color:var(--ink-muted)}
.safe-over .sm-stat-value{color:var(--danger-text);font-size:20px;line-height:28px}
.ibrand{display:inline-grid;place-items:center;flex:none;border-radius:10px;font-weight:700;font-size:11px;letter-spacing:-.02em;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06)}
.ibrand.logo{background:#fff;padding:3px}.ibrand.logo img{width:100%;height:100%;object-fit:contain;border-radius:7px}
.acc-card{display:flex;flex-direction:column;gap:2px}
.acc-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.acc-row{display:flex;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--border)}
.acc-row:nth-child(2){border-top:0}
.acc-row .grow{flex:1;min-width:0}.acc-n{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acc-b{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}.acc-b.neg{color:var(--danger-text)}
.acc-warn{margin:6px 0 0}
.acc-empty{flex-direction:row;align-items:center;justify-content:space-between;gap:12px}.acc-empty p{margin:4px 0 0}
.acc-chips{display:flex;flex-wrap:wrap;gap:6px}
.acc-chip{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:4px 12px 4px 6px;border-radius:999px;border:1px solid var(--border-strong);background:var(--surface);color:var(--ink);font:500 14px var(--font-sans);cursor:pointer}
.acc-chip.on{background:var(--surface-tint);border-color:var(--brand-500);font-weight:600}
.acc-chip:focus-visible,.inst:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.inst-grid{max-height:min(56vh,480px);overflow-y:auto;margin:12px 0}
.inst-grid .grp{font-size:12px;font-weight:600;color:var(--ink-subtle);margin:12px 0 8px}
.inst-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 6px}
.inst{display:flex;flex-direction:column;align-items:center;gap:6px;background:none;border:0;padding:6px 2px;border-radius:12px;color:var(--ink-muted);font:12px/1.3 var(--font-sans);text-align:center;cursor:pointer;min-height:44px}
.inst:hover{background:var(--surface-sunken);color:var(--ink)}
.acc-pick{display:flex;align-items:center;gap:12px}.acc-pick:empty{display:none}
@media(max-width:900px){.home-top{grid-template-columns:minmax(0,1fr)}}
.acc-strip{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:2px}.acc-strip::-webkit-scrollbar{display:none}
.acc-pill{flex:none;display:flex;align-items:center;gap:8px;padding:8px 14px 8px 8px;border-radius:14px;background:var(--surface);border:1px solid var(--border);min-height:48px}
.acc-pill>span{display:flex;flex-direction:column;line-height:1.2}.acc-pill .acc-n{font-size:12px;color:var(--ink-muted)}.acc-pill .acc-b{font-size:14px}
.acc-plus{padding:8px 14px;color:var(--ink-muted);cursor:pointer;font:inherit}.acc-plus:hover{color:var(--ink)}
.acc-add-cta{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:12px 14px;border-radius:14px;border:1px dashed var(--border-strong);background:transparent;color:var(--ink);font:inherit;cursor:pointer}
.acc-add-cta>span{display:flex;flex-direction:column;gap:2px}.acc-add-cta:focus-visible,.acc-plus:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.acc-plus svg{width:20px;height:20px;flex:none}
/* Category hues that stay apart from each other and from the danger red, while sitting with the gold brand.
   Overrides the all-gold/grey set so the donut, legend and per-category bars are readable. */
:root,[data-theme="light"]{--cat-makan:#D9B44A;--cat-transport:#3F7F8C;--cat-belanja:#8A5FA8;--cat-tagihan:#6E7074;--cat-kesehatan:#4E8A5E;--cat-investasi:#8C6A1F;--cat-hiburan:#C0678A;--cat-lainnya:#B8B3A4}
[data-theme="dark"]{--cat-makan:#E6C865;--cat-transport:#6FB3C0;--cat-belanja:#B592D0;--cat-tagihan:#A8A69D;--cat-kesehatan:#7FBF8F;--cat-investasi:#C9A13E;--cat-hiburan:#E08FB0;--cat-lainnya:#6E6B60}
.sm-legend-row .amt{white-space:nowrap}.sm-legend-row>span:nth-child(2){min-width:0;overflow-wrap:anywhere}
.inc-cta{cursor:pointer;border-style:dashed}.inc-cta:hover{background:var(--surface-tint)}.inc-cta:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
@media(min-width:901px){.inc-cta{grid-column:span 2}}
.sm-donut .center-n{font-size:20px}
/* Struk sebagai satu pembelian + header per tanggal di daftar transaksi */
.rc-group>summary{list-style:none;cursor:pointer}.rc-group>summary::-webkit-details-marker{display:none}
.rc-group>summary:focus-visible{outline:2px solid var(--ink);outline-offset:-2px;border-radius:10px}
.rc-chev{display:grid;place-items:center;width:32px;color:var(--ink-subtle);transition:transform .15s}.rc-chev svg{width:18px;height:18px}
.rc-group[open] .rc-chev{transform:rotate(180deg)}
.rc-items{margin:0 0 6px 20px;border-left:2px solid var(--border);padding-left:10px}.rc-items .tx{padding-block:6px}.rc-items .ic{transform:scale(.85)}
.day-h{display:flex;justify-content:space-between;align-items:baseline;padding:14px 4px 6px;font-size:13px;font-weight:600;color:var(--ink-muted);border-bottom:1px solid var(--border)}
.day-h .amt{font-variant-numeric:tabular-nums}
#list{max-width:880px}
@media (prefers-reduced-motion:reduce){.rc-chev{transition:none}}
.cat-btn{background:none;border:0;padding:0;font:inherit;color:inherit;text-decoration:underline dotted;text-underline-offset:3px;cursor:pointer}
.cat-btn:hover{color:var(--ink)}.cat-btn:focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:4px}
.recat{padding:8px 4px 12px 52px;display:flex;flex-direction:column;gap:6px}.recat-chips{display:flex;flex-wrap:wrap;gap:6px}.recat .acc-chip{min-height:36px;padding:4px 12px}
.sm-chart .bar-cut{stroke:var(--surface);stroke-width:3;fill:none}.sm-chart text.cut-val{fill:var(--ink);font-weight:600}
.acc-tag{display:inline-flex;align-items:center;gap:4px;vertical-align:middle}.acc-tag .ibrand{border-radius:4px}.acc-tag .ibrand.logo{padding:1px}
.fbar{display:grid;grid-template-columns:minmax(0,1fr) 180px auto;gap:8px;align-items:center}.fbar #kindchips{flex-wrap:nowrap}
.fbar-range{margin-top:8px}.frange{margin-top:6px}.frange>summary{cursor:pointer;font-size:13px;color:var(--ink-muted);padding:4px 0}.frange>summary:focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:4px}
.frange .filters{margin-top:8px}
@media(max-width:700px){.fbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.fbar #q{grid-column:1/-1}}
.chat-day{display:flex;align-items:center;gap:10px;margin:10px 0;color:var(--ink-subtle);font-size:12px}.chat-day::before,.chat-day::after{content:"";flex:1;height:1px;background:var(--border)}
/* Heatmap steps far enough apart to tell a normal day from a heavy one (review batch C). */
:root,[data-theme="light"]{--heat-1:#F5E6BA;--heat-2:#E6C466;--heat-3:#C4952A}
[data-theme="dark"]{--heat-1:#3F3620;--heat-2:#7D6628;--heat-3:#D9B44A}
.seg button{color:var(--ink)}.seg button.on{font-weight:600}.seg button:not(.on):hover{background:var(--surface-tint)}
@media(max-width:700px){.fbar #kindchips{grid-column:1/-1;overflow-x:auto;scrollbar-width:none}.fbar #catSel{grid-column:1/-1}}
#cbAddBtn{margin-top:14px;width:100%}.bl-form .chips{flex-wrap:nowrap}
#cbAskBtn{margin-top:14px;width:100%}#cbAskBtn+#cbAddBtn{margin-top:8px}
.fx-tag{color:var(--muted);white-space:nowrap}
.acc-idr{display:block;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.acc-xfer{gap:6px;width:auto;padding:0 14px;font-size:13px;font-weight:600}
button.acc-pill{font:inherit;color:inherit;text-align:left;cursor:pointer}
button.acc-pill:hover{border-color:var(--border-strong,var(--muted))}
.check-row{display:flex;align-items:center;gap:10px;font-size:14px;min-height:44px}
.check-row input{width:18px;height:18px;accent-color:var(--brand-500)}
/* Impor mutasi (ROADMAP E1-S2) */
.imp-body{background:var(--bg)}
.imp{max-width:760px;margin:0 auto;padding:16px 16px 120px}
.imp-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.imp-h1{font-family:var(--display);font-size:clamp(1.5rem,4vw,2rem);margin:0 0 4px;letter-spacing:-.02em}
.imp-sub{margin:0 0 16px}
.imp-pick{display:flex;flex-direction:column;gap:4px;align-items:center;justify-content:center;text-align:center;min-height:140px;border:1.5px dashed var(--border);border-radius:var(--radius-lg);cursor:pointer;padding:16px}
.imp-pick:hover,.imp-pick:focus-within{border-color:var(--brand-500)}
.imp-head{display:flex;justify-content:space-between;gap:12px;align-items:end;flex-wrap:wrap;margin-bottom:8px}
.imp-acc{min-width:180px}
.imp-allrow{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--border);padding-bottom:4px}
.imp-list{list-style:none;margin:0;padding:0}
.imp-row{display:grid;grid-template-columns:32px minmax(0,1fr) 150px auto;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--border);opacity:.55}
.imp-row.on{opacity:1}
.imp-chk input{width:20px;height:20px;accent-color:var(--brand-500)}
.imp-main{display:flex;flex-direction:column;min-width:0}
.imp-main b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.imp-main .hint{margin:0;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.imp-cat{padding:6px 10px;min-height:36px;font-size:13px}
.imp-amt{font-variant-numeric:tabular-nums;font-weight:600;text-align:right;white-space:nowrap}
.imp-amt.in{color:var(--success-text,var(--accent-text))}
.imp-bar{position:fixed;left:0;right:0;bottom:0;display:flex;gap:8px;justify-content:center;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));background:var(--surface);border-top:1px solid var(--border);z-index:40}
.imp-bar .btn-primary{flex:0 1 420px}
@media(max-width:600px){.imp-row{grid-template-columns:28px minmax(0,1fr) auto;grid-template-areas:"chk main amt" ". cat cat";row-gap:6px}.imp-chk{grid-area:chk}.imp-main{grid-area:main}.imp-amt{grid-area:amt}.imp-cat-w{grid-area:cat}.imp-acc{min-width:0;width:100%}}
.imp-link{margin-top:8px;width:100%}
.imp-text{margin-top:12px}
.imp-text summary{cursor:pointer;font-weight:600;font-size:14px;padding:6px 0}
.imp-text textarea{width:100%;margin:6px 0 8px;font-size:13px;resize:vertical}
/* onboarding card */
.act-card{margin-bottom:16px}
.act-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.act-step{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--border)}
.act-step:first-child{border-top:0}
.act-dot{flex:none;width:26px;height:26px;border-radius:50%;border:2px solid var(--border-strong,var(--border));display:grid;place-items:center}
.act-step.done .act-dot{background:var(--brand-500);border-color:var(--brand-500);color:var(--on-brand,#202124)}
.act-step.done .act-dot svg{width:15px;height:15px}
.act-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.act-t .hint{margin:0}
.act-step.done .act-t b{text-decoration:line-through;color:var(--ink-muted)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
/* iOS zooms into any field under 16px on focus and stays zoomed. Touch screens get 16px fields; pinch zoom stays available. */
@media (pointer: coarse) { input, textarea, select { font-size: 16px !important; } }

/* ================= Dashboard v2 (desktop ala mockup; HP tetap satu kolom) ================= */
.head-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-sunken); color: var(--accent-text); margin-right: 10px; flex: none; }
.sm-card-title:has(.head-ic) { display: flex; align-items: center; }
.trend-cat { height: 32px; width: auto; padding: 0 28px 0 10px; font-size: 12px; margin-left: auto; margin-right: 12px; }
.acc-head, .safe-ic, .guard-ic, .tbl-head, .c-date, .c-cat, .c-acc { display: none; }
.guard-cta { display: none; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap;
  background: color-mix(in srgb, var(--bc, var(--ink-muted)) 16%, var(--surface)); color: color-mix(in srgb, var(--bc, var(--ink-muted)) 65%, var(--ink)); }
.badge.b-in { --bc: var(--success); }
.badge.b-x { --bc: var(--info); }
.side-user { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.side-user .su-t { min-width: 0; display: flex; flex-direction: column; }
.side-user b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { font-size: 11px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-open .acc-strip { flex-wrap: wrap; overflow: visible; }

@media (min-width: 901px) {
  :root { --tbl-cols: 36px 52px minmax(0, 1.5fr) 124px minmax(0, 1fr) minmax(0, 1fr) 28px; }
  .topbar .avatar { display: none; }
  #v-dashboard.on { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
  #v-dashboard > * { grid-column: 1 / -1; margin: 0; }
  #v-dashboard > div:empty { display: none; }
  #v-dashboard .home-top, #v-dashboard .stats { display: contents; }
  #v-dashboard #safeBox { grid-column: 1 / -1; }
  #v-dashboard .stats > section { grid-column: auto; }
  #v-dashboard #accBox { order: 5; grid-column: 1 / -1; }
  #v-dashboard > .row { order: 6; }
  #v-dashboard .guard { margin: 0; }

  .safe { display: flex; align-items: center; gap: 16px; height: 100%; box-sizing: border-box; }
  .safe-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .38); flex: none; }
  .safe-t { min-width: 0; }

  .guard { align-items: center; gap: 14px; background: var(--warning-tint); border-color: color-mix(in srgb, var(--warning) 30%, var(--surface)); padding: 14px 18px; }
  .guard.over { background: var(--danger-tint); border-color: var(--danger); }
  .guard b { color: var(--warning-text); }
  .guard.over b { color: var(--danger-text); }
  .guard-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--warning) 18%, var(--surface)); color: var(--warning-text); flex: none; }
  .guard.over .guard-ic { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger-text); }
  .guard-cta { display: inline-flex; margin-left: auto; }
  .guard-fix { display: none; }

  .acc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); box-shadow: var(--shadow-card); }
  .acc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .acc-head .sm-card-title { margin: 0; }
  .acc-all { background: none; border: 0; cursor: pointer; font: inherit; }

  #v-dashboard .g3.row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  #v-dashboard .g3.row > .m-first { grid-row: span 2; }
  #v-dashboard .g3.row > .d-hide { display: none; }

  .tbl-head { display: grid; grid-template-columns: var(--tbl-cols); gap: 12px; padding: 8px 0; font-size: 12px; font-weight: 600; color: var(--ink-subtle); border-bottom: 1px solid var(--border); }
  .tbl-head .r { text-align: right; }
  #recent.tbl .tx[data-id] { grid-template-columns: var(--tbl-cols); gap: 12px; padding: 12px 0; }
  #recent.tbl .tx[data-id] .c-date { display: block; font-size: 13px; color: var(--ink-muted); white-space: nowrap; }
  #recent.tbl .tx[data-id] .c-cat { display: block; }
  #recent.tbl .tx[data-id] .c-acc { display: block; min-width: 0; font-size: 13px; color: var(--ink-muted); }
  #recent.tbl .tx[data-id] .amt { text-align: right; }
  #recent.tbl .tx[data-id] .d-meta { font-size: 0; }
  #recent.tbl .tx[data-id] .d-meta .cat-btn, #recent.tbl .tx[data-id] .d-meta .acc-tag { display: none; }
  #recent.tbl .tx[data-id] .d-meta .fx-tag { font-size: 12px; }
  #recent.tbl .tx.editing, #recent.tbl .tx.confirm { grid-template-columns: 1fr; }
}
/* Kolom mengikuti lebar area konten (bukan layar): panel Snap yang terbuka menyempitkan konten. */
.main { container: main / inline-size; }
@container main (min-width: 1180px) {
  #v-dashboard.on { grid-template-columns: minmax(0, 1.35fr) repeat(4, minmax(0, 1fr)); }
  #v-dashboard #safeBox { grid-column: auto; }
}
@container main (max-width: 1179px) {
  #v-dashboard .stats .sm-stat-value { font-size: 20px; }
}
@container main (max-width: 760px) {
  #v-dashboard.on { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #v-dashboard .g3.row, #v-dashboard .g21 { grid-template-columns: minmax(0, 1fr); }
  #v-dashboard .g3.row > .m-first { grid-row: auto; }
}

@media (min-width: 901px) {
  #v-dashboard .stats .sm-stat-value { font-size: 24px; white-space: nowrap; }
  #v-dashboard .safe .sm-stat-value { font-size: 30px; }
}


/* Menu aksi baris (popup) */
.row-pop { position: fixed; z-index: 60; min-width: 160px; max-width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-raised); padding: 6px; display: flex; flex-direction: column; }
.row-pop > button, .row-pop .rp-act button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; }
.row-pop button svg { width: 16px; height: 16px; }
.row-pop button:hover, .row-pop button:focus-visible { background: var(--surface-sunken); }
.row-pop .danger { color: var(--danger-text); }
.row-pop.ask { padding: 12px; gap: 10px; }
.row-pop p { margin: 0; font-size: 13px; line-height: 1.45; }
.row-pop .rp-act { display: flex; gap: 6px; justify-content: flex-end; }
.row-pop .rp-act .danger { background: var(--danger); color: #fff; }

/* ================= Dashboard v3: bahasa visual ala mockup (kartu bersih, grafik mini, area chart) ================= */
.dash-h, .st-viz, .st-badge.hidden { display: none; }
.st-badge { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.st-badge span { font-weight: 400; opacity: .8; }
.st-badge.good { background: var(--success-tint); color: var(--income-text); }
.st-badge.bad { background: var(--danger-tint); color: var(--danger-text); }
.st-badge.warn { background: var(--warning-tint); color: var(--warning-text); }
.spark .sp-l { fill: none; stroke: var(--brand-600); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .sp-a { fill: var(--brand-500); opacity: .14; }
.spark circle { fill: var(--brand-600); }
.mini-ring .mr-t { fill: none; stroke: var(--surface-sunken); stroke-width: 4; }
.mini-ring .mr-v { fill: none; stroke: var(--success); stroke-width: 4; stroke-linecap: round; }
.mini-ring text { font: 600 8.5px/1 var(--font-sans); fill: var(--ink); }
.sm-area .ar-fill { fill: url(#arG); }
.sm-area .ar-line { fill: none; stroke: var(--brand-600); stroke-width: 2.5; stroke-linecap: round; }
.sm-area .ar-dot { fill: var(--surface); stroke: var(--brand-600); stroke-width: 1.6; }
.sm-area .ar-dot.cut { fill: var(--brand-600); }
.sm-area .ar-guide { stroke: var(--brand-700); stroke-width: 1; stroke-dasharray: 3 3; }
.sm-area .ar-focus { fill: var(--brand-600); stroke: var(--surface); stroke-width: 3; }
.sm-area.pick .ar-hit { cursor: pointer; }
.sm-area .ar-hit:focus { outline: none; }
.ar-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-raised); padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.ar-tip span { font-size: 11px; color: var(--ink-muted); }
.ar-tip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ar-tip i { font-style: normal; font-size: 11px; font-weight: 600; }
.ar-tip i.good { color: var(--income-text); }
.ar-tip i.bad { color: var(--danger-text); }

@media (min-width: 901px) {
  .main { background: var(--bg); }
  .dash-h { display: flex; align-items: center; }
  .dash-h h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
  #v-dashboard #guardBox { display: none; }
  #v-dashboard .sm-card { border-radius: 18px; box-shadow: 0 1px 2px rgba(32,33,36,.04), 0 6px 18px rgba(32,33,36,.035); }
  #v-dashboard .stats .sm-card { display: flex; flex-direction: column; gap: 6px; }
  #v-dashboard .stats .st-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 6px; }
  #v-dashboard .stats .st-viz { display: block; flex: none; margin-bottom: 2px; }
  #v-dashboard .stats .sm-stat-delta { display: inline-flex; align-self: flex-start; gap: 3px; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--danger-tint); color: var(--danger-text); }
  #v-dashboard .stats .sm-stat-delta.hidden { display: none; }
  #v-dashboard .stats .sm-stat-delta svg { width: 12px; height: 12px; }
  #v-dashboard .stats .sm-stat-delta span { font-weight: 400; opacity: .8; }
  #v-dashboard .stats .sm-stat-sub { margin-top: auto; }
  .plan-card { background: var(--surface); box-shadow: 0 6px 18px rgba(32,33,36,.06); border-radius: 14px; padding: 14px; }
  .plan-card .plan-cta { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
  .plan-card .plan-cta:hover { opacity: .9; }
}
@container main (max-width: 1179px) {
  #v-dashboard .stats .st-viz { display: none; }
}
@media (min-width: 901px) { #v-dashboard .stats .sm-stat-delta.good { background: var(--success-tint); color: var(--income-text); } }
@media (min-width: 901px) {
  #v-dashboard .stats .sm-card { position: relative; }
  #v-dashboard .stats .st-viz { position: absolute; top: 14px; right: 14px; margin: 0; }
  #v-dashboard .stats .sm-card:has(.st-viz:not(:empty)) .sm-stat-icon { visibility: hidden; }
}

/* ================= Lekuk ala mockup pertama: sudut besar, tombol pil, hero bergradien, bar berarsir ================= */
@media (min-width: 901px) {
  #v-dashboard .sm-card, #v-dashboard .acc-card { border-radius: 24px; }
  .topbar .btn, .topbar .monthnav, .topbar .askbtn { border-radius: 999px; }
  .topbar .monthnav button { border-radius: 999px; }
  #v-dashboard .safe { background: linear-gradient(140deg, var(--brand-400) 0%, var(--brand-500) 55%, var(--brand-700) 135%); border: 0; box-shadow: 0 10px 28px rgba(173, 139, 48, .28); }
  #v-dashboard .safe-ic { border-radius: 16px; background: rgba(255, 255, 255, .32); }
  #v-dashboard .acc-pill { border-radius: 18px; }
  #v-dashboard .acc-pill.acc-plus { border-radius: 999px; }
  #v-dashboard .head-ic { border-radius: 10px; }
  #v-dashboard .trend-cat { border-radius: 999px; }
  /* bar budget: sisa diarsir garis miring, terpakai solid */
  #v-dashboard #bbar { height: 12px; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--surface-sunken) 0 5px, var(--border-strong) 5px 7px); }
  #v-dashboard #bbar i { border-radius: 999px; }
  #v-dashboard .badge, #v-dashboard .st-badge { border-radius: 999px; }
  .plan-card, .plan-card .plan-cta { border-radius: 18px; }
  .plan-card .plan-cta { border-radius: 999px; }
  .side nav a { border-radius: 999px; }
}

/* ================= Kalender v2 ================= */
.cs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cs-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface-sunken); }
.cs-row[role="button"] { cursor: pointer; }
.cs-row[role="button"]:hover { box-shadow: inset 0 0 0 1px var(--brand-500); }
.cs-row span { font-size: 12px; color: var(--ink-muted); }
.cs-row b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cs-row small { font-size: 11px; color: var(--ink-subtle); }
.cal-side-detail .sm-cal-detail { margin: 0; border: 0; padding: 0; }
.cal-side-detail .sm-cal-detail-head { font-size: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
#v-calendar .sm-card, #v-calendar .sm-cal { border-radius: 24px; }

@media (min-width: 901px) {
  .cal-layout { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); }
  #v-calendar .sm-cal { padding: 24px; box-shadow: 0 1px 2px rgba(32,33,36,.04), 0 6px 18px rgba(32,33,36,.035); }
  #v-calendar .sm-cal-head .btn { border-radius: 999px; width: 38px; height: 38px; border: 1px solid var(--border); }
  #v-calendar .sm-cal-month { font-size: 20px; letter-spacing: -.01em; }
  #v-calendar .sm-cal-grid { gap: 8px; }
  #v-calendar .sm-cal-dow { font-size: 12px; padding-bottom: 6px; }
  #v-calendar .sm-cal-day { aspect-ratio: auto; min-height: 76px; border-radius: 16px; padding: 10px 10px 8px; align-items: flex-start; justify-content: space-between; background: var(--surface-sunken); transition: transform .12s, box-shadow .12s; }
  #v-calendar .sm-cal-day[data-out="true"] { background: transparent; }
  #v-calendar .sm-cal-day[data-future="true"] { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--ink-subtle); }
  #v-calendar .sm-cal-day:hover:not([data-out]) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(32,33,36,.08); }
  #v-calendar .sm-cal-n { font-size: 14px; }
  #v-calendar .sm-cal-amt { font: 600 12px/14px var(--font-sans); letter-spacing: 0; opacity: 1; }
  #v-calendar .sm-cal-day[data-today="true"] { box-shadow: inset 0 0 0 2px var(--brand-700); }
  #v-calendar .sm-cal-day[aria-pressed="true"] { outline: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
  #v-calendar .sm-cal-bill, #v-calendar .sm-cal-inc { top: 10px; width: 8px; height: 8px; }
  #v-calendar .sm-cal-bill { right: 10px; }
  #v-calendar .sm-cal-inc { left: auto; right: 22px; }
  #v-calendar .sm-cal-legend { margin-top: 18px; gap: 8px 18px; font-size: 12px; }
  #v-calendar .sm-cal-scale i { border-radius: 5px; width: 14px; height: 14px; }
  .cal-side-detail { max-height: 520px; overflow: auto; }
}
@container main (max-width: 1050px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  #v-calendar .sm-cal-day { min-height: 60px; }
}
@media (min-width: 901px) {
  #v-calendar .sm-cal-day[data-heat="1"] { background: var(--heat-1); }
  #v-calendar .sm-cal-day[data-heat="2"] { background: var(--heat-2); }
  #v-calendar .sm-cal-day[data-heat="3"] { background: linear-gradient(140deg, var(--brand-400), var(--brand-600)); color: var(--on-brand); }
}

/* ================= HP: kalender & beranda lebih rapi ================= */
.g-short { display: none; }
@media (max-width: 900px) {
  /* beranda */
  #v-dashboard .guard { padding: 12px 14px; border-radius: 18px; }
  #v-dashboard .guard .g-long, #v-dashboard .guard .dim { display: none; }
  #v-dashboard .guard .g-short { display: block; font-size: 13px; color: var(--ink-muted); }
  #v-dashboard .guard b { font-size: 13px; }
  #v-dashboard .safe { border-radius: 24px; background: linear-gradient(140deg, var(--brand-400) 0%, var(--brand-500) 55%, var(--brand-700) 140%); border: 0; padding: 18px 20px; }
  #v-dashboard .safe .sm-stat-value { font-size: 34px; }
  #v-dashboard .acc-pill { border-radius: 18px; }
  #v-dashboard .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #v-dashboard .stats > .sm-card { padding: 14px; border-radius: 20px; min-width: 0; }
  #v-dashboard .stats .sm-stat-value { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #v-dashboard .stats .sm-stat-icon { width: 30px; height: 30px; }
  #v-dashboard .stats .sm-stat-sub, #v-dashboard .stats .sm-stat-delta { font-size: 11px; }
  #v-dashboard .sm-card { border-radius: 20px; }
  /* kalender */
  body[data-view="calendar"] .topbar .monthnav { display: none; }
  #v-calendar .sm-cal { border-radius: 24px; padding: 16px 12px; }
  #v-calendar .sm-cal-head .btn { border-radius: 999px; border: 1px solid var(--border); }
  #v-calendar .sm-cal-total { font-size: 11px; }
  #v-calendar .sm-cal-grid { gap: 5px; }
  #v-calendar .sm-cal-day { aspect-ratio: 1 / 1.15; min-height: 0; border-radius: 12px; padding: 6px 2px 5px; background: var(--surface-sunken); box-shadow: none; }
  #v-calendar .sm-cal-day[data-out="true"] { background: transparent; }
  #v-calendar .sm-cal-day[data-future="true"] { background: transparent; box-shadow: none; color: var(--ink-subtle); }
  #v-calendar .sm-cal-day[data-heat="1"] { background: var(--heat-1); }
  #v-calendar .sm-cal-day[data-heat="2"] { background: var(--heat-2); }
  #v-calendar .sm-cal-day[data-heat="3"] { background: linear-gradient(140deg, var(--brand-400), var(--brand-600)); color: var(--on-brand); }
  #v-calendar .sm-cal-n { font-size: 13px; }
  #v-calendar .sm-cal-amt { font: 600 9.5px/12px var(--font-sans); letter-spacing: -.01em; }
  #v-calendar .sm-cal-day[data-today="true"] { box-shadow: inset 0 0 0 2px var(--brand-500); }
  #v-calendar .sm-cal-day[aria-pressed="true"] { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
  .cal-side-detail { max-height: 440px; overflow: auto; border-radius: 24px; }
  .cs-row b { font-size: 16px; }
}

/* ================= Total saldo + Pemasukan vs pengeluaran ================= */
.money-row { display: grid; gap: 12px; margin-top: 12px; }
.money-row > #accBox { min-width: 0; }
.acc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 18px; }
.tb-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tb-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.tb-sub { font-size: 12px; color: var(--ink-muted); }
.tb-act { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 14px; }
.tb-act .btn { border-radius: 999px; height: 44px; justify-content: center; font-weight: 600; }
.tb-main { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tb-main:hover { opacity: .92; }
.acc-card .acc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.tb-wl { font-size: 13px; font-weight: 600; }
.tb-wl span { color: var(--ink-muted); font-weight: 400; }
.io-card { border-radius: 24px; }
.io-lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.io-lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.io-lg i.in { background: repeating-linear-gradient(45deg, var(--brand-500) 0 3px, #F2D58A 3px 5px); }
.io-lg i.out { background: var(--ink); }
.io-chart .io-in { fill: url(#ioH); }
.io-chart .io-out { fill: var(--ink); }
.io-chart .io-g:hover rect.io-in, .io-chart .io-g:focus rect.io-in { filter: brightness(.95); }
.io-chart .io-g:focus { outline: none; }
@media (min-width: 901px) {
  #v-dashboard .money-row { order: 5; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; margin: 0; align-items: stretch; }
  #v-dashboard .money-row #accBox { order: 0; }
  #v-dashboard .money-row .acc-card { height: 100%; box-sizing: border-box; padding: 22px; }
  .tb-val { font-size: 34px; }
}
@container main (max-width: 1050px) {
  #v-dashboard .money-row { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 901px) { #v-dashboard .money-row > #accBox { grid-column: auto; order: 0; } }
.acc-card .acc-xfer { display: none; }

/* Pemilih akun berlogo */
.acc-sel { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; height: auto; min-height: 48px; padding: 6px 12px; }
.acc-sel .as-chev { margin-left: auto; color: var(--ink-muted); display: grid; }
.acc-sel .as-chev svg { width: 16px; height: 16px; }
.as-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.as-t b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-t small { font-size: 11px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.acc-pop { z-index: 80; max-height: 320px; overflow: auto; }
.acc-pop > button { gap: 10px; padding: 8px 10px; }
.acc-pop > button[aria-selected="true"] { background: var(--surface-tint); }
.acc-pop .as-ok { margin-left: auto; color: var(--accent-text); display: grid; }

/* kartu usulan Snap AI */
.ag-card{gap:12px}
.ag-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.ag-title{font-weight:600;font-size:15px}
.ag-rows{display:grid;border:1px solid var(--border);border-radius:var(--radius-md,10px);overflow:hidden}
.ag-row{display:flex;align-items:center;gap:10px;padding:10px 12px}
.ag-row+.ag-row{border-top:1px solid var(--border)}
.ag-main{flex:1;min-width:0}
.ag-desc{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ag-amt{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0;text-align:right}
.ag-diff{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;margin:0;padding:10px 12px;border-top:1px solid var(--border);font-size:13px}
.ag-diff dt{color:var(--ink-muted)}.ag-diff dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
.ag-total{display:flex;justify-content:space-between;padding:10px 12px;border-top:1px solid var(--border);background:var(--surface-sunken);font-weight:600;font-variant-numeric:tabular-nums}
.ag-card[data-state=cancelled] .ag-rows,.ag-card[data-state=undone] .ag-rows,.ag-card[data-state=replaced] .ag-rows{opacity:.55}
.ag-card[data-state=cancelled] .ag-amt,.ag-card[data-state=undone] .ag-amt,.ag-card[data-state=replaced] .ag-amt{text-decoration:line-through}

/* kolom chat multi-baris: Enter kirim, Shift+Enter baris baru, tinggi ikut isi sampai 6 baris */
#deskQ,#panelQ{resize:none;max-height:132px;overflow-y:auto;font-family:var(--font-sans);display:block}
.desk-composer,.sm-composer-field{align-items:flex-end}
.desk-composer .sm-round,.sm-composer-field .sm-round{flex-shrink:0}
.sm-composer-field textarea{flex:1;min-width:0;border:0;outline:0;background:transparent;font:400 14px/20px var(--font-sans);color:var(--ink);padding:10px 0}
/* Nominal tidak boleh terpotong: di layar sempit nama dan keterangan yang mengalah. Placeholder kolom chat satu baris
   (textarea membungkus teks placeholder dan baris keduanya terpotong setengah); begitu diketik, membungkus lagi. */
@media (max-width:520px){.ag-row{gap:8px;padding:10px}.ag-row .sm-tile{display:none}}
#deskQ:placeholder-shown,#panelQ:placeholder-shown{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
