/* ==========================================================================
   MAXBURG COMPARISON STUDIO — STYLESHEET
   Inspired by Dividend Vision modular palette architecture
   Optimized for Commercial Subscribers & YouTube Livestreams
   ========================================================================== */

:root {
    /* Color Palette - Slate Dark / Dividend Vision Inspired */
    --studio-bg: #0b0f19;
    --palette-bg: #141828;
    --palette-bg-hover: #192035;
    --palette-surface: #1c233c;
    --palette-border: rgba(255, 255, 255, 0.08);
    --palette-border-hover: rgba(255, 255, 255, 0.18);
    --palette-border-accent: rgba(99, 102, 241, 0.4);
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    
    /* Financial Highlights */
    --color-emerald: #10b981;
    --color-emerald-glow: rgba(16, 185, 129, 0.15);
    --color-red: #ef4444;
    --color-red-glow: rgba(239, 68, 68, 0.15);
    --color-gold: #f59e0b;
    --color-gold-glow: rgba(245, 158, 11, 0.15);
    --color-purple: #a855f7;
    --color-purple-glow: rgba(168, 85, 247, 0.15);
    --color-blue: #3b82f6;
    --color-cyan: #06b6d4;
    
    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, Monaco, monospace;
    
    /* Radius & Spacing */
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --radius-pill: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base HTML */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--studio-bg);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 13px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: rgba(11, 15, 25, 0.7);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Utility Helpers */
.text-emerald { color: var(--color-emerald) !important; }
.text-red { color: var(--color-red) !important; }
.text-gold { color: var(--color-gold) !important; }
.text-purple { color: var(--color-purple) !important; }
.text-blue { color: var(--color-blue) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-mono { font-family: var(--font-mono) !important; }
.font-bold { font-weight: 700 !important; }

/* ==========================================================================
   TOPBAR NAVIGATION RIBBON & GLOBAL SUMMARY
   ========================================================================== */
.studio-navbar {
    position: sticky;
    top: 0;
    z-index: 500;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--palette-border);
    padding: 5px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    -webkit-app-region: drag;
    user-select: none;
}

.studio-navbar button,
.studio-navbar input,
.studio-navbar select,
.studio-navbar a,
.studio-navbar .kpi-stat-mode-selector,
.studio-navbar .studio-settings-menu-wrapper,
.studio-navbar .kpi-pill {
    -webkit-app-region: no-drag;
}

.window-drag-grip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    font-size: 10.5px;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    cursor: grab;
    -webkit-app-region: drag;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.window-drag-grip:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
}

.window-drag-grip:active {
    cursor: grabbing;
}

.studio-brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.studio-logo-badge {
    width: 34px;
    height: 34px;
    border: 2px solid #d97706;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    color: #fbbf24;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.studio-title-block {
    display: flex;
    flex-direction: column;
}

.studio-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.studio-title-main {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.studio-edition-tag {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.18);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.studio-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #34d399;
    font-weight: 600;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Global Market Summary Tape (Apple Monochromatic Aesthetic) */
.studio-kpi-ribbon {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-grow: 1;
    justify-content: center;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 14px;
    border-radius: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.studio-kpi-ribbon::-webkit-scrollbar { display: none; }

.kpi-pill {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
    font-size: 12.5px;
}
.kpi-pill-label {
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.kpi-pill-val {
    font-family: var(--font-mono, monospace);
    font-weight: 800;
    font-size: 13px;
    color: #f8fafc;
    letter-spacing: 0.02em;
}
.kpi-pill.filter-active .kpi-pill-val {
    color: #e2c071;
    text-shadow: 0 0 8px rgba(226, 192, 113, 0.35);
}
.kpi-pill.zero-match .kpi-pill-val {
    color: #f87171;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.kpi-stat-mode-selector {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    user-select: none;
}
.kpi-stat-mode-selector:hover {
    border-color: rgba(226, 192, 113, 0.35);
    background: rgba(226, 192, 113, 0.08);
}
.kpi-stat-badge {
    font-size: 10.5px;
    font-weight: 700;
    color: #64748b;
    padding: 0 2px;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}
.kpi-stat-badge.active {
    color: #e2c071;
    font-weight: 900;
    text-shadow: 0 0 6px rgba(226, 192, 113, 0.4);
}
.kpi-stat-sep {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
}

.kpi-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.14);
}

.kpi-val-cagr {
    color: #f8fafc;
    font-weight: 800;
}
.kpi-val-yield {
    color: #e2c071;
    font-weight: 800;
}
.kpi-val-stabledex {
    color: #f8fafc;
    font-weight: 800;
}
.kpi-val-maxdd {
    color: #f87171;
    font-weight: 800;
}

/* Studio Global Actions (Monochromatic Theme with Gold Highlights) */
.studio-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Apple-style plain word action (Tweet Studio) */
.btn-studio-text-action {
    display: inline-flex;
    align-items: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    padding: 0 10px;
    height: 30px;
    border-radius: 5px;
    transition: color 0.15s ease, text-shadow 0.15s ease;
    user-select: none;
    outline: none;
}
.btn-studio-text-action:hover {
    color: #e2c071;
    text-shadow: 0 0 10px rgba(226, 192, 113, 0.45);
}
.btn-studio-text-action:active {
    transform: translateY(0.5px);
}

.action-separator {
    color: rgba(255, 255, 255, 0.25);
    font-size: 13px;
    user-select: none;
    margin: 0 2px;
}

/* General Monochromatic Action Button */
.btn-studio-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    height: 30px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    user-select: none;
    box-sizing: border-box;
}

/* Gold hover highlight */
.btn-studio-action:hover {
    background: rgba(226, 192, 113, 0.12);
    color: #e2c071;
    border-color: rgba(226, 192, 113, 0.5);
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.22);
}
.btn-studio-action:active,
.btn-studio-action.active {
    background: rgba(226, 192, 113, 0.2);
    border-color: #e2c071;
    color: #e2c071;
}

/* Icon-Only Buttons */
.btn-icon-action {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
    flex-shrink: 0;
}
.btn-icon-action svg {
    display: block;
    stroke: #f1f5f9;
    stroke-width: 2.3;
    transition: transform 0.2s ease, stroke 0.18s ease;
}
.btn-icon-action:hover svg {
    stroke: #e2c071;
}
.btn-icon-action:hover .settings-sprocket-svg {
    transform: rotate(90deg);
}

/* Modern CSS Floating Tooltip for all icons */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    background: #0d1117;
    color: #f1f5f9;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(226, 192, 113, 0.35);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 10000;
}
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.btn-studio-action.btn-switch-screen {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(59, 130, 246, 0.15));
    border-color: rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
}
.btn-studio-action.btn-switch-screen:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(59, 130, 246, 0.3));
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.btn-studio-action.btn-derby-active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(147, 51, 234, 0.35)) !important;
    border-color: #a855f7 !important;
    color: #f3e8ff !important;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.45) !important;
}

/* Chart Flip Navigation Controls */
.studio-chart-nav-controls {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 2px 5px;
    margin-right: 4px;
}
.btn-chart-flip {
    padding: 3px 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #38bdf8 !important;
    border-radius: 4px !important;
}
.btn-chart-flip:hover {
    background: rgba(56, 189, 248, 0.2) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}
.chart-flipper-deck {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    padding: 1px 3px;
}
.btn-chart-flipper {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    padding: 2px 7px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
    transition: all 0.15s ease !important;
}
.btn-chart-flipper:hover {
    background: rgba(168, 85, 247, 0.25) !important;
    border-color: #a855f7 !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3) !important;
}
.btn-chart-flipper:active {
    transform: scale(0.95);
}
.chart-nav-pos-pill {
    font-family: var(--font-mono, monospace);
    font-size: 10.5px;
    font-weight: 800;
    color: #fbbf24;
    padding: 2px 8px;
    letter-spacing: 0.05em;
    user-select: none;
    white-space: nowrap;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.chart-nav-pos-pill:hover {
    background: rgba(251, 191, 36, 0.18) !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}
.btn-send-to-studio {
    transition: all var(--transition-fast);
}
.btn-send-to-studio:hover {
    background: rgba(59, 130, 246, 0.35) !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3) !important;
}

/* ==========================================================================
   SEARCH, COMPARE & PRESETS COMMAND DOCK
   ========================================================================== */
.studio-command-dock {
    background: rgba(16, 21, 36, 0.8);
    border-bottom: 1px solid var(--palette-border);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.command-search-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    max-width: none;
}

.search-input-box,
.search-input-box.unified-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0 9px;
    height: 30px;
    width: 230px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.search-input-box:hover,
.search-input-box:focus-within {
    border-color: rgba(226, 192, 113, 0.55);
    background: rgba(226, 192, 113, 0.05);
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.18);
}
.search-icon-symbol {
    font-size: 12px;
    margin-right: 7px;
    opacity: 0.7;
}
.search-input-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    letter-spacing: 0.04em;
}
.search-input-box input::placeholder {
    color: #94a3b8;
    font-weight: 500;
    text-transform: none;
}

.compare-input-box {
    display: none;
}

/* Clear X Buttons inside Search Boxes */
.input-clear-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    opacity: 0.75;
    flex-shrink: 0;
}
.input-clear-btn:hover {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.45);
    opacity: 1;
}

/* Active Comparison Chips Container */
.active-compare-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-grow: 1;
}

.compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    user-select: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.compare-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.chip-ticker-symbol {
    color: #ffffff;
}
.chip-close {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    margin-left: 2px;
    transition: color var(--transition-fast);
}
.chip-close:hover {
    color: #ef4444;
}

/* Command Dock Quick Filters: Category & Issuer (Compact & Monochromatic) */
.dock-filters-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.dock-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    height: 30px;
    padding: 0 8px;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.dock-select-wrapper:hover,
.dock-select-wrapper:focus-within {
    border-color: rgba(226, 192, 113, 0.55);
    background: rgba(226, 192, 113, 0.06);
    box-shadow: 0 0 10px rgba(226, 192, 113, 0.18);
}
.dock-select-wrapper.has-active-filter {
    border-color: #e2c071;
    background: rgba(226, 192, 113, 0.12);
}
.dock-select {
    background: transparent;
    border: none;
    outline: none;
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding-right: 4px;
    max-width: 145px;
    transition: color 0.15s ease;
}
.dock-select-wrapper:hover .dock-select,
.dock-select-wrapper:focus-within .dock-select,
.dock-select-wrapper.has-active-filter .dock-select {
    color: #e2c071;
}
.dock-select option {
    background: #0f1422;
    color: #f1f5f9;
    font-weight: 500;
}

/* Presets Bar (Monochromatic Apple-Style Text Navigation) */
.presets-group {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding-left: 2px;
}
.presets-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-right: 2px;
    user-select: none;
}
.preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 2px;
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.01em;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #e2e8f0;
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease, text-shadow 0.15s ease;
    user-select: none;
    outline: none;
}
.preset-btn:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #e2c071;
    text-shadow: 0 0 10px rgba(226, 192, 113, 0.45);
}
.preset-btn:active {
    color: rgba(226, 192, 113, 0.85);
    transform: translateY(0.5px);
}
.preset-btn.active,
.preset-btn.is-active {
    color: #e2c071;
    font-weight: 700;
}
.preset-btn.active::after,
.preset-btn.is-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 2px;
    right: 2px;
    height: 1.5px;
    background: #e2c071;
    box-shadow: 0 0 6px rgba(226, 192, 113, 0.5);
    border-radius: 1px;
}
.preset-separator {
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    user-select: none;
    pointer-events: none;
}
.preset-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
    user-select: none;
    outline: none;
}
.preset-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    transform: scale(1.1);
}
.preset-clear-btn:active {
    transform: scale(0.95);
}

