@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg-base: #08090b;
    --bg-surface: #0f1012;
    --bg-elevated: #151618;
    --bg-hover: #1a1b1f;
    --bg-input: #111214;
    --surface-glass: rgba(15, 16, 18, 0.65);
    --surface-glass-strong: rgba(15, 16, 18, 0.82);
    --surface-glass-stronger: rgba(15, 16, 18, 0.92);
    --surface-glass-opaque: rgba(18, 19, 22, 0.97);
    --surface-subtle: rgba(255, 255, 255, 0.025);
    --surface-subtle-strong: rgba(255, 255, 255, 0.04);
    --surface-subtle-hover: rgba(255, 255, 255, 0.06);
    --surface-subtle-soft: rgba(255, 255, 255, 0.015);
    --surface-subtle-border: rgba(255, 255, 255, 0.04);
    --surface-border-strong: rgba(255, 255, 255, 0.07);
    --surface-border-soft: rgba(255, 255, 255, 0.045);
    --surface-divider: rgba(255, 255, 255, 0.04);
    --surface-overlay: rgba(0, 0, 0, 0.25);
    --modal-overlay: rgba(0, 0, 0, 0.82);
    --input-bg: rgba(15, 16, 18, 0.7);
    --input-bg-focus: rgba(18, 19, 22, 0.9);
    --chart-text: #71717a;
    --chart-grid: rgba(255, 255, 255, 0.03);
    --topbar-bg: rgba(12, 13, 15, 0.72);
    --sidebar-bg: rgba(12, 13, 15, 0.85);
    --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.25);
    --shadow-strong: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.4);
    --brand-primary: #F97316;
    --brand-secondary: #FB923C;
    --brand-rgb: 249, 115, 22;
    --brand-glow: rgba(249, 115, 22, 0.25);
    --brand-soft: rgba(249, 115, 22, 0.1);
    --brand-softest: rgba(249, 115, 22, 0.04);
    --brand-border: rgba(249, 115, 22, 0.18);
    --brand-focus: rgba(249, 115, 22, 0.12);
    --brand-shadow: rgba(249, 115, 22, 0.2);
    --brand-shadow-strong: rgba(249, 115, 22, 0.3);
    --brand-chart-fill: rgba(249, 115, 22, 0.18);
    --brand-chart-fill-soft: rgba(249, 115, 22, 0.12);
    --brand-chart-crosshair: rgba(249, 115, 22, 0.25);
    --brand-text-glow: rgba(249, 115, 22, 0.3);
    --text-primary: #f0f0f2;
    --text-secondary: #8b8b96;
    --text-muted: #494952;
    --positive: #10b981;
    --positive-dim: rgba(16, 185, 129, 0.12);
    --negative: #ef4444;
    --negative-dim: rgba(239, 68, 68, 0.12);
    --border: rgba(255, 255, 255, 0.055);
    --border-hover: rgba(255, 255, 255, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --sidebar-width: 236px;
    --sidebar-collapsed-width: 68px;
    --topbar-height: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; }
body { background: var(--bg-base); color: var(--text-primary); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; line-height: 1.5; min-height: 100vh; overflow-x: hidden; font-feature-settings: 'cv01', 'cv02', 'ss01'; letter-spacing: -0.011em; }
html.page-loading,
html.page-loading body {
    overflow: hidden;
}
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(10 10 12);
    transform: translateY(0);
    will-change: transform;
}
.page-loader.is-exiting {
    animation: page-loader-swipe-up 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.page-loader__media {
    width: min(180px, 42vw);
    max-width: 180px;
    aspect-ratio: 1;
    object-fit: contain;
    transform: scaleX(-1);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
@keyframes page-loader-swipe-up {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}
[data-theme="light"] {
    --bg-base: #f8f9fb;
    --bg-surface: #ffffff;
    --bg-elevated: #f1f3f6;
    --bg-hover: #ebedf1;
    --bg-input: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.85);
    --surface-glass-strong: rgba(255, 255, 255, 0.93);
    --surface-glass-stronger: rgba(255, 255, 255, 0.97);
    --surface-glass-opaque: rgba(255, 255, 255, 0.99);
    --surface-subtle: rgba(15, 23, 42, 0.025);
    --surface-subtle-strong: rgba(15, 23, 42, 0.04);
    --surface-subtle-hover: rgba(15, 23, 42, 0.06);
    --surface-subtle-soft: rgba(15, 23, 42, 0.015);
    --surface-subtle-border: rgba(15, 23, 42, 0.06);
    --surface-border-strong: rgba(15, 23, 42, 0.1);
    --surface-border-soft: rgba(15, 23, 42, 0.07);
    --surface-divider: rgba(15, 23, 42, 0.06);
    --surface-overlay: rgba(255, 255, 255, 0.6);
    --modal-overlay: rgba(15, 23, 42, 0.22);
    --input-bg: #f8f9fb;
    --input-bg-focus: #ffffff;
    --text-primary: #0c0f1a;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.14);
    --chart-text: #6b7280;
    --chart-grid: rgba(15, 23, 42, 0.06);
    --topbar-bg: rgba(255, 255, 255, 0.82);
    --sidebar-bg: rgba(255, 255, 255, 0.92);
    --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-strong: 0 2px 6px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 4px 12px rgba(15, 23, 42, 0.06), 0 20px 40px rgba(15, 23, 42, 0.12);
    --shadow-float: 0 2px 8px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.1);
}
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-subtle-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.app-layout { display: flex; min-height: 100vh; }

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width); min-height: 100vh;
    background:
        radial-gradient(140% 70% at 0% 0%, rgba(var(--brand-rgb), 0.08), transparent 55%),
        radial-gradient(80% 40% at 100% 100%, rgba(var(--brand-rgb), 0.04), transparent 60%),
        linear-gradient(180deg, rgba(10, 11, 13, 0.92), rgba(10, 11, 13, 0.86));
    backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-right: 1px solid var(--border); display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; z-index: 100;
    transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:
        1px 0 0 rgba(255, 255, 255, 0.02) inset,
        0 0 0 1px rgba(0, 0, 0, 0.2),
        4px 0 24px rgba(0, 0, 0, 0.25);
}
[data-theme="light"] .sidebar {
    background:
        radial-gradient(140% 70% at 0% 0%, rgba(var(--brand-rgb), 0.05), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
    box-shadow:
        1px 0 0 rgba(15, 23, 42, 0.02) inset,
        4px 0 24px rgba(15, 23, 42, 0.06);
}
.sidebar::after {
    content: ''; position: absolute; top: 0; right: -1px; width: 1px; height: 100%;
    background: linear-gradient(180deg, transparent, rgba(var(--brand-rgb), 0.22) 22%, rgba(var(--brand-rgb), 0.1) 60%, transparent);
    pointer-events: none; opacity: 0.8;
}
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
.sidebar-header {
    padding: 20px 18px 16px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--surface-divider); position: relative;
    min-height: calc(var(--topbar-height) + 8px);
}
.sidebar-home-link { display: inline-flex; align-items: center; gap: 12px; width: 100%; }
.sidebar-logo-img { object-fit: cover; flex-shrink: 0; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, filter 0.3s ease; }
.sidebar-logo-img:hover { transform: scale(1.04); filter: drop-shadow(0 0 12px rgba(var(--brand-rgb), 0.35)); }
.sidebar-logo-full { width: 100%; }

/* Mobile */
@media (max-width: 768px) {
  .sidebar-logo-full {
    width: 70%; /* adjust: 60%–80% depending on look */
  }
}
.sidebar-logo-compact { width: 36px; display: none; }
.sidebar-logo { width: 28px; height: 28px; background: var(--brand-primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0; }
.sidebar-brand { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; letter-spacing: -0.03em; color: var(--text-primary); }
.sidebar-collapsed .sidebar-brand { display: none; }
#sidebar-toggle {
    background: linear-gradient(180deg, var(--bg-elevated), var(--bg-surface));
    border: 1px solid var(--border); color: var(--text-secondary);
    width: 26px; height: 26px; border-radius: 50%; margin-left: auto;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25), 0 0 0 0 var(--brand-glow);
}
#sidebar-toggle:hover {
    color: var(--brand-primary); border-color: var(--brand-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3), 0 0 0 4px var(--brand-soft);
}
#sidebar-toggle i { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.sidebar-collapsed #sidebar-toggle i { transform: rotate(180deg); }
.sidebar-collapsed .sidebar-header { padding-inline: 12px; justify-content: center; gap: 0; }
.sidebar-collapsed .sidebar-home-link { gap: 0; }
.sidebar-collapsed .sidebar-logo-full { display: none; }
.sidebar-collapsed .sidebar-logo-compact { display: block; }
.sidebar-collapsed #sidebar-toggle { margin-left: 0; position: absolute; top: 24px; right: -13px; }

.sidebar-nav { flex: 1; padding: 16px 14px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto;}
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 10px; color: var(--text-secondary);
    font-size: 13px; font-weight: 500; letter-spacing: -0.005em;
    transition: color 0.18s ease, background 0.18s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
    white-space: nowrap; position: relative;
    border: 1px solid transparent;
}
/* CRM page_access: no flash of wrong links — hide gated items until JS applies access */
html:not(.page-access-ready) .sidebar-nav a[data-nav-page],
html:not(.page-access-ready) .sidebar-nav .nav-divider {
    display: none !important;
}
/* CRM page_access: author `display:flex` must not beat the `hidden` attribute */
.sidebar-nav a[data-nav-page][hidden] {
    display: none !important;
}
.sidebar-nav .nav-divider[hidden] {
    display: none !important;
}
.sidebar-nav a::before {
    content: ''; position: absolute; left: 0; top: 50%; height: 0; width: 2px;
    background: var(--brand-primary); border-radius: 0 2px 2px 0;
    transform: translateY(-50%); opacity: 0;
    transition: height 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
    box-shadow: 0 0 8px var(--brand-glow);
}
.sidebar-nav a:hover {
    color: var(--text-primary); background: var(--surface-subtle-hover);
    border-color: var(--surface-border-soft);
}
.sidebar-nav a.active {
    color: var(--text-primary);
    background: linear-gradient(95deg, rgba(var(--brand-rgb), 0.16), rgba(var(--brand-rgb), 0.05) 65%, rgba(var(--brand-rgb), 0.02));
    border-color: rgba(var(--brand-rgb), 0.22);
    box-shadow:
        0 0 0 1px rgba(var(--brand-rgb), 0.05),
        0 8px 20px -10px rgba(var(--brand-rgb), 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.sidebar-nav a.active::before { height: 60%; opacity: 1; }
.sidebar-nav a i {
    font-size: 18px; width: 20px; text-align: center; flex-shrink: 0;
    transition: color 0.18s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-nav a:hover i { color: var(--text-primary); transform: scale(1.08); }
.sidebar-nav a.active i { color: var(--brand-primary); filter: drop-shadow(0 0 6px var(--brand-glow)); }
.sidebar-collapsed .sidebar-nav a {
    justify-content: center; padding: 11px 0; gap: 0;
}
.sidebar-collapsed .sidebar-nav a:hover { transform: none; }
.sidebar-collapsed .sidebar-nav a span { display: none; }
.sidebar-collapsed .sidebar-nav a.active::before { left: 6px; }
.sidebar-nav .nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border) 30%, var(--border) 70%, transparent);
    margin: 16px 6px 12px; border: none; position: relative;
}
.sidebar-footer { padding: 12px 14px 18px; border-top: 1px solid var(--surface-divider); }
.sidebar-footer a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 10px; color: var(--text-muted); font-size: 13px;
    font-weight: 500;
    transition: color 0.18s ease, background 0.18s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    border: 1px solid transparent;
}
.sidebar-footer a i { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; transition: transform 0.25s ease; }
.sidebar-footer a:hover { color: var(--negative); background: var(--negative-dim); border-color: rgba(239, 68, 68, 0.18); }
.sidebar-footer a:hover i { transform: translateX(2px); }
.sidebar-collapsed .sidebar-footer a { justify-content: center; padding-inline: 0; gap: 0; }
.sidebar-collapsed .sidebar-footer a:hover { transform: none; }
.sidebar-collapsed .sidebar-footer a span { display: none; }

