/* ================================================================
   FideO v2.2 — Social Titan + Polished Views
   DNA: Twitter/X layout · Instagram energy · Cash App wallet
   Brand: Bodoni Moda (logo) · Body: Plus Jakarta Sans
   ================================================================ */

:root {
    --primary: #1d9bf0;
    --primary-hover: #1a8cd8;
    --primary-light: #e8f5fd;
    --primary-dark: #1471b0;
    --primary-rgb: 29, 155, 240;

    --gradient-brand: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #fda085 100%);
    --gradient-money: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    --gradient-wallet: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);

    --bg-app: #f0f2f5;
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f7f9f9;
    --bg-hover: #f7f9f9;
    --bg-sidebar: #0f1419;
    --bg-sidebar-hover: rgba(231,233,234,0.08);
    --bg-sidebar-active: rgba(29,155,240,0.12);

    --border: #eff3f4;
    --border-light: #f7f9f9;
    --border-heavy: #cfd9de;

    --text-primary: #0f1419;
    --text-secondary: #536471;
    --text-tertiary: #8899a6;
    --text-inverse: #ffffff;
    --text-sidebar: #8899a6;
    --text-sidebar-active: #ffffff;
    --text-link: var(--primary);

    --success: #00ba7c;
    --success-light: #e8f8f2;
    --warning: #ffad1f;
    --warning-light: #fff8e6;
    --error: #f4212e;
    --error-light: #fee8e9;
    --info: #1d9bf0;
    --info-light: #e8f5fd;

    --color-comment: #1d9bf0;
    --color-repost: #00ba7c;
    --color-like: #f91880;
    --color-share: #1d9bf0;

    --font-display: 'Roboto', 'Helvetica Neue', sans-serif;
    --font-body: 'Roboto', 'Helvetica Neue', sans-serif;

    --space-xs: 0.25rem; --space-sm: 0.5rem; --space-md: 1rem;
    --space-lg: 1.5rem; --space-xl: 2rem; --space-2xl: 3rem;

    --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
    --radius-xl: 24px; --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 24px 56px rgba(0,0,0,0.16);

    --transition-fast: 100ms ease;
    --transition-base: 180ms ease;
    --transition-slow: 300ms cubic-bezier(0.2, 0, 0, 1);

    --sidebar-width: 244px;
    --sidebar-collapsed: 68px;
    --content-pad: 1.5rem;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-body); background: var(--bg-app);
    color: var(--text-primary); line-height: 1.55;
    -webkit-font-smoothing: antialiased; font-weight: 400;
}
.screen { display: none; }
.screen.active { display: block; }/* ════════  AUTH  ════════ */
.auth-container { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-visual {
    position: relative; background: var(--bg-sidebar);
    padding: var(--space-2xl); display: flex; align-items: center;
    justify-content: center; overflow: hidden;
}
.visual-bg {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 40%, rgba(29,155,240,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(249,24,128,0.1) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(0,186,124,0.08) 0%, transparent 40%);
}
.visual-bg::before {
    content: ''; position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='0.5' fill='rgba(255,255,255,0.025)'/%3E%3C/svg%3E");
    background-size: 60px 60px;
}
.visual-content { position: relative; z-index: 1; text-align: center; color: var(--text-inverse); animation: fadeUp 0.6s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.brand-title {
    font-family: var(--font-display); font-size: 4.5rem; font-weight: 700;
    letter-spacing: -0.01em; margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.65) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.brand-logo-img { display: block; object-fit: contain; }
.brand-tagline { font-size: 1.0625rem; color: rgba(255,255,255,0.5); line-height: 1.7; margin-bottom: 2.5rem; font-weight: 400; }
.trust-metrics { display: flex; gap: 2.5rem; justify-content: center; }
.metric { display: flex; flex-direction: column; gap: 0.25rem; }
.metric-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: #fff; }
.metric-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.3); font-weight: 600; }

.auth-forms { display: flex; align-items: center; justify-content: center; padding: var(--space-2xl) 3rem; background: var(--bg-primary); }
.form-panel { display: none; width: 100%; max-width: 380px; animation: fadeUp 0.35s ease-out; }
.form-panel.active { display: block; }
.form-panel h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.25rem; }
.form-subtitle { color: var(--text-secondary); margin-bottom: var(--space-xl); font-size: 0.9375rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.125rem; }
.form-group { display: flex; flex-direction: column; gap: 6px; position: relative; }
.form-group label { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.form-group input, .form-group select, .form-group textarea {
    padding: 0.6875rem 0.875rem; border: 1.5px solid var(--border-heavy);
    border-radius: var(--radius-sm); font-family: var(--font-body);
    font-size: 0.9375rem; transition: all var(--transition-base);
    background: var(--bg-primary); color: var(--text-primary);
    resize: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
    resize: none;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-tertiary); resize: none; }
.form-footer { margin-top: var(--space-lg); text-align: center; color: var(--text-secondary); font-size: 0.875rem; }

/* ════════  BUTTONS  ════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; padding: 0.5625rem 1.25rem; border: none;
    border-radius: var(--radius-full); font-family: var(--font-body);
    font-size: 0.875rem; font-weight: 700; cursor: pointer;
    transition: all var(--transition-base); text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--text-inverse); }
.btn-primary:hover { background: var(--primary-hover); transform: scale(1.02); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1.5px solid var(--border-heavy); }
.btn-outline:hover { background: var(--bg-hover); border-color: var(--text-tertiary); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.3125rem 0.75rem; font-size: 0.8125rem; }
.btn-icon { transition: transform var(--transition-fast); }
.btn:hover .btn-icon { transform: translateX(2px); }
.btn-icon-only { width: 36px; height: 36px; border-radius: var(--radius-full); border: none; background: transparent; color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast); display: flex; align-items: center; justify-content: center; }
.btn-icon-only:hover { background: var(--bg-hover); color: var(--text-primary); }
.link { color: var(--primary); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.link-subtle { font-size: 0.8125rem; color: var(--primary); text-decoration: none; font-weight: 600; }
.link-subtle:hover { text-decoration: underline; }
.back-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.875rem; font-weight: 600; font-family: var(--font-body); display: flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.625rem; border-radius: var(--radius-full); transition: all var(--transition-fast); }
.back-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-close { background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 0.25rem; border-radius: var(--radius-full); transition: all var(--transition-fast); }
.btn-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-send { background: var(--primary); color: #fff; border: none; border-radius: var(--radius-full); padding: 0.5rem 1rem; font-weight: 700; cursor: pointer; font-family: var(--font-body); }
.btn-text { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 600; font-family: var(--font-body); font-size: 0.8125rem; display: inline-flex; align-items: center; gap: 0.25rem; }

/* ════════  SIDEBAR NAV  ════════ */
#dashboard-screen.active { display: flex; min-height: 100vh; overflow-x: hidden; }.navbar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width); background: var(--bg-sidebar);
    display: flex; flex-direction: column; z-index: 200;
    overflow-y: auto; overflow-x: hidden; padding: 1rem 0.75rem;
}
.nav-brand { padding: 0.25rem 0.75rem 1.25rem; }
.nav-brand .brand-logo { font-family: var(--font-display); font-size: 1.625rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.nav-menu { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-link {
    display: flex; align-items: center; gap: 0.875rem;
    padding: 0.625rem 0.875rem; border-radius: var(--radius-full);
    text-decoration: none; color: var(--text-sidebar);
    font-weight: 500; font-size: 0.9375rem;
    transition: all var(--transition-base); white-space: nowrap; position: relative;
}
.nav-link svg { width: 22px; height: 22px; flex-shrink: 0; opacity: 0.5; transition: opacity var(--transition-fast); }
.nav-link:hover { background: var(--bg-sidebar-hover); color: #e7e9ea; }
.nav-link:hover svg { opacity: 0.85; }
.nav-link.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); font-weight: 700; }
.nav-link.active svg { opacity: 1; color: var(--primary); }
.nav-link.active::before { content: ''; position: absolute; left: -0.75rem; top: 50%; transform: translateY(-50%); width: 3px; height: 24px; background: var(--primary); border-radius: 0 4px 4px 0; }

.nav-user {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0.75rem; margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-full); cursor: default;
}
.user-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--gradient-brand); color: var(--text-inverse); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; flex-shrink: 0; }
.user-avatar img { width: 100%; height: 100%; border-radius: var(--radius-full); object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 0.875rem; color: #e7e9ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-balance { font-size: 0.75rem; color: var(--success); font-weight: 700; }
.nav-user .btn-icon-only { color: var(--text-sidebar); width: 32px; height: 32px; }
.nav-user .btn-icon-only:hover { color: #fff; background: var(--bg-sidebar-hover); }
#notif-panel { border-radius: var(--radius-lg) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-xl) !important; left: var(--sidebar-width) !important; right: auto !important; top: auto !important; bottom: 80px !important; background: var(--bg-primary) !important; }

/* ════════  MAIN CONTENT  ════════ */
.dashboard-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; padding: 0; }
.view { display: none; animation: viewIn 0.25s ease-out; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

.view-header {
    padding: 1rem var(--content-pad);
    background: rgba(255,255,255,0.88); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.view-title { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.01em; }
.view-subtitle { color: var(--text-secondary); font-size: 0.8125rem; margin-top: 2px; font-weight: 400; }

/* Universal view content padding */
#overview-view > :not(.view-header),
#borrow-view > :not(.view-header),
#lend-view > :not(.view-header),
#leaderboard-view > :not(.view-header),
#agreements-contracts-panel > :not(.view-header),
#agreements-arbitration-panel > :not(.view-header),
#members-directory-panel > :not(.view-header),
#members-leaderboard-panel > :not(.view-header),
#groups-view > :not(.view-header),
#guarantees-view > :not(.view-header) {
    margin-left: var(--content-pad);
    margin-right: var(--content-pad);
}

/* ════════  STATS  ════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; margin-top: 1.25rem; }
.stat-card {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1rem 1.25rem;
    display: flex; gap: 0.875rem; transition: all var(--transition-base);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon-green { background: var(--success-light); color: var(--success); }
.stat-icon-blue  { background: var(--info-light); color: var(--info); }
.stat-icon-purple { background: #f3e8ff; color: #9333ea; }
.stat-icon-orange { background: var(--warning-light); color: var(--warning); }
.stat-content { flex: 1; min-width: 0; }
.stat-label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 2px; }
.stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat-change { font-size: 0.6875rem; color: var(--text-tertiary); margin-top: 2px; }
.stat-change.positive { color: var(--success); }

/* ════════  SECTION CARDS / DASHBOARD  ════════ */
.section-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 0.75rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.875rem; }
.section-header h3 { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }
.dashboard-sections { display: grid; grid-template-columns: 1.5fr 1fr; gap: 0.75rem; }

.quick-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.action-btn {
    display: flex; align-items: center; gap: 0.875rem;
    padding: 0.875rem 1rem; background: var(--bg-tertiary);
    border: none; border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 0.875rem; font-weight: 600;
    color: var(--text-primary); cursor: pointer; transition: all var(--transition-base);
    text-align: left; width: 100%;
}
.action-btn:hover { background: var(--border); transform: scale(1.01); }
.action-icon { width: 38px; height: 38px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.action-text { flex: 1; }
.action-text strong { display: block; font-size: 0.875rem; font-weight: 700; }
.action-text span { font-size: 0.6875rem; color: var(--text-secondary); }

.activity-list { }
.activity-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0; }
.activity-item + .activity-item { border-top: 1px solid var(--border); }
.activity-icon { width: 34px; height: 34px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-content { flex: 1; min-width: 0; }
.activity-content p { font-size: 0.8125rem; line-height: 1.4; }
.activity-time { font-size: 0.6875rem; color: var(--text-tertiary); }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--text-tertiary); font-size: 0.8125rem; }
.empty-state svg { margin-bottom: 0.75rem; opacity: 0.2; }
.loading-state { text-align: center; padding: 2rem; color: var(--text-tertiary); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; margin: 0 auto 0.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════  WALLET  ════════ */
#wallet-view > .view-header { position: sticky; top: 0; z-index: 10; }
.wallet-balance-card {
    background: var(--gradient-wallet); border-radius: var(--radius-xl);
    padding: 1.75rem 2rem; color: #fff;
    margin: 1.25rem var(--content-pad) 1rem;
    position: relative; overflow: hidden;
}
.wallet-balance-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 50%, rgba(29,155,240,0.12) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(249,24,128,0.08) 0%, transparent 50%); pointer-events: none; }
.wallet-balance-card::after { content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,0.02); pointer-events: none; }
.wallet-balance-row { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; margin-bottom: 1.5rem; }
.wallet-balance-main { }
.wallet-balance-label { font-size: 0.75rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: 0.25rem; }
.wallet-balance-amount { font-family: var(--font-display); font-size: 2.75rem; font-weight: 700; letter-spacing: -0.03em; }
.wallet-quick-actions { display: flex; gap: 0.5rem; position: relative; z-index: 1; }
.wallet-quick-actions .btn-outline { border-color: rgba(255,255,255,0.2); color: #fff; }
.wallet-quick-actions .btn-outline:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.08); }
.wallet-metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; position: relative; z-index: 1; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.06); }
.wallet-metric { }
.wallet-metric-label { font-size: 0.625rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 0.125rem; }
.wallet-metric-value { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; }
#wallet-view > .section-card { margin: 0 var(--content-pad) 0.75rem; }
.wallet-chart-controls { display: flex; gap: 0.375rem; }
.wallet-chart-controls select { font-size: 0.75rem; padding: 0.3125rem 0.5rem; border: 1.5px solid var(--border); border-radius: var(--radius-full); font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); cursor: pointer; }

/* ═══ Wallet Transactions — Venmo Style ═══ */
.txn-row {
    display: flex; align-items: center; gap: 0.875rem;
    padding: 0.875rem 0; border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}
.txn-row:last-child { border-bottom: none; }
.txn-row:hover { background: var(--bg-hover); margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; border-radius: var(--radius-md); }
.txn-icon {
    width: 40px; height: 40px; border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0; font-weight: 700;
}
.txn-info { flex: 1; min-width: 0; }
.txn-label { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.txn-note { font-size: 0.75rem; color: var(--text-secondary); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-time { font-size: 0.6875rem; color: var(--text-tertiary); margin-top: 2px; }
.txn-amount { font-family: var(--font-display); font-size: 1rem; font-weight: 700; text-align: right; white-space: nowrap; min-width: 80px; }
.txn-balance { font-size: 0.6875rem; color: var(--text-tertiary); text-align: right; min-width: 70px; white-space: nowrap; }

/* ════════  CONTRACTS SUMMARY (shared for contracts + arb)  ════════ */
.contracts-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem; margin: 1rem 0;
}
.summary-card-contract {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1rem 1.25rem;
    display: flex; align-items: center; gap: 0.875rem;
    transition: all var(--transition-base);
}
.summary-card-contract:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.summary-icon {
    width: 44px; height: 44px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.summary-icon-blue { background: var(--info-light); color: var(--info); }
.summary-icon-green { background: var(--success-light); color: var(--success); }
.summary-icon-orange { background: var(--warning-light); color: var(--warning); }
.summary-content { flex: 1; }
.summary-label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.summary-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }

/* ════════  MODALS  ════════ */
.modal { display: none; position: fixed; inset: 0; z-index: 500; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); display: none; z-index: 500; }
.modal-overlay.active { display: flex; align-items: center; justify-content: center; }
.modal-content { position: relative; background: var(--bg-primary); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); width: 90%; max-width: 520px; max-height: 85vh; overflow-y: auto; animation: modalPop 0.2s cubic-bezier(0.2, 0, 0, 1); }
.modal-large { max-width: 680px; }
@keyframes modalPop { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; }
.modal-close { width: 34px; height: 34px; border-radius: var(--radius-full); border: none; background: transparent; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition-fast); }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.875rem 1.25rem; border-top: 1px solid var(--border); }
.fullscreen-modal .modal-content { width: 95%; max-width: 960px; max-height: 90vh; }

.txn-date-btn {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.txn-date-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.txn-date-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
/* ════════  TABS (pill style)  ════════ */
.contracts-tabs { display: flex; gap: 0; margin-bottom: 0.875rem; background: var(--bg-tertiary); border-radius: var(--radius-full); padding: 3px; }
.contracts-tab { flex: 1; padding: 0.5rem 0.75rem; border: none; background: transparent; border-radius: var(--radius-full); font-family: var(--font-body); font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all var(--transition-base); text-align: center; }
.contracts-tab:hover { color: var(--text-primary); }
.contracts-tab.active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-sm); font-weight: 700; }