/* Immortals Dropdown Popover Menu */
.preset-dropdown-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.immortals-popover-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #090e1a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 1200;
    min-width: 230px;
    padding: 5px;
    backdrop-filter: blur(16px);
}
.immortals-menu-choice {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: #f1f5f9;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
    user-select: none;
}
.immortals-menu-choice:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2c071;
}
.immortals-menu-choice.is-active {
    background: rgba(226, 192, 113, 0.14);
    color: #e2c071;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 44px;
    left: 0;
    width: 280px;
    max-height: 320px;
    overflow-y: auto;
    background: #111728;
    border: 1px solid var(--palette-border-hover);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
}
.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--transition-fast);
}
.autocomplete-item:hover, .autocomplete-item.selected {
    background: rgba(226, 192, 113, 0.14);
}
.ac-ticker {
    font-weight: 800;
    color: #e2c071;
    font-family: var(--font-mono);
}
.ac-name {
    font-size: 11px;
    color: var(--text-secondary);
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   MODULAR PALETTE GRID SYSTEM
   ========================================================================== */
.studio-main-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 8px 16px 40px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Standard Modular Palette Container */
.palette {
    background: var(--palette-bg);
    border: 1px solid var(--palette-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), height var(--transition-normal);
    display: flex;
    flex-direction: column;
}
.palette:hover {
    border-color: var(--palette-border-hover);
}

/* Palette Header */
.palette-header {
    background: rgba(20, 24, 40, 0.75);
    border-bottom: 1px solid var(--palette-border);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    user-select: none;
    cursor: grab;
}
.palette-header:active {
    cursor: grabbing;
}
.palette-header button,
.palette-header input,
.palette-header select,
.palette-header a,
.palette-header .details-ticker-tabs,
.palette-header .tr-range-presets {
    cursor: auto;
}

/* Palette Drag Handle */
.palette-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #64748b);
    font-size: 13px;
    cursor: grab;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
    user-select: none;
    margin-right: 2px;
    line-height: 1;
    letter-spacing: -1px;
}
.palette-drag-handle:hover {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.2);
}
.palette-drag-handle:active {
    cursor: grabbing;
}

/* Dragging and Drop Target States */
.palette.is-palette-dragging {
    opacity: 0.4;
    border: 2px dashed #c084fc !important;
    box-shadow: 0 0 24px rgba(192, 132, 252, 0.5) !important;
    cursor: grabbing !important;
}

.palette.palette-drop-target {
    border: 2px solid #38bdf8 !important;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.55) !important;
    transform: scale(1.008);
    transition: transform 0.15s ease, border-color 0.15s ease;
    position: relative;
}
.palette.palette-drop-target::after {
    content: "⇄ DROP TO SWAP";
    position: absolute;
    top: 8px;
    right: 12px;
    background: #0284c7;
    color: #ffffff;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 100;
}

/* Swap Success Flash Animation */
@keyframes paletteSwapGlow {
    0% { box-shadow: 0 0 32px rgba(52, 211, 153, 0.9); border-color: #34d399; }
    100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); border-color: var(--palette-border); }
}
.palette.palette-swapped-flash,
.studio-row-split.palette-swapped-flash > .palette,
.studio-row-performance.palette-swapped-flash > .palette {
    animation: paletteSwapGlow 0.6s ease-out;
}

/* Row Swap Action Buttons */
.btn-row-swap {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.btn-row-swap:hover {
    background: rgba(226, 192, 113, 0.15);
    color: #e2c071;
    border-color: rgba(226, 192, 113, 0.45);
}

.palette-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.palette-icon {
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.palette-title {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.palette-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.03em;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    line-height: 1.3;
}

#studio-tr-range-tag {
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 2px 7px;
    background: rgba(226, 192, 113, 0.08);
    border: 1px solid rgba(226, 192, 113, 0.3);
    color: #e2c071;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 270px;
}

/* Timeline Range Presets in Total Return Header */
.tr-range-presets {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-range-preset {
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 10px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-range-preset:hover {
    background: rgba(226, 192, 113, 0.12);
    color: #e2c071;
    border-color: rgba(226, 192, 113, 0.5);
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.22);
}

.btn-range-preset.active,
#btn-preset-low-high.active,
#btn-preset-high-low.active,
#btn-preset-calendar.active {
    background: rgba(226, 192, 113, 0.2);
    color: #e2c071;
    border-color: #e2c071;
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.25);
    font-weight: 800;
}
.btn-range-preset svg {
    display: inline-block;
    vertical-align: middle;
    stroke: currentColor;
    flex-shrink: 0;
    transition: stroke 0.15s ease;
}
.btn-range-preset:hover svg,
.btn-range-preset.active svg {
    stroke: #e2c071;
}

/* Palette Window Tweet Grab Icon Button (Page / Card with 𝕏) */
.btn-palette-tweet svg {
    display: block;
    transition: transform 0.18s ease;
}
.btn-palette-tweet:hover svg {
    transform: scale(1.08);
}

/* Floating Calendar Date Punch-In Popover */
.studio-calendar-popover {
    position: fixed;
    z-index: 9999;
    background: #0d1117;
    border: 1px solid rgba(226, 192, 113, 0.4);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(226, 192, 113, 0.15);
    border-radius: var(--radius-md, 8px);
    width: 290px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: calFadeIn 0.15s ease-out;
}

@keyframes calFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.cal-pop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.cal-pop-title {
    font-size: 12px;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-pop-close {
    background: transparent;
    border: none;
    color: var(--text-muted, #64748b);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
}
.cal-pop-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.cal-pop-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cal-pop-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-pop-field label {
    font-size: 9.5px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cal-date-input {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    color: #f8fafc;
    padding: 5px 8px;
    font-size: 12px;
    font-family: var(--font-mono, monospace);
    width: 100%;
    outline: none;
    transition: border-color 0.15s ease;
}
.cal-date-input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.35);
}

.cal-pop-shortcuts {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.cal-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.cal-chip:hover {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.4);
}

.cal-pop-preview {
    font-size: 10px;
    color: #34d399;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    min-height: 14px;
}

.cal-pop-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
}

.btn-cal-action {
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-cal-clear {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}
.btn-cal-clear:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
}

.btn-cal-apply {
    background: #9333ea;
    border: 1px solid #a855f7;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.4);
}
.btn-cal-apply:hover {
    background: #a855f7;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.6);
}

body.streamer-mode .btn-range-preset {
    font-size: 12px;
    padding: 4px 11px;
    border-width: 1.5px;
}

body.streamer-mode .palette-drag-handle {
    font-size: 16px;
    padding: 3px 6px;
}

body.streamer-mode .studio-calendar-popover {
    width: 320px;
    padding: 14px;
}

body.streamer-mode .cal-date-input {
    font-size: 13px;
    padding: 7px 10px;
}

/* Header Controls Toolbar */
.palette-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Directional Swap Arrows */
.palette-dir-arrows {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 1px;
    gap: 1px;
}

.btn-dir-arrow {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 10px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s ease;
    padding: 0;
    user-select: none;
}

.btn-dir-arrow:hover {
    background: rgba(226, 192, 113, 0.15);
    color: #e2c071;
    transform: scale(1.12);
}

.btn-dir-arrow:active {
    transform: scale(0.92);
}

/* View Switcher: Chart ⇄ List */
.btn-view-switch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 9px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-view-switch:hover {
    background: rgba(226, 192, 113, 0.12);
    border-color: rgba(226, 192, 113, 0.5);
    color: #e2c071;
    box-shadow: 0 0 10px rgba(226, 192, 113, 0.2);
}

.btn-view-switch.active-list,
.btn-view-switch.active-dist,
.btn-view-switch.active-slide {
    background: rgba(226, 192, 113, 0.18);
    border-color: #e2c071;
    color: #e2c071;
}

.btn-view-switch.active-list:hover,
.btn-view-switch.active-dist:hover,
.btn-view-switch.active-slide:hover {
    background: rgba(226, 192, 113, 0.25);
    border-color: #e2c071;
    color: #e2c071;
}

.view-switch-icon {
    font-size: 12px;
    line-height: 1;
}

/* 3-Way Size Control Switch: [ — ] [ ▣ ] [ ⛶ ] */
.palette-size-controls {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 2px;
    gap: 1px;
}

.size-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    width: 24px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.size-btn:hover {
    color: #e2c071;
    background: rgba(226, 192, 113, 0.1);
}
.size-btn.active {
    background: rgba(226, 192, 113, 0.2);
    color: #e2c071;
    font-weight: 800;
}

/* Palette Body */
.palette-body {
    padding: 8px 12px;
    flex-grow: 1;
    transition: opacity var(--transition-fast);
}

/* 3-State Sizing Behavior */
.palette[data-size="minimized"] .palette-body {
    display: none !important;
}
.palette[data-size="minimized"] {
    height: auto !important;
}

.palette[data-size="expanded"] {
    grid-column: 1 / -1 !important;
    min-height: 500px;
}

.palette[data-size="expanded"] .chart-canvas-wrapper,
.palette[data-size="expanded"] .chart-list-wrapper,
.palette[data-size="expanded"] .chart-dist-wrapper,
.palette[data-size="expanded"] .chart-slide-wrapper {
    height: 520px;
}


/* ==========================================================================
   ROW 1: TWO-COLUMN MAIN STUDIO (CHART & DETAILS SIDEBAR)
   ========================================================================== */
.studio-row-split {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 10px;
    align-items: stretch;
}

.studio-row-split.swapped-cols,
.studio-row-split:has(> #palette-details:first-child) {
    grid-template-columns: 340px 1fr;
}

@media (max-width: 1200px) {
    .studio-row-split,
    .studio-row-split.swapped-cols,
    .studio-row-split:has(> #palette-details:first-child) {
        grid-template-columns: 1fr;
    }
}

/* Palette 1: Chart Studio */
.chart-palette {
    display: flex;
    flex-direction: column;
}

.chart-controls-deck {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.studio-select {
    background: #0f1422;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    height: 26px;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.studio-select:hover, .studio-select:focus {
    border-color: rgba(226, 192, 113, 0.5);
    color: #e2c071;
    box-shadow: 0 0 8px rgba(226, 192, 113, 0.15);
}

.chart-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 310px;
}

