:root {
    --bg-color: #000000;
    --card-bg: #0a0a0c;
    --card-bg-alt: #111113;
    --border-color: rgba(255, 255, 255, 0.07);
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --text-muted: #666666;
    
    --color-bull: #51CF66;
    --color-bear: #FF6B6B;
    --color-sideways: #FAB005;
    
    --color-buy: #51CF66;
    --color-sell: #FF6B6B;
    --color-hold: #999999;

    --btn-primary-bg: #ffffff;
    --btn-primary-text: #000000;
    --btn-secondary-bg: #1a1a1f;
    --btn-secondary-text: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(9, 10, 15, 0.94);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 1.25rem;
}

.topbar-zone-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Logo & Brand Containment */
.logo-container {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-container a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.logo-container img,
.logo-container .logo-img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    object-fit: contain !important;
    border-radius: 7px;
    display: block;
    flex-shrink: 0;
}

.badge-quant {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(81, 207, 102, 0.15);
    border: 1px solid rgba(81, 207, 102, 0.35);
    border-radius: 4px;
    color: #51CF66;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
}

.topbar-latency-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #10b981;
    font-family: 'JetBrains Mono', monospace;
}

.topbar-zone-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 620px;
}

.topbar-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.topbar-search-wrap input {
    width: 100%;
    min-width: 200px;
    padding: 6px 42px 6px 30px;
    background: #0d0f15;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: all 0.2s ease;
}

.topbar-search-wrap input:focus {
    border-color: #22d3ee;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
}

.topbar-search-wrap .search-icon {
    position: absolute;
    left: 10px;
    color: #71717a;
    font-size: 0.75rem;
    pointer-events: none;
}

.search-kbd-btn {
    position: absolute;
    right: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #a1a1aa;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.65rem;
    cursor: pointer;
}

.btn-topbar-run {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #000;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.btn-topbar-run:hover { opacity: 0.9; }

.btn-topbar-sync {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.3);
    color: #22d3ee;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.topbar-zone-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-pill-provider {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.72rem;
}

.topbar-pill-provider select {
    background: transparent;
    border: none;
    color: #22d3ee;
    font-weight: 700;
    font-size: 0.72rem;
    cursor: pointer;
    outline: none;
    padding: 0;
    min-width: 0;
}

.btn-topbar-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #22d3ee;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-topbar-action {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Workspaces Institutional Dropdown */
.topbar-workspaces-dropdown {
    position: relative;
}

.btn-workspaces-trigger {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f4f4f5;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-workspaces-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.workspaces-menu-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 250px;
    background: #090a0f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    padding: 8px 6px;
    display: none;
    z-index: 12000;
    backdrop-filter: blur(20px);
}

.topbar-workspaces-dropdown.open .workspaces-menu-popup {
    display: block;
    animation: fadeInMenu 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.workspaces-group-title {
    font-size: 0.62rem;
    font-weight: 800;
    color: #71717a;
    letter-spacing: 0.08em;
    padding: 6px 10px 4px;
}

.workspace-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    color: #e4e4e7;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.15s;
}

.workspace-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.workspace-item .ws-badge {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

/* Profile Pill */
.topbar-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    text-decoration: none;
    color: #f4f4f5;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.topbar-profile-link:hover {
    border-color: #22d3ee;
    background: rgba(34, 211, 238, 0.08);
}

.profile-avatar-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22d3ee, #3b82f6);
    color: #000;
    font-weight: 800;
    font-size: 0.62rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

input[type="text"], input[type="number"], select {
    background-color: #111111;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    min-width: 280px;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: #ffffff;
}