/* Sidebar nav scrollbar — slim and subtle */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: var(--surface-subtle-hover); }
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    z-index: 95;
}
.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--surface-border-soft);
    background:
        linear-gradient(180deg, var(--surface-subtle-hover), var(--surface-subtle));
    color: var(--text-primary);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 4px 12px -6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}
.mobile-nav-toggle:hover {
    transform: translateY(-1px);
    background: var(--surface-subtle-hover);
    border-color: var(--brand-border);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 8px 18px -8px rgba(var(--brand-rgb), 0.35);
}
.mobile-nav-toggle:active { transform: translateY(0); }
.mobile-nav-toggle i { font-size: 20px; }

/* ─── Main Content ─── */
.main-content {
    flex: 1; margin-left: var(--sidebar-width); min-height: 100vh;
    transition: margin-left 0.3s ease; display: flex; flex-direction: column;
}
.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-width); }

/* ─── Top Bar ─── */
.topbar {
    height: var(--topbar-height);
    background:
        linear-gradient(180deg, rgba(15, 16, 18, 0.78), rgba(12, 13, 15, 0.72));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid var(--surface-divider);
    display: flex; align-items: center;
    padding: 0 clamp(16px, 1.8vw, 26px);
    gap: 10px;
    position: sticky; top: 0; z-index: 50;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.025) inset,
        0 6px 20px -8px rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .topbar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82));
    box-shadow:
        0 1px 0 rgba(15, 23, 42, 0.04) inset,
        0 6px 18px -10px rgba(15, 23, 42, 0.1);
}
.topbar::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--brand-rgb), 0.18) 35%, rgba(var(--brand-rgb), 0.18) 65%, transparent);
    opacity: 0.6;
    pointer-events: none;
}

/* Market info: refined pill with subtle background */
.topbar-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px;
    background: var(--surface-subtle);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.005em;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.18s ease;
    position: relative;
}
.topbar-pill:hover {
    color: var(--text-primary);
    background: var(--surface-subtle-hover);
    border-color: var(--surface-border-soft);
    transform: translateY(-1px);
}
.topbar-pill .positive { color: var(--positive); font-weight: 700; }
.topbar-pill .negative { color: var(--negative); font-weight: 700; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* Visual separator between groups in topbar-right */
.topbar-right .topbar-divider,
.topbar-right > .topbar-icon + .user-display {
    position: relative;
}
.topbar-right > .topbar-icon + .user-display::before {
    content: '';
    position: absolute; left: -8px; top: 50%;
    width: 1px; height: 24px;
    background: var(--surface-divider);
    transform: translateY(-50%);
}

.search-box {
    display: flex; align-items: center; gap: 10px;
    padding: 0 14px;
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border-soft);
    border-radius: 10px;
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    min-width: clamp(220px, 22vw, 320px);
    height: 38px;
    margin-right: 4px;
}
.search-box i { font-size: 14px; color: var(--text-muted); transition: color 0.15s ease; flex-shrink: 0; }
.search-box:hover {
    background: var(--surface-subtle-hover, var(--surface-subtle));
    border-color: var(--surface-border-soft);
    color: var(--text-primary);
}
.search-box:hover i { color: var(--text-secondary); }
.search-box.is-active {
    border-color: var(--brand-border);
    background: var(--bg-base);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--brand-focus);
}
.search-box.is-active i { color: var(--brand-primary); }
.search-box kbd {
    margin-left: auto;
    background: var(--bg-base);
    border: 1px solid var(--surface-border-soft);
    border-radius: 4px; padding: 2px 6px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.topbar-icon {
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border-soft);
    color: var(--text-secondary);
    font-size: 16px;
    width: 38px; height: 38px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.topbar-icon:hover {
    color: var(--text-primary);
    background: var(--surface-subtle-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.4);
}
.topbar-icon:active { transform: translateY(0); }
.topbar-icon.notification-bell { position: relative; }
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 999px;
    background: var(--brand-primary);
    color: transparent;
    font-size: 0;
    border: 2px solid var(--topbar-bg, var(--bg-base));
    box-shadow: 0 0 0 1px var(--brand-primary);
    line-height: 1;
    pointer-events: none;
}
.notification-badge[hidden] { display: none; }

.user-display {
    display: inline-flex; align-items: center; gap: 9px;
    cursor: pointer;
    padding: 3px 12px 3px 3px;
    border-radius: 999px;
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border-soft);
    margin-left: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.user-display:hover {
    background: var(--surface-subtle-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.4);
}
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
    overflow: hidden; flex-shrink: 0;
    box-shadow:
        0 0 0 2px rgba(var(--brand-rgb), 0.2),
        0 4px 10px -4px rgba(var(--brand-rgb), 0.5);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.user-addr { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

/* ─── Page Content ─── */
.page-content { flex: 1; padding: clamp(24px, 2.4vw, 40px); width: 100%; }
.page-header { margin-bottom: 20px; min-width: 0; }
.page-header > * { min-width: 0; }
.page-header.page-header-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    flex-wrap: wrap;
}
.page-title { font-size: clamp(22px, 1.8vw, 30px); font-weight: 700; letter-spacing: -0.03em; }
.page-subtitle { font-size: clamp(13px, 0.95vw, 15px); color: var(--text-secondary); margin-top: 4px; max-width: 60ch; }
.workspace-meta {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.95fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 24px;
        display: none !important;
}
.workspace-meta__panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 24px;
    border-radius: 24px;
    border: 1px solid var(--surface-border-soft);
    background:
        radial-gradient(circle at top right, var(--brand-soft) 0%, transparent 34%),
        linear-gradient(180deg, var(--surface-glass-strong), var(--surface-glass));
    box-shadow: var(--shadow-soft);
}
.workspace-meta__panel::after {
    content: '';
    position: absolute;
    inset: auto -32px -42px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--brand-soft) 0%, transparent 70%);
    pointer-events: none;
}
.workspace-meta__eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(var(--brand-rgb), 0.08);
    border: 1px solid rgba(var(--brand-rgb), 0.18);
    color: var(--brand-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.workspace-meta__title {
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 800;
    letter-spacing: -0.04em;
    max-width: 16ch;
}
.workspace-meta__text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    max-width: 60ch;
}
.workspace-meta__chip-row,
.workspace-meta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.workspace-meta__chip,
.workspace-meta__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 14px;
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.workspace-meta__chip i,
.workspace-meta__link i {
    font-size: 15px;
}
.workspace-meta__chip.positive {
    color: var(--positive);
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.18);
}
.workspace-meta__chip.warning {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.18);
}
.workspace-meta__chip.negative {
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.18);
}
.workspace-meta__link {
    color: var(--text-primary);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.workspace-meta__link:hover {
    transform: translateY(-1px);
    border-color: var(--brand-border);
    background: rgba(var(--brand-rgb), 0.07);
}
.workspace-meta__actions-copy strong {
    display: block;
    font-size: 13px;
    letter-spacing: -0.02em;
}
.workspace-meta__actions-copy span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}
.app-footer {
    margin: 6px clamp(20px, 2.8vw, 40px) 28px;
    padding: 22px 24px;
    border-radius: 24px;
    border: 1px solid var(--surface-border-soft);
    background:
        linear-gradient(180deg, var(--surface-glass-strong), var(--surface-glass)),
        radial-gradient(circle at top right, var(--brand-softest) 0%, transparent 30%);
    box-shadow: var(--shadow-soft);
    display: none;
}
.app-footer__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--surface-divider);
}
.app-footer__brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}
.app-footer__brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    box-shadow: 0 12px 28px var(--brand-soft);
}
.app-footer__brand-mark img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.app-footer__brand-copy strong {
    display: block;
    font-size: 14px;
    letter-spacing: -0.02em;
}
.app-footer__brand-copy p {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    max-width: 54ch;
}
.app-footer__status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.app-footer__status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 999px;
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}
.app-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 18px;
}
.app-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.app-footer__links a {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}
.app-footer__links a:hover {
    color: var(--text-primary);
}
.app-footer__note {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
}
.btn,
.btn-sm,
.btn-secondary,
.btn-primary,
.btn-outline,
.form-input,
.form-select,
.form-textarea {
    max-width: 100%;
}
.card,
.stat-card,
.quick-stat,
.history-stat,
.support-card,
.ticket-panel,
.ticket-form,
.tier-card,
.hero-panel {
    min-width: 0;
}
.table-responsive,
.table-scroll,
.history-table-wrap,
.history-panel,
.page-media-hero,
.page-media-hero__content {
    min-width: 0;
}
.modal-body > *,
.modal-footer > *,
.filter-group > *,
.topbar > *,
.topbar-right > * {
    min-width: 0;
}
.modal-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.modal-actions-grid > * {
    min-width: 0;
}
.search-box .search-box__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-box .search-box__shortcut {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0 8px;
    height: 26px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--surface-border-soft);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.legal-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 107, 0, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 138, 0, 0.08), transparent 22%),
        linear-gradient(180deg, #09090b 0%, var(--bg-base) 28%, var(--bg-base) 100%);
}
.legal-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}
.legal-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding: 16px 20px;
    border: 1px solid var(--surface-border-soft);
    border-radius: 24px;
    background: rgba(10, 10, 12, 0.76);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
}
.legal-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.legal-brand img {
    height: 36px;
    width: auto;
    object-fit: contain;
}
.legal-brand-copy strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.legal-brand-copy span {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
}
.legal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.legal-nav-link,
.legal-utility-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.legal-nav-link:hover,
.legal-utility-link:hover,
.legal-nav-link.active {
    color: var(--text-primary);
    border-color: var(--brand-border);
    background: var(--brand-soft);
    transform: translateY(-1px);
}
.legal-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    padding: clamp(28px, 4vw, 48px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(17, 17, 19, 0.92), rgba(17, 17, 19, 0.66)),
        radial-gradient(circle at 14% 18%, rgba(255, 107, 0, 0.2), transparent 32%),
        radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.05), transparent 18%);
    box-shadow: var(--shadow-strong);
}
.legal-hero::after {
    content: '';
    position: absolute;
    inset: auto -120px -140px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 0, 0.2) 0%, transparent 70%);
    pointer-events: none;
}
.legal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--brand-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.legal-hero-title {
    max-width: 14ch;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 0.98;
    letter-spacing: -0.06em;
    font-weight: 900;
}
.legal-hero-text {
    max-width: 72ch;
    margin-top: 16px;
    color: rgba(244, 244, 245, 0.78);
    font-size: 16px;
    line-height: 1.8;
}
.legal-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}
.legal-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(244, 244, 245, 0.78);
    font-size: 13px;
    font-weight: 600;
}
.legal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}
.legal-card {
    border-radius: 28px;
    border: 1px solid var(--surface-border-soft);
    background: linear-gradient(180deg, var(--surface-glass-strong), var(--surface-glass));
    box-shadow: var(--shadow-soft);
}
.legal-article {
    padding: clamp(24px, 3vw, 36px);
}
.legal-article section + section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--surface-divider);
}
.legal-article h2 {
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.04em;
}
.legal-article p,
.legal-article li {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}
.legal-article ul {
    margin: 14px 0 0 18px;
}
.legal-article strong {
    color: var(--text-primary);
}
.legal-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
}
.legal-sidebar h3 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.legal-sidebar p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}
.legal-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.legal-sidebar-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.legal-sidebar-list a:hover,
.legal-sidebar-list a.active {
    color: var(--text-primary);
    border-color: var(--brand-border);
    background: var(--brand-soft);
    transform: translateY(-1px);
}
.legal-note {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--surface-border-soft);
    background: linear-gradient(180deg, var(--surface-subtle-strong), var(--surface-subtle-soft));
}
.legal-note strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 800;
}
.legal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 20px 2px 0;
    border-top: 1px solid var(--surface-divider);
    color: var(--text-muted);
    font-size: 12px;
}
[data-theme="light"] .legal-page {
    background:
        radial-gradient(circle at top left, rgba(255, 107, 0, 0.12), transparent 28%),
        linear-gradient(180deg, #f7fafc 0%, var(--bg-base) 26%, var(--bg-base) 100%);
}
[data-theme="light"] .legal-topbar,
[data-theme="light"] .legal-card {
    background: rgba(255, 255, 255, 0.86);
}
@media (max-width: 980px) {
    .legal-grid { grid-template-columns: 1fr; }
    .legal-sidebar { position: static; }
}
@media (max-width: 720px) {
    .legal-shell { width: min(100% - 20px, 1180px); padding-top: 16px; }
    .legal-topbar { padding: 14px 16px; border-radius: 20px; flex-direction: column; align-items: stretch; }
    .legal-nav { justify-content: flex-start; }
    .legal-hero { border-radius: 26px; }
    .legal-hero-title { max-width: none; }
    .legal-article,
    .legal-sidebar { padding: 20px; }
    .legal-footer { flex-direction: column; align-items: flex-start; }
}
/* ─── Command Palette v2 ─── */
.modal-overlay.quick-search-overlay {
    align-items: flex-start;
    padding-top: clamp(40px, 10vh, 120px);
}
.modal.modal--search {
    width: min(680px, calc(100vw - 32px));
    max-width: 680px;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
}
.modal.modal--search .modal-body { padding: 0; }

.search-modal-shell.search-modal-shell--v2 {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.search-modal-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--surface-divider);
    background: var(--surface-glass-stronger);
}
.search-modal-input-icon {
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.search-modal-input {
    flex: 1; min-width: 0;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    outline: none;
}
.search-modal-input::placeholder { color: var(--text-muted); font-weight: 400; }
.search-modal-esc {
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border-soft);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    line-height: 1;
}