.chart-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Dual-Pane Split Screen Mode */
.chart-canvas-wrapper.split-mode-active {
    display: flex !important;
    flex-direction: row;
    gap: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.chart-split-pane {
    position: relative;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart-split-pane-left {
    flex: 1 1 100%;
    width: 100%;
}

.chart-canvas-wrapper.split-mode-active .chart-split-pane-left {
    flex: 1 1 50%;
    width: 50%;
    border-right: 2px solid rgba(56, 189, 248, 0.3);
}

.chart-canvas-wrapper.split-mode-active .chart-split-pane-right {
    flex: 1 1 50%;
    width: 50%;
    background: rgba(10, 15, 29, 0.6);
}

.chart-split-canvas-box {
    flex: 1 1 auto;
    position: relative;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.chart-canvas-wrapper.split-mode-active .chart-split-canvas-box {
    height: calc(100% - 32px);
}

.chart-split-canvas-box canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* On-Screen Watermark Navigation Arrows for Chart Flipping (Fully Transparent) */
.chart-screen-watermark-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 70px;
    border-radius: 8px;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    z-index: 12;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    padding: 0;
}

.chart-screen-watermark-arrow.arrow-left {
    left: 6px;
}

.chart-screen-watermark-arrow.arrow-right {
    right: 6px;
}

.chart-screen-watermark-arrow .watermark-arrow-symbol {
    font-size: 36px;
    line-height: 1;
    font-weight: 200;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transform: translateY(-2px);
    transition: transform 0.18s ease, color 0.18s ease, filter 0.18s ease;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}

.chart-screen-watermark-arrow.arrow-left:hover .watermark-arrow-symbol {
    transform: translateY(-2px) translateX(-3px);
}

.chart-screen-watermark-arrow.arrow-right:hover .watermark-arrow-symbol {
    transform: translateY(-2px) translateX(3px);
}

.chart-screen-watermark-arrow:hover {
    background: transparent !important;
    border: none !important;
    color: #e2c071;
    box-shadow: none !important;
    transform: translateY(-50%) scale(1.12);
}

.chart-screen-watermark-arrow:hover .watermark-arrow-symbol {
    color: #e2c071;
    filter: drop-shadow(0 0 10px rgba(226, 192, 113, 0.75));
}

.chart-screen-watermark-arrow:active {
    transform: translateY(-50%) scale(0.92);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.chart-screen-watermark-arrow:active .watermark-arrow-symbol {
    color: #ffffff;
}

/* ==========================================================================
   ON-SCREEN LEFT-CORNER WATERMARK FOR LIST POSITION (e.g. 20th, 19th, 18th)
   ========================================================================== */
.chart-corner-watermark {
    position: absolute;
    left: 20px;
    bottom: 42px;
    z-index: 10;
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.watermark-place-row {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    line-height: 1;
}

.watermark-place-ordinal {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: rgba(255, 255, 255, 0.26);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
    line-height: 1;
}

.watermark-place-total {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.17);
    line-height: 1;
}

.watermark-place-context {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 10px;
    font-weight: 800;
    color: rgba(226, 192, 113, 0.45);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 3px;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

body.streamer-mode .watermark-place-ordinal {
    font-size: 40px;
    color: rgba(255, 255, 255, 0.34);
}
body.streamer-mode .watermark-place-total {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.22);
}
body.streamer-mode .watermark-place-context {
    font-size: 11px;
    color: rgba(226, 192, 113, 0.58);
}

/* On-Screen Floating Button to Clear Custom Range Selection */
.chart-clear-range-floating-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 25;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 192, 113, 0.45);
    border-radius: 14px;
    color: #f1f5f9;
    font-family: var(--font-heading, -apple-system, system-ui, sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(226, 192, 113, 0.15);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    outline: none;
    animation: fadeInFloating 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-clear-range-floating-btn:hover {
    background: rgba(226, 192, 113, 0.2);
    border-color: #e2c071;
    color: #e2c071;
    box-shadow: 0 4px 20px rgba(226, 192, 113, 0.45);
    transform: translateY(-1px);
}

.chart-clear-range-floating-btn:active {
    transform: translateY(0.5px) scale(0.97);
}

.chart-clear-range-floating-btn .clear-range-x {
    font-size: 12px;
    font-weight: 900;
    color: #e2c071;
    transition: transform 0.18s ease;
}

.chart-clear-range-floating-btn:hover .clear-range-x {
    transform: rotate(90deg);
}

@keyframes fadeInFloating {
    0% {
        opacity: 0;
        transform: translateY(-4px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


.palette-title-area .chart-nav-pos-pill {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
}

.chart-list-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.chart-list-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.08) !important;
}

.chart-split-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 10px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    height: 32px;
    box-sizing: border-box;
    user-select: none;
}

.chart-split-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-split-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.chart-split-dot.dot-primary {
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
}

.chart-split-dot.dot-secondary {
    background: #c084fc;
    box-shadow: 0 0 6px #c084fc;
}

.chart-split-label {
    font-weight: 700;
    color: #e2e8f0;
    font-size: 11px;
}

.chart-split-badge {
    font-size: 10px;
    font-weight: 700;
    font-family: monospace;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-split-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.split-timeframe-select, .split-metric-select {
    background: #0b1120 !important;
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    color: #e9d5ff !important;
    font-weight: 700 !important;
    padding: 1px 6px !important;
    font-size: 11px !important;
    border-radius: 4px !important;
    height: 24px !important;
    cursor: pointer;
}

.split-timeframe-select:focus, .split-metric-select:focus {
    border-color: #c084fc !important;
    outline: none;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.35);
}

.btn-split-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s ease;
}

.btn-split-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.btn-split-primary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.18s ease;
    height: 24px;
    line-height: 1;
    user-select: none;
}

.btn-split-primary-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.chart-split-pane-left .btn-split-primary-toggle.is-active-primary {
    background: rgba(56, 189, 248, 0.22) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4) !important;
    cursor: default;
}

.chart-split-pane-right .btn-split-primary-toggle.is-active-primary {
    background: rgba(192, 132, 252, 0.22) !important;
    border-color: #c084fc !important;
    color: #c084fc !important;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.4) !important;
    cursor: default;
}

.btn-split-primary-toggle .primary-star {
    font-size: 11px;
    line-height: 1;
}

.chart-split-pane-header.pane-is-primary {
    background: rgba(15, 23, 42, 0.98);
}

.btn-split-toggle.active {
    background: rgba(56, 189, 248, 0.2) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35) !important;
}

/* Chart Palette: List View Mode (Same dimensions as Chart Canvas) */
.chart-list-wrapper {
    position: relative;
    width: 100%;
    height: 310px;
    display: flex;
    flex-direction: column;
    background: #0d121f;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-list-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.chart-list-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-list-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.chart-list-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.chart-list-tab.active {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

.chart-list-subbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-list-range-pill {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.chart-list-search {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #f8fafc;
    font-size: 11px;
    padding: 3px 8px;
    width: 140px;
    outline: none;
    transition: border-color 0.15s, width 0.2s;
}

.chart-list-search:focus {
    border-color: #38bdf8;
    width: 180px;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.chart-list-table-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    position: relative;
}

.chart-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
}

.chart-list-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #131b2e;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-list-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.12s ease;
    cursor: pointer;
}

.chart-list-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

.chart-list-table tbody tr.is-primary-row {
    background: rgba(245, 158, 11, 0.07);
    border-left: 2px solid #f59e0b;
}

.chart-list-table tbody tr.is-bench-row {
    background: rgba(234, 179, 8, 0.05);
}

.chart-list-table td {
    padding: 5px 10px;
    vertical-align: middle;
}

.chart-list-ticker-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #38bdf8;
}

.chart-list-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.chart-list-action-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #ffffff;
    border-color: #3b82f6;
}

.chart-list-action-btn.btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: #ef4444;
}

.chart-list-action-btn.btn-open-chart {
    background: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
}

.chart-list-action-btn.btn-open-chart:hover {
    background: rgba(56, 189, 248, 0.28) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35) !important;
}

.chart-list-table .cherry-icon {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.6));
    animation: cherryBounce 2s ease-in-out infinite;
}

/* ==========================================================================
   Chart Palette: Distribution Studio Mode (Same dimensions as Chart Canvas)
   ========================================================================== */
.chart-dist-wrapper {
    position: relative;
    width: 100%;
    height: 310px;
    display: flex;
    flex-direction: column;
    background: #0d121f;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-dist-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.chart-dist-subbar-left, .chart-dist-subbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chart-dist-label {
    font-size: 9.5px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.chart-dist-funds {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.dist-fund-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 10.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dist-fund-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.dist-fund-pill.active {
    background: #f59e0b;
    color: #0f172a;
    border-color: #f59e0b;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.dist-fund-pill.primary-fund-star::after {
    content: " ★";
    font-size: 9px;
    opacity: 0.9;
}

.chart-dist-search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.chart-dist-search {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #f8fafc;
    font-size: 10.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 6px;
    width: 82px;
    outline: none;
    transition: all 0.15s ease;
    text-transform: uppercase;
}

.chart-dist-search:focus {
    border-color: #fbbf24;
    width: 100px;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}

.chart-dist-btn-sm {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chart-dist-btn-sm:hover {
    background: rgba(251, 191, 36, 0.3);
    color: #ffffff;
}

.chart-dist-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 3px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-dist-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.chart-dist-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.chart-dist-tab.active {
    background: #f59e0b;
    color: #0f172a;
    font-weight: 800;
}

/* Distribution Metric Unit Toggles ($ Cash vs % Payout vs % Annual) */
.chart-dist-unit-toggles {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 3px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-dist-unit-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.chart-dist-unit-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.chart-dist-unit-btn.active {
    background: #10b981; /* Default emerald for % */
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.chart-dist-unit-btn[data-dist-unit="cash"].active {
    background: #f59e0b; /* Warm gold amber for cash */
    color: #0f172a;
}

.chart-dist-unit-btn[data-dist-unit="pct"].active {
    background: #10b981; /* Emerald green for % payout */
    color: #0f172a;
}

.chart-dist-unit-btn[data-dist-unit="annual"].active {
    background: #06b6d4; /* Electric cyan for % annual yield */
    color: #0f172a;
}

.chart-dist-view-toggles {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 3px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-dist-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.chart-dist-toggle-btn.active {
    background: #3b82f6;
    color: #ffffff;
}

.chart-dist-btn-export {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.chart-dist-btn-export:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* Distribution Statistical KPI Ribbon */
.chart-dist-kpi-ribbon {
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(9, 14, 26, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.chart-dist-kpi-ribbon::-webkit-scrollbar {
    display: none;
}

.dist-kpi-card {
    flex: 1 1 0;
    min-width: 85px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 3px 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dist-kpi-title {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 1px;
    white-space: nowrap;
}

.dist-kpi-val-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.dist-kpi-val {
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #f8fafc;
    line-height: 1.1;
}

.dist-kpi-val.highlight-gold {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}

.dist-kpi-val.highlight-emerald {
    color: #34d399;
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.25);
}

.dist-kpi-val.highlight-cyan {
    color: #38bdf8;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.dist-kpi-val.highlight-red {
    color: #f87171;
}

.dist-kpi-sub {
    font-size: 8.5px;
    font-weight: 600;
    color: #94a3b8;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Distribution Main Area */
.chart-dist-main-area {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-dist-chart-pane {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 4px 8px;
}

.chart-dist-chart-pane canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-dist-table-pane {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart-dist-table-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
}

.chart-dist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    white-space: nowrap;
}

.chart-dist-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #131b2e;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-dist-table tbody td {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: #e2e8f0;
}

.chart-dist-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Palette 2: Detailed Fund Metrics Sidebar */
.details-palette {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}
.details-palette .palette-header {
    padding: 6px 10px;
    gap: 6px;
    flex-shrink: 0;
}
.details-palette .palette-title-area {
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
}
.details-palette .palette-title {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.details-palette .palette-toolbar {
    gap: 4px;
    flex-shrink: 0;
}
.details-palette .palette-body {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    padding: 10px 14px;
}

/* Dedicated Ticker Tab Bar inside Details Palette */
.details-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 8px;
    flex-shrink: 0;
}
.details-palette[data-size="minimized"] .details-tabs-bar {
    display: none;
}

.details-ticker-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    flex: 1 1 auto;
    min-width: 0;
    scrollbar-width: none;
}
.details-ticker-tabs::-webkit-scrollbar { display: none; }

.btn-details-finviz {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.btn-details-finviz:hover {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.ticker-tab-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.ticker-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}
.ticker-tab-btn.active {
    background: #2563eb;
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.45);
}
.ticker-tab-btn.is-primary-tab {
    border-color: rgba(251, 191, 36, 0.35);
}
.ticker-tab-btn.is-primary-tab:hover {
    border-color: #fbbf24;
}
.btn-sidebar-make-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.25);
}

/* Metric Rows in Sidebar */
.metric-group-title {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 6px 0 2px 0;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.metric-group-title:first-child {
    margin-top: 0;
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.studio-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 11px;
}
.studio-metric-row:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.metric-lbl {
    color: var(--text-secondary);
    font-weight: 500;
}
.metric-val {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

.custom-beta-input {
    width: 58px;
    height: 18px;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-align: center;
    outline: none;
    transition: all var(--transition-fast);
}
.custom-beta-input:focus {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
}

/* ==========================================================================
   ROW 2: PERFORMANCE & DEEP STATS UNDERNEATH THE CHART
   ========================================================================== */
.studio-row-performance {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 1024px) {
    .studio-row-performance {
        grid-template-columns: 1fr;
    }
}

/* Total Return Multi-Fund Cards Grid */
.total-return-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 8px;
}

.tr-fund-card {
    background: rgba(28, 35, 60, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.tr-fund-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
/* Benchmark Shading in Total Return Summary */
.tr-fund-card.is-benchmark {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.16), rgba(35, 30, 20, 0.65)) !important;
    border: 1.5px solid rgba(234, 179, 8, 0.65) !important;
    box-shadow: 0 0 16px rgba(234, 179, 8, 0.22), inset 0 0 12px rgba(234, 179, 8, 0.05) !important;
}
.tr-fund-card.is-benchmark:hover {
    border-color: #facc15 !important;
    box-shadow: 0 0 22px rgba(234, 179, 8, 0.38), inset 0 0 14px rgba(234, 179, 8, 0.1) !important;
}
.tr-fund-card.is-benchmark .tr-sub-stats {
    border-top-color: rgba(234, 179, 8, 0.25);
}

.bench-tag-yellow {
    font-size: 9px;
    font-weight: 900;
    color: #fef08a;
    background: rgba(234, 179, 8, 0.35);
    border: 1px solid rgba(234, 179, 8, 0.8);
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.06em;
    margin-left: 4px;
    display: inline-block;
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.3);
}

.tr-fund-card.has-cherry {
    border-color: rgba(16, 185, 129, 0.55);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(28, 35, 60, 0.45));
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.15);
}
.tr-fund-card.is-benchmark.has-cherry {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.18), rgba(28, 35, 60, 0.65)) !important;
    border: 1.5px solid #facc15 !important;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.3), 0 0 12px rgba(16, 185, 129, 0.25) !important;
}

.tr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tr-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 11px;
    color: #ffffff;
}
.tr-card-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.tr-card-place-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 800;
    color: #e2c071;
    background: rgba(226, 192, 113, 0.14);
    border: 1px solid rgba(226, 192, 113, 0.35);
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-left: 2px;
}