button {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Navigation Tabs */
.tabs-container {
    border-bottom: 1px solid var(--border-color);
    background-color: #050507;
    padding: 0.4rem 2rem;
    overflow-x: auto;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.825rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
    transform: none;
}

.tab-btn.active {
    color: #000;
    background-color: #fff;
    font-weight: 600;
}

/* Content */
.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grids & Cards */
.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Desk Primer / How-To Banner */
.desk-primer-card {
    background: linear-gradient(135deg, rgba(81, 207, 102, 0.05) 0%, rgba(79, 143, 255, 0.03) 100%);
    border: 1px solid rgba(81, 207, 102, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
}

.primer-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #51CF66;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.primer-text {
    font-size: 0.825rem;
    color: #b0b0b5;
    line-height: 1.6;
}

.primer-text strong {
    color: #ffffff;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.chart-container.large {
    height: 280px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}

.data-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Text Colors & Badges */
.text-buy { color: var(--color-buy) !important; font-weight: 600; }
.text-sell { color: var(--color-sell) !important; font-weight: 600; }
.text-hold { color: var(--color-hold) !important; }
.text-primary { color: #fff !important; font-weight: 600; }

.badge.bull { background: rgba(81, 207, 102, 0.15); color: var(--color-bull); }
.badge.bear { background: rgba(255, 107, 107, 0.15); color: var(--color-bear); }
.badge.sideways { background: rgba(250, 176, 5, 0.15); color: var(--color-sideways); }

/* Regime Display */
.regime-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}
.regime-badge.bull { background: rgba(81, 207, 102, 0.2); color: var(--color-bull); border: 1px solid rgba(81, 207, 102, 0.4); }
.regime-badge.bear { background: rgba(255, 107, 107, 0.2); color: var(--color-bear); border: 1px solid rgba(255, 107, 107, 0.4); }
.regime-badge.sideways { background: rgba(250, 176, 5, 0.2); color: var(--color-sideways); border: 1px solid rgba(250, 176, 5, 0.4); }

.prob-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}
.prob-fill { height: 100%; border-radius: 3px; }
.prob-fill.bull { background: var(--color-bull); }
.prob-fill.bear { background: var(--color-bear); }
.prob-fill.sideways { background: var(--color-sideways); }

/* Correlation Matrix */
.corr-grid {
    display: grid;
    gap: 4px;
    font-size: 0.75rem;
    text-align: center;
}
.corr-cell {
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    color: #fff;
}
.corr-label {
    padding: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Stats Rows */
.stats-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}
.stat-item { text-align: center; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.stat-value { font-size: 1.05rem; font-weight: 700; color: #fff; }

.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    text-align: center;
}
.stats-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    text-align: center;
}

.stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem 0.5rem;
}

/* Level-2 DOM Table */
.dom-table-wrap {
    overflow-x: auto;
}
.dom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    font-family: monospace;
}
.dom-table th {
    padding: 6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
}
.dom-table td {
    padding: 5px 8px;
    text-align: center;
}
.dom-bid-row { background: rgba(81, 207, 102, 0.04); }
.dom-ask-row { background: rgba(255, 107, 107, 0.04); }
.dom-bid-price { color: var(--color-buy); font-weight: 700; }
.dom-ask-price { color: var(--color-sell); font-weight: 700; }