.search-modal-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: min(60vh, 520px);
    overflow-y: auto;
    padding: 10px 8px;
    scrollbar-width: thin;
}
.search-modal-results::-webkit-scrollbar { width: 6px; }
.search-modal-results::-webkit-scrollbar-thumb { background: var(--surface-subtle-hover); border-radius: 3px; }

.search-group { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px 2px; }
.search-group + .search-group { padding-top: 8px; }
.search-group-head {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px 6px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.search-group-head i { font-size: 13px; color: var(--text-muted); }
.search-group-list { display: flex; flex-direction: column; gap: 2px; }

.search-result {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.search-result:hover,
.search-result.is-active,
.search-result:focus-visible {
    background: var(--surface-subtle-hover);
    border-color: var(--surface-border-soft);
    outline: none;
}
.search-result.is-active {
    border-color: var(--brand-border);
    background: linear-gradient(90deg, var(--brand-soft), var(--surface-subtle-hover) 80%);
}

.search-result-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border-soft);
    color: var(--text-secondary);
    font-size: 15px;
    overflow: hidden;
}
.search-result-icon-img { width: 100%; height: 100%; object-fit: cover; }
.search-result.is-active .search-result-icon {
    color: var(--brand-primary);
    border-color: var(--brand-border);
    background: var(--brand-soft);
}
.search-result--asset .search-result-icon { background: var(--bg-elevated); }
.search-result--command .search-result-icon { color: var(--brand-primary); background: var(--brand-soft); border-color: var(--brand-border); }
.search-result--section .search-result-icon { color: #a5b4fc; background: rgba(129, 140, 248, 0.1); border-color: rgba(129, 140, 248, 0.22); }

.search-result-copy {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    gap: 2px;
}
.search-result-label {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--text-primary);
    display: inline-flex; align-items: baseline; gap: 8px;
    min-width: 0;
}
.search-result-label strong { font-weight: 700; }
.search-result-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
}
.search-result-desc {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-tail {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 8px;
}
.search-result-chip {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px; font-weight: 700;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
}
.search-result-chip.pos { color: var(--positive); background: var(--positive-dim); border-color: rgba(16, 185, 129, 0.22); }
.search-result-chip.neg { color: var(--negative); background: var(--negative-dim); border-color: rgba(239, 68, 68, 0.22); }
.search-result-meta {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.search-empty-state {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px;
    padding: 36px 20px;
    color: var(--text-secondary);
    text-align: center;
}
.search-empty-state i { font-size: 28px; color: var(--text-muted); margin-bottom: 6px; }
.search-empty-state strong { font-size: 14px; color: var(--text-primary); font-weight: 600; }
.search-empty-state span { font-size: 12px; color: var(--text-muted); max-width: 36ch; line-height: 1.5; }

.search-modal-foot {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--surface-divider);
    background: var(--surface-glass);
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.search-modal-foot span { display: inline-flex; align-items: center; gap: 5px; }
.search-modal-foot kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 5px;
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border-soft);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 700;
    color: var(--text-secondary);
    line-height: 1;
}

@media (max-width: 600px) {
    .modal-overlay.quick-search-overlay { padding-top: 12px; align-items: stretch; }
    .modal.modal--search { width: calc(100vw - 16px); max-width: none; border-radius: 16px; }
    .search-modal-input { font-size: 15px; }
    .search-result-desc { display: none; }
    .search-modal-foot { display: none; }
}
.modal.notification-modal {
    width: min(440px, calc(100vw - 32px));
    max-width: 440px;
    max-height: min(720px, calc(100vh - 32px));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.modal.notification-modal .modal-header {
    padding: 16px 20px;
    position: sticky;
    top: 0;
    background: var(--surface-glass-stronger);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2;
}
.modal.notification-modal .modal-body {
    padding: 0;
}
.notification-center {
    display: flex;
    flex-direction: column;
}
.notification-center__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 20px 12px;
}
.notification-center__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
}
.notification-center__meta-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--text-muted);
    flex: 0 0 auto;
    transition: background 0.15s ease;
}
.notification-center__meta-dot.has-unread {
    background: var(--brand-primary);
}
.notification-center__actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.notification-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
.notification-action-btn i { font-size: 14px; }
.notification-action-btn:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--surface-subtle);
}
.notification-action-btn.is-icon {
    width: 30px;
    padding: 0;
    justify-content: center;
}
.notification-action-btn.is-danger:hover:not(:disabled) {
    color: var(--negative);
    background: var(--negative-dim);
}
.notification-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.notification-center__filters {
    display: flex;
    gap: 6px;
    padding: 0 20px 12px;
    border-bottom: 1px solid var(--surface-divider);
}
.notification-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--surface-border-soft);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}
.notification-filter-btn__count {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-subtle-strong);
    color: var(--text-muted);
    min-width: 20px;
    text-align: center;
    line-height: 1.5;
    transition: background 0.15s ease, color 0.15s ease;
}
.notification-filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}
.notification-filter-btn.active {
    color: var(--text-primary);
    background: var(--surface-subtle-hover);
    border-color: var(--border-hover);
}
.notification-filter-btn.active .notification-filter-btn__count {
    background: var(--brand-soft);
    color: var(--brand-primary);
}
.notification-list {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 14px;
}
.notification-item {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 10px 12px 16px;
    border-radius: var(--radius-lg);
    background: transparent;
    transition: background 0.15s ease;
}
.notification-item + .notification-item {
    margin-top: 2px;
}
.notification-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 16px;
    bottom: 16px;
    width: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.15s ease;
}
.notification-item.is-unread::before {
    background: var(--brand-primary);
}
.notification-item:hover {
    background: var(--surface-subtle);
}
.notification-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-subtle-strong);
    color: var(--text-secondary);
    font-size: 16px;
    flex: 0 0 auto;
}
.notification-item.is-unread .notification-item__icon {
    background: var(--brand-soft);
    color: var(--brand-primary);
}
.notification-item__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.notification-item__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.notification-item__title {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--text-primary);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}
.notification-item__time {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    flex: 0 0 auto;
}
.notification-item__message {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.5;
    word-break: break-word;
}
.notification-item__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}
.notification-item__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border-soft);
    background: transparent;
    color: var(--text-primary);
    font-size: 11.5px;
    font-weight: 500;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}