.tr-card-place-watermark {
    position: absolute;
    right: 8px;
    bottom: -6px;
    font-size: 38px;
    font-weight: 900;
    font-family: var(--font-mono, monospace);
    color: rgba(255, 255, 255, 0.045);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.tr-winner-crown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: all var(--transition-fast);
}
.tr-winner-crown.winner-cherry {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.15));
    border: 1.5px solid #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}
.tr-leader-icon {
    font-size: 22px;
    line-height: 1;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    vertical-align: middle;
}
body.streamer-mode .tr-leader-icon {
    font-size: 26px;
}
body.streamer-mode .tr-winner-crown {
    padding: 2px 8px;
}

.tr-val-large {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.1;
}

.tr-sub-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    color: var(--text-secondary);
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 5px;
    margin-top: 2px;
}
.tr-sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.35;
}
.tr-sub-val {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

/* Multi-Horizon Returns & Dividends Comparative Table */
.studio-tr-horizons-wrap {
    overflow-x: auto;
    width: 100%;
}
.studio-horizons-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.studio-horizons-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-weight: 700;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 9.5px;
    letter-spacing: 0.04em;
}
.studio-horizons-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    font-family: var(--font-mono);
}
.studio-horizons-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}
.studio-horizons-table tr.is-benchmark td {
    background: rgba(234, 179, 8, 0.08);
}
.horizon-div-pill {
    display: inline-block;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    font-size: 9px;
    color: #facc15;
    font-weight: 700;
    margin-left: 4px;
}

/* Deep Stats Matrix Table */
.deep-stats-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.studio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: left;
}

.studio-table th {
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.studio-table td {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
}
.studio-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   ROW 3: FULL COMPARISON MATRIX TABLE PALETTE
   ========================================================================== */
.comparison-matrix-wrapper {
    overflow-x: auto;
    width: 100%;
    position: relative;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Watermark Overlay for Head-to-Head Comparison Matrix */
.matrix-watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.matrix-col-watermark {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    user-select: none;
    overflow: hidden;
}

.matrix-watermark-inner {
    font-family: var(--font-heading), 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    opacity: 0.10;
    line-height: 1;
    transform: translate3d(0, 0, 0);
    transition: opacity 0.2s ease, transform 0.05s linear;
    will-change: transform;
    text-shadow: 0 0 25px currentColor;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 12px;
    position: relative;
    z-index: 2;
    background: transparent;
}

.matrix-table th {
    padding: 10px 14px;
    background: #111628;
    color: var(--text-secondary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
    position: relative;
    z-index: 5;
}

.matrix-table td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    text-align: right;
}

.matrix-table td:first-child,
.matrix-table th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: #141828;
    z-index: 10;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.matrix-bench-row {
    background: rgba(239, 68, 68, 0.06);
}
.matrix-bench-row td {
    color: #fca5a5;
    border-bottom: 1.5px solid rgba(239, 68, 68, 0.2);
}

.matrix-avg-row {
    background: rgba(245, 158, 11, 0.07);
    font-weight: 800;
}
.matrix-avg-row td {
    color: #fde68a;
    border-top: 2px solid rgba(245, 158, 11, 0.3);
}

.best-in-class-pill {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}

/* ==========================================================================
   ROW 4: DEDICATED ETF SCANNER & SCREENER STUDIO
   ========================================================================== */
.scanner-controls-panel {
    background: rgba(20, 25, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.scanner-presets-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.scanner-preset-chip {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.scanner-preset-chip:hover {
    background: rgba(226, 192, 113, 0.1);
    border-color: rgba(226, 192, 113, 0.4);
    color: #f1f5f9;
}
.scanner-preset-chip.active {
    background: rgba(226, 192, 113, 0.2);
    border-color: #e2c071;
    color: #e2c071;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(226, 192, 113, 0.2);
}

/* Multi-field rule rows */
.rules-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scanner-rule-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(15, 20, 34, 0.6);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.scanner-rule-select {
    background: #0d1220;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #ffffff;
    font-size: 12px;
    padding: 4px 8px;
    outline: none;
}

.scanner-rule-input {
    background: #0d1220;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12px;
    padding: 4px 8px;
    width: 90px;
    outline: none;
}

.btn-rule-remove {
    background: transparent;
    border: none;
    color: var(--color-red);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

/* Progressive Rule Knockout Badges */
.rule-funds-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.32);
    color: #38bdf8;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.rule-funds-count-badge.zero-match {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.rules-eligible-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    transition: all 0.2s ease;
}

.scanner-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.btn-add-rule {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-add-rule:hover {
    background: rgba(226, 192, 113, 0.12);
    border-color: #e2c071;
    color: #e2c071;
}

.btn-export-csv {
    height: 30px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    box-sizing: border-box;
}
.btn-export-csv:hover {
    background: rgba(226, 192, 113, 0.12);
    color: #e2c071;
    border-color: rgba(226, 192, 113, 0.5);
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.22);
}
.btn-export-csv svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.btn-send-to-studio {
    height: 30px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    box-sizing: border-box;
}
.btn-send-to-studio:hover {
    background: rgba(226, 192, 113, 0.12) !important;
    color: #e2c071 !important;
    border-color: rgba(226, 192, 113, 0.5) !important;
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.22) !important;
}
.btn-send-to-studio svg {
    stroke: currentColor;
    flex-shrink: 0;
}

/* Scanner Results Table */
.scanner-results-wrapper {
    overflow-x: auto;
    max-height: 480px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-table-compare {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-table-compare:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* ==========================================================================
   YOUTUBE LIVESTREAM / BROADCAST MODE (.streamer-mode)
   ========================================================================== */
body.streamer-mode {
    font-size: 15px;
}

body.streamer-mode .studio-title-main {
    font-size: 1.3rem;
}

body.streamer-mode .studio-metric-row {
    padding: 7px 0;
    font-size: 14px;
}

body.streamer-mode .metric-val {
    font-size: 15px;
}

body.streamer-mode .tr-val-large {
    font-size: 2.1rem;
}

body.streamer-mode .studio-table th,
body.streamer-mode .matrix-table th {
    font-size: 13px;
    padding: 12px 16px;
}

body.streamer-mode .studio-table td,
body.streamer-mode .matrix-table td {
    font-size: 14px;
    padding: 11px 16px;
}

body.streamer-mode .chart-canvas-wrapper,
body.streamer-mode .chart-list-wrapper,
body.streamer-mode .chart-dist-wrapper {
    height: 520px;
}

/* Toast Notification */
.studio-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.studio-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   BENCHMARK CLEAR BUTTON STYLES
   ========================================================================== */
.studio-bench-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.bench-clear-btn {
    position: absolute;
    right: 18px;
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    border-radius: 50%;
    font-size: 8.5px;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
    z-index: 2;
}
.bench-clear-btn:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    transform: scale(1.1);
}

.tr-card-remove-bench {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
}
.tr-card-remove-bench:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* ==========================================================================
   VIRAL TWEET & SOCIAL POSTING STUDIO STYLES
   ========================================================================== */
.btn-palette-tweet {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-palette-tweet:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}
.palette-tweet-x {
    font-weight: 900;
    font-size: 11px;
    font-family: system-ui, -apple-system, sans-serif;
}

.btn-tweet-studio {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}
.btn-tweet-studio:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.25) !important;
}

/* Modal Backdrop */
.tweet-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(8, 12, 24, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: tweetFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tweetFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.tweet-modal-container {
    width: 95%;
    max-width: 1060px;
    max-height: 92vh;
    background: #0b1120;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(59, 130, 246, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.tweet-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}
.tweet-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tweet-x-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.tweet-header-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}
.tweet-header-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}
.tweet-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tweet-source-badge {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    font-family: var(--font-mono);
}
.btn-tweet-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.btn-tweet-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Body */
.tweet-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tweet-source-bar,
.tweet-tone-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.tweet-bar-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    flex-shrink: 0;
}
.tweet-source-pills,
.tweet-tone-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-grow: 1;
}
.tweet-source-pill,
.tweet-tone-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tweet-source-pill:hover,
.tweet-tone-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}
.tweet-source-pill.active {
    background: #2563eb;
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.tweet-tone-pill[data-tone="reality"].active {
    background: #dc2626;
    border-color: #f87171;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}
.tweet-tone-pill[data-tone="quant"].active {
    background: #7c3aed;
    border-color: #a78bfa;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}
.tweet-tone-pill[data-tone="money"].active {
    background: #059669;
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
}
.tweet-tone-pill[data-tone="yieldtrap"].active {
    background: #d97706;
    border-color: #fbbf24;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}
.tweet-tone-pill[data-tone="thread"].active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
}

.btn-tweet-regen {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.btn-tweet-regen:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

/* Grid: Editor & Preview */
.tweet-studio-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 16px;
    flex: 1;
    min-height: 360px;
}

/* Composer Col */
.tweet-composer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tweet-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tweet-editor-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.tweet-char-indicator {
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #10b981;
}
.tweet-char-indicator.over-limit {
    color: #ef4444;
}

.tweet-textarea {
    width: 100%;
    flex: 1;
    min-height: 240px;
    background: #060a14;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px 14px;
    color: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    resize: none;
    box-sizing: border-box;
}
.tweet-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.tweet-quick-tags-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0;
}
.tweet-tags-scroll {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.tweet-tag-chip {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: all 0.12s ease;
}
.tweet-tag-chip:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #ffffff;
}

/* Preview Col */
.tweet-preview-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tweet-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tweet-preview-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.tweet-preview-sub {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}
.tweet-card-canvas-container {
    width: 100%;
    flex: 1;
    min-height: 240px;
    background: #040711;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-sizing: border-box;
}
.tweet-card-canvas-container canvas {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.tweet-preview-actions {
    display: flex;
    gap: 8px;
}
.btn-tweet-sub-action {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}
.btn-tweet-sub-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

@keyframes tweetSpin {
    to { transform: rotate(360deg); }
}

/* Footer */
.tweet-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}
.tweet-footer-left {
    max-width: 55%;
}
.tweet-footer-tip {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}
.tweet-footer-tip strong {
    color: #e2e8f0;
}
.tweet-footer-right {
    display: flex;
    gap: 10px;
    align-items: center;
}
.btn-tweet-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-tweet-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}
.btn-tweet-primary {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    transition: all 0.15s ease;
}
.btn-tweet-primary:hover {
    background: #111827;
    border-color: #ffffff;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

/* Tweet Studio Options Strip */
.tweet-options-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.tweet-option-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 4px 9px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    user-select: none;
    transition: all 0.15s ease;
}
.tweet-option-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
.tweet-option-toggle input[type="checkbox"] {
    display: none;
}
.tweet-toggle-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    color: transparent;
    transition: all 0.15s ease;
}
.tweet-option-toggle input[type="checkbox"]:checked + .tweet-toggle-box {
    background: #3b82f6;
    border-color: #60a5fa;
    color: #ffffff;
}
.tweet-option-toggle:has(input[type="checkbox"]:checked) {
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.1);
}