/* Greeks Grid Table */
.greeks-wrap {
    overflow-x: auto;
}
.greeks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}
.greeks-table th, .greeks-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.greek-name { font-weight: 600; color: #fff; }
.greek-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Execution Form */
.execution-form {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.exec-input { min-width: 160px; padding: 0.5rem 0.75rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.25rem; }
.text-center { text-align: center; }

/* Responsive */
@media (max-width: 900px) {
    .grid-2-col { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; gap: 0.75rem; align-items: stretch; }
    .controls { flex-direction: column; }
    .input-wrap input { width: 100%; }
    .stats-grid-4, .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════════════
   QUANT TERMINAL REAL-TIME MARKET RIBBON & INFINITE MARQUEE SCROLLER
   ══════════════════════════════════════════════════════════════════════════ */
.market-ribbon-card {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(13, 13, 18, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    padding: 6px 14px;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
}

.market-ribbon-track {
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    animation: marketMarqueeScroll 42s linear infinite;
    will-change: transform;
}

.market-ribbon-track:hover,
.market-ribbon-card:hover .market-ribbon-track {
    animation-play-state: paused;
}

@keyframes marketMarqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ribbon-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ribbon-item:hover {
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.4);
    transform: translateY(-1px);
}

.ribbon-symbol {
    font-size: 0.75rem;
    font-weight: 800;
    color: #ffffff;
    font-family: monospace;
}

.ribbon-price {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    font-family: monospace;
}

.ribbon-chg {
    font-size: 0.675rem;
    font-weight: 700;
    font-family: monospace;
}

.text-emerald { color: #51CF66 !important; }
.text-red { color: #FF6B6B !important; }

@keyframes flashGreen {
    0% { background-color: rgba(81, 207, 102, 0.45); color: #fff; }
    100% { background-color: transparent; }
}

@keyframes flashRed {
    0% { background-color: rgba(255, 107, 107, 0.45); color: #fff; }
    100% { background-color: transparent; }
}

.price-flash-up {
    animation: flashGreen 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
    border-radius: 4px;
}

.price-flash-down {
    animation: flashRed 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════
   UNIVERSAL FINANCIAL COMMAND PALETTE (CMD+K) OVERLAY
   ══════════════════════════════════════════════════════════════════════════ */
.palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.palette-overlay[hidden] {
    display: none !important;
}

.palette-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.palette-modal {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: #0f1015;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: paletteSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes paletteSlideDown {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.palette-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.palette-icon {
    font-size: 1.1rem;
    color: #22d3ee;
}

.palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #ffffff;
    font-family: inherit;
}

.palette-input::placeholder {
    color: #71717a;
}

.palette-kbd {
    font-size: 0.7rem;
    font-family: monospace;
    font-weight: 700;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: #a1a1aa;
}

.palette-suggestions {
    max-height: 420px;
    overflow-y: auto;
    padding: 10px;
}

.palette-group-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #71717a;
    padding: 8px 12px 4px 12px;
    text-transform: uppercase;
}

.palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #e4e4e7;
    text-decoration: none;
}

.palette-item:hover, .palette-item.active {
    background: rgba(34, 211, 238, 0.12);
    color: #ffffff;
}

.palette-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.palette-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #22d3ee;
}

.palette-item-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.palette-item-sub {
    font-size: 0.72rem;
    color: #a1a1aa;
}

.palette-item-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: #a1a1aa;
    font-family: monospace;
}

/* ══════════════════════════════════════════════════════════════════════════
   INTERACTIVE DESK SIMULATOR STYLES
   ══════════════════════════════════════════════════════════════════════════ */
.btn-dom-buy {
    background: rgba(81, 207, 102, 0.15);
    border: 1px solid rgba(81, 207, 102, 0.4);
    color: #51CF66;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-dom-buy:hover {
    background: #51CF66;
    color: #000;
    box-shadow: 0 0 12px rgba(81, 207, 102, 0.4);
}

.btn-dom-sell {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #FF6B6B;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-dom-sell:hover {
    background: #FF6B6B;
    color: #000;
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.4);
}

.greek-slider-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 14px;
}
.greek-slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #a1a1aa;
    margin-bottom: 4px;
}
.greek-slider-header strong {
    color: #22d3ee;
    font-family: monospace;
}
.greek-slider {
    width: 100%;
    accent-color: #22d3ee;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════════════
   UNIVERSAL MATHEMATICAL EXPLAINABILITY DRAWER
   ══════════════════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════════════════
   UNIVERSAL KATEX RESPONSIVE EQUATION CONTAINMENT
   ══════════════════════════════════════════════════════════════════════════ */
.katex-display {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 8px 4px !important;
    margin: 0.75em 0 !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.4) rgba(0, 0, 0, 0.2);
    -webkit-overflow-scrolling: touch;
}
.katex-display::-webkit-scrollbar {
    height: 4px;
}
.katex-display::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}
.katex-display::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.4);
    border-radius: 4px;
}
.katex {
    max-width: 100%;
    text-rendering: auto;
    font-size: 1.05em;
    line-height: 1.35;
}
.katex-html {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.explain-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.25);
    color: #22d3ee;
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.explain-trigger-btn:hover {
    background: #22d3ee;
    color: #000;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
    transform: scale(1.1);
}

