  :root{
    --bg:#F1F4F9;
    --card:#FFFFFF;
    --ink:#0F172A;
    --ink-soft:#64748B;
    --line:#E2E8F0;
    --credit:#16A34A;
    --debit:#DC2626;
    --gold:#F59E0B;
    --link:#2563EB;
    --goal:#9333EA;
    --binder:#1B2A4D;
    --binder-light:#27406B;
    --shadow:0 1px 3px rgba(15,23,42,.06), 0 16px 36px rgba(15,23,42,.12);
    --shadow-sm:0 1px 2px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.08);
    --shadow-glass:0 1px 2px rgba(15,23,42,.06), 0 24px 48px rgba(15,23,42,.14);
    --shadow-fab:0 8px 20px rgba(15,23,42,.32);
    --shadow-nav:0 -4px 20px rgba(15,23,42,.06);
  }
  *{box-sizing:border-box; -webkit-tap-highlight-color:transparent; tap-highlight-color:transparent; letter-spacing:normal; word-spacing:normal; text-justify:none; text-align-last:auto;}
  html,body{margin:0;padding:0;height:100%; overflow-x:hidden; -webkit-text-size-adjust:100%; text-size-adjust:100%; touch-action:pan-x pan-y;}
  button, a, .node, [onclick]{ touch-action:manipulation; }
  body{
    font-family:'Inter',system-ui,sans-serif;
    color:var(--ink);
    background:var(--bg);
    display:flex;
    min-height:100vh;
    -webkit-font-smoothing:antialiased;
  }
  button{font-family:inherit; cursor:pointer;}
  input,select{font-family:inherit;}
  *:focus-visible{ outline:2px solid var(--gold); outline-offset:1px; }
  svg{display:block;}
  .mono-num{ font-family:'Inter',sans-serif; font-variant-numeric:tabular-nums; font-feature-settings:"tnum"; letter-spacing:.2px; }
  .masked-amount{ letter-spacing:4px; opacity:.82; }

  .card{ background:var(--card); border-radius:22px; box-shadow:var(--shadow); padding:22px; border:1px solid rgba(15,23,42,.04); }
  .card-glass{
    background: rgba(255,255,255,.52);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid rgba(255,255,255,.65);
    box-shadow: var(--shadow-glass);
  }
  .grid-2x2, .card-header-row, .balance-card, .ring-card{ position:relative; z-index:1; }
  .card-label{ font-size:12px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.5px; }
  .card-header-row{ display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; gap:10px; flex-wrap:wrap; }
  .link-btn{ background:none; border:none; color:var(--link); font-size:12.5px; font-weight:700; padding:0; }
  .empty-note{ color:var(--ink-soft); font-size:13px; }

  .btn-pill{ display:inline-flex; align-items:center; gap:7px; padding:11px 18px; border-radius:999px; font-weight:600; font-size:13.5px; border:none; transition:transform .12s, box-shadow .12s, filter .12s; box-shadow:var(--shadow-sm); }
  .btn-pill:hover{ transform:translateY(-1px); filter:brightness(1.04); }
  .btn-pill:active{ transform:translateY(0) scale(.97); }
  .btn-black{ background:var(--binder); color:#FFFFFF; }
  .btn-outline{ background:#fff; color:var(--ink); border:1.5px solid var(--line); box-shadow:none; }
  .btn-outline:hover{ background:var(--bg); }
  .btn-danger{ background:var(--debit); color:#fff; }
  .icon-btn-sm{ background:var(--bg); border:none; border-radius:8px; color:var(--ink-soft); padding:6px; display:flex; align-items:center; transition:background .12s, color .12s; }
  .icon-btn-sm:hover{ background:var(--line); color:var(--ink); }

  .spine{ width:232px; background:rgba(255,255,255,.78); backdrop-filter:blur(18px) saturate(160%); -webkit-backdrop-filter:blur(18px) saturate(160%); border-right:1px solid var(--line); display:flex; flex-direction:column; padding:22px 14px; flex-shrink:0; }
  .brand-row{ display:flex; align-items:center; gap:10px; padding:6px 8px 26px; }
  .brand-mark{ width:38px; height:38px; border-radius:50%; background:#fff; display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow:var(--shadow-sm); overflow:hidden; padding:3px; }
  .brand-mark img{ width:100%; height:100%; object-fit:contain; }
  .brand-name{ font-weight:800; font-size:17px; letter-spacing:-.2px; }
  .brand-sub{ font-size:10.5px; color:var(--ink-soft); margin-top:2px; }
  .spine .tab-btn{ display:flex; align-items:center; gap:11px; padding:11px 14px; border-radius:13px; color:var(--ink-soft); font-weight:600; font-size:14px; margin-bottom:3px; background:none; border:none; text-align:left; width:100%; transition:background .12s, color .12s; }
  .spine .tab-btn:hover{ background:var(--bg); color:var(--ink); }
  .spine .tab-btn.active{ background:var(--binder); color:#FFFFFF; box-shadow:var(--shadow-sm); }
  .spine .tab-label{ flex:1; }

  .bottom-nav{ display:none; position:fixed; bottom:0; left:0; right:0; background:rgba(255,255,255,.72); backdrop-filter:blur(20px) saturate(180%); -webkit-backdrop-filter:blur(20px) saturate(180%); border-top:1px solid rgba(15,23,42,.08); justify-content:space-around; align-items:center; padding:8px 6px calc(6px + env(safe-area-inset-bottom)); z-index:50; box-shadow:var(--shadow-nav); }
  .bottom-nav .tab-btn{ background:none; border:none; display:flex; flex-direction:column; align-items:center; gap:3px; color:var(--ink-soft); font-size:10.5px; font-weight:600; padding:4px 6px; flex:1; }
  .bottom-nav .tab-btn.active{ color:var(--binder); }
  .bottom-nav .tab-btn.fab{ background:var(--binder); color:#FFFFFF; width:54px; height:54px; border-radius:50%; margin-top:-30px; justify-content:center; box-shadow:var(--shadow-fab); flex:0 0 auto; border:4px solid var(--bg); }
  .bottom-nav .tab-btn.fab .tab-label{ display:none; }

  main{ flex:1; display:flex; flex-direction:column; overflow:hidden; }
  .topbar{ position:sticky; top:0; z-index:30; margin:0 -30px; padding:18px 30px; display:flex; justify-content:space-between; align-items:center; background:rgba(241,244,249,.7); backdrop-filter:blur(18px) saturate(160%); -webkit-backdrop-filter:blur(18px) saturate(160%); border-bottom:1px solid rgba(15,23,42,.06); }
  .topbar-left{ display:flex; align-items:center; gap:10px; }
  .topbar h1{ font-size:19px; margin:0; font-weight:800; letter-spacing:-.2px; }
  .topbar-right{ display:flex; align-items:center; gap:10px; }
  .icon-circle{ width:38px; height:38px; border-radius:50%; background:rgba(255,255,255,.75); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); box-shadow:var(--shadow-sm); display:flex; align-items:center; justify-content:center; color:var(--ink); position:relative; border:1px solid rgba(255,255,255,.6); transition:transform .12s, box-shadow .12s; }
  .icon-circle:hover{ transform:translateY(-1px); box-shadow:var(--shadow); }
  .badge-dot{ position:absolute; top:-3px; right:-3px; min-width:16px; height:16px; padding:0 3px; border-radius:999px; background:var(--debit); color:#fff; font-size:9.5px; font-weight:800; display:none; align-items:center; justify-content:center; box-shadow:0 0 0 2px #fff; }

  .views{ flex:1; overflow-y:auto; overflow-x:hidden; padding:0 30px 50px; position:relative; }
  .view{ display:none; max-width:1100px; position:relative; padding-top:18px; }
  .view.active{ display:block; animation: viewFadeIn .28s ease; }
  @keyframes viewFadeIn{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:translateY(0); } }
  @media (prefers-reduced-motion: reduce){ .view.active{ animation:none; } }

  .grid-2x2{ display:flex; flex-direction:column; gap:16px; margin-bottom:16px; }
  .balance-amount{ font-size:30px; font-weight:700; margin:6px 0 18px; }
  .balance-amount.negative{ color:var(--debit); }
  .mono-num.negative{ color:var(--debit); }
  .progress-block{ margin-bottom:18px; }
  .progress-row{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--ink-soft); font-weight:600; margin-bottom:8px; text-align:left; }
  .progress-row span{ white-space:nowrap; }
  .progress-track{ height:8px; border-radius:999px; background:var(--bg); overflow:hidden; box-shadow:inset 0 1px 2px rgba(15,23,42,.08); }
  .progress-fill{ height:100%; border-radius:999px; background:var(--binder); transition:width .3s ease; width:0%; }
  .progress-spent{ font-size:12px; color:var(--ink-soft); margin-top:8px; font-weight:600; }
  .quick-actions{ display:flex; gap:10px; }
  .quick-actions .btn-pill{ flex:1; justify-content:center; }

  .ring-period-toggle{ display:inline-flex; background:var(--bg); border-radius:999px; padding:3px; gap:2px; }
  .ring-period-btn{ background:none; border:none; padding:6px 13px; border-radius:999px; font-size:11.5px; font-weight:700; color:var(--ink-soft); }
  .ring-period-btn.active{ background:#fff; color:var(--ink); box-shadow:var(--shadow-sm); }
  .ring-card{ display:flex; flex-direction:column; align-items:center; }
  .ring-card .ring-period-toggle{ margin-top:14px; }
  .ring-wrap{ position:relative; width:fit-content; margin:6px auto; }
  .ring-center{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; pointer-events:none; }
  .ring-center-label{ font-size:11px; color:var(--ink-soft); font-weight:600; margin-bottom:4px; }
  .ring-center-amount{ font-size:19px; font-weight:700; color:var(--ink); }
  .ring-tap-hint{ text-align:center; font-size:11px; color:var(--ink-soft); margin-top:8px; }

  .activity-group-label{ font-size:11.5px; font-weight:700; color:var(--ink-soft); margin:14px 0 8px; text-transform:uppercase; letter-spacing:.4px; }
  .activity-group-label:first-child{ margin-top:0; }
  .activity-row{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--bg); }
  .activity-row.clickable-row{ cursor:pointer; border-radius:10px; transition:background .12s; margin:0 -6px; padding:9px 6px; }
  .activity-row.clickable-row:active{ background:var(--bg); }
  .activity-row:last-child{ border-bottom:none; }
  .activity-left{ display:flex; align-items:center; gap:11px; min-width:0; flex:1 1 auto; overflow:hidden; }
  .activity-left > div{ min-width:0; flex:1 1 auto; overflow:hidden; }
  .cat-badge{ width:36px; height:36px; border-radius:50%; color:#fff; font-weight:700; font-size:14px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .activity-name{ font-size:13.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .activity-sub{ font-size:11.5px; color:var(--ink-soft); margin-top:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
  .activity-right{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
  .activity-amt{ font-weight:700; font-size:13.5px; }
  .activity-amt.income{ color:var(--credit); }
  .activity-amt.expense{ color:var(--debit); }
  .activity-actions{ display:flex; gap:4px; }

  .cat-grid-2x2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  .cat-grid-cell{ background:var(--bg); border-radius:16px; padding:14px; position:relative; }
  .cat-grid-cell.clickable-row{ cursor:pointer; transition:transform .1s; }
  .cat-grid-cell.clickable-row:active{ transform:scale(.97); }
  .cat-grid-top{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px; }
  .cat-amt{ font-size:15px; font-weight:700; }
  .cat-pct{ font-size:11.5px; font-weight:700; color:var(--ink-soft); }
  .cat-grid-name{ font-size:12px; color:var(--ink-soft); font-weight:600; margin-bottom:10px; }
  .cat-badge.sm{ width:26px; height:26px; font-size:11px; }

  .insight-note{ background:#fff; border-radius:16px; padding:14px 18px; font-size:13.5px; margin:0 0 16px; box-shadow:var(--shadow-sm); display:none; border-left:4px solid var(--gold); }

  .breakdown-row{ display:flex; align-items:center; gap:10px; margin-bottom:11px; font-size:13px; }
  .breakdown-row .dot{ width:9px; height:9px; border-radius:50%; flex-shrink:0; }
  .breakdown-name{ width:130px; flex-shrink:0; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .breakdown-track{ flex:1; height:7px; background:var(--bg); border-radius:999px; overflow:hidden; box-shadow:inset 0 1px 2px rgba(15,23,42,.06); }
  .breakdown-fill{ height:100%; border-radius:999px; }
  .breakdown-amt{ width:95px; text-align:right; font-weight:700; flex-shrink:0; }

  .budget-grid{ display:flex; flex-direction:column; gap:12px; }
  .budget-row{ background:var(--bg); border-radius:16px; padding:14px 16px; margin-bottom:12px; }
  .budget-row:last-child{ margin-bottom:0; }
  .budget-row.clickable-row{ cursor:pointer; transition:background .12s; }
  .budget-row.clickable-row:active{ background:var(--line); }
  .budget-row-top{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:9px; }
  .budget-cat-left{ display:flex; align-items:center; gap:10px; }
  .budget-cat-name{ font-weight:700; font-size:13.5px; }
  .budget-limit-input{ display:flex; align-items:center; gap:6px; }
  .budget-limit-input input{ width:90px; padding:6px 9px; border:1.5px solid var(--line); border-radius:8px; background:#fff; font-size:16px; }
  .budget-bar-track{ height:8px; background:#fff; border-radius:999px; overflow:hidden; margin-bottom:7px; box-shadow:inset 0 1px 2px rgba(15,23,42,.06); }
  .budget-bar-fill{ height:100%; border-radius:999px; transition:width .3s ease; }
  .budget-row-meta{ font-size:11.5px; color:var(--ink-soft); font-weight:600; }
  .budget-row-meta.over{ color:var(--debit); }

  .debt-card{ background:var(--bg); border-radius:16px; padding:14px 16px; margin-bottom:12px; border-left:4px solid transparent; }
  .debt-card.clickable-row{ cursor:pointer; transition:background .12s; }
  .debt-card.clickable-row:active{ background:var(--line); }
  .debt-card.type-emi{ border-left-color:var(--link); }
  .debt-card.type-lump{ border-left-color:var(--gold); }
  .debt-card.paid-off{ opacity:.65; border-left-color:var(--credit); }
  .debt-card-top{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px; gap:8px; }
  .debt-name{ font-weight:700; font-size:14px; }
  .debt-type-badge{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:2px; }
  .debt-bar-track{ height:8px; background:#fff; border-radius:999px; overflow:hidden; margin-bottom:8px; box-shadow:inset 0 1px 2px rgba(15,23,42,.06); }
  .debt-bar-fill{ height:100%; border-radius:999px; transition:width .3s ease; }
  .debt-row-meta{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-bottom:4px; }
  .overdue-tag{ color:var(--debit); font-weight:700; }
  .paidoff-tag{ color:var(--credit); font-weight:700; }
  .log-payment-form{ margin-top:10px; background:#fff; border-radius:12px; padding:12px; }
  .log-payment-form label{ display:block; font-size:11.5px; color:var(--ink-soft); font-weight:700; margin-bottom:8px; }
  .log-payment-form input, .log-payment-form select{ width:100%; max-width:100%; min-width:0; margin-top:5px; padding:9px 10px; border:1.5px solid var(--line); border-radius:9px; font-size:16px; background:var(--bg); }

  .debt-overview-grid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; margin-bottom:14px; }
  .debt-overview-stat{ background:var(--bg); border-radius:14px; padding:12px 8px; text-align:center; }
  .debt-overview-label{ display:block; font-size:10px; color:var(--ink-soft); font-weight:700; text-transform:uppercase; letter-spacing:.3px; margin-bottom:6px; }
  .debt-overview-amt{ font-size:14.5px; font-weight:800; }
  .debt-overview-track{ height:8px; background:var(--bg); border-radius:999px; overflow:hidden; margin-bottom:14px; box-shadow:inset 0 1px 2px rgba(15,23,42,.06); }
  .debt-overview-fill{ height:100%; background:var(--credit); border-radius:999px; transition:width .3s ease; }
  .debt-overview-subsection{ margin-bottom:10px; border-left:3px solid transparent; padding-left:10px; }
  .debt-overview-subsection[id$="-emi-section"]{ border-left-color:var(--link); }
  .debt-overview-subsection[id$="-lump-section"]{ border-left-color:var(--gold); }
  .debt-overview-subsection[id$="-emi-section"] .debt-overview-subtitle{ color:var(--link); }
  .debt-overview-subsection[id$="-lump-section"] .debt-overview-subtitle{ color:var(--gold); }
  .debt-overview-subtitle{ font-size:12px; font-weight:700; color:var(--ink-soft); margin-bottom:6px; }
  .debt-overview-row{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px 14px; font-size:12.5px; font-weight:600; background:var(--bg); border-radius:10px; padding:9px 12px; }

  .goal-card{ background:var(--bg); border-radius:16px; padding:14px 16px; margin-bottom:12px; border-left:4px solid var(--goal); }
  .goal-card.complete{ opacity:.65; border-left-color:var(--credit); }
  .goal-card.clickable-row{ cursor:pointer; transition:background .12s; }
  .goal-card.clickable-row:active{ background:var(--line); }
  .goal-card-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
  .goal-name{ font-weight:700; font-size:14px; }
  .goal-meta{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:2px; }
  .goal-bar-track{ height:8px; background:#fff; border-radius:999px; overflow:hidden; margin:10px 0 8px; box-shadow:inset 0 1px 2px rgba(15,23,42,.06); }
  .goal-bar-fill{ height:100%; border-radius:999px; background:var(--goal); transition:width .3s ease; }
  .goal-row-meta{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-bottom:4px; }
  .goal-reached-tag{ color:var(--credit); font-weight:700; }
  .contribution-form{ margin-top:10px; background:#fff; border-radius:12px; padding:12px; }
  .contribution-form label{ display:block; font-size:11.5px; color:var(--ink-soft); font-weight:700; margin-bottom:8px; }
  .contribution-form input{ width:100%; max-width:100%; min-width:0; margin-top:5px; padding:9px 10px; border:1.5px solid var(--line); border-radius:9px; font-size:16px; background:var(--bg); }

  .ledger-form{ max-width:440px; }
  .type-toggle{ display:flex; gap:10px; margin-bottom:20px; background:var(--bg); border-radius:14px; padding:5px; }
  .type-btn{ flex:1; padding:11px 8px; border:none; border-radius:10px; background:none; font-size:13.5px; font-weight:700; color:var(--ink-soft); display:flex; align-items:center; justify-content:center; gap:6px; transition:background .12s, color .12s, box-shadow .12s; }
  .type-btn.active{ background:#fff; color:var(--ink); box-shadow:var(--shadow-sm); }
  .type-btn.credit.active{ color:var(--credit); }
  .type-btn.debit.active{ color:var(--debit); }
  .ledger-form label{ display:block; font-size:12.5px; color:var(--ink-soft); margin-bottom:16px; font-weight:700; }
  .ledger-form input, .ledger-form select{ display:block; width:100%; max-width:100%; min-width:0; margin-top:7px; padding:11px 12px; border:1.5px solid var(--line); border-radius:12px; font-size:16px; background:#fff; color:var(--ink); }
  .stamp-btn{ width:100%; padding:13px; justify-content:center; font-size:14.5px; }
  #cancel-edit-link{ display:none; margin-top:12px; background:none; border:none; color:var(--ink-soft); font-size:13px; font-weight:600; width:100%; text-align:center; align-items:center; justify-content:center; gap:5px; }
  .today-entries{ margin-top:30px; max-width:440px; }
  .today-entries h3{ font-size:15px; font-weight:800; margin-bottom:6px; }

  .stamp-overlay{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:none; opacity:0; transition:opacity .15s; z-index:999; }
  .stamp-overlay.show{ opacity:1; }
  .stamp-overlay .stamp{ font-weight:800; font-size:32px; border:5px solid var(--credit); letter-spacing:.5px; color:var(--credit); padding:16px 32px; border-radius:14px; background:rgba(255,255,255,.72); backdrop-filter:blur(14px) saturate(160%); -webkit-backdrop-filter:blur(14px) saturate(160%); transform:scale(2) rotate(-10deg); opacity:0; transition:transform .35s cubic-bezier(.2,1.6,.4,1), opacity .25s; box-shadow:var(--shadow); }
  .stamp-overlay.show .stamp{ transform:scale(1) rotate(-6deg); opacity:1; }
  @media (prefers-reduced-motion: reduce){ .stamp-overlay, .stamp-overlay .stamp{ transition:none !important; } }

  .report-controls{ margin-bottom:16px; }
  .segmented{ display:grid; grid-template-columns:1fr 1fr; gap:8px; background:var(--bg); border-radius:16px; padding:6px; margin-bottom:16px; }
  .segmented button{ padding:11px 12px; background:none; border:none; border-radius:11px; font-size:13px; color:var(--ink-soft); font-weight:700; transition:background .12s, color .12s; }
  .segmented button.active{ background:#fff; color:var(--ink); box-shadow:var(--shadow-sm); }
  .period-inputs{ margin-bottom:16px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .period-inputs input{ padding:9px 12px; border:1.5px solid var(--line); border-radius:10px; background:#fff; font-family:'Roboto Mono',monospace; }
  .period-hint{ font-size:12px; color:var(--ink-soft); font-weight:500; }
  .filter-row{ display:flex; gap:10px; flex-wrap:wrap; }
  .filter-row select{ padding:9px 12px; border:1.5px solid var(--line); border-radius:10px; min-width:160px; background:#fff; }
  .search-input{ flex:2; min-width:200px; padding:9px 12px; border:1.5px solid var(--line); border-radius:10px; background:#fff; }
  .search-input-wrap{ position:relative; flex:2; min-width:200px; }
  .search-input-wrap .search-input{ width:100%; padding-left:36px; }
  .search-input-wrap .search-icon{ position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--ink-soft); }

  .report-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; flex-wrap:wrap; gap:10px; }
  .report-header h2{ font-size:16.5px; margin:0; font-weight:800; letter-spacing:-.2px; }
  .report-header .btn-group{ display:flex; gap:8px; flex-wrap:wrap; }
  .report-summary{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin-bottom:22px; }
  .summary-box{ background:var(--bg); border-radius:16px; padding:14px 16px; font-size:11.5px; color:var(--ink-soft); font-weight:700; text-align:center; }
  .summary-box .mono-num{ display:block; font-size:18px; color:var(--ink); margin-top:6px; font-weight:700; }
  .summary-box.credit .mono-num{ color:var(--credit); }
  .summary-box.debit .mono-num{ color:var(--debit); }
  .summary-box .mono-num.negative{ color:var(--debit); }

  .table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .data-table{ width:100%; min-width:560px; border-collapse:collapse; font-size:13.5px; }
  .data-table th{ text-align:left; padding:9px 8px; color:var(--ink-soft); font-size:10.5px; text-transform:uppercase; letter-spacing:.5px; font-weight:700; border-bottom:1.5px solid var(--line); }
  .data-table td{ padding:11px 8px; border-bottom:1px solid var(--bg); }
  .data-table td.num{ font-family:'Roboto Mono',monospace; font-variant-numeric:tabular-nums; font-weight:700; text-align:right; }
  .data-table tr:hover{ background:var(--bg); }

  .more-row{ display:flex; justify-content:space-between; align-items:center; width:100%; background:#fff; border:none; border-radius:18px; padding:16px 18px; margin-bottom:10px; box-shadow:var(--shadow-sm); color:var(--ink); font-size:14.5px; font-weight:700; transition:transform .12s, box-shadow .12s; }
  .more-row:hover{ transform:translateY(-1px); box-shadow:var(--shadow); }
  .more-row-left{ display:flex; align-items:center; gap:13px; }
  .more-icon-badge{ width:36px; height:36px; border-radius:11px; background:var(--bg); color:var(--ink); display:flex; align-items:center; justify-content:center; }
  .back-btn{ display:flex; align-items:center; gap:6px; background:none; border:none; color:var(--ink-soft); font-weight:700; font-size:13.5px; margin-bottom:16px; padding:0; }
  .back-btn:hover{ color:var(--ink); }
  .more-sub{ display:none; }
  .more-sub.active{ display:block; animation: viewFadeIn .24s ease; }
  #more-menu{ display:none; }
  #more-menu.active{ display:block; animation: viewFadeIn .24s ease; }
  @media (prefers-reduced-motion: reduce){ .more-sub.active, #more-menu.active{ animation:none; } }
  .more-sub h2{ font-size:18px; margin:0 0 16px; font-weight:800; letter-spacing:-.2px; }

  .cat-columns{ display:flex; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
  .cat-col{ flex:1; min-width:260px; }
  .cat-col h3{ font-size:14.5px; margin-top:0; margin-bottom:14px; font-weight:800; }
  .cat-row{ display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid var(--bg); font-size:13.5px; }
  .cat-row-left{ display:flex; align-items:center; gap:10px; }
  .cat-col form{ display:flex; gap:8px; margin-top:14px; }
  .cat-col form input{ flex:1; padding:9px 12px; border:1.5px solid var(--line); border-radius:10px; background:var(--bg); }
  .cat-col form button{ background:var(--binder); color:#FFFFFF; border:none; padding:9px 16px; border-radius:10px; font-weight:700; font-size:13px; }

  .settings-row{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; }
  .settings-row label{ font-size:13px; color:var(--ink-soft); font-weight:700; }
  .settings-row input{ margin-left:8px; padding:7px 9px; border:1.5px solid var(--line); border-radius:8px; width:3.5em; background:var(--bg); }
  .settings-actions{ display:flex; gap:10px; flex-wrap:wrap; }

  #loading-overlay{ position:fixed; inset:0; background:var(--bg); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; z-index:2000; }
  #loading-overlay img{ width:64px; height:64px; animation: loadPulse 1.4s ease-in-out infinite; }
  #loading-overlay .loading-text{ font-size:13.5px; font-weight:700; color:var(--ink-soft); letter-spacing:.3px; }
  @keyframes loadPulse{ 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(1.08); opacity:.7; } }

  /* ---------- Dark mode ---------- */
  body[data-theme="dark"]{
    --bg:#0B1220;
    --card:#141B2D;
    --ink:#E8ECF6;
    --ink-soft:#8B95AC;
    --line:#232C42;
    --credit:#22C55E;
    --debit:#F87171;
    --gold:#FBBF24;
    --link:#60A5FA;
    --goal:#C084FC;
    --binder:#2563EB;
    --binder-light:#3B82F6;
    --shadow:0 1px 3px rgba(0,0,0,.45), 0 16px 36px rgba(0,0,0,.55);
    --shadow-sm:0 1px 2px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.45);
    --shadow-glass:0 1px 2px rgba(0,0,0,.35), 0 24px 48px rgba(0,0,0,.55);
    --shadow-fab:0 8px 22px rgba(0,0,0,.55);
    --shadow-nav:0 -4px 20px rgba(0,0,0,.35);
  }
  body[data-theme="dark"] .spine{ background:rgba(20,27,45,.82); border-right-color:var(--line); }
  body[data-theme="dark"] .bottom-nav{ background:rgba(20,27,45,.82); border-top-color:var(--line); }
  body[data-theme="dark"] .topbar{ background:rgba(11,18,32,.74); border-bottom-color:var(--line); }
  body[data-theme="dark"] .icon-circle{ background:rgba(32,41,64,.78); border-color:rgba(255,255,255,.07); }
  body[data-theme="dark"] .card-glass{ background:rgba(32,41,64,.55); border-color:rgba(255,255,255,.07); }
  body[data-theme="dark"] .stamp-overlay .stamp{ background:rgba(20,27,45,.8); }
  body[data-theme="dark"] .data-table tr:hover{ background:rgba(255,255,255,.04); }
  body[data-theme="dark"] .ledger-form input, body[data-theme="dark"] .ledger-form select,
  body[data-theme="dark"] .filter-row select, body[data-theme="dark"] .search-input,
  body[data-theme="dark"] .period-inputs input, body[data-theme="dark"] .budget-limit-input input,
  body[data-theme="dark"] .log-payment-form input, body[data-theme="dark"] .log-payment-form select, body[data-theme="dark"] .cat-col form input,
  body[data-theme="dark"] .settings-row input, body[data-theme="dark"] .btn-outline,
  body[data-theme="dark"] .contribution-form input{
    background:#1A2336; border-color:var(--line); color:var(--ink);
  }
  body[data-theme="dark"] .more-row, body[data-theme="dark"] .summary-box, body[data-theme="dark"] .insight-note,
  body[data-theme="dark"] .log-payment-form, body[data-theme="dark"] .contribution-form{
    background:var(--card);
  }
  body[data-theme="dark"] .progress-track, body[data-theme="dark"] .breakdown-track,
  body[data-theme="dark"] .budget-bar-track, body[data-theme="dark"] .debt-bar-track,
  body[data-theme="dark"] .goal-bar-track{ background:#0E1626; }
  body[data-theme="dark"] .ring-period-btn.active,
  body[data-theme="dark"] .type-btn.active,
  body[data-theme="dark"] .segmented button.active{
    background:#28344E; color:#FFFFFF; box-shadow:var(--shadow-sm);
  }
  body[data-theme="dark"] .type-btn.credit.active{ color:#4ADE80; }
  body[data-theme="dark"] .type-btn.debit.active{ color:#F87171; }

  /* ---------- Mounty theme ---------- */
  body[data-theme="mounty"]{
    --bg:#0B2B26;
    --card:#1B4038;
    --ink:#EAF6EC;
    --ink-soft:#8EB69B;
    --line:#2C6354;
    --credit:#5FD98C;
    --debit:#E2795C;
    --gold:#D9A441;
    --link:#6FA8C4;
    --goal:#C98BD1;
    --binder:#2F6B52;
    --binder-light:#3D8567;
    --shadow:0 1px 3px rgba(0,0,0,.45), 0 16px 36px rgba(0,0,0,.55);
    --shadow-sm:0 1px 2px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.45);
    --shadow-glass:0 1px 2px rgba(0,0,0,.35), 0 24px 48px rgba(0,0,0,.55);
    --shadow-fab:0 8px 22px rgba(0,0,0,.55);
    --shadow-nav:0 -4px 20px rgba(0,0,0,.35);
    --mounty-photo: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5MDAgNDAwIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1heCBzbGljZSI+CiAgPGRlZnM+CiAgICA8cmFkaWFsR3JhZGllbnQgaWQ9Im1vb25HbG93IiBjeD0iNTAlIiBjeT0iNTAlIiByPSI1MCUiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjREFGMURFIiBzdG9wLW9wYWNpdHk9IjAuNTUiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSI0MCUiIHN0b3AtY29sb3I9IiM4RUI2OUIiIHN0b3Atb3BhY2l0eT0iMC4yMiIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM4RUI2OUIiIHN0b3Atb3BhY2l0eT0iMCIvPgogICAgPC9yYWRpYWxHcmFkaWVudD4KICAgIDxyYWRpYWxHcmFkaWVudCBpZD0ibW9vbkNvcmUiIGN4PSI1MCUiIGN5PSI1MCUiIHI9IjUwJSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNGM0ZC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zY5LDI2NCBaIi8+CiAgPC9nPgo8L3N2Zz4K");
    background-image: var(--mounty-photo), linear-gradient(180deg, #1B4038 0%, #0B2B26 40%, #071714 75%, #051009 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: bottom center, top center;
    background-size: cover, 100% 100%;
    background-attachment: fixed, fixed;
  }
  body[data-theme="mounty"] .spine{ background:rgba(27,64,56,.82); border-right-color:var(--line); }
  body[data-theme="mounty"] .bottom-nav{ background:rgba(27,64,56,.82); border-top-color:var(--line); }
  body[data-theme="mounty"] .topbar{ background:rgba(18,52,45,.74); border-bottom-color:var(--line); }
  body[data-theme="mounty"] .icon-circle{ background:rgba(44,99,84,.68); border-color:rgba(255,255,255,.08); }
  body[data-theme="mounty"] .card-glass{ background:rgba(27,64,56,.62); border-color:rgba(255,255,255,.09); }
  body[data-theme="mounty"] .stamp-overlay .stamp{ background:rgba(20,52,46,.85); }
  body[data-theme="mounty"] .data-table tr:hover{ background:rgba(255,255,255,.04); }
  body[data-theme="mounty"] .ledger-form input, body[data-theme="mounty"] .ledger-form select,
  body[data-theme="mounty"] .filter-row select, body[data-theme="mounty"] .search-input,
  body[data-theme="mounty"] .period-inputs input, body[data-theme="mounty"] .budget-limit-input input,
  body[data-theme="mounty"] .log-payment-form input, body[data-theme="mounty"] .log-payment-form select, body[data-theme="mounty"] .cat-col form input,
  body[data-theme="mounty"] .settings-row input, body[data-theme="mounty"] .btn-outline,
  body[data-theme="mounty"] .contribution-form input{
    background:#163832; border-color:var(--line); color:var(--ink);
  }
  body[data-theme="mounty"] .more-row, body[data-theme="mounty"] .summary-box, body[data-theme="mounty"] .insight-note,
  body[data-theme="mounty"] .log-payment-form, body[data-theme="mounty"] .contribution-form{
    background:var(--card);
  }
  body[data-theme="mounty"] .progress-track, body[data-theme="mounty"] .breakdown-track,
  body[data-theme="mounty"] .budget-bar-track, body[data-theme="mounty"] .debt-bar-track,
  body[data-theme="mounty"] .goal-bar-track{ background:#123029; }
  body[data-theme="mounty"] .ring-period-btn.active,
  body[data-theme="mounty"] .type-btn.active,
  body[data-theme="mounty"] .segmented button.active{
    background:#2E5D50; color:#FFFFFF; box-shadow:var(--shadow-sm);
  }
  body[data-theme="mounty"] .type-btn.credit.active{ color:#7FE5A8; }
  body[data-theme="mounty"] .type-btn.debit.active{ color:#F0987A; }
  body[data-theme="mounty"] .bottom-nav .tab-btn.active{ color:#6FE0A0; }
  body[data-theme="mounty"] .balance-card, body[data-theme="mounty"] .ring-card{ overflow:hidden; }
  body[data-theme="mounty"] .balance-card::before, body[data-theme="mounty"] .ring-card::before{
    content:""; position:absolute; z-index:-1; left:0; right:0; bottom:0; height:70%;
    background-image: var(--mounty-photo);
    background-size:cover; background-position:bottom center; background-repeat:no-repeat;
    opacity:.4; pointer-events:none;
  }
  body[data-theme="mounty"] .back-btn{ color:#DCEFE0; text-shadow:0 1px 4px rgba(0,0,0,.5); }
  body[data-theme="mounty"] .back-btn:hover{ color:#FFFFFF; }
  body[data-theme="mounty"] .more-sub > p.period-hint{ color:#D3E8D8; text-shadow:0 1px 4px rgba(0,0,0,.45); }

  .theme-toggle{ width:46px; height:26px; border-radius:999px; background:var(--line); border:none; position:relative; padding:0; flex-shrink:0; transition:background .15s; }
  .theme-toggle .theme-toggle-thumb{ position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:var(--shadow-sm); transition:transform .18s; }
  .theme-toggle.on{ background:var(--binder); }
  .theme-toggle.on .theme-toggle-thumb{ transform:translateX(20px); }

  /* ---------- Search overlay ---------- */
  .search-overlay{ position:fixed; inset:0; background:rgba(15,23,42,.45); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); z-index:300; display:none; align-items:flex-start; justify-content:center; padding:64px 16px 20px; opacity:0; transition:opacity .2s cubic-bezier(.16,1,.3,1); }
  .search-overlay.open{ opacity:1; }
  .search-overlay-inner{ background:var(--card); border-radius:20px; max-width:560px; width:100%; max-height:78vh; box-shadow:var(--shadow); padding:18px; display:flex; flex-direction:column; opacity:0; transform:translateY(18px) scale(.96); transition:opacity .22s cubic-bezier(.16,1,.3,1), transform .22s cubic-bezier(.16,1,.3,1); }
  .search-overlay.open .search-overlay-inner{ opacity:1; transform:translateY(0) scale(1); }
  @media (prefers-reduced-motion: reduce){ .search-overlay, .search-overlay-inner{ transition:none; } }
  .search-overlay-header{ display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-shrink:0; }
  .search-overlay-body{ overflow-y:auto; -webkit-overflow-scrolling:touch; }
  .schedule-row{ padding:11px 4px; border-bottom:1px solid var(--bg); }

  .txdetail-hero{ text-align:center; padding:18px 0 20px; border-bottom:1px solid var(--line); margin-bottom:6px; }
  .txdetail-badge{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:5px 12px; border-radius:999px; margin-bottom:12px; }
  .txdetail-badge.credit{ background:rgba(22,163,74,.12); color:var(--credit); }
  .txdetail-badge.debit{ background:rgba(220,38,38,.12); color:var(--debit); }
  .txdetail-amount{ font-size:32px; font-weight:800; color:var(--ink); margin-bottom:6px; }
  .txdetail-category{ font-size:13.5px; color:var(--ink-soft); font-weight:600; }
  .txdetail-fields{ padding-top:8px; }
  .txdetail-field{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; padding:12px 4px; border-bottom:1px solid var(--bg); }
  .txdetail-field:last-child{ border-bottom:none; }
  .txdetail-field-label{ font-size:12px; color:var(--ink-soft); font-weight:600; flex-shrink:0; }
  .txdetail-field-value{ font-size:13.5px; font-weight:600; color:var(--ink); text-align:right; }
  .schedule-row:last-child{ border-bottom:none; }
  .schedule-row-top{ display:flex; justify-content:space-between; align-items:center; gap:8px; }
  .schedule-row-left{ display:flex; align-items:center; gap:10px; min-width:0; }
  .schedule-no{ width:26px; height:26px; border-radius:50%; background:var(--bg); color:var(--ink-soft); font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .schedule-due{ font-size:12.5px; font-weight:600; }
  .schedule-amt{ font-size:12px; font-weight:700; color:var(--ink-soft); margin-top:1px; }
  .schedule-status{ font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:999px; flex-shrink:0; white-space:nowrap; }
  .schedule-status.paid{ background:rgba(22,163,74,.12); color:var(--credit); }
  .schedule-status.overdue{ background:rgba(220,38,38,.12); color:var(--debit); }
  .schedule-status.upcoming{ background:var(--bg); color:var(--ink-soft); }
  .schedule-meta{ font-size:11px; color:var(--ink-soft); font-weight:600; margin-top:6px; padding-left:36px; }

  /* Desktop-only: the mobile single-column list gets a narrow, heavily-visible native
     scrollbar once there are more than a handful of installments. On wide screens there's
     room to lay rows out two-up (fewer inner scrolls needed) and to give any scrolling
     that remains a slim, custom-styled scrollbar instead of the stock OS one. Mobile is
     untouched — everything here lives behind the same 781px breakpoint as the rest of
     the desktop layout work. */
  @media (min-width:781px){
    #schedule-overlay .search-overlay-inner{ max-width:760px; }
    #schedule-list{ display:grid; grid-template-columns:1fr 1fr; gap:2px 24px; align-content:start; }
    #schedule-overlay .schedule-row{ border-bottom:none; background:var(--bg); border-radius:12px; padding:11px 14px; margin-bottom:8px; }
    #schedule-overlay .search-overlay-body{ scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
    #schedule-overlay .search-overlay-body::-webkit-scrollbar{ width:8px; }
    #schedule-overlay .search-overlay-body::-webkit-scrollbar-track{ background:transparent; }
    #schedule-overlay .search-overlay-body::-webkit-scrollbar-thumb{ background:var(--line); border-radius:999px; }
    #schedule-overlay .search-overlay-body::-webkit-scrollbar-thumb:hover{ background:var(--ink-soft); }
  }

  /* ---------- Recurring quick-add ---------- */
  .recurring-chips{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
  .recurring-chip{ display:flex; align-items:center; gap:7px; background:var(--bg); border:1.5px solid var(--line); border-radius:999px; padding:8px 10px 8px 6px; font-size:12.5px; font-weight:600; color:var(--ink); }
  .recurring-chip .chip-badge{ width:22px; height:22px; border-radius:50%; color:#fff; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .recurring-chip .chip-del{ color:var(--ink-soft); font-weight:800; padding:0 2px; border-radius:50%; }
  .recurring-chip .chip-del:hover{ color:var(--debit); }
  .save-recurring-row{ display:flex; align-items:center; gap:8px; margin:-6px 0 16px; font-size:12.5px; color:var(--ink-soft); font-weight:600; }
  .save-recurring-row input[type="checkbox"]{ width:16px; height:16px; accent-color:var(--binder); }

  /* ---------- Net worth ---------- */
  .networth-row{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; padding-top:12px; margin-top:4px; border-top:1px solid var(--line); }
  .networth-row .card-label{ font-size:11px; line-height:1.4; padding-top:2px; }
  .networth-row .mono-num{ line-height:1.4; flex-shrink:0; }

  /* ---------- Reminders ---------- */
  .reminder-card{ background:var(--bg); border-radius:16px; padding:14px 16px; margin-bottom:12px; }
  .reminder-card-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
  .reminder-name{ font-weight:700; font-size:14px; }
  .reminder-meta{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:2px; }
  .reminder-status{ font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; flex-shrink:0; }
  .reminder-status.overdue{ background:rgba(220,38,38,.12); color:var(--debit); }
  .reminder-status.upcoming{ background:rgba(245,158,11,.14); color:var(--gold); }
  .reminder-actions{ display:flex; gap:8px; margin-top:10px; }

  /* ---------- Add Entry desktop side panel ---------- */
  .add-entry-main{ min-width:0; }
  @media (min-width:781px){
    .add-entry-layout{ display:flex; align-items:flex-start; gap:26px; }
    .add-entry-main{ flex:1 1 480px; max-width:480px; }
    .add-entry-side{ flex:1 1 380px; min-width:0; }
  }

  @media (max-width:780px){
    body{ flex-direction:column; }
    .spine{ display:none; }
    .bottom-nav{ display:flex; }
    main{ padding-bottom:0; }
    .views{ padding:0 16px 90px; }
    .topbar{ margin:0 -16px; padding:16px 16px; }
    .grid-2x2{ grid-template-columns:1fr; }
    .cat-columns{ flex-direction:column; }
    .report-summary{ grid-template-columns:1fr; }
    .debt-overview-grid{ grid-template-columns:1fr; }
  }

  #app-toast{
    position:fixed; left:50%; top:calc(14px + env(safe-area-inset-top)); z-index:5000;
    transform:translateX(-50%) translateY(-160%);
    display:flex; align-items:center; gap:12px; background:var(--debit); color:#fff;
    padding:12px 16px; border-radius:14px; box-shadow:var(--shadow); font-size:13.5px; font-weight:600;
    transition:transform .22s ease; max-width:calc(100vw - 32px);
  }
  #app-toast.show{ transform:translateX(-50%) translateY(0); }
  #app-toast.info{ background:var(--binder); }
  #app-toast-close{ background:none; border:none; color:#fff; opacity:.8; font-size:18px; line-height:1; padding:0; flex-shrink:0; }
  #app-toast-close:hover{ opacity:1; }