/* Post to X Guided Step Overlay */
.tweet-guide-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: rgba(4, 7, 16, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: tweetFadeIn 0.2s ease;
}
.tweet-guide-card {
    width: 100%;
    max-width: 540px;
    background: #0b1120;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
}
.tweet-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.tweet-guide-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-size: 11px;
    font-weight: 800;
    border-radius: 20px;
    letter-spacing: 0.5px;
}
.btn-guide-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}
.btn-guide-close:hover {
    color: #ffffff;
}
.tweet-guide-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
}
.tweet-guide-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 18px;
}
.tweet-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.guide-step-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}
.guide-step-card.step-highlighted {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.35);
}
.guide-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.guide-step-card.step-highlighted .guide-step-num {
    background: #38bdf8;
    color: #000000;
}
.guide-step-heading {
    font-size: 13.5px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 3px;
}
.guide-step-desc {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}
.guide-step-desc strong {
    color: #38bdf8;
}
.tweet-guide-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.btn-guide-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-guide-action:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}
.btn-guide-primary {
    background: #3b82f6;
    border: 1px solid #60a5fa;
    color: #ffffff;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-guide-primary:hover {
    background: #2563eb;
}

/* Tweet Drag Hint Pill */
.tweet-drag-hint-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    user-select: none;
}
.tweet-drag-hint-pill strong {
    color: #38bdf8;
}

/* Tweet Attach Callout in Footer */
.tweet-attach-callout {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11.5px;
    color: #fde68a;
    line-height: 1.35;
}
.tweet-attach-callout strong {
    color: #f59e0b;
}

#tweet-social-img-drag:hover {
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}


/* ==========================================================================
   STUDIO SETTINGS MENU SYSTEM (GLASSMORPHIC WITH TRANSLUCENT WORDS)
   ========================================================================== */
.studio-settings-menu-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.btn-studio-settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    box-sizing: border-box;
    flex-shrink: 0;
}

.btn-studio-settings:hover,
.btn-studio-settings.active {
    background: rgba(226, 192, 113, 0.14);
    border-color: rgba(226, 192, 113, 0.5);
    color: #e2c071;
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.22);
}

.btn-studio-settings .settings-sprocket-svg {
    display: block;
    stroke: currentColor;
    transition: transform 0.25s ease, stroke 0.18s ease;
}

.btn-studio-settings:hover .settings-sprocket-svg,
.btn-studio-settings.active .settings-sprocket-svg {
    transform: rotate(90deg);
    stroke: #e2c071;
}

.btn-studio-settings.active[data-tooltip]::after,
.btn-studio-action.active[data-tooltip]::after {
    display: none !important;
}

/* Glassmorphic Dropdown Panel (Right-Aligned in Topbar, Scrollable) */
.studio-settings-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 250px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    background: rgba(10, 15, 30, 0.96);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 6px 0;
    z-index: 9999;
    display: none;
    transform-origin: top right;
    animation: settingsMenuFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-settings-dropdown.show {
    display: block;
}

@keyframes settingsMenuFade {
    0% {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.settings-menu-section-title {
    padding: 6px 14px 4px 14px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.35);
}

.settings-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 4px 0;
}

/* Menu items with transparent words */
.settings-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-heading, system-ui, sans-serif);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.14s ease;
    user-select: none;
    box-sizing: border-box;
}

.settings-menu-item:hover {
    color: #e2c071;
    background: rgba(226, 192, 113, 0.1);
    padding-left: 16px;
    text-shadow: 0 0 10px rgba(226, 192, 113, 0.3);
}

.settings-item-main {
    display: flex;
    align-items: center;
    gap: 9px;
}

.settings-item-icon {
    font-size: 13px;
    opacity: 0.85;
    width: 16px;
    display: inline-flex;
    justify-content: center;
}

.settings-item-icon.tweet-x-icon {
    font-weight: 900;
    font-size: 13px;
    font-family: system-ui, -apple-system, sans-serif;
    color: #f1f5f9;
}

.settings-item-text {
    font-weight: 600;
}

.settings-item-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: all 0.16s ease;
}

.settings-menu-item:hover .settings-item-badge {
    background: rgba(226, 192, 113, 0.16);
    color: #e2c071;
    border-color: rgba(226, 192, 113, 0.45);
}

.settings-item-arrow {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}
.settings-menu-item:hover .settings-item-arrow {
    color: #e2c071;
}

/* Settings Theme Swatches & Options */
.theme-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}
.theme-check-mark {
    font-size: 11px;
    font-weight: 900;
    color: #e2c071;
}
.settings-theme-item.active {
    background: rgba(226, 192, 113, 0.08);
    color: #ffffff;
}
.settings-theme-item.active .theme-check-mark {
    display: inline-block !important;
}

/* ==========================================================================
   THREE COLOR SCHEMES / THEMES
   ========================================================================== */
/* 1. Midnight Obsidian (Default) */
body.theme-midnight {
    --studio-bg: #0b0f19;
    --palette-bg: #141828;
    --palette-bg-hover: #192035;
    --palette-surface: #1c233c;
    --palette-border: rgba(255, 255, 255, 0.08);
    --palette-border-hover: rgba(255, 255, 255, 0.18);
    --palette-border-accent: rgba(99, 102, 241, 0.4);
    --color-purple: #a855f7;
    --color-purple-glow: rgba(168, 85, 247, 0.15);
    --color-blue: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
}

/* 2. Bloomberg Terminal Amber */
body.theme-bloomberg {
    --studio-bg: #030304;
    --palette-bg: #0c0d11;
    --palette-bg-hover: #14161d;
    --palette-surface: #181b24;
    --palette-border: rgba(245, 158, 11, 0.22);
    --palette-border-hover: rgba(245, 158, 11, 0.45);
    --palette-border-accent: rgba(245, 158, 11, 0.75);
    --color-purple: #f59e0b;
    --color-purple-glow: rgba(245, 158, 11, 0.25);
    --color-blue: #fbbf24;
    --text-primary: #fffdf5;
    --text-secondary: #d4a755;
    --text-muted: #8c734b;
}
body.theme-bloomberg .studio-navbar {
    background: rgba(3, 3, 4, 0.94);
    border-bottom: 1px solid rgba(245, 158, 11, 0.28);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
}
body.theme-bloomberg .palette {
    background: #0c0d11;
    border-color: rgba(245, 158, 11, 0.22);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}
body.theme-bloomberg .palette-header {
    background: rgba(18, 20, 27, 0.85);
    border-bottom-color: rgba(245, 158, 11, 0.22);
}
body.theme-bloomberg .studio-settings-dropdown {
    background: #0c0d11;
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 16px rgba(245, 158, 11, 0.15);
}
body.theme-bloomberg .settings-menu-item:hover {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}
body.theme-bloomberg .theme-check-mark {
    color: #f59e0b;
}
body.theme-bloomberg .stats-master-table thead th,
body.theme-bloomberg #studio-scanner-table thead th {
    background: #0a0b0e;
    border-bottom-color: rgba(245, 158, 11, 0.3);
}
body.theme-bloomberg .kpi-pill-eligible {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}
body.theme-bloomberg .kpi-pill-eligible .kpi-pill-label {
    color: #fde68a;
}
body.theme-bloomberg .kpi-pill-eligible .kpi-pill-val {
    color: #fbbf24;
}
body.theme-bloomberg .rule-funds-count-badge,
body.theme-bloomberg .rules-eligible-badge {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}
body.theme-bloomberg .matrix-watermark-inner {
    opacity: 0.12;
    color: #fbbf24 !important;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.45);
}

/* 3. Cyber Emerald */
body.theme-emerald {
    --studio-bg: #020f0d;
    --palette-bg: #061915;
    --palette-bg-hover: #0b2621;
    --palette-surface: #10332c;
    --palette-border: rgba(16, 185, 129, 0.22);
    --palette-border-hover: rgba(16, 185, 129, 0.45);
    --palette-border-accent: rgba(16, 185, 129, 0.75);
    --color-purple: #10b981;
    --color-purple-glow: rgba(16, 185, 129, 0.25);
    --color-blue: #06b6d4;
    --text-primary: #f0fdf4;
    --text-secondary: #6ee7b7;
    --text-muted: #347d6a;
}
body.theme-emerald .studio-navbar {
    background: rgba(2, 15, 13, 0.94);
    border-bottom: 1px solid rgba(16, 185, 129, 0.28);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}
body.theme-emerald .palette {
    background: #061915;
    border-color: rgba(16, 185, 129, 0.22);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}
body.theme-emerald .palette-header {
    background: rgba(10, 32, 27, 0.85);
    border-bottom-color: rgba(16, 185, 129, 0.22);
}
body.theme-emerald .studio-settings-dropdown {
    background: #061915;
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 16px rgba(16, 185, 129, 0.15);
}
body.theme-emerald .settings-menu-item:hover {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}
body.theme-emerald .theme-check-mark {
    color: #10b981;
}
body.theme-emerald .stats-master-table thead th,
body.theme-emerald #studio-scanner-table thead th {
    background: #041210;
    border-bottom-color: rgba(16, 185, 129, 0.3);
}
body.theme-emerald .kpi-pill-eligible {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}
body.theme-emerald .kpi-pill-eligible .kpi-pill-label {
    color: #a7f3d0;
}
body.theme-emerald .kpi-pill-eligible .kpi-pill-val {
    color: #34d399;
}
body.theme-emerald .rule-funds-count-badge,
body.theme-emerald .rules-eligible-badge {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}
body.theme-emerald .matrix-watermark-inner {
    opacity: 0.12;
    color: #34d399 !important;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   PERFORMANCE & STATISTICS MASTER GRID PALETTE (#palette-statistics)
   ========================================================================== */
#palette-statistics {
    border-color: rgba(56, 189, 248, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.stats-view-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.35);
    padding: 3px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-stats-tab {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-family: var(--font-heading, system-ui, sans-serif);
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 10px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.16s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-sizing: border-box;
}

.btn-stats-tab:hover {
    color: #e2c071;
    background: rgba(226, 192, 113, 0.12);
}

.btn-stats-tab.active {
    background: rgba(226, 192, 113, 0.2);
    border-color: #e2c071;
    color: #e2c071;
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.25);
    font-weight: 800;
}

/* Search & Presets Toolbar */
.stats-toolbar-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(13, 18, 32, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.stats-search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 320px;
    max-width: 100%;
}

.stats-search-icon {
    position: absolute;
    left: 10px;
    font-size: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

#stats-grid-search {
    width: 100%;
    height: 32px;
    padding: 0 30px 0 32px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm, 6px);
    color: #ffffff;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#stats-grid-search:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

#stats-grid-clear {
    position: absolute;
    right: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
#stats-grid-clear:hover {
    background: #ef4444;
}

.stats-presets-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.stats-preset-chip {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
}

.stats-preset-chip:hover {
    background: rgba(226, 192, 113, 0.1);
    border-color: rgba(226, 192, 113, 0.4);
    color: #f1f5f9;
}

.stats-preset-chip.active {
    background: rgba(226, 192, 113, 0.2);
    border-color: #e2c071;
    color: #e2c071;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(226, 192, 113, 0.2);
}

/* Scroll Navigation Indicator / Hint */
.scroll-navigation-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill, 9999px);
    padding: 3px 10px;
    user-select: none;
    margin-left: auto;
    cursor: help;
    transition: all 0.2s ease;
}