.notification-item__cta:hover {
    border-color: var(--brand-border);
    background: var(--brand-softest);
    color: var(--brand-primary);
}
.notification-item__cta i {
    font-size: 12px;
}
.notification-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.notification-tool-btn i { font-size: 13px; }
.notification-tool-btn:hover {
    color: var(--brand-primary);
    background: var(--brand-softest);
}
.notification-item__dismiss {
    grid-column: 3;
    grid-row: 1;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    flex: 0 0 auto;
}
.notification-item:hover .notification-item__dismiss,
.notification-item:focus-within .notification-item__dismiss {
    opacity: 1;
}
.notification-item__dismiss:hover {
    color: var(--text-primary);
    background: var(--surface-subtle-hover);
}
.notification-empty {
    margin: 20px;
    padding: 40px 20px;
    border-radius: var(--radius-lg);
    background: var(--surface-subtle-soft);
    color: var(--text-secondary);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.notification-empty__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-subtle-strong);
    color: var(--text-muted);
    font-size: 20px;
}
.notification-empty__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.notification-empty__text {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 260px;
}
@media (hover: none) {
    .notification-item__dismiss { opacity: 1; }
}
.search-target-flash {
    animation: search-target-flash 1.8s ease;
}
@keyframes search-target-flash {
    0% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0); }
    20% { box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.16); }
    100% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0); }
}
.page-media-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin-bottom: 20px;
    height: 240px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--surface-border-soft);
    background:
        linear-gradient(180deg, rgba(8, 9, 11, 0.3) 0%, rgba(8, 9, 11, 0.78) 100%),
        radial-gradient(circle at 85% 12%, rgba(var(--brand-rgb), 0.14) 0%, transparent 28%),
        linear-gradient(135deg, rgba(var(--brand-rgb), 0.12), rgba(var(--brand-rgb), 0.04));
    box-shadow: var(--shadow-soft);
}
@media (min-width: 1400px) {
    .page-content {
        padding: 32px 44px 20px;
    }
}
.generated-image-host {
    position: relative;
    isolation: isolate;
}
.generated-image-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.78;
    transform: scale(1.02);
    filter: saturate(1.04) contrast(1.02);
    pointer-events: none;
}
.page-media-hero .generated-image-layer {
    opacity: 0.74;
}
.page-media-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(7, 8, 10, 0.94) 0%, rgba(7, 8, 10, 0.72) 34%, rgba(7, 8, 10, 0.34) 62%, rgba(7, 8, 10, 0.14) 100%),
        radial-gradient(circle at 18% 50%, rgba(7, 8, 10, 0.24) 0%, transparent 42%);
    pointer-events: none;
}
.page-media-hero::after {
    content: '';
    position: absolute;
    inset: auto -100px -130px auto;
    z-index: 1;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--brand-rgb), 0.22) 0%, transparent 70%);
    pointer-events: none;
}
.page-media-hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
    height: 100%;
    padding: 24px 28px;
    justify-content: center;
}
.page-media-hero__eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(8, 9, 11, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.page-media-hero__title {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    max-width: 50ch;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
[data-theme="light"] .page-media-hero__title {
    color: #fff;
}
.page-media-hero__text {
    max-width: 58ch;
    color: rgba(244, 244, 245, 0.86);
    font-size: 15px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.page-media-hero__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 14px;
    background: rgba(7, 8, 10, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(244, 244, 245, 0.84);
    font-size: 12px;
    font-weight: 600;
}
.hero-copy-desktop { display: inline; }
.hero-copy-mobile { display: none; }

/* ─── Cards ─── */
.card {
    background: var(--surface-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-subtle-border); border-radius: var(--radius-xl);
    padding: 20px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: var(--shadow-soft);
}
.card:hover { border-color: var(--surface-border-strong); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }

/* ── Account Hub (dual account switcher) ───────────────────────── */
/* ─── CFD Account Cards ─── */
.cfd-accounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.cfd-card {
    position: relative;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.cfd-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

/* Accent edge — thin top strip */
.cfd-card__edge {
    height: 3px;
    width: 100%;
}
.cfd-card__edge--live { background: linear-gradient(90deg, #10b981, #34d399); }
.cfd-card__edge--managed { background: linear-gradient(90deg, #818cf8, #a78bfa); }

.cfd-card__inner { padding: 22px 24px 20px; }

/* Top row: icon + name + status */
.cfd-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.cfd-card__identity {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cfd-card__icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
}
.cfd-card__icon--live  { background: rgba(16,185,129,0.10); color: #10b981; }
.cfd-card__icon--managed { background: rgba(129,140,248,0.10); color: #818cf8; }
.cfd-card__name {
    font-size: 15px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.cfd-card__type {
    font-size: 11px; color: var(--text-muted); margin-top: 1px; font-weight: 500;
}
.cfd-card__status {
    padding: 4px 10px; border-radius: 20px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.cfd-card__status--live { background: rgba(16,185,129,0.10); color: #10b981; }
.cfd-card__status--managed { background: rgba(129,140,248,0.10); color: #818cf8; }

/* Balance block */
.cfd-card__balance-block { margin-bottom: 22px; }
.cfd-card__balance-label {
    font-size: 11px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.06em; font-weight: 600; margin-bottom: 6px;
}
.cfd-card__balance {
    font-size: 28px; font-weight: 700; letter-spacing: -0.03em;
    line-height: 1.15; font-feature-settings: 'tnum';
}
.cfd-card__pnl {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 8px; font-size: 12px; font-weight: 600;
    color: var(--positive); font-feature-settings: 'tnum';
}
.cfd-card__pnl i { font-size: 14px; }
.cfd-card__pnl.negative { color: var(--negative); }
.cfd-card__pnl.negative i::before { content: "\e59a"; }

/* Metric row: value on top, label below, separated by thin dividers */
.cfd-card__metrics {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 14px 0;
    margin-bottom: 20px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.cfd-card__metric {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    text-align: center;
    padding: 2px 6px;
    min-width: 0;
}
.cfd-card__metric-val {
    font-size: 14px; font-weight: 700; font-feature-settings: 'tnum';
    letter-spacing: -0.01em; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.cfd-card__metric-key {
    font-size: 10px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 600; white-space: nowrap;
}
.cfd-card__metric-sep {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    flex-shrink: 0;
}

/* Actions */
.cfd-card__actions {
    display: flex; gap: 8px;
}
.cfd-card__btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12px; font-weight: 700;
    cursor: pointer; border: none;
    transition: all .15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.cfd-card__btn--primary {
    color: #fff;
}
.cfd-card__btn--live  { background: #10b981; }
.cfd-card__btn--live:hover  { background: #059669; }
.cfd-card__btn--managed { background: #818cf8; }
.cfd-card__btn--managed:hover { background: #6366f1; }
.cfd-card__btn--ghost {
    background: var(--surface-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.cfd-card__btn--ghost:hover {
    background: var(--surface-subtle-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}
.cfd-card__btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
.cfd-card__btn:active { transform: translateY(1px); }
.cfd-card__btn i { font-size: 14px; }

.cfd-card__note {
    margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-md);
    background: var(--surface-subtle); font-size: 11px;
    color: var(--text-secondary); line-height: 1.5;
}

@media (max-width: 768px) {
    .cfd-accounts { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .cfd-card__inner { padding: 18px 16px 16px; }
    .cfd-card__balance { font-size: 24px; }
    .cfd-card__metrics { flex-direction: column; gap: 0; }
    .cfd-card__metric { flex-direction: row; justify-content: space-between; padding: 8px 0; }
    .cfd-card__metric-sep { width: 100%; height: 1px; align-self: auto; }
    .cfd-card__actions { flex-direction: column; }
}
.card-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 18px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600;
    border: none; transition: all 0.15s ease; cursor: pointer;
    letter-spacing: -0.01em; position: relative; white-space: nowrap;
}
.btn-primary {
    background: var(--brand-primary); color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 2px 8px var(--brand-shadow);
}
.btn-primary:hover { background: var(--brand-secondary); box-shadow: 0 2px 4px rgba(0,0,0,0.12), 0 4px 14px var(--brand-shadow-strong); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 2px var(--brand-shadow); }
.btn-secondary { background: var(--surface-subtle-strong); color: var(--text-primary); border: 1px solid var(--surface-border-strong); }
.btn-secondary:hover { background: var(--surface-subtle-hover); border-color: var(--border-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--surface-subtle); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--negative); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--positive); color: #fff; }
.btn-success:hover { background: #059669; }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0; }
.form-input, .form-select {
    width: 100%; padding: 10px 14px; background: var(--input-bg); border: 1px solid var(--surface-border-strong);
    border-radius: var(--radius-md); color: var(--text-primary); font-size: 13px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--brand-primary); background: var(--input-bg-focus); box-shadow: 0 0 0 2px var(--brand-focus); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { min-height: 100px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--negative); margin-top: 4px; }
.input-group { display: flex; gap: 0; border-radius: var(--radius-md); }
.input-group .form-input { border-radius: var(--radius-md) 0 0 var(--radius-md); border-right: none; }
.input-group .btn { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ─── Tables ─── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 8px 16px; color: var(--text-muted); font-weight: 600;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    border-bottom: 1px solid var(--surface-divider);
    position: sticky; top: 0; background: var(--bg-surface); z-index: 1;
}
.data-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--surface-divider); transition: background 0.1s ease; font-feature-settings: 'tnum'; }
.data-table tr { position: relative; }
.data-table tbody tr:hover td { background: var(--surface-subtle); }
.data-table tbody td:first-child { border-radius: 0; }
.data-table tbody td:last-child { border-radius: 0; text-align: right; }
.data-table th:last-child { text-align: right; }

/* ─── Tabs ─── */
.tab-bar { display: flex; gap: 2px; background: var(--input-bg); padding: 3px; border-radius: var(--radius-md); border: 1px solid var(--surface-border-soft); width: fit-content; }
.tab-btn {
    padding: 6px 16px; background: transparent; border: none; color: var(--text-secondary);
    font-size: 12px; font-weight: 600; border-radius: var(--radius-sm); transition: all 0.12s ease; cursor: pointer;
}
.tab-btn:hover { color: var(--text-primary); background: var(--surface-subtle-strong); }
.tab-btn.active { background: var(--brand-primary); color: #fff; box-shadow: 0 1px 4px var(--brand-shadow); }

/* ─── Badges ─── */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-positive { background: rgba(16, 185, 129, 0.12); color: var(--positive); border: 1px solid rgba(16, 185, 129, 0.18); }
.badge-negative { background: rgba(239, 68, 68, 0.12); color: var(--negative); border: 1px solid rgba(239, 68, 68, 0.18); }
.badge-neutral { background: var(--surface-subtle-strong); color: var(--text-secondary); border: 1px solid var(--surface-border-strong); }
.badge-orange { background: var(--brand-soft); color: var(--brand-primary); border: 1px solid var(--brand-border); }

.positive { color: var(--positive); }
.negative { color: var(--negative); }

/* ─── Stat Cards ─── */
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; font-feature-settings: 'tnum'; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 500; letter-spacing: 0; }
.stat-change { font-size: 12px; font-weight: 600; margin-top: 3px; font-feature-settings: 'tnum'; }

/* ─── Grid Layouts ─── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Crypto Icon ─── */
.crypto-icon { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.crypto-icon-sm { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.crypto-icon-lg { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.crypto-badge { display: flex; align-items: center; gap: 10px; }
.crypto-badge .symbol { font-weight: 600; }
.crypto-badge .name { font-size: 12px; color: var(--text-secondary); }

/* ─── Sparkline ─── */
.sparkline { width: 100px; height: 32px; }

/* ─── Toggle ─── */
.toggle { position: relative; width: 40px; height: 22px; cursor: pointer; }
.toggle input { display: none; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 11px; transition: all 0.15s ease;
}
.toggle-slider::before {
    content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    background: var(--text-muted); border-radius: 50%; transition: all 0.15s ease;
}
.toggle input:checked + .toggle-slider { background: var(--brand-primary); border-color: var(--brand-primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* ─── Modal ─── */
.modal-overlay {
    position: fixed; inset: 0; background: var(--modal-overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--surface-glass-stronger); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border-strong); border-radius: var(--radius-xl);
    width: 90%; max-width: 480px; max-height: 90vh; overflow-y: auto;
    transform: translateY(16px) scale(0.98); transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: var(--shadow-xl);
}
.modal.large {
    width: min(1080px, calc(100vw - 48px));
    max-width: 1080px;
}
.modal.xlarge {
    width: min(1240px, calc(100vw - 48px));
    max-width: 1240px;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--surface-divider); }
.modal-header h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.modal-close { background: var(--surface-subtle-strong); border: 1px solid var(--surface-border-soft); color: var(--text-secondary); font-size: 18px; width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.12s ease; cursor: pointer; }
.modal-close:hover { color: var(--text-primary); background: var(--surface-subtle-hover); border-color: var(--border-hover); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--surface-divider); display: flex; gap: 12px; justify-content: flex-end; }

/* ─── Toast ─── */
#toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    display: flex; align-items: center; gap: 10px; padding: 12px 18px;
    background: var(--surface-glass-stronger); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border-strong); border-radius: var(--radius-md);
    font-size: 13px; font-weight: 600; transform: translateX(110%); opacity: 0;
    transition: all 0.25s ease; min-width: 280px;
    box-shadow: var(--shadow-float);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast i { font-size: 18px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--positive); }
.toast-success i { color: var(--positive); }
.toast-error { border-left: 3px solid var(--negative); }
.toast-error i { color: var(--negative); }
.toast-warning { border-left: 3px solid #eab308; }
.toast-warning i { color: #eab308; }
.toast-info { border-left: 3px solid var(--brand-primary); }
.toast-info i { color: var(--brand-primary); }

/* ─── Loading States ─── */
.skeleton { background: linear-gradient(90deg, var(--surface-subtle-strong) 25%, var(--surface-subtle-hover) 50%, var(--surface-subtle-strong) 75%); background-size: 200% 100%; animation: skeleton-pulse 1.8s ease infinite; border-radius: 4px; }
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spinner { width: 20px; height: 20px; border: 2px solid var(--surface-subtle-hover); border-top-color: var(--brand-primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Dropdown ─── */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: 100%; right: 0; min-width: 180px; background: var(--surface-glass-opaque);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border-strong); border-radius: var(--radius-md); padding: 4px;
    box-shadow: var(--shadow-xl);
    display: none; z-index: 200; transform-origin: top right;
    animation: dropdown-in 0.12s ease;
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-menu.show { display: block; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; transition: all 0.1s ease; border: none; background: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: var(--surface-subtle-hover); color: var(--text-primary); }
.dropdown-item i { font-size: 16px; width: 16px; }

/* ─── Pagination ─── */
.pagination { display: flex; align-items: center; gap: 3px; justify-content: center; margin-top: 16px; }
.page-btn {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all 0.1s ease;
}
.page-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.page-btn.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }

/* ─── Empty State ─── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; text-align: center; }
.empty-state i { font-size: 36px; color: var(--text-muted); margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { color: var(--text-secondary); font-size: 13px; max-width: 360px; margin-bottom: 16px; }

/* ─── Responsive ─── */
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
    body.sidebar-mobile-open { overflow: hidden; }
    body.sidebar-mobile-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .app-layout { display: block; }
    .sidebar,
    .sidebar-collapsed .sidebar {
        width: min(320px, calc(100vw - 32px));
        transform: translateX(calc(-100% - 24px));
        visibility: hidden;
        z-index: 1000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease, box-shadow 0.3s ease;
        box-shadow: none;
    }
    .sidebar.open,
    .sidebar.active {
        transform: translateX(0);
        visibility: visible;
        box-shadow: var(--shadow-xl);
    }
    .sidebar-collapsed .sidebar-header {
        padding-inline: 20px;
        justify-content: flex-start;
        gap: 12px;
    }
    .sidebar-collapsed .sidebar-logo-full { display: block; }
    .sidebar-collapsed .sidebar-logo-compact { display: none; }
    .sidebar-collapsed #sidebar-toggle {
        position: static;
        margin-left: auto;
    }
    .sidebar-collapsed .sidebar-nav a,
    .sidebar-collapsed .sidebar-footer a {
        justify-content: flex-start;
        padding-inline: 14px;
    }
    .sidebar-collapsed .sidebar-nav a span,
    .sidebar-collapsed .sidebar-footer a span { display: inline; }
    .main-content {
        margin-left: 0 !important;
        width: 100%;
        min-width: 0;
    }
    .topbar {
        min-height: 62px;
        height: auto;
        padding: 11px 14px;
        gap: 10px;
        flex-wrap: nowrap;
        align-items: center;
        z-index: 200;
    }
    .mobile-nav-toggle {
        display: inline-flex;
        order: 1;
        flex: 0 0 auto;
    }
    .topbar-pill {
        display: none;
    }
    .topbar-right {
        order: 2;
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        margin-left: auto;
        justify-content: flex-end;
        gap: 8px;
    }
    .search-box {
        flex: 1 1 160px;
        min-width: 0;
        height: 40px;
        padding: 0 14px;
        font-size: 13px;
        border-radius: 12px;
    }
    .search-box kbd { display: none; }
    .search-box .search-box__shortcut {
        min-width: 42px;
        padding: 0 6px;
    }
    .topbar-icon {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        flex: 0 0 auto;
        border-radius: 12px;
    }
    .user-display {
        flex: 0 0 auto;
        min-width: 0;
        max-width: min(200px, 46vw);
        padding: 3px 11px 3px 3px;
        gap: 8px;
    }
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    .user-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
    }
    .page-content {
        padding: 24px 16px 20px;
        min-width: 0;
    }
    .page-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start !important;
        gap: 12px;
        width: 100%;
    }
    .page-header.page-header-split {
        align-items: stretch !important;
        justify-content: flex-start !important;
    }
    .page-title { font-size: 22px; }
    .header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-actions > * { min-width: 0; }
    .card { padding: 20px; }
    .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-1 { grid-template-columns: 1fr; }
    .overview-grid,
    .transfer-layout,
    .portfolio-grid,
    .settings-layout,
    .support-overview,
    .faq-layout,
    .support-workspace,
    .hero-grid,
    .ticket-grid,
    .help-topics,
    .tiers-grid,
    .overview-strip,
    .compliance-grid,
    .flow-panel,
    .field-grid {
        grid-template-columns: 1fr !important;
    }
    .market-filters,
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .filter-right,
    .search-filter {
        width: 100%;
    }
    .search-filter input { width: 100%; }
    .history-search,
    .holdings-search {
        width: 100%;
        min-width: 0;
    }
    .movers-nav,
    .export-btn {
        max-width: 100%;
    }
    .chart-tabs,
    .transfer-tabs,
    .action-tabs,
    .filter-tabs,
    .amount-presets {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .chart-tabs::-webkit-scrollbar,
    .transfer-tabs::-webkit-scrollbar,
    .action-tabs::-webkit-scrollbar,
    .filter-tabs::-webkit-scrollbar,
    .amount-presets::-webkit-scrollbar {
        display: none;
    }
    .sidebar-summary,
    .settings-nav {
        position: static !important;
        top: auto !important;
    }
    .balance-card,
    .swap-card,
    .ticket-form,
    .ticket-panel,
    .support-card-inner,
    .faq-list-wrap,
    .faq-side-panel,
    .hero-panel {
        padding: 20px !important;
    }
    .balance-amount { font-size: 32px !important; }
    .data-table-wrapper,
    .table-container,
    .table-responsive,
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    .table-responsive > table,
    .table-scroll > table,
    table.data-table { min-width: 640px; }
    .content-wrapper { padding: 16px !important; }
}
@media (max-width: 768px) {
    .page-media-hero { height: 280px; border-radius: 24px; }
    .page-media-hero__content { padding: 22px 20px; gap: 10px; }
    .page-media-hero__title {
        max-width: none;
        font-size: clamp(20px, 5.4vw, 26px);
        -webkit-line-clamp: 2;
    }
    .page-media-hero__text {
        font-size: 13px;
        line-height: 1.5;
        -webkit-line-clamp: 2;
    }
    .hero-copy-desktop { display: none; }
    .hero-copy-mobile { display: inline; }
    .quick-stats,
    .history-stats,
    .hero-stat-grid,
    .ticket-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .balance-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .settings-nav { display: none; }
    .form-row { grid-template-columns: 1fr !important; }
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .header-actions > * { width: 100%; }
    .modal-actions-grid {
        grid-template-columns: 1fr;
    }
    .notification-center__bar {
        gap: 10px;
    }
    .notification-center__actions {
        justify-content: flex-end;
    }
    .notification-action-btn:not(.is-icon) {
        padding: 0 10px;
    }
    .workspace-meta {
        grid-template-columns: 1fr;
    }
    .app-footer {
        margin-inline: 16px;
    }
    .app-footer__top,
    .app-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
    }
    .app-footer__status {
        justify-content: flex-start;
    }
    .app-footer__note {
        text-align: left;
    }
}
@media (max-width: 480px) {
    .page-media-hero { height: 260px; }
    .page-media-hero__content {
        padding: 18px 16px;
        gap: 8px;
    }
    .page-media-hero__eyebrow {
        padding: 7px 10px;
        font-size: 10px;
    }
    .page-media-hero__title {
        font-size: clamp(18px, 6.2vw, 22px);
        line-height: 1.05;
        -webkit-line-clamp: 2;
    }
    .page-media-hero__text {
        font-size: 12px;
        line-height: 1.45;
        -webkit-line-clamp: 2;
    }
    .modal,
    .modal.large,
    .modal.xlarge {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 20px;
    }
    .modal-header {
        padding: 18px 18px 16px;
    }
    .modal-body,
    .modal-footer {
        padding: 18px;
    }
    .page-content { padding: 18px 12px 20px !important; }
    .topbar {
        padding: 10px 12px;
        gap: 8px;
        min-height: 60px;
    }
    .topbar-right {
        width: auto;
        order: 2;
        gap: 8px;
        align-items: center;
        justify-content: flex-end;
    }
    .mobile-nav-toggle {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        flex: 0 0 auto;
    }
    .search-box {
        flex: 1 1 auto;
        min-width: 0;
        flex-basis: auto;
        height: 40px;
        padding: 0 14px;
        border-radius: 12px;
        font-size: 13px;
    }
    .search-box i {
        font-size: 15px;
    }
    .search-box .search-box__shortcut {
        display: none;
    }
    .topbar-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .user-display {
        flex: 0 0 auto;
        max-width: 44px;
        min-width: 44px;
        padding: 4px;
        justify-content: center;
        gap: 0;
        border-radius: 999px;
    }
    .user-display .user-name,
    .user-display .user-addr {
        display: none;
    }
    .topbar-right > .topbar-icon + .user-display::before { display: none; }
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    .workspace-meta__panel,
    .app-footer {
        padding: 18px;
        border-radius: 20px;
    }
    .modal.notification-modal {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 20px;
    }
    .notification-center__bar {
        padding: 4px 14px 10px;
    }
    .notification-center__filters {
        padding: 0 14px 10px;
    }
    .notification-list {
        padding: 8px 6px 14px;
    }
    .notification-item {
        padding: 12px 8px 12px 14px;
        gap: 10px;
        grid-template-columns: 34px minmax(0, 1fr) auto;
    }
    .notification-item::before {
        left: 4px;
    }
    .notification-item__icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
    .notification-item__head {
        flex-wrap: wrap;
    }
    .notification-item__dismiss {
        opacity: 1;
    }
    .notification-tool-btn span {
        display: none;
    }
    .notification-empty {
        margin: 16px 14px;
        padding: 28px 16px;
    }
    .history-filters .tab-bar,
    .filter-tabs,
    .transfer-tabs,
    .chart-tabs,
    .action-tabs {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }
    .history-filters .tab-bar > *,
    .filter-tabs > *,
    .transfer-tabs > *,
    .chart-tabs > *,
    .action-tabs > * {
        width: 100%;
        min-width: 0;
    }
    .quick-stats,
    .history-stats,
    .hero-stat-grid,
    .ticket-summary-grid,
    .ticket-priority {
        grid-template-columns: 1fr !important;
    }
    .table-responsive > table,
    .table-scroll > table,
    table.data-table { min-width: 560px; }
}

[data-theme="light"] .sidebar-nav a.active,
[data-theme="light"] .sidebar-nav a.active i,
[data-theme="light"] .tab-btn.active,
[data-theme="light"] .btn-primary,
[data-theme="light"] .page-btn.active {
    color: #0f172a;
}
[data-theme="light"] .topbar-pill .negative,
[data-theme="light"] .topbar-pill .positive {
    text-shadow: none;
}
[data-theme="light"] .sidebar {
    background:
        radial-gradient(140% 70% at 0% 0%, rgba(var(--brand-rgb), 0.05), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)) !important;
}
[data-theme="light"] .chart-tabs,
[data-theme="light"] .transfer-tabs,
[data-theme="light"] .action-tabs,
[data-theme="light"] .filter-tabs,
[data-theme="light"] .settings-nav a.active,
[data-theme="light"] .api-key-row,
[data-theme="light"] .session-item,
[data-theme="light"] .network-option,
[data-theme="light"] .address-display,
[data-theme="light"] .fee-info,
[data-theme="light"] .recent-address,
[data-theme="light"] .mover-card,
[data-theme="light"] .help-topic,
[data-theme="light"] .contact-card,
[data-theme="light"] .ticket-item,
[data-theme="light"] .priority-option,
[data-theme="light"] .chat-header,
[data-theme="light"] .chat-msg.bot,
[data-theme="light"] .chat-input-wrap,
[data-theme="light"] .tier-card,
[data-theme="light"] .tier-meta-item,
[data-theme="light"] .overview-tile,
[data-theme="light"] .readiness-item,
[data-theme="light"] .flow-step,
[data-theme="light"] .flow-card,
[data-theme="light"] .radio-card,
[data-theme="light"] .alloc-item,
[data-theme="light"] .holding-action,
[data-theme="light"] .history-stat,
[data-theme="light"] .type-icon,
[data-theme="light"] .topbar-search,
[data-theme="light"] .search-filter,
[data-theme="light"] .swap-field,
[data-theme="light"] .swap-select,
[data-theme="light"] .mode-btn {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-soft) !important;
    box-shadow: var(--shadow-soft) !important;
}
[data-theme="light"] .support-hero,
[data-theme="light"] .danger-zone,
[data-theme="light"] .alloc-chart-wrap::after,
[data-theme="light"] .mover-card::before {
    filter: none;
}
[data-theme="light"] .chat-window {
    background: var(--surface-glass-stronger) !important;
    border-color: var(--surface-border-strong) !important;
    box-shadow: var(--shadow-xl) !important;
}
[data-theme="light"] .chat-input-wrap input,
[data-theme="light"] .hero-search input,
[data-theme="light"] .search-filter input,
[data-theme="light"] .swap-amount,
[data-theme="light"] .amount-input-wrap input {
    color: var(--text-primary) !important;
}
[data-theme="light"] .chart-tab:hover,
[data-theme="light"] .filter-tab:hover,
[data-theme="light"] .transfer-tab:hover,
[data-theme="light"] .action-tab:hover,
[data-theme="light"] .mode-btn:hover,
[data-theme="light"] .amount-preset:hover,
[data-theme="light"] .recent-address:hover,
[data-theme="light"] .ticket-item:hover,
[data-theme="light"] .holding-row:hover,
[data-theme="light"] .alloc-item:hover,
[data-theme="light"] .session-item:hover,
[data-theme="light"] .help-topic:hover,
[data-theme="light"] .mover-card:hover {
    background: var(--surface-subtle-hover) !important;
}
[data-theme="light"] .chart-tab,
[data-theme="light"] .filter-tab,
[data-theme="light"] .transfer-tab,
[data-theme="light"] .action-tab,
[data-theme="light"] .mode-btn,
[data-theme="light"] .amount-preset,
[data-theme="light"] .network-option,
[data-theme="light"] .priority-option,
[data-theme="light"] .movers-nav button,
[data-theme="light"] .copy-btn,
[data-theme="light"] .hero-search input,
[data-theme="light"] .search-filter,
[data-theme="light"] .search-filter input {
    color: var(--text-secondary) !important;
}
[data-theme="light"] .chart-tab.active,
[data-theme="light"] .filter-tab.active,
[data-theme="light"] .mode-btn.active,
[data-theme="light"] .network-option.active,
[data-theme="light"] .priority-option.active,
[data-theme="light"] .flow-step.active,
[data-theme="light"] .radio-card.active {
    border-color: var(--brand-border) !important;
}
[data-theme="light"] .chart-tab.active,
[data-theme="light"] .filter-tab.active,
[data-theme="light"] .mode-btn.active {
    box-shadow: 0 1px 4px var(--brand-shadow) !important;
}
[data-theme="light"] .swap-toggle button,
[data-theme="light"] .session-icon,
[data-theme="light"] .recent-address .addr-icon,
[data-theme="light"] .api-key-row .key-actions button {
    background: var(--surface-subtle-strong) !important;
    border-color: var(--surface-border-soft) !important;
    color: var(--text-secondary) !important;
}
[data-theme="light"] .topbar,
[data-theme="light"] .main-content,
[data-theme="light"] body {
    color-scheme: light;
}

[data-theme="light"] .cfd-card {
    background: var(--bg-surface);
    border-color: var(--surface-border-soft);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
[data-theme="light"] .cfd-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
[data-theme="light"] .cfd-card__icon--live  { background: rgba(16,185,129,0.08); }
[data-theme="light"] .cfd-card__icon--managed { background: rgba(129,140,248,0.08); }
[data-theme="light"] .cfd-card__status--live { background: rgba(16,185,129,0.08); }
[data-theme="light"] .cfd-card__status--managed { background: rgba(129,140,248,0.08); }
[data-theme="light"] .cfd-card__btn--ghost {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-soft) !important;
    box-shadow: var(--shadow-soft) !important;
}

/* ─── Market news drawer ─── */
.topbar-news-btn {
    position: relative;
}
.topbar-news-btn--fresh::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--bg-surface);
    pointer-events: none;
}
body.news-drawer-open {
    overflow: hidden;
}
.news-overlay {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.news-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.news-drawer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 190;
    width: min(380px, 100vw);
    height: 100vh;
    height: 100dvh;
    background: var(--surface-glass-stronger);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--surface-border-soft);
    box-shadow: var(--shadow-xl);
    transform: translateX(-104%);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.news-drawer.is-open {
    transform: translateX(0);
}
.news-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 12px;
    border-bottom: 1px solid var(--surface-divider);
    flex-shrink: 0;
}
.news-drawer__title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 3px;
}
.news-drawer__sub {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 280px;
}
.news-drawer__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.news-drawer__close:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--surface-subtle-hover);
}
.news-drawer__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    flex-shrink: 0;
}
.news-drawer__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 16px 24px;
    /* Block layout avoids flex-shrink squashing cards (thin image strips + collapsed text). */
    display: block;
}
.news-drawer__list > .news-card {
    margin-bottom: 10px;
}
.news-drawer__list > .news-card:last-child {
    margin-bottom: 0;
}
.news-drawer__empty {
    padding: 24px 8px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.news-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.news-card--drawer {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
    overflow: hidden;
}
.news-card--page {
    flex-direction: column;
    padding: 0;
    gap: 0;
    overflow: hidden;
    background: linear-gradient(155deg, var(--bg-surface) 0%, var(--bg-base) 100%);
    position: relative;
    isolation: isolate;
}
.news-card--page::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08) 30%, rgba(255,255,255,0.08) 70%, transparent);
    pointer-events: none;
    z-index: 1;
}
.news-card__body {
    padding: 16px 18px 18px;
    min-width: 0;
}
.news-card:hover {
    border-color: var(--brand-border);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}
.news-card.news-card--page:hover {
    transform: translateY(-3px);
    border-color: var(--brand-border);
    box-shadow: 0 14px 32px -14px rgba(249,115,22,0.22);
}
.news-card__main {
    flex: 1;
    min-width: 0;
}
.news-card--drawer .news-card__body {
    padding: 14px 16px 16px;
    min-width: 0;
    flex-shrink: 0;
}
.news-card--drawer .news-card__meta--top {
    margin-bottom: 2px;
}
.news-card--drawer .news-card__byline {
    margin: 8px 0 10px;
}
.news-card--drawer .news-card__title {
    display: block;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}
.news-card__byline {
    margin: 6px 0 8px;
}
.news-card__author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.news-card__released {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.45;
}
.news-card__meta--top {
    margin-bottom: 4px;
}
.news-card__media {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-elevated);
    flex-shrink: 0;
}
.news-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.news-card__media--fallback {
    background: var(--bg-elevated);
}
.news-card__media--fallback .fallback-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background-image: radial-gradient(var(--text-secondary) 1px, transparent 1px);
    background-size: 16px 16px;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.news-card__media--fallback[data-kind="crypto"] {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(var(--brand-rgb), 0.08) 100%);
}
.news-card__media--fallback[data-kind="crypto"] .fallback-pattern {
    background-image: radial-gradient(var(--brand-primary) 1px, transparent 1px);
    opacity: 0.2;
}
.news-card__media--fallback[data-kind="stocks"] {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(16, 185, 129, 0.08) 100%);
}
.news-card__media--fallback[data-kind="stocks"] .fallback-pattern {
    background-image: radial-gradient(var(--positive) 1px, transparent 1px);
    opacity: 0.2;
}
.news-card__media--fallback .fallback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: var(--text-secondary);
    opacity: 0.5;
    z-index: 1;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.news-card__media--fallback[data-kind="crypto"] .fallback-icon {
    color: var(--brand-primary);
}
.news-card__media--fallback[data-kind="stocks"] .fallback-icon {
    color: var(--positive);
}
.news-card:hover .news-card__media img,
.news-card:hover .news-card__media--fallback .fallback-pattern {
    transform: scale(1.05);
}
.news-card:hover .news-card__media--fallback .fallback-icon {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.8;
}
.news-card__media--sm {
    width: 96px;
    min-height: 72px;
    max-height: 100px;
    align-self: flex-start;
}
/* 16:9 frame via padding (reliable when flex/aspect-ratio combos misbehave in scroll areas). */
.news-card--drawer .news-card__media,
.news-card--page .news-card__media {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    flex-shrink: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}
.news-card--page .news-card__media {
    border-radius: 12px 12px 0 0;
}
.news-card--drawer .news-card__media img,
.news-card--page .news-card__media img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.news-card__media--video .news-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-size: 44px;
    pointer-events: none;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.news-card__media--sm .news-card__play {
    font-size: 30px;
}
.news-card--drawer .news-card__media--video .news-card__play {
    font-size: 40px;
}
.news-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.news-card__dot {
    opacity: 0.5;
}
.news-card__pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.news-card__pill--crypto {
    background: var(--brand-soft);
    color: var(--brand-primary);
    border: 1px solid var(--brand-border);
}
.news-card__pill--stocks {
    background: var(--positive-dim);
    color: var(--positive);
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.news-card__title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.02em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.news-card__tags span {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 8px;
    background: var(--surface-subtle-strong);
    color: var(--text-secondary);
    border: 1px solid var(--surface-border-soft);
}
@media (max-width: 900px) {
    .news-drawer {
        width: 100%;
        max-width: none;
        border-right: none;
    }
    .news-overlay.is-open {
        background: rgba(2, 6, 23, 0.55);
    }
}

/* ─── News full page ─── */
.news-page__hero {
    margin-bottom: 24px;
}
.news-page__related {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.news-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    backdrop-filter: blur(8px);
    letter-spacing: 0.01em;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    cursor: default;
}
.news-tag:hover {
    background: rgba(var(--brand-rgb), 0.16);
    border-color: rgba(var(--brand-rgb), 0.35);
    transform: translateY(-1px);
}
[data-theme="light"] .news-tag {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

.news-page__grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.news-page__grid .section-head {
    margin-bottom: 4px;
}
.news-page__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.news-page__list > .news-card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Card baseline (page mode) — cleaner, more premium */
.news-page__list .news-card--page {
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border-soft);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.news-page__list .news-card--page::after { display: none; }
.news-page__list .news-card--page:hover {
    border-color: rgba(var(--brand-rgb), 0.4);
    transform: translateY(-3px);
    box-shadow: 0 22px 48px -28px rgba(var(--brand-rgb), 0.45),
                0 8px 20px -12px rgba(0, 0, 0, 0.5);
}
.news-page__list .news-card--page .news-card__media {
    border-radius: 0;
    padding-bottom: 58%;
}
.news-page__list .news-card--page .news-card__body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}
.news-page__list .news-card--page .news-card__main {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.news-page__list .news-card--page .news-card__meta--top {
    margin-bottom: 12px;
    font-size: 11px;
}
.news-page__list .news-card--page .news-card__pill {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.news-page__list .news-card--page .news-card__title {
    display: block;
    margin: 0 0 14px 0;
    font-size: 17px;
    font-weight: 700;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.news-page__list .news-card--page:hover .news-card__title {
    color: var(--brand-primary);
}
.news-page__list .news-card--page .news-card__byline {
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--surface-border-soft);
}
.news-page__list .news-card--page .news-card__author {
    font-size: 12px;
    font-weight: 600;
}
.news-page__list .news-card--page .news-card__released {
    font-size: 11px;
    margin-top: 2px;
    color: var(--text-muted);
}
.news-page__list .news-card--page .news-card__tags {
    margin-top: auto;
    padding-top: 12px;
}
.news-page__list .news-card--page .news-card__tags span {
    font-size: 10px;
    padding: 3px 9px;
    background: transparent;
    border: 1px solid var(--surface-border-soft);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.news-page__loading {
    color: var(--text-secondary);
    padding: 60px 40px;
    text-align: center;
    font-size: 14px;
}
.news-page__note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
    line-height: 1.6;
}

/* ─ Featured hero card (first item, magazine style) ─ */
@media (min-width: 768px) {
    .news-page__list > .news-card:first-child {
        grid-column: 1 / -1;
        flex-direction: row;
        min-height: 420px;
        position: relative;
        overflow: hidden;
        border-radius: 20px;
    }
    .news-page__list > .news-card:first-child .news-card__media {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        padding-bottom: 0;
        border-radius: 0;
    }
    .news-page__list > .news-card:first-child .news-card__media::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.2) 45%,
            rgba(0, 0, 0, 0.85) 100%
        );
        pointer-events: none;
        z-index: 1;
    }
    .news-page__list > .news-card:first-child .news-card__media img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .news-page__list > .news-card:first-child:hover .news-card__media img {
        transform: scale(1.04);
    }
    .news-page__list > .news-card:first-child .news-card__body {
        position: relative;
        z-index: 2;
        margin-top: auto;
        width: 100%;
        max-width: 720px;
        padding: 36px 40px 36px;
        background: transparent;
        border-top: none;
    }
    .news-page__list > .news-card:first-child .news-card__meta--top {
        margin-bottom: 14px;
    }
    .news-page__list > .news-card:first-child .news-card__meta--top > span:not(.news-card__pill) {
        color: rgba(255, 255, 255, 0.85);
    }
    .news-page__list > .news-card:first-child .news-card__title {
        font-size: 34px;
        line-height: 1.15;
        margin-bottom: 14px;
        letter-spacing: -0.025em;
        color: #fff;
        -webkit-line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .news-page__list > .news-card:first-child:hover .news-card__title {
        color: #fff;
    }
    .news-page__list > .news-card:first-child .news-card__byline {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    .news-page__list > .news-card:first-child .news-card__author {
        color: #fff;
    }
    .news-page__list > .news-card:first-child .news-card__released {
        color: rgba(255, 255, 255, 0.7);
    }
    .news-page__list > .news-card:first-child .news-card__tags { display: none; }
    .news-page__list > .news-card:first-child .news-card__pill--crypto,
    .news-page__list > .news-card:first-child .news-card__pill--stocks {
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        border-color: rgba(255, 255, 255, 0.15);
        color: #fff;
    }
    .news-page__list > .news-card:first-child:hover {
        transform: translateY(-2px);
        border-color: rgba(var(--brand-rgb), 0.4);
    }

    /* Two prominent cards on row 2 */
    .news-page__list > .news-card:nth-child(2),
    .news-page__list > .news-card:nth-child(3) {
        grid-column: span 2;
    }
}
@media (min-width: 1100px) {
    .news-page__list {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    .news-page__list > .news-card:nth-child(2),
    .news-page__list > .news-card:nth-child(3) {
        grid-column: span 1;
    }
    .news-page__list > .news-card:first-child {
        min-height: 480px;
    }
    .news-page__list > .news-card:first-child .news-card__title {
        font-size: 42px;
    }
    .news-page__list > .news-card:first-child .news-card__body {
        padding: 44px 48px 44px;
    }
}
@media (max-width: 767px) {
    .news-page__list {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .news-page__list .news-card--page .news-card__title {
        font-size: 16px;
    }
    .news-page__list .news-card--page .news-card__body {
        padding: 16px 18px 18px;
    }
}

/* ─── Support (streamlined) ─── */
.support-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.support-page__intro {
    padding: 22px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.support-page__intro h2 {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}
.support-page__intro p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 52ch;
    line-height: 1.55;
}
.support-page__search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(100%, 320px);
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border-soft);
}
.support-page__search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}
.support-page__search button {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.support-page__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 22px;
    align-items: start;
}
.support-page__topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.support-topic {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    text-align: left;
    border-radius: 14px;
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    color: inherit;
    font: inherit;
}
.support-topic:hover {
    border-color: var(--brand-border);
    transform: translateY(-2px);
}
.support-topic i {
    font-size: 22px;
    color: var(--brand-primary);
    flex-shrink: 0;
}
.support-topic strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}
.support-topic span {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}
.support-page__section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-primary);
    margin-bottom: 10px;
}
.support-page__card {
    padding: 22px;
}
.support-page__card h3 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}
.support-page__aside {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.support-aside-card {
    padding: 18px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--surface-border-soft);
    background: linear-gradient(180deg, var(--surface-subtle-strong), var(--surface-subtle-soft));
}
.support-aside-card h4 {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.support-aside-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}
.support-faq .faq-item {
    border-bottom: 1px solid var(--surface-divider);
}
.support-faq .faq-item:last-child {
    border-bottom: none;
}
.support-faq .faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}
.support-faq .faq-question i {
    transition: transform 0.25s ease;
    color: var(--text-muted);
}
.support-faq .faq-item.open .faq-question i {
    transform: rotate(180deg);
    color: var(--brand-primary);
}
.support-faq .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.support-faq .faq-item.open .faq-answer {
    max-height: 320px;
}
.support-faq .faq-answer-inner {
    padding: 0 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 65ch;
}
.support-ticket-form .ticket-priority {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
.support-ticket-form .priority-option {
    padding: 12px 8px;
    text-align: center;
    border-radius: 12px;
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.support-ticket-form .priority-option:hover {
    border-color: var(--border-hover);
}
.support-ticket-form .priority-option.active {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-soft);
}
.support-ticket-form .priority-option.disabled {
    opacity: 0.45;
    pointer-events: none;
}
.support-ticket-form .ticket-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.support-ticket-form .ticket-upload {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    border: 1px dashed var(--brand-border);
    background: var(--surface-subtle);
    cursor: pointer;
}
.support-ticket-form .ticket-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.support-ticket-form .ticket-upload-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}
.support-ticket-form .ticket-submit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}
.support-tickets-list .ticket-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--surface-border-soft);
    background: var(--surface-subtle);
    margin-bottom: 8px;
}
.support-tickets-list .ticket-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.support-tickets-list .ticket-status.open {
    background: #facc15;
    box-shadow: 0 0 8px #facc15;
}
.support-tickets-list .ticket-status.resolved {
    background: var(--positive);
}
.support-tickets-list .ticket-status.closed {
    background: var(--text-muted);
}
.support-tickets-list .ticket-info h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}
.support-tickets-list .ticket-info p {
    font-size: 11px;
    color: var(--text-secondary);
}
.support-tickets-list .ticket-meta {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
    text-align: right;
    line-height: 1.4;
}
@media (max-width: 960px) {
    .support-page__grid {
        grid-template-columns: 1fr;
    }
    .support-ticket-form .ticket-grid {
        grid-template-columns: 1fr;
    }
    .support-ticket-form .ticket-priority {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Support live chat FAB */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
}
.chat-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--brand-primary);
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--brand-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}
.chat-btn:hover {
    background: var(--brand-secondary);
    box-shadow: 0 6px 20px var(--brand-shadow-strong);
}
.chat-window {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: min(380px, calc(100vw - 32px));
    height: min(480px, 70vh);
    background: var(--surface-glass-stronger);
    backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border-strong);
    border-radius: 20px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}
