  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg: #f7f6f2; --surface: #ffffff; --surface2: #f0efe9; --border: #e8e6df;
    --text: #1a1916; --text-muted: #8a8880; --accent: #2c4a3e; --accent-light: #e8f0ed;
    --accent2: #c4a882; --danger: #c0392b; --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --radius: 12px; --transition: 0.18s ease;
  }
  body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; line-height: 1.6; }
  #login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); position: relative; overflow: hidden; }
  #login-screen::before { content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(44,74,62,0.06) 0%, transparent 70%); top: -100px; right: -100px; pointer-events: none; }
  #login-screen::after { content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(196,168,130,0.08) 0%, transparent 70%); bottom: -50px; left: -50px; pointer-events: none; }
  .login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 52px 48px; width: 420px; max-width: 90vw; box-shadow: 0 8px 40px rgba(0,0,0,0.08); position: relative; z-index: 1; animation: fadeUp 0.5s ease both; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
  .login-logo { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--accent); margin-bottom: 6px; letter-spacing: -0.5px; }
  .login-tagline { color: var(--text-muted); font-size: 13px; margin-bottom: 36px; font-weight: 300; }
  .login-tabs { display: flex; margin-bottom: 28px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .login-tab { flex: 1; padding: 9px; background: none; border: none; font-family: 'DM Sans', sans-serif; font-size: 13px; cursor: pointer; color: var(--text-muted); transition: all var(--transition); }
  .login-tab.active { background: var(--accent); color: white; font-weight: 500; }
  .field-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
  .field-input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 14px; background: var(--bg); color: var(--text); outline: none; transition: border-color var(--transition), box-shadow var(--transition); margin-bottom: 20px; }
  .field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,74,62,0.1); background: var(--surface); }
  .btn-primary { width: 100%; padding: 13px; background: var(--accent); color: white; border: none; border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; transition: background var(--transition), transform var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px; }
  .btn-primary:hover { background: #1e3329; transform: translateY(-1px); }
  .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
  .auth-message { font-size: 12px; margin-top: 12px; text-align: center; padding: 10px; border-radius: 8px; display: none; }
  .auth-message.error { background: #fdf0ef; color: var(--danger); display: block; }
  .auth-message.success { background: var(--accent-light); color: var(--accent); display: block; }
  .forgot-link { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); }
  .forgot-link a { color: var(--accent); cursor: pointer; }
  #loading-screen { min-height: 100vh; display: none; align-items: center; justify-content: center; background: var(--bg); flex-direction: column; gap: 16px; }
  .loading-logo { font-family: 'DM Serif Display', serif; font-size: 32px; color: var(--accent); }
  .loading-dots { display: flex; gap: 6px; }
  .loading-dots span { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: bounce 1.2s infinite; opacity: 0.4; }
  .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
  .loading-dots span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes bounce { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
  #app { display: none; min-height: 100vh; flex-direction: column; }
  .topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 28px; height: 58px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
  .topbar-logo { font-family: 'DM Serif Display', serif; font-size: 20px; color: var(--accent); letter-spacing: -0.3px; display: flex; align-items: center; gap: 10px; }
  .topbar-logo span { width: 8px; height: 8px; background: var(--accent2); border-radius: 50%; display: inline-block; }
  .topbar-right { display: flex; align-items: center; gap: 16px; }
  .topbar-user { font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; }
  .topbar-time { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-muted); }
  .btn-logout { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: all var(--transition); }
  .btn-logout:hover { border-color: var(--danger); color: var(--danger); }
  .app-body { display: grid; grid-template-columns: 220px 1fr; flex: 1; }
  .sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 24px 16px; position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto; }
  .sidebar-section { margin-bottom: 28px; }
  .sidebar-label { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 0 10px; margin-bottom: 6px; }
  .nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: all var(--transition); font-size: 13.5px; color: var(--text-muted); border: none; background: none; width: 100%; text-align: left; font-family: 'DM Sans', sans-serif; }
  .nav-item:hover { background: var(--surface2); color: var(--text); }
  .nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
  .nav-item .nav-icon { font-size: 15px; width: 20px; text-align: center; }
  .nav-count { margin-left: auto; font-size: 10px; background: var(--surface2); color: var(--text-muted); padding: 2px 7px; border-radius: 20px; font-family: 'DM Mono', monospace; }
  .nav-item.active .nav-count { background: rgba(44,74,62,0.15); color: var(--accent); }
  .main { padding: 32px 36px; overflow-y: auto; }
  .page { display: none; animation: fadeIn 0.2s ease; }
  .page.active { display: block; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
  .page-title { font-family: 'DM Serif Display', serif; font-size: 26px; color: var(--text); letter-spacing: -0.3px; line-height: 1.2; }
  .page-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
  .btn-add { background: var(--accent); color: white; border: none; border-radius: 8px; padding: 9px 18px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; gap: 6px; }
  .btn-add:hover { background: #1e3329; transform: translateY(-1px); }
  .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
  .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: box-shadow var(--transition); }
  .stat-card:hover { box-shadow: var(--shadow); }
  .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
  .stat-value { font-family: 'DM Serif Display', serif; font-size: 32px; color: var(--text); line-height: 1; margin-bottom: 4px; }
  .stat-change { font-size: 11px; color: var(--text-muted); }
  .dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
  .dash-card-title { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 16px; }
  .recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: color var(--transition); }
  .recent-item:last-child { border-bottom: none; }
  .recent-item:hover .recent-title { color: var(--accent); }
  .recent-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
  .recent-title { font-size: 13px; color: var(--text); }
  .recent-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; font-family: 'DM Mono', monospace; }
  .greeting-bar { background: linear-gradient(135deg, var(--accent) 0%, #1e3329 100%); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 24px; color: white; display: flex; align-items: center; justify-content: space-between; }
  .greeting-title { font-family: 'DM Serif Display', serif; font-size: 22px; margin-bottom: 4px; }
  .greeting-sub { font-size: 13px; opacity: 0.7; }
  .greeting-emblem { font-family: 'DM Serif Display', serif; font-size: 48px; opacity: 0.15; letter-spacing: -2px; }
  .notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
  .note-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; cursor: pointer; transition: all var(--transition); }
  .note-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
  .note-title { font-weight: 500; font-size: 14px; margin-bottom: 8px; color: var(--text); }
  .note-preview { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .note-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
  .note-date { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }
  .note-tag { font-size: 10px; padding: 3px 8px; border-radius: 20px; background: var(--accent-light); color: var(--accent); font-weight: 500; }
  .links-list { display: flex; flex-direction: column; gap: 10px; }
  .link-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: all var(--transition); }
  .link-card:hover { box-shadow: var(--shadow); border-color: var(--accent); }
  .link-favicon { width: 36px; height: 36px; border-radius: 8px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
  .link-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
  .link-url { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; margin-top: 2px; }
  .link-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
  .link-tag { margin-left: auto; font-size: 10px; padding: 3px 10px; border-radius: 20px; background: var(--surface2); color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
  .tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; cursor: pointer; transition: all var(--transition); text-align: center; }
  .tool-card:hover { box-shadow: var(--shadow); border-color: var(--accent); transform: translateY(-2px); }
  .tool-icon { font-size: 28px; margin-bottom: 12px; }
  .tool-name { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
  .tool-desc { font-size: 12px; color: var(--text-muted); }
  .ai-layout { display: flex; flex-direction: column; height: calc(100vh - 58px - 64px - 48px); min-height: 400px; }
  .ai-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 0 20px; }
  .ai-msg { display: flex; gap: 12px; animation: fadeUp 0.2s ease both; }
  .ai-msg.user { flex-direction: row-reverse; }
  .ai-avatar { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; background: var(--accent-light); color: var(--accent); font-family: 'DM Serif Display', serif; }
  .ai-msg.user .ai-avatar { background: var(--surface2); }
  .ai-bubble { max-width: 72%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-size: 13.5px; line-height: 1.65; color: var(--text); }
  .ai-msg.user .ai-bubble { background: var(--accent); color: white; border-color: var(--accent); }
  .ai-input-row { display: flex; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
  .ai-input { flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 14px; background: var(--surface); color: var(--text); outline: none; transition: border-color var(--transition); resize: none; }
  .ai-input:focus { border-color: var(--accent); }
  .ai-send { background: var(--accent); color: white; border: none; border-radius: 10px; padding: 12px 18px; cursor: pointer; font-size: 16px; transition: all var(--transition); display: flex; align-items: center; }
  .ai-send:hover { background: #1e3329; }
  .ai-send:disabled { opacity: 0.5; cursor: not-allowed; }
  .ai-thinking { display: flex; gap: 4px; padding: 4px 0; align-items: center; }
  .ai-thinking span { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; animation: bounce 1.2s infinite; }
  .ai-thinking span:nth-child(2) { animation-delay: 0.2s; }
  .ai-thinking span:nth-child(3) { animation-delay: 0.4s; }
  .modal-overlay { position: fixed; inset: 0; background: rgba(26,25,22,0.4); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  .modal-overlay.open { opacity: 1; pointer-events: all; }
  .modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 500px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.15); transform: translateY(10px); transition: transform 0.2s ease; }
  .modal-overlay.open .modal { transform: translateY(0); }
  .modal-title { font-family: 'DM Serif Display', serif; font-size: 20px; margin-bottom: 20px; color: var(--text); }
  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
  .btn-cancel { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 9px 18px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text-muted); cursor: pointer; transition: all var(--transition); }
  .btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }
  textarea.field-input { resize: vertical; min-height: 90px; }
  .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
  .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
  .empty-text { font-size: 14px; }
  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: white; padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 999; opacity: 0; transform: translateY(8px); transition: all 0.2s ease; pointer-events: none; }
  .toast.show { opacity: 1; transform: translateY(0); }
  .toast.error { background: var(--danger); }
  .toast.success { background: var(--accent); }

  /* ── FINANCE STYLES ── */
  .fin-card { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:22px 24px;margin-bottom:16px; }
  .fin-card-lbl { font-size:10px;text-transform:uppercase;letter-spacing:.12em;color:var(--text-muted);font-weight:500;margin-bottom:14px; }
  .fin-row2 { display:grid;grid-template-columns:1fr 1fr;gap:16px; }
  .fin-row3 { display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px; }
  .fin-sep { border:none;border-top:1px solid var(--border);margin:12px 0; }
  .fin-empty { text-align:center;padding:48px 20px;color:var(--text-muted);font-size:13px; }
  .fin-empty-icon { font-size:36px;margin-bottom:10px;opacity:.35; }
  @media(max-width:680px){ .fin-row2,.fin-row3{ grid-template-columns:1fr; } }
  .up-format-note { background:var(--surface2);border-radius:10px;padding:14px 18px;margin-bottom:20px;font-size:12px;color:var(--text-muted);line-height:1.75; }
  .up-format-note strong { color:var(--text);font-weight:600; }
  .up-format-note code { font-family:'DM Mono',monospace;background:var(--border);padding:1px 5px;border-radius:4px;font-size:11px; }
  .up-drop-grid { display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:18px; }
  .up-drop-badge { display:inline-block;font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;padding:2px 7px;border-radius:20px;margin-bottom:8px; }
  .badge-santander { background:#e8f0ed;color:#2c4a3e; }
  .badge-hsbc { background:#e8eef8;color:#1a3a6b; }
  .badge-amex { background:#fef3e2;color:#b45309; }
  /* Account switcher */
  .fin-acct-bar { display:flex;gap:6px;margin-bottom:20px;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:10px 14px;align-items:center; }
  .fin-acct-lbl { font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.08em;font-weight:500;margin-right:4px; }
  .fin-acct-btn { background:none;border:1px solid var(--border);border-radius:6px;padding:5px 14px;font-family:'DM Mono',monospace;font-size:11px;color:var(--text-muted);cursor:pointer;transition:all .15s;font-weight:500; }
  .fin-acct-btn.on { color:white;border-color:transparent; }
  .fin-acct-btn.on.santander { background:#2c4a3e; }
  .fin-acct-btn.on.hsbc { background:#1a3a6b; }
  .fin-acct-btn.on.amex { background:#b45309; }
  @media(max-width:580px){ .up-drop-grid{ grid-template-columns:1fr; } }
  .up-drop { border:2px dashed var(--border);border-radius:var(--radius);padding:30px 20px;text-align:center;cursor:pointer;transition:all .18s ease;background:var(--surface);position:relative; }
  .up-drop:hover,.up-drop.drag-over { border-color:var(--accent);background:var(--accent-light); }
  .up-drop.loaded { border-color:var(--accent);border-style:solid; }
  .up-drop input { display:none; }
  .up-drop-icon { font-size:30px;margin-bottom:10px; }
  .up-drop-title { font-size:14px;font-weight:500;color:var(--text);margin-bottom:4px; }
  .up-drop-sub { font-size:11px;color:var(--text-muted);line-height:1.5; }
  .up-drop-status { font-size:11px;color:var(--accent);margin-top:10px;font-family:'DM Mono',monospace;display:none; }
  .up-drop.loaded .up-drop-status { display:block; }
  .up-drop-clear { position:absolute;top:10px;right:10px;background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:16px;padding:2px 6px;border-radius:4px;display:none; }
  .up-drop.loaded .up-drop-clear { display:block; }
  .up-drop-clear:hover { color:var(--danger); }
  .up-actions { display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:28px; }
  .btn-up-save { background:var(--accent);color:white;border:none;border-radius:8px;padding:10px 22px;font-family:'DM Sans',sans-serif;font-size:13px;font-weight:500;cursor:pointer;transition:all .18s ease; }
  .btn-up-save:hover { background:#1e3329;transform:translateY(-1px); }
  .btn-up-save:disabled { opacity:.45;cursor:not-allowed;transform:none; }
  .up-hint { font-size:12px;color:var(--text-muted); }
  .up-history { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden; }
  .up-history-hdr { padding:16px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between; }
  .up-history-title { font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted); }
  .up-hist-row { display:flex;align-items:center;gap:14px;padding:12px 20px;border-bottom:1px solid var(--border);font-size:13px; }
  .up-hist-row:last-child { border-bottom:none; }
  .up-hist-src { font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;padding:3px 8px;border-radius:20px;white-space:nowrap; }
  .up-hist-src.santander { background:#e8f0ed;color:var(--accent); }
  .up-hist-src.amex { background:#fef3e2;color:#b45309; }
  .up-hist-src.hsbc { background:#e8eef8;color:#1a3a6b; }
  .up-hist-file { flex:1;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .up-hist-meta { font-size:11px;color:var(--text-muted);font-family:'DM Mono',monospace;white-space:nowrap; }
  .up-hist-del { background:none;border:none;color:var(--text-muted);cursor:pointer;padding:4px 8px;border-radius:6px;font-size:13px;transition:all .15s; }
  .up-hist-del:hover { background:#fdf0ef;color:var(--danger); }
  .up-saving-bar { display:none;align-items:center;gap:10px;padding:10px 16px;background:var(--accent-light);border-radius:8px;font-size:12px;color:var(--accent);margin-bottom:16px; }
  .up-saving-bar.show { display:flex; }
  .up-saving-dot { width:8px;height:8px;background:var(--accent);border-radius:50%;animation:bounce 1.2s infinite; }
  .fin-tabs { display:flex;gap:6px;flex-wrap:wrap;margin-bottom:22px; }
  .fin-tab { background:none;border:1px solid var(--border);border-radius:8px;color:var(--text-muted);padding:7px 16px;cursor:pointer;font-family:'DM Mono',monospace;font-size:11px;letter-spacing:.1em;text-transform:uppercase;transition:all .18s ease; }
  .fin-tab.on { border-color:var(--accent);color:var(--accent);background:var(--accent-light);font-weight:500; }
  .fin-kpis { display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:22px; }
  @media(max-width:900px){ .fin-kpis{ grid-template-columns:repeat(3,1fr); } }
  @media(max-width:580px){ .fin-kpis{ grid-template-columns:repeat(2,1fr); } }
  .fin-kpi { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px; }
  .fk-lbl { font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--text-muted);margin-bottom:6px;font-weight:500; }
  .fk-val { font-family:'DM Serif Display',serif;font-size:26px;line-height:1;margin-bottom:3px; }
  .fk-sub { font-size:11px;color:var(--text-muted);font-family:'DM Mono',monospace; }
  .fin-subpage { display:none; }
  .fin-subpage.on { display:block; }
  .fin-tx { display:flex;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--border);font-size:12px; }
  .fin-tx:last-child { border-bottom:none; }
  .fin-tx .ft-d { font-family:'DM Mono',monospace;font-size:10px;color:var(--text-muted);flex-shrink:0;width:38px; }
  .fin-tx .ft-desc { flex:1;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .fin-tx .ft-amt { font-family:'DM Mono',monospace;font-size:12px;font-weight:500;flex-shrink:0; }
  .ft-pos { color:#16a34a; }
  .ft-neg { color:#dc2626; }
  .fin-scroll { max-height:320px;overflow-y:auto; }
  .fin-insight { background:var(--surface2);border-left:3px solid var(--accent);padding:10px 14px;margin-bottom:8px;border-radius:0 8px 8px 0; }
  .fin-insight.warn { border-left-color:#f59e0b; }
  .fin-insight .fi-t { font-size:12px;font-weight:600;color:var(--accent);margin-bottom:2px; }
  .fin-insight.warn .fi-t { color:#b45309; }
  .fin-insight .fi-d { font-size:11px;color:var(--text-muted);line-height:1.55; }
  .fin-dot { width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:5px;vertical-align:middle;flex-shrink:0; }
  .fin-bill-row { margin-bottom:10px; }
  .fin-bill-top { display:flex;justify-content:space-between;font-size:12px;margin-bottom:4px; }
  .fin-bar-bg { height:4px;background:var(--border);border-radius:2px; }
  .fin-bar-fill { height:4px;border-radius:2px;transition:width .6s ease; }
  .fin-total-row { display:flex;justify-content:space-between;font-size:13px;font-weight:600; }
  .fin-filter-bar { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:20px;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px 16px; }
  .fin-filter-lbl { font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.08em;font-weight:500; }
  .fin-filter-btn { background:none;border:1px solid var(--border);border-radius:6px;padding:5px 12px;font-family:'DM Mono',monospace;font-size:11px;color:var(--text-muted);cursor:pointer;transition:all .15s; }
  .fin-filter-btn.on { border-color:var(--accent);color:var(--accent);background:var(--accent-light); }
  .fin-filter-sep { width:1px;height:18px;background:var(--border); }
  .fin-month-sel { font-family:'DM Mono',monospace;font-size:11px;border:1px solid var(--border);border-radius:6px;padding:5px 10px;background:var(--surface);color:var(--text);cursor:pointer; }
  canvas { display:block; }

  /* ── INVESTMENT STYLES ── */
  .inv-platform-badge { display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;padding:3px 9px;border-radius:20px;white-space:nowrap; }
  .inv-kpis { display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:22px; }
  @media(max-width:900px){ .inv-kpis{ grid-template-columns:repeat(2,1fr); } }
  .inv-kpi { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px; }
  .ik-lbl { font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:var(--text-muted);margin-bottom:6px;font-weight:500; }
  .ik-val { font-family:'DM Serif Display',serif;font-size:28px;line-height:1;margin-bottom:3px; }
  .ik-sub { font-size:11px;color:var(--text-muted);font-family:'DM Mono',monospace; }
  .ik-change { font-size:11px;font-family:'DM Mono',monospace;margin-top:4px; }
  .ik-pos { color:#16a34a; } .ik-neg { color:#dc2626; }
  .inv-tabs { display:flex;gap:6px;flex-wrap:wrap;margin-bottom:22px; }
  .inv-tab { background:none;border:1px solid var(--border);border-radius:8px;color:var(--text-muted);padding:7px 16px;cursor:pointer;font-family:'DM Mono',monospace;font-size:11px;letter-spacing:.1em;text-transform:uppercase;transition:all .18s ease; }
  .inv-tab.on { border-color:var(--accent);color:var(--accent);background:var(--accent-light);font-weight:500; }
  .inv-subpage { display:none; }
  .inv-subpage.on { display:block; }
  .inv-platform-switcher { display:flex;gap:6px;flex-wrap:wrap;margin-bottom:20px;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:10px 14px;align-items:center; }
  .inv-plat-lbl { font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.08em;font-weight:500;margin-right:4px; }
  .inv-plat-btn { background:none;border:1px solid var(--border);border-radius:6px;padding:5px 12px;font-family:'DM Mono',monospace;font-size:11px;color:var(--text-muted);cursor:pointer;transition:all .15s;font-weight:500; }
  .inv-plat-btn.on { color:white;border-color:transparent;background:var(--accent); }
  .inv-plat-btn.all { }
  .holdings-table { width:100%;border-collapse:collapse;font-size:12px; }
  .holdings-table th { font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);font-weight:500;padding:8px 10px;border-bottom:1px solid var(--border);text-align:left; }
  .holdings-table td { padding:9px 10px;border-bottom:1px solid var(--border);color:var(--text); }
  .holdings-table tr:last-child td { border-bottom:none; }
  .holdings-table tr:hover td { background:var(--surface2); }
  .holdings-table .num { text-align:right;font-family:'DM Mono',monospace; }
  .h-asset { font-weight:500;color:var(--text); }
  .h-ticker { font-size:10px;color:var(--text-muted);font-family:'DM Mono',monospace; }
  .h-class-badge { font-size:9px;padding:2px 6px;border-radius:20px;background:var(--surface2);color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em; }
  .inv-snap-form { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:24px;margin-bottom:20px; }
  .inv-snap-title { font-family:'DM Serif Display',serif;font-size:18px;margin-bottom:18px;color:var(--text); }
  .inv-form-row { display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px; }
  .inv-form-row3 { display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;margin-bottom:14px; }
  @media(max-width:680px){ .inv-form-row,.inv-form-row3 { grid-template-columns:1fr; } }
  .inv-field-label { display:block;font-size:11px;font-weight:500;color:var(--text-muted);text-transform:uppercase;letter-spacing:.08em;margin-bottom:6px; }
  .inv-field-input { width:100%;padding:10px 13px;border:1px solid var(--border);border-radius:8px;font-family:'DM Sans',sans-serif;font-size:13px;background:var(--bg);color:var(--text);outline:none;transition:border-color .15s; }
  .inv-field-input:focus { border-color:var(--accent);background:var(--surface); }
  .inv-field-select { width:100%;padding:10px 13px;border:1px solid var(--border);border-radius:8px;font-family:'DM Mono',monospace;font-size:12px;background:var(--bg);color:var(--text);outline:none;cursor:pointer; }
  .holdings-entry { background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:16px;margin-bottom:10px; }
  .holdings-entry-hdr { display:flex;align-items:center;justify-content:space-between;margin-bottom:12px; }
  .btn-add-holding { background:none;border:1px dashed var(--border);border-radius:8px;padding:10px;width:100%;font-family:'DM Sans',sans-serif;font-size:13px;color:var(--text-muted);cursor:pointer;transition:all .15s;margin-bottom:14px; }
  .btn-add-holding:hover { border-color:var(--accent);color:var(--accent);background:var(--accent-light); }
  .btn-remove-holding { background:none;border:none;color:var(--text-muted);cursor:pointer;padding:4px 6px;border-radius:4px;font-size:14px; }
  .btn-remove-holding:hover { color:var(--danger);background:#fdf0ef; }
  .inv-save-btn { background:var(--accent);color:white;border:none;border-radius:8px;padding:11px 24px;font-family:'DM Sans',sans-serif;font-size:13px;font-weight:500;cursor:pointer;transition:all .15s; }
  .inv-save-btn:hover { background:#1e3329;transform:translateY(-1px); }
  .inv-save-btn:disabled { opacity:.45;cursor:not-allowed;transform:none; }
  .inv-snap-history { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;margin-top:20px; }
  .inv-snap-hist-row { display:flex;align-items:center;gap:12px;padding:11px 18px;border-bottom:1px solid var(--border);font-size:12px;cursor:pointer;transition:background .12s; }
  .inv-snap-hist-row:last-child { border-bottom:none; }
  .inv-snap-hist-row:hover { background:var(--surface2); }
  .inv-snap-date { font-family:'DM Mono',monospace;font-size:11px;color:var(--text-muted);white-space:nowrap;width:80px; }
  .inv-snap-plat { flex:1;font-weight:500; }
  .inv-snap-val { font-family:'DM Serif Display',serif;font-size:16px;color:var(--accent); }
  .inv-snap-delta { font-size:11px;font-family:'DM Mono',monospace; }
  .inv-snap-del { background:none;border:none;color:var(--text-muted);cursor:pointer;padding:4px 8px;border-radius:6px; }
  .inv-snap-del:hover { background:#fdf0ef;color:var(--danger); }
  .platform-mgmt { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px; }
  .platform-row { display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border); }
  .platform-row:last-child { border-bottom:none; }
  .platform-color-dot { width:12px;height:12px;border-radius:50%;flex-shrink:0; }
  .platform-name { flex:1;font-weight:500;font-size:13px; }
  .platform-type-badge { font-size:9px;text-transform:uppercase;letter-spacing:.08em;padding:2px 7px;border-radius:20px;background:var(--surface2);color:var(--text-muted); }
  .btn-small-danger { background:none;border:1px solid var(--border);border-radius:6px;padding:4px 10px;font-family:'DM Sans',sans-serif;font-size:11px;color:var(--text-muted);cursor:pointer;transition:all .12s; }
  .btn-small-danger:hover { border-color:var(--danger);color:var(--danger); }
  .btn-small-accent { background:none;border:1px solid var(--accent);border-radius:6px;padding:4px 10px;font-family:'DM Sans',sans-serif;font-size:11px;color:var(--accent);cursor:pointer;transition:all .12s; }
  .btn-small-accent:hover { background:var(--accent);color:white; }

  /* MFA */
  .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; display: none; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* SEARCH */
  .search-overlay { position: fixed; inset: 0; background: rgba(26,25,22,0.5); backdrop-filter: blur(4px); z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  .search-overlay.open { opacity: 1; pointer-events: all; }
  .search-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 620px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.2); transform: translateY(-10px); transition: transform 0.2s ease; overflow: hidden; }
  .search-overlay.open .search-box { transform: translateY(0); }
  .search-input-wrap { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
  .search-icon { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }
  .search-input-field { flex: 1; border: none; outline: none; font-family: 'DM Sans', sans-serif; font-size: 16px; background: none; color: var(--text); }
  .search-input-field::placeholder { color: var(--text-muted); }
  .search-kbd { font-size: 11px; color: var(--text-muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; font-family: 'DM Mono', monospace; cursor: pointer; }
  .search-results { max-height: 420px; overflow-y: auto; padding: 8px; }
  .search-section-label { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 8px 10px 4px; }
  .search-result { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background var(--transition); }
  .search-result:hover, .search-result.selected { background: var(--surface2); }
  .search-result-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
  .search-result.selected .search-result-icon { background: var(--accent-light); }
  .search-result-title { font-size: 13.5px; color: var(--text); font-weight: 500; }
  .search-result-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
  .search-result-type { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
  .search-highlight { background: rgba(44,74,62,0.15); color: var(--accent); border-radius: 2px; padding: 0 1px; }
  .search-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px; }
  .search-footer { padding: 10px 20px; border-top: 1px solid var(--border); display: flex; gap: 16px; font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }


  /* ---------- mobile responsive ---------- */
  .nav-toggle { display:none; background:none; border:none; font-size:20px; color:var(--accent); cursor:pointer; padding:4px 8px; line-height:1; }
  .nav-backdrop { display:none; }
  @media (max-width: 760px) {
    .nav-toggle { display:inline-flex; }
    .app-body { grid-template-columns: 1fr; }
    .sidebar {
      position: fixed; top: 58px; left: 0; bottom: 0; width: 250px; max-width: 82vw;
      transform: translateX(-100%); transition: transform .25s ease; z-index: 130;
      box-shadow: 2px 0 18px rgba(0,0,0,.14);
    }
    body.nav-open .sidebar { transform: none; }
    .nav-backdrop { display: block; position: fixed; inset: 58px 0 0 0; background: rgba(0,0,0,.38); z-index: 120; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
    .main { padding: 18px 14px; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-time { display: none; }
    .topbar-user { max-width: 36vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-logo { font-size: 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }
    .modal { width: 94vw; padding: 22px; }
    .page-title { font-size: 26px; }
  }
  @media (max-width: 440px) {
    .stats-grid { grid-template-columns: 1fr; }
  }