/* ════════  FEED  ════════ */
.feed-container { display: grid; grid-template-columns: 1fr; gap: 0; max-width: 680px; width: 100%; margin: 0 auto; }
.feed-container-full { display: grid; grid-template-columns: 1fr 300px; gap: 0; max-width: 980px; width: 100%; margin: 0 auto; align-items: start; }
.feed-main { min-width: 0; border-right: 1px solid var(--border); }
#feed-scroll-container { height: 100vh; overflow-y: auto; overflow-x: hidden; position: sticky; top: 0; }
#feed-scroll-container { height: 100vh; overflow-y: auto; overflow-x: hidden; }
.create-post-box { background: var(--bg-primary); border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; display: flex; gap: 0.75rem; }
.post-avatar, .create-post-avatar { width: 42px; height: 42px; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8125rem; flex-shrink: 0; overflow: hidden; }
.post-avatar.has-image img, .create-post-avatar.has-image img { width: 100%; height: 100%; border-radius: var(--radius-full); object-fit: cover; }
.create-post-input { flex: 1; min-width: 0; }
.create-post-input textarea { width: 100%; border: none; resize: none; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.5; color: var(--text-primary); background: transparent; outline: none; padding: 0.25rem 0; }
.create-post-input textarea::placeholder { color: var(--text-tertiary); }
.create-post-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.post-attach-actions { display: flex; gap: 0; }
.post-attach-btn { width: 36px; height: 36px; border-radius: var(--radius-full); border: none; background: transparent; color: var(--primary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition-fast); }
.post-attach-btn:hover { background: rgba(var(--primary-rgb), 0.1); }
.post-attach-btn svg { width: 18px; height: 18px; }
.post-submit-area { display: flex; align-items: center; gap: 0.75rem; }
.char-count { font-size: 0.75rem; color: var(--text-tertiary); font-weight: 600; font-variant-numeric: tabular-nums; }
.post-attachments-preview { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.75rem; }
.attachment-preview-card { display: flex; align-items: center; gap: 0.375rem; padding: 0.3125rem 0.625rem; background: var(--bg-tertiary); border-radius: var(--radius-full); font-size: 0.8125rem; }
.attachment-preview-text { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.attachment-remove-btn { width: 20px; height: 20px; border: none; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all var(--transition-fast); }
.attachment-remove-btn:hover { background: var(--error-light); color: var(--error); }
.attachment-preview-card.photo-preview { padding: 0; overflow: hidden; border-radius: var(--radius-md); position: relative; max-width: 120px; }
.attachment-preview-card.photo-preview img { width: 100%; height: 80px; object-fit: cover; display: block; }
.attachment-preview-card.photo-preview .attachment-remove-btn { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.6); color: #fff; }
.attachment-preview-content { display: flex; align-items: center; gap: 0.375rem; }

/* Post modals */
.post-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); z-index: 600; display: flex; align-items: center; justify-content: center; }
.post-modal-box, .post-modal-content { background: var(--bg-primary); border-radius: var(--radius-xl); padding: 1.5rem; width: 90%; max-width: 420px; box-shadow: var(--shadow-xl); animation: modalPop 0.2s ease-out; }
.post-modal-lg { max-width: 560px; }
.post-modal-box h4, .post-modal-header { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
.post-modal-body { }
.post-modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.post-modal-input, .post-modal-box input { width: 100%; padding: 0.625rem 0.75rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.875rem; margin-bottom: 0.75rem; background: var(--bg-primary); color: var(--text-primary); }
.post-modal-box input:focus, .post-modal-input:focus { outline: none; border-color: var(--primary); }
.gif-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.375rem; max-height: 280px; overflow-y: auto; }
.gif-grid img { width: 100%; border-radius: var(--radius-sm); cursor: pointer; transition: transform var(--transition-fast); }
.gif-grid img:hover { transform: scale(1.04); }
.gif-placeholder { padding: 2rem; text-align: center; color: var(--text-tertiary); font-size: 0.875rem; }
.location-suggestions { display: flex; flex-direction: column; gap: 1px; }
.location-option { padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.875rem; transition: background var(--transition-fast); }
.location-option:hover { background: var(--bg-tertiary); }
.tag-user-item { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.75rem; cursor: pointer; border-radius: var(--radius-md); transition: background var(--transition-fast); }
.tag-user-item:hover { background: var(--bg-tertiary); }
.tag-user-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; overflow: hidden; }
.tag-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tag-user-name { font-weight: 700; font-size: 0.875rem; }
.tag-user-username { font-size: 0.75rem; color: var(--text-secondary); }
.tag-user-results { max-height: 200px; overflow-y: auto; }
.tagged-users-list { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.tagged-user-chip { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; background: var(--primary-light); color: var(--primary); border-radius: var(--radius-full); font-size: 0.8125rem; font-weight: 600; }
.chip-remove { border: none; background: transparent; color: var(--primary); cursor: pointer; font-size: 1rem; padding: 0; opacity: 0.6; }
.chip-remove:hover { opacity: 1; }

/* Feed tabs */
.feed-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg-primary); padding: 0; }
.feed-tab { flex: 1; padding: 0.875rem 0; border: none; background: transparent; color: var(--text-secondary); font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600; cursor: pointer; position: relative; transition: all var(--transition-base); text-align: center; }
.feed-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.feed-tab.active { color: var(--text-primary); font-weight: 700; }
.feed-tab.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 56px; height: 4px; background: var(--primary); border-radius: 4px; }

/* Posts */
.posts-feed { display: flex; flex-direction: column; }
.post-card { background: var(--bg-primary); border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; transition: background var(--transition-fast); }
.post-card:hover { background: var(--bg-hover); }
.post-author-info { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.25rem; }
.post-author-avatar { width: 42px; height: 42px; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8125rem; flex-shrink: 0; overflow: hidden; }
.post-author-avatar.has-image img { width: 100%; height: 100%; object-fit: cover; }
.post-author-name { font-weight: 700; font-size: 0.9375rem; }
.verified-badge { display: inline-flex; align-items: center; color: var(--primary); margin-left: 3px; }
.verified-badge svg { width: 16px; height: 16px; }
.post-author-username { font-size: 0.8125rem; color: var(--text-secondary); margin-left: 0.25rem; }
.post-timestamp { font-size: 0.8125rem; color: var(--text-tertiary); }
.post-content { font-size: 0.9375rem; line-height: 1.5; margin-bottom: 0.375rem; word-wrap: break-word; }
.post-media { border-radius: var(--radius-lg); overflow: hidden; margin-top: 0.75rem; border: 1px solid var(--border); }
.post-media img { width: 100%; display: block; }
.post-link-card { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.875rem; background: var(--bg-tertiary); border-radius: var(--radius-lg); margin-top: 0.5rem; font-size: 0.875rem; color: var(--text-link); text-decoration: none; border: 1px solid var(--border); }
.post-link-card:hover { background: var(--border); }
.post-location-tag, .post-mentions-tag { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.375rem; }
.post-mention { color: var(--primary); font-weight: 600; }
.post-actions { display: flex; justify-content: space-between; margin-top: 0.5rem; max-width: 400px; }
.post-action { display: flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.625rem; border-radius: var(--radius-full); border: none; background: transparent; color: var(--text-tertiary); font-family: var(--font-body); font-size: 0.8125rem; cursor: pointer; transition: all var(--transition-fast); }
.post-action svg { width: 18px; height: 18px; }
.post-action:nth-child(1):hover { background: rgba(29,155,240,0.1); color: var(--color-comment); }
.post-action:nth-child(2):hover, .post-action.reposted { background: rgba(0,186,124,0.1); color: var(--color-repost); }
.post-action:nth-child(3):hover, .post-action.liked { background: rgba(249,24,128,0.1); color: var(--color-like); }
.post-action.liked svg { fill: var(--color-like); color: var(--color-like); }
.post-action:nth-child(4):hover { background: rgba(29,155,240,0.1); color: var(--color-share); }
.post-action.bookmarked { color: var(--primary); }
.post-action.bookmarked svg { fill: var(--primary); }
.post-context-menu { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-xl); min-width: 180px; overflow: hidden; }
.post-context-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border: none; background: transparent; cursor: pointer; font-size: 0.875rem; color: var(--text-primary); text-align: left; }
.post-context-menu button:hover { background: var(--bg-hover); }
.post-hashtag { color: var(--primary); cursor: pointer; font-weight: 500; }
.post-hashtag:hover { text-decoration: underline; }
.post-mention { color: var(--primary); cursor: pointer; font-weight: 500; }
.post-mention:hover { text-decoration: underline; }

/* Comments */
.comments-section { background: var(--bg-tertiary); padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.comment-item { display: flex; gap: 0.625rem; padding: 0.5rem 0; }
.comment-item + .comment-item { border-top: 1px solid var(--border); }
.comment-avatar { width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.comment-avatar.has-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.comment-body { flex: 1; min-width: 0; }
.comment-author { font-weight: 700; font-size: 0.8125rem; }
.comment-username { font-size: 0.75rem; color: var(--text-secondary); margin-left: 0.25rem; }
.comment-text { font-size: 0.875rem; line-height: 1.4; margin-top: 0.125rem; }
.comment-time { font-size: 0.6875rem; color: var(--text-tertiary); }
.comment-input-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.comment-input-row input { flex: 1; padding: 0.5rem 0.875rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-full); font-family: var(--font-body); font-size: 0.8125rem; background: var(--bg-primary); color: var(--text-primary); }
.comment-input-row input:focus { outline: none; border-color: var(--primary); }

/* ═══ Feed Sidebar — Who to Follow ═══ */
.feed-sidebar, .feed-sidebar-right { display: flex; flex-direction: column; gap: 0; padding: 0.75rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.feed-sidebar-right { top: 56px; height: calc(100vh - 56px); padding: 1rem 0.75rem; gap: 1rem; display: flex; flex-direction: column; }
.sidebar-widget { background: var(--bg-tertiary); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 0; }
.sidebar-widget-title, .sidebar-widget-header { padding: 1rem 1rem 0.625rem; }
.sidebar-widget-title h2, .sidebar-widget-header h2 { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.sidebar-widget-item { padding: 0.625rem 1rem; transition: background var(--transition-fast); }
.sidebar-widget-item:hover { background: rgba(0,0,0,0.03); }
.widget-show-more { display: block; padding: 0.75rem 1rem; color: var(--primary); font-weight: 600; font-size: 0.8125rem; cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; font-family: var(--font-body); transition: background var(--transition-fast); }
.widget-show-more:hover { background: rgba(0,0,0,0.03); }
.user-suggestion { display: flex; align-items: center; gap: 0.75rem; width: 100%; }
.user-suggestion-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--gradient-brand); padding: 2px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: #fff; font-size: 0.75rem; font-weight: 700; }
.user-suggestion-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-full); }
.user-suggestion-info { flex: 1; min-width: 0; overflow: hidden; }
.user-suggestion-name { font-weight: 700; font-size: 0.875rem; display: flex; align-items: center; gap: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-suggestion-username { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-suggestion-title { font-size: 0.6875rem; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-btn { padding: 0.375rem 1rem; border-radius: var(--radius-full); border: none; background: var(--text-primary); color: var(--bg-primary); font-family: var(--font-body); font-size: 0.8125rem; font-weight: 700; cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0; white-space: nowrap; }
.follow-btn:hover { opacity: 0.85; }
.follow-btn.following { background: transparent; border: 1.5px solid var(--border-heavy); color: var(--text-primary); }
.user-search-results, .search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-height: 220px; overflow-y: auto; z-index: 10; }
.user-search-item { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.875rem; transition: background var(--transition-fast); }
.user-search-item:hover { background: var(--bg-hover); }
.user-avatar-sm { width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 700; flex-shrink: 0; }
.selected-user-card { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: var(--bg-tertiary); border-radius: var(--radius-md); margin-top: 0.5rem; }
.results-count { font-size: 0.75rem; color: var(--text-tertiary); }

/* ════════  BORROW / LEND  ════════ */
.borrow-stats, .borrow-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.borrow-stat { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; text-align: center; }
.borrow-stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.borrow-stat-label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-card-lend { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 0.875rem; }

/* Progress Steps */
.application-progress, .progress-steps { display: flex; gap: 0; margin-bottom: 1.25rem; counter-reset: step; }
.progress-step { flex: 1; position: relative; text-align: center; padding-top: 2.5rem; }
.progress-step::before { content: counter(step); counter-increment: step; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--bg-tertiary); border: 2px solid var(--border-heavy); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary); z-index: 1; }
.progress-step::after { content: ''; position: absolute; top: 13px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--border-heavy); }
.progress-step:last-child::after { display: none; }
.progress-step.active::before { background: var(--primary); border-color: var(--primary); color: #fff; }
.progress-step.completed::before { background: var(--success); border-color: var(--success); color: #fff; content: '✓'; }
.progress-step.completed::after { background: var(--success); }
.progress-step span, .step-label { font-size: 0.6875rem; color: var(--text-tertiary); font-weight: 600; }
.progress-step.active span, .progress-step.completed span { color: var(--text-primary); }
.step-number { font-weight: 700; }
.step-title { font-size: 0.9375rem; font-weight: 700; margin-bottom: 0.75rem; }
.progress-line { background: var(--border-heavy); }

.form-step { display: none; animation: viewIn 0.25s ease-out; }
.form-step.active { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-nav-buttons { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.application-review { }
.review-section, .review-item { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 0.875rem 1rem; margin-bottom: 0.5rem; }
.review-label { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); font-weight: 600; margin-bottom: 0.125rem; }
.review-value { font-size: 0.875rem; font-weight: 600; }
.consent-section { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 1rem; margin-top: 0.75rem; }
.checkbox-label { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.8125rem; cursor: pointer; }

.request-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; transition: all var(--transition-base); margin-bottom: 0.5rem; }
.request-card:hover { background: var(--bg-hover); }

/* ═══ Lend — Marketplace Cards ═══ */
.lender-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.lender-stat-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; text-align: center; }
.lender-stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.lender-stat-label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.marketplace-filters, .filter-group { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.875rem; align-items: flex-end; }
.filter-group { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.filter-group label { font-size: 0.6875rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.marketplace-filters select, .marketplace-filters input { padding: 0.5rem 0.75rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-full); font-family: var(--font-body); font-size: 0.8125rem; background: var(--bg-primary); color: var(--text-primary); }
.marketplace-list, .contracts-list { }

/* Marketplace card — proper layout with user info */
.marketplace-card {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.25rem;
    margin-bottom: 0.75rem; transition: all var(--transition-base); cursor: pointer;
}
.marketplace-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-heavy); }
.marketplace-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.marketplace-title h4 { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.125rem; }
.marketplace-title p { font-size: 0.8125rem; color: var(--text-secondary); }
.marketplace-rate { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--success); background: var(--success-light); padding: 0.375rem 0.875rem; border-radius: var(--radius-full); white-space: nowrap; }
.marketplace-details { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; padding: 0.875rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; }
.detail-item { text-align: center; }
.detail-label { font-size: 0.625rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 0.125rem; }
.detail-value { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); }
.marketplace-progress { margin-bottom: 0.75rem; }
.progress-bar-container { height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; margin-bottom: 0.375rem; }
.progress-bar-fill { height: 100%; background: var(--gradient-brand); border-radius: 3px; transition: width 1s ease-out; min-width: 2px; }
.progress-text { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }
.marketplace-footer { display: flex; justify-content: space-between; align-items: center; }
.borrower-info { display: flex; align-items: center; gap: 0.625rem; }
.borrower-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 700; flex-shrink: 0; }
.borrower-name { font-size: 0.875rem; font-weight: 600; }
.marketplace-actions { }

.pledge-section, .pledge-summary { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 1rem; margin-top: 0.75rem; }
.pledge-section label, .pledge-terms label { font-size: 0.8125rem; font-weight: 600; display: block; margin-bottom: 0.375rem; }
.pledge-calc, .pledge-calculation { margin-top: 0.75rem; }
.pledge-calculation h4 { font-family: var(--font-display); font-size: 0.9375rem; font-weight: 700; margin-bottom: 0.5rem; }
.calc-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.calc-row:last-child { border-bottom: none; }
.pledge-calc-item { padding: 0.5rem 0.75rem; background: var(--bg-primary); border-radius: var(--radius-sm); }
.pledge-calc-label { font-size: 0.625rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.pledge-calc-value { font-weight: 700; font-family: var(--font-display); font-size: 1rem; }
.pledges-list { margin-top: 0.75rem; }

/* ════════  LEADERBOARD  ════════ */
.leaderboard-explainer { margin-top: 1rem; }
.leaderboard-podium { display: flex; justify-content: center; align-items: flex-end; gap: 0.875rem; margin: 1rem 0; }
.podium-card, .lb-podium-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; text-align: center; min-width: 130px; transition: all var(--transition-base); }
.podium-card:hover, .lb-podium-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.rankings-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rankings-table th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); font-weight: 600; text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.rankings-table td { padding: 0.75rem 1rem; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.rankings-table tr:hover td { background: var(--bg-hover); }
.score-bar { height: 6px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 3px; background: var(--gradient-brand); transition: width 1s ease-out; }

/* ════════  CONTRACTS  ════════ */
.contract-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 0.5rem; transition: all var(--transition-base); cursor: pointer; }
.contract-card:hover { background: var(--bg-hover); box-shadow: var(--shadow-xs); }
.contract-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.contract-type-card { background: var(--bg-primary); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; cursor: pointer; transition: all var(--transition-base); text-align: center; }
.contract-type-card:hover, .contract-type-card.selected { border-color: var(--primary); background: var(--primary-light); }
.ct-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.ct-label { font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.25rem; }
.ct-desc { font-size: 0.75rem; color: var(--text-secondary); }
.wizard-step, .wizard-panel { display: none; }
.wizard-step.active, .wizard-panel.active { display: block; animation: viewIn 0.25s ease-out; }
.wizard-step-num { width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--bg-tertiary); border: 2px solid var(--border-heavy); display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; }
.wizard-step-label { font-size: 0.75rem; color: var(--text-secondary); }
.wizard-step-line { height: 2px; background: var(--border-heavy); flex: 1; }
.payment-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
.payment-item { display: flex; justify-content: space-between; align-items: center; padding: 0.625rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.stake-card { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 0.75rem 1rem; margin-bottom: 0.5rem; }
.dispute-warning { background: var(--error-light); border: 1px solid rgba(244,33,46,0.2); border-radius: var(--radius-md); padding: 0.75rem 1rem; color: var(--error); font-size: 0.875rem; font-weight: 600; margin-top: 0.75rem; }
.board-category-badge { display: inline-flex; padding: 0.25rem 0.625rem; border-radius: var(--radius-full); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; }
.board-listing-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 0.5rem; cursor: pointer; transition: all var(--transition-base); }
.board-listing-card:hover { background: var(--bg-hover); }
.highlight { background: var(--warning-light); padding: 0.125rem 0.25rem; border-radius: 2px; }
.milestone-row { display: grid; grid-template-columns: 1fr 120px 120px 40px; gap: 0.5rem; align-items: center; margin-bottom: 0.375rem; }
.milestone-row input { padding: 0.5rem 0.625rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.8125rem; }
.ms-title, .ms-amount, .ms-due { font-size: 0.8125rem; }
#application-form-container .modal-content { max-width: 680px; }

/* ════════  ARBITRATION  ════════ */
.arb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 1rem 0; }
.arb-stat-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; text-align: center; }
.arb-case-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 0.5rem; cursor: pointer; transition: all var(--transition-base); }
.arb-case-card:hover { background: var(--bg-hover); }

/* ════════  GROUPS / MESSAGES  ════════ */
.grp-top-bar, .groups-top-bar { display: flex; justify-content: space-between; align-items: center; margin: 0.875rem 0; flex-wrap: wrap; gap: 0.5rem; }
.grp-top-left { display: flex; align-items: center; gap: 0.5rem; }
.grp-top-left h2 { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 700; }
.grp-top-actions { display: flex; gap: 0.375rem; }
.grp-invite-badge { display: inline-flex; padding: 0.125rem 0.375rem; background: var(--error); color: #fff; border-radius: var(--radius-full); font-size: 0.6875rem; font-weight: 700; }
/* ── Hide tabs, combine groups + DMs into one unified list ── */
.grp-main-tabs { display: none !important; }
#grp-groups-panel, #grp-messages-panel { display: block !important; }
#grp-groups-panel::before { content: 'Groups'; display: block; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); padding: 0.875rem 1rem 0.375rem; }
#grp-messages-panel::before { content: 'Direct Messages'; display: block; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); padding: 0.875rem 1rem 0.375rem; border-top: 1px solid var(--border); }
.grp-main-tab { display: none; }

.group-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 0.5rem; cursor: pointer; transition: all var(--transition-base); }
.group-card:hover { background: var(--bg-hover); }
.group-description { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* Group Detail */
.grp-detail-container { display: flex; flex-direction: column; height: 100%; }
.grp-detail-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.grp-detail-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--gradient-brand); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.grp-detail-info { flex: 1; }
.grp-detail-tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 0 0.5rem; }
.gd-tab { padding: 0.625rem 0.875rem; border: none; background: transparent; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 3px solid transparent; transition: all var(--transition-base); white-space: nowrap; }
.gd-tab.active { color: var(--text-primary); border-bottom-color: var(--primary); }
.gd-panel-container { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.gd-panel, .gd-scroll-panel { padding: 0.75rem 1rem; animation: viewIn 0.25s ease-out; }
.gd-panel { display: none; }
.gd-panel.active { display: flex; flex-direction: column; }
#gd-panel-chat.active { flex: 1; overflow: hidden; }
#gd-panel-chat .chat-messages-area { flex: 1; overflow-y: auto; }
/* Non-chat panels are just block with scroll */
#gd-panel-finances.active, #gd-panel-polls.active, #gd-panel-meetings.active,
#gd-panel-minutes.active, #gd-panel-forum.active, #gd-panel-members.active {
    display: block; overflow-y: auto; flex: 1;
}