.chat-window.open {
    display: flex;
}
.chat-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-subtle);
}
.chat-header h4 {
    font-size: 14px;
    font-weight: 800;
}
.chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-msg {
    max-width: 90%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
}
.chat-msg.bot {
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border-soft);
    align-self: flex-start;
}
.chat-msg.user {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    align-self: flex-end;
}
.chat-input-wrap {
    padding: 12px;
    border-top: 1px solid var(--surface-divider);
    display: flex;
    gap: 8px;
}
.chat-input-wrap input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--surface-border-soft);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
}
.chat-input-wrap button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: var(--brand-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 640px) {
    .chat-widget {
        right: 16px;
        bottom: 16px;
    }
}

/* ============================================================
   Shared Polish Utilities — used across client pages
   ============================================================ */

/* Premium card surface with gradient + soft top accent line.
   Apply alongside any card to upgrade it to dashboard quality. */
.polish-surface {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border-soft);
    background: linear-gradient(155deg, var(--bg-surface) 0%, var(--bg-base) 100%);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.2s cubic-bezier(.2,.7,.2,1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.polish-surface::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08) 30%, rgba(255,255,255,0.08) 70%, transparent);
    pointer-events: none;
}
.polish-surface--accent::before {
    background: linear-gradient(90deg, transparent, var(--polish-accent, var(--brand-primary)) 50%, transparent);
    opacity: 0.55;
}
.polish-surface--lift:hover {
    transform: translateY(-3px);
    border-color: var(--polish-accent-border, var(--surface-border-strong));
    box-shadow: 0 14px 32px -14px var(--polish-accent-shadow, rgba(0,0,0,0.45));
}