.scroll-navigation-hint:hover {
    color: #e2c071;
    border-color: rgba(226, 192, 113, 0.4);
    background: rgba(226, 192, 113, 0.1);
}

.scroll-hint-icon {
    color: #38bdf8;
    font-size: 12px;
    font-weight: 800;
}

/* Master Table Wrapper */
.stats-table-wrapper {
    position: relative;
    max-height: 520px;
    overflow: hidden; /* Default: completely inert so window scrolls at 100% full hardware speed! */
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.stats-table-wrapper.ticker-scroll-active {
    overflow-y: auto !important; /* Unlocks vertical scroll when hovering over the tickers column */
    overflow-x: hidden !important;
}

.stats-table-wrapper.horizontal-scroll-active {
    overflow-x: auto !important; /* Unlocks horizontal scroll when cursor is over horizontal scrollbar track */
    overflow-y: hidden !important;
}

.stats-master-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.stats-master-table thead th,
#studio-scanner-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #090d1a;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 9px 12px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    transition: color 0.15s, background-color 0.15s;
}

.stats-master-table thead th:hover {
    color: #ffffff;
    background: #111827;
}

.stats-master-table thead th.sort-asc::after,
#studio-scanner-table thead th.sort-asc::after {
    content: ' ▲';
    color: #e2c071;
    font-size: 9px;
}

.stats-master-table thead th.sort-desc::after,
#studio-scanner-table thead th.sort-desc::after {
    content: ' ▼';
    color: #e2c071;
    font-size: 9px;
}

#studio-scanner-table thead th:hover {
    color: #ffffff;
    background: #111827;
}

#studio-scanner-table th:first-child,
#studio-scanner-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #0b0f19;
    min-width: 96px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.35);
}

#studio-scanner-table thead th:first-child {
    z-index: 15;
    background: #090d1a;
}

#studio-scanner-table tbody tr:hover td:first-child {
    background: #141824;
}

/* Sticky First Column: Ticker */
.stats-master-table .sticky-col-ticker {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #0b0f19;
    min-width: 96px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.35);
}

.stats-master-table thead th.sticky-col-ticker {
    z-index: 15;
    background: #090d1a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.35);
}

.stats-master-table tbody tr {
    transition: background-color 0.12s ease;
    cursor: pointer;
}

.stats-master-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.stats-master-table tbody tr:hover .sticky-col-ticker {
    background: #141824;
}

.stats-master-table tbody tr.row-selected {
    background: rgba(226, 192, 113, 0.12);
}

.stats-master-table tbody tr.row-selected .sticky-col-ticker {
    background: #1f1b14;
}

.btn-stats-quick-add {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 800;
    width: 17px;
    height: 17px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all var(--transition-fast);
}
.btn-stats-quick-add:hover {
    background: rgba(226, 192, 113, 0.2);
    color: #e2c071;
    border-color: #e2c071;
    box-shadow: 0 0 8px rgba(226, 192, 113, 0.35);
    transform: scale(1.08);
}

.stats-master-table td {
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    font-family: var(--font-mono, monospace);
}

.stats-cell-pos {
    color: #34d399 !important;
    font-weight: 700;
}

.stats-cell-neg {
    color: #f87171 !important;
    font-weight: 700;
}

.stats-div-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(226, 192, 113, 0.1);
    border: 1px solid rgba(226, 192, 113, 0.25);
    color: #e2c071;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    letter-spacing: 0.2px;
}

.btn-stats-primary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.14s ease;
}
.btn-stats-primary:hover {
    background: rgba(226, 192, 113, 0.2);
    color: #e2c071;
    border-color: #e2c071;
    box-shadow: 0 0 8px rgba(226, 192, 113, 0.35);
}

.btn-stats-compare {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.14s ease;
}
.btn-stats-compare:hover {
    background: rgba(226, 192, 113, 0.2);
    color: #e2c071;
    border-color: #e2c071;
    box-shadow: 0 0 8px rgba(226, 192, 113, 0.35);
}

/* Streamer Mode overrides for Statistics Palette */
body.streamer-mode .stats-master-table {
    font-size: 13.5px;
}
body.streamer-mode .stats-master-table thead th {
    font-size: 12px;
    padding: 11px 14px;
}
body.streamer-mode .stats-master-table td {
    padding: 10px 14px;
}
body.streamer-mode .stats-table-wrapper {
    max-height: 640px;
}

/* ==========================================================================
   Saved Filter Presets System (Save, Manage, 1-Click Apply, Notes & Themes)
   ========================================================================== */

/* Quick Presets Bar: Divider & Saved Chips Bar */
.presets-bar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.16);
    margin: 0 4px;
    align-self: center;
}

.presets-bar-saved-label {
    font-size: 11px;
    font-weight: 700;
    color: #c084fc;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.scanner-saved-chips-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.scanner-saved-preset-chip {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #e9d5ff;
    border-radius: 9999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.scanner-saved-preset-chip:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.scanner-saved-preset-chip.active {
    background: #9333ea;
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.45);
}

.scanner-saved-preset-chip .chip-fund-count {
    font-size: 9.5px;
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 5px;
    border-radius: 9999px;
}

/* Saved Chip Wrapper & Hover Tooltip Showing Notes */
.scanner-saved-chip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.preset-hover-tooltip {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    background: #0d1322;
    border: 1px solid rgba(168, 85, 247, 0.45);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.85), 0 0 16px rgba(168, 85, 247, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 240px;
    max-width: 340px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 10000;
    white-space: normal;
    text-align: left;
}

.preset-hover-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 24px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #0d1322 transparent;
}

.scanner-saved-chip-wrapper:hover .preset-hover-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.preset-tooltip-title {
    font-size: 12px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.preset-tooltip-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
    line-height: 1.35;
}

.preset-tooltip-notes {
    font-size: 11px;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.8);
    border-left: 2px solid #c084fc;
    padding: 5px 8px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: pre-wrap;
    margin-bottom: 6px;
}

.preset-tooltip-notes-header {
    font-weight: 700;
    color: #c084fc;
    font-size: 9.5px;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.preset-tooltip-hint {
    font-size: 9.5px;
    color: #c084fc;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Scanner Footer Actions Buttons */
.btn-save-preset {
    background: rgba(168, 85, 247, 0.14) !important;
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    color: #c084fc !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700 !important;
}

.btn-save-preset:hover {
    background: rgba(168, 85, 247, 0.28) !important;
    border-color: rgba(168, 85, 247, 0.8) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
    transform: translateY(-1px);
}

.btn-manage-presets {
    background: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    color: #38bdf8 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700 !important;
}

.btn-manage-presets:hover {
    background: rgba(56, 189, 248, 0.24) !important;
    border-color: rgba(56, 189, 248, 0.75) !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}

/* Preset Modal Backdrop & Containers */
.preset-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(7, 11, 22, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: presetFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes presetFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.preset-modal-container {
    width: 100%;
    background: #0d1322;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.88), 0 0 45px rgba(168, 85, 247, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 92vh;
}

.preset-modal-container.save-preset-dialog {
    max-width: 620px;
}

.preset-modal-container.manage-presets-dialog {
    max-width: 880px;
}

.preset-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.preset-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preset-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.preset-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
    letter-spacing: -0.01em;
}

.preset-modal-subtitle {
    font-size: 11.5px;
    color: var(--text-muted, #94a3b8);
    margin: 2px 0 0 0;
}

.preset-header-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

.btn-preset-modal-close {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.btn-preset-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.preset-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Form Styling */
.preset-active-summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
}

.preset-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.preset-summary-title {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #94a3b8);
}

.preset-summary-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

.preset-rules-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preset-rule-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.preset-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preset-form-label {
    font-size: 12px;
    font-weight: 700;
    color: #f1f5f9;
}

.preset-form-help {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
}

.preset-form-input, .preset-form-textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #f8fafc;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.preset-form-input:focus, .preset-form-textarea:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.preset-form-textarea {
    resize: vertical;
    line-height: 1.5;
}

.preset-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.btn-preset-primary {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    border: 1px solid #c084fc;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(147, 51, 234, 0.35);
    transition: all 0.15s ease;
}

.btn-preset-primary:hover {
    background: linear-gradient(135deg, #a855f7, #9333ea);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(147, 51, 234, 0.45);
}

.btn-preset-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-preset-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.btn-preset-utility {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-preset-utility:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Preset Cards Manager */
.preset-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preset-search-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: #f8fafc;
    font-family: inherit;
}

.preset-search-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.btn-save-new-from-manager {
    white-space: nowrap;
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.35);
    background: rgba(168, 85, 247, 0.1);
}

.btn-save-new-from-manager:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.6);
    color: #e9d5ff;
}

.saved-presets-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 56vh;
    overflow-y: auto;
    padding-right: 4px;
}

.saved-preset-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.15s ease;
}

.saved-preset-card:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.saved-preset-card.is-active-preset {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.06);
}

.saved-preset-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.saved-preset-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.saved-preset-card-name {
    font-size: 15px;
    font-weight: 800;
    color: #f8fafc;
}

.saved-preset-card-meta {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
}

.saved-preset-card-desc {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.4;
}

.saved-preset-notes-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid #c084fc;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.45;
    white-space: pre-wrap;
}

.saved-preset-notes-label {
    font-weight: 700;
    color: #c084fc;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.saved-preset-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-card-apply {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    border: 1px solid #60a5fa;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-card-apply:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-1px);
}

.btn-card-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-card-delete {
    color: #f87171;
}

.btn-card-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.saved-presets-empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted, #94a3b8);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Themes: Bloomberg Terminal Amber Overrides
   -------------------------------------------------------------------------- */
body.theme-bloomberg .preset-modal-container {
    background: #090a0d;
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.95), 0 0 45px rgba(245, 158, 11, 0.18);
}
body.theme-bloomberg .preset-header-icon {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: #fbbf24 !important;
}
body.theme-bloomberg .presets-bar-saved-label {
    color: #fbbf24;
}
body.theme-bloomberg .scanner-saved-preset-chip {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fde68a;
}
body.theme-bloomberg .scanner-saved-preset-chip:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.6);
}
body.theme-bloomberg .scanner-saved-preset-chip.active {
    background: #d97706;
    border-color: #fbbf24;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}
body.theme-bloomberg .btn-save-preset {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
}
body.theme-bloomberg .btn-save-preset:hover {
    background: rgba(245, 158, 11, 0.3) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}
body.theme-bloomberg .btn-manage-presets {
    border-color: rgba(245, 158, 11, 0.35) !important;
}
body.theme-bloomberg .btn-preset-primary {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: #fbbf24;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}
body.theme-bloomberg .btn-preset-primary:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
body.theme-bloomberg .preset-form-input:focus,
body.theme-bloomberg .preset-form-textarea:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
body.theme-bloomberg .saved-preset-notes-box {
    border-left-color: #fbbf24;
}
body.theme-bloomberg .saved-preset-notes-label {
    color: #fbbf24;
}
body.theme-bloomberg .saved-preset-card.is-active-preset {
    border-color: #fbbf24;
    background: rgba(245, 158, 11, 0.08);
}
body.theme-bloomberg .preset-hover-tooltip {
    background: #090a0d;
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.95), 0 0 16px rgba(245, 158, 11, 0.2);
}
body.theme-bloomberg .preset-hover-tooltip::after {
    border-color: transparent transparent #090a0d transparent;
}
body.theme-bloomberg .preset-tooltip-notes {
    background: rgba(18, 19, 24, 0.9);
    border-left-color: #fbbf24;
}
body.theme-bloomberg .preset-tooltip-notes-header,
body.theme-bloomberg .preset-tooltip-hint {
    color: #fbbf24;
}

/* --------------------------------------------------------------------------
   Themes: Cyber Emerald Overrides
   -------------------------------------------------------------------------- */
body.theme-emerald .preset-modal-container {
    background: #041411;
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.95), 0 0 45px rgba(16, 185, 129, 0.18);
}
body.theme-emerald .preset-header-icon {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
}
body.theme-emerald .presets-bar-saved-label {
    color: #34d399;
}
body.theme-emerald .scanner-saved-preset-chip {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}
body.theme-emerald .scanner-saved-preset-chip:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.6);
}
body.theme-emerald .scanner-saved-preset-chip.active {
    background: #059669;
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}
body.theme-emerald .btn-save-preset {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
    color: #34d399 !important;
}
body.theme-emerald .btn-save-preset:hover {
    background: rgba(16, 185, 129, 0.3) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}
