:root {
    /* ── Anchor Brand Palette — Dark (default) ── */
    --anchor-bg:        #061019;
    --anchor-surface:   #10171F;
    --anchor-surface-2: #17212B;
    --anchor-border:    #2a3a4a;
    --anchor-text:      #e7e9ea;
    --anchor-text-muted:#6b7280;
    --anchor-text-dim:  #9ca3af;
    --anchor-gold:      #D7C6A3;
    --anchor-copper:    #CD9C7A;
    --anchor-coral:     #E9614B;
    --anchor-navy:      #1E496D;
    --anchor-teal:      #0074AF;
    --anchor-horizon:   #00578D;
    --anchor-bay:       #6F93B0;
}

/* R-03: hover styles migrated from inline onmouseenter/onmouseleave so 'unsafe-inline' can be dropped from the CSP. Use the theme-aware vars so light/dark both work. */
.hover-gold-border:hover { border-color: var(--anchor-gold) !important; }
.hover-surface2:hover    { background: var(--anchor-surface-2) !important; }

/* ── Light Theme ── */
[data-theme="light"] {
    --anchor-bg:        #F4F1EC;
    --anchor-surface:   #FFFFFF;
    --anchor-surface-2: #EDE9E3;
    --anchor-border:    #D4CFC6;
    --anchor-text:      #1A2332;
    --anchor-text-muted:#6B7280;
    --anchor-text-dim:  #4B5563;
    --anchor-gold:      #B5975A;
    --anchor-copper:    #A67D5A;
    --anchor-coral:     #D4453A;
    --anchor-navy:      #163C63;
    --anchor-teal:      #0074AF;
    --anchor-horizon:   #00578D;
    --anchor-bay:       #4A7A9A;
}

/* Light theme button adjustments */
[data-theme="light"] .btn-primary {
    color: #FFFFFF;
}
[data-theme="light"] .btn-secondary {
    background: #EDE9E3;
    border-color: #D4CFC6;
    color: #1A2332;
}
[data-theme="light"] .user-avatar,
[data-theme="light"] .client-avatar,
[data-theme="light"] .profile-avatar {
    color: #FFFFFF;
}
[data-theme="light"] .auth-tab.active {
    color: #FFFFFF;
}
[data-theme="light"] .message.user {
    color: #FFFFFF;
}
[data-theme="light"] .auth-btn {
    color: #FFFFFF;
}
[data-theme="light"] .chat-widget-fab {
    color: #FFFFFF;
}
/* Light sidebar */
[data-theme="light"] .sidebar {
    background: #0a1929;
    border-right-color: #061019;
}
[data-theme="light"] .sidebar-header {
    border-bottom-color: rgba(255,255,255,0.12);
}
[data-theme="light"] .sidebar-logo h2 {
    color: #FFFFFF;
}
[data-theme="light"] .sidebar-logo img {
    mix-blend-mode: normal;
    filter: brightness(10);
}
[data-theme="light"] .nav-section-title {
    color: rgba(255,255,255,0.45);
}
[data-theme="light"] .nav-item {
    color: rgba(255,255,255,0.65);
}
[data-theme="light"] .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #FFFFFF;
}
[data-theme="light"] .nav-item.active {
    background: rgba(215,198,163,0.15);
    color: var(--anchor-gold);
}
[data-theme="light"] .sidebar-footer {
    border-top-color: rgba(255,255,255,0.12);
}
[data-theme="light"] .user-info {
    background: rgba(255,255,255,0.08);
}
[data-theme="light"] .user-info:hover {
    border-color: var(--anchor-gold);
}
[data-theme="light"] .user-name {
    color: #FFFFFF;
}
[data-theme="light"] .user-role {
    color: rgba(255,255,255,0.55);
}
[data-theme="light"] .logout-btn {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
}
[data-theme="light"] .logout-btn:hover {
    color: var(--anchor-coral);
    border-color: var(--anchor-coral);
}
/* Light stat card text */
[data-theme="light"] .stat-card { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
[data-theme="light"] .stock-card,
[data-theme="light"] .client-card { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
/* Theme toggle button */
.theme-toggle {
    width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--anchor-border);
    background: var(--anchor-surface-2); color: var(--anchor-text); cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--anchor-gold); }