/* Section head — uppercase eyebrow + optional live dot, matches dashboard pattern */
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 2px;
    gap: 12px;
}
.section-head h2,
.section-head__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin: 0;
}
.section-head__live {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.section-head__live::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--positive);
    box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
    animation: ov-pulse 2s ease-in-out infinite;
}
@keyframes polish-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Empty state placeholder — used when a list/table has no data */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--surface-border-soft);
    background: var(--surface-subtle-soft);
    gap: 8px;
    color: var(--text-secondary);
}
.empty-state__icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--brand-soft), transparent 70%);
    color: var(--brand-primary);
    border: 1px solid var(--brand-border);
}
.empty-state__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.empty-state__text {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 380px;
    line-height: 1.55;
}
.empty-state__action {
    margin-top: 12px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--brand-shadow), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.empty-state__action:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px var(--brand-shadow-strong), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Skeleton shimmer for table/list loading states */
@keyframes polish-skeleton {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton-line,
.skeleton-block {
    display: block;
    border-radius: 6px;
    background: linear-gradient(90deg,
        var(--surface-subtle) 0%,
        var(--surface-subtle-hover) 50%,
        var(--surface-subtle) 100%);
    background-size: 200% 100%;
    animation: polish-skeleton 1.4s ease-in-out infinite;
}
.skeleton-line { height: 12px; width: 100%; }
.skeleton-line.sm { height: 10px; width: 50%; }
.skeleton-line.lg { height: 16px; width: 70%; }
.skeleton-block { height: 60px; }
.skeleton-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--surface-border-soft);
}
.skeleton-row:last-child { border-bottom: none; }
.skeleton-row .skeleton-line { flex: 1; }