.dm-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-fast); }
.dm-item:hover { background: var(--bg-hover); }
.dm-avatar { width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--gradient-brand); padding: 2px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 700; flex-shrink: 0; position: relative; }
.dm-avatar .online-dot { position: absolute; bottom: 1px; right: 1px; width: 10px; height: 10px; background: var(--success); border: 2px solid var(--bg-primary); border-radius: 50%; }
.dm-info { flex: 1; min-width: 0; }
.dm-info .dm-name { font-weight: 700; font-size: 0.9375rem; }
.dm-info .dm-preview { font-size: 0.8125rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-time { font-size: 0.6875rem; color: var(--text-tertiary); flex-shrink: 0; }
.dm-unread { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; flex-shrink: 0; }

/* Chat */
.group-chat-container { display: flex; flex-direction: column; height: 100%; }
.group-chat-header, .chat-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.chat-header-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--gradient-brand); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.chat-header-info { flex: 1; }
.header-actions { display: flex; gap: 0.25rem; }
.chat-messages-area, .chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.375rem; }
/* Push messages to bottom when fewer than fill area */
.chat-messages-area::before, .chat-messages::before { content: ''; flex: 1 1 auto; min-height: 0; }
#gd-chat-messages::before { content: ''; flex: 1 1 auto; min-height: 0; }
.chat-msg { max-width: 70%; padding: 0.625rem 0.875rem; border-radius: var(--radius-xl); font-size: 0.875rem; line-height: 1.4; position: relative; }
.chat-msg.mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.theirs { align-self: flex-start; background: var(--bg-tertiary); color: var(--text-primary); border-bottom-left-radius: 4px; }
.chat-msg.compact { padding: 0.375rem 0.75rem; }
.chat-input-container, .chat-input-area { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.chat-input-container input, .chat-input-area input, .chat-input-area textarea { flex: 1; padding: 0.625rem 1rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-full); font-family: var(--font-body); font-size: 0.875rem; background: var(--bg-primary); color: var(--text-primary); resize: none;}
.chat-input-container input:focus, .chat-input-area input:focus { outline: none; border-color: var(--primary); }
.msg-delete-btn { opacity: 0; position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: none; background: rgba(244,33,46,0.1); color: var(--error); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity var(--transition-fast); }
.chat-msg:hover .msg-delete-btn { opacity: 1; }

/* Polls / Meetings / Minutes / Forum */
.poll-card, .meeting-card, .minutes-card, .forum-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; margin-bottom: 0.5rem; }
.poll-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0; font-size: 0.8125rem; }
.poll-option-bar { flex: 1; height: 28px; background: var(--bg-tertiary); border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.poll-option-fill { height: 100%; background: var(--primary-light); border-radius: var(--radius-sm); }
.poll-option-input { width: 100%; padding: 0.5rem 0.75rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-sm); font-size: 0.8125rem; font-family: var(--font-body); margin-bottom: 0.375rem; background: var(--bg-primary); color: var(--text-primary); }
.meeting-card .meeting-time { font-size: 0.75rem; color: var(--text-secondary); }
.group-member-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 1px solid var(--border); }

/* ════════  DIRECTORY  ════════ */
.directory-search-bar { display: flex; gap: 0.75rem; margin: 1rem 0; align-items: center; }
.directory-search-bar input { flex: 1; padding: 0.625rem 1rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-full); font-size: 0.875rem; font-family: var(--font-body); background: var(--bg-tertiary); color: var(--text-primary); }
.directory-search-bar input:focus { outline: none; border-color: var(--primary); background: var(--bg-primary); }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.member-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; cursor: pointer; transition: all var(--transition-base); text-align: center; }
.member-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.profile-cover { height: 120px; background: var(--gradient-brand); border-radius: var(--radius-xl) var(--radius-xl) 0 0; position: relative; }
.profile-avatar { width: 76px; height: 76px; border-radius: var(--radius-full); background: var(--gradient-warm); padding: 3px; border: 3px solid var(--bg-primary); position: absolute; bottom: -38px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-body { padding: 2.75rem 1.5rem 1.5rem; text-align: center; }

/* ════════  GUARANTEES  ════════ */
.guarantee-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 0.5rem; }
.guarantee-status { display: inline-flex; padding: 0.25rem 0.625rem; border-radius: var(--radius-full); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; }

/* ════════  TOAST  ════════ */
.toast-container { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.toast { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; border-radius: var(--radius-full); background: var(--bg-sidebar); color: #e7e9ea; box-shadow: var(--shadow-xl); font-size: 0.875rem; font-weight: 600; animation: toastPop 0.3s cubic-bezier(0.2,0,0,1); max-width: 400px; }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--error); color: #fff; }
.toast.info { background: var(--primary); color: #fff; }
.toast.warning { background: var(--warning); color: #000; }
@keyframes toastPop { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ════════  FINANCIAL TABLES  ════════ */
.fin-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.fin-table th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); font-weight: 600; text-align: left; padding: 0.5rem 0.75rem; background: var(--bg-tertiary); }
.fin-table td { padding: 0.5rem 0.75rem; font-size: 0.8125rem; border-bottom: 1px solid var(--border); }
.fin-table input, .fin-input { width: 100%; padding: 0.375rem 0.5rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.8125rem; background: var(--bg-primary); color: var(--text-primary); }
.fin-table input:focus { outline: none; border-color: var(--primary); }
.fin-table-section { margin-bottom: 0.75rem; }
.fin-row-sep td, .fin-row-total td { border-top: 2px solid var(--border-heavy); font-weight: 700; }
.fin-row-income td, .fin-row-expense td, .fin-row-asset td, .fin-row-liability td { }
.fin-total-val { font-weight: 700; font-family: var(--font-display); }
.fin-note { font-size: 0.6875rem; color: var(--text-tertiary); }
.income-input, .expense-input, .asset-input, .liability-input { width: 100%; padding: 0.375rem 0.5rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.8125rem; }
.dob-error { color: var(--error); font-size: 0.75rem; margin-top: 0.25rem; }

/* Overflow fix */
.arb-case-card, .contract-card { overflow: hidden; word-wrap: break-word; }
.arb-case-card *, .contract-card * { max-width: 100%; overflow-wrap: break-word; }

/* ════════  RESPONSIVE  ════════ */
@media (max-width: 1024px) {
    .navbar { width: var(--sidebar-collapsed); padding: 0.875rem 0.5rem; }
    .nav-link { justify-content: center; padding: 0.625rem; font-size: 0; gap: 0; }
    .nav-link svg { width: 22px; height: 22px; }
    .nav-brand .brand-logo { font-size: 1.125rem; text-align: center; }
    .nav-brand img { height: 20px !important; }
    .user-info { display: none; }
    .dashboard-content { margin-left: var(--sidebar-collapsed); }
    .feed-container { grid-template-columns: 1fr; }
    .feed-sidebar, .feed-sidebar-right { display: none; }
    .dashboard-sections { grid-template-columns: 1fr; }
    #notif-panel { left: var(--sidebar-collapsed) !important; }
    .marketplace-details { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    /* ── Bottom nav bar ── */
    .navbar {
        position: fixed !important;
        bottom: 0; left: 0; right: 0; top: auto !important;
        width: 100% !important; height: 56px !important;
        flex-direction: row !important;
        padding: 0.25rem 0 !important;
        border-top: 1px solid rgba(255,255,255,0.08);
        border-right: none;
        z-index: 200;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .nav-brand { display: none; }
    .nav-user { display: none; }
    .nav-menu {
        flex-direction: row !important;
        gap: 0 !important;
        flex: 1;
        justify-content: space-around;
        overflow-y: hidden;
    }
    .nav-link {
        flex-direction: column;
        font-size: 0.5625rem;
        padding: 0.25rem !important;
        gap: 0.125rem;
        min-width: 44px;
        justify-content: center;
        align-items: center;
    }
    .nav-link span { display: inline !important; font-size: 0.5625rem; }
    .nav-link svg { width: 20px; height: 20px; }
    .nav-link.active::before { display: none; }

    /* ── Layout ── */
    .main-content { margin-left: 0 !important; padding: 0.75rem; width: 100%; box-sizing: border-box; overflow-x: hidden; }
    .dashboard-content { margin-left: 0 !important; margin-bottom: 64px; padding-bottom: 8px; }
    .view { padding: 0.5rem 0; }
    :root { --content-pad: 1rem; }

    /* ── Cards & sections ── */
    .section-card { padding: 1rem; overflow: visible; }
    .section-header { flex-wrap: wrap; gap: 0.5rem; }
    .view-title { font-size: 1.125rem; }

    /* ── Auth ── */
    .auth-container { grid-template-columns: 1fr; }
    .auth-visual { min-height: 200px; padding: 1.5rem; }
    .brand-title { font-size: 2.5rem; }
    .trust-metrics { gap: 1.25rem; }
    .metric-value { font-size: 1.25rem; }
    .auth-forms { padding: 2rem 1.5rem; }

    /* ── Forms ── */
    .form-grid { grid-template-columns: 1fr; }

    /* ── Wallet ── */
    .wallet-balance-card { margin: 0.75rem 0; width: 100%; box-sizing: border-box; }
    #wallet-view > .section-card { margin: 0 0 0.75rem; }
    .wallet-balance-amount { font-size: 2rem; }
    .wallet-metrics-row { grid-template-columns: repeat(2, 1fr); }

    /* ── Transactions ── */
    .txn-row { padding: 0.625rem 0; gap: 0.5rem; }
    .txn-info { min-width: 0; flex: 1; overflow: hidden; }
    .txn-label, .txn-note, .txn-time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .txn-balance { display: none; }

    /* ── Banking ── */
    .banking-virtual-card { width: 100%; max-width: 340px; margin: 0 auto; }

    /* ── Grids ── */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .contracts-summary { grid-template-columns: 1fr; }
    .arb-stats { grid-template-columns: 1fr; }
    .directory-grid { grid-template-columns: 1fr; }
    .marketplace-details { grid-template-columns: repeat(2, 1fr); }
    .marketplace-header { flex-direction: column; gap: 0.5rem; }

    /* ── Modals ── */
    .modal-content { width: 100% !important; margin: 0 !important; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 90vh; }

    /* ── Onboarding ── */
    .ob-tier-grid { grid-template-columns: 1fr; }
    .ob-nav-buttons { padding: 0.75rem 1rem; }

    /* ── Notifications / Toast ── */
    #notif-panel { left: 0 !important; right: 0 !important; bottom: 60px !important; width: 100% !important; border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; }
    .toast-container { bottom: 4.5rem; }
}

@media (max-width: 480px) {
    .stats-grid, .borrow-summary, .wallet-metrics-row, .contracts-summary { grid-template-columns: 1fr; }
    .wallet-balance-row { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .progress-steps, .application-progress { overflow-x: auto; }
    .form-row { grid-template-columns: 1fr; }
    .form-panel { padding: 1rem; }
    .brand-logo-img { height: 48px; }
    .nav-link { padding: 0.5rem; }
    .nav-link svg { width: 20px; height: 20px; }
    .wallet-balance-hero, .banking-hero { padding: 1rem; }
    .wallet-balance-hero h1, .banking-hero h1 { font-size: 1.75rem; }
    .section-header h3 { font-size: 0.8125rem; }
    .txn-icon { width: 32px; height: 32px; font-size: 0.75rem; }
    .txn-label { font-size: 0.8125rem; }
    .txn-amount { font-size: 0.8125rem; }
    .modal-content { margin: 0; border-radius: 0; max-height: 100vh; width: 100%; }
}
.credit-toggle-bar {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    padding: 3px;
    margin-bottom: 1rem;
}
.credit-toggle-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}
.credit-toggle-tab.active {
    background: var(--primary);
    color: #fff;
}
.credit-panel { display: none; }
.credit-panel.active { display: block; }
 
/* ════════  UTILITY  ════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.skeleton { background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border) 50%, var(--bg-tertiary) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
::-webkit-scrollbar { width: 0; height: 0; }
.chat-messages::-webkit-scrollbar, .chat-messages-area::-webkit-scrollbar, .modal-content::-webkit-scrollbar, .nav-menu::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb, .modal-content::-webkit-scrollbar-thumb { background: var(--border-heavy); border-radius: 2px; }
.text-success { color: var(--success); } .text-error { color: var(--error); } .text-warning { color: var(--warning); } .text-info { color: var(--info); }
.badge { display: inline-flex; padding: 0.125rem 0.5rem; border-radius: var(--radius-full); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-error { background: var(--error-light); color: var(--error); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
::selection { background: rgba(var(--primary-rgb), 0.2); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ════════════════════════════════════════════════════
   JS-GENERATED DYNAMIC CLASSES
   These are created by app.js at runtime
   ════════════════════════════════════════════════════ */

/* ── Fullscreen Modal Containers ── */
.fullscreen-modal { align-items: center; justify-content: center; background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); }
.fullscreen-modal .grp-detail-container,
.fullscreen-modal .group-chat-container {
    width: 70%; max-width: 860px; height: 90vh;
    background: var(--bg-primary); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl); overflow: hidden;
    display: flex; flex-direction: column;
    margin: auto; position: relative; z-index: 1;
    animation: modalPop 0.2s cubic-bezier(0.2, 0, 0, 1);
}

/* ── Group Cards (grp-card-*) ── */
.grp-card {
    display: flex; align-items: center; gap: 0.875rem;
    padding: 0.875rem 1rem; border-radius: var(--radius-md);
    cursor: pointer; transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border);
}
.grp-card:hover { background: var(--bg-hover); }
.grp-card-avatar {
    width: 48px; height: 48px; border-radius: var(--radius-full);
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.875rem; flex-shrink: 0;
}
.grp-card-info { flex: 1; min-width: 0; }
.grp-card-name { font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.125rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.grp-card-sub { font-size: 0.75rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-card-stats { font-size: 0.6875rem; color: var(--text-tertiary); margin-top: 0.125rem; }
.grp-card-role { font-size: 0.625rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; background: var(--primary-light); padding: 0.125rem 0.5rem; border-radius: var(--radius-full); flex-shrink: 0; }

/* ── Chat Messages (DM + Group) ── */
.chat-message, .chat-msg-wrapper {
    display: flex; gap: 0.5rem; padding: 0.375rem 0;
    align-items: flex-start;
}
.chat-message.own { flex-direction: row-reverse; }
.chat-avatar {
    width: 32px; height: 32px; border-radius: var(--radius-full);
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.625rem; font-weight: 700; flex-shrink: 0;
    overflow: hidden;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-full); }
.message-bubble-wrapper { max-width: 70%; display: flex; flex-direction: column; }
.chat-message.own .message-bubble-wrapper { align-items: flex-end; }
.message-bubble {
    padding: 0.625rem 0.875rem; border-radius: var(--radius-xl);
    font-size: 0.875rem; line-height: 1.45; position: relative;
    background: var(--bg-tertiary); color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.message-bubble.own {
    background: var(--primary); color: #fff;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: 4px;
}
.message-bubble p { margin: 0; }
.message-time, .message-timestamp {
    font-size: 0.6875rem; color: var(--text-tertiary);
    margin-top: 2px; padding: 0 0.25rem;
}
.message-author { font-size: 0.75rem; font-weight: 700; margin-bottom: 2px; color: var(--text-secondary); }

/* ── DM Inbox Cards ── */
.message-card {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.875rem 1rem; cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border);
}
.message-card:hover { background: var(--bg-hover); }
.message-avatar-wrapper { position: relative; flex-shrink: 0; }
.message-avatar {
    width: 44px; height: 44px; border-radius: var(--radius-full);
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8125rem; overflow: hidden;
}
.message-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-full); }
.message-info { flex: 1; min-width: 0; }
.message-header { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.message-header h4 { font-weight: 700; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.message-header .message-time, .message-header .message-timestamp { font-size: 0.6875rem; color: var(--text-tertiary); flex-shrink: 0; white-space: nowrap; }
.last-message { font-size: 0.8125rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 0.125rem; }
.unread-badge { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; flex-shrink: 0; }

/* ── Contract Detail (JS-generated) ── */
.contract-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.contract-title-section { flex: 1; min-width: 0; }
.contract-title-section h4 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 0.125rem; }
.contract-subtitle { font-size: 0.8125rem; color: var(--text-secondary); }
.contract-status-badge { display: inline-flex; padding: 0.1875rem 0.5rem; border-radius: var(--radius-full); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.contract-status-completed { background: var(--success-light); color: var(--success); }
.contract-status-pending { background: var(--warning-light); color: var(--warning); }
.contract-status-cancelled { background: var(--error-light); color: var(--error); }
.contract-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.contract-parties { display: flex; gap: 1rem; margin: 0.5rem 0; }
.contract-party { flex: 1; }
.party-label { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); font-weight: 600; }
.party-name { font-weight: 700; font-size: 0.875rem; }
.party-username { font-size: 0.75rem; color: var(--text-secondary); }
.contract-details-grid, .detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; margin: 0.75rem 0; }
.contract-detail-item, .detail-section { background: var(--bg-tertiary); border-radius: var(--radius-sm); padding: 0.625rem 0.75rem; }
.contract-detail-label, .detail-header { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); font-weight: 600; margin-bottom: 0.125rem; }
.contract-detail-value { font-size: 0.875rem; font-weight: 700; }
.contract-type-terms { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.5; }
.request-detail-view { }
.request-header { margin-bottom: 0.75rem; }
.request-body { }
.request-stat { display: flex; justify-content: space-between; padding: 0.375rem 0; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.request-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* ── Milestone List ── */
.milestone-list { }
.ms-card-title { font-weight: 700; font-size: 0.875rem; }
.ms-info { flex: 1; }
.ms-meta { font-size: 0.75rem; color: var(--text-secondary); }
.ms-order { font-size: 0.6875rem; color: var(--text-tertiary); }
.ms-actions { display: flex; gap: 0.25rem; }
.ms-remove { border: none; background: transparent; color: var(--error); cursor: pointer; padding: 0.25rem; }

/* ── Board Cards (Contract Board) ── */
.board-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 0.5rem; cursor: pointer; transition: all var(--transition-base); }
.board-card:hover { background: var(--bg-hover); box-shadow: var(--shadow-xs); }
.expiring-offer-card { background: var(--warning-light); border: 1px solid rgba(255,173,31,0.2); border-radius: var(--radius-md); padding: 0.75rem 1rem; margin-bottom: 0.5rem; }

/* ── Arbitration Timeline ── */
.arb-timeline-item { display: flex; gap: 0.75rem; padding: 0.625rem 0; position: relative; }
.arb-timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 0.375rem; }
.arb-timeline-content { flex: 1; font-size: 0.8125rem; }