body.theme-emerald .btn-manage-presets {
    border-color: rgba(16, 185, 129, 0.35) !important;
}
body.theme-emerald .btn-preset-primary {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}
body.theme-emerald .btn-preset-primary:hover {
    background: linear-gradient(135deg, #10b981, #059669);
}
body.theme-emerald .preset-form-input:focus,
body.theme-emerald .preset-form-textarea:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
body.theme-emerald .saved-preset-notes-box {
    border-left-color: #34d399;
}
body.theme-emerald .saved-preset-notes-label {
    color: #34d399;
}
body.theme-emerald .saved-preset-card.is-active-preset {
    border-color: #34d399;
    background: rgba(16, 185, 129, 0.08);
}
body.theme-emerald .preset-hover-tooltip {
    background: #041411;
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.95), 0 0 16px rgba(16, 185, 129, 0.2);
}
body.theme-emerald .preset-hover-tooltip::after {
    border-color: transparent transparent #041411 transparent;
}
body.theme-emerald .preset-tooltip-notes {
    background: rgba(6, 25, 21, 0.9);
    border-left-color: #34d399;
}
body.theme-emerald .preset-tooltip-notes-header,
body.theme-emerald .preset-tooltip-hint {
    color: #34d399;
}

/* Custom CSV Export Column Selector Styles */
.export-col-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 10px 12px;
}

.export-col-group-title {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.export-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
}

.export-col-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 11.5px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.export-col-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.export-col-chip input[type="checkbox"] {
    accent-color: #10b981;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* ==========================================================================
   PALETTE 8: ISSUER RANKINGS & FAMILY INTELLIGENCE
   ========================================================================== */
#palette-issuer-rankings {
    grid-column: 1 / -1 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
}

#palette-issuer-rankings .palette-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.issuer-view-toggles {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.issuer-view-btn {
    height: 30px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-sizing: border-box;
}

.issuer-view-btn:hover {
    color: #e2c071;
    background: rgba(226, 192, 113, 0.12);
    border-color: rgba(226, 192, 113, 0.45);
}

.issuer-view-btn.active {
    background: rgba(226, 192, 113, 0.2);
    border-color: #e2c071;
    color: #e2c071;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.25);
}

.issuer-view-btn svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.issuer-filter-chips {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.issuer-chip {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.issuer-chip:hover {
    color: #f1f5f9;
    background: rgba(226, 192, 113, 0.1);
    border-color: rgba(226, 192, 113, 0.4);
}

.issuer-chip.active {
    color: #e2c071;
    background: rgba(226, 192, 113, 0.2);
    border-color: #e2c071;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(226, 192, 113, 0.25);
}

/* Orientation Toggles */
.issuer-orient-toggles {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
    height: 30px;
    box-sizing: border-box;
}

.btn-orient-toggle {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    padding: 0 8px;
    height: 100%;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-orient-toggle:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.btn-orient-toggle.active {
    background: rgba(226, 192, 113, 0.2);
    color: #e2c071;
    border-color: #e2c071;
    font-weight: 800;
}

/* Issuer KPI Ribbon (Compact for single-screen view) */
.issuer-kpi-ribbon {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.issuer-kpi-ribbon::-webkit-scrollbar {
    display: none;
}

.issuer-kpi-card {
    flex: 1 1 0;
    min-width: 105px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.issuer-kpi-title {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 1px;
    white-space: nowrap;
}

.issuer-kpi-val {
    font-size: 13px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #f8fafc;
    line-height: 1.15;
}

.issuer-kpi-sub {
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Area & View Panes */
.issuer-main-area {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.issuer-pane {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    animation: fadeIn 0.2s ease-in-out;
}

.issuer-pane#issuer-chart-pane {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow-y: hidden; /* Default: completely inert so window scrolls at 100% full hardware speed! */
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.issuer-pane#issuer-chart-pane.ticker-scroll-active {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.issuer-pane#issuer-chart-pane::-webkit-scrollbar {
    width: 6px;
}
.issuer-pane#issuer-chart-pane::-webkit-scrollbar-track {
    background: transparent;
}
.issuer-pane#issuer-chart-pane::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.issuer-pane#issuer-chart-pane::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Heatmap Grid */
.issuer-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.issuer-legend-label {
    font-size: 9px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.issuer-legend-bar {
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #450a0a 0%, #7c2d12 25%, #1e3a5f 50%, #105a34 75%, #05785a 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.issuer-legend-hint {
    font-size: 10.5px;
    color: #64748b;
    margin-left: auto;
}

.issuer-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: 880px;
    overflow-y: auto;
    padding: 2px;
}

.issuer-tile {
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.issuer-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.issuer-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.issuer-tile-rank {
    font-size: 9.5px;
    font-weight: 800;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 5px;
    border-radius: 4px;
}

.issuer-tile-name {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issuer-tile-count {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.issuer-tile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px;
    border-radius: 6px;
}

.issuer-tile-stat {
    display: flex;
    flex-direction: column;
}

.issuer-stat-lbl {
    font-size: 8px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

.issuer-stat-val {
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #f8fafc;
}

/* Leaderboard Table */
.issuer-table-scroll {
    max-height: 880px;
    overflow: hidden; /* Default: completely inert so window scrolls at 100% full hardware speed! */
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.issuer-table-scroll.ticker-scroll-active {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.issuer-table-scroll.horizontal-scroll-active {
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.issuer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    white-space: nowrap;
}

.issuer-table th {
    cursor: pointer;
    user-select: none;
    background: #0f172a;
    position: sticky;
    top: 0;
    z-index: 10;
}

.issuer-table th:hover {
    color: #fbbf24;
}

.issuer-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.issuer-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.issuer-rank-pill {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.issuer-rank-pill.rank-top3 {
    background: #f59e0b;
    color: #0f172a;
}

.issuer-action-btn {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.issuer-action-btn:hover {
    background: rgba(56, 189, 248, 0.28);
    color: #ffffff;
}

/* Streamer Mode Overrides */
body.streamer-mode #palette-issuer-rankings .issuer-kpi-val {
    font-size: 16px;
}
body.streamer-mode #palette-issuer-rankings .issuer-table td {
    font-size: 12.5px;
    padding: 10px 14px;
}

/* Issuer Spotlight Dossier Modal (Broadcast / Multimedia) & Fullscreen Expansion */
.issuer-spotlight-container {
    background: #090e1a !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.95), 0 0 60px rgba(56, 189, 248, 0.15) !important;
    transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), height 0.2s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.2s, max-height 0.2s !important;
}

.issuer-spotlight-container.is-fullscreen {
    position: fixed !important;
    inset: 12px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    height: calc(100vh - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    border-radius: 12px !important;
    margin: 0 !important;
    z-index: 10001 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.98), 0 0 60px rgba(56, 189, 248, 0.3) !important;
}

.issuer-spotlight-container.is-fullscreen .preset-modal-body {
    flex: 1 1 0% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    max-height: none !important;
    padding: 12px 20px !important;
    gap: 10px !important;
}

.issuer-spotlight-container.is-fullscreen .iss-spotlight-kpis {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

.issuer-spotlight-container.is-fullscreen .iss-spotlight-kpis .issuer-kpi-card {
    padding: 6px 12px !important;
}

.issuer-spotlight-container.is-fullscreen .iss-spotlight-kpis .issuer-kpi-val {
    font-size: 18px !important;
    margin: 2px 0 !important;
}

.issuer-spotlight-container.is-fullscreen .iss-spotlight-kpis .issuer-kpi-sub {
    font-size: 9.5px !important;
}

.issuer-spotlight-container.is-fullscreen .iss-spotlight-showdown {
    display: none !important;
}

.issuer-spotlight-container.is-fullscreen .iss-modal-lineup-card {
    flex: 1 1 0% !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.issuer-spotlight-container.is-fullscreen .iss-modal-lineup-scroll {
    flex: 1 1 0% !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
}

.iss-spotlight-kpis .issuer-kpi-card {
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.iss-spotlight-kpis .issuer-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

#iss-modal-table th {
    transition: background 0.15s ease, color 0.15s ease;
}

#iss-modal-table th:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #38bdf8 !important;
}

#iss-modal-table tbody tr {
    transition: background 0.12s ease;
}

#iss-modal-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* --- Frozen / Sticky Company Average Row in Lineup Table --- */
#iss-modal-table tfoot {
    position: sticky;
    bottom: 0;
    z-index: 6;
}

#iss-modal-table tfoot tr {
    background: #0b1322 !important;
}

#iss-modal-table tfoot td {
    position: sticky;
    background: #0b1322 !important;
    z-index: 6;
    font-size: 11.5px;
    user-select: text;
}

/* Single Frozen Mean row */
#iss-modal-table tfoot tr.tfoot-mean td {
    bottom: 0;
    border-top: 2px solid rgba(251, 191, 36, 0.6) !important;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.75);
}

/* Single Frozen Median row */
#iss-modal-table tfoot tr.tfoot-median td {
    bottom: 0;
    border-top: 2px solid rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.75);
}

/* When Both are displayed: Staggered sticky offsets */
#iss-modal-table tfoot tr.tfoot-mean.has-both td {
    bottom: 33px;
    border-top: 2px solid rgba(251, 191, 36, 0.6) !important;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.85);
}

#iss-modal-table tfoot tr.tfoot-median.has-both td {
    bottom: 0;
    border-top: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Segmented Pill Selector for Mean / Median / Both */
.iss-stat-mode-group {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.btn-iss-stat-mode {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1.2;
}

.btn-iss-stat-mode:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.btn-iss-stat-mode.active-mean {
    background: rgba(251, 191, 36, 0.2) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.45) !important;
    font-weight: 800;
}

.btn-iss-stat-mode.active-median {
    background: rgba(56, 189, 248, 0.2) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    font-weight: 800;
}

.btn-iss-stat-mode.active-both {
    background: rgba(168, 85, 247, 0.2) !important;
    color: #c084fc !important;
    border-color: rgba(168, 85, 247, 0.45) !important;
    font-weight: 800;
}

.iss-modal-lineup-scroll {
    max-height: 380px;
}

/* ==========================================================================
   PRESENTATION SLIDE & COUNTDOWN VIEW (BROADCAST QUALITY)
   ========================================================================== */
.chart-slide-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #090e17;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    min-height: 520px;
    box-sizing: border-box;
}

/* Floating Slide Navigation & Controls Bar */
.slide-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    z-index: 10;
}

.slide-controls-left,
.slide-controls-center,
.slide-controls-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.slide-badge-title {
    font-size: 11px;
    font-weight: 800;
    color: #e2c071;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(226, 192, 113, 0.12);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(226, 192, 113, 0.25);
    white-space: nowrap;
}

.slide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.slide-btn:hover {
    background: rgba(226, 192, 113, 0.15);
    border-color: #e2c071;
    color: #e2c071;
}

.slide-btn.btn-chart-link {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
    font-weight: 800;
}

.slide-btn.btn-chart-link:hover {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
}

.slide-jump-select {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    max-width: 170px;
}

.slide-counter-pill {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    padding: 3px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Presentation Canvas Stage */
.presentation-slide-stage {
    position: relative;
    flex: 1;
    padding: 24px 60px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #050811;
}

/* Subtle On-Slide Overlay Navigation Arrows */
.slide-overlay-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    opacity: 0.32;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    user-select: none;
    padding: 0;
}

.slide-overlay-nav-arrow:hover {
    opacity: 0.95;
    background: rgba(30, 58, 138, 0.85);
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.45);
    transform: translateY(-50%) scale(1.1);
}