.explain-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: flex;
    justify-content: flex-end;
}

.explain-modal-overlay[hidden],
.explain-modal-overlay.hidden {
    display: none !important;
}

.explain-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

.explain-drawer-panel {
    position: relative;
    width: 100%;
    max-width: 580px;
    height: 100%;
    background: #0d0f15;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -15px 0 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: hidden;
    animation: slideInRight 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.explain-drawer-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.015);
    gap: 12px;
}

.explain-drawer-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.explain-drawer-close-btn:hover {
    background: rgba(255, 107, 107, 0.25);
    border-color: rgba(255, 107, 107, 0.5);
    color: #ff6b6b;
    transform: scale(1.08);
}

.explain-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.explain-depth-selector {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.explain-depth-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s ease;
}
.explain-depth-btn.active {
    background: #22d3ee;
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
}

.explain-section-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
    max-width: 100%;
    overflow: hidden;
    word-break: break-word;
}
.explain-formula-box {
    background: #08090d;
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
    margin: 12px 0;
    color: #22d3ee;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.35) transparent;
}

/* Cointegration Screener & Black-Litterman Card Styles */
.arb-pair-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: monospace;
}
.arb-pair-badge.stationary {
    background: rgba(81, 207, 102, 0.15);
    color: #51CF66;
    border: 1px solid rgba(81, 207, 102, 0.3);
}
.arb-pair-badge.non-stationary {
    background: rgba(255, 107, 107, 0.15);
    color: #FF6B6B;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ══════════════════════════════════════════════════════════════════════════
   BLOOMBERG TERMINAL FUNCTION STRIP & QUAD DESK TILE GRID
   ══════════════════════════════════════════════════════════════════════════ */
.bloomberg-function-strip {
    max-width: 1400px;
    margin: 8px auto 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.bbg-fn-track {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}
.bbg-fn-track::-webkit-scrollbar {
    display: none;
}

.bbg-fn-btn {
    background: #08090d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a1a1aa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: monospace;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.bbg-fn-btn kbd {
    background: rgba(255, 158, 0, 0.15);
    color: #ff9e00;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.65rem;
}

.bbg-fn-btn:hover {
    border-color: #ff9e00;
    color: #ffffff;
    background: rgba(255, 158, 0, 0.08);
}

.bbg-fn-btn.active {
    background: #ff9e00;
    border-color: #ff9e00;
    color: #000000;
}
.bbg-fn-btn.active kbd {
    background: #000000;
    color: #ff9e00;
}

.bbg-mode-toggle-group {
    display: flex;
    gap: 4px;
    background: #08090d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px;
    border-radius: 6px;
    flex-shrink: 0;
}

.bbg-tile-btn {
    background: transparent;
    border: none;
    color: #a1a1aa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.bbg-tile-btn.active {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
    font-weight: 700;
}

/* Bloomberg Quad-Tile Grid View Mode */
body.quad-grid-active .main-content {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
}

body.quad-grid-active .tab-content {
    display: flex !important;
    flex-direction: column !important;
    height: 700px !important;
    overflow-y: auto !important;
    border: 1px solid rgba(255, 158, 0, 0.25) !important;
    border-radius: 12px !important;
    padding: 14px !important;
    background: rgba(10, 11, 15, 0.95) !important;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6) !important;
}

@media (max-width: 1100px) {
    body.quad-grid-active .main-content {
        grid-template-columns: 1fr !important;
    }
}

/* FIX 4.4 Modal Styles */
.fix-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fix-modal-overlay[hidden],
.fix-modal-overlay.hidden {
    display: none !important;
}

.fix-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.fix-modal-panel {
    position: relative;
    width: 100%;
    max-width: 650px;
    background: #0d0f15;
    border: 1px solid rgba(255, 158, 0, 0.4);
    border-radius: 14px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 158, 0, 0.15);
    z-index: 1;
    overflow: hidden;
}