/* ── Pay Requests ── */
.pay-req-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 0; border-bottom: 1px solid var(--border); }
.pay-req-icon { width: 40px; height: 40px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pay-req-left { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.pay-req-info { flex: 1; min-width: 0; }
.pay-req-label { font-weight: 600; font-size: 0.875rem; }
.pay-req-note { font-size: 0.75rem; color: var(--text-secondary); }
.pay-req-time { font-size: 0.6875rem; color: var(--text-tertiary); }
.pay-req-right { text-align: right; }
.pay-req-amount { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.pay-req-actions { display: flex; gap: 0.375rem; margin-top: 0.25rem; }

/* ── Group Finances ── */
.fin-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.5rem; margin-bottom: 0.75rem; }
.fin-summary-card { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 0.875rem; text-align: center; }
.fin-label { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); font-weight: 600; }
.fin-val { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; }
.fin-bar-bg { height: 8px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; margin: 0.375rem 0; }
.fin-bar-fill { height: 100%; border-radius: 4px; background: var(--gradient-money); transition: width 0.6s ease; }
.fin-member-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }

/* ── Group Members ── */
.gd-member-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 1px solid var(--border); }
.gd-member-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.gd-member-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-full); }
.gd-member-info { flex: 1; min-width: 0; }
.gd-member-name { font-weight: 700; font-size: 0.875rem; }
.gd-member-sub { font-size: 0.75rem; color: var(--text-secondary); }

/* ── Polls ── */
.poll-question { font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.poll-meta { font-size: 0.6875rem; color: var(--text-tertiary); margin-top: 0.5rem; }

/* ── Meetings ── */
.mtg-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; margin-bottom: 0.5rem; display: flex; gap: 0.875rem; }
.mtg-date-badge { text-align: center; min-width: 48px; padding: 0.375rem; background: var(--primary-light); border-radius: var(--radius-sm); flex-shrink: 0; }
.mtg-month { font-size: 0.5625rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); font-weight: 700; }
.mtg-day { font-size: 1.25rem; font-weight: 700; color: var(--primary); font-family: var(--font-display); }
.mtg-info { flex: 1; min-width: 0; }
.mtg-title { font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.125rem; }
.mtg-detail { font-size: 0.8125rem; color: var(--text-secondary); }
.mtg-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.mtg-agenda { margin-top: 0.5rem; }
.mtg-agenda-item { font-size: 0.8125rem; padding: 0.25rem 0; color: var(--text-secondary); }
.mtg-rsvp-bar { display: flex; gap: 0.375rem; margin-top: 0.5rem; }

/* ── Minutes ── */
.min-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; margin-bottom: 0.5rem; cursor: pointer; transition: background var(--transition-fast); }
.min-card:hover { background: var(--bg-hover); }
.min-title { font-weight: 700; font-size: 0.9375rem; }
.min-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.125rem; }
.min-content { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.55; }
.min-section { margin-bottom: 0.75rem; }
.min-section-title { font-weight: 700; font-size: 0.875rem; margin-bottom: 0.25rem; }
.min-item { padding: 0.25rem 0; font-size: 0.8125rem; }
.min-action-item { padding: 0.375rem 0.625rem; background: var(--bg-tertiary); border-radius: var(--radius-sm); margin-bottom: 0.25rem; font-size: 0.8125rem; }

/* ── Forum ── */
.forum-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; margin-bottom: 0.5rem; }
.forum-header { display: flex; gap: 0.625rem; align-items: flex-start; margin-bottom: 0.5rem; }
.forum-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 700; flex-shrink: 0; }
.forum-title { font-weight: 700; font-size: 0.9375rem; }
.forum-content { font-size: 0.875rem; line-height: 1.5; color: var(--text-secondary); margin-bottom: 0.5rem; }
.forum-actions { display: flex; gap: 0.5rem; }
.forum-replies { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.forum-reply { display: flex; gap: 0.5rem; padding: 0.375rem 0; font-size: 0.8125rem; }
.forum-reply-input { width: 100%; padding: 0.5rem 0.75rem; border: 1.5px solid var(--border-heavy); border-radius: var(--radius-full); font-size: 0.8125rem; font-family: var(--font-body); margin-top: 0.375rem; }

/* ── Pledge Cards ── */
.pledge-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.875rem 1rem; margin-bottom: 0.5rem; }
.pledge-info { flex: 1; }
.pledge-amount-display { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.pledge-input-row { display: flex; gap: 0.5rem; align-items: center; }

/* ── Search / Directory Results ── */
.search-result-item, .user-result-item { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.75rem; cursor: pointer; transition: background var(--transition-fast); border-radius: var(--radius-sm); }
.search-result-item:hover, .user-result-item:hover { background: var(--bg-hover); }
.location-suggestion-item { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.875rem; transition: background var(--transition-fast); }
.location-suggestion-item:hover { background: var(--bg-tertiary); }
.tag-user-info { flex: 1; min-width: 0; }

/* ── Misc Dynamic ── */
.btn-error { background: var(--error); color: #fff; }
.btn-error:hover { background: #d91c28; }
.comment-content { flex: 1; min-width: 0; }
.status { display: inline-flex; padding: 0.1875rem 0.5rem; border-radius: var(--radius-full); font-size: 0.6875rem; font-weight: 700; text-transform: capitalize; }
.amount { font-family: var(--font-display); font-weight: 700; }

/* ── Mobile Fullscreen Modals ── */
@media (max-width: 768px) {
    .fullscreen-modal .grp-detail-container,
    .fullscreen-modal .group-chat-container {
        width: 100%; height: 100vh; max-height: 100vh;
        border-radius: 0;
    }
}
/* ════════════════════════════════════════════════════
   TRUST & IDENTITY — Tiers 1, 2, 4, 5
   ════════════════════════════════════════════════════ */

/* ── Tier 4: FideO Credit Card ── */
.fideo-credit-card {
    background: var(--gradient-wallet); border-radius: var(--radius-xl);
    padding: 1.5rem 1.75rem; color: #fff; margin-top: 1.25rem; margin-bottom: 1rem;
    position: relative; overflow: hidden;
}
.fideo-credit-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 25% 40%, rgba(0,186,124,0.12) 0%, transparent 50%), radial-gradient(circle at 80% 70%, rgba(29,155,240,0.1) 0%, transparent 50%); pointer-events: none; }
.fideo-credit-header { display: flex; gap: 2rem; align-items: center; position: relative; z-index: 1; }
.fideo-credit-score-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; text-align: center; }
.fideo-score-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.fideo-score-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, 30%); font-size: 0.5625rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.5); font-weight: 700; }
.fideo-credit-breakdown { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.fideo-credit-factor { display: flex; align-items: center; gap: 0.75rem; }
.factor-label { font-size: 0.6875rem; color: rgba(255,255,255,0.5); width: 120px; flex-shrink: 0; font-weight: 600; }
.factor-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.factor-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #00ba7c, #1d9bf0); transition: width 1s ease; }
.factor-value { font-size: 0.6875rem; font-weight: 700; width: 28px; text-align: right; }
.fideo-credit-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; padding-top: 1.25rem; margin-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.06); position: relative; z-index: 1; }
.fc-metric { text-align: center; }
.fc-metric-val { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; }
.fc-metric-label { font-size: 0.5625rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 0.125rem; }

/* ── Trust Panel Tabs ── */
.trust-panel { display: none; margin-top: 0.5rem; }
.trust-panel.active { display: block; animation: viewIn 0.25s ease-out; }

/* ── Tier 1: Trust Signals ── */
.trust-signals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.trust-signal-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.125rem; display: flex; align-items: center; gap: 0.75rem; transition: all var(--transition-base); }
.trust-signal-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.trust-signal-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.125rem; flex-shrink: 0; }
.trust-signal-info { flex: 1; min-width: 0; }
.trust-signal-title { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin-bottom: 2px; }
.trust-signal-value { font-size: 0.9375rem; font-weight: 700; }

/* ── Tier 2: Attestations ── */
.attest-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.attest-legend-item { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--text-secondary); }
.attest-tier-badge { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.attest-tier-badge.tier-social { background: var(--primary); }
.attest-tier-badge.tier-identity { background: #9333ea; }
.attest-tier-badge.tier-financial { background: var(--success); }
.attest-level-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.25rem; }
.attest-level-card { border: 2px solid var(--border); border-radius: var(--radius-md); padding: 0.875rem; cursor: pointer; text-align: center; transition: all var(--transition-base); }
.attest-level-card:hover { border-color: var(--border-heavy); }
.attest-level-card.selected { border-color: var(--primary); background: var(--primary-light); }
.attest-level-card .attest-tier-badge { width: 14px; height: 14px; margin: 0 auto 0.375rem; }
.attest-level-card strong { display: block; font-size: 0.8125rem; margin-bottom: 0.125rem; }
.attest-level-card p { font-size: 0.6875rem; color: var(--text-secondary); margin: 0; line-height: 1.3; }
.attestation-card { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.attestation-card:last-child { border-bottom: none; }
.attestation-avatar { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 700; flex-shrink: 0; }
.attestation-info { flex: 1; min-width: 0; }
.attestation-name { font-weight: 700; font-size: 0.875rem; }
.attestation-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.125rem; }
.attestation-statement { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.25rem; font-style: italic; }
.attestation-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.5rem; border-radius: var(--radius-full); font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.attestation-badge.social { background: var(--primary-light); color: var(--primary); }
.attestation-badge.identity { background: #f3e8ff; color: #9333ea; }
.attestation-badge.financial { background: var(--success-light); color: var(--success); }

/* ── Tier 5: Verification Tiers ── */
.verification-tiers { display: flex; flex-direction: column; gap: 0.5rem; }
.verification-tier { display: flex; align-items: center; gap: 0.875rem; padding: 0.875rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-md); transition: all var(--transition-base); }
.verification-tier.completed { border-color: var(--success); background: var(--success-light); }
.verification-tier.current { border-color: var(--primary); background: var(--primary-light); }
.vtier-check { width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary); flex-shrink: 0; }
.verification-tier.completed .vtier-check { background: var(--success); color: #fff; }
.verification-tier.current .vtier-check { background: var(--primary); color: #fff; }
.vtier-info { flex: 1; min-width: 0; }
.vtier-name { font-weight: 700; font-size: 0.875rem; }
.vtier-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.125rem; }
.vtier-limit { font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary); flex-shrink: 0; white-space: nowrap; }
.verification-tier.completed .vtier-limit { color: var(--success); }
.compliance-status { display: flex; flex-direction: column; gap: 0.5rem; }
.compliance-row { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.compliance-row:last-child { border-bottom: none; }
.compliance-row span:nth-child(2) { flex: 1; }
.compliance-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.compliance-indicator.good { background: var(--success); }
.compliance-indicator.warning { background: var(--warning); }
.compliance-indicator.alert { background: var(--error); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .fideo-credit-header { flex-direction: column; gap: 1rem; }
    .fideo-credit-metrics { grid-template-columns: repeat(2, 1fr); }
    .trust-signals-grid { grid-template-columns: 1fr; }
    .attest-level-cards { grid-template-columns: 1fr; }
    .factor-label { width: 90px; font-size: 0.625rem; }
}
/* ════════════════════════════════════════════════════
   LEGAL STRUCTURE — TILA, ECOA, E-Signature, Enforcement
   ════════════════════════════════════════════════════ */

/* ── TILA Disclosure Box (Regulation Z) ── */
.tila-disclosure-box {
    border: 2px solid var(--text-primary); border-radius: var(--radius-md);
    padding: 0; margin-bottom: 1rem; overflow: hidden; font-size: 0.8125rem;
}
.tila-header {
    background: var(--text-primary); color: var(--bg-primary); padding: 0.625rem 1rem;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.25rem;
}
.tila-header strong { font-size: 0.875rem; letter-spacing: 0.03em; }
.tila-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 2px solid var(--text-primary);
}
.tila-cell {
    padding: 0.75rem 0.625rem; border-right: 1px solid var(--border-heavy); text-align: center;
}
.tila-cell:last-child { border-right: none; }
.tila-cell-label {
    font-size: 0.5625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-secondary); margin-bottom: 0.25rem;
}
.tila-cell-value { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.tila-cell-desc { font-size: 0.625rem; color: var(--text-secondary); line-height: 1.3; }
.tila-schedule { padding: 0.625rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.8125rem; }
.tila-terms { padding: 0.75rem 1rem; }
.tila-terms p { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.5rem; line-height: 1.45; }
.tila-terms p:last-child { margin-bottom: 0; }
.tila-terms strong { color: var(--text-primary); }

/* ── ECOA Notice ── */
.ecoa-notice-box {
    border: 1px solid var(--border-heavy); border-radius: var(--radius-md);
    padding: 0.875rem 1rem; margin-bottom: 1rem; font-size: 0.75rem; line-height: 1.5;
    color: var(--text-secondary); background: var(--bg-secondary);
}
.ecoa-notice-box strong { display: block; font-size: 0.8125rem; color: var(--text-primary); margin-bottom: 0.375rem; letter-spacing: 0.02em; }
.ecoa-notice-box p { margin: 0; }

/* ── Promissory Note ── */
.promissory-note-box {
    border: 1.5px solid var(--text-primary); border-radius: var(--radius-md);
    padding: 0.875rem 1rem; margin-bottom: 1rem; font-size: 0.8125rem; line-height: 1.55;
}
.promissory-note-box strong { font-size: 0.875rem; display: block; margin-bottom: 0.375rem; letter-spacing: 0.02em; }
.promissory-note-box p { margin-bottom: 0.5rem; color: var(--text-secondary); }
.promissory-note-box p:last-child { margin-bottom: 0; }

/* ── E-Signature Block ── */
.esig-block {
    border: 2px solid var(--primary); border-radius: var(--radius-md);
    padding: 1rem; margin-top: 1rem; background: var(--primary-light);
}
.esig-header {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--primary); margin-bottom: 0.5rem;
}
.esig-block input[type="text"] {
    font-family: 'Georgia', 'Times New Roman', serif; font-size: 1.25rem;
    font-style: italic; border-bottom: 2px solid var(--primary); background: transparent;
    padding: 0.5rem 0; border-radius: 0;
    textarea { resize: none; }; 
}
.esig-meta {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
    font-size: 0.6875rem; color: var(--text-tertiary); margin-top: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .tila-grid { grid-template-columns: repeat(2, 1fr); }
    .tila-cell { border-bottom: 1px solid var(--border); }
}
/* ═══════════════════════════════════════════════════════════════
   LEADERBOARD REDESIGN — Professional, legitimate, data-dense
   ═══════════════════════════════════════════════════════════════ */

