  :root {
    --cream: #f3f6f8;
    --cream-dark: #e9eef4;
    --warm-brown: #1f6f64;
    --gold: #1f6f64;
    --gold-light: #72b6a9;
    --green: #1f8a66;
    --green-light: #32a97f;
    --green-bg: #dff3ea;
    --red: #c24141;
    --red-light: #fce8e8;
    --text: #0f172a;
    --text-muted: #64748b;
    --sidebar: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #f8fafc;
    --border: #dbe3ec;
    --card: #ffffff;
    --shadow: 0 8px 24px rgba(15,23,42,0.08);
    --accent: #1f6f64;
    --accent-glow: rgba(31,111,100,0.16);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Manrope', sans-serif; background: var(--cream); color: var(--text); display: flex; height: 100vh; overflow: hidden; }

  /* SIDEBAR */
  .sidebar { width: 200px; min-width: 200px; background: var(--sidebar); display: flex; flex-direction: column; padding: 0; overflow-y: auto; }
  .logo { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 800; color: var(--gold-light); padding: 22px 20px 18px; letter-spacing: 0.5px; display: flex; align-items: center; justify-content: space-between; text-transform: uppercase; }
  .logo-settings { background: none; border: none; color: var(--sidebar-text); cursor: pointer; padding: 2px; border-radius: 4px; display: flex; align-items: center; }
  .logo-settings:hover { color: var(--gold-light); }
  .nav-section { padding: 4px 0; }
  .nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 13.5px; font-weight: 500; color: var(--sidebar-text); cursor: pointer; transition: all 0.15s; border-radius: 0; }
  .nav-item:hover { color: var(--sidebar-active); background: rgba(255,255,255,0.08); }
  .nav-item.active { color: var(--sidebar-active); background: rgba(31,111,100,0.18); }
  .nav-item.hidden-nav { display: none; }
  .nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
  .nav-item.active svg { opacity: 1; }
  .sidebar-divider { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; color: #64748b; padding: 16px 20px 6px; text-transform: uppercase; }
  .account-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 20px; font-size: 12px; color: var(--sidebar-text); cursor: pointer; }
  .account-item:hover { background: rgba(255,255,255,0.04); }
  .account-item .acc-name { opacity: 0.7; font-size: 11.5px; }
  .account-item .acc-val { font-weight: 600; color: #9fb3c8; }
  .account-total { display: flex; justify-content: space-between; padding: 8px 20px 4px; font-size: 12px; font-weight: 700; color: var(--gold-light); border-top: 1px solid #1e293b; margin-top: 4px; }
  .goals-section { padding: 8px 0 16px; }

  /* MAIN */
  .main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
  .page { display: none; flex-direction: column; height: 100%; }
  .page.active { display: flex; }

  /* FORECAST PAGE */
  .forecast-header { background: var(--cream); padding: 24px 32px 0; border-bottom: 1px solid var(--border); }
  .balance-row { display: flex; align-items: baseline; gap: 16px; margin-bottom: 8px; }
  .balance-label { font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
  .balance-amount { font-family: 'Sora', sans-serif; font-size: 48px; font-weight: 800; color: var(--text); line-height: 1; }
  .balance-cents { font-size: 28px; }
  .tab-row { display: flex; gap: 4px; margin-bottom: 16px; }
  .tab-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: transparent; font-size: 13px; font-family: 'Manrope', sans-serif; cursor: pointer; color: var(--text-muted); transition: all 0.15s; }
  .tab-btn.active { background: var(--sidebar); color: white; border-color: var(--sidebar); }
  .tab-btn:hover:not(.active) { background: var(--cream-dark); color: var(--text); }
  .meta-row { display: flex; align-items: center; gap: 20px; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
  .meta-row .highlight { color: var(--text); font-weight: 600; }
  .meta-row .positive { color: var(--green); font-weight: 600; }
  .meta-row .separator { color: var(--border); }
  .header-tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 0; padding-bottom: 12px; }
  .period-tabs { display: flex; gap: 4px; }
  .btn-outline { padding: 7px 16px; border-radius: 8px; border: 1px solid var(--border); background: transparent; font-size: 13px; font-family: 'Manrope', sans-serif; cursor: pointer; color: var(--text); transition: all 0.15s; }
  .btn-outline:hover { background: var(--cream-dark); color: var(--text); }
  .btn-primary { padding: 7px 16px; border-radius: 8px; border: none; background: var(--sidebar); font-size: 13px; font-family: 'Manrope', sans-serif; cursor: pointer; color: white; font-weight: 500; transition: all 0.15s; }
  .btn-primary:hover { background: #1e293b; }
  .btn-danger { padding: 7px 16px; border-radius: 8px; border: none; background: var(--red); font-size: 13px; font-family: 'Manrope', sans-serif; cursor: pointer; color: white; font-weight: 500; transition: all 0.15s; }

  /* CHART */
  .chart-container { background: var(--cream); padding: 20px 32px; position: relative; height: 260px; }

  /* LOWER AREA */
  .forecast-lower { display: flex; flex: 1; border-top: 1px solid var(--border); overflow: hidden; }
  .upcoming-panel { flex: 1; padding: 20px 32px; overflow-y: auto; border-right: 1px solid var(--border); }
  .panel-title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
  .upcoming-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
  .txn-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; }
  .txn-date { font-size: 12px; color: var(--text-muted); width: 48px; flex-shrink: 0; }
  .txn-info { flex: 1; }
  .txn-name { font-size: 14px; font-weight: 500; }
  .txn-cat { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
  .txn-amount { font-size: 14px; font-weight: 600; }
  .txn-amount.neg { color: var(--red); }
  .txn-amount.pos { color: var(--green); }
  .summary-panel { width: 320px; min-width: 280px; padding: 20px 24px; overflow-y: auto; }
  .summary-card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
  .summary-title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .summary-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13.5px; }
  .summary-row .s-label { color: var(--text-muted); }
  .summary-row .s-val { font-weight: 600; }
  .summary-row .s-val.pos { color: var(--green); }
  .summary-row .s-val.neg { color: var(--red); }
  .summary-row.total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }

  /* PAGE INNER */
  .page-inner { padding: 28px 32px; overflow-y: auto; flex: 1; }
  .page-header { margin-bottom: 24px; }
  .page-heading { font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 400; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
  .page-amount { font-family: 'Sora', sans-serif; font-size: 40px; font-weight: 800; }
  .page-meta { font-size: 13px; color: var(--text-muted); margin-top: 6px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
  .badge { background: var(--cream-dark); border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: var(--text); }
  .action-row { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; }
  .search-input { flex: 1; max-width: 320px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: 'Manrope', sans-serif; background: var(--card); color: var(--text); outline: none; }
  .search-input:focus { border-color: var(--gold); }

  /* CATEGORIES */
  .category-card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
  .cat-header { display: flex; align-items: center; padding: 16px 20px; gap: 14px; cursor: pointer; transition: background 0.15s; }
  .cat-header:hover { background: var(--cream); }
  .cat-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
  .cat-name { font-size: 15px; font-weight: 600; flex: 1; }
  .cat-count { font-size: 12px; color: var(--text-muted); }
  .cat-total { font-size: 16px; font-weight: 700; }
  .cat-item { display: grid; grid-template-columns: 1fr auto auto auto auto auto; gap: 8px; align-items: center; padding: 12px 20px 12px 74px; border-top: 1px solid var(--border); font-size: 13px; }
  .cat-item-name { font-weight: 500; }
  .cat-item-val { text-align: right; color: var(--text-muted); font-size: 12px; }
  .cat-item-val.bold { font-weight: 700; color: var(--text); font-size: 13px; }
  .cat-item-val.qtr { background: var(--cream-dark); border-radius: 4px; padding: 2px 6px; font-size: 12px; font-weight: 600; }
  .icon-btn { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-muted); padding: 4px; border-radius: 4px; transition: all 0.15s; }
  .icon-btn:hover { background: var(--cream-dark); color: var(--text); }

  /* INVESTMENTS */
  .holdings-header { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
  .holding-pill { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 13px; font-weight: 500; }
  .holding-dot { width: 8px; height: 8px; border-radius: 50%; }
  .holding-card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
  .holding-header { display: flex; align-items: center; padding: 20px 24px; gap: 16px; }
  .holding-badge { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: white; flex-shrink: 0; }
  .holding-info { flex: 1; }
  .holding-ticker { font-size: 16px; font-weight: 700; }
  .holding-name { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
  .holding-value { text-align: right; }
  .holding-main-val { font-size: 20px; font-weight: 700; }
  .holding-per { font-size: 12px; color: var(--text-muted); }
  .holding-stats { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); }
  .stat-box { padding: 14px 20px; border-right: 1px solid var(--border); }
  .stat-box:last-child { border-right: none; }
  .stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
  .stat-val { font-size: 14px; font-weight: 600; }
  .stat-val.pos { color: var(--green); }
  .stat-val.neg { color: var(--red); }

  /* PROJECTIONS */

  /* SCENARIOS */
  .scenario-selector { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; }
  .scenario-pill { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }
  .scenario-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

  /* NET WORTH */
  .nw-table { width: 100%; font-size: 13.5px; }
  .nw-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .nw-row:last-child { border-bottom: none; font-weight: 700; font-size: 15px; padding-top: 12px; }
  .nw-row .nw-val { font-weight: 500; }
  .on-track-banner { background: var(--green); color: white; border-radius: 12px; padding: 16px 20px; margin: 0 32px 16px; display: flex; align-items: center; gap: 20px; }
  .on-track-label { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.8; }
  .on-track-heading { font-size: 18px; font-weight: 700; }
  .on-track-sub { font-size: 13px; opacity: 0.85; margin-top: 2px; }
  .on-track-projections { display: flex; gap: 24px; margin-left: auto; }
  .on-track-proj { text-align: right; }
  .on-track-proj-label { font-size: 11px; opacity: 0.7; }
  .on-track-proj-val { font-size: 18px; font-weight: 700; }
  .on-track-proj-delta { font-size: 12px; opacity: 0.8; }
  .bear-emoji { font-size: 36px; flex-shrink: 0; }
  .events-section { margin-top: 20px; }
  .event-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; }
  .event-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .event-date { font-size: 13px; color: var(--text-muted); width: 80px; }
  .event-name { flex: 1; font-size: 14px; font-weight: 500; }
  .event-amount { font-size: 14px; font-weight: 600; }
  .add-link { font-size: 13px; color: var(--gold); cursor: pointer; font-weight: 600; background: none; border: none; font-family: 'Manrope', sans-serif; }
  .add-link:hover { text-decoration: underline; color: var(--warm-brown); }

  /* MODALS */
  .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(10,8,4,0.82); backdrop-filter: blur(8px) saturate(0.6); -webkit-backdrop-filter: blur(8px) saturate(0.6); z-index: 1000; align-items: center; justify-content: center; }
  .modal-overlay.open { display: flex; }
  .modal { background: #fff; border-radius: 18px; width: 480px; max-width: 95vw; box-shadow: 0 0 0 1px rgba(31,111,100,0.18), 0 32px 80px rgba(0,0,0,0.55); max-height: 90vh; overflow-y: auto; }
  .modal-header { background: var(--sidebar); border-radius: 18px 18px 0 0; padding: 22px 28px 18px; }
  .modal-header h3 { font-size: 18px; font-weight: 700; color: var(--gold-light); margin: 0 0 2px; font-family: 'Sora', sans-serif; letter-spacing: 0.3px; }
  .modal-header .modal-subtitle { font-size: 13px; color: #9fb3c8; margin: 0; }
  .modal-body { padding: 22px 28px 6px; }
  .modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 28px 24px; border-top: 1px solid var(--border); margin-top: 8px; }
  .modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
  .modal-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
  .form-group { margin-bottom: 14px; }
  .form-label { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; display: block; }
  .form-input { width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: 'Manrope', sans-serif; outline: none; background: #fff; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; }
  .form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(31,111,100,0.16); }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  /* DASHBOARD */
  .dash-wrap { flex: 1; overflow-y: auto; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 20px; }
  .dash-top { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
  .kpi-card { background: var(--card); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; min-height: 96px; position: relative; overflow: hidden; }
  .kpi-card.accent { background: var(--sidebar); }
  .kpi-label { font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
  .kpi-card.accent .kpi-label { color: rgba(148,163,176,0.65); }
  .kpi-value { font-family: 'Sora', sans-serif; font-size: 30px; font-weight: 800; color: var(--text); line-height: 1; }
  .kpi-card.accent .kpi-value { color: var(--gold-light); }
  .kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
  .kpi-card.accent .kpi-sub { color: rgba(148,163,176,0.6); }
  .kpi-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
  .kpi-badge.pos { background: var(--green-bg); color: var(--green); }
  .kpi-badge.neg { background: var(--red-light); color: var(--red); }
  .kpi-badge.neutral { background: var(--cream-dark); color: var(--text-muted); }
  .kpi-tab { font-size: 11px; padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.12); background: transparent; font-family: 'Manrope', sans-serif; cursor: pointer; color: rgba(148,163,176,0.55); transition: all 0.15s; }
  .kpi-tab.active { background: rgba(114,182,169,0.22); border-color: transparent; color: var(--gold-light); font-weight: 600; }
  .kpi-tab:hover:not(.active) { color: var(--gold-light); border-color: rgba(255,255,255,0.2); }
  .kpi-icon { position: absolute; right: 16px; top: 14px; font-size: 20px; opacity: 0.13; pointer-events: none; }

  .dash-mid { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
  .dash-chart-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
  .dash-chart-head { padding: 18px 22px 0; display: flex; align-items: center; justify-content: space-between; }
  .dash-chart-title { font-size: 13px; font-weight: 700; letter-spacing: 0.5px; }
  .dash-chart-meta { font-size: 12px; color: var(--text-muted); }
  .dash-chart-inner { padding: 12px 16px 16px; height: 220px; position: relative; }
  .dash-chart-period { display: flex; gap: 4px; }

  .dash-bottom { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
  .dash-panel { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
  .dash-panel-head { padding: 16px 20px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
  .dash-panel-title { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); }
  .dash-panel-body { padding: 4px 20px 16px; flex: 1; overflow-y: auto; max-height: 240px; }
  .dash-txn { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .dash-txn:last-child { border-bottom: none; }
  .dash-txn-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .dash-txn-name { flex: 1; font-size: 13px; font-weight: 500; }
  .dash-txn-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
  .dash-txn-amt { font-size: 13px; font-weight: 600; }
  .dash-nw-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
  .dash-nw-row:last-child { border-bottom: none; font-weight: 700; padding-top: 12px; margin-top: 4px; }
  .dash-cat-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
  .dash-cat-row:last-child { border-bottom: none; }
  .dash-cat-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
  .dash-cat-name { flex: 1; font-size: 13px; font-weight: 500; }
  .dash-cat-bar-wrap { width: 80px; height: 4px; background: var(--cream-dark); border-radius: 2px; overflow: hidden; }
  .dash-cat-bar { height: 100%; border-radius: 2px; background: var(--red); }
  .dash-cat-amt { font-size: 12px; font-weight: 600; color: var(--text-muted); width: 52px; text-align: right; }
  .dash-empty { font-size: 13px; color: var(--text-muted); padding: 16px 0; font-style: italic; }

  /* SETUP WIZARD */

  /* FEATURE TOGGLE */

  /* ACCOUNT EDIT LIST */

  /* SETTINGS PAGE */
  .settings-section { margin-bottom: 28px; }
  .settings-section-title { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .toggle-row:last-child { border-bottom: none; }
  .toggle-info { flex: 1; }
  .toggle-name { font-size: 14px; font-weight: 500; }
  .toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
  .toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border); border-radius: 24px; transition: 0.2s; }
  .toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
  input:checked + .toggle-slider { background: var(--gold); }
  input:checked + .toggle-slider:before { transform: translateX(20px); }

  /* ---- BOTTOM NAV + DRAWER: hidden on desktop ---- */
  .bottom-nav { display: none; }
  .more-drawer { display: none; }
  .more-drawer-backdrop { display: none; }

  /* ================================
     MOBILE RESPONSIVE (≤ 768px)
     ================================ */
  @media (max-width: 768px) {
    body { flex-direction: column; height: 100dvh; overflow: hidden; }
    .sidebar { display: none; }
    .main { flex: 1; overflow: hidden; padding-bottom: 64px; }
    .page { height: 100%; }

    /* Bottom nav */
    .bottom-nav {
      display: flex; position: fixed; bottom: 0; left: 0; right: 0;
      height: 64px; background: var(--sidebar); align-items: stretch;
      border-top: 1px solid #1e293b; z-index: 900;
      padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav-item {
      flex: 1; display: flex; flex-direction: column; align-items: center;
      justify-content: center; gap: 3px; cursor: pointer;
      color: var(--sidebar-text); font-size: 10px; font-weight: 500;
      padding: 8px 4px; border: none; background: none;
      font-family: 'Manrope', sans-serif; transition: color 0.15s; opacity: 0.65;
    }
    .bottom-nav-item.active { color: var(--gold-light); opacity: 1; }
    .bottom-nav-item svg { width: 20px; height: 20px; stroke: currentColor; }
    .bottom-nav-item span { font-size: 10px; line-height: 1; }

    /* More drawer */
    .more-drawer {
      display: block; position: fixed; bottom: 64px; left: 0; right: 0;
      z-index: 850; background: var(--sidebar); border-top: 1px solid #1e293b;
      border-radius: 16px 16px 0 0;
      transform: translateY(110%); transition: transform 0.25s ease;
      padding: 12px 0 env(safe-area-inset-bottom);
    }
    .more-drawer.open { transform: translateY(0); }
    .more-drawer-item {
      display: flex; align-items: center; gap: 14px; padding: 14px 24px;
      font-size: 15px; font-weight: 500; color: var(--sidebar-text);
      cursor: pointer; border: none; background: none;
      font-family: 'Manrope', sans-serif; width: 100%; text-align: left;
    }
    .more-drawer-item.active { color: var(--gold-light); }
    .more-drawer-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.8; }
    .more-drawer-backdrop {
      display: none; position: fixed; inset: 0; z-index: 840;
      background: rgba(0,0,0,0.3);
    }
    .more-drawer-backdrop.open { display: block; }

    /* Dashboard */
    .dash-wrap { padding: 16px 14px 20px; gap: 14px; }
    .dash-top { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi-card { min-height: 88px; padding: 16px; }
    .kpi-value { font-size: 24px; }
    .kpi-icon { font-size: 16px; }
    .dash-mid { grid-template-columns: 1fr; }
    .dash-chart-inner { height: 180px; }
    .dash-bottom { grid-template-columns: 1fr; }
    .dash-panel-body { max-height: 200px; }

    /* Categories */
    .page-inner { padding: 16px 14px; }
    .page-amount { font-size: 28px; }
    .action-row { flex-wrap: wrap; gap: 6px; }
    .search-input { max-width: 100%; width: 100%; }
    .cat-item { grid-template-columns: 1fr auto auto auto; padding: 10px 14px 10px 58px; }
    .cat-item .cat-item-val:nth-child(2) { display: none; }
    .cat-item .cat-item-val.qtr { display: none; }
    .cat-icon { width: 34px; height: 34px; font-size: 15px; }

    /* Investments */
    .holding-stats { grid-template-columns: repeat(3, 1fr); }
    .holding-stats .stat-box:nth-child(4),
    .holding-stats .stat-box:nth-child(5) { display: none; }

    /* Projections */
      
    /* Settings */
    .page-inner[style*="max-width"] { max-width: 100% !important; }

    /* Modals */
    .modal-overlay { align-items: flex-end; }
    .modal { width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; max-height: 92dvh; }
    .modal-header { border-radius: 20px 20px 0 0; padding: 20px 20px 16px; }
    .modal-body { padding: 16px 20px 4px; }
    .modal-footer { padding: 10px 20px 24px; }
    .form-row { grid-template-columns: 1fr; }

    /* Setup wizard */
          
    /* Misc */
    .btn-primary, .btn-outline { padding: 9px 14px; font-size: 13px; }
    .holdings-header { gap: 8px; }
    .holding-header { padding: 16px; gap: 12px; }
    .holding-badge { width: 42px; height: 42px; font-size: 11px; }
    .holding-main-val { font-size: 17px; }
  }

  /* CALENDAR */
  .cal-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--sidebar); }
  .cal-grid-header div { padding: 10px 0; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--sidebar-text); }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--border); }
  .cal-cell { min-height: 90px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 8px; cursor: default; transition: background 0.1s; }
  .cal-cell:hover { background: var(--cream); }
  .cal-cell.other-month { background: #f8fafc; }
  .cal-cell.today .cal-day-num { background: var(--sidebar); color: var(--gold-light); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
  .cal-day-num { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
  .cal-event { font-size: 10px; font-weight: 600; border-radius: 4px; padding: 2px 5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
  .cal-event.payday  { background: #d8f3dc; color: var(--green); }
  .cal-event.bill    { background: var(--red-light); color: var(--red); }
  .cal-event.income  { background: #d8f3dc; color: var(--green); }
  .cal-event.txn     { background: var(--cream-dark); color: var(--text-muted); }
  .cal-event.reminder { background: #dbeafe; color: #1d4ed8; }
  /* Reminder list */
  .reminder-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 10px; display: flex; align-items: center; gap: 16px; }
  .reminder-icon { width: 40px; height: 40px; border-radius: 10px; background: #dbeafe; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
  .reminder-info { flex: 1; }
  .reminder-name { font-size: 14px; font-weight: 600; }
  .reminder-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
  .reminder-amount { font-size: 16px; font-weight: 700; color: var(--red); }
  @media (max-width: 768px) {
    .cal-cell { min-height: 60px; padding: 4px 4px; }
    .cal-event { font-size: 9px; padding: 1px 3px; }
    .cal-day-num { font-size: 11px; }
    #proj-cards { grid-template-columns: 1fr !important; }
  }

  /* AUTH SCREEN */
  .auth-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.82); z-index: 10000; display: none; align-items: center; justify-content: center; font-family: 'Manrope', sans-serif; }
    .auth-overlay.open { display: flex; }
  .auth-box { background: #1a2130; border-radius: 20px; padding: 40px 36px; width: 100%; max-width: 400px; margin: 16px; }
  .auth-logo { font-family: 'Sora', sans-serif; font-size: 32px; font-weight: 800; color: var(--gold-light); text-align: center; margin-bottom: 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 1px; }
  .auth-tagline { text-align: center; color: var(--sidebar-text); font-size: 13px; margin-bottom: 32px; opacity: 0.7; }
  .auth-tabs { display: flex; gap: 0; margin-bottom: 24px; background: #1e2530; border-radius: 10px; padding: 3px; }
  .auth-tab { flex: 1; padding: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--sidebar-text); cursor: pointer; border-radius: 8px; border: none; background: none; font-family: 'Manrope', sans-serif; transition: all 0.15s; }
  .auth-tab.active { background: var(--gold); color: #1e2530; }
  .auth-input { width: 100%; padding: 12px 14px; background: #1e2530; border: 1px solid #1e293b; border-radius: 10px; color: var(--sidebar-text); font-size: 14px; font-family: 'Manrope', sans-serif; margin-bottom: 12px; outline: none; }
  .auth-input:focus { border-color: var(--gold); }
  .auth-input::placeholder { color: #4a5a6a; }
  .auth-link { border: none; background: none; color: var(--gold-light); font-size: 12px; font-weight: 600; cursor: pointer; margin: -4px 0 8px; padding: 0; text-align: left; }
  .auth-link:hover { text-decoration: underline; }
  .auth-btn { width: 100%; padding: 13px; background: var(--gold); color: #1e2530; font-weight: 700; font-size: 15px; border: none; border-radius: 10px; cursor: pointer; font-family: 'Manrope', sans-serif; margin-top: 4px; transition: opacity 0.15s; }
  .auth-btn:hover { opacity: 0.9; }
  .auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .auth-msg { text-align: center; font-size: 13px; margin-top: 14px; min-height: 20px; }
  .auth-msg.error { color: #f87171; }
  .auth-msg.success { color: var(--green-light); }
  .auth-sync { position: fixed; top: 16px; right: 16px; background: var(--sidebar); color: var(--sidebar-text); font-size: 12px; padding: 6px 12px; border-radius: 8px; z-index: 500; display: none; align-items: center; gap: 6px; }
  .auth-sync.visible { display: flex; }
  .sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-light); }
  .sync-dot.syncing { background: var(--gold); animation: pulse 1s infinite; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

  ::-webkit-scrollbar { width: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }




.logo-home {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.public-home {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(31,111,100,0.12), transparent 60%), var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.public-home-inner {
  width: 100%;
  max-width: 980px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px;
}
.public-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(31,111,100,0.10);
  border-radius: 999px;
  padding: 6px 10px;
  margin-bottom: 14px;
}
.public-title { font-family: 'Sora', sans-serif; font-size: 38px; line-height: 1.1; margin-bottom: 12px; }
.public-subtitle { color: var(--text-muted); max-width: 760px; line-height: 1.55; margin-bottom: 18px; }
.public-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.public-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.public-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: #fbfcfe; }
.public-card h3 { font-size: 14px; margin-bottom: 6px; }
.public-card p { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }

.auth-back {
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 12px;
}

.dash-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.insight-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.insight-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
}
.insight-value { font-size: 13px; font-weight: 700; color: var(--text); }
.dash-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-quick-actions .btn-outline { background: var(--card); }

#app-shell { display: flex; flex: 1; min-height: 100vh; }

@media (max-width: 768px) {
  .public-home-inner { padding: 24px 18px; }
  .public-title { font-size: 30px; }
  .public-grid { grid-template-columns: 1fr; }
  .dash-insights { grid-template-columns: 1fr; }
}