/* Polished interactive row — hover lift used in lists/tables */
.row-interactive {
    transition: background 0.15s ease, transform 0.15s cubic-bezier(.2,.7,.2,1), border-color 0.15s ease, box-shadow 0.15s ease;
}
.row-interactive:hover {
    background: var(--surface-subtle);
    border-color: var(--surface-border-strong);
}

/* Premium quick-stat card — re-usable copy of dashboard quick-stat */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-card {
    position: relative;
    padding: 16px 18px 18px;
    display: flex; flex-direction: column; gap: 10px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border-soft);
    background: linear-gradient(155deg, var(--bg-surface) 0%, var(--bg-base) 100%);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.2s cubic-bezier(.2,.7,.2,1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 100% at 100% 0%, var(--stat-accent-soft, var(--brand-soft)) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--stat-accent, var(--brand-primary)) 50%, transparent);
    opacity: 0.5;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--stat-accent-border, var(--surface-border-strong));
    box-shadow: 0 12px 32px -12px var(--stat-accent-shadow, rgba(0,0,0,0.4));
}
.stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-card__icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
}
.stat-card__icon.orange { background: linear-gradient(135deg, rgba(249,115,22,0.18), rgba(249,115,22,0.05)); color: var(--brand-primary); border: 1px solid var(--brand-border); }
.stat-card__icon.green  { background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.05)); color: var(--positive); border: 1px solid rgba(16,185,129,0.25); }
.stat-card__icon.blue   { background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(59,130,246,0.05)); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.stat-card__icon.purple { background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(139,92,246,0.05)); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.stat-card__icon.red    { background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(239,68,68,0.05)); color: var(--negative); border: 1px solid rgba(239,68,68,0.25); }
.stat-card__value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
    font-feature-settings: 'tnum';
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-card__label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}
.stat-card.accent-orange { --stat-accent: var(--brand-primary); --stat-accent-soft: rgba(249,115,22,0.16); --stat-accent-border: var(--brand-border); --stat-accent-shadow: rgba(249,115,22,0.18); }
.stat-card.accent-green  { --stat-accent: var(--positive);     --stat-accent-soft: rgba(16,185,129,0.16); --stat-accent-border: rgba(16,185,129,0.3);  --stat-accent-shadow: rgba(16,185,129,0.18); }
.stat-card.accent-blue   { --stat-accent: #3b82f6;             --stat-accent-soft: rgba(59,130,246,0.16); --stat-accent-border: rgba(59,130,246,0.3);  --stat-accent-shadow: rgba(59,130,246,0.18); }
.stat-card.accent-purple { --stat-accent: #8b5cf6;             --stat-accent-soft: rgba(139,92,246,0.16); --stat-accent-border: rgba(139,92,246,0.3);  --stat-accent-shadow: rgba(139,92,246,0.18); }
.stat-card.accent-red    { --stat-accent: var(--negative);     --stat-accent-soft: rgba(239,68,68,0.16); --stat-accent-border: rgba(239,68,68,0.3);  --stat-accent-shadow: rgba(239,68,68,0.18); }

/* ============== KYC verification chip ============== */
.kyc-chip {
    --kyc-accent: 249, 115, 22;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(var(--kyc-accent), 0.08);
    border: 1px solid rgba(var(--kyc-accent), 0.28);
    margin-bottom: 18px;
    cursor: default;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.kyc-chip:hover {
    background: rgba(var(--kyc-accent), 0.13);
    border-color: rgba(var(--kyc-accent), 0.45);
}
.kyc-chip__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(var(--kyc-accent), 0.2);
    color: rgb(var(--kyc-accent));
    font-size: 14px;
    flex-shrink: 0;
}
.kyc-chip__pulse {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(var(--kyc-accent));
    box-shadow: 0 0 0 0 rgba(var(--kyc-accent), 0.6);
    animation: kyc-chip-pulse 1.8s infinite;
}
@keyframes kyc-chip-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(var(--kyc-accent), 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(var(--kyc-accent), 0); }
    100% { box-shadow: 0 0 0 0   rgba(var(--kyc-accent), 0); }
}
.kyc-chip__label { white-space: nowrap; }
.kyc-chip__action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgb(var(--kyc-accent));
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.kyc-chip__action:hover { filter: brightness(1.08); transform: translateX(1px); }
.kyc-chip__action i { font-size: 12px; }

.kyc-chip__tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: max-content;
    max-width: 320px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-secondary);
    background: var(--bg-elevated, #14151a);
    border: 1px solid var(--hairline, rgba(255,255,255,0.08));
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 30;
}
.kyc-chip__tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 18px;
    width: 9px;
    height: 9px;
    background: var(--bg-elevated, #14151a);
    border-left: 1px solid var(--hairline, rgba(255,255,255,0.08));
    border-top: 1px solid var(--hairline, rgba(255,255,255,0.08));
    transform: rotate(45deg);
}
.kyc-chip:hover .kyc-chip__tooltip,
.kyc-chip:focus-within .kyc-chip__tooltip {
    opacity: 1;
    transform: translateY(0);
}