.slide-overlay-nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.slide-nav-left {
    left: 14px;
}

.slide-nav-right {
    right: 14px;
}

/* The Individual Presentation Slide Frame */
.presentation-slide-deck {
    width: 100%;
    max-width: 1060px;
    border-radius: 16px;
    padding: 28px 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   THEME 1: BROADCAST WHITE (MATCHING DOUG'S YOUTUBE DECK)
   ========================================================================== */
.presentation-slide-deck.theme-broadcast-white {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.theme-broadcast-white .slide-fund-title {
    color: #0f172a;
}

.theme-broadcast-white .slide-report-subtitle {
    color: #2563eb;
}

.theme-broadcast-white .slide-header-stripe {
    background: #2563eb;
}

.theme-broadcast-white .slide-gold-banner {
    background: #ffd000;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.25);
}

.theme-broadcast-white .slide-gold-banner .banner-rank {
    color: #1e3a8a;
}

.theme-broadcast-white .slide-gold-banner .banner-ticker {
    color: #0f172a;
}

.theme-broadcast-white .slide-gold-banner .banner-badge,
.theme-broadcast-white .banner-mf-pill,
.theme-broadcast-white .banner-issuer-pill {
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.theme-broadcast-white .slide-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.theme-broadcast-white .slide-kpi-val {
    color: #1d4ed8;
}

.theme-broadcast-white .slide-kpi-val.positive {
    color: #15803d;
}

.theme-broadcast-white .slide-kpi-val.negative {
    color: #b91c1c;
}

.theme-broadcast-white .slide-kpi-title {
    color: #64748b;
}

.theme-broadcast-white .slide-kpi-sub {
    color: #94a3b8;
}

.theme-broadcast-white .slide-kpi-card-yield .slide-kpi-val-ttm {
    color: #1d4ed8;
}

.theme-broadcast-white .slide-kpi-sec-label {
    color: #475569;
}

.theme-broadcast-white .slide-kpi-sec-val {
    color: #15803d;
}

.theme-broadcast-white .slide-kpi-sec-badge {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.theme-broadcast-white .slide-wallet-income-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.theme-broadcast-white .slide-wallet-icon {
    color: #2563eb;
}

.theme-broadcast-white .income-annual-val {
    color: #1d4ed8;
    font-weight: 800;
}

.theme-broadcast-white .income-monthly-val {
    color: #475569;
}

.theme-broadcast-white .slide-info-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.theme-broadcast-white .slide-section-title {
    color: #0f172a;
}

.theme-broadcast-white .slide-section-icon {
    color: #2563eb;
}

.theme-broadcast-white .slide-bullet-item {
    color: #334155;
}

.theme-broadcast-white .slide-bullet-dot {
    background: #f59e0b;
}

.theme-broadcast-white .slide-footer-bar {
    border-top: 1px solid #f1f5f9;
    color: #94a3b8;
}

/* ==========================================================================
   THEME 2: DARK TERMINAL (HIGH YIELD LAB CYBERPUNK)
   ========================================================================== */
.presentation-slide-deck.theme-dark-terminal {
    background: #0d1424;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-dark-terminal .slide-fund-title {
    color: #f8fafc;
}

.theme-dark-terminal .slide-report-subtitle {
    color: #60a5fa;
}

.theme-dark-terminal .slide-header-stripe {
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

.theme-dark-terminal .slide-gold-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1a1006;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.theme-dark-terminal .slide-gold-banner .banner-rank {
    color: #172554;
}

.theme-dark-terminal .slide-gold-banner .banner-ticker {
    color: #0f172a;
}

.theme-dark-terminal .slide-gold-banner .banner-badge,
.theme-dark-terminal .banner-mf-pill,
.theme-dark-terminal .banner-issuer-pill {
    background: rgba(0, 0, 0, 0.22);
    color: #172554;
}

.theme-dark-terminal .slide-kpi-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-dark-terminal .slide-kpi-val {
    color: #60a5fa;
}

.theme-dark-terminal .slide-kpi-val.positive {
    color: #4ade80;
}

.theme-dark-terminal .slide-kpi-val.negative {
    color: #f87171;
}

.theme-dark-terminal .slide-kpi-title {
    color: #94a3b8;
}

.theme-dark-terminal .slide-kpi-sub {
    color: #64748b;
}

.theme-dark-terminal .slide-kpi-card-yield .slide-kpi-val-ttm {
    color: #60a5fa;
}

.theme-dark-terminal .slide-kpi-sec-label {
    color: #94a3b8;
}

.theme-dark-terminal .slide-kpi-sec-val {
    color: #4ade80;
}

.theme-dark-terminal .slide-kpi-sec-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
}

.theme-dark-terminal .slide-wallet-income-card {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #cbd5e1;
}

.theme-dark-terminal .slide-wallet-icon {
    color: #60a5fa;
}

.theme-dark-terminal .income-annual-val {
    color: #93c5fd;
    font-weight: 800;
}

.theme-dark-terminal .income-monthly-val {
    color: #94a3b8;
}

.theme-dark-terminal .slide-info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-dark-terminal .slide-section-title {
    color: #f8fafc;
}

.theme-dark-terminal .slide-section-icon {
    color: #60a5fa;
}

.theme-dark-terminal .slide-bullet-item {
    color: #cbd5e1;
}

.theme-dark-terminal .slide-bullet-dot {
    background: #fbbf24;
}

.theme-dark-terminal .slide-footer-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #64748b;
}

/* ==========================================================================
   COMMON SLIDE COMPONENT STRUCTURES
   ========================================================================== */
.slide-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
}

.slide-header-stripe {
    width: 8px;
    min-height: 52px;
    border-radius: 4px;
    flex-shrink: 0;
}

.slide-header-text-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

/* Upper Right Corner Fullscreen Button */
.slide-corner-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #1e293b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    align-self: flex-start;
    user-select: none;
    flex-shrink: 0;
}

.slide-corner-fullscreen-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #2563eb;
    color: #2563eb;
    background: #ffffff;
}

.theme-broadcast-white .slide-corner-fullscreen-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.theme-broadcast-white .slide-corner-fullscreen-btn:hover {
    background: #ffffff;
    border-color: #2563eb;
    color: #2563eb;
}

.theme-dark-terminal .slide-corner-fullscreen-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
}

.theme-dark-terminal .slide-corner-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: #60a5fa;
    color: #60a5fa;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.25);
}

.slide-fund-title {
    font-size: 27px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
}

.slide-report-subtitle {
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0;
}

/* Slide 2-Column Grid Layout */
.slide-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.22fr;
    gap: 22px;
    align-items: start;
}

.slide-left-col,
.slide-right-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Gold Ticker Banner */
.slide-gold-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-radius: 12px;
    font-family: inherit;
    flex-wrap: wrap;
    gap: 10px;
}

.banner-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.banner-rank {
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}

.banner-ticker {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.banner-mf-pill {
    font-size: 13px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    background: rgba(0, 0, 0, 0.14);
    color: inherit;
    white-space: nowrap;
}

.banner-delta-pill {
    font-size: 11.5px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.banner-delta-pill.delta-up {
    background: #15803d;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.25);
}

.banner-delta-pill.delta-down {
    background: #b91c1c;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
}

.banner-delta-pill.delta-hold {
    background: #475569;
    color: #f8fafc;
}

.banner-delta-pill.delta-new {
    background: #7c3aed;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.banner-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.banner-issuer-pill {
    font-size: 11.5px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
}

.banner-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* 6 KPI Grid: Row 1 = 3 cards, Row 2 = 3 cards */
.slide-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.slide-kpi-card {
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 92px;
    box-sizing: border-box;
}

.slide-kpi-val {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.slide-kpi-prefix {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.8;
    margin-right: 2px;
    letter-spacing: 0;
}

.slide-kpi-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.slide-kpi-sub {
    font-size: 9.5px;
    font-weight: 600;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slide-kpi-secondary-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.slide-kpi-sec-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.slide-kpi-sec-val {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.slide-kpi-sec-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

/* $100k Hypothetical Income Card */
.slide-wallet-income-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.4;
}

.slide-wallet-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.slide-wallet-text {
    flex: 1;
}

/* Right Column Cards */
.slide-info-card {
    padding: 18px 22px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slide-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    margin: 0;
}

.slide-section-icon {
    font-size: 18px;
}

.slide-bullets-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slide-bullet-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    line-height: 1.45;
}

.slide-bullet-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

/* High Yield Lab Role / Mike's Lab Take Blue Card */
.slide-verdict-card {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    border-radius: 12px;
    padding: 18px 22px;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.3);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.slide-verdict-title {
    font-size: 11.5px;
    font-weight: 900;
    color: #ffd000;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slide-verdict-text {
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.55;
    margin: 0;
    outline: none;
    cursor: text;
    border-radius: 4px;
    padding: 2px 4px;
    transition: background 0.15s ease;
}

.slide-verdict-text:hover,
.slide-verdict-text:focus {
    background: rgba(255, 255, 255, 0.12);
}

.slide-verdict-hint {
    font-size: 9.5px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Slide Footer Bar */
.slide-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    font-size: 10.5px;
    line-height: 1.4;
    gap: 14px;
    flex-wrap: wrap;
}

.slide-footer-disclaimer {
    flex: 1;
    font-style: italic;
}

.slide-footer-brand {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
    white-space: nowrap;
}

.theme-dark-terminal .slide-footer-brand {
    color: #e2c071;
}

/* Responsive adjustment for compact screens */
@media (max-width: 900px) {
    .slide-content-grid {
        grid-template-columns: 1fr;
    }
    .slide-fund-title {
        font-size: 22px;
    }
    .banner-rank {
        font-size: 28px;
    }
    .banner-ticker {
        font-size: 20px;
    }
}

/* ==========================================================================
   FULLSCREEN MODE STYLING (TAKES UP THE WHOLE SCREEN)
   ========================================================================== */
.chart-slide-wrapper.slide-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #040711 !important;
}

.slide-fullscreen-active .slide-control-bar {
    padding: 10px 24px;
    background: rgba(10, 15, 30, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.slide-fullscreen-active .presentation-slide-stage {
    padding: 32px 64px;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 58px);
    overflow-y: auto;
}

.slide-fullscreen-active .presentation-slide-deck {
    max-width: 1520px;
    width: 90vw;
    min-height: 78vh;
    padding: 36px 46px;
    gap: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
}

.slide-fullscreen-active .slide-fund-title {
    font-size: clamp(28px, 2.5vw, 38px);
}

.slide-fullscreen-active .banner-rank {
    font-size: clamp(34px, 3.2vw, 48px);
}

.slide-fullscreen-active .banner-ticker {
    font-size: clamp(24px, 2.3vw, 36px);
}

.slide-fullscreen-active .slide-kpi-val {
    font-size: clamp(22px, 1.9vw, 32px);
}

.slide-fullscreen-active .slide-kpi-sec-label {
    font-size: clamp(12px, 1vw, 15px);
}

.slide-fullscreen-active .slide-kpi-sec-val {
    font-size: clamp(18px, 1.5vw, 24px);
}

.slide-fullscreen-active .slide-kpi-sec-badge {
    font-size: clamp(10px, 0.8vw, 13px);
}

.slide-fullscreen-active .income-annual-val {
    font-size: clamp(24px, 2.1vw, 34px);
}

.slide-fullscreen-active .slide-verdict-text {
    font-size: clamp(14px, 1.1vw, 17px);
}

.slide-fullscreen-active .slide-bullet-item {
    font-size: clamp(13px, 1vw, 15px);
}

.slide-fullscreen-active .slide-overlay-nav-arrow {
    width: 58px;
    height: 58px;
    opacity: 0.42;
}

.slide-fullscreen-active .slide-overlay-nav-arrow:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.12);
}

.slide-fullscreen-active .slide-nav-left {
    left: 24px;
}

.slide-fullscreen-active .slide-nav-right {
    right: 24px;
}