/* Your Position Card */
.lb-your-position { margin-bottom: 1rem; }
.lb-your-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 4px 0;
}
.lb-your-rank-col { text-align: center; min-width: 64px; }
.lb-your-rank-num { font-size: 1.75rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.lb-your-rank-label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.lb-your-score-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lb-your-score-ring { position: relative; width: 72px; height: 72px; }
.lb-your-score-ring svg { width: 100%; height: 100%; }
.lb-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; font-weight: 800; color: var(--text-primary); }
.lb-your-score-label { font-size: 0.6875rem; color: var(--text-secondary); font-weight: 600; }
.lb-your-breakdown { flex: 1; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.lb-your-breakdown .lb-bd-item { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; }
.lb-your-breakdown .lb-bd-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lb-your-breakdown .lb-bd-val { font-weight: 700; min-width: 24px; }

/* Methodology */
.lb-methodology { margin-bottom: 1rem; border: 1px solid var(--border); cursor: default; }
.lb-methodology-summary {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; list-style: none; padding: 0;
}
.lb-methodology-summary::-webkit-details-marker { display: none; }
.lb-methodology-summary svg { transition: transform 0.2s; }
.lb-methodology[open] .lb-methodology-summary svg { transform: rotate(180deg); }
.lb-methodology-body { margin-top: 12px; }
.lb-factor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.lb-factor { display: flex; align-items: flex-start; gap: 10px; padding: 10px; background: var(--bg-secondary); border-radius: 8px; }
.lb-factor-weight {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff; display: flex; align-items: center;
    justify-content: center; font-size: 0.6875rem; font-weight: 800;
}
.lb-factor-info strong { display: block; font-size: 0.8125rem; margin-bottom: 2px; }
.lb-factor-info span { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.35; }
.lb-methodology-note { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 10px; font-style: italic; }

/* Podium Row */
.lb-podium-row { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-bottom: 1.5rem; }
.lb-podium-card {
    flex: 1; max-width: 180px; text-align: center; border-radius: 16px;
    padding: 20px 12px 16px; border: 1px solid var(--border);
    background: var(--bg-primary); transition: transform 0.15s, box-shadow 0.15s; cursor: pointer;
}
.lb-podium-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.lb-podium-card.lb-podium-1st { border-color: #f5c842; background: linear-gradient(180deg, rgba(245,200,66,0.06) 0%, var(--bg-primary) 100%); min-height: 200px; }
.lb-podium-card.lb-podium-2nd { min-height: 170px; }
.lb-podium-card.lb-podium-3rd { min-height: 150px; }
.lb-podium-medal { font-size: 2rem; margin-bottom: 8px; }
.lb-podium-avatar {
    width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 6px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.875rem; color: #fff;
}
.lb-podium-name { font-size: 0.8125rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-podium-username { font-size: 0.6875rem; color: var(--text-secondary); margin-top: 1px; }
.lb-podium-score-val { font-size: 1.5rem; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.lb-podium-score-label { font-size: 0.625rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

/* Rankings Table */
.lb-rankings-card { overflow: hidden; }
.lb-rankings-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.lb-rankings-header h3 { font-size: 0.9375rem; margin: 0; }
.lb-rankings-controls { display: flex; gap: 8px; align-items: center; }
.lb-search-input {
    font-size: 0.8125rem; padding: 5px 10px; border: 1px solid var(--border);
    border-radius: 6px; width: 180px; background: var(--bg-secondary);
    font-family: var(--font-body);
}
.lb-rankings-table-wrap { margin-top: 12px; overflow-x: auto; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.lb-table thead { position: sticky; top: 0; z-index: 1; }
.lb-table th {
    text-align: left; padding: 8px 10px; font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary);
    border-bottom: 2px solid var(--border); background: var(--bg-primary); white-space: nowrap;
}
.lb-table td { padding: 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.lb-table tbody tr { transition: background 0.1s; cursor: pointer; }
.lb-table tbody tr:hover { background: rgba(29,155,240,0.03); }
.lb-th-rank { width: 52px; text-align: center; }
.lb-th-member { min-width: 160px; }
.lb-th-bar { width: 100px; }
.lb-th-stat { width: 72px; text-align: center; }
.lb-th-score { width: 80px; text-align: right; }
.lb-td-rank { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-rank-top { font-size: 1rem; }
.lb-td-member { display: flex; align-items: center; gap: 10px; }
.lb-td-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.6875rem; color: #fff;
}
.lb-td-name { font-weight: 600; }
.lb-td-username { font-size: 0.6875rem; color: var(--text-secondary); }
.lb-mini-bar { height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; width: 100%; }
.lb-mini-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.lb-mini-bar-row { display: flex; align-items: center; gap: 6px; }
.lb-mini-bar-val { font-size: 0.6875rem; font-weight: 600; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.lb-td-score {
    text-align: right; font-size: 1.125rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.lb-score-label { font-size: 0.5625rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.lb-td-stat-val { text-align: center; font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-debt-badge {
    display: inline-block; font-size: 0.5625rem; padding: 1px 5px; border-radius: 3px;
    background: var(--primary-light); color: var(--primary); font-weight: 600;
    margin-left: 4px; vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════
   RISK MANAGEMENT — Portfolio dashboard, LTV/DTI, diversification
   ═══════════════════════════════════════════════════════════════ */

.rm-portfolio-card { overflow: visible; }
.rm-portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.rm-metric-card {
    background: var(--bg-secondary); border-radius: 10px; padding: 14px;
    border: 1px solid var(--border-light);
}
.rm-metric-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.rm-metric-icon { font-size: 1rem; }
.rm-metric-title { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.rm-metric-value { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.rm-metric-bar { height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.rm-metric-bar-fill { height: 100%; border-radius: 2px; background: var(--success); transition: width 0.5s ease; }
.rm-metric-bar-fill.rm-bar-warning { background: var(--warning); }
.rm-metric-bar-fill.rm-bar-danger { background: var(--error); }
.rm-metric-detail { font-size: 0.6875rem; color: var(--text-tertiary); }
.rm-risk-badge {
    font-size: 0.6875rem; padding: 3px 10px; border-radius: 20px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.rm-risk-badge.rm-risk-low { background: rgba(39,174,96,0.1); color: #27ae60; }
.rm-risk-badge.rm-risk-moderate { background: rgba(243,156,18,0.1); color: #f39c12; }
.rm-risk-badge.rm-risk-high { background: rgba(231,76,60,0.1); color: #e74c3c; }
.rm-alerts {
    margin-top: 12px; display: flex; flex-direction: column; gap: 6px;
}
.rm-alert {
    display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
    border-radius: 8px; font-size: 0.8125rem; line-height: 1.4;
}
.rm-alert-warn { background: rgba(243,156,18,0.08); border-left: 3px solid var(--warning); }
.rm-alert-danger { background: rgba(231,76,60,0.08); border-left: 3px solid var(--error); }
.rm-alert-info { background: rgba(29,155,240,0.06); border-left: 3px solid var(--primary); }
.rm-alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* LTV / DTI badges on request cards */
.rm-badge-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rm-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.6875rem; font-weight: 600; padding: 2px 8px; border-radius: 4px;
}
.rm-badge-good { background: rgba(39,174,96,0.1); color: #27ae60; }
.rm-badge-caution { background: rgba(243,156,18,0.1); color: #e67e22; }
.rm-badge-risk { background: rgba(231,76,60,0.1); color: #e74c3c; }
.rm-badge-neutral { background: var(--bg-tertiary); color: var(--text-secondary); }

/* Auto-pay toggle */
.rm-toggle-label {
    position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer;
}
.rm-toggle-label input { opacity: 0; width: 0; height: 0; }
.rm-toggle-slider {
    position: absolute; inset: 0; background: var(--bg-tertiary); border-radius: 24px;
    transition: background 0.2s;
}
.rm-toggle-slider::before {
    content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: transform 0.2s;
}
.rm-toggle-label input:checked + .rm-toggle-slider { background: var(--primary); }
.rm-toggle-label input:checked + .rm-toggle-slider::before { transform: translateX(18px); }

/* Auto-pay schedule items */
.rm-schedule-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 8px;
    margin-bottom: 6px; font-size: 0.8125rem;
}
.rm-schedule-item .rm-sched-due { color: var(--text-secondary); font-size: 0.75rem; }
.rm-schedule-item .rm-sched-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.rm-schedule-item .rm-sched-status { font-size: 0.6875rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.rm-sched-upcoming { background: rgba(29,155,240,0.08); color: var(--primary); }
.rm-sched-overdue { background: rgba(231,76,60,0.08); color: var(--error); }

/* ═══════════════════════════════════════════════════════════════
   GUARANTOR NETWORK / FAMILY TREE
   ═══════════════════════════════════════════════════════════════ */

.gn-stats-row {
    display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px;
}
.gn-stat {
    flex: 1; min-width: 120px; background: var(--bg-secondary); border-radius: 10px;
    padding: 12px 16px; text-align: center; border: 1px solid var(--border-light);
}
.gn-stat-val { display: block; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.gn-stat-label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

.gn-tree-container { min-height: 200px; padding: 16px; overflow-x: auto; }

/* Tree node */
.gn-family-block { margin-bottom: 24px; }
.gn-family-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 2px solid var(--primary);
}
.gn-family-header-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem;
}
.gn-family-header-name { font-weight: 700; font-size: 0.9375rem; }
.gn-family-header-meta { font-size: 0.75rem; color: var(--text-secondary); }

/* Tree lines */
.gn-tree { position: relative; padding-left: 24px; }
.gn-tree::before {
    content: ''; position: absolute; left: 15px; top: 0; bottom: 16px;
    width: 2px; background: var(--border);
}
.gn-node {
    position: relative; padding: 8px 12px 8px 20px; margin-bottom: 4px;
    border-radius: 8px; transition: background 0.15s; cursor: pointer;
}
.gn-node:hover { background: var(--bg-secondary); }
.gn-node::before {
    content: ''; position: absolute; left: -9px; top: 16px;
    width: 16px; height: 2px; background: var(--border);
}
.gn-node::after {
    content: ''; position: absolute; left: -11px; top: 12px;
    width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--primary);
    background: var(--bg-primary);
}
.gn-node-info { display: flex; align-items: center; gap: 10px; }
.gn-node-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.625rem; color: #fff;
}
.gn-node-name { font-weight: 600; font-size: 0.8125rem; }
.gn-node-meta { font-size: 0.6875rem; color: var(--text-secondary); }
.gn-node-amount { font-size: 0.75rem; font-weight: 700; color: var(--primary); margin-left: auto; font-variant-numeric: tabular-nums; }
.gn-node-status { font-size: 0.625rem; padding: 1px 6px; border-radius: 3px; font-weight: 600; margin-left: 6px; }
.gn-status-approved { background: rgba(39,174,96,0.1); color: #27ae60; }
.gn-status-pending { background: rgba(243,156,18,0.1); color: #e67e22; }
.gn-subtree { margin-left: 20px; }

/* List view */
.gn-list-item {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border: 1px solid var(--border-light); border-radius: 10px; margin-bottom: 8px;
    transition: background 0.15s; cursor: pointer;
}
.gn-list-item:hover { background: var(--bg-secondary); }
.gn-list-chain {
    display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto;
}
.gn-chain-arrow { color: var(--text-tertiary); font-size: 0.75rem; flex-shrink: 0; }
.gn-chain-person {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
    background: var(--bg-secondary); padding: 3px 8px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600;
}
.gn-chain-person-avatar {
    width: 20px; height: 20px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 0.5rem;
    font-weight: 700; color: #fff;
}
.gn-list-amount { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.8125rem; white-space: nowrap; margin-left: auto; }

@media (max-width: 768px) {
    .lb-podium-row { flex-direction: column; align-items: center; }
    .lb-podium-card { max-width: 100% !important; }
    .lb-your-inner { flex-direction: column; text-align: center; }
    .lb-rankings-controls { flex-direction: column; width: 100%; }
    .lb-search-input { width: 100%; }
    .rm-portfolio-grid { grid-template-columns: 1fr 1fr; }
    .gn-stats-row { flex-direction: column; }
}

/* ════════════════════════════════════════════════════
   TOP RIGHT PROFILE BAR
   ════════════════════════════════════════════════════ */
.topbar-profile {
    position: fixed; top: 0; right: 0; z-index: 201;
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255,255,255,0.88); backdrop-filter: blur(12px);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom: 1px solid var(--border); border-left: 1px solid var(--border);
}
.topbar-profile svg { cursor: pointer; color: var(--text-secondary); transition: color var(--transition-fast); }
.topbar-profile svg:hover { color: var(--text-primary); }
.topbar-profile-btn {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.375rem 0.625rem 0.375rem 0.375rem;
    border-radius: var(--radius-full); cursor: pointer;
    transition: background var(--transition-fast); border: none; background: transparent;
}
.topbar-profile-btn:hover { background: var(--bg-hover); }
.topbar-avatar {
    width: 32px; height: 32px; border-radius: var(--radius-full);
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.6875rem; flex-shrink: 0;
}
.topbar-user-info { text-align: left; }
.topbar-user-name { font-weight: 600; font-size: 0.8125rem; color: var(--text-primary); display: block; line-height: 1.2; }
.topbar-user-tier { font-size: 0.625rem; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

/* Profile Dropdown */
.profile-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); right: 0;
    width: 280px; background: var(--bg-primary);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); overflow: hidden; z-index: 999;
    animation: modalPop 0.15s ease;
}
.profile-dropdown.active { display: block; }
.profile-dropdown-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem; background: var(--bg-tertiary);
}
.profile-dropdown-avatar {
    width: 44px; height: 44px; border-radius: var(--radius-full);
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8125rem; flex-shrink: 0;
}
.profile-dropdown-info { flex: 1; min-width: 0; }
.profile-dropdown-name { font-weight: 700; font-size: 0.9375rem; }
.profile-dropdown-email { font-size: 0.75rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown-tier-badge {
    display: inline-block; margin-top: 4px; padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full); font-size: 0.625rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--primary-light); color: var(--primary);
}
.profile-dropdown-divider { height: 1px; background: var(--border); }
.profile-dropdown-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; font-size: 0.875rem; font-weight: 500;
    color: var(--text-primary); cursor: pointer; transition: background var(--transition-fast);
    text-decoration: none;
}
.profile-dropdown-item:hover { background: var(--bg-hover); }
.profile-dropdown-item svg { color: var(--text-secondary); flex-shrink: 0; }
.profile-dropdown-danger { color: var(--error); }
.profile-dropdown-danger svg { color: var(--error); }

/* ════════════════════════════════════════════════════
   BANKING VIEW
   ════════════════════════════════════════════════════ */
.banking-tabs {
    display: flex; gap: 0; margin-bottom: 1rem; margin-top: 1rem;
    background: var(--bg-tertiary); border-radius: var(--radius-full); padding: 3px;
}
.banking-tab {
    flex: 1; padding: 0.5rem 1rem; border: none; background: transparent;
    border-radius: var(--radius-full); font-family: var(--font-body);
    font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition-base); text-align: center;
}
.banking-tab:hover { color: var(--text-primary); }
.banking-tab.active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.banking-panel { display: none; }
.banking-panel.active { display: block; }

/* Hero Card */
.banking-hero-card {
    background: var(--gradient-wallet); border-radius: var(--radius-xl);
    padding: 1.75rem 2rem; color: #fff; position: relative; overflow: hidden;
}
.banking-hero-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 15% 45%, rgba(29,155,240,0.15) 0%, transparent 55%),
                radial-gradient(circle at 85% 25%, rgba(0,186,124,0.1) 0%, transparent 45%);
    pointer-events: none;
}
.banking-hero-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; margin-bottom: 1.25rem; }
.banking-hero-label { font-size: 0.6875rem; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: 0.25rem; }
.banking-hero-amount { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; }
.banking-hero-actions { display: flex; gap: 0.5rem; }
.banking-hero-accounts {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
    padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.08);
    position: relative; z-index: 1;
}
.banking-hero-acct {}
.banking-hero-acct-label { font-size: 0.625rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; display: block; }
.banking-hero-acct-val { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; display: block; }

/* Account Cards Grid */
.banking-acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin-top: 1rem; }
.banking-acct-card {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.25rem; transition: all var(--transition-base);
}
.banking-acct-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.banking-acct-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.banking-acct-card-header h4 { font-size: 0.9375rem; font-weight: 700; margin: 0; }
.banking-acct-card-header .badge { margin-left: auto; }
.banking-acct-icon {
    width: 44px; height: 44px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.banking-acct-icon-blue { background: var(--info-light); color: var(--info); }
.banking-acct-icon-green { background: var(--success-light); color: var(--success); }
.banking-acct-num { font-size: 0.75rem; color: var(--text-secondary); font-family: monospace; }
.banking-acct-balance { margin-bottom: 1rem; }
.banking-acct-balance-label { font-size: 0.625rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.banking-acct-balance-val { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.banking-acct-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.banking-acct-meta-item { background: var(--bg-tertiary); border-radius: var(--radius-sm); padding: 0.5rem 0.625rem; }
.banking-acct-meta-item span { font-size: 0.625rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; display: block; }
.banking-acct-meta-item strong { font-size: 0.8125rem; font-weight: 700; }
.banking-acct-actions { display: flex; gap: 0.375rem; flex-wrap: wrap; }

/* Virtual Card */
.banking-card-display { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.5rem; margin-top:1rem; }
.banking-virtual-card {
    width: 380px; max-width: 100%; aspect-ratio: 1.586; border-radius: 16px;
    padding: 1.5rem 1.75rem; color: #fff; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.banking-virtual-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(29,155,240,0.2), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(249,24,128,0.1), transparent 40%);
    pointer-events: none;
}
.bvc-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.bvc-brand { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: 0.05em; }
.bvc-type { font-size: 1rem; font-weight: 700; letter-spacing: 0.1em; opacity: 0.7; }
.bvc-chip { margin: 1rem 0; position: relative; z-index: 1; }
.bvc-number { font-family: monospace; font-size: 1.25rem; letter-spacing: 0.15em; position: relative; z-index: 1; margin-bottom: 1rem; }
.bvc-bottom { display: flex; gap: 2rem; position: relative; z-index: 1; }
.bvc-label { font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.5; margin-bottom: 2px; }
.bvc-value { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; }
.banking-card-actions-row { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* Card Controls */
.banking-card-controls { margin-top: 1rem; }
.card-control-grid { display: flex; flex-direction: column; gap: 0; }
.card-control-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; background: var(--bg-primary);
    border: 1px solid var(--border); transition: background var(--transition-fast);
}
.card-control-item:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-control-item:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-control-item:not(:last-child) { border-bottom: none; }
.card-control-item:hover { background: var(--bg-hover); }
.card-control-info { display: flex; align-items: center; gap: 0.875rem; }
.card-control-info svg { color: var(--text-secondary); flex-shrink: 0; }
.card-control-title { font-weight: 600; font-size: 0.875rem; }
.card-control-desc { font-size: 0.75rem; color: var(--text-secondary); }
/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border-heavy); border-radius: 24px;
    transition: all var(--transition-base);
}
.toggle-slider::before {
    content: ''; position: absolute; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background: #fff;
    border-radius: 50%; transition: all var(--transition-base);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Spending Limits */
.spending-limits-grid { display: flex; flex-direction: column; gap: 1rem; }
.spending-limit-item {}
.spending-limit-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.8125rem; margin-bottom: 0.375rem; }
.spending-limit-header span { color: var(--text-secondary); }
.spending-limit-bar { height: 8px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; }
.spending-limit-fill { height: 100%; border-radius: 4px; background: var(--primary); transition: width 0.6s ease; }
.spending-limit-meta { font-size: 0.6875rem; color: var(--text-tertiary); margin-top: 0.25rem; }

/* Transfers */
.transfers-type-tabs {
    display: flex; gap: 0; margin: 1rem 0;
    background: var(--bg-tertiary); border-radius: var(--radius-full); padding: 3px;
}
.transfers-type-tab {
    flex: 1; padding: 0.5rem 0.75rem; border: none; background: transparent;
    border-radius: var(--radius-full); font-family: var(--font-body);
    font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition-base); text-align: center;
}
.transfers-type-tab:hover { color: var(--text-primary); }
.transfers-type-tab.active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.transfer-sub-panel { display: none; }
.transfer-sub-panel.active { display: block; }
.transfer-form { max-width: 520px; }
.transfer-form .form-group { margin-bottom: 1rem; }
.transfer-acct-selector { display: flex; align-items: flex-end; gap: 0.75rem; }
.transfer-acct-selector .form-group { flex: 1; }
.transfer-swap-btn {
    width: 40px; height: 40px; border-radius: var(--radius-full);
    border: 1.5px solid var(--border-heavy); background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0;
    margin-bottom: 1rem;
}
.transfer-swap-btn:hover { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }
.transfer-fee-notice {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem; background: var(--warning-light);
    border-radius: var(--radius-md); font-size: 0.8125rem;
    color: var(--warning); margin-bottom: 1rem;
}

/* Programs */
.programs-intro { margin-top: 1rem; }
.programs-intro-content h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.375rem; }
.programs-intro-content p { font-size: 0.875rem; color: var(--text-secondary); }
.programs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.program-card {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.25rem;
    display: flex; align-items: flex-start; gap: 1rem;
    transition: all var(--transition-base);
}
.program-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.program-card-icon {
    width: 52px; height: 52px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.program-icon-blue { background: var(--info-light); color: var(--info); }
.program-icon-green { background: var(--success-light); color: var(--success); }
.program-icon-purple { background: #f3e8ff; color: #9333ea; }
.program-icon-orange { background: var(--warning-light); color: var(--warning); }
.program-card-content { flex: 1; min-width: 0; }
.program-card-content h4 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 0.25rem; }
.program-card-content p { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.45; margin-bottom: 0.5rem; }
.program-card > .btn { flex-shrink: 0; align-self: center; }

/* ════════════════════════════════════════════════════
   PROFILE VIEW
   ════════════════════════════════════════════════════ */
.profile-header-card {
    position: relative; border-radius: var(--radius-xl); overflow: hidden;
    background: var(--bg-primary); border: 1px solid var(--border); margin-top: 1rem;
}
.profile-header-bg {
    height: 120px;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    position: relative;
}
.profile-header-bg::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 60%, rgba(29,155,240,0.2), transparent 50%),
                radial-gradient(circle at 80% 30%, rgba(249,24,128,0.12), transparent 40%);
}
.profile-header-content {
    display: flex; align-items: flex-end; gap: 1.25rem;
    padding: 0 1.5rem 1.25rem; margin-top: -40px; position: relative; z-index: 1;
}
.profile-avatar-large {
    width: 88px; height: 88px; border-radius: var(--radius-full);
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.75rem; flex-shrink: 0;
    border: 4px solid var(--bg-primary);
}
.profile-header-info { flex: 1; min-width: 0; padding-bottom: 0.25rem; }
.profile-header-info h2 { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; margin-bottom: 0.125rem; }
.profile-username { font-size: 0.875rem; color: var(--text-secondary); }
.profile-tier-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.375rem; }
.profile-tier-badge {
    display: inline-flex; padding: 0.1875rem 0.625rem; border-radius: var(--radius-full);
    font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.profile-tier-badge.member { background: var(--primary-light); color: var(--primary); }
.profile-tier-badge.associate { background: var(--success-light); color: var(--success); }
.profile-join-date { font-size: 0.75rem; color: var(--text-tertiary); }

/* Profile Stats */
.profile-stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-top: 1rem;
}
.profile-stat {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1rem; text-align: center;
    transition: all var(--transition-base);
}
.profile-stat:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.profile-stat-val { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
.profile-stat-label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-top: 0.125rem; }

/* Tier Comparison */
.tier-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tier-col { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.tier-col-header { padding: 1rem 1.25rem; }
.tier-col-header h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.125rem; }
.tier-col-header p { font-size: 0.75rem; opacity: 0.8; }
.tier-associate { background: linear-gradient(135deg, #e8f5fd, #f3e8ff); }
.tier-member { background: linear-gradient(135deg, var(--primary-light), #e8f8f2); }
.tier-features { list-style: none; padding: 0.75rem 1.25rem; }
.tier-features li {
    padding: 0.4375rem 0; font-size: 0.8125rem;
    display: flex; align-items: center; gap: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}
.tier-features li:last-child { border-bottom: none; }
.tier-included::before { content: '✓'; color: var(--success); font-weight: 700; font-size: 0.875rem; }
.tier-excluded::before { content: '—'; color: var(--text-tertiary); font-weight: 700; font-size: 0.875rem; }
.tier-excluded { color: var(--text-tertiary); }

/* Profile Details */
.profile-detail-grid { display: flex; flex-direction: column; gap: 0; }
.profile-detail-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 0; border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}
.profile-detail-row:last-child { border-bottom: none; }
.profile-detail-row span { color: var(--text-secondary); }
.profile-detail-row strong { font-weight: 600; }

/* ═══ Responsive Banking ═══ */
@media (max-width: 768px) {
    .topbar-profile { padding: 0.5rem 0.75rem; }
    .topbar-user-info { display: none; }
    .banking-hero-amount { font-size: 2rem; }
    .banking-hero-accounts { grid-template-columns: 1fr; gap: 0.5rem; }
    .banking-acct-grid { grid-template-columns: 1fr; }
    .banking-acct-meta { grid-template-columns: 1fr; }
    .banking-virtual-card { width: 100%; }
    .transfer-acct-selector { flex-direction: column; }
    .transfer-swap-btn { align-self: center; transform: rotate(90deg); margin-bottom: 0; }
    .programs-grid { grid-template-columns: 1fr; }
    .program-card { flex-direction: column; align-items: stretch; }
    .program-card > .btn { align-self: flex-start; }
    .profile-header-content { flex-direction: column; align-items: center; text-align: center; }
    .profile-stats-row { grid-template-columns: repeat(2, 1fr); }
    .tier-comparison { grid-template-columns: 1fr; }
    .profile-dropdown { width: 260px; }
}


/* ═══════════════════════════════════════════════════════════════
   ONBOARDING SYSTEM STYLES
   ═══════════════════════════════════════════════════════════════ */
.ob-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 20px 140px;
    min-height: 100vh;
    position: relative;
}
/* Progress Bar */
.ob-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color, #e2e5e9);
    z-index: 100;
}
.ob-progress-fill {
    height: 100%;
    background: var(--primary, #2563eb);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    border-radius: 0 4px 4px 0;
}
.ob-progress-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 8px;
    flex-wrap: wrap;
}
.ob-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color, #e2e5e9);
    transition: all 0.3s ease;
    cursor: pointer;
}
.ob-progress-dot.ob-dot-active {
    background: var(--primary, #2563eb);
    transform: scale(1.3);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.ob-progress-dot.ob-dot-done {
    background: var(--success, #16a34a);
}

/* Steps */
.ob-step {
    display: none;
    animation: obFadeIn 0.4s ease;
}
.ob-step.active {
    display: block;
}
@keyframes obFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero / Welcome */
.ob-hero {
    text-align: center;
    padding: 32px 0 24px;
}
.ob-hero-badge {
    display: inline-block;
    background: var(--primary, #2563eb);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.ob-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary);
}
.ob-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tier Grid */
.ob-tier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}
.ob-tier-card {
    background: var(--bg-secondary, #f9fafb);
    border: 2px solid var(--border-color, #e2e5e9);
    border-radius: 16px;
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}
.ob-tier-card:hover {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}
.ob-tier-card.ob-tier-selected {
    border-color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.04);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.ob-tier-card-premium {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(168, 85, 247, 0.03) 100%);
}
.ob-tier-badge-top {
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary, #2563eb), #7c3aed);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ob-tier-icon {
    color: var(--primary, #2563eb);
    margin-bottom: 12px;
}
.ob-tier-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 6px;
}
.ob-tier-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 16px;
}
.ob-tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    flex: 1;
}
.ob-tier-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.ob-check {
    color: var(--success, #16a34a);
    font-weight: 700;
    flex-shrink: 0;
}
.ob-check-gold {
    color: #d97706;
}
.ob-tier-req {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary, #f3f4f6);
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.ob-tier-btn {
    margin-top: auto;
}

/* Step Header */
.ob-step-header {
    margin-bottom: 24px;
}
.ob-step-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 6px;
}
.ob-step-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px;
}
.ob-step-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}
.ob-member-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary, #2563eb), #7c3aed);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* Form Grid */
.ob-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.ob-col-2 {
    grid-column: span 2;
}
.ob-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ob-form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.ob-form-group input,
.ob-form-group select,
.ob-form-group textarea {
    padding: 10px 12px;
    border: 1.5px solid var(--border-color, #e2e5e9);
    border-radius: 10px;
    font-size: 0.9rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    transition: border-color 0.2s;
    resize: none;
}
.ob-form-group input:focus,
.ob-form-group select:focus {
    border-color: var(--primary, #2563eb);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.ob-form-group input.field-error,
.ob-form-group select.field-error {
    border-color: var(--error, #dc2626);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.ob-req { color: var(--error, #dc2626); }
.ob-muted { color: var(--text-secondary); font-weight: 400; font-size: 0.75rem; }
.ob-muted-text { color: var(--text-secondary); font-size: 0.85rem; margin: 4px 0; }

.ob-section-divider {
    height: 1px;
    background: var(--border-color, #e2e5e9);
    margin: 28px 0;
}

/* Help Accordion */
.ob-help-section {
    margin: 24px 0 8px;
    border: 1px solid var(--border-color, #e2e5e9);
    border-radius: 12px;
    overflow: hidden;
}
.ob-help-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary, #f9fafb);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary, #2563eb);
    transition: background 0.2s;
}
.ob-help-toggle:hover {
    background: var(--bg-tertiary, #f3f4f6);
}
.ob-help-arrow {
    transition: transform 0.3s;
    font-size: 1rem;
}
.ob-help-section.ob-help-open .ob-help-arrow {
    transform: rotate(180deg);
}
.ob-help-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.ob-help-section.ob-help-open .ob-help-body {
    max-height: 600px;
}
.ob-help-content {
    padding: 16px 20px;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.ob-help-content h4 {
    color: var(--text-primary);
    margin: 0 0 8px;
    font-size: 0.95rem;
}
.ob-help-content p {
    margin: 0 0 10px;
}
.ob-help-content code {
    background: var(--bg-tertiary, #f3f4f6);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Guarantee Status Card */
.ob-guarantee-status-card {
    background: var(--bg-secondary, #f9fafb);
    border: 1.5px solid var(--border-color, #e2e5e9);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
}
.ob-guar-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.ob-guar-status-header h3 {
    font-size: 1rem;
    margin: 0;
}
.ob-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
    text-transform: uppercase;
}
.ob-status-pending { background: #fef3c7; color: #92400e; }
.ob-status-approved { background: #d1fae5; color: #065f46; }

.ob-guarantor-slot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e5e9);
    border-radius: 10px;
    margin-bottom: 10px;
}
.ob-guarantor-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.ob-guarantor-info {
    flex: 1;
    min-width: 0;
}
.ob-guarantor-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    font-weight: 600;
}
.ob-guarantor-name {
    font-weight: 600;
    font-size: 0.9rem;
}
.ob-guarantor-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.ob-guarantor-status {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.ob-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.ob-dot-pending { background: #f59e0b; }
.ob-dot-done { background: var(--success, #16a34a); }

/* Invite Link */
.ob-invite-section {
    margin: 24px 0;
}
.ob-invite-section h4 {
    font-size: 0.95rem;
    margin: 0 0 4px;
}
.ob-invite-link-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.ob-invite-input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color, #e2e5e9);
    border-radius: 10px;
    font-size: 0.85rem;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary);
}

/* Downgrade Option */
.ob-downgrade-option {
    margin: 24px 0;
}
.ob-downgrade-inner {
    background: var(--bg-secondary, #f9fafb);
    border: 1px dashed var(--border-color, #e2e5e9);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.ob-downgrade-inner p {
    margin: 0 0 8px;
    font-size: 0.9rem;
}

/* Linked Accounts (Onboarding) */
.ob-linked-section {
    margin-bottom: 24px;
}
.ob-linked-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.ob-linked-header h3 {
    font-size: 1rem;
    margin: 0;
}
.ob-linked-list {
    border: 1px solid var(--border-color, #e2e5e9);
    border-radius: 12px;
    overflow: hidden;
}
.ob-empty-linked {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-secondary);
}
.ob-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}
.ob-linked-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #e2e5e9);
    transition: background 0.15s;
}
.ob-linked-item:last-child { border-bottom: none; }
.ob-linked-item:hover { background: var(--bg-secondary, #f9fafb); }
.ob-linked-item-icon { font-size: 1.5rem; flex-shrink: 0; }
.ob-linked-item-info { flex: 1; min-width: 0; }
.ob-linked-item-name { font-weight: 600; font-size: 0.9rem; }
.ob-linked-item-detail { font-size: 0.8rem; color: var(--text-secondary); }
.ob-linked-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Fund Section */
.ob-fund-card {
    background: var(--bg-secondary, #f9fafb);
    border: 1.5px solid var(--border-color, #e2e5e9);
    border-radius: 14px;
    padding: 20px;
    margin-top: 16px;
}
.ob-fund-flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
    overflow-x: auto;
}
.ob-flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}
.ob-flow-icon {
    font-size: 1.3rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary, #fff);
    border: 1.5px solid var(--border-color, #e2e5e9);
    border-radius: 10px;
}
.ob-flow-node-active .ob-flow-icon {
    border-color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.06);
}
.ob-flow-node-final .ob-flow-icon {
    border-color: var(--success, #16a34a);
    background: rgba(22, 163, 74, 0.06);
}
.ob-flow-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}
.ob-flow-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
}
.ob-fund-result {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.6;
}
.ob-fund-result.ob-fund-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.ob-fund-result.ob-fund-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Account Setup Cards */
.ob-accounts-setup {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ob-setup-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-secondary, #f9fafb);
    border: 1.5px solid var(--border-color, #e2e5e9);
    border-radius: 12px;
    transition: all 0.2s;
}
.ob-setup-card.ob-setup-active {
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(37, 99, 235, 0.03);
}
.ob-setup-icon {
    color: var(--primary, #2563eb);
    flex-shrink: 0;
    font-size: 1.4rem;
}
.ob-setup-info {
    flex: 1;
    min-width: 0;
}
.ob-setup-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 2px;
}
.ob-setup-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}
.ob-setup-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.ob-setup-included {
    background: #d1fae5;
    color: #065f46;
}
.ob-member-services-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 16px;
}

/* Toggle Switch */
.ob-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.ob-toggle-switch input { opacity: 0; width: 0; height: 0; }
.ob-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border-color, #e2e5e9);
    border-radius: 24px;
    transition: 0.25s;
}
.ob-toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
}
.ob-toggle-switch input:checked + .ob-toggle-slider {
    background: var(--primary, #2563eb);
}
.ob-toggle-switch input:checked + .ob-toggle-slider:before {
    transform: translateX(20px);
}

/* Review Card */
.ob-review-card {
    border: 1.5px solid var(--border-color, #e2e5e9);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 24px;
}
.ob-review-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e2e5e9);
}
.ob-review-section:last-child { border-bottom: none; }
.ob-review-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    margin: 0 0 10px;
    font-weight: 600;
}
.ob-review-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
}
.ob-review-row span {
    color: var(--text-secondary);
}

/* Terms & Signature */
.ob-terms-section {
    margin-bottom: 24px;
}
.ob-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    font-size: 0.85rem;
    line-height: 1.5;
    cursor: pointer;
}
.ob-checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--primary, #2563eb);
}
.ob-signature-section {
    margin-bottom: 24px;
}
.ob-signature-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px dashed var(--border-color, #e2e5e9);
    border-radius: 12px;
    font-size: 1.1rem;
    font-style: italic;
    text-align: center;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-primary);
    margin-top: 8px;
    transition: border-color 0.2s;
}
.ob-signature-input:focus {
    border-color: var(--primary, #2563eb);
    outline: none;
}
.ob-signature-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 6px;
}

/* Confirmation */
.ob-confirmation {
    text-align: center;
    padding: 48px 0 24px;
}
.ob-confirm-animation {
    margin-bottom: 24px;
}
.ob-confirm-circle {
    display: inline-block;
    animation: obBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
@keyframes obBounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.ob-confirm-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px;
}
.ob-confirm-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 24px;
    line-height: 1.5;
}
.ob-confirm-summary {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ob-confirm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 10px;
    font-size: 0.85rem;
}
.ob-confirm-icon {
    color: var(--success, #16a34a);
    font-weight: 700;
    flex-shrink: 0;
}
.ob-nav-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-primary, #fff);
    border-top: 1px solid var(--border-color, #e2e5e9);
    z-index: 50;
}
/* Mobile */
@media (max-width: 640px) {
    .ob-tier-grid {
        grid-template-columns: 1fr;
    }
    .ob-form-grid {
        grid-template-columns: 1fr;
    }
    .ob-col-2 {
        grid-column: span 1;
    }
    .ob-fund-flow-diagram {
        gap: 2px;
        padding: 12px 0;
    }
    .ob-flow-label {
        font-size: 0.55rem;
    }
    .ob-flow-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
    .ob-flow-arrow svg {
        width: 24px;
    }
    .ob-container {
        padding: 16px 14px 120px;
    }
    .ob-confirm-summary {
        max-width: 100%;
    }
}

.toast-container { z-index: 9999; }

.contract-card img, .grp-card img, .message-card img, .gd-member-card img {
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════

   LOANS PANEL — Banking Tab

   ═══════════════════════════════════════════════════════════ */



/* IRS Tax Alert Banner */

.loan-tax-banner {

    display: flex; align-items: center; gap: 12px;

    background: linear-gradient(135deg, #1d4ed8, #1e40af);

    color: #fff; border-radius: var(--radius-lg);

    padding: 14px 18px; margin-bottom: 1rem; font-size: 0.8125rem; line-height: 1.5;

}

.loan-tax-banner-icon { font-size: 1.25rem; flex-shrink: 0; }

.loan-tax-banner-body { flex: 1; }



/* KPI row */

.loan-kpi-row {

    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 0.25rem;

}

.loan-kpi-card {

    background: var(--bg-primary); border: 1px solid var(--border);

    border-radius: var(--radius-lg); padding: 1rem 1.125rem;

}

.loan-kpi-card--accent { border-color: var(--primary); }

.loan-kpi-label { font-size: 0.625rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 0.25rem; }

.loan-kpi-val { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }

.loan-kpi-sub { font-size: 0.6875rem; color: var(--text-secondary); margin-top: 2px; }



/* Sub-tabs */

.loan-subtabs {

    display: flex; gap: 0; background: var(--bg-tertiary);

    border-radius: var(--radius-full); padding: 3px; margin-bottom: 0.75rem;

    width: fit-content;

}

.loan-subtab {

    padding: 0.4rem 1.25rem; border: none; background: transparent;

    border-radius: var(--radius-full); font-size: 0.8125rem; font-weight: 600;

    color: var(--text-secondary); cursor: pointer; transition: all var(--transition-base);

}

.loan-subtab:hover { color: var(--text-primary); }

.loan-subtab.active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-xs); }

.loan-subpanel { display: none; }

.loan-subpanel.active { display: block; }



/* Statement-style toolbar */

.loan-stmt-toolbar {

    display: flex; align-items: center; justify-content: space-between;

    margin-bottom: 1rem; flex-wrap: wrap; gap: 8px;

}

.loan-stmt-filter-row {

    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;

    padding: 10px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 0;

}

.loan-stmt-filter-label { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; font-weight: 500; }

.loan-stmt-filter-input {

    font-size: 0.8125rem; padding: 5px 10px; border: 1px solid var(--border);

    border-radius: 6px; background: var(--bg-secondary); color: var(--text-primary);

}



/* Bank-statement table — mirrors the screenshot */

.loan-stmt-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }

.loan-stmt-table thead th {

    padding: 8px 12px; text-align: left; font-size: 0.6875rem; font-weight: 700;

    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em;

    border-bottom: 2px solid var(--border); white-space: nowrap; background: var(--bg-secondary);

}

.loan-stmt-table thead th.num { text-align: right; }

.loan-stmt-table tbody tr { border-bottom: 1px solid var(--border-light); transition: background 0.1s; }

.loan-stmt-table tbody tr:hover { background: var(--bg-secondary); }

.loan-stmt-table td { padding: 10px 12px; vertical-align: middle; }

.loan-stmt-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.loan-stmt-table td.debit { text-align: right; color: var(--error); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.loan-stmt-table td.credit { text-align: right; color: var(--success); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.loan-stmt-table td.balance { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.loan-stmt-table .row-expand-btn {

    width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 4px;

    background: transparent; cursor: pointer; display: flex; align-items: center;

    justify-content: center; color: var(--text-secondary); font-size: 0.75rem;

}

.loan-stmt-table .row-expand-btn:hover { background: var(--bg-tertiary); }

.loan-stmt-pending { font-weight: 700; color: var(--warning, #f59e0b); }

.loan-stmt-completed { color: var(--success); }

.loan-stmt-late { color: var(--error); font-weight: 700; }

.loan-stmt-upcoming { color: var(--text-secondary); }



/* Loan card — borrower */

.loan-card {

    background: var(--bg-primary); border: 1px solid var(--border);

    border-radius: var(--radius-lg); margin-bottom: 0.75rem; overflow: hidden;

}

.loan-card-header {

    display: flex; align-items: center; justify-content: space-between;

    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; gap: 8px;

}

.loan-card-title { font-weight: 700; font-size: 0.9375rem; }

.loan-card-meta { font-size: 0.8125rem; color: var(--text-secondary); }

.loan-progress-bar { height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; margin: 0.5rem 0; }

.loan-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.4s; }

.loan-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }

.loan-card-stat { padding: 0.75rem 1rem; border-right: 1px solid var(--border-light); }

.loan-card-stat:last-child { border-right: none; }

.loan-card-stat-label { font-size: 0.625rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 2px; }

.loan-card-stat-val { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }

.loan-card-actions { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border-light); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }



/* P&L grid */

.loan-pl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }

.loan-pl-item {

    display: flex; justify-content: space-between; align-items: center;

    padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--border-light); border-right: 1px solid var(--border-light); font-size: 0.875rem;

}

.loan-pl-item:nth-child(even) { border-right: none; }

.loan-pl-item--warn { background: #fffbeb; }

.loan-pl-item span { color: var(--text-secondary); }



/* Tax rule cards */

.tax-rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1rem 0; }

.tax-rule-card { border-radius: var(--radius-md); padding: 1rem 1.125rem; font-size: 0.8125rem; line-height: 1.55; }

.tax-rule-title { font-weight: 700; font-size: 0.875rem; margin-bottom: 0.375rem; }

.tax-rule-card--blue { background: #eff6ff; border: 1px solid #bfdbfe; }

.tax-rule-card--blue .tax-rule-title { color: #1d4ed8; }

.tax-rule-card--green { background: #f0fdf4; border: 1px solid #bbf7d0; }

.tax-rule-card--green .tax-rule-title { color: #15803d; }

.tax-rule-card--yellow { background: #fffbeb; border: 1px solid #fde68a; }

.tax-rule-card--yellow .tax-rule-title { color: #92400e; }

.tax-rule-card--red { background: #fef2f2; border: 1px solid #fecaca; }

.tax-rule-card--red .tax-rule-title { color: #991b1b; }



/* Pending badge */

.loan-due-badge {

    display: inline-block; padding: 2px 10px; border-radius: 999px;

    font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em;

}

.loan-due-badge--overdue { background: #fef2f2; color: #991b1b; }

.loan-due-badge--soon    { background: #fffbeb; color: #92400e; }

.loan-due-badge--ok      { background: #f0fdf4; color: #15803d; }



/* Responsive */

@media (max-width: 768px) {

    .loan-kpi-row { grid-template-columns: repeat(2, 1fr); }

    .loan-card-stats { grid-template-columns: repeat(2, 1fr); }

    .loan-pl-grid { grid-template-columns: 1fr; }

    .tax-rule-grid { grid-template-columns: 1fr; }

    .loan-pl-item { border-right: none; }

    .loan-tax-banner { flex-direction: column; align-items: flex-start; }

}

@media (max-width: 480px) {

    .loan-kpi-row { grid-template-columns: 1fr 1fr; }

    .loan-stmt-table thead th:nth-child(2),

    .loan-stmt-table td:nth-child(2) { display: none; } /* hide Check # on mobile */

}

/* ═══════════════════════════════════════════════════════════
/* ═══════════════════════════════════════════════════════════
   OVERVIEW — Account Summary rows
   LOANS PANEL — Banking Tab
   ═══════════════════════════════════════════════════════════ */

.acct-summary-row {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr 0.9fr 1.4fr 1.1fr 0.7fr;
    align-items: center;
    gap: 0.5rem;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}
.acct-summary-row {
    display: grid;
    display: grid;
    grid-template-columns: 1.8fr 1.2fr 0.9fr 1.4fr 1.1fr 0.7fr;
    grid-template-columns: 1.8fr 1.2fr 0.9fr 1.4fr 1.1fr 0.7fr;
    align-items: center;
    align-items: center;
    gap: 0.5rem;
    gap: 0.5rem;
    padding: 9px 4px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    font-size: 0.8125rem;
}
.acct-summary-row:last-child { border-bottom: none; }
.acct-summary-header {
    padding: 6px 4px 8px;
    border-bottom: 2px solid var(--border);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
}
.acct-summary-row:not(.acct-summary-header):not(.acct-summary-loading):hover {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}
.acct-summary-loading { padding: 1rem 4px; border: none; display: block; }
/* column slots */
.accts-col-name  { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.accts-col-num   { font-family: monospace; font-size: 0.75rem; color: var(--text-secondary); }
.accts-col-type  { }
.accts-col-detail{ font-size: 0.75rem; color: var(--text-secondary); }
.accts-col-bal   { font-family: var(--font-display); font-weight: 700;
                   font-variant-numeric: tabular-nums; text-align: right; }
.accts-col-bal.negative { color: var(--error); }
.accts-col-action{ text-align: right; }
/* account icon dot */
.acct-dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6875rem; font-weight: 700; flex-shrink: 0;
}
.acct-dot-blue   { background: var(--info-light,#eff6ff);   color: var(--info,#3b82f6); }
.acct-dot-green  { background: var(--success-light,#f0fdf4); color: var(--success,#22c55e); }
.acct-dot-red    { background: #fef2f2; color: #dc2626; }
.acct-dot-orange { background: #fff7ed; color: #ea580c; }
.acct-dot-purple { background: #f5f3ff; color: #7c3aed; }
/* type badges */
.acct-type-badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 999px; font-size: 0.625rem; font-weight: 700;
    letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.acct-type-checking { background: #eff6ff; color: #1d4ed8; }
.acct-type-savings  { background: #f0fdf4; color: #15803d; }
.acct-type-loan     { background: #fef2f2; color: #991b1b; }
.acct-type-lending  { background: #f5f3ff; color: #6d28d9; }
@media (max-width: 640px) {
    .acct-summary-row {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .accts-col-num, .accts-col-type, .accts-col-detail { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   EMAIL PREFERENCES — Profile card
   ═══════════════════════════════════════════════════════════ */
.epref-group {
    margin-bottom: 1.25rem;
}
.epref-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
}
.epref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-light, #f3f4f6);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.12s;
}
.epref-row:last-child { border-bottom: none; }
.epref-row:hover { background: var(--bg-secondary); }
.epref-desc {
    font-size: 0.8125rem;
    color: var(--text-primary);
}

/* iOS-style toggle */
.epref-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 22px;
    border-radius: 11px;
    background: var(--border);
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}
.epref-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    transition: left 0.18s;
}
.epref-toggle:checked {
    background: var(--success, #22c55e);
}
.epref-toggle:checked::after {
    left: 19px;
}

/* ─── 2FA Panel ─────────────────────────────────────────────────────────── */
#twofa-form .form-group input[type="text"] {
    font-family: 'Roboto Mono', 'Courier New', monospace;
}

/* ── GoFundMe-style loan cards ── */
.marketplace-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.gfm-card { background: var(--bg-secondary); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.gfm-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.gfm-card-header { height: 100px; position: relative; display: flex; align-items: flex-end; padding: 12px; }
.gfm-avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.25); color: #fff; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,0.5); }
.gfm-funded-badge { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.9); color: #16a34a; font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.gfm-card-body { padding: 14px 16px 16px; }
.gfm-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.gfm-username { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.gfm-purpose-tag { font-size: 0.7rem; background: var(--bg-tertiary); color: var(--text-secondary); padding: 2px 8px; border-radius: 20px; }
.gfm-amount-headline { font-size: 1.1rem; color: var(--text-primary); margin-bottom: 2px; }
.gfm-subtitle { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 12px; }
.gfm-progress-track { height: 8px; background: var(--bg-tertiary); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.gfm-progress-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.gfm-progress-meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 12px; }
.gfm-stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.gfm-stat { text-align: center; }
.gfm-stat-value { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.gfm-stat-label { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }
.gfm-action-row { display: flex; gap: 8px; align-items: center; }
.gfm-pledge-btn { flex: 1; }
.gfm-own-badge { flex: 1; text-align: center; font-size: 0.75rem; color: var(--text-secondary); background: var(--bg-tertiary); padding: 6px 12px; border-radius: 8px; }

/* ============================================================
   PEER FUNDING — Cards + Slide-in Panel
   ============================================================ */

/* ── Filter bar ──────────────────────────────────────────────── */
.pf-filter-bar { display:flex; flex-direction:column; gap:10px; padding:14px 0 4px; }
.pf-pills { display:flex; flex-wrap:wrap; gap:6px; }
.pf-pill {
    padding:5px 13px; border-radius:99px; font-size:12px; font-weight:600;
    cursor:pointer; border:1.5px solid var(--border-heavy); background:transparent;
    color:var(--text-secondary); transition:all .15s; white-space:nowrap;
    font-family:var(--font-body); line-height:1.4;
}
.pf-pill.active, .pf-pill:hover { background:var(--primary); border-color:var(--primary); color:#fff; }
.pf-filter-controls { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.pf-search-wrap { position:relative; flex:1; min-width:140px; max-width:260px; }
.pf-si { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--text-tertiary); pointer-events:none; }
.pf-search-input {
    width:100%; padding:7px 12px 7px 30px; border-radius:99px;
    border:1.5px solid var(--border-heavy); background:var(--bg-tertiary);
    font-size:13px; color:var(--text-primary); outline:none; box-sizing:border-box;
    font-family:var(--font-body);
}
.pf-search-input:focus { border-color:var(--primary); }
.pf-sort-select {
    padding:7px 12px; border-radius:8px; border:1.5px solid var(--border-heavy);
    background:var(--bg-tertiary); font-size:12px; color:var(--text-primary);
    cursor:pointer; outline:none; font-family:var(--font-body);
}
.pf-grid-hdr { display:flex; justify-content:space-between; align-items:center; margin:12px 0 8px; }
.pf-count { font-size:12px; color:var(--text-secondary); }

/* ── Card grid ───────────────────────────────────────────────── */
.pf-card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:16px; width:100%; box-sizing:border-box; }
@keyframes pfIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
.pf-card {
    background:var(--bg-primary); border:1px solid var(--border); border-radius:14px;
    overflow:hidden; cursor:pointer; display:flex; flex-direction:column;
    transition:transform .18s ease,box-shadow .18s ease;
    box-shadow:0 1px 4px rgba(0,0,0,.05); animation:pfIn .35s ease both;
}
.pf-card:hover { transform:translateY(-3px); box-shadow:0 6px 20px rgba(0,0,0,.1); }
.pf-card-header {
    position:relative; height:88px; display:flex; align-items:flex-end;
    padding:10px 11px; gap:7px; flex-shrink:0;
}
.pf-cat-pill {
    background:rgba(255,255,255,.85); backdrop-filter:blur(4px); border-radius:99px;
    padding:3px 9px; font-size:10.5px; font-weight:700; color:#0f1419;
}
.pf-score-badge {
    position:absolute; top:8px; right:9px; background:rgba(255,255,255,.9);
    border-radius:9px; padding:4px 7px 2px; display:flex; flex-direction:column;
    align-items:center;
}
.pf-score-lbl { font-size:7.5px; letter-spacing:.07em; text-transform:uppercase; color:var(--text-tertiary); font-weight:700; }
.pf-initials {
    width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,.2);
    color:#fff; font-weight:800; font-size:12px; display:flex; align-items:center;
    justify-content:center; border:2px solid rgba(255,255,255,.4); flex-shrink:0;
}
.pf-urgency {
    position:absolute; top:8px; left:9px; background:rgba(244,33,46,.82);
    color:#fff; font-size:9.5px; font-weight:700; padding:2px 7px; border-radius:99px;
}
.pf-card-body { padding:11px 13px 13px; display:flex; flex-direction:column; gap:0; flex:1; }
.pf-borrower-line { font-size:10.5px; color:var(--text-tertiary); margin-bottom:3px; }
.pf-title {
    font-size:13px; font-weight:700; color:var(--text-primary); line-height:1.4; margin-bottom:4px;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.pf-excerpt {
    font-size:11.5px; color:var(--text-secondary); font-style:italic; line-height:1.5; margin-bottom:9px;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.pf-fund-line { display:flex; justify-content:space-between; font-size:11.5px; color:var(--text-secondary); margin-bottom:5px; }
.pf-fund-line strong { color:var(--text-primary); }
.pf-pct { font-weight:700; color:var(--primary); }
.pf-track { height:5px; background:var(--bg-tertiary); border-radius:99px; overflow:hidden; margin-bottom:10px; }
.pf-fill { height:100%; background:linear-gradient(90deg,var(--primary),#60b8f8); border-radius:99px; transition:width .8s ease; }
.pf-stats { display:grid; grid-template-columns:1fr 1fr 1fr; border-top:1px solid var(--border); border-bottom:1px solid var(--border); padding:8px 0; margin-bottom:10px; }
.pf-stat { text-align:center; }
.pf-sv { font-size:11.5px; font-weight:700; color:var(--text-primary); }
.pf-sl { font-size:9.5px; color:var(--text-tertiary); margin-top:1px; }
.pf-cta { width:100%; border-radius:99px; font-weight:700; font-size:12.5px; padding:8px 12px; margin-top:auto; }
.pf-own-badge { text-align:center; font-size:11px; color:var(--text-secondary); background:var(--bg-tertiary); padding:6px 12px; border-radius:8px; margin-top:auto; }

/* ============================================================
   SLIDE-IN PANEL
   ============================================================ */
.bpv-backdrop {
    display:none; position:fixed; inset:0; background:rgba(15,20,25,.45);
    z-index:900; backdrop-filter:blur(2px); cursor:pointer;
}
.bpv-backdrop.active { display:block; animation:bpvFade .2s ease; }
@keyframes bpvFade { from{opacity:0} to{opacity:1} }

.bpv-panel {
    position:fixed; top:0; right:0; bottom:0; width:680px; max-width:100vw;
    background:var(--bg-primary); z-index:901; display:flex; flex-direction:column;
    box-shadow:-6px 0 40px rgba(0,0,0,.16);
    transform:translateX(100%); transition:transform .3s cubic-bezier(.4,0,.2,1);
}
.bpv-panel.active { transform:translateX(0); }

.bpv-topbar { display:flex; align-items:center; justify-content:space-between; padding:12px 18px; border-bottom:1px solid var(--border); flex-shrink:0; }
.bpv-topbar-left { min-width:0; }
.bpv-topbar-name { font-size:13.5px; font-weight:700; color:var(--text-primary); }
.bpv-topbar-meta { font-size:11px; color:var(--text-secondary); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bpv-close { width:30px; height:30px; border:none; background:var(--bg-tertiary); border-radius:8px; cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text-secondary); flex-shrink:0; }
.bpv-close:hover { background:var(--border); color:var(--text-primary); }

.bpv-tabs { display:flex; border-bottom:1px solid var(--border); flex-shrink:0; }
.bpv-tab { flex:1; padding:10px 6px; border:none; background:none; font-size:12.5px; font-weight:400; color:var(--text-secondary); cursor:pointer; border-bottom:2.5px solid transparent; transition:all .14s; font-family:var(--font-body); }
.bpv-tab.active { font-weight:700; color:var(--text-primary); border-bottom-color:var(--primary); }

.bpv-scroll { flex:1; overflow-y:auto; overflow-x:hidden; }
.bpv-scroll::-webkit-scrollbar { width:4px; }
.bpv-scroll::-webkit-scrollbar-thumb { background:var(--border-heavy); border-radius:99px; }
.bpv-body-inner { padding:0; }

/* ── Story tab ───────────────────────────────────────────────── */
.bpv-hero {
    display:flex; align-items:center; gap:14px;
    padding:20px 20px 18px; flex-shrink:0;
    border-bottom:1px solid rgba(255,255,255,.15);
}
.bpv-hero-av {
    width:52px; height:52px; border-radius:50%; background:rgba(255,255,255,.25);
    color:#fff; font-weight:800; font-size:18px; display:flex; align-items:center;
    justify-content:center; flex-shrink:0; border:2px solid rgba(255,255,255,.4);
    letter-spacing:.5px;
}
.bpv-hero-info { flex:1; min-width:0; }
.bpv-hero-name { font-size:17px; font-weight:800; color:#fff; line-height:1.25; margin-bottom:3px; }
.bpv-hero-sub  { font-size:11.5px; color:rgba(255,255,255,.75); }
.bpv-hero-score {
    text-align:center; background:rgba(0,0,0,.18); border-radius:12px;
    padding:9px 14px; flex-shrink:0; border:1px solid rgba(255,255,255,.2);
    backdrop-filter:blur(4px);
}
.bpv-score-num { font-size:22px; font-weight:900; line-height:1; margin-bottom:2px; }
.bpv-score-lbl { font-size:9.5px; font-weight:700; color:rgba(255,255,255,.85); letter-spacing:.04em; }
.bpv-score-tag { font-size:8px; color:rgba(255,255,255,.5); text-transform:uppercase; letter-spacing:.07em; margin-top:2px; }

.bpv-inner { padding:18px 20px 40px; }

/* Loan card */
.bpv-loan-card {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:13px; padding:16px 18px; margin-bottom:16px;
}
.bpv-loan-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px; }
.bpv-loan-amt { font-size:26px; font-weight:900; color:var(--text-primary); line-height:1; margin-bottom:4px; }
.bpv-loan-terms { font-size:12px; color:var(--text-secondary); }
.bpv-pct-pill {
    background:var(--primary); color:#fff; font-size:13px; font-weight:800;
    padding:4px 10px; border-radius:99px; white-space:nowrap; flex-shrink:0;
    align-self:center;
}
.bpv-quote {
    font-style:italic; color:var(--text-secondary); font-size:12.5px; line-height:1.6;
    border-left:3px solid var(--primary); padding-left:11px; margin:0 0 12px;
}
.bpv-bar-track { height:6px; background:var(--bg-tertiary); border-radius:99px; overflow:hidden; margin-bottom:8px; }
.bpv-bar-fill  { height:100%; background:linear-gradient(90deg,var(--primary),#60b8f8); border-radius:99px; transition:width .8s ease; }
.bpv-bar-row   { display:flex; justify-content:space-between; align-items:center; font-size:11.5px; color:var(--text-secondary); }
.bpv-bar-needed { color:var(--primary); font-weight:600; }
.bpv-bar-full   { color:var(--success); font-weight:600; }

/* Stats grid */
.bpv-stats-grid {
    display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:18px;
}
.bpv-stat-card {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:10px; padding:10px 12px; text-align:center;
}
.bpv-stat-v { font-size:14px; font-weight:800; color:var(--text-primary); margin-bottom:3px; }
.bpv-stat-l { font-size:9.5px; color:var(--text-tertiary); text-transform:uppercase; letter-spacing:.04em; }

/* Info blocks (Employment, Timeline) */
.bpv-info-block { margin-bottom:12px; background:var(--bg-secondary); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.bpv-info-hdr   { padding:8px 14px; font-size:9.5px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--text-tertiary); background:var(--bg-tertiary); border-bottom:1px solid var(--border); }
.bpv-krows      { }
.bpv-krow       { display:flex; justify-content:space-between; align-items:center; padding:9px 14px; border-bottom:1px solid var(--border); }
.bpv-krow:last-child { border-bottom:none; }
.bpv-krow-l { font-size:12px; color:var(--text-secondary); }
.bpv-krow-v { font-size:12.5px; font-weight:600; color:var(--text-primary); text-align:right; }

/* Actions */
.bpv-actions { display:flex; gap:10px; padding-top:18px; border-top:1px solid var(--border); }
.bpv-action-btn { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:7px; font-weight:700; border-radius:10px; padding:11px 16px; font-size:13px; }



/* ── Credit File tab ─────────────────────────────────────────── */
.bpv-csec { margin-bottom:12px; background:var(--bg-secondary); border:1px solid var(--border); border-radius:11px; overflow:hidden; }
.bpv-csec:first-child { margin-top:0; }
/* credit/fund tabs wrap their content in .bpv-inner for consistent padding */
.bpv-csec-hdr { display:block; padding:8px 13px; font-size:10.5px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--primary); background:var(--bg-tertiary); border-bottom:1px solid var(--border); }
.bpv-kv { width:100%; border-collapse:collapse; }
.bpv-kv-l { padding:7px 13px; font-size:12.5px; color:var(--text-secondary); border-bottom:1px solid var(--border); }
.bpv-kv-v { padding:7px 13px; font-size:12.5px; font-weight:600; color:var(--text-primary); text-align:right; border-bottom:1px solid var(--border); }
.bpv-uw-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; padding:9px; }
.bpv-uw { background:var(--bg-tertiary); border:1px solid var(--border); border-radius:8px; padding:8px 10px; }
.bpv-uw-hdr { display:flex; align-items:center; gap:5px; margin-bottom:2px; }
.bpv-uw-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.bpv-uw-lbl { font-size:9.5px; color:var(--text-tertiary); text-transform:uppercase; letter-spacing:.05em; }
.bpv-uw-val { font-size:14px; font-weight:700; color:var(--text-primary); }
.bpv-uw-n { font-size:9.5px; color:var(--text-tertiary); margin-top:1px; }
.bpv-ftable { width:100%; border-collapse:collapse; font-size:12px; }
.bpv-ftable thead tr { border-bottom:2px solid var(--border); }
.bpv-ftable thead th { padding:6px 10px; text-align:right; color:var(--text-tertiary); font-weight:600; font-size:10.5px; }
.bpv-ftable thead th:first-child { text-align:left; }
.bpv-tr-hdr td { padding:6px 10px 2px; font-weight:700; font-size:10px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-tertiary); background:var(--bg-tertiary); }
.bpv-td-l { padding:5px 10px; color:var(--text-primary); border-bottom:1px solid var(--border); }
.bpv-td-r { padding:5px 10px; text-align:right; font-weight:600; border-bottom:1px solid var(--border); }
.bpv-td-n { padding:5px 10px; color:var(--text-tertiary); font-size:10.5px; border-bottom:1px solid var(--border); }
.bpv-inc { color:var(--success); }
.bpv-exp { color:var(--error); }
.bpv-ftable tfoot td { padding:6px 10px; border-bottom:1px solid var(--border); }
.bpv-tr-net td { background:var(--bg-tertiary); font-weight:700; }
.bpv-empty { padding:12px 14px; font-size:12.5px; color:var(--text-secondary); margin:0; }

/* ── Fund tab ────────────────────────────────────────────────── */
.bpv-slider-wrap { margin-bottom:20px; }
.bpv-slider-hdr { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:9px; }
.bpv-slider-lbl { font-size:10.5px; color:var(--text-tertiary); text-transform:uppercase; letter-spacing:.06em; font-weight:600; }
.bpv-slider-amt { font-size:26px; font-weight:800; color:var(--text-primary); }
input[type="range"]#bpv-slider { width:100%; accent-color:var(--primary); cursor:pointer; }
.bpv-slider-range { display:flex; justify-content:space-between; font-size:10.5px; color:var(--text-tertiary); margin-top:3px; }
.bpv-fund-summary { background:var(--bg-tertiary); border:1px solid var(--border); border-radius:12px; padding:14px 16px; margin-bottom:18px; }
.bpv-sum-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 16px; margin-bottom:12px; }
.bpv-sr-l { font-size:10px; color:var(--text-tertiary); text-transform:uppercase; letter-spacing:.06em; margin-bottom:1px; }
.bpv-sr-v { font-size:13px; font-weight:600; color:var(--text-primary); }
.bpv-net-ret { border-top:1px solid var(--border); padding-top:10px; }
.bpv-net-lbl { font-size:10px; color:var(--text-tertiary); text-transform:uppercase; letter-spacing:.06em; margin-bottom:2px; }
.bpv-net-val { font-size:22px; font-weight:800; color:var(--primary); }
.bpv-atbl { width:100%; border-collapse:collapse; font-size:11.5px; }
.bpv-atbl thead tr { border-bottom:2px solid var(--border); }
.bpv-atbl thead th { padding:5px 9px; text-align:right; color:var(--text-tertiary); font-weight:600; font-size:10.5px; }
.bpv-atbl thead th:first-child { text-align:left; }
.bpv-atbl tbody tr:nth-child(even) { background:var(--bg-tertiary); }
.bpv-atbl tbody td { padding:4px 9px; text-align:right; border-bottom:1px solid var(--border); }
.bpv-atbl tbody td:first-child { text-align:left; color:var(--text-secondary); }
.bpv-amort-sep td { text-align:center !important; color:var(--text-tertiary); font-size:10px; }
.bpv-impact { text-align:center; padding:11px 14px; background:var(--bg-tertiary); border-radius:9px; margin-bottom:16px; font-style:italic; color:var(--text-secondary); font-size:12.5px; line-height:1.6; border:1px solid var(--border); }
.bpv-fund-cta-wrap { padding-bottom:28px; }
.bpv-fund-cta-btn { width:100%; padding:13px; font-size:14px; font-weight:700; border-radius:11px; display:flex; flex-direction:column; align-items:center; gap:3px; }
.bpv-cta-sub { font-size:9.5px; opacity:.75; font-weight:400; letter-spacing:.06em; text-transform:uppercase; }
/* ═══════════════════════════════════════════════════════════
   FEED v2 — Home Tab Enhancements
   ═══════════════════════════════════════════════════════════ */

/* ── Feed tabs bar ── */
.feed-tabs-bar {
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 8px;
}
.feed-tabs { display: flex; }
.feed-tab {
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    transition: color var(--transition-base), border-color var(--transition-base);
    white-space: nowrap;
}
.feed-tab:hover { color: var(--text-primary); }
.feed-tab.active { color: var(--text-primary); border-bottom-color: var(--primary); }
.feed-tab.active::after { display: none; } /* override old pseudo-element */
.feed-search-wrap input {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    background: var(--bg-tertiary);
    width: 148px;
    outline: none;
    transition: border-color var(--transition-base);
    color: var(--text-primary);
}
.feed-search-wrap input:focus { border-color: var(--primary); }

/* ── Visibility selector ── */
.post-visibility-select {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    margin-left: 4px;
    font-family: var(--font-body);
}
.post-visibility-select:focus { border-color: var(--primary); color: var(--text-primary); }

/* ── Char counter states ── */
.char-count { font-size: 0.8125rem; color: var(--text-tertiary); transition: color var(--transition-base); font-weight: 500; }
.char-count.warn { color: var(--warning); }
.char-count.danger { color: var(--error); font-weight: 700; }

/* ── @mention autocomplete ── */
.mention-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 200;
    overflow: hidden;
    max-height: 240px;
    overflow-y: auto;
}
.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.mention-item:hover, .mention-item.active { background: var(--bg-hover); }
.mention-item-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.mention-item-name { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.mention-item-username { font-size: 0.8125rem; color: var(--text-secondary); }

/* ── New posts banner ── */
#new-posts-banner {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    animation: slideDown 0.25s ease-out;
}
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Skeleton loading ── */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border) 37%, var(--bg-tertiary) 63%);
    background-size: 800px 100%;
    animation: shimmer 1.4s ease infinite;
    margin-bottom: 8px;
}
.skeleton-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.skeleton-user::before {
    content: '';
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border) 37%, var(--bg-tertiary) 63%);
    background-size: 800px 100%;
    animation: shimmer 1.4s ease infinite;
}
.skeleton-user::after {
    content: '';
    flex: 1; height: 14px; border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border) 37%, var(--bg-tertiary) 63%);
    background-size: 800px 100%;
    animation: shimmer 1.4s ease infinite;
}
.post-card.skeleton {
    pointer-events: none;
}
.post-skeleton-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border) 37%, var(--bg-tertiary) 63%);
    background-size: 800px 100%;
    animation: shimmer 1.4s ease infinite;
}
.post-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* ── Sidebar widget enhancements ── */
.sidebar-widget { background: var(--bg-tertiary); border-radius: var(--radius-lg); overflow: hidden; }
.sidebar-widget-header { padding: 1rem 1rem 0.625rem; }
.sidebar-widget-header h2 { font-size: 1.0625rem; font-weight: 700; color: var(--text-primary); }

/* ── Trending item ── */
.trending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-radius: 0;
}
.trending-item:hover { background: rgba(0,0,0,0.04); }
.trending-tag { font-weight: 700; font-size: 0.9375rem; color: var(--text-primary); }
.trending-count { font-size: 0.75rem; color: var(--text-secondary); }

/* ── Suggested user card ── */
.suggest-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.625rem 1rem;
    transition: background var(--transition-fast);
}
.suggest-user-item:hover { background: rgba(0,0,0,0.04); }
.suggest-user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8125rem; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.suggest-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.suggest-user-info { flex: 1; min-width: 0; }
.suggest-user-name { font-weight: 700; font-size: 0.875rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-user-handle { font-size: 0.8125rem; color: var(--text-secondary); }

/* ═══════ Saints / Who to Follow Widget ═══════ */
.saint-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 1rem;
    transition: background 0.15s ease;
}
.saint-item:hover { background: rgba(0,0,0,0.03); }
.saint-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.8125rem;
    flex-shrink: 0;
}
.saint-info { flex: 1; min-width: 0; }
.saint-name { font-weight: 700; font-size: 0.8125rem; color: var(--text-primary); }
.saint-role { font-size: 0.6875rem; color: var(--text-secondary); line-height: 1.3; margin-top: 1px; }
.saint-divider {
    text-align: center;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    padding: 0.5rem 1rem 0.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
#saints-list > .saint-item:first-child .saint-name { color: var(--primary); }
#saints-list > .saint-item:first-child .saint-avatar { box-shadow: 0 0 0 2px rgba(201,168,54,0.4); }
.follow-btn-sm {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}
.follow-btn-sm:hover { background: var(--primary); color: #fff; }
.follow-btn-sm.following { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Score card in sidebar ── */
.sidebar-score-display {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}
.sidebar-score-num {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}
.sidebar-score-num.gold { color: #f59e0b; }
.sidebar-score-num.silver { color: #6b7280; }
.sidebar-score-num.gray { color: var(--text-secondary); }
.sidebar-score-label { font-size: 0.8125rem; color: var(--text-secondary); padding-bottom: 4px; }

/* ── Feed empty states ── */
.feed-empty {
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.feed-empty svg { color: var(--text-tertiary); }
.feed-empty-title { font-weight: 700; font-size: 1.0625rem; color: var(--text-primary); }
.feed-empty-sub { font-size: 0.9375rem; color: var(--text-secondary); max-width: 260px; }

/* ── Leaderboard rank badge ── */
.rank-badge {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6875rem; font-weight: 800; flex-shrink: 0;
    color: #fff;
}
.rank-badge.r1 { background: #f59e0b; }
.rank-badge.r2 { background: #9ca3af; }
.rank-badge.r3 { background: #b45309; }
.rank-badge.rn { background: var(--primary); }

/* ── Mobile: hide right sidebar on small screens ── */
@media (max-width: 780px) {
    .feed-container-full { grid-template-columns: 1fr; }
    .feed-sidebar-right { display: none; }
    .feed-search-wrap input { width: 120px; }
}
@media (max-width: 480px) {
    .feed-tabs-bar { flex-wrap: wrap; gap: 0; }
    .feed-search-wrap { width: 100%; padding: 4px 8px; }
    .feed-search-wrap input { width: 100%; }
    .post-visibility-select { display: none; }
}


/* ═══════════════════════════════════════════════════════════
   FULL PROFILE PAGE
   ═══════════════════════════════════════════════════════════ */

#member-profile-view {
    display: none; /* hidden by default — JS sets style.display to show/hide */
}
.profile-full-view {
    position: fixed;
    inset: 0;
    background: var(--bg-app);
    z-index: 400;
    overflow-y: auto;
    flex-direction: column;
    animation: profileSlideIn 0.22s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes profileSlideIn {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* Back bar */
.profile-back-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
}
.profile-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background var(--transition-fast);
}
.profile-back-btn:hover { background: var(--bg-hover); }
.profile-back-name { font-weight: 700; font-size: 0.9375rem; color: var(--text-primary); }

/* Page inner */
.profile-page-inner {
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
    min-height: calc(100vh - 52px);
}

/* Cover */
.profile-cover {
    height: 180px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    position: relative;
    flex-shrink: 0;
}

/* Header row: avatar left, actions right */
.profile-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px;
    margin-top: -52px;
    position: relative;
    z-index: 2;
    min-height: 80px;
}
.profile-avatar-wrap {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--bg-primary);
    background: var(--bg-primary);
    flex-shrink: 0;
    overflow: hidden;
}
.profile-page-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    overflow: hidden;
}
.profile-page-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-header-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Identity block */
.profile-identity {
    padding: 12px 20px 0;
}
.profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-name-row h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}
.pv-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
}
.profile-handle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.profile-score-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.profile-score-badge.gold   { background: #fef3c7; color: #92400e; }
.profile-score-badge.silver { background: #f3f4f6; color: #374151; }
.profile-score-badge.gray   { background: var(--bg-tertiary); color: var(--text-secondary); }
.profile-bio {
    margin-top: 10px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.55;
    white-space: pre-wrap;
}
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Stats */
.profile-stats-row {
    display: flex;
    gap: 0;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    margin-top: 10px;
}
.profile-stat-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 4px 0;
    margin-right: 20px;
    transition: opacity var(--transition-fast);
}
.profile-stat-btn:hover { opacity: 0.75; }
.profile-stat-btn strong { font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.profile-stat-btn span { font-size: 0.875rem; color: var(--text-secondary); }

/* Tabs */
.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    position: sticky;
    top: 52px;
    z-index: 5;
}
.profile-tab {
    flex: 1;
    padding: 0.875rem 0;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color var(--transition-base);
    white-space: nowrap;
}
.profile-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.profile-tab.active { color: var(--text-primary); }
.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* Tab panels */
.profile-tab-panel { display: none; }
.profile-tab-panel.active { display: block; }

/* Media grid */
.profile-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
}
.profile-media-thumb {
    aspect-ratio: 1;
    object-fit: cover;
    width: 100%;
    cursor: zoom-in;
    background: var(--bg-tertiary);
    transition: opacity var(--transition-fast);
}
.profile-media-thumb:hover { opacity: 0.85; }

/* Skeleton inside profile */
.pv-skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border) 37%, var(--bg-tertiary) 63%);
    background-size: 800px 100%;
    animation: shimmer 1.4s ease infinite;
    height: 96px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

/* Follow list modal body */
.follow-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}
.follow-list-item:hover { background: var(--bg-hover); }
.follow-list-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.875rem; flex-shrink: 0; overflow: hidden;
}
.follow-list-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.follow-list-name { font-weight: 700; font-size: 0.9375rem; color: var(--text-primary); }
.follow-list-handle { font-size: 0.8125rem; color: var(--text-secondary); }

/* Profile page buttons */
.btn-follow-profile {
    padding: 7px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-follow-profile:hover { background: var(--primary-hover); }
.btn-follow-profile.following {
    background: transparent;
    color: var(--primary);
}
.btn-follow-profile.following:hover {
    background: rgba(29,155,240,0.08);
    border-color: var(--primary);
}
.btn-dm-profile {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border-heavy);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-dm-profile:hover { border-color: var(--text-primary); }
.btn-edit-profile {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border-heavy);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-edit-profile:hover { border-color: var(--text-primary); }

/* Profile feed empty */
.profile-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

@media (max-width: 600px) {
    .profile-cover { height: 120px; }
    .profile-avatar-wrap { width: 76px; height: 76px; margin-top: -38px; }
    .profile-header-row { margin-top: -38px; }
    .profile-page-avatar { font-size: 1.5rem; }
    .profile-media-grid { grid-template-columns: repeat(3, 1fr); }
    .profile-tab { font-size: 0.8125rem; padding: 0.75rem 0; }
}

/* ═══════════════════════════════════════════════════════════
   POST THREAD VIEW
   ═══════════════════════════════════════════════════════════ */

#post-thread-view {
    position: fixed;
    inset: 0;
    background: var(--bg-app);
    z-index: 401;
    display: none; /* JS controls this */
    flex-direction: column;
    overflow-y: auto;
    animation: profileSlideIn 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.post-thread-back-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
}

.post-thread-inner {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
    min-height: calc(100vh - 52px);
    padding-bottom: 3rem;
}

/* Original post (big, full width) */
.thread-original-post {
    padding: 1.25rem 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.thread-op-header {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 12px;
}

.thread-op-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}
.thread-op-avatar img {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.thread-op-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
}

.thread-op-handle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.thread-op-content {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
}

.thread-media-row {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.thread-media-img {
    max-height: 300px;
    max-width: 100%;
    border-radius: 12px;
    object-fit: cover;
    cursor: zoom-in;
    flex: 1;
    min-width: 0;
}

.thread-op-timestamp {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.thread-op-stats {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.thread-op-stats strong {
    color: var(--text-primary);
    font-weight: 800;
}

.thread-op-actions {
    display: flex;
    gap: 8px;
    padding: 8px 0 14px;
}

/* Reply composer */
.post-thread-reply-composer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}

.pt-composer-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    overflow: hidden;
}
.pt-composer-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.pt-reply-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 14px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    margin-bottom: 8px;
    display: block;
    box-sizing: border-box;
}

.pt-reply-input:focus {
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(29,155,240,0.1);
}

.pt-reply-btn {
    border-radius: 20px;
    padding: 6px 18px;
}

/* Replies label */
.post-thread-comments-label {
    font-weight: 800;
    font-size: 1rem;
    padding: 14px 1.25rem 10px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

/* Individual comment in thread */
.thread-comment-item {
    display: flex;
    gap: 10px;
    padding: 14px 1.25rem;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.thread-comment-item:hover {
    background: var(--bg-hover);
}

.thread-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    overflow: hidden;
}
.thread-comment-avatar img {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.thread-comment-body { flex: 1; min-width: 0; }

.thread-comment-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.thread-comment-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.thread-comment-handle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.thread-comment-ts {
    font-size: 0.8125rem;
    color: var(--text-muted, var(--text-secondary));
    margin-left: auto;
}

.thread-comment-content {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.thread-comment-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.thread-comment-delete:hover { opacity: 1; color: var(--error); }

@media (max-width: 600px) {
    .thread-op-content { font-size: 1rem; }
    .thread-original-post, .post-thread-reply-composer, .thread-comment-item, .post-thread-comments-label { padding-left: 1rem; padding-right: 1rem; }
}

/* ═══════ MOBILE OPTIMIZATION ═══════ */

/* Sticky tab bars on mobile so they don't scroll away */
@media (max-width: 768px) {
    .credit-toggle-bar {
        position: sticky;
        top: 0;
        z-index: 10;
        margin: 0 calc(-1 * var(--content-pad));
        padding: 6px var(--content-pad);
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .banking-tabs {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--bg-primary);
        padding-bottom: 4px;
        border-bottom: 1px solid var(--border);
    }
    .contracts-tabs {
        position: sticky;
        top: 42px;
        z-index: 9;
        background: var(--bg-primary);
        padding: 4px 0;
    }
}

/* Touch target minimums (44px per Apple HIG) */
@media (max-width: 768px) {
    .btn, .credit-toggle-tab, .banking-tab, .contracts-tab,
    .grp-main-tab, .feed-tab, .svc-filter-tab, .arb-filter-tab {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .feed-tab {
        padding: 0.625rem 1rem;
    }
    .post-attach-btn {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Tighter spacing on small screens */
@media (max-width: 480px) {
    .view-header {
        padding: 0.75rem var(--content-pad);
    }
    .section-card {
        border-radius: var(--radius-md);
    }
    .credit-toggle-tab {
        font-size: 0.8125rem;
        padding: 0.5rem 0.5rem;
    }
}