.kyc-chip--info   { --kyc-accent: 99, 102, 241; }
.kyc-chip--danger { --kyc-accent: 239, 68, 68; }

/* ═══════════════════════════════════════════════════════════════════
   TOPBAR v2 — Three-section layout: [left cluster] [clock] [user]
   ═══════════════════════════════════════════════════════════════════ */
.topbar.topbar--v2 {
    height: 64px;
    padding: 0 clamp(16px, 1.8vw, 26px);
    gap: 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
.topbar-cluster {
    display: flex; align-items: center; gap: 10px;
    min-width: 0;
}
.topbar-cluster--left { justify-content: flex-start; }
.topbar-cluster--right { justify-content: flex-end; margin-left: 0; }

/* Notification bell with prominent badge */
.topbar--v2 .notification-bell { position: relative; }
.topbar--v2 .notification-bell .notification-badge {
    position: absolute;
    top: -2px; right: -2px; left: auto;
    min-width: 14px; height: 14px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--brand-primary);
    color: #1a1300;
    font-size: 9px; font-weight: 700;
    line-height: 14px;
    text-align: center;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--topbar-bg, var(--bg-base));
    border: none;
    letter-spacing: -0.02em;
}
[data-theme="light"] .topbar--v2 .notification-bell .notification-badge {
    box-shadow:
        0 0 0 2px #ffffff,
        0 2px 8px rgba(251, 191, 36, 0.5);
    color: #1a1300;
}

/* Status pill — dark capsule with green dot */
.topbar-status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    height: 38px;
    padding: 0 14px 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border-soft);
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
    transition: border-color 0.2s ease, background 0.2s ease;
}
[data-theme="light"] .topbar-status-pill { background: rgba(15, 23, 42, 0.04); }
.topbar-status-pill:hover {
    border-color: var(--border-hover);
    background: var(--surface-subtle-hover);
}
.topbar-status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--positive);
    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.18),
        0 0 10px rgba(16, 185, 129, 0.45);
    position: relative;
    flex-shrink: 0;
}
.topbar-status-dot::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 50%;
    background: var(--positive);
    animation: dx-status-pulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    opacity: 0.6;
}
@keyframes dx-status-pulse {
    0% { transform: scale(1); opacity: 0.55; }
    70%, 100% { transform: scale(2.4); opacity: 0; }
}
body.reduced-motion .topbar-status-dot::after { animation: none; opacity: 0; }
.topbar-status-label { color: var(--text-primary); font-weight: 600; }
.topbar-status-value {
    color: var(--positive);
    font-weight: 700;
    letter-spacing: 0;
}

/* Red round button (alert / news) */
.topbar-stop {
    width: 38px; height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, 0.32);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.12));
    color: #fca5a5;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}
.topbar-stop:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(220, 38, 38, 0.2));
    border-color: rgba(239, 68, 68, 0.5);
    color: #fecaca;
    box-shadow: 0 6px 16px -6px rgba(239, 68, 68, 0.5);
}
.topbar-stop:active { transform: translateY(0); }
.topbar-stop i { font-size: 12px; }

/* Center clock */
.topbar-clock {
    display: inline-flex; align-items: baseline; gap: 12px;
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.005em;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    justify-self: center;
}
.topbar-clock-date { color: var(--text-primary); }
.topbar-clock-time {
    color: var(--brand-primary);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(var(--brand-rgb), 0.25);
}

/* User pill v2 — avatar + greeting + name + caret */
.user-display.user-display--v2 {
    display: inline-flex; align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border-soft);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
    max-width: 260px;
    margin-left: 0;
}
[data-theme="light"] .user-display.user-display--v2 { background: rgba(15, 23, 42, 0.04); }
.user-display.user-display--v2:hover {
    border-color: var(--border-hover);
    background: var(--surface-subtle-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.5);
}
.user-display.user-display--v2 .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    box-shadow:
        0 0 0 2px rgba(var(--brand-rgb), 0.18),
        0 4px 10px -4px rgba(var(--brand-rgb), 0.5);
}
.user-display.user-display--v2 .user-meta {
    display: flex; flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    min-width: 0;
}
.user-display.user-display--v2 .user-greet {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}
.user-display.user-display--v2 .user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-display.user-display--v2 .user-caret {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 2px;
    transition: transform 0.2s ease, color 0.2s ease;
}
.user-display.user-display--v2:hover .user-caret { color: var(--text-primary); transform: translateY(1px); }

/* v2 search icon button */
.topbar--v2 .topbar-search-btn { /* uses base .topbar-icon */ }

/* Mobile — collapse smartly */
@media (max-width: 1024px) {
    .topbar.topbar--v2 {
        display: flex;
        grid-template-columns: none;
        height: auto;
        min-height: 62px;
    }
    .topbar.topbar--v2 .topbar-cluster--left { flex: 1 1 auto; gap: 8px; order: 1; min-width: 0; }
    .topbar.topbar--v2 .topbar-cluster--right { flex: 0 0 auto; gap: 8px; order: 2; }
    .topbar.topbar--v2 .mobile-nav-toggle { order: 0; }
    .topbar-clock { display: none; }
    .topbar-status-pill {
        height: 36px;
        padding: 0 12px 0 11px;
        font-size: 12px;
        gap: 7px;
    }
    .topbar-stop { width: 36px; height: 36px; }
    .user-display.user-display--v2 {
        max-width: 180px;
        padding: 3px 10px 3px 3px;
        gap: 9px;
    }
    .user-display.user-display--v2 .user-avatar { width: 32px; height: 32px; }
    .user-display.user-display--v2 .user-name { max-width: 100px; font-size: 12px; }
    .user-display.user-display--v2 .user-greet { font-size: 10px; }
}
@media (max-width: 640px) {
    .topbar-status-pill .topbar-status-label { display: none; }
    .topbar-status-pill { padding: 0 12px; }
    .topbar.topbar--v2 .topbar-search-btn { display: none; }
}
@media (max-width: 480px) {
    .topbar-status-pill {
        padding: 0;
        width: 36px;
        justify-content: center;
        background: transparent;
        border-color: transparent;
    }
    .topbar-status-pill .topbar-status-value { display: none; }
    .topbar-stop { width: 34px; height: 34px; }
    .user-display.user-display--v2 {
        max-width: 44px; min-width: 44px;
        padding: 3px;
        gap: 0;
        justify-content: center;
    }
    .user-display.user-display--v2 .user-meta,
    .user-display.user-display--v2 .user-caret { display: none; }
    .user-display.user-display--v2 .user-avatar { width: 32px; height: 32px; }
    .topbar--v2 .notification-bell .notification-badge {
        min-width: 13px; height: 13px;
        font-size: 8.5px; line-height: 13px;
    }
}