/* ── Light theme: override inline-styled elements ── */
/* Sections with inline #10171F background */
[data-theme="light"] [style*="background:#10171F"],
[data-theme="light"] [style*="background: #10171F"] {
    background: #FFFFFF !important;
    border-color: #D4CFC6 !important;
}
/* Sections with inline #2a3a4a borders */
[data-theme="light"] [style*="border:1px solid #2a3a4a"],
[data-theme="light"] [style*="border: 1px solid #2a3a4a"] {
    border-color: #D4CFC6 !important;
}
/* Inline text colors */
[data-theme="light"] [style*="color:#e7e9ea"],
[data-theme="light"] [style*="color: #e7e9ea"] {
    color: #1A2332 !important;
}
[data-theme="light"] [style*="color:#D7C6A3"],
[data-theme="light"] [style*="color: #D7C6A3"] {
    color: #B5975A !important;
}
[data-theme="light"] [style*="color:#9ca3af"],
[data-theme="light"] [style*="color: #9ca3af"] {
    color: #4B5563 !important;
}
[data-theme="light"] [style*="color:#6b7280"],
[data-theme="light"] [style*="color: #6b7280"] {
    color: #6B7280 !important;
}
[data-theme="light"] [style*="color:#8899AA"],
[data-theme="light"] [style*="color: #8899AA"] {
    color: #4B5563 !important;
}
/* Landing page — white in light mode */
[data-theme="light"] .landing-page {
    background: #FFFFFF !important;
    color: #1A2332 !important;
}
[data-theme="light"] .landing-hero h2 {
    color: #1A2332 !important;
}
[data-theme="light"] .landing-hero p,
[data-theme="light"] .landing-page .landing-hero p {
    color: #6B7280 !important;
}
[data-theme="light"] .landing-actions { border-color: #D4CFC6 !important; }
[data-theme="light"] .landing-action-btn {
    background: #FFFFFF !important;
    border-color: #D4CFC6 !important;
    color: #1A2332 !important;
}
[data-theme="light"] .landing-action-btn:hover {
    border-color: var(--anchor-gold) !important;
    background: #F4F1EC !important;
}
[data-theme="light"] .landing-page input[type="text"],
[data-theme="light"] .landing-page .form-input {
    background: #FFFFFF !important;
    border-color: #D4CFC6 !important;
    color: #1A2332 !important;
}
[data-theme="light"] .landing-page .form-input::placeholder {
    color: #9CA3AF !important;
}
[data-theme="light"] .landing-greeting {
    color: #6B7280 !important;
}
[data-theme="light"] .landing-title {
    color: #1A2332 !important;
}
[data-theme="light"] .landing-chat-input-wrapper {
    background: #FFFFFF !important;
    border-color: #D4CFC6 !important;
}
[data-theme="light"] .landing-chat-input {
    color: #1A2332 !important;
}
[data-theme="light"] .landing-chat-input::placeholder {
    color: #9CA3AF !important;
}
[data-theme="light"] .landing-chat-btn {
    background: #F4F1EC !important;
    color: #6B7280 !important;
}
[data-theme="light"] .landing-chat-btn:hover {
    background: var(--anchor-gold) !important;
    color: #FFFFFF !important;
}
[data-theme="light"] .landing-attach-btn {
    color: #6B7280 !important;
}
[data-theme="light"] .landing-page [style*="background:#2a3a4a"] {
    background: #D4CFC6 !important;
}
[data-theme="light"] .landing-branding img {
    filter: brightness(0.2) !important;
}
/* Chart Y-axis prompt modal */
[data-theme="light"] #chartYAxisPrompt > div {
    background: #FFFFFF !important;
    border-color: #D4CFC6 !important;
}
/* Form select dropdowns */
[data-theme="light"] select.form-input option {
    background: #FFFFFF;
    color: #1A2332;
}
/* Toast */
[data-theme="light"] .toast {
    background: #1A2332 !important;
    color: #FFFFFF !important;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--anchor-bg); color: var(--anchor-text); min-height: 100vh; }
        .auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--anchor-bg) 0%, var(--anchor-surface-2) 50%, var(--anchor-bg) 100%); }
        .auth-card { background: var(--anchor-surface); border-radius: 20px; padding: 48px; width: 100%; max-width: 440px; border: 1px solid var(--anchor-border); }
        .auth-logo { text-align: center; margin-bottom: 32px; }
        .auth-logo-icon { font-size: 48px; margin-bottom: 12px; }
        .auth-logo h1 { font-size: 28px; font-weight: 700; background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
        .auth-logo p { color: var(--anchor-text-muted); font-size: 14px; margin-top: 8px; }
        .auth-tabs { display: flex; margin-bottom: 32px; background: var(--anchor-surface-2); border-radius: 12px; padding: 4px; }
        .auth-tab { flex: 1; padding: 12px; background: transparent; border: none; color: var(--anchor-text-muted); font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 8px; }
        .auth-tab.active { background: var(--anchor-gold); color: var(--anchor-bg); }
        .auth-form { display: none; } .auth-form.active { display: block; }
        .form-group { margin-bottom: 20px; }
        .form-label { display: block; font-size: 13px; color: var(--anchor-text-dim); margin-bottom: 8px; }
        .form-input { width: 100%; padding: 14px 16px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 10px; color: var(--anchor-text); font-size: 15px; }
        .form-input:focus { outline: none; border-color: var(--anchor-gold); }
        .auth-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); border: none; border-radius: 10px; color: var(--anchor-bg); font-size: 15px; font-weight: 600; cursor: pointer; }
        .auth-error { background: rgba(233,97,75,0.1); border: 1px solid var(--anchor-coral); color: var(--anchor-coral); padding: 12px; border-radius: 8px; font-size: 13px; margin-bottom: 20px; display: none; }
        .auth-error.show { display: block; }
        .app-container { display: none; } .app-container.active { display: flex; height: 100vh; }
        .sidebar { width: 260px; background: var(--anchor-surface-2); border-right: 1px solid var(--anchor-border); display: flex; flex-direction: column; transition: width 0.25s ease; }
        .sidebar-header { padding: 24px; border-bottom: 1px solid var(--anchor-border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .sidebar-logo { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
        .sidebar-logo-icon { font-size: 28px; }
        .sidebar-logo h2 { font-size: 13px; font-weight: 600; letter-spacing: 2px; color: var(--anchor-text); text-transform: uppercase; line-height: 1.4; }
        .sidebar-logo { cursor: pointer; }
        .sidebar-logo:hover { opacity: 0.8; transition: opacity 0.2s; }
        .sidebar-logo-img, .sidebar-logo img { width: 160px; height: auto; max-height: 40px; object-fit: contain; flex-shrink: 0; transition: width 0.25s ease, opacity 0.15s ease; }
        .sidebar-collapse-toggle { width: 28px; height: 28px; padding: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--anchor-text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s, border-color 0.15s, color 0.15s; }
        .sidebar-collapse-toggle:hover { background: var(--anchor-surface); border-color: var(--anchor-border); color: var(--anchor-text); }
        .sidebar-collapse-toggle svg { width: 16px; height: 16px; }
        .sidebar-collapse-toggle .sb-expand-icon { display: none; }
        .sidebar-nav { flex: 1; padding: 16px 12px; overflow-x: hidden; }
        .nav-section { margin-bottom: 24px; }
        .nav-section-title { font-size: 11px; color: var(--anchor-text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 0 12px; margin-bottom: 8px; transition: opacity 0.15s ease; }
        .nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--anchor-text-dim); border-radius: 10px; cursor: pointer; font-size: 14px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; transition: background 0.15s, color 0.15s; }
        .nav-item:hover { background: var(--anchor-surface-2); color: var(--anchor-text); }
        .nav-item.active { background: rgba(215,198,163,0.1); color: var(--anchor-gold); }
        .nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
        .nav-icon svg { width: 20px; height: 20px; }
        .sidebar-footer { padding: 16px; border-top: 1px solid var(--anchor-border); transition: padding 0.25s ease; }

        /* ─── Sidebar collapsed state (Claude-style icon-only rail) ─── */
        .sidebar.collapsed { width: 64px; }
        .sidebar.collapsed .sidebar-header { padding: 18px 8px; flex-direction: column; gap: 8px; }
        .sidebar.collapsed .sidebar-logo { justify-content: center; }
        .sidebar.collapsed .sidebar-logo-img,
        .sidebar.collapsed .sidebar-logo img { width: 32px; max-height: 32px; }
        .sidebar.collapsed .sidebar-collapse-toggle .sb-collapse-icon { display: none; }
        .sidebar.collapsed .sidebar-collapse-toggle .sb-expand-icon { display: block; }
        .sidebar.collapsed .sidebar-nav { padding: 16px 8px; }
        .sidebar.collapsed .nav-section-title { opacity: 0; height: 0; margin: 0; padding: 0; pointer-events: none; }
        .sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; gap: 0; position: relative; }
        .sidebar.collapsed .nav-item > span:not(.nav-icon) { display: none; }
        .sidebar.collapsed .nav-item:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            left: calc(100% + 12px);
            top: 50%;
            transform: translateY(-50%);
            background: var(--anchor-surface);
            color: var(--anchor-text);
            border: 1px solid var(--anchor-border);
            border-radius: 6px;
            padding: 6px 10px;
            font-size: 12px;
            white-space: nowrap;
            z-index: 200;
            pointer-events: none;
            box-shadow: 0 4px 12px rgba(0,0,0,0.25);
        }
        .sidebar.collapsed .sidebar-footer { padding: 12px 8px; }
        .sidebar.collapsed .user-info { padding: 6px; justify-content: center; }
        .sidebar.collapsed .user-info .user-details,
        .sidebar.collapsed .user-info > span:last-child { display: none; }
        .sidebar.collapsed .logout-btn { font-size: 0; padding: 10px 0; }
        .sidebar.collapsed .logout-btn::before {
            content: '';
            display: inline-block;
            width: 16px; height: 16px;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16 17 21 12 16 7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>");
            background-repeat: no-repeat;
            background-position: center;
        }

        /* ─── Theme toggle dual-icon swap (moon shows in dark, sun in light) ─── */
        .theme-toggle { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 6px; cursor: pointer; color: var(--anchor-text-dim); display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s, border-color 0.15s, color 0.15s; }
        .theme-toggle:hover { background: var(--anchor-surface-2); border-color: var(--anchor-border); color: var(--anchor-text); }
        .theme-toggle svg { width: 18px; height: 18px; }
        .theme-toggle .theme-icon-sun { display: none; }
        [data-theme="light"] .theme-toggle .theme-icon-moon { display: none; }
        [data-theme="light"] .theme-toggle .theme-icon-sun { display: block; }

        /* ─── Top-bar menu toggle (mobile hamburger) ─── */
        .menu-toggle { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 6px; cursor: pointer; color: var(--anchor-text-dim); display: none; align-items: center; justify-content: center; }
        .menu-toggle:hover { background: var(--anchor-surface-2); border-color: var(--anchor-border); color: var(--anchor-text); }
        .menu-toggle svg { width: 20px; height: 20px; }
        .user-info { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--anchor-surface-2); border-radius: 10px; margin-bottom: 12px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; }
        .user-info:hover { border-color: var(--anchor-gold); }
        .user-avatar { width: 40px; height: 40px; background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--anchor-bg); }
        .user-name { font-size: 14px; font-weight: 600; }
        .user-role { font-size: 12px; color: var(--anchor-text-muted); }
        .logout-btn { width: 100%; padding: 10px; background: transparent; border: 1px solid var(--anchor-border); border-radius: 8px; color: var(--anchor-text-dim); font-size: 13px; cursor: pointer; }
        .logout-btn:hover { color: var(--anchor-coral); border-color: var(--anchor-coral); }
        .main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
        .top-bar { padding: 16px 24px; background: var(--anchor-surface); border-bottom: 1px solid var(--anchor-border); display: flex; justify-content: space-between; align-items: center; }
        .page-title { font-size: 20px; font-weight: 600; }
        .content-area { flex: 1; padding: 24px; overflow-y: auto; background: var(--anchor-bg); }
        .page-section { display: none; } .page-section.active { display: block; }
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
        .stat-card { background: var(--anchor-surface); border-radius: 16px; padding: 20px; border: 1px solid var(--anchor-border); }
        .stat-icon { width: 44px; height: 44px; background: rgba(215,198,163,0.1); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; }
        .stat-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
        .stat-label { color: var(--anchor-text-muted); font-size: 13px; }
        .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
        .section-title { font-size: 18px; font-weight: 600; }
        .btn { padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; }
        .btn-primary { background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); color: var(--anchor-bg); }
        .btn-secondary { background: var(--anchor-surface-2); color: var(--anchor-text); border: 1px solid var(--anchor-border); }
        .btn-danger { background: rgba(233,97,75,0.1); color: var(--anchor-coral); border: 1px solid var(--anchor-coral); }
        .btn-sm { padding: 6px 12px; font-size: 12px; }
        .clients-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
        .client-card { background: var(--anchor-surface); border-radius: 14px; padding: 20px; border: 1px solid var(--anchor-border); transition: all 0.2s; }
        .client-card { cursor: pointer; } .client-card:hover { border-color: var(--anchor-gold); transform: translateY(-2px); }
        .stock-header, .client-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
        .client-header { align-items: center; gap: 16px; }
        .stock-symbol { font-size: 18px; font-weight: 700; }
        .stock-name, .client-email { font-size: 13px; color: var(--anchor-text-muted); }
        .stock-logo { width: 40px; height: 40px; border-radius: 10px; background: #fff; }
        .client-avatar { width: 56px; height: 56px; background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--anchor-bg); }
        .client-name { font-size: 18px; font-weight: 600; }
        .stock-price { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
        .stock-change { display: inline-flex; padding: 4px 10px; border-radius: 6px; font-size: 14px; font-weight: 600; }
        .stock-change.positive { background: rgba(215,198,163,0.15); color: var(--anchor-gold); }
        .stock-change.negative { background: rgba(233,97,75,0.15); color: var(--anchor-coral); }
        .stock-details, .client-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--anchor-border); }
        .client-stats { grid-template-columns: repeat(3, 1fr); text-align: center; }
        .stock-detail-label, .client-stat-label { color: var(--anchor-text-muted); font-size: 12px; }
        .stock-detail-value { font-weight: 600; }
        .client-stat-value { font-size: 16px; font-weight: 700; color: var(--anchor-gold); }
        .empty-state { text-align: center; padding: 60px 20px; color: var(--anchor-text-muted); }
        .empty-state-icon { font-size: 48px; margin-bottom: 16px; }
        .empty-state-title { font-size: 18px; margin-bottom: 8px; color: var(--anchor-text-dim); }
        .profile-header { background: var(--anchor-surface); border-radius: 16px; padding: 28px; border: 1px solid var(--anchor-border); margin-bottom: 24px; }
        .profile-header-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
        .profile-info { display: flex; align-items: center; gap: 20px; }
        .profile-avatar { width: 80px; height: 80px; background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--anchor-bg); }
        .profile-name { font-size: 24px; font-weight: 700; }
        .profile-email { color: var(--anchor-text-muted); }
        .profile-actions { display: flex; gap: 12px; }
        .profile-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
        .profile-detail-label { font-size: 12px; color: var(--anchor-text-muted); margin-bottom: 4px; }
        .profile-detail-value { font-size: 14px; font-weight: 500; }
        .profile-tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--anchor-border); padding-bottom: 12px; }
        .profile-tab { padding: 10px 20px; background: transparent; border: none; color: var(--anchor-text-muted); font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 8px; }
        .profile-tab.active { background: rgba(215,198,163,0.1); color: var(--anchor-gold); }
        .profile-tab-content { display: none; } .profile-tab-content.active { display: block; }
        .metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
        .metric-card { background: var(--anchor-surface); border-radius: 12px; padding: 20px; border: 1px solid var(--anchor-border); }
        .metric-label { color: var(--anchor-text-muted); font-size: 13px; margin-bottom: 8px; }
        .metric-value { font-size: 26px; font-weight: 700; }
        .metric-change { font-size: 13px; margin-top: 8px; }
        .metric-change.positive { color: var(--anchor-gold); }
        .metric-change.negative { color: var(--anchor-coral); }
        .charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; margin-bottom: 24px; }
        .chart-card { background: var(--anchor-surface); border-radius: 16px; padding: 24px; border: 1px solid var(--anchor-border); }
        .chart-card.full-width { grid-column: 1 / -1; }
        .chart-card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
        .chart-canvas-container { position: relative; height: 280px; }
        .holdings-table { width: 100%; border-collapse: collapse; }
        .holdings-table th, .holdings-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--anchor-border); }
        .holdings-table th { color: var(--anchor-text-muted); font-size: 11px; text-transform: uppercase; font-weight: 600; }
        .holdings-table tr:hover { background: var(--anchor-surface-2); }
        .holdings-ticker { font-weight: 600; color: var(--anchor-gold); }
        .commentary-section { background: var(--anchor-surface); border-radius: 16px; padding: 24px; border: 1px solid var(--anchor-border); margin-bottom: 24px; }
        .commentary-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
        .commentary-text { color: var(--anchor-text-dim); line-height: 1.7; font-size: 14px; }
        .chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 9999; font-family: 'Lato', Arial, sans-serif; }
        .chat-widget-fab { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #D7C6A3 0%, #CD9C7A 100%); border: none; color: #0B1622; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0,0,0,0.4); transition: transform 0.2s, box-shadow 0.2s; position: absolute; bottom: 0; right: 0; }
        .chat-widget-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,0.5); }
        .chat-widget-panel { position: absolute; bottom: 72px; right: 0; width: 400px; height: 560px; background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); display: none; flex-direction: column; overflow: hidden; animation: chatSlideUp 0.25s ease-out; }
        .chat-widget-panel.open { display: flex; }
        @keyframes chatSlideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
        .chat-widget-header { padding: 16px 16px 12px; border-bottom: 1px solid var(--anchor-border); display: flex; justify-content: space-between; align-items: center; }
        .chat-widget-footer { padding: 12px; border-top: 1px solid var(--anchor-border); }
        .chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
        .message { padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; max-width: 90%; }
        .message.user { background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); color: var(--anchor-bg); align-self: flex-end; }
        .message.assistant { background: var(--anchor-surface-2); color: var(--anchor-text); align-self: flex-start; }
        .message.assistant.portfolio-response { max-width: 100%; background: transparent; padding: 0; }
        .message.typing { color: var(--anchor-text-muted); font-style: italic; }
        .message-chart { align-self: flex-start; width: 100%; }
        .chart-container { background: var(--anchor-surface-2); border-radius: 12px; padding: 16px; border: 1px solid var(--anchor-border); }
        .chart-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; text-align: center; }
        .chart-canvas-wrapper { height: 260px; position: relative; }
        .chart-description { font-size: 12px; color: var(--anchor-text-muted); margin-top: 12px; }
        .chat-input-area { padding: 16px; border-top: 1px solid var(--anchor-border); }
        .quick-prompts { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
        .quick-prompt { padding: 6px 12px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 16px; color: var(--anchor-text); font-size: 12px; cursor: pointer; }
        .quick-prompt:hover { border-color: var(--anchor-gold); color: var(--anchor-gold); }
        /* Guided Flow Styles */
        .guided-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
        .guided-choice { padding: 10px 16px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 12px; color: var(--anchor-text); font-size: 13px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px; font-weight: 500; }
        .guided-choice:hover { border-color: var(--anchor-gold); color: var(--anchor-gold); background: rgba(215,198,163,0.08); }
        .guided-choice.disabled { pointer-events: none; opacity: 0.45; }
        .guided-choice.selected { border-color: var(--anchor-gold); color: var(--anchor-gold); background: rgba(215,198,163,0.12); }
        .guided-input-wrapper { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
        .guided-input { flex: 1; padding: 10px 14px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 10px; color: var(--anchor-text); font-size: 13px; font-family: inherit; }
        .guided-input:focus { outline: none; border-color: var(--anchor-gold); }
        .guided-submit { padding: 10px 18px; background: linear-gradient(135deg, #D7C6A3 0%, #CD9C7A 100%); border: none; border-radius: 10px; color: #0B1622; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; }
        .guided-submit:hover { opacity: 0.9; }
        .guided-nav { display: flex; gap: 8px; margin-top: 10px; }
        .guided-back { padding: 6px 14px; background: none; border: 1px solid var(--anchor-border); border-radius: 10px; color: var(--anchor-text-muted); font-size: 12px; cursor: pointer; font-family: inherit; }
        .guided-back:hover { border-color: var(--anchor-text-muted); color: var(--anchor-text); }
        .guided-step-label { font-size: 11px; color: var(--anchor-text-muted); margin-bottom: 6px; }
        .guided-welcome { font-size: 14px; line-height: 1.6; }
        .guided-welcome b { color: var(--anchor-gold); }
        /* Watchlist Styles */
        .watchlist-card { background: var(--anchor-surface); border-radius: 14px; padding: 20px; border: 1px solid var(--anchor-border); transition: all 0.2s; }
        .watchlist-card:hover { border-color: var(--anchor-gold); }
        .watchlist-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
        .watchlist-title { font-size: 18px; font-weight: 600; }
        .watchlist-sector { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; margin-top: 6px; }
        .sector-technology { background: rgba(59,130,246,0.15); color: #3b82f6; }
        .sector-healthcare { background: rgba(16,185,129,0.15); color: #10b981; }
        .sector-finance { background: rgba(245,158,11,0.15); color: #F58555; }
        .sector-energy { background: rgba(233,97,75,0.15); color: var(--anchor-coral); }
        .sector-consumer { background: rgba(168,85,247,0.15); color: #a855f7; }
        .sector-industrial { background: rgba(107,114,128,0.15); color: var(--anchor-text-muted); }
        .sector-realestate { background: rgba(236,72,153,0.15); color: #ec4899; }
        .sector-utilities { background: rgba(20,184,166,0.15); color: #14b8a6; }
        .sector-materials { background: rgba(251,146,60,0.15); color: #fb923c; }
        .sector-etf { background: rgba(215,198,163,0.15); color: var(--anchor-gold); }
        .sector-mixed { background: rgba(139,92,246,0.15); color: #8b5cf6; }
        .watchlist-stocks { margin-top: 12px; }
        .watchlist-stock-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--anchor-surface-2); border-radius: 8px; margin-bottom: 8px; }
        .watchlist-stock-info { display: flex; align-items: center; gap: 12px; }
        .watchlist-stock-ticker { font-weight: 700; color: var(--anchor-gold); min-width: 60px; }
        .watchlist-stock-name { font-size: 13px; color: var(--anchor-text-dim); }
        .watchlist-stock-price { text-align: right; }
        .watchlist-stock-current { font-weight: 600; }
        .watchlist-stock-change { font-size: 12px; }
        .watchlist-stock-change.positive { color: var(--anchor-gold); }
        .watchlist-stock-change.negative { color: var(--anchor-coral); }
        .watchlist-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--anchor-border); }
        .watchlist-count { font-size: 13px; color: var(--anchor-text-muted); }
        .watchlist-empty { text-align: center; padding: 20px; color: var(--anchor-text-muted); font-size: 13px; }
        .stock-search-results { max-height: 200px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--anchor-border); border-radius: 8px; }
        .stock-search-item { padding: 10px 12px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--anchor-border); }
        .stock-search-item:last-child { border-bottom: none; }
        .stock-search-item:hover { background: var(--anchor-surface-2); }
        .remove-stock-btn { background: none; border: none; color: var(--anchor-coral); cursor: pointer; font-size: 16px; padding: 4px 8px; opacity: 0.7; }
        .remove-stock-btn:hover { opacity: 1; }
        /* Stock Detail Page */
        .stock-detail-header { background: var(--anchor-surface); border-radius: 16px; padding: 24px; border: 1px solid var(--anchor-border); margin-bottom: 20px; }
        .stock-header-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
        .stock-header-left { display: flex; align-items: center; gap: 16px; }
        .stock-logo { width: 64px; height: 64px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
        .stock-logo img { max-width: 100%; max-height: 100%; }
        .stock-logo-placeholder { width: 64px; height: 64px; border-radius: 12px; background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: var(--anchor-bg); }
        .stock-title-section h1 { font-size: 28px; font-weight: 700; margin: 0; }
        .stock-ticker-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
        .stock-ticker-badge span { font-size: 14px; color: var(--anchor-gold); font-weight: 600; }
        .stock-exchange { font-size: 12px; color: var(--anchor-text-muted); }
        .stock-industry { font-size: 13px; color: var(--anchor-text-dim); margin-top: 4px; }
        .stock-price-section { text-align: right; }
        .stock-current-price { font-size: 36px; font-weight: 700; }
        .stock-price-change { font-size: 16px; font-weight: 600; margin-top: 4px; }
        .stock-price-change.positive { color: var(--anchor-gold); }
        .stock-price-change.negative { color: var(--anchor-coral); }
        .stock-price-time { font-size: 11px; color: var(--anchor-text-muted); margin-top: 4px; }
        .stock-quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--anchor-border); }
        .stock-quick-stat { text-align: center; }
        .stock-quick-stat-value { font-size: 18px; font-weight: 700; }
        .stock-quick-stat-label { font-size: 11px; color: var(--anchor-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
        .stock-chart-card { background: var(--anchor-surface); border-radius: 16px; padding: 20px; border: 1px solid var(--anchor-border); margin-bottom: 20px; }
        .stock-chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
        .stock-chart-title { font-size: 16px; font-weight: 600; }
        .stock-period-btns { display: flex; gap: 6px; }
        .stock-period-btn { padding: 6px 14px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 6px; color: var(--anchor-text-dim); font-size: 12px; font-weight: 600; cursor: pointer; }
        .stock-period-btn:hover, .stock-period-btn.active { background: rgba(215,198,163,0.15); border-color: var(--anchor-gold); color: var(--anchor-gold); }
        .stock-chart-container { height: 300px; }
        .stock-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
        .stock-metrics-card { background: var(--anchor-surface); border-radius: 16px; padding: 20px; border: 1px solid var(--anchor-border); }
        .stock-metrics-card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
        .stock-metric-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--anchor-border); }
        .stock-metric-row:last-child { border-bottom: none; }
        .stock-metric-label { font-size: 13px; color: var(--anchor-text-dim); }
        .stock-metric-value { font-size: 13px; font-weight: 600; }
        .stock-metric-value.positive { color: var(--anchor-gold); }
        .stock-metric-value.negative { color: var(--anchor-coral); }
        .stock-actions-row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
        .stock-action-btn { padding: 10px 20px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 10px; color: var(--anchor-text); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; }
        .stock-action-btn:hover { border-color: var(--anchor-gold); color: var(--anchor-gold); }
        .stock-action-btn.primary { background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); border: none; color: var(--anchor-bg); }
        .stock-peers-section { margin-top: 20px; }
        .stock-peers-list { display: flex; flex-wrap: wrap; gap: 8px; }
        .stock-peer-chip { padding: 8px 16px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--anchor-gold); cursor: pointer; }
        .stock-peer-chip:hover { border-color: var(--anchor-gold); background: rgba(215,198,163,0.1); }
        .analyst-rating { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
        .rating-score { font-size: 48px; font-weight: 700; }
        .rating-bars { flex: 1; }
        .rating-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
        .rating-bar-label { font-size: 11px; color: var(--anchor-text-muted); width: 50px; }
        .rating-bar { flex: 1; height: 8px; background: var(--anchor-surface-2); border-radius: 4px; overflow: hidden; }
        .rating-bar-fill { height: 100%; border-radius: 4px; }
        .rating-bar-fill.buy { background: var(--anchor-gold); }
        .rating-bar-fill.hold { background: #F58555; }
        .rating-bar-fill.sell { background: var(--anchor-coral); }
        .rating-bar-count { font-size: 11px; color: var(--anchor-text-dim); width: 24px; text-align: right; }
        /* Stock Detail Page Styles */
        .stock-detail-header { background: var(--anchor-surface); border-radius: 16px; padding: 24px; border: 1px solid var(--anchor-border); margin-bottom: 24px; }
        .stock-detail-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
        .stock-detail-info { display: flex; align-items: center; gap: 20px; }
        .stock-detail-logo { width: 72px; height: 72px; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
        .stock-detail-logo img { width: 100%; height: 100%; object-fit: contain; }
        .stock-detail-logo.no-logo { background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); color: var(--anchor-bg); font-size: 24px; font-weight: 700; }
        .stock-detail-name { font-size: 28px; font-weight: 700; }
        .stock-detail-ticker { font-size: 16px; color: var(--anchor-gold); font-weight: 600; }
        .stock-detail-industry { font-size: 13px; color: var(--anchor-text-muted); margin-top: 4px; }
        .stock-detail-price-section { text-align: right; }
        .stock-detail-price { font-size: 36px; font-weight: 700; }
        .stock-detail-change { font-size: 18px; font-weight: 600; margin-top: 4px; }
        .stock-detail-change.positive { color: var(--anchor-gold); }
        .stock-detail-change.negative { color: var(--anchor-coral); }
        .stock-detail-updated { font-size: 11px; color: var(--anchor-text-muted); margin-top: 8px; }
        .stock-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--anchor-border); }
        .stock-metric-item { background: var(--anchor-surface-2); border-radius: 10px; padding: 14px; }
        .stock-metric-label { font-size: 11px; color: var(--anchor-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
        .stock-metric-value { font-size: 18px; font-weight: 700; }
        .stock-metric-value.positive { color: var(--anchor-gold); }
        .stock-metric-value.negative { color: var(--anchor-coral); }
        .stock-chart-section { background: var(--anchor-surface); border-radius: 16px; padding: 24px; border: 1px solid var(--anchor-border); margin-bottom: 24px; }
        .stock-chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
        .stock-chart-title { font-size: 18px; font-weight: 600; }
        .stock-chart-periods { display: flex; gap: 8px; }
        .stock-period-btn { padding: 8px 16px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 8px; color: var(--anchor-text-dim); font-size: 13px; font-weight: 600; cursor: pointer; }
        .stock-period-btn:hover { border-color: var(--anchor-gold); color: var(--anchor-gold); }
        .stock-period-btn.active { background: rgba(215,198,163,0.15); border-color: var(--anchor-gold); color: var(--anchor-gold); }
        .period-divider { width: 1px; height: 24px; background: var(--anchor-border); align-self: center; margin: 0 4px; }
        .stock-chart-container { height: 350px; }
        .stock-financials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-bottom: 24px; }
        .stock-financials-card { background: var(--anchor-surface); border-radius: 16px; padding: 20px; border: 1px solid var(--anchor-border); }
        .stock-financials-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
        .stock-financials-table { width: 100%; }
        .stock-financials-table tr { border-bottom: 1px solid var(--anchor-border); }
        .stock-financials-table tr:last-child { border-bottom: none; }
        .stock-financials-table td { padding: 10px 0; font-size: 13px; }
        .stock-financials-table td:first-child { color: var(--anchor-text-dim); }
        .stock-financials-table td:last-child { text-align: right; font-weight: 600; }
        .stock-actions-bar { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
        .stock-action-btn { padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--anchor-border); background: var(--anchor-surface-2); color: var(--anchor-text); display: flex; align-items: center; gap: 8px; }
        .stock-action-btn:hover { border-color: var(--anchor-gold); color: var(--anchor-gold); }
        .stock-action-btn.primary { background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); color: var(--anchor-bg); border: none; }
        .stock-news-item { padding: 16px; background: var(--anchor-surface-2); border-radius: 10px; margin-bottom: 12px; }
        .stock-news-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
        .stock-news-meta { font-size: 11px; color: var(--anchor-text-muted); }
        .stock-peers-list { display: flex; flex-wrap: wrap; gap: 8px; }
        .stock-peer-chip { padding: 8px 14px; background: var(--anchor-surface-2); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--anchor-gold); cursor: pointer; border: 1px solid var(--anchor-border); }
        .stock-peer-chip:hover { border-color: var(--anchor-gold); }
        .chat-input-wrapper { display: flex; gap: 10px; }
        .chat-input { flex: 1; padding: 12px 16px; background: var(--anchor-surface-2); border: 1px solid var(--anchor-border); border-radius: 24px; color: var(--anchor-text); font-size: 14px; }
        .chat-input:focus { outline: none; border-color: var(--anchor-gold); }
        .chat-send { padding: 12px 20px; background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%); border: none; border-radius: 24px; color: var(--anchor-bg); font-size: 16px; cursor: pointer; }
        .chat-send:disabled { background: var(--anchor-border); cursor: not-allowed; }
        .modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(10,14,20,0.8); z-index: 1000; justify-content: center; align-items: center; }
        .modal-overlay.show { display: flex; }
        .modal { background: var(--anchor-surface); border-radius: 20px; padding: 32px; width: 100%; max-width: 500px; border: 1px solid var(--anchor-border); max-height: 90vh; overflow-y: auto; }
        .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
        .modal-title { font-size: 20px; font-weight: 600; }
        .modal-close { background: none; border: none; color: var(--anchor-text-muted); font-size: 24px; cursor: pointer; }
        .modal-actions { display: flex; gap: 12px; margin-top: 24px; }
        .modal-actions .btn { flex: 1; }
        .loading-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(10,14,20,0.9); z-index: 1001; justify-content: center; align-items: center; flex-direction: column; }
        .loading-overlay.show { display: flex; }
        .loading-spinner { width: 60px; height: 60px; border: 4px solid var(--anchor-border); border-top-color: var(--anchor-gold); border-radius: 50%; animation: spin 1s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loading-text { margin-top: 20px; font-size: 16px; }
        .loading-subtext { margin-top: 8px; font-size: 13px; color: var(--anchor-text-muted); }
        .toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1002; }
        .toast { background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 12px; min-width: 280px; margin-top: 12px; }
        .toast.success { border-color: var(--anchor-gold); }
        .toast.error { border-color: var(--anchor-coral); }
        .activity-card { background: var(--anchor-surface-2); border-radius: 12px; padding: 16px; border-left: 4px solid var(--anchor-gold); margin-bottom: 12px; }
        .activity-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
        .activity-action { font-weight: 600; }
        .activity-security { color: var(--anchor-gold); font-weight: 600; }
        .activity-rationale { color: var(--anchor-text-dim); font-size: 13px; }
        /* ── Scenario Engine ── */
        .se-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
        .se-sidebar { background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 14px; padding: 20px; max-height: 800px; overflow-y: auto; }
        .se-sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
        .se-badge { background: rgba(0,116,175,0.15); color: #0074AF; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
        .se-badge-sm { background: rgba(0,116,175,0.15); color: #0074AF; padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: 600; margin-left: 6px; }
        .se-mode-selector { display: flex; gap: 4px; margin-bottom: 12px; }
        .se-mode-btn { flex: 1; padding: 6px 8px; border: 1px solid var(--anchor-border); border-radius: 8px; background: transparent; color: var(--anchor-text-muted); font-size: 12px; cursor: pointer; }
        .se-mode-btn.active { background: rgba(0,116,175,0.15); border-color: #0074AF; color: #0074AF; }
        .se-clear-btn { width: 100%; padding: 6px; border: 1px solid var(--anchor-border); border-radius: 8px; background: transparent; color: var(--anchor-text-muted); font-size: 12px; cursor: pointer; margin-bottom: 16px; }
        .se-clear-btn:hover { border-color: #E9614B; color: #E9614B; }
        .se-category { margin-bottom: 16px; }
        .se-cat-header { padding: 6px 0; margin-bottom: 8px; }
        .se-event { padding: 10px; border: 1px solid var(--anchor-border); border-radius: 10px; margin-bottom: 6px; transition: all 0.2s; }
        .se-event.active { background: rgba(0,116,175,0.05); }
        .se-event-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
        .se-event-label input[type="checkbox"] { margin-top: 3px; accent-color: #0074AF; }
        .se-event-info { flex: 1; }
        .se-event-title { font-size: 13px; font-weight: 600; }
        .se-event-sub { font-size: 11px; color: var(--anchor-text-muted); margin-top: 2px; }
        .se-event-badges { display: flex; gap: 6px; margin-top: 6px; padding-left: 24px; }
        .se-prob-badge, .se-time-badge { font-size: 10px; padding: 1px 8px; border-radius: 10px; background: var(--anchor-surface-2); color: var(--anchor-text-muted); }

        .se-content { min-height: 400px; }
        .se-metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
        .se-metric-card { background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 12px; padding: 16px; transition: border-color 0.2s; }
        .se-metric-card.impacted { border-color: rgba(0,116,175,0.4); }
        .se-metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--anchor-text-muted); font-weight: 600; }
        .se-metric-sublabel { font-size: 10px; color: var(--anchor-text-muted); margin-bottom: 8px; }
        .se-metric-value { font-size: 22px; font-weight: 700; }
        .se-metric-delta { font-size: 12px; font-weight: 600; margin-top: 4px; }
        .se-metric-delta.good { color: #4ca882; }
        .se-metric-delta.bad { color: #E9614B; }
        .se-metric-baseline { font-size: 10px; color: var(--anchor-text-muted); margin-top: 2px; }

        .se-section { background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
        .se-section-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
        .se-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
        .se-chain-step { padding: 4px 12px; border-radius: 8px; font-size: 12px; font-weight: 500; }
        .se-chain-first { background: rgba(215,198,163,0.15); color: #D7C6A3; }
        .se-chain-mid { background: var(--anchor-surface-2); color: var(--anchor-text-muted); }
        .se-chain-last { background: rgba(233,97,75,0.15); color: #E9614B; }
        .se-chain-arrow { color: var(--anchor-text-muted); font-size: 14px; }
        .se-narrative { font-size: 14px; line-height: 1.7; color: var(--anchor-text); }
        .se-impacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
        .se-impact-item { background: var(--anchor-surface-2); border-radius: 10px; padding: 12px; }
        .se-impact-label { font-size: 11px; color: var(--anchor-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
        .se-impact-vals { font-size: 13px; margin-top: 4px; }
        .se-impact-delta { font-size: 12px; font-weight: 600; margin-top: 2px; }
        .se-impact-delta.good { color: #4ca882; }
        .se-impact-delta.bad { color: #E9614B; }

        .se-portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
        .se-portfolio-card { background: var(--anchor-surface-2); border-radius: 10px; padding: 14px; text-align: center; border: 1px solid transparent; }
        .se-portfolio-card.good { border-color: rgba(76,168,130,0.3); }
        .se-portfolio-card.bad { border-color: rgba(233,97,75,0.3); }
        .se-portfolio-icon { font-size: 24px; margin-bottom: 6px; }
        .se-portfolio-name { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
        .se-portfolio-label { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; display: inline-block; }
        .se-portfolio-label.good { background: rgba(76,168,130,0.15); color: #4ca882; }
        .se-portfolio-label.bad { background: rgba(233,97,75,0.15); color: #E9614B; }
        .se-portfolio-label.neutral { background: var(--anchor-surface); color: var(--anchor-text-muted); }
        .se-implications { margin-top: 16px; }
        .se-implication { font-size: 13px; line-height: 1.6; padding: 8px 0; border-bottom: 1px solid var(--anchor-border); }
        .se-empty { text-align: center; padding: 80px 40px; }

        /* Scenario Engine animations */
        .se-metric-card { transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s; }
        .se-metric-card.impacted { box-shadow: 0 2px 12px rgba(0,116,175,0.1); }
        .se-metric-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
        .se-metric-value { transition: color 0.3s; }
        .se-metric-delta { transition: opacity 0.3s; }
        .se-event { transition: background 0.2s, border-color 0.2s; }
        .se-event:hover { background: rgba(0,116,175,0.03); }
        .se-event-detail { animation: seSlideDown 0.25s ease-out; }
        @keyframes seSlideDown { from { opacity: 0; max-height: 0; margin-top: 0; padding: 0 12px; } to { opacity: 1; max-height: 400px; margin-top: 10px; padding: 12px; } }
        .se-section { animation: seFadeIn 0.3s ease-out; }
        .se-chain-step { animation: seFadeIn 0.3s ease-out; }
        @keyframes seFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
        .se-portfolio-card { transition: transform 0.2s, box-shadow 0.2s; }
        .se-portfolio-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
        .se-confidence-dot { transition: left 0.4s ease-out; }
        .se-confidence-fill { transition: opacity 0.3s; }
        .se-metric-bar { transition: width 0.4s ease-out; }

        /* Event search */
        .se-search { margin-bottom: 12px; }
        .se-search input { width: 100%; padding: 8px 12px; border: 1px solid var(--anchor-border); border-radius: 8px; background: var(--anchor-surface-2); color: var(--anchor-text); font-size: 12px; outline: none; }
        .se-search input:focus { border-color: #0074AF; }
        .se-search input::placeholder { color: var(--anchor-text-muted); }
        .se-event.filtered-out { display: none; }

        /* Tabs */
        .se-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--anchor-border); padding-bottom: 0; }
        .se-tab { padding: 10px 16px; border: none; background: transparent; color: var(--anchor-text-muted); font-size: 13px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
        .se-tab:hover { color: var(--anchor-text); }
        .se-tab.active { color: #0074AF; border-bottom-color: #0074AF; }
        .se-tab-content { animation: seFadeIn 0.25s ease-out; }
        .se-transmit-icon { font-size: 10px; cursor: help; opacity: 0.6; }
        .se-transmit-icon:hover { opacity: 1; }

        .se-event-row { display: flex; align-items: flex-start; gap: 4px; }
        .se-event-row .se-event-label { flex: 1; }
        .se-expand-btn { flex-shrink: 0; transition: color 0.2s; }
        .se-expand-btn:hover { color: var(--anchor-gold) !important; }
        .se-event-detail { margin-top: 10px; padding: 12px; background: var(--anchor-surface-2); border-radius: 8px; border-left: 2px solid var(--anchor-bay); }

        .se-metric-card { position: relative; overflow: hidden; }
        .se-metric-bar { position: absolute; top: 0; left: 0; height: 100%; border-radius: 12px; transition: width 0.3s; z-index: 0; }
        .se-metric-card > *:not(.se-metric-bar) { position: relative; z-index: 1; }

        .se-confidence { margin-top: 8px; }
        .se-confidence-bar { position: relative; height: 4px; background: var(--anchor-surface-2); border-radius: 2px; margin-bottom: 4px; }
        .se-confidence-fill { position: absolute; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #E9614B, #D7C6A3, #4ca882); opacity: 0.4; }
        .se-confidence-dot { position: absolute; top: -3px; width: 10px; height: 10px; background: var(--anchor-text); border-radius: 50%; border: 2px solid var(--anchor-surface); transform: translateX(-50%); }
        .se-confidence-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--anchor-text-muted); }

        @media (max-width: 900px) {
            .se-layout { grid-template-columns: 1fr; }
            .se-sidebar { max-height: none; }
            .se-metrics-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
            .se-metric-card { padding: 12px; }
            .se-metric-value { font-size: 18px; }
            .se-event { padding: 12px; }
            .se-event-label { gap: 12px; }
            .se-event-label input[type="checkbox"] { width: 18px; height: 18px; }
            .se-mode-btn { padding: 10px 8px; font-size: 13px; }
            .se-portfolio-grid { grid-template-columns: repeat(3, 1fr); }
            .se-impacts-grid { grid-template-columns: 1fr 1fr; }
            .se-chain { flex-direction: column; }
            .se-chain-arrow { transform: rotate(90deg); }
        }

        @media (max-width: 1200px) { .chat-widget-panel { width: 340px; height: 480px; } .charts-grid { grid-template-columns: 1fr; } #chartOptionsSidebar { width: 220px !important; } }
        @media (max-width: 768px) { .sidebar { display: none; } .stats-grid, .clients-grid, .market-grid { grid-template-columns: 1fr; } .chat-widget-panel { width: calc(100vw - 32px); right: -8px; height: 70vh; } .chat-widget { bottom: 16px; right: 16px; } #chartOptionsSidebar { width: 100% !important; } }

        /* Landing Page */
        .landing-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; background: radial-gradient(ellipse at center, #0e1822 0%, var(--anchor-bg) 70%); position: relative; }

        /* Landing Chat Messages (ChatGPT style) */
        .lc-msg { display: flex; margin-bottom: 24px; }
        .lc-user { justify-content: flex-end; }
        .lc-assistant { justify-content: flex-start; }
        .lc-bubble { max-width: 90%; padding: 12px 18px; border-radius: 18px; font-size: 14px; line-height: 1.6; word-wrap: break-word; }
        .lc-assistant .lc-bubble { max-width: 100%; }
        .lc-user .lc-bubble { background: var(--anchor-surface-2); color: var(--anchor-text); border-bottom-right-radius: 4px; }
        .lc-assistant .lc-bubble { background: transparent; color: var(--anchor-text); }
        .lc-bubble.lc-rich { max-width: 100%; width: 100%; padding: 0; }
        .lc-bubble.lc-rich > * { padding: 0; }
        .lc-assistant { width: 100%; }
        .lc-bubble.lc-typing { color: var(--anchor-text-muted); font-style: italic; }
        .lc-bubble p { margin: 0 0 8px 0; }
        .lc-bubble p:last-child { margin-bottom: 0; }
        .lc-bubble table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
        .lc-bubble th, .lc-bubble td { padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--anchor-border); }
        .lc-bubble th { color: var(--anchor-bay); font-weight: 600; font-size: 11px; text-transform: uppercase; }
        .lc-bubble strong { color: var(--anchor-gold); }
        .lc-bubble a { color: #6F93B0; text-decoration: none; }
        .lc-bubble a:hover { color: var(--anchor-gold); text-decoration: underline; }
        .lc-bubble h3 { font-size: 16px; font-weight: 700; margin: 16px 0 8px 0; color: var(--anchor-text); }
        .lc-bubble h4 { font-size: 14px; font-weight: 600; margin: 12px 0 6px 0; color: var(--anchor-bay); }
        .lc-bubble ul, .lc-bubble ol { padding-left: 20px; margin: 8px 0; }
        .lc-bubble li { margin-bottom: 4px; }

        [data-theme="light"] .lc-user .lc-bubble { background: #EDE9E3; color: #1A2332; }
        [data-theme="light"] .lc-assistant .lc-bubble { color: #1A2332; }
        [data-theme="light"] .lc-bubble strong { color: #163C63; }
        .landing-page.hidden { display: none; }
        .landing-page.chat-active { justify-content: flex-start; overflow: hidden; padding: 0; }
        .landing-page.chat-active .landing-chat-container { flex-shrink: 0; padding: 0 40px 16px; z-index: 2; width: 100%; max-width: 1100px; margin: 0 auto; }
        .landing-page.chat-active .landing-actions { display: none; }
        .landing-page.chat-active .landing-branding { display: none; }

        /* Landing chat scrollbar — hidden */
        #landingMessages { scrollbar-width: none; -ms-overflow-style: none; }
        #landingMessages::-webkit-scrollbar { display: none; }
        .landing-greeting { color: var(--anchor-text-dim); font-size: 40px; margin-bottom: 8px; font-weight: 400; text-align: center; }
        .landing-title { font-size: 48px; font-weight: 700; color: var(--anchor-text); margin-bottom: 48px; text-align: center; }
        .landing-chat-container { width: 100%; max-width: 700px; margin-bottom: 32px; }
        .landing-chat-input-wrapper { display: flex; align-items: center; background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 14px; padding: 8px 8px 8px 24px; transition: border-color 0.2s, box-shadow 0.2s; }
        .landing-chat-input-wrapper:focus-within { border-color: #3a4252; box-shadow: 0 0 0 4px rgba(215,198,163,0.1); }
        .landing-chat-input { flex: 1; background: transparent; border: none; color: var(--anchor-text); font-size: 16px; padding: 12px 0; outline: none; }
        .landing-chat-input::placeholder { color: #4a5568; }
        .landing-chat-btn { width: 48px; height: 48px; background: var(--anchor-surface-2); border: none; border-radius: 10px; color: var(--anchor-text-muted); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; margin-left: 8px; }
        .landing-chat-btn:hover { background: var(--anchor-gold); color: var(--anchor-bg); }
        .landing-attach-btn { background: none; border: none; color: #4a5568; font-size: 20px; cursor: pointer; padding: 8px; margin-right: 8px; }
        .landing-attach-btn:hover { color: var(--anchor-text-muted); }
        .landing-actions { display: flex; gap: 16px; margin-bottom: 80px; }
        .landing-action-btn { width: 64px; height: 64px; background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 16px; color: var(--anchor-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
        .landing-action-btn:hover { border-color: var(--anchor-gold); color: var(--anchor-gold); transform: translateY(-2px); }
        .landing-action-btn svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.5; }
        .landing-icon-img { width: 34px; height: 34px; object-fit: contain; opacity: 0.45; transition: opacity 0.2s; mix-blend-mode: screen; }
        .landing-action-btn:hover .landing-icon-img { opacity: 0.9; }
        .landing-branding { display: flex; align-items: center; gap: 20px; position: absolute; bottom: 40px; }
        .brand-anchor-img { height: 32px; width: auto; mix-blend-mode: screen; }
        .brand-divider { width: 1px; height: 32px; background: var(--anchor-border); }
        .brand-credo { font-size: 24px; font-weight: 700; color: var(--anchor-text); letter-spacing: 6px; display: flex; align-items: center; gap: 4px; }
        .brand-credo-dot { width: 8px; height: 8px; background: var(--anchor-text); border-radius: 50%; margin-left: 2px; }
        /* Menu Toggle (mobile) */
        .menu-toggle { background: none; border: none; color: var(--anchor-text-muted); font-size: 24px; cursor: pointer; padding: 8px; border-radius: 8px; display: none; }
        .menu-toggle:hover { background: var(--anchor-surface-2); color: var(--anchor-text); }
        @media (max-width: 768px) { .menu-toggle { display: block; } .sidebar { position: fixed; left: -280px; z-index: 100; height: 100vh; transition: left 0.3s; } .sidebar.open { left: 0; } }
        /* Presentation viewer */
        #presSlideshow:fullscreen { background: var(--anchor-bg); border-radius: 0; border: none; }
        #presSlideshow:fullscreen #presSlideContainer { height: calc(100vh - 60px); aspect-ratio: auto; }
        #presSlideshow:-webkit-full-screen { background: var(--anchor-bg); border-radius: 0; border: none; }
        #presSlideshow:-webkit-full-screen #presSlideContainer { height: calc(100vh - 60px); aspect-ratio: auto; }
        @keyframes presSpin { to { transform: rotate(360deg); } }
        .pres-spinner { width:24px;height:24px;border:3px solid var(--anchor-border);border-top-color:var(--anchor-gold);border-radius:50%;animation:presSpin 0.8s linear infinite; }

        /* ===== Extended Stock Detail Styles ===== */

        /* Key Metrics Bar */
        .key-metrics-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
        .key-metric-item { background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 12px; padding: 18px 16px; text-align: left; }
        .key-metric-label { font-size: 10px; font-weight: 700; color: var(--anchor-navy); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
        .key-metric-value { font-size: 26px; font-weight: 800; color: #17283A; color: var(--anchor-text); line-height: 1; }
        .key-metric-trend { font-size: 12px; margin-top: 6px; font-weight: 600; }
        .key-metric-trend.positive { color: var(--anchor-teal); }
        .key-metric-trend.negative { color: var(--anchor-coral); }

        /* Earnings & P/E Analysis */
        .earnings-analysis-card { background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 16px; padding: 24px; margin-bottom: 20px; }
        .earnings-analysis-title { font-size: 14px; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 20px; }
        .earnings-analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; text-align: center; }
        .earnings-item-label { font-size: 10px; font-weight: 700; color: var(--anchor-navy); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
        .earnings-item-value { font-size: 28px; font-weight: 800; color: var(--anchor-text); }
        .earnings-item-value.accent { color: var(--anchor-teal); }

        /* Quality Scores */
        .quality-scores-container { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
        .quality-score-row { display: flex; align-items: center; gap: 12px; }
        .quality-score-label { font-size: 13px; font-weight: 600; color: var(--anchor-text-dim); width: 100px; flex-shrink: 0; }
        .quality-score-bar-bg { flex: 1; height: 12px; background: var(--anchor-surface-2); border-radius: 6px; overflow: hidden; }
        .quality-score-bar-fill { height: 100%; background: linear-gradient(90deg, var(--anchor-navy) 0%, var(--anchor-teal) 100%); border-radius: 6px; transition: width 0.6s ease; }
        .quality-score-val { font-size: 16px; font-weight: 800; color: var(--anchor-text); width: 28px; text-align: right; }

        /* DCF Cards */
        .dcf-card { background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 16px; padding: 24px; }
        .dcf-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
        .dcf-card-title { font-size: 14px; font-weight: 700; letter-spacing: 0.5px; }
        .dcf-card-badge { font-size: 11px; color: var(--anchor-text-muted); font-weight: 500; }
        .dcf-values-row { display: flex; gap: 40px; margin-bottom: 16px; }
        .dcf-value-label { font-size: 10px; font-weight: 700; color: var(--anchor-navy); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
        .dcf-value-amount { font-size: 32px; font-weight: 800; color: var(--anchor-text); }
        .dcf-value-amount.navy { color: var(--anchor-navy); }
        .dcf-upside-pill { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; margin-bottom: 20px; }
        .dcf-upside-pill.upside { background: rgba(0,116,175,0.12); color: var(--anchor-teal); }
        .dcf-upside-pill.downside { background: rgba(233,97,75,0.12); color: var(--anchor-coral); }
        .dcf-assumptions { border-top: 1px solid var(--anchor-border); padding-top: 16px; }
        .dcf-assumptions-title { font-size: 10px; font-weight: 700; color: var(--anchor-navy); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
        .dcf-assumptions-grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; font-size: 13px; }
        .dcf-assumptions-grid span:nth-child(odd) { color: var(--anchor-text-dim); }
        .dcf-assumptions-grid span:nth-child(even) { color: var(--anchor-text); font-weight: 600; text-align: right; }

        /* Investment Thesis */
        .thesis-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .thesis-heading { font-size: 13px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
        .thesis-heading.pros { color: var(--anchor-teal); }
        .thesis-heading.cons { color: var(--anchor-coral); }
        .thesis-item { font-size: 13px; color: var(--anchor-text-dim); line-height: 1.6; padding: 6px 0; display: flex; gap: 8px; }
        .thesis-bullet { font-weight: 700; flex-shrink: 0; font-size: 14px; }
        .thesis-bullet.pros { color: var(--anchor-teal); }
        .thesis-bullet.cons { color: var(--anchor-coral); }

        /* Recent Updates */
        .update-row { padding: 14px 0; border-bottom: 1px solid var(--anchor-border); }
        .update-row:last-child { border-bottom: none; }
        .update-row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
        .update-badge { font-size: 10px; font-weight: 600; background: rgba(0,116,175,0.15); color: var(--anchor-teal); padding: 2px 8px; border-radius: 4px; text-transform: capitalize; }
        .update-date { font-size: 11px; color: var(--anchor-text-muted); }
        .update-headline { font-size: 13px; color: var(--anchor-text); text-decoration: none; display: block; line-height: 1.5; }
        .update-headline:hover { color: var(--anchor-gold); }

        @media (max-width: 640px) {
            .key-metrics-bar { grid-template-columns: repeat(3, 1fr); }
            .earnings-analysis-grid { grid-template-columns: repeat(2, 1fr); }
            .thesis-columns { grid-template-columns: 1fr; }
            .dcf-values-row { gap: 20px; }
            .dcf-value-amount { font-size: 24px; }
        }

        /* ===== Proposal List Styles ===== */
        .prop-list-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
        .prop-list-heading { font-size: 20px; font-weight: 700; color: var(--anchor-text); margin: 0; }
        .prop-list-count { font-size: 12px; color: var(--anchor-text-muted); background: var(--anchor-surface-2); padding: 4px 12px; border-radius: 20px; border: 1px solid var(--anchor-border); }
        .prop-list-container { display: flex; flex-direction: column; gap: 10px; }
        .prop-list-row {
            display: flex; align-items: center; gap: 16px; padding: 18px 20px;
            background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 12px;
            cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
        }
        .prop-list-row:hover { border-color: var(--anchor-gold); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
        .prop-list-icon {
            width: 42px; height: 42px; border-radius: 10px;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            display: flex; align-items: center; justify-content: center; flex-shrink: 0;
            color: var(--anchor-text-dim);
        }
        .prop-list-info { flex: 1; min-width: 0; }
        .prop-list-title { font-size: 15px; font-weight: 600; color: var(--anchor-text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .prop-list-row--complete .prop-list-title { font-weight: 700; }
        .prop-list-row--draft .prop-list-title { font-weight: 400; color: var(--anchor-text-muted); }
        .prop-list-row--draft .prop-list-icon svg { stroke: var(--anchor-text-muted); }
        .prop-list-row--draft .prop-list-meta { color: var(--anchor-text-dim); }
        .prop-list-meta { font-size: 12px; color: var(--anchor-text-muted); }
        .prop-list-dot { margin: 0 6px; opacity: 0.5; }
        .prop-list-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
        .prop-list-badge {
            padding: 5px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
            background: rgba(0,87,141,0.12); color: #0074AF; white-space: nowrap;
        }
        .prop-list-badge--draft { background: rgba(107,114,128,0.15); color: #6b7280; }
        .prop-list-menu { position: relative; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; color: var(--anchor-text-dim); }
        .prop-list-menu:hover { background: var(--anchor-surface-2); }
        .prop-menu-dropdown {
            display: none; position: absolute; top: 100%; right: 0; z-index: 50;
            background: var(--anchor-surface); border: 1px solid var(--anchor-border); border-radius: 10px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.2); min-width: 140px; overflow: hidden;
        }
        .prop-menu-dropdown.open { display: block; }
        .prop-menu-item { padding: 10px 14px; font-size: 13px; color: var(--anchor-text); cursor: pointer; white-space: nowrap; }
        .prop-menu-item:hover { background: var(--anchor-surface-2); }
        .prop-menu-item.prop-menu-danger:hover { background: rgba(233,97,75,0.1); color: var(--anchor-coral); }

        /* Light theme overrides for proposal list */
        [data-theme="light"] .prop-list-badge { background: rgba(0,87,141,0.08); color: #005a8c; }
        [data-theme="light"] .prop-list-row:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.05); }


        /* ══════════════════════════════════════════
           PROPOSAL — CLIENT INFO PAGE
           ══════════════════════════════════════════ */

        .prop-ci-topbar {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 0; margin-bottom: 8px; gap: 12px; flex-wrap: wrap;
        }
        .prop-ci-topbar-left {
            display: flex; align-items: center; gap: 12px;
        }
        .prop-ci-back-btn {
            background: none; border: none; color: var(--anchor-text-muted); cursor: pointer;
            padding: 6px; border-radius: 8px; display: flex; align-items: center;
            transition: all 0.15s ease;
        }
        .prop-ci-back-btn:hover { color: var(--anchor-text); background: var(--anchor-surface-2); }
        .prop-ci-logo { height: 22px; opacity: 0.85; }
        .prop-ci-divider { color: var(--anchor-text-muted); font-size: 16px; font-weight: 300; }
        .prop-ci-title {
            font-size: 14px; font-weight: 500; color: var(--anchor-text-dim);
        }
        .prop-ci-saved-label {
            font-size: 11px; color: var(--anchor-text-muted); margin-top: 1px;
        }
        .prop-ci-topbar-right { display: flex; align-items: center; gap: 8px; }
        .prop-ci-action-btn { font-size: 12px !important; display: flex; align-items: center; gap: 6px; }
        .prop-ci-settings-btn {
            background: none; border: none; color: var(--anchor-text-muted); cursor: pointer;
            padding: 6px; border-radius: 8px; display: flex; align-items: center;
            transition: color 0.15s ease;
        }
        .prop-ci-settings-btn:hover { color: var(--anchor-text); }

        /* Tabs */
        .prop-ci-tabs {
            display: flex; gap: 0; border-bottom: 1px solid var(--anchor-border);
            margin-bottom: 28px; overflow-x: auto;
        }
        .prop-ci-tab {
            padding: 12px 20px; font-size: 13px; font-weight: 500;
            color: var(--anchor-text-muted); background: none; border: none;
            border-bottom: 2px solid transparent;
            cursor: pointer; display: flex; align-items: center; gap: 6px;
            white-space: nowrap; transition: all 0.15s ease;
        }
        .prop-ci-tab:hover { color: var(--anchor-text-dim); }
        .prop-ci-tab.active {
            color: var(--anchor-text); border-bottom-color: var(--anchor-gold);
            background: rgba(215,198,163,0.06);
        }

        /* Panels */
        .prop-ci-panels { min-height: 400px; }
        .prop-ci-panel { display: none; animation: propCiFadeIn 0.2s ease; }
        .prop-ci-panel.active { display: block; }
        @keyframes propCiFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

        /* Cards */
        .prop-ci-card {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 14px; padding: 28px; margin-bottom: 20px;
        }
        .prop-ci-card-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
        }
        .prop-ci-card-header h3 {
            font-size: 16px; font-weight: 700; color: var(--anchor-text); margin: 0;
        }
        .prop-ci-card-header-icon {
            display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
        }
        .prop-ci-card-header-icon h3 {
            font-size: 15px; font-weight: 600; color: var(--anchor-text); margin: 0;
        }

        /* Form Grid */
        .prop-ci-form-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
        }
        .prop-ci-form-full { grid-column: 1 / -1; }
        .prop-ci-form-half { }
        @media (max-width: 640px) {
            .prop-ci-form-grid { grid-template-columns: 1fr; }
            .prop-ci-form-half { grid-column: 1; }
        }

        /* Two-column layout */
        .prop-ci-two-col {
            display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
        }
        @media (max-width: 768px) {
            .prop-ci-two-col { grid-template-columns: 1fr; }
        }

        /* Rich text area */
        .prop-ci-richtext {
            min-height: 180px; line-height: 1.65; font-size: 14px;
        }

        /* Empty state */
        .prop-ci-empty-state {
            text-align: center; padding: 32px 20px;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 10px;
        }

        /* Account row */
        .prop-ci-account-row {
            display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px;
            align-items: end; padding: 16px; margin-bottom: 10px;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 10px; animation: propCiFadeIn 0.2s ease;
        }
        .prop-ci-account-row .form-label { font-size: 12px; margin-bottom: 6px; }
        .prop-ci-remove-btn {
            background: none; border: none; color: var(--anchor-text-muted);
            cursor: pointer; padding: 10px 8px; border-radius: 6px;
            transition: all 0.15s ease;
        }
        .prop-ci-remove-btn:hover { color: var(--anchor-coral); background: rgba(233,97,75,0.08); }
        @media (max-width: 640px) {
            .prop-ci-account-row { grid-template-columns: 1fr; }
        }

        /* Bottom actions */
        .prop-ci-bottom-actions {
            display: flex; justify-content: flex-end; gap: 12px;
            padding-top: 24px; margin-top: 8px;
        }

        /* Auto-populate from PDF button — light gold */
        .prop-autopopulate-btn {
            background: rgba(215,198,163,0.12);
            color: var(--anchor-gold);
            border: 1.5px solid var(--anchor-gold);
            font-weight: 600;
            transition: all 0.2s ease;
        }
        .prop-autopopulate-btn:hover {
            background: rgba(215,198,163,0.22);
            border-color: var(--anchor-gold);
            color: var(--anchor-gold);
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(215,198,163,0.18);
        }
        .prop-autopopulate-btn:active {
            transform: translateY(0);
        }
        .prop-autopopulate-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        .prop-autopopulate-btn .prop-ap-spinner {
            width: 15px; height: 15px;
            border: 2px solid rgba(215,198,163,0.3);
            border-top-color: var(--anchor-gold);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes prop-ap-spin { to { transform: rotate(360deg); } }  /* fallback, main @keyframes spin is in base */
        [data-theme="light"] .prop-autopopulate-btn {
            background: rgba(181,151,90,0.08);
            color: #8B7340;
            border-color: #B5975A;
        }
        [data-theme="light"] .prop-autopopulate-btn:hover {
            background: rgba(181,151,90,0.16);
            color: #8B7340;
            border-color: #B5975A;
        }

        /* Light theme overrides */
        [data-theme="light"] .prop-ci-card { background: #FFFFFF; border-color: #D4CFC6; }
        [data-theme="light"] .prop-ci-empty-state { background: #F7F5F1; border-color: #D4CFC6; }
        [data-theme="light"] .prop-ci-account-row { background: #F7F5F1; border-color: #D4CFC6; }
        [data-theme="light"] .prop-ci-tab.active { background: rgba(181,151,90,0.08); }


        /* ══════════════════════════════════════════
           PROPOSAL — PORTFOLIO SETUP CHOICE
           ══════════════════════════════════════════ */

        .prop-ps-choice-page {
            display: flex; flex-direction: column; align-items: center;
            padding: 60px 20px 40px; text-align: center;
        }
        .prop-ps-heading {
            font-size: 28px; font-weight: 700; color: var(--anchor-text);
            margin: 0 0 12px; line-height: 1.25;
        }
        .prop-ps-subheading {
            font-size: 15px; color: var(--anchor-text-muted);
            margin: 0 0 40px; max-width: 500px;
        }

        /* Card container */
        .prop-ps-cards {
            display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
            max-width: 780px; width: 100%;
        }
        @media (max-width: 700px) {
            .prop-ps-cards { grid-template-columns: 1fr; max-width: 400px; }
        }

        /* Individual card */
        .prop-ps-card {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 14px; padding: 0;
            display: flex; flex-direction: column;
            position: relative; transition: border-color 0.2s ease, box-shadow 0.2s ease;
            text-align: left;
        }
        .prop-ps-card:hover {
            border-color: rgba(215,198,163,0.35);
            box-shadow: 0 4px 24px rgba(0,0,0,0.15);
        }
        .prop-ps-card--recommended {
            border-color: rgba(215,198,163,0.3);
        }

        /* Badge */
        .prop-ps-badge {
            display: inline-flex; align-items: center; gap: 4px;
            background: rgba(215,198,163,0.12); color: var(--anchor-gold);
            font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
            padding: 5px 12px; border-radius: 20px;
            position: absolute; top: -12px; left: 20px;
            border: 1px solid rgba(215,198,163,0.2);
        }

        /* Card body */
        .prop-ps-card-body {
            display: flex; gap: 16px; padding: 28px 24px 20px;
            flex: 1;
        }
        .prop-ps-card--recommended .prop-ps-card-body { padding-top: 32px; }

        .prop-ps-card-icon {
            width: 48px; height: 48px; border-radius: 12px;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .prop-ps-card-content { flex: 1; min-width: 0; }

        .prop-ps-card-title {
            font-size: 16px; font-weight: 700; color: var(--anchor-text);
            margin: 0 0 8px;
        }
        .prop-ps-card-desc {
            font-size: 13px; color: var(--anchor-text-muted);
            line-height: 1.55; margin: 0 0 14px;
        }
        .prop-ps-card-list {
            list-style: none; padding: 0; margin: 0;
        }
        .prop-ps-card-list li {
            font-size: 13px; color: var(--anchor-text-dim);
            padding: 3px 0; padding-left: 16px; position: relative;
        }
        .prop-ps-card-list li::before {
            content: '•'; position: absolute; left: 0;
            color: var(--anchor-gold); font-weight: 700;
        }

        /* Card button */
        .prop-ps-card-btn {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            width: calc(100% - 40px); margin: 0 20px 20px;
            padding: 12px 20px; font-size: 13px; font-weight: 600;
            border-radius: 10px; border: none; cursor: pointer;
            transition: all 0.15s ease;
        }
        .prop-ps-card-btn--primary {
            background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%);
            color: var(--anchor-bg);
        }
        .prop-ps-card-btn--primary:hover {
            filter: brightness(1.08); box-shadow: 0 2px 12px rgba(215,198,163,0.3);
        }
        .prop-ps-card-btn--secondary {
            background: var(--anchor-surface-2); color: var(--anchor-text);
            border: 1px solid var(--anchor-border);
        }
        .prop-ps-card-btn--secondary:hover {
            border-color: var(--anchor-text-muted); background: rgba(42,58,74,0.6);
        }

        /* Light theme */
        [data-theme="light"] .prop-ps-card { background: #FFFFFF; border-color: #D4CFC6; }
        [data-theme="light"] .prop-ps-card:hover { border-color: rgba(181,151,90,0.5); box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
        [data-theme="light"] .prop-ps-card--recommended { border-color: rgba(181,151,90,0.4); }
        [data-theme="light"] .prop-ps-badge { background: rgba(181,151,90,0.1); border-color: rgba(181,151,90,0.25); }
        [data-theme="light"] .prop-ps-card-icon { background: #F7F5F1; border-color: #D4CFC6; }
        [data-theme="light"] .prop-ps-card-btn--secondary { background: #F7F5F1; border-color: #D4CFC6; }

        /* ══════════════════════════════════════════
           ALLOCATION EDITOR
           ══════════════════════════════════════════ */

        .alloc-card {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 14px; padding: 28px; margin-bottom: 24px;
        }
        .alloc-card--sa { border-color: rgba(0,116,175,0.4); }
        .alloc-card--off { border-color: rgba(0,180,130,0.4); }
        .alloc-card--geo { border-color: var(--anchor-border); }

        .alloc-card-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
        }
        .alloc-card-header h3 { font-size: 20px; font-weight: 800; color: var(--anchor-text); margin: 0; }

        .alloc-badge {
            font-size: 12px; font-weight: 600; padding: 5px 16px;
            border-radius: 20px; letter-spacing: 0.3px;
        }
        .alloc-badge--sa { background: rgba(0,116,175,0.12); color: #5cb8e6; border: 1px solid rgba(0,116,175,0.25); }
        .alloc-badge--off { background: rgba(0,180,130,0.12); color: #3dd6a5; border: 1px solid rgba(0,180,130,0.25); }

        /* Risk profile box */
        .alloc-risk-box {
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 12px; padding: 20px; margin-bottom: 24px;
        }
        .alloc-risk-title { font-size: 14px; font-weight: 600; color: var(--anchor-text-dim); margin-bottom: 6px; }
        .alloc-risk-desc { font-size: 13px; color: var(--anchor-text-muted); margin: 0 0 16px; }

        .alloc-risk-btns { display: flex; gap: 8px; flex-wrap: wrap; }
        .alloc-risk-btn {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 10px; padding: 12px 18px; cursor: pointer;
            text-align: left; min-width: 110px; transition: all 0.15s ease;
        }
        .alloc-risk-btn strong { display: block; font-size: 13px; color: var(--anchor-text); font-weight: 600; margin-bottom: 2px; }
        .alloc-risk-btn span { font-size: 11px; color: var(--anchor-text-muted); }
        .alloc-risk-btn:hover { border-color: var(--anchor-text-muted); }
        .alloc-risk-btn.active {
            border-color: var(--anchor-gold); background: rgba(215,198,163,0.08);
            box-shadow: 0 0 0 1px var(--anchor-gold);
        }
        .alloc-risk-btn.active strong { color: var(--anchor-gold); }

        /* MAP-variant chip buttons - smaller pill style than the risk buttons,
           grouped by family (Core / ESG / Select) under the dial. Active state
           uses the same Credo gold accent as the risk buttons for consistency. */
        .alloc-map-btn {
            background: transparent; border: 1px solid var(--anchor-border);
            border-radius: 999px; padding: 4px 12px; font-size: 12px;
            color: var(--anchor-text-dim); cursor: pointer; transition: all 0.15s ease;
            font-weight: 500;
        }
        .alloc-map-btn:hover { border-color: var(--anchor-text-muted); color: var(--anchor-text); }
        .alloc-map-btn.active {
            border-color: var(--anchor-gold); background: rgba(215,198,163,0.12);
            color: var(--anchor-gold); font-weight: 600;
        }

        /* Global Equity share-class tier toggle on the Funds tab. Smaller +
           text-only pills since they sit inline with the share-class label. */
        .credo-tier-btn {
            background: transparent; border: 1px solid var(--anchor-border);
            border-radius: 6px; padding: 4px 10px; font-size: 11.5px;
            color: var(--anchor-text-dim); cursor: pointer; transition: all 0.15s ease;
            font-weight: 500;
        }
        .credo-tier-btn:hover { border-color: var(--anchor-text-muted); color: var(--anchor-text); }
        .credo-tier-btn.active {
            border-color: var(--anchor-gold); background: rgba(215,198,163,0.12);
            color: var(--anchor-gold); font-weight: 600;
        }

        /* Slider + chart layout */
        .alloc-body { display: grid; grid-template-columns: 1fr 280px; gap: 32px; align-items: start; }
        @media (max-width: 800px) { .alloc-body { grid-template-columns: 1fr; } }

        .alloc-sliders { display: flex; flex-direction: column; gap: 4px; }
        .alloc-slider-row {
            display: flex; align-items: center; gap: 10px; margin-top: 12px;
        }
        .alloc-slider-label { flex: 1; font-size: 14px; font-weight: 500; color: var(--anchor-text); }
        .alloc-slider-input {
            width: 60px; padding: 8px 10px; text-align: center;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 8px; color: var(--anchor-text); font-size: 14px; font-weight: 600;
            -moz-appearance: textfield;
        }
        .alloc-slider-input::-webkit-inner-spin-button,
        .alloc-slider-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
        .alloc-slider-input:focus { outline: none; border-color: var(--anchor-gold); }
        .alloc-pct { font-size: 13px; color: var(--anchor-text-muted); min-width: 44px; }

        /* Range slider styling */
        .alloc-range {
            -webkit-appearance: none; appearance: none;
            width: 100%; height: 6px; border-radius: 3px;
            background: linear-gradient(to right, #0074AF 0%, #0074AF 55%, var(--anchor-surface-2) 55%, var(--anchor-surface-2) 100%);
            outline: none; margin-bottom: 4px;
        }
        .alloc-range::-webkit-slider-thumb {
            -webkit-appearance: none; appearance: none;
            width: 18px; height: 18px; border-radius: 50%;
            background: #c8d6e5; border: 2px solid var(--anchor-surface);
            cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
        }
        .alloc-range::-moz-range-thumb {
            width: 18px; height: 18px; border-radius: 50%;
            background: #c8d6e5; border: 2px solid var(--anchor-surface);
            cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
        }
        .alloc-range::-moz-range-progress { background: #0074AF; border-radius: 3px; height: 6px; }

        /* Chart area */
        .alloc-chart-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 12px; }
        .alloc-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
        .alloc-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--anchor-text-dim); }
        .alloc-legend-dot { width: 10px; height: 10px; border-radius: 2px; }

        /* Geographic exposure */
        .alloc-geo-inner {
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 12px; padding: 24px;
        }
        .alloc-geo-subtitle { font-size: 16px; font-weight: 700; color: var(--anchor-text); margin: 0 0 8px; }

        .alloc-geo-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
        @media (max-width: 700px) { .alloc-geo-sliders { grid-template-columns: 1fr; } }
        .alloc-geo-col { }

        .alloc-geo-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--anchor-text-muted); margin-top: 4px; }
        .alloc-geo-sum { font-size: 13px; color: var(--anchor-text-dim); font-weight: 500; margin-top: 8px; }
        .alloc-range--geo { margin-top: 4px; }

        .alloc-geo-visual { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; margin-top: 16px; }
        @media (max-width: 700px) { .alloc-geo-visual { grid-template-columns: 1fr; } }
        .alloc-geo-chart-col { display: flex; justify-content: center; }
        .alloc-geo-detail-col { }
        .alloc-geo-block { margin-bottom: 20px; }
        .alloc-geo-block h5 { font-size: 14px; font-weight: 700; color: var(--anchor-text); margin: 0 0 10px; }
        .alloc-geo-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--anchor-text-dim); border-bottom: 1px solid var(--anchor-border); }
        .alloc-geo-row strong { color: var(--anchor-text); }
        .alloc-geo-detail-item { margin-bottom: 12px; }
        .alloc-geo-detail-item .alloc-geo-detail-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--anchor-text); }
        .alloc-geo-detail-item .alloc-geo-detail-sub { font-size: 12px; color: var(--anchor-text-muted); margin-left: 20px; margin-top: 2px; }
        .alloc-geo-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

        /* Light theme */
        [data-theme="light"] .alloc-card { background: #FFFFFF; }
        [data-theme="light"] .alloc-risk-box { background: #F7F5F1; }
        [data-theme="light"] .alloc-risk-btn { background: #FFFFFF; }
        [data-theme="light"] .alloc-risk-btn.active { background: rgba(181,151,90,0.08); }
        [data-theme="light"] .alloc-geo-inner { background: #F7F5F1; }
        [data-theme="light"] .alloc-range { background: #D4CFC6; }
        [data-theme="light"] .alloc-range::-webkit-slider-thumb { background: #6B7280; border-color: #FFFFFF; }
        [data-theme="light"] .alloc-range::-moz-range-progress { background: #5a99bf; }
        [data-theme="light"] .alloc-slider-input { background: #FFFFFF; }


        /* ══════════════════════════════════════════
           PROPOSAL — FUNDS SELECTOR
           ══════════════════════════════════════════ */

        .fund-section {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 14px; padding: 24px; margin-bottom: 20px;
        }
        .fund-section--sa { border-color: rgba(0,116,175,0.4); }
        .fund-section--off { border-color: rgba(0,180,130,0.4); }

        .fund-section-header {
            display: flex; justify-content: space-between; align-items: flex-start;
            gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
        }
        .fund-section-header-left { display: flex; align-items: flex-start; gap: 14px; }
        .fund-section-header-right { display: flex; align-items: center; gap: 10px; }

        .fund-section-icon {
            width: 40px; height: 40px; border-radius: 10px; display: flex;
            align-items: center; justify-content: center; flex-shrink: 0;
        }
        .fund-section-icon--sa { background: rgba(0,116,175,0.12); color: #5cb8e6; }
        .fund-section-icon--off { background: rgba(0,180,130,0.12); color: #3dd6a5; }

        .fund-section-title { font-size: 18px; font-weight: 800; color: var(--anchor-text); margin: 0; }
        .fund-section-meta { font-size: 13px; color: var(--anchor-text-muted); margin: 4px 0 0; }

        .fund-total-badge {
            font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 6px;
            background: var(--anchor-surface-2); color: var(--anchor-text-muted);
            border: 1px solid var(--anchor-border);
        }
        .fund-total-badge.fund-total--ok {
            background: rgba(34,197,94,0.1); color: #22c55e;
            border-color: rgba(34,197,94,0.3);
        }
        .fund-total-badge.fund-total--over {
            background: rgba(233,97,75,0.1); color: var(--anchor-coral);
            border-color: rgba(233,97,75,0.3);
        }

        .fund-toggle-btn {
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            color: var(--anchor-text-dim); font-size: 12px; font-weight: 500;
            padding: 5px 12px; border-radius: 6px; cursor: pointer;
            display: flex; align-items: center; gap: 5px; transition: all 0.15s ease;
        }
        .fund-toggle-btn:hover { border-color: var(--anchor-text-muted); }
        .fund-toggle-btn.collapsed svg { transform: rotate(180deg); }

        /* Fund grid */
        .fund-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
        }
        @media (max-width: 800px) { .fund-grid { grid-template-columns: 1fr; } }

        /* Individual fund card */
        .fund-card {
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 10px; padding: 16px 16px 12px; position: relative;
            animation: propCiFadeIn 0.2s ease;
        }
        .fund-card-remove {
            position: absolute; top: -6px; left: -6px;
            width: 18px; height: 18px; border-radius: 50%;
            background: var(--anchor-coral); border: none; color: #fff;
            font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            opacity: 0.85; transition: opacity 0.15s ease;
        }
        .fund-card-remove:hover { opacity: 1; }

        .fund-card-top { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }

        .fund-card-select {
            flex: 1; min-width: 0; padding: 10px 32px 10px 12px;
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 8px; color: var(--anchor-text); font-size: 13px;
            -webkit-appearance: none; appearance: none; cursor: pointer;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='2 4 6 8 10 4'/%3E%3C/svg%3E");
            background-repeat: no-repeat; background-position: right 12px center;
            text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
        }
        .fund-card-select:focus { outline: none; border-color: var(--anchor-gold); }

        .fund-card-pct-input {
            width: 56px; text-align: center; padding: 10px 4px;
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 8px; color: var(--anchor-text); font-size: 15px; font-weight: 600;
            -moz-appearance: textfield;
        }
        .fund-card-pct-input::-webkit-inner-spin-button,
        .fund-card-pct-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
        .fund-card-pct-input:focus { outline: none; border-color: var(--anchor-gold); }

        .fund-card-pct-label { font-size: 12px; color: var(--anchor-text-muted); text-align: right; margin-bottom: 4px; }

        .fund-card-range {
            -webkit-appearance: none; appearance: none;
            width: 100%; height: 5px; border-radius: 3px;
            background: var(--anchor-surface); outline: none;
        }
        .fund-card-range::-webkit-slider-thumb {
            -webkit-appearance: none; appearance: none;
            width: 16px; height: 16px; border-radius: 50%;
            background: #c8d6e5; border: 2px solid var(--anchor-surface-2);
            cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
        }
        .fund-card-range::-moz-range-thumb {
            width: 16px; height: 16px; border-radius: 50%;
            background: #c8d6e5; border: 2px solid var(--anchor-surface-2);
            cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
        }
        .fund-card-range::-moz-range-progress { background: #0074AF; border-radius: 3px; height: 5px; }

        /* Add Fund button */
        .fund-add-btn {
            width: 100%; margin-top: 16px; padding: 14px;
            background: transparent; border: 1px dashed var(--anchor-border);
            border-radius: 10px; color: var(--anchor-text-dim); font-size: 13px;
            font-weight: 500; cursor: pointer; display: flex; align-items: center;
            justify-content: center; gap: 8px; transition: all 0.15s ease;
        }
        .fund-add-btn:hover { border-color: var(--anchor-text-muted); color: var(--anchor-text); background: rgba(42,58,74,0.2); }

        /* Light theme */
        [data-theme="light"] .fund-section { background: #FFFFFF; }
        [data-theme="light"] .fund-card { background: #F7F5F1; border-color: #D4CFC6; }
        [data-theme="light"] .fund-card-select { background: #FFFFFF; }
        [data-theme="light"] .fund-card-pct-input { background: #FFFFFF; }
        [data-theme="light"] .fund-card-range { background: #D4CFC6; }
        [data-theme="light"] .fund-add-btn:hover { background: rgba(0,0,0,0.03); }


        /* ══════════════════════════════════════════
           PROPOSAL — PLATFORM & FEES
           ══════════════════════════════════════════ */

        .plat-card {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 14px; padding: 28px; margin-bottom: 20px;
        }
        .plat-card--dev { border-style: dashed; }
        .plat-card--disclosure {
            border-color: rgba(215,198,163,0.25);
        }

        /* In Development placeholder */
        .plat-dev-inner {
            display: flex; flex-direction: column; align-items: center;
            text-align: center; padding: 40px 20px;
        }
        .plat-dev-icon { margin-bottom: 20px; opacity: 0.5; }

        .plat-dev-progress-wrap {
            display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
        }
        .plat-dev-progress-bar {
            width: 200px; height: 8px; border-radius: 4px;
            background: var(--anchor-surface-2); overflow: hidden;
        }
        .plat-dev-progress-fill {
            height: 100%; border-radius: 4px;
            background: linear-gradient(90deg, var(--anchor-text-muted) 0%, var(--anchor-text-dim) 100%);
        }
        .plat-dev-progress-label {
            font-size: 14px; font-weight: 700; color: var(--anchor-text);
        }
        .plat-dev-status {
            font-size: 13px; color: var(--anchor-text-muted); font-weight: 400;
        }
        .plat-dev-desc {
            font-size: 13px; color: var(--anchor-text-muted); max-width: 500px;
            line-height: 1.6; margin: 0;
        }

        /* Fee section header */
        .plat-section-header {
            display: flex; align-items: center; gap: 10px; margin-bottom: 24px;
        }
        .plat-section-title {
            font-size: 17px; font-weight: 700; color: var(--anchor-text); margin: 0;
        }

        /* Fee inputs row */
        .plat-fee-inputs {
            display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px;
            margin-bottom: 24px;
        }
        @media (max-width: 700px) { .plat-fee-inputs { grid-template-columns: 1fr; } }

        .plat-fee-field {}
        .plat-fee-label {
            display: block; font-size: 13px; font-weight: 500;
            color: var(--anchor-text-dim); margin-bottom: 8px;
        }
        .plat-fee-input-wrap {
            display: flex; align-items: center; gap: 0;
            position: relative;   /* anchors the unit symbol inside the box */
        }
        .plat-fee-input {
            flex: 1; padding: 10px 14px; font-size: 15px; font-weight: 500;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 8px; color: var(--anchor-text);
            -moz-appearance: textfield;
        }
        .plat-fee-input::-webkit-inner-spin-button,
        .plat-fee-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
        .plat-fee-input:focus { outline: none; border-color: var(--anchor-gold); }
        /* ── Unit symbols inside the field ──────────────────────────────────
           %, £ and $ sit INSIDE the input's border, right against the figure,
           and follow it as the number grows (_positionUnitAffixes measures the
           rendered text). The right-edge default below keeps them sensibly
           placed inside the box before the script runs, or if it never does. */
        .plat-fee-unit,
        .cf-input-suffix,
        .unit-affix {
            position: absolute; top: 50%; transform: translateY(-50%);
            right: 12px; left: auto; padding: 0;
            font-size: 14px; color: var(--anchor-text-muted); font-weight: 500;
            pointer-events: none; white-space: nowrap; z-index: 1;
        }
        .unit-box { position: relative; display: inline-flex; align-items: center; }

        /* ── Small on/off switch ──────────────────────────────────────────── */
        .ai-switch { position: relative; display: inline-block; width: 34px; height: 18px; flex: none; }
        .ai-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
        .ai-switch .ai-switch-track {
            position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            transition: background .15s, border-color .15s;
        }
        .ai-switch .ai-switch-track::before {
            content: ''; position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
            width: 12px; height: 12px; border-radius: 50%;
            background: var(--anchor-text-muted); transition: transform .15s, background .15s;
        }
        .ai-switch input:checked + .ai-switch-track { background: rgba(0,174,239,0.25); border-color: #00AEEF; }
        .ai-switch input:checked + .ai-switch-track::before { transform: translate(16px,-50%); background: #00AEEF; }
        .ai-switch input:focus-visible + .ai-switch-track { border-color: var(--anchor-gold); }
        .ai-switch-label { font-size: 11px; font-weight: 600; color: var(--anchor-text-muted); }
        .ai-switch-label.is-on { color: #00AEEF; }

        /* Fee Summary card */
        .plat-fee-summary {
            background: var(--anchor-surface-2); border: 1px solid rgba(215,198,163,0.2);
            border-radius: 12px; padding: 20px 24px;
            box-sizing: border-box; max-width: 100%; overflow: hidden;
        }
        .plat-fee-summary-header {
            display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
        }
        .plat-fee-summary-title {
            font-size: 14px; font-weight: 700; color: var(--anchor-text); margin: 0;
        }
        .plat-fee-total-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 8px 0; font-size: 14px; font-weight: 500; color: var(--anchor-text);
            width: 100%; min-width: 0;
        }
        .plat-fee-total-val {
            font-size: 15px; font-weight: 700; color: var(--anchor-gold);
            background: rgba(215,198,163,0.08); padding: 4px 12px; border-radius: 6px;
            border: 1px solid rgba(215,198,163,0.2);
        }
        .plat-fee-divider {
            height: 1px; background: linear-gradient(90deg, var(--anchor-gold), transparent);
            margin: 12px 0;
        }
        .plat-fee-breakdown-row {
            display: flex; justify-content: space-between; padding: 5px 0;
            font-size: 13px; color: var(--anchor-text-dim); width: 100%; min-width: 0;
        }

        /* Disclosure */
        .plat-disclosure-header {
            display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
        }
        .plat-disclosure-title {
            font-size: 14px; font-weight: 700; color: var(--anchor-text); margin: 0;
        }
        .plat-disclosure-text {
            font-size: 13px; color: var(--anchor-text-muted); line-height: 1.65; margin: 0;
        }

        /* Platform provider selection */
        .plat-provider-desc {
            font-size: 13px; color: var(--anchor-text-muted); line-height: 1.6;
            margin: 0 0 16px 0;
        }
        .plat-provider-actions {
            display: flex; gap: 8px; margin-bottom: 16px;
        }
        .plat-provider-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
        }
        @media (max-width: 600px) { .plat-provider-grid { grid-template-columns: 1fr; } }
        .plat-provider-item {
            display: flex; align-items: center; gap: 10px;
            padding: 12px 14px; border-radius: 10px; cursor: pointer;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            transition: border-color 0.2s, background 0.2s;
        }
        .plat-provider-item:hover {
            border-color: var(--anchor-gold);
        }
        .plat-provider-item:has(.plat-provider-check:checked) {
            border-color: var(--anchor-gold);
            background: rgba(215,198,163,0.06);
        }
        .plat-provider-check {
            width: 18px; height: 18px; accent-color: var(--anchor-gold);
            cursor: pointer; flex-shrink: 0;
        }
        .plat-provider-label {
            flex: 1; font-size: 14px; font-weight: 500; color: var(--anchor-text);
        }

        /* Credo platform toggle items */
        .credo-plat-item {
            display: flex; align-items: flex-start; gap: 12px;
            padding: 14px 16px; border-radius: 10px; cursor: pointer;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            transition: border-color 0.2s, background 0.2s;
            user-select: none;
        }
        .credo-plat-item:hover { border-color: rgba(215,198,163,0.6); }
        .credo-plat-item.active {
            border-color: var(--anchor-gold);
            background: rgba(215,198,163,0.07);
        }
        .credo-plat-check {
            width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
            border: 2px solid var(--anchor-border); display: flex; align-items: center;
            justify-content: center; color: transparent; transition: all 0.15s;
            margin-top: 1px;
        }
        .credo-plat-item.active .credo-plat-check {
            background: var(--anchor-gold); border-color: var(--anchor-gold); color: #0a1929;
        }
        .credo-plat-name {
            font-size: 14px; font-weight: 600; color: var(--anchor-text); margin-bottom: 3px;
        }
        .credo-plat-subdesc {
            font-size: 12px; color: var(--anchor-text-muted); line-height: 1.5;
        }

        /* Light theme */
        [data-theme="light"] .plat-card { background: #FFFFFF; }
        [data-theme="light"] .credo-plat-item { background: #F7F5F1; border-color: #D4CFC6; }
        [data-theme="light"] .plat-fee-input { background: #FFFFFF; border-color: #D4CFC6; }
        [data-theme="light"] .plat-fee-summary { background: #F7F5F1; border-color: rgba(181,151,90,0.2); }
        [data-theme="light"] .plat-provider-item { background: #F7F5F1; border-color: #D4CFC6; }


        /* ══════════════════════════════════════════
           PROPOSAL — CASHFLOW
           ══════════════════════════════════════════ */

        .cf-card {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 14px; padding: 28px; margin-bottom: 20px;
        }

        /* FX Rate row */
        .cf-fx-row {
            display: flex; justify-content: flex-end; align-items: center;
            gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
        }
        .cf-fx-left {
            display: flex; align-items: center; gap: 8px;
        }
        .cf-fx-label { font-size: 13px; color: var(--anchor-text-dim); font-weight: 500; }
        .cf-fx-input {
            width: 80px; padding: 8px 10px; text-align: center;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 8px; color: var(--anchor-text); font-size: 14px; font-weight: 600;
            -moz-appearance: textfield;
        }
        .cf-fx-input::-webkit-inner-spin-button,
        .cf-fx-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
        .cf-fx-input:focus { outline: none; border-color: var(--anchor-gold); }

        .cf-currency-toggle {
            display: flex; border: 1px solid var(--anchor-border); border-radius: 8px; overflow: hidden;
        }
        .cf-curr-btn {
            padding: 8px 16px; font-size: 12px; font-weight: 600;
            background: transparent; border: none; color: var(--anchor-text-muted);
            cursor: pointer; transition: all 0.15s ease;
        }
        .cf-curr-btn.active {
            background: var(--anchor-surface-2); color: var(--anchor-text);
            border: 1px solid var(--anchor-border);
            border-radius: 6px; margin: 2px;
        }
        .cf-curr-btn:not(.active):hover { color: var(--anchor-text-dim); }

        /* Fields grid */
        .cf-fields {
            display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px;
        }
        @media (max-width: 800px) { .cf-fields { grid-template-columns: 1fr; } }

        .cf-field-label {
            display: block; font-size: 13px; font-weight: 500;
            color: var(--anchor-text-dim); margin-bottom: 8px;
        }

        .cf-input-wrap {
            display: flex; align-items: center;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 8px; overflow: hidden;
            position: relative;   /* anchors the unit suffix inside the box */
        }
        .cf-input-wrap:focus-within { border-color: var(--anchor-gold); }

        /* Currency prefix stays an in-flow flex item: the figure starts
           immediately after it, so it is already hugging the number. */
        .cf-input-prefix {
            padding: 0 0 0 14px; font-size: 14px; color: var(--anchor-text-muted);
            font-weight: 500; pointer-events: none;
        }

        .cf-input {
            flex: 1; padding: 10px 14px; font-size: 14px; font-weight: 500;
            background: transparent; border: none; color: var(--anchor-text);
            -moz-appearance: textfield; min-width: 0;
        }
        .cf-input::-webkit-inner-spin-button,
        .cf-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
        .cf-input:focus { outline: none; }

        .cf-input--plain {
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 8px; padding: 10px 14px; width: 100%; box-sizing: border-box;
        }
        .cf-input--plain:focus { outline: none; border-color: var(--anchor-gold); }

        .cf-select {
            width: 100%; padding: 10px 32px 10px 14px; font-size: 14px; font-weight: 500;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 8px; color: var(--anchor-text);
            -webkit-appearance: none; appearance: none; cursor: pointer;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='2 4 6 8 10 4'/%3E%3C/svg%3E");
            background-repeat: no-repeat; background-position: right 12px center;
        }
        .cf-select:focus { outline: none; border-color: var(--anchor-gold); }

        /* Dropdown-options dark-mode fix: browsers don't always inherit the
           parent <select>'s color into the open <option> list, so dark-mode
           users see dim text on a dim system background and can't tell
           selectable options from disabled ones. Force a clear contrast in
           both themes; disabled options dim but still readable. */
        select option {
            background-color: var(--anchor-surface-2);
            color: var(--anchor-text);
        }
        select option:disabled {
            color: var(--anchor-text-muted);
        }
        [data-theme="light"] select option {
            background-color: #F7F5F1;
            color: #1a1a1a;
        }
        [data-theme="light"] select option:disabled {
            color: #9a958c;
        }

        /* Life Events */
        .cf-life-events {
            margin-top: 28px; padding-top: 24px;
            border-top: 1px solid var(--anchor-border);
        }
        .cf-life-header {
            display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
        }
        .cf-life-title {
            font-size: 15px; font-weight: 700; color: var(--anchor-text); margin: 0;
        }
        .cf-life-desc {
            font-size: 13px; color: var(--anchor-text-muted); line-height: 1.6; margin: 0 0 16px;
        }

        .cf-life-card {
            display: grid; grid-template-columns: 1fr 120px 120px 32px;
            gap: 10px; align-items: end;
            padding: 12px 0; border-bottom: 1px solid var(--anchor-border);
            animation: propCiFadeIn 0.2s ease;
        }
        @media (max-width: 700px) { .cf-life-card { grid-template-columns: 1fr; } }

        .cf-life-remove {
            width: 28px; height: 28px; border-radius: 6px; border: none;
            background: rgba(233,97,75,0.1); color: var(--anchor-coral);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            font-size: 13px; font-weight: 700; transition: background 0.15s ease;
        }
        .cf-life-remove:hover { background: rgba(233,97,75,0.2); }

        .cf-life-add-btn {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 8px 16px; margin-top: 12px; font-size: 13px; font-weight: 500;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            border-radius: 8px; color: var(--anchor-text-dim); cursor: pointer;
            transition: all 0.15s ease;
        }
        .cf-life-add-btn:hover { border-color: var(--anchor-text-muted); color: var(--anchor-text); }

        /* Light theme */
        [data-theme="light"] .cf-card { background: #FFFFFF; }
        [data-theme="light"] .cf-fx-input { background: #F7F5F1; }
        [data-theme="light"] .cf-input-wrap { background: #F7F5F1; border-color: #D4CFC6; }
        [data-theme="light"] .cf-input--plain { background: #F7F5F1; border-color: #D4CFC6; }
        [data-theme="light"] .cf-select { background-color: #F7F5F1; border-color: #D4CFC6; }
        [data-theme="light"] .cf-curr-btn.active { background: #F7F5F1; }

        /* ── Cashflow Projection Visualizations ── */
        .cf-proj-card {
            background: var(--anchor-surface);
            border: 1px solid var(--anchor-border);
            border-radius: 14px;
            padding: 20px 24px;
            margin-top: 16px;
        }
        .cf-proj-card-header {
            display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
        }
        .cf-proj-card-header h4 {
            font-size: 15px; font-weight: 700; color: var(--anchor-text); margin: 0;
        }
        .cf-proj-summary-list {
            display: flex; flex-direction: column; gap: 6px;
        }
        .cf-proj-summary-list .cf-proj-bullet {
            font-size: 13px; color: var(--anchor-text); line-height: 1.5;
        }
        .cf-proj-summary-list .cf-proj-bullet::before {
            content: '•'; margin-right: 8px; color: var(--anchor-gold);
        }
        .cf-proj-chart-wrap {
            position: relative; width: 100%; height: 340px;
        }
        .cf-proj-chart-note {
            font-size: 11px; color: var(--anchor-text-muted); margin: 10px 0 0; line-height: 1.4;
        }
        .cf-proj-milestones {
            display: flex; flex-wrap: wrap; gap: 16px;
        }
        .cf-proj-milestone {
            display: flex; align-items: flex-start; gap: 12px;
            background: rgba(215,198,163,0.06); border: 1px solid var(--anchor-border);
            border-radius: 10px; padding: 14px 18px; flex: 1; min-width: 220px;
        }
        .cf-proj-milestone-badge {
            background: var(--anchor-surface); border: 1px solid var(--anchor-gold);
            color: var(--anchor-gold); font-size: 11px; font-weight: 700;
            padding: 4px 10px; border-radius: 6px; white-space: nowrap;
        }
        .cf-proj-milestone-text h5 {
            font-size: 13px; font-weight: 600; color: var(--anchor-text); margin: 0 0 2px;
        }
        .cf-proj-milestone-text p {
            font-size: 11px; color: var(--anchor-text-muted); margin: 0;
        }
        .cf-proj-stats-grid {
            display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
        }
        .cf-proj-stat {
            text-align: left;
        }
        .cf-proj-stat-label {
            font-size: 11px; color: var(--anchor-text-muted); margin-bottom: 4px;
        }
        .cf-proj-stat-value {
            font-size: 20px; font-weight: 700; color: var(--anchor-text);
        }
        .cf-proj-stat-value.positive { color: #4ecdc4; }
        .cf-proj-collapse-header {
            cursor: pointer; justify-content: space-between;
        }
        .cf-proj-collapse-header:hover { opacity: 0.85; }
        .cf-proj-table {
            width: 100%; border-collapse: collapse; font-size: 11px;
        }
        .cf-proj-table th {
            background: rgba(215,198,163,0.1); color: var(--anchor-gold);
            font-weight: 600; text-align: right; padding: 8px 10px;
            border-bottom: 1px solid var(--anchor-border); font-size: 10px;
        }
        .cf-proj-table th:first-child { text-align: left; }
        .cf-proj-table td {
            padding: 6px 10px; text-align: right; color: var(--anchor-text);
            border-bottom: 1px solid rgba(255,255,255,0.04);
        }
        .cf-proj-table td:first-child { text-align: left; color: var(--anchor-text-muted); }
        .cf-proj-table tr:hover td { background: rgba(215,198,163,0.04); }
        @media (max-width: 700px) {
            .cf-proj-stats-grid { grid-template-columns: repeat(2, 1fr); }
            .cf-proj-milestones { flex-direction: column; }
        }
        [data-theme="light"] .cf-proj-card { background: #FFFFFF; border-color: #D4CFC6; }
        [data-theme="light"] .cf-proj-milestone { background: rgba(181,151,90,0.04); border-color: #D4CFC6; }
        [data-theme="light"] .cf-proj-table th { background: rgba(181,151,90,0.08); }
        [data-theme="light"] .cf-proj-table td { border-bottom-color: #eee; }


        /* ══════════════════════════════════════════
           PROPOSAL — UPLOAD & GENERATE
           ══════════════════════════════════════════ */

        /* Data Summary */
        .prop-upload-summary {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 14px; padding: 24px; margin-top: 20px; margin-bottom: 20px;
        }
        .prop-upload-summary-title {
            display: flex; align-items: center; gap: 10px;
            font-size: 16px; font-weight: 700; color: var(--anchor-text);
            margin: 0 0 16px;
        }
        .prop-upload-checks {
            display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
        }
        @media (max-width: 800px) { .prop-upload-checks { grid-template-columns: 1fr 1fr; } }
        @media (max-width: 500px) { .prop-upload-checks { grid-template-columns: 1fr; } }

        .prop-upload-check {
            display: flex; align-items: flex-start; gap: 10px;
            padding: 12px 14px; border-radius: 10px;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
        }
        .prop-upload-check--ok { border-color: rgba(34,197,94,0.3); }
        .prop-upload-check--warn { border-color: rgba(234,179,8,0.3); }
        .prop-upload-check--empty { opacity: 0.5; }

        .prop-upload-check-icon {
            width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
            font-size: 11px; font-weight: 700; margin-top: 1px;
        }
        .prop-upload-check-icon--ok { background: rgba(34,197,94,0.15); color: #22c55e; }
        .prop-upload-check-icon--warn { background: rgba(234,179,8,0.15); color: #eab308; }
        .prop-upload-check-icon--empty { background: var(--anchor-surface); color: var(--anchor-text-muted); }

        .prop-upload-check-label {
            font-size: 13px; font-weight: 600; color: var(--anchor-text); margin: 0 0 2px;
        }
        .prop-upload-check-detail {
            font-size: 11px; color: var(--anchor-text-muted); line-height: 1.4;
        }

        /* Upload zone */
        .prop-upload-zone {
            background: var(--anchor-surface); border: 2px dashed var(--anchor-border);
            border-radius: 14px; margin-bottom: 20px;
            transition: border-color 0.2s ease;
        }
        .prop-upload-zone.dragover { border-color: var(--anchor-gold); }

        .prop-upload-zone-inner {
            display: flex; flex-direction: column; align-items: center;
            text-align: center; padding: 48px 24px;
        }
        .prop-upload-icon { margin-bottom: 16px; }
        .prop-upload-zone-title {
            font-size: 18px; font-weight: 700; color: var(--anchor-text);
            margin: 0 0 8px;
        }
        .prop-upload-zone-desc {
            font-size: 13px; color: var(--anchor-text-muted); max-width: 480px;
            line-height: 1.6; margin: 0 0 16px;
        }

        /* File info display */
        .prop-upload-file-info {
            display: flex; align-items: center; gap: 12px;
            background: var(--anchor-surface-2); border: 1px solid rgba(215,198,163,0.25);
            border-radius: 10px; padding: 12px 16px; margin-top: 16px;
            min-width: 280px;
        }
        .prop-upload-file-icon { flex-shrink: 0; }
        .prop-upload-file-name { font-size: 13px; font-weight: 600; color: var(--anchor-text); }
        .prop-upload-file-size { font-size: 11px; color: var(--anchor-text-muted); margin-top: 2px; }
        .prop-upload-file-remove {
            margin-left: auto; width: 24px; height: 24px; border-radius: 6px;
            background: rgba(233,97,75,0.1); border: none; color: var(--anchor-coral);
            cursor: pointer; font-size: 12px; font-weight: 700;
            display: flex; align-items: center; justify-content: center;
        }
        .prop-upload-file-remove:hover { background: rgba(233,97,75,0.2); }

        /* Actions card */
        .prop-upload-actions-card {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 14px; padding: 28px;
        }
        .prop-generate-btn {
            width: 100%; padding: 16px; font-size: 15px; font-weight: 700;
            background: linear-gradient(135deg, var(--anchor-gold) 0%, var(--anchor-copper) 100%);
            color: var(--anchor-bg); border: none; border-radius: 10px;
            cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
            transition: all 0.15s ease;
        }
        .prop-generate-btn:hover { filter: brightness(1.08); box-shadow: 0 4px 20px rgba(215,198,163,0.3); }
        .prop-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; box-shadow: none; }

        /* Light theme */
        [data-theme="light"] .prop-upload-summary { background: #FFFFFF; }
        [data-theme="light"] .prop-upload-check { background: #F7F5F1; }
        [data-theme="light"] .prop-upload-zone { background: #FFFFFF; border-color: #D4CFC6; }
        [data-theme="light"] .prop-upload-file-info { background: #F7F5F1; }
        [data-theme="light"] .prop-upload-actions-card { background: #FFFFFF; }


        /* ══════════════════════════════════════════
           PROPOSAL — GENERATING MODAL OVERLAY
           ══════════════════════════════════════════ */

        .prop-gen-modal {
            position: fixed; inset: 0; z-index: 10000;
            display: flex; align-items: center; justify-content: center;
            animation: propGenModalFadeIn 0.3s ease;
        }
        .prop-gen-modal-backdrop {
            position: absolute; inset: 0;
            background: rgba(5, 12, 20, 0.85);
            backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
        }
        .prop-gen-modal-content {
            position: relative; z-index: 1;
            width: 100%; max-width: 520px; padding: 20px;
        }
        .prop-gen-modal-card {
            background: var(--anchor-surface); border: 1px solid var(--anchor-border);
            border-radius: 20px; padding: 48px 40px 36px; text-align: center;
            box-shadow: 0 24px 80px rgba(0,0,0,0.5);
        }

        /* Spinner ring + bolt icon */
        .prop-gen-modal-spinner-wrap {
            position: relative; width: 72px; height: 72px;
            margin: 0 auto 24px; display: flex; align-items: center; justify-content: center;
        }
        .prop-gen-modal-ring {
            position: absolute; inset: 0; border-radius: 50%;
            border: 3px solid var(--anchor-border);
            border-top-color: var(--anchor-gold);
            animation: propGenSpin 1.2s linear infinite;
        }
        .prop-gen-modal-bolt { animation: propGenPulse 2s ease-in-out infinite; }

        @keyframes propGenSpin { to { transform: rotate(360deg); } }
        @keyframes propGenPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.9); } }
        @keyframes propGenModalFadeIn { from { opacity: 0; } to { opacity: 1; } }

        /* Title & status */
        .prop-gen-modal-title {
            font-size: 22px; font-weight: 800; color: var(--anchor-text);
            margin: 0 0 6px; letter-spacing: -0.3px;
        }
        .prop-gen-modal-status {
            font-size: 14px; color: var(--anchor-gold); font-weight: 500;
            margin: 0 0 28px; min-height: 20px;
        }

        /* Progress bar */
        .prop-gen-modal-progress {
            display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
        }
        .prop-gen-modal-progress-track {
            flex: 1; height: 6px; background: var(--anchor-surface-2);
            border-radius: 3px; overflow: hidden;
        }
        .prop-gen-modal-progress-fill {
            height: 100%; border-radius: 3px;
            background: linear-gradient(90deg, var(--anchor-gold), var(--anchor-copper));
            transition: width 0.6s ease;
        }
        .prop-gen-modal-progress-pct {
            font-size: 13px; font-weight: 700; color: var(--anchor-text);
            min-width: 36px; text-align: right;
        }

        /* Step checklist */
        .prop-gen-modal-steps {
            text-align: left; margin-bottom: 24px;
            display: flex; flex-direction: column; gap: 8px;
        }
        .prop-gen-step {
            display: flex; align-items: center; gap: 10px;
            font-size: 13px; color: var(--anchor-text-muted);
            padding: 8px 12px; border-radius: 8px;
            background: transparent; transition: all 0.3s ease;
        }
        .prop-gen-step.active {
            background: var(--anchor-surface-2); color: var(--anchor-text);
            font-weight: 600;
        }
        .prop-gen-step.done { color: #22c55e; }

        .prop-gen-step-icon {
            width: 20px; height: 20px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 11px; font-weight: 700; flex-shrink: 0;
            border: 1.5px solid var(--anchor-border); transition: all 0.3s ease;
        }
        .prop-gen-step.active .prop-gen-step-icon {
            border-color: var(--anchor-gold); color: var(--anchor-gold);
            box-shadow: 0 0 8px rgba(215,198,163,0.25);
        }
        .prop-gen-step.done .prop-gen-step-icon {
            background: rgba(34,197,94,0.15); border-color: #22c55e; color: #22c55e;
        }

        /* Tip */
        .prop-gen-modal-tip {
            display: flex; align-items: flex-start; gap: 8px;
            padding: 12px 16px; border-radius: 10px;
            background: var(--anchor-surface-2); border: 1px solid var(--anchor-border);
            font-size: 12px; color: var(--anchor-text-muted); text-align: left;
            line-height: 1.5; min-height: 48px;
        }
        .prop-gen-modal-tip svg { flex-shrink: 0; margin-top: 1px; }

        /* Elapsed timer */
        .prop-gen-modal-elapsed {
            margin-top: 16px; font-size: 11px; color: var(--anchor-text-muted);
            letter-spacing: 0.3px;
        }

        /* Light theme */
        [data-theme="light"] .prop-gen-modal-backdrop { background: rgba(240, 235, 228, 0.88); }
        [data-theme="light"] .prop-gen-modal-card { background: #FFFFFF; box-shadow: 0 24px 80px rgba(0,0,0,0.15); }


/* ════════════════════════════════════════════════════════════
   PRODUCT WRAPPER SELECTION GRID
   ════════════════════════════════════════════════════════════ */

.pw-header {
    margin-bottom: 20px;
}
.pw-header-title {
    font-size: 16px; font-weight: 600; color: var(--anchor-text); margin: 0 0 6px 0;
}
.pw-header-desc {
    font-size: 13px; color: var(--anchor-text-muted); margin: 0; line-height: 1.5;
}

.pw-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.pw-category {
    background: var(--anchor-surface); border: 1px solid var(--anchor-border);
    border-radius: 12px; padding: 16px; transition: border-color 0.2s;
}
.pw-category:hover { border-color: var(--anchor-gold); }

.pw-category-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--anchor-border);
}
.pw-category-title {
    font-size: 14px; font-weight: 600; color: var(--anchor-gold); margin: 0;
}
.pw-category-actions { display: flex; gap: 6px; }

.pw-cat-btn {
    background: transparent; border: 1px solid var(--anchor-border); color: var(--anchor-text-muted);
    font-size: 11px; padding: 3px 8px; border-radius: 6px; cursor: pointer; transition: all 0.15s;
}
.pw-cat-btn:hover {
    border-color: var(--anchor-gold); color: var(--anchor-gold);
}

.pw-product-list { display: flex; flex-direction: column; gap: 6px; }

.pw-product-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: 8px; cursor: pointer; transition: background 0.15s;
}
.pw-product-item:hover { background: var(--anchor-surface-2); }

.pw-product-check {
    width: 16px; height: 16px; accent-color: var(--anchor-gold); cursor: pointer; flex-shrink: 0;
}

.pw-product-label {
    flex: 1; font-size: 13px; color: var(--anchor-text); user-select: none;
}

.pw-slide-badge {
    font-size: 11px; color: var(--anchor-text-muted); background: var(--anchor-surface-2);
    padding: 2px 7px; border-radius: 10px; white-space: nowrap;
}

/* Light theme overrides */
[data-theme="light"] .pw-category { background: var(--anchor-surface); }
[data-theme="light"] .pw-cat-btn { color: var(--anchor-text-dim); }
[data-theme="light"] .pw-cat-btn:hover { color: var(--anchor-gold); }

/* ── NeuroGrid Hero ── */
.ng-hero {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
    padding: 28px 32px; border-radius: 16px;
    background: linear-gradient(135deg, var(--anchor-surface) 0%, var(--anchor-surface-2) 100%);
    border: 1px solid var(--anchor-border);
}
.ng-hero-left {}
.ng-title { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.3px; }
.ng-subtitle { font-size: 13px; color: var(--anchor-text-muted); margin-top: 4px; }
.ng-hero-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ng-status-pill {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--anchor-gold); background: rgba(215,198,163,0.10);
    padding: 5px 12px; border-radius: 20px;
}
.ng-pulse {
    width: 7px; height: 7px; border-radius: 50%; background: var(--anchor-gold);
    animation: ngPulse 2s ease-in-out infinite;
}
@keyframes ngPulse { 0%,100%{opacity:1;} 50%{opacity:0.35;} }
.ng-last-update { font-size: 12px; color: var(--anchor-text-muted); }

/* ── NeuroGrid Stock Cards ── */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.stock-card {
    background: var(--anchor-surface); border-radius: 14px; padding: 20px;
    border: 1px solid var(--anchor-border); transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer; position: relative;
}
.stock-card:hover {
    border-color: var(--anchor-gold); transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.stock-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.stock-symbol { font-size: 16px; font-weight: 700; letter-spacing: 0.3px; }
.stock-name { font-size: 12px; color: var(--anchor-text-muted); margin-top: 2px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-logo { width: 36px; height: 36px; border-radius: 8px; background: #fff; object-fit: contain; }
.stock-price { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.stock-change { display: inline-flex; padding: 3px 9px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.stock-change.positive { background: rgba(215,198,163,0.12); color: var(--anchor-gold); }
.stock-change.negative { background: rgba(233,97,75,0.12); color: var(--anchor-coral); }
.stock-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--anchor-border); }
.stock-detail-label { color: var(--anchor-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.stock-detail-value { font-weight: 600; font-size: 13px; }

/* ── Economic Calendar Section ── */
.econ-cal-section { margin-top: 36px; }
.econ-cal-toggle {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 14px 18px; background: var(--anchor-surface); border: 1px solid var(--anchor-border);
    border-radius: 12px; transition: border-color 0.2s;
    user-select: none;
}
.econ-cal-toggle:hover { border-color: var(--anchor-gold); }
.econ-cal-toggle-icon { font-size: 12px; color: var(--anchor-gold); transition: transform 0.2s; }
.econ-cal-toggle-title { font-size: 16px; font-weight: 700; margin: 0; }
.econ-cal-collapsible { margin-top: 12px; }

.ng-cal-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.ng-cal-header-left { display: flex; align-items: baseline; gap: 10px; }
.ng-cal-title { font-size: 20px; font-weight: 700; margin: 0; }
.ng-cal-subtitle { font-size: 11px; color: var(--anchor-text-muted); }
.ng-cal-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Timezone selector */
.ng-tz-select-wrap { display: flex; align-items: center; gap: 6px; }
.ng-tz-label { font-size: 11px; color: var(--anchor-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.ng-tz-select {
    padding: 5px 10px; font-size: 12px; font-weight: 500;
    background: var(--anchor-surface-2); color: var(--anchor-text);
    border: 1px solid var(--anchor-border); border-radius: 6px;
    cursor: pointer; appearance: auto;
}
.ng-tz-select:focus { outline: none; border-color: var(--anchor-gold); }

/* Toolbar (filters) */
.econ-cal-toolbar {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start;
    background: var(--anchor-surface); border: 1px solid var(--anchor-border);
    border-radius: 12px 12px 0 0; padding: 14px 18px;
    border-bottom: none;
}
.econ-cal-filter-group { display: flex; align-items: center; gap: 8px; }
.econ-cal-filter-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--anchor-text-muted); white-space: nowrap;
}
.econ-cal-countries-group { flex: 1; flex-wrap: wrap; }

.econ-cal-country-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.econ-cal-country-chip {
    padding: 3px 9px; font-size: 11px; font-weight: 600; border-radius: 5px;
    border: 1px solid var(--anchor-border); background: transparent;
    color: var(--anchor-text-muted); cursor: pointer; transition: all 0.15s ease;
    line-height: 1.3;
}
.econ-cal-country-chip:hover { border-color: var(--anchor-text-dim); color: var(--anchor-text-dim); }
.econ-cal-country-chip.active {
    background: rgba(215,198,163,0.12); border-color: var(--anchor-gold); color: var(--anchor-gold);
}

.econ-cal-importance-btns { display: flex; gap: 5px; }
.econ-cal-imp-btn {
    padding: 3px 10px; font-size: 12px; font-weight: 500; border-radius: 5px;
    border: 1px solid var(--anchor-border); background: transparent;
    color: var(--anchor-text-muted); cursor: pointer; transition: all 0.15s ease;
    display: flex; align-items: center; gap: 5px; line-height: 1.3;
}
.econ-cal-imp-btn:hover { border-color: var(--anchor-text-dim); }
.econ-cal-imp-btn.active {
    background: var(--anchor-surface-2); border-color: var(--anchor-gold); color: var(--anchor-text);
}
.econ-cal-impact-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Calendar table */
.econ-cal-table-wrap {
    overflow-x: auto; border: 1px solid var(--anchor-border);
    border-radius: 0 0 12px 12px;
    max-height: 520px; overflow-y: auto;
}
.econ-cal-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: var(--anchor-surface);
}
.econ-cal-table thead { position: sticky; top: 0; z-index: 2; }
.econ-cal-table thead th {
    text-align: left; padding: 9px 14px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--anchor-text-muted); background: var(--anchor-surface-2);
    border-bottom: 1px solid var(--anchor-border);
}
.econ-cal-table tbody td {
    padding: 7px 14px; border-bottom: 1px solid var(--anchor-border);
    color: var(--anchor-text); vertical-align: middle; font-size: 12px;
}
.econ-cal-table tbody tr:last-child td { border-bottom: none; }
.econ-cal-table tbody tr:hover { background: rgba(215,198,163,0.04); }

.econ-cal-date-row td {
    font-weight: 700; font-size: 11px; padding: 8px 14px !important;
    background: var(--anchor-surface-2); color: var(--anchor-text-muted);
    letter-spacing: 0.3px; position: sticky; top: 30px; z-index: 1;
}
.econ-cal-date-today td { color: var(--anchor-gold) !important; background: rgba(215,198,163,0.10) !important; }
.econ-cal-date-past td { color: var(--anchor-text-muted) !important; }
.econ-cal-date-future td { color: var(--anchor-teal) !important; }

.econ-cal-row-today { background: rgba(215,198,163,0.04); }
.econ-cal-row-past td { opacity: 0.55; }

.econ-cal-time { font-family: 'Lato', monospace; font-size: 11px; white-space: nowrap; color: var(--anchor-text-dim) !important; }
.econ-cal-event-name { font-weight: 500; min-width: 180px; }
.econ-cal-unit { font-size: 10px; color: var(--anchor-text-muted); }
.econ-cal-category { font-size: 11px; color: var(--anchor-text-dim); white-space: nowrap; }
.econ-cal-val { font-family: 'Lato', monospace; font-size: 11px; text-align: right; white-space: nowrap; }

.econ-cal-country-badge {
    display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 10px;
    font-weight: 700; background: rgba(30,73,109,0.15); color: var(--anchor-bay);
    letter-spacing: 0.3px;
}
.econ-cal-impact-badge {
    display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 10px;
    font-weight: 600; white-space: nowrap;
}

/* Light theme overrides */
[data-theme="light"] .ng-hero { background: linear-gradient(135deg, var(--anchor-surface) 0%, var(--anchor-surface-2) 100%); }
[data-theme="light"] .ng-status-pill { background: rgba(181,151,90,0.12); }
[data-theme="light"] .econ-cal-country-chip.active { background: rgba(181,151,90,0.12); }
[data-theme="light"] .econ-cal-country-badge { background: rgba(30,73,109,0.08); }
[data-theme="light"] .stock-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

@media (max-width: 768px) {
    .ng-hero { padding: 20px; flex-direction: column; align-items: flex-start; }
    .ng-hero-right { width: 100%; justify-content: flex-start; }
    .market-grid { grid-template-columns: 1fr; }
    .econ-cal-toolbar { flex-direction: column; gap: 10px; }
    .ng-cal-header { flex-direction: column; align-items: flex-start; }
    .econ-cal-event-name { min-width: 120px; }
}
/* ── Economic Calendar Detail Row ── */
.econ-cal-event-row.clickable { cursor: pointer; }
.econ-cal-event-row.clickable:hover { background: rgba(215,198,163,0.06); }
.econ-cal-event-row.expanded { background: rgba(215,198,163,0.06); }
.econ-cal-event-row.expanded .econ-cal-expand-icon { transform: rotate(180deg); }
.econ-cal-expand-icon {
    display: inline-block; font-size: 9px; color: var(--anchor-text-muted);
    margin-left: 4px; transition: transform 0.2s ease; vertical-align: middle;
}
.econ-cal-detail-row td { padding: 0 !important; border-bottom: 1px solid var(--anchor-border); }
.econ-cal-detail-content {
    padding: 14px 18px 14px 46px; font-size: 12px; line-height: 1.65;
    color: var(--anchor-text-dim); background: var(--anchor-surface-2);
    border-left: 3px solid var(--anchor-gold);
    max-width: 720px;
}
/* ── Economic Calendar Date Navigation ── */
.econ-cal-datebar {
    display: flex; align-items: center; gap: 8px;
    background: var(--anchor-surface); border: 1px solid var(--anchor-border);
    border-radius: 12px; padding: 10px 16px; margin-bottom: 10px;
}
.econ-cal-nav-btn {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--anchor-border);
    background: var(--anchor-surface-2); color: var(--anchor-text);
    font-size: 20px; font-weight: 300; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.15s ease;
    line-height: 1; padding: 0;
}
.econ-cal-nav-btn:hover { border-color: var(--anchor-gold); color: var(--anchor-gold); }
.econ-cal-date-display { display: flex; flex-direction: column; align-items: center; min-width: 200px; }
.econ-cal-date-label { font-size: 15px; font-weight: 700; color: var(--anchor-text); }
.econ-cal-date-full { font-size: 11px; color: var(--anchor-text-muted); margin-top: 1px; }
.econ-cal-date-sep { width: 1px; height: 28px; background: var(--anchor-border); margin: 0 4px; }
.econ-cal-today-btn {
    padding: 5px 14px; font-size: 12px; font-weight: 600; border-radius: 6px;
    border: 1px solid var(--anchor-border); background: transparent;
    color: var(--anchor-gold); cursor: pointer; transition: all 0.15s ease;
    white-space: nowrap;
}
.econ-cal-today-btn:hover { background: rgba(215,198,163,0.10); border-color: var(--anchor-gold); }
.econ-cal-date-picker {
    padding: 5px 10px; font-size: 12px; font-weight: 500;
    background: var(--anchor-surface-2); color: var(--anchor-text);
    border: 1px solid var(--anchor-border); border-radius: 6px;
    cursor: pointer; font-family: inherit;
}
.econ-cal-date-picker:focus { outline: none; border-color: var(--anchor-gold); }
.econ-cal-date-picker::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }

/* Empty state */
.econ-cal-empty {
    text-align: center; padding: 48px 20px; color: var(--anchor-text-muted);
    background: var(--anchor-surface);
}
.econ-cal-empty-icon { font-size: 36px; margin-bottom: 10px; }
.econ-cal-empty p { font-size: 13px; margin: 0; }

@media (max-width: 768px) {
    .econ-cal-datebar { flex-wrap: wrap; justify-content: center; }
    .econ-cal-date-display { min-width: 160px; }
}
/* ── Country Select/Deselect Toggle ── */
.econ-cal-country-toggle {
    padding: 3px 9px; font-size: 10px; font-weight: 700; border-radius: 5px;
    border: 1px solid var(--anchor-border); background: var(--anchor-surface-2);
    color: var(--anchor-text-muted); cursor: pointer; transition: all 0.15s ease;
    text-transform: uppercase; letter-spacing: 0.4px; line-height: 1.3;
}
.econ-cal-country-toggle:hover:not(:disabled) { border-color: var(--anchor-gold); color: var(--anchor-gold); }
.econ-cal-country-toggle:disabled { opacity: 0.35; cursor: default; }

/* ── Polymarket Prediction Markets ── */
.pm-section { margin-top: 36px; }
.pm-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.pm-header-left { display: flex; align-items: baseline; gap: 10px; }
.pm-title { font-size: 20px; font-weight: 700; margin: 0; }
.pm-subtitle { font-size: 11px; color: var(--anchor-text-muted); margin: 0; white-space: nowrap; }
.pm-last-update { font-size: 11px; color: var(--anchor-text-muted); }
.pm-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.pm-card {
    display: flex; flex-direction: column; gap: 12px;
    background: var(--anchor-surface); border-radius: 14px; padding: 20px;
    border: 1px solid var(--anchor-border); transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer; text-decoration: none; color: inherit;
}
.pm-card:hover {
    border-color: var(--anchor-gold); transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18); text-decoration: none; color: inherit;
}
.pm-card-top { display: flex; gap: 12px; align-items: flex-start; }
.pm-card-img {
    width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
    flex-shrink: 0; background: var(--anchor-surface-2);
}
.pm-card-img-placeholder {
    width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--anchor-surface-2); font-size: 22px;
}
.pm-card-question {
    font-size: 14px; font-weight: 600; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.pm-prob-labels {
    display: flex; justify-content: space-between; font-size: 12px; font-weight: 600;
}
.pm-prob-yes { color: var(--anchor-gold); }
.pm-prob-no { color: var(--anchor-text-muted); }
.pm-prob-bar {
    height: 8px; border-radius: 4px; background: var(--anchor-surface-2); overflow: hidden;
}
.pm-prob-fill {
    height: 100%; border-radius: 4px; background: var(--anchor-gold);
    transition: width 0.4s ease;
}
.pm-card-stats {
    display: flex; justify-content: space-between; font-size: 11px;
    color: var(--anchor-text-muted); padding-top: 10px;
    border-top: 1px solid var(--anchor-border);
}
@media (max-width: 640px) {
    .pm-grid { grid-template-columns: 1fr; }
}

/* ── Polymarket Scanner Page ── */
.pms-hero { margin-bottom: 16px; }
.pms-title { font-size: 26px; font-weight: 800; margin: 0 0 4px 0; }
.pms-subtitle { font-size: 13px; color: var(--anchor-text-muted); margin: 0; }
/* AI Smart Search bar */
.pms-smart-search {
    display: flex; align-items: flex-end; gap: 12px;
    padding: 16px 20px; margin-bottom: 12px;
    background: linear-gradient(135deg, var(--anchor-surface), rgba(215,198,163,0.06));
    border: 1px solid var(--anchor-gold); border-radius: 12px;
}
.pms-smart-search-left { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.pms-smart-label {
    font-size: 14px; font-weight: 700; color: var(--anchor-gold);
    display: flex; align-items: center; gap: 6px;
}
.pms-smart-label-icon {
    width: 20px; height: 20px; color: var(--anchor-gold); flex-shrink: 0;
    filter: drop-shadow(0 0 3px rgba(215,198,163,0.5));
}
.pms-smart-tagline {
    font-size: 13px; color: var(--anchor-text-muted); margin: 0; line-height: 1.4;
}
.pms-smart-input { border-radius: 8px 0 0 8px; }
.pms-smart-btn {
    background: var(--anchor-gold); color: #000; border-color: var(--anchor-gold);
    font-weight: 600; padding: 8px 16px; font-size: 12px; letter-spacing: 0.3px;
}
.pms-smart-btn:hover { background: #c9b06a; }
/* AI result card — recommended side badge */
.pms-rec-badge {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.pms-rec-yes { background: rgba(34,197,94,0.15); color: #22c55e; }
.pms-rec-no { background: rgba(239,68,68,0.15); color: #ef4444; }
.pms-smart-card-reasoning {
    font-size: 13px; line-height: 1.55; color: var(--anchor-text-muted);
    padding: 12px 14px; border-left: 3px solid var(--anchor-gold);
    background: var(--anchor-surface-2); border-radius: 0 8px 8px 0;
}
.pms-filters {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
    padding: 16px 20px; margin-bottom: 16px;
    background: var(--anchor-surface); border: 1px solid var(--anchor-border);
    border-radius: 12px;
}
.pms-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.pms-filter-group.pms-filter-action { margin-left: auto; min-width: unset; }
.pms-filter-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--anchor-text-muted);
}
.pms-filter-select {
    padding: 8px 12px; font-size: 13px; border-radius: 8px;
    border: 1px solid var(--anchor-border); background: var(--anchor-surface-2);
    color: var(--anchor-text); cursor: pointer; outline: none;
    transition: border-color 0.2s;
}
.pms-filter-select:focus { border-color: var(--anchor-gold); }
.pms-filter-search { min-width: 220px; flex: 1; }
.pms-search-wrap { display: flex; gap: 0; }
.pms-filter-input {
    flex: 1; padding: 8px 12px; font-size: 13px; border-radius: 8px 0 0 8px;
    border: 1px solid var(--anchor-border); border-right: none;
    background: var(--anchor-surface-2); color: var(--anchor-text);
    outline: none; transition: border-color 0.2s;
}
.pms-filter-input:focus { border-color: var(--anchor-gold); }
.pms-filter-input::placeholder { color: var(--anchor-text-muted); opacity: 0.6; }
.pms-search-btn {
    padding: 8px 12px; font-size: 13px; border-radius: 0 8px 8px 0;
    border: 1px solid var(--anchor-border); border-left: none;
    background: var(--anchor-surface-2); color: var(--anchor-text);
    cursor: pointer; transition: background 0.2s;
}
.pms-search-btn:hover { background: var(--anchor-gold); color: #000; }
.pms-scan-btn { white-space: nowrap; padding: 8px 20px; font-size: 13px; }
.pms-status-row {
    display: flex; align-items: center; gap: 10px; padding: 12px 0;
    border-bottom: 1px solid var(--anchor-border); margin-bottom: 20px;
}
#pmScannerStatus {
    font-size: 13px; color: var(--anchor-text-muted);
}
.pms-stop-btn {
    padding: 3px 10px; font-size: 11px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--anchor-border); background: var(--anchor-surface-2);
    color: var(--anchor-text); margin-left: 8px; vertical-align: middle;
    transition: background 0.2s, border-color 0.2s;
}
.pms-stop-btn:hover { background: #ef4444; border-color: #ef4444; color: #fff; }
/* Loader spinner */
.pms-loader {
    display: flex; align-items: center; gap: 12px; padding: 20px 0;
    font-size: 13px; color: var(--anchor-text-muted);
}
@keyframes pms-spin { to { transform: rotate(360deg); } }
.pms-spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid var(--anchor-border);
    border-top-color: var(--anchor-gold);
    animation: pms-spin 0.8s linear infinite;
}
/* Pagination */
.pms-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 24px 0 8px; flex-wrap: wrap;
}
.pms-page-btn {
    min-width: 36px; height: 36px; padding: 0 10px; font-size: 13px;
    border-radius: 8px; border: 1px solid var(--anchor-border);
    background: var(--anchor-surface-2); color: var(--anchor-text);
    cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.pms-page-btn:hover { border-color: var(--anchor-gold); color: var(--anchor-gold); }
.pms-page-btn.active {
    background: var(--anchor-gold); color: #000; border-color: var(--anchor-gold);
    font-weight: 700;
}
.pms-page-btn:disabled { opacity: 0.4; cursor: default; }
.pms-page-ellipsis {
    font-size: 13px; color: var(--anchor-text-muted); padding: 0 4px;
}
.pms-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}
@keyframes pms-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
.pms-card-loading {
    animation: pms-pulse 1.5s ease-in-out infinite;
}
.pms-card {
    display: flex; flex-direction: column; gap: 12px;
    background: var(--anchor-surface); border-radius: 14px; padding: 22px;
    border: 1px solid var(--anchor-border);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pms-card:hover {
    border-color: var(--anchor-gold);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.pms-card-top { display: flex; gap: 12px; align-items: flex-start; }
.pms-card-img {
    width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
    flex-shrink: 0; background: var(--anchor-surface-2);
}
.pms-card-img-placeholder {
    width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--anchor-surface-2); font-size: 22px;
}
.pms-card-header { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pms-card-cat {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--anchor-gold); opacity: 0.85;
}
.pms-card-question {
    font-size: 15px; font-weight: 600; line-height: 1.35;
}
.pms-return {
    font-size: 11px; font-weight: 700; color: var(--anchor-gold);
}
.pms-analysis {
    font-size: 13px; line-height: 1.55; color: var(--anchor-text-muted);
    padding: 12px 14px; border-left: 3px solid var(--anchor-gold);
    background: var(--anchor-surface-2); border-radius: 0 8px 8px 0;
}
.pms-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 10px; border-top: 1px solid var(--anchor-border);
}
.pms-card-link {
    font-size: 12px; font-weight: 600; color: var(--anchor-gold);
    text-decoration: none; white-space: nowrap;
}
.pms-card-link:hover { text-decoration: underline; }
@media (max-width: 768px) {
    .pms-filters { flex-direction: column; }
    .pms-filter-group { min-width: unset; width: 100%; }
    .pms-filter-group.pms-filter-action { margin-left: 0; }
    .pms-scan-btn { width: 100%; }
}
@media (max-width: 640px) {
    .pms-grid { grid-template-columns: 1fr; }
}