.fix-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 158, 0, 0.03);
}

.fix-modal-body {
    padding: 20px;
}




/* ═══════════════════ COMPLETED INSTITUTIONAL SUITE STYLES ═══════════════════ */
.opt-strat-btn, .q-strat-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.opt-strat-btn:hover, .q-strat-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.opt-strat-btn.active {
    background: rgba(167, 139, 250, 0.2);
    border-color: rgba(167, 139, 250, 0.5);
    color: #a78bfa;
    font-weight: 700;
}

.q-strat-btn.active {
    background: rgba(81, 207, 102, 0.2);
    border-color: rgba(81, 207, 102, 0.5);
    color: #51CF66;
    font-weight: 700;
}

.heatmap-cell {
    padding: 6px 4px;
    border-radius: 4px;
    font-weight: 600;
    font-family: monospace;
    transition: transform 0.15s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 2;
}

.heat-pos-high { background: rgba(16, 185, 129, 0.45); color: #fff; }
.heat-pos-med { background: rgba(16, 185, 129, 0.25); color: #51CF66; }
.heat-pos-low { background: rgba(16, 185, 129, 0.12); color: #a7f3d0; }
.heat-neg-low { background: rgba(244, 63, 94, 0.15); color: #fecdd3; }
.heat-neg-med { background: rgba(244, 63, 94, 0.3); color: #fda4af; }
.heat-neg-high { background: rgba(244, 63, 94, 0.55); color: #fff; }

/* ── Institutional Topbar Hub Dropdowns (Quant Core, Desks & Ops) ────────── */
.topbar-hub-dropdown {
    position: relative;
    display: inline-block;
}

.topbar-hub-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    color: #e4e4e7;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.topbar-hub-trigger:hover,
.topbar-hub-dropdown.open .topbar-hub-trigger {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.05);
}

.topbar-hub-trigger .caret-icon {
    font-size: 0.6rem;
    color: #71717a;
    transition: transform 0.2s;
    margin-left: 2px;
}

.topbar-hub-dropdown.open .topbar-hub-trigger .caret-icon {
    transform: rotate(180deg);
    color: #fff;
}

.topbar-hub-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 290px;
    background: #090b10;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.08);
    padding: 6px;
    display: none;
    z-index: 12000;
    backdrop-filter: blur(24px);
}

.topbar-hub-dropdown.open .topbar-hub-menu {
    display: block;
    animation: fadeInHubMenu 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.hub-menu-header {
    font-size: 0.62rem;
    font-weight: 800;
    color: #71717a;
    letter-spacing: 0.08em;
    padding: 6px 10px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.hub-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #e4e4e7;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
    box-sizing: border-box;
}

.hub-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.hub-menu-item i {
    width: 20px;
    font-size: 0.85rem;
    text-align: center;
    flex-shrink: 0;
}

.hub-item-text {
    flex: 1;
    min-width: 0;
}

.hub-item-title {
    font-size: 0.76rem;
    font-weight: 600;
    color: #f4f4f5;
    line-height: 1.25;
}

.hub-item-sub {
    font-size: 0.65rem;
    color: #71717a;
    line-height: 1.2;
    margin-top: 1px;
}

.hub-menu-item:hover .hub-item-sub {
    color: #a1a1aa;
}

.hub-badge {
    margin-left: auto;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

