:root {
    /* Colors */
    --bg-dark: #070708;
    --bg-navy: #0f172a;
    --sidebar-bg: #0c0c0e;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-hover-bg: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.06);
    
    --accent-red: #ff006e;
    --accent-amber: #ffb703;
    --accent-green: #2ecc71;
    --accent-blue: #3b82f6;
    
    --neon-green: #00ffa3;
    --neon-red: #ff4757;
    --neon-blue: #3b82f6;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Fonts */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', 'Fira Code', monospace;
    
    /* Effects */
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Layout Containers */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    height: 100%;
    background: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    z-index: 1100;
}

.main-content {
    flex: 1;
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(255, 0, 110, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05), transparent);
    position: relative;
}

.main-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg opacity="0.05" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none" stroke="white" stroke-width="0.5" stroke-dasharray="2 4"/></svg>');
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.top-bar {
    height: 80px;
    min-height: 80px;
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(7, 7, 8, 0.8);
    backdrop-filter: blur(20px);
    z-index: 1000;
}

/* View Toggling & Scrolling */
.view-container {
    display: none;
    flex: 1;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 80px);
    overflow: hidden;
    position: relative;
}

.view-container.active {
    display: block;
}

/* ── Headers & Typography ────────────────────────────────────────────────── */

.view-header, .section-header {
    margin-bottom: 40px;
}

.view-header h1, .section-header h2 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.view-header h1::before, .section-header h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--accent-red);
    border-radius: 4px;
    box-shadow: 0 0 12px var(--accent-red);
}

.view-header p {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.5px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 32px;
}

/* Removed duplicate section-header h2 definition */

.dashboard-scroll {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px;
    padding-top: 40px;
    box-sizing: border-box;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

/* Dashboard Filter Buttons */
.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.nav-item:hover .icon,
.nav-item.active .icon {
    stroke: var(--accent-red);
}

.nav-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 15px 20px;
}

.filter-btn.active {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

/* Scrollbar Styling */
.dashboard-scroll::-webkit-scrollbar {
    width: 6px;
}

.dashboard-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.dashboard-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Sidebar Components */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent-red);
    text-shadow: 0 0 10px var(--accent-red);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 600;
    margin: 0 -10px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 0, 110, 0.1);
    color: var(--accent-red);
    box-shadow: inset 4px 0 0 var(--accent-red);
}

.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-red), var(--neon-blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.2);
}

.user-info { display: flex; flex-direction: column; gap: 2px; }
.name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
/* Bug #6: HTML uses class="status", CSS only had .status-label — added both */
.status, .status-label { font-size: 11px; color: var(--accent-green); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.status-dot { width: 6px; height: 6px; background: var(--accent-green); border-radius: 50%; }

/* Top Bar Components */
/* Search container (original flex-child sizing) */
.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 16px;
    width: 100%;
    border: 1px solid transparent;
    transition: var(--transition);
}

.search-container:focus-within {
    border-color: var(--accent-red);
}

.search-icon {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
    margin-right: 12px;
}

#ticker-search {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    width: 100%;
}

.top-status {
    display: flex;
    align-items: center;
    gap: 40px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    font-weight: 900;
    color: var(--accent-green);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.market-time { 
    font-size: 10px; 
    font-weight: 500; 
    font-family: var(--font-mono); 
    color: var(--text-secondary); 
    letter-spacing: 2px;
    opacity: 0.8;
}

.pulse {
    width: 14px;
    height: 14px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--accent-green), 0 0 10px var(--accent-green);
    position: relative;
    animation: neon-glow 1.5s infinite ease-in-out;
}

@keyframes neon-glow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px var(--accent-green); }
    50% { transform: scale(1.1); box-shadow: 0 0 35px var(--accent-green); }
}

.pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.8; }
    80%, 100% { transform: scale(2.5); opacity: 0; }
}

/* Cards & Grid */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, opacity 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    background: var(--card-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 15px 45px -12px rgba(0, 0, 0, 0.6);
}

.glass-card.is-dragging {
    opacity: 0.8;
    transform: scale(1.02);
    cursor: grabbing !important;
    z-index: 9999;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8);
    pointer-events: none; /* Allow mousemove to track faster without interference */
}

.card-label {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
}

.card-label::before {
    content: '';
    display: block;
    width: 2px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 1px;
    box-shadow: 0 0 5px var(--accent-red);
}

.hero-section {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 24px;
    margin-bottom: 32px;
}

.hero-card { padding: 32px; display: flex; flex-direction: column; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }

.card-header h3 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3::before {
    content: '';
    display: block;
    width: 3px;
    height: 14px;
    background: var(--accent-red);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent-red);
}
.card-body { flex: 1; display: flex; flex-direction: column; }
.card-footer { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ticker { font-size: 40px; font-weight: 900; }
.company-name { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
.prob-label { font-size: 11px; letter-spacing: 2px; color: var(--text-muted); font-weight: 800; }

/* Signal Breakdown */
.signal-breakdown { margin-top: 24px; }
.breakdown-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.breakdown-header h3.card-label { margin-bottom: 0; }
.confidence-tag { font-size: 9px; font-weight: 800; letter-spacing: 1px; color: var(--accent-green); background: rgba(46, 204, 113, 0.1); border: 1px solid rgba(46, 204, 113, 0.3); padding: 4px 10px; border-radius: 100px; }
.signal-tag { font-size: 10px; font-weight: 700; color: var(--text-muted); background: rgba(255,255,255,0.04); border: 1px solid var(--border); padding: 4px 10px; border-radius: 6px; }

/* Side Feed */
.side-feed { margin-top: 24px; }
.feed-content { display: flex; flex-direction: column; gap: 12px; }
.pulse-red { width: 8px; height: 8px; background: var(--accent-red); border-radius: 50%; animation: pulse 2s infinite; }
.risk-badge { padding: 6px 12px; border-radius: 100px; font-size: 10px; font-weight: 800; }
.risk-badge.high { background: rgba(255, 0, 110, 0.2); color: var(--accent-red); border: 1px solid var(--accent-red); }
.risk-badge.medium { background: rgba(255, 183, 3, 0.2); color: var(--accent-amber); border: 1px solid var(--accent-amber); }
.risk-badge.low { background: rgba(46, 204, 113, 0.2); color: var(--accent-green); border: 1px solid var(--accent-green); }

.prob-number {
    font-size: 80px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--accent-red);
    text-shadow: 0 0 40px rgba(255, 0, 110, 0.3);
    margin: 10px 0;
    text-align: center;
}

.probability-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    margin-top: auto;
}

.stat-item { display: flex; flex-direction: column; }
/* Bug #12: renamed .label → .stat-label to avoid collision with generic .label rules */
.stat-item .stat-label { font-size: 9px; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; white-space: nowrap; }
.stat-item .value { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }

/* Staircase Waterfall */
.waterfall-staircase {
    display: flex;
    height: 180px;
    gap: 6px;
    align-items: flex-end;
    padding: 30px 0 28px 0;
    position: relative;
    overflow: visible;
}

.waterfall-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    height: 100%;
}

.step-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    position: absolute;
    bottom: 0;
    left: 0;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 0, 110, 0.3),
        rgba(255, 0, 110, 0.3) 1px,
        transparent 1px,
        transparent 5px
    );
    border: 1px solid rgba(255, 0, 110, 0.4);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.1);
}

.waterfall-step.baseline .step-bar {
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.1) 1px,
        transparent 1px,
        transparent 5px
    );
    border-color: rgba(255, 255, 255, 0.2);
}

.waterfall-step.final .step-bar {
    background: repeating-linear-gradient(
        45deg,
        rgba(131, 56, 236, 0.4),
        rgba(131, 56, 236, 0.4) 1px,
        transparent 1px,
        transparent 5px
    );
    border-color: rgba(131, 56, 236, 0.5);
    box-shadow: 0 0 15px rgba(131, 56, 236, 0.2);
}

.step-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
    position: absolute;
    bottom: -22px;
}

.step-value {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-primary);
    position: absolute;
    white-space: nowrap;
}

/* Feed Components */
.feed-card { padding: 24px; display: flex; flex-direction: column; }
/* Bug #9: .feed-container was dead — HTML uses .feed-content, defined above. Removed. */
.feed-item { padding: 16px; background: rgba(255, 255, 255, 0.02); border-radius: 12px; border-left: 3px solid var(--accent-red); transition: var(--transition); animation: fadeIn 0.3s ease-out; margin-bottom: 12px; }
.feed-item.high { border-left-color: var(--accent-red); background: rgba(255, 0, 110, 0.04); }
.feed-item.medium { border-left-color: var(--accent-amber); background: rgba(255, 183, 3, 0.03); }
.feed-item.low { border-left-color: var(--accent-green); background: rgba(46, 204, 113, 0.03); }
.feed-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.feed-ticker { font-weight: 900; font-size: 14px; letter-spacing: 1px; }
.feed-time { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.feed-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Grid Sections */
.grid-section { margin-top: 32px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.earnings-table { width: 100%; border-collapse: collapse; }
.earnings-table th { text-align: left; padding: 16px; font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.earnings-table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 13px; }

.action-btn { padding: 6px 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: white; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 700; transition: var(--transition); }
.action-btn:hover { background: var(--accent-red); border-color: var(--accent-red); }

/* Strategy Builder */
.strategy-card { display: flex; flex-direction: column; gap: 20px; }
.strategy-type-toggle { display: flex; background: rgba(255,255,255,0.05); padding: 4px; border-radius: 8px; gap: 4px; }
.type-btn { flex: 1; padding: 8px 6px; background: none; border: none; color: var(--text-muted); font-size: 10px; font-weight: 800; cursor: pointer; border-radius: 6px; white-space: nowrap; letter-spacing: 0.5px; }
.type-btn.active { background: var(--neon-blue); color: white; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-group label { display: block; font-size: 9px; color: var(--text-muted); font-weight: 700; margin-bottom: 6px; letter-spacing: 0.5px; }
.input-group input, .input-group select { background: rgba(0,0,0,0.2); border: 1px solid var(--border); padding: 10px; border-radius: 8px; color: white; width: 100%; font-size: 13px; font-family: var(--font-mono); }
.recommendation-box { background: rgba(59, 130, 246, 0.05); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 12px; padding: 16px; }
.rec-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 6px; }
.rec-title { font-size: 10px; color: var(--neon-blue); font-weight: 800; letter-spacing: 1px; }
.iv-warning { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; }
.rec-content h4 { font-size: 15px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.rec-content p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.rec-stats { display: flex; gap: 20px; margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 12px; }
.rec-stat span:first-child { display: block; font-size: 9px; color: var(--text-muted); font-weight: 700; letter-spacing: 0.5px; margin-bottom: 4px; }
.rec-stat .neon-green { font-size: 18px; font-weight: 900; color: var(--neon-green); font-family: var(--font-mono); }
.rec-stat .neon-red   { font-size: 18px; font-weight: 900; color: var(--neon-red);   font-family: var(--font-mono); }


/* Watchlist & Calendar */
.watchlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.calendar-layout { background: var(--card-bg); border-radius: 20px; border: var(--glass-border); padding: 32px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.calendar-header h2 { 
    font-size: 20px; 
    font-weight: 900; 
    letter-spacing: 1px; 
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-header h2::before {
    content: '';
    display: block;
    width: 3px;
    height: 18px;
    background: var(--accent-red);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-red);
}
.btn-icon { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: white; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.btn-icon:hover { background: var(--accent-red); border-color: var(--accent-red); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.day-label { background: rgba(255,255,255,0.02); padding: 12px; text-align: center; font-size: 10px; font-weight: 800; color: var(--text-muted); letter-spacing: 1px; }
.calendar-day { background: var(--bg-dark); min-height: 140px; padding: 12px; transition: background 0.2s ease; }
.calendar-day:hover { background: rgba(255,255,255,0.02); }
.calendar-day.empty { background: rgba(0, 0, 0, 0.3); opacity: 0.4; }
.day-number { font-size: 12px; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 8px; }
/* Bug #8: all three risk tiers now have distinct styles */
.calendar-event { padding: 6px 10px; margin-top: 6px; font-size: 10px; font-weight: 900; border-radius: 4px; border-left: 3px solid var(--accent-red); background: rgba(255, 0, 110, 0.08); cursor: pointer; transition: transform 0.1s ease; }
.calendar-event:hover { transform: scale(1.02); }
.calendar-event.high { border-left-color: var(--accent-red); background: rgba(255, 0, 110, 0.15); color: #fff; }
.calendar-event.medium { border-left-color: var(--accent-amber); background: rgba(255, 183, 3, 0.1); color: var(--accent-amber); }
.calendar-event.low { border-left-color: var(--accent-green); background: rgba(46, 204, 113, 0.1); color: var(--accent-green); }

/* Toasts */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 9999; }
.toast {
    padding: 16px 24px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent-red);
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 400px;
    line-height: 1.4;
}

.toast.alert { 
    border-left-color: var(--accent-red); 
    background: linear-gradient(90deg, rgba(255, 0, 110, 0.1), rgba(10, 10, 15, 0.95));
    box-shadow: 0 10px 30px rgba(255, 0, 110, 0.15);
}

.toast.warning { 
    border-left-color: var(--accent-amber); 
    background: linear-gradient(90deg, rgba(255, 183, 3, 0.1), rgba(10, 10, 15, 0.95));
    box-shadow: 0 10px 30px rgba(255, 183, 3, 0.15);
}

.toast.success { 
    border-left-color: var(--accent-green); 
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.1), rgba(10, 10, 15, 0.95));
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.15);
}
@keyframes slideIn { from { transform: translateX(120%); } to { transform: translateX(0); } }
.toast.fade-out { animation: fadeOut 0.3s ease-in forwards; }
@keyframes fadeOut { from { transform: translateX(0); } to { transform: translateX(120%); } }

/* Utils */
/* .btn base class — all buttons use class="btn btn-primary/btn-outline" */
.btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border: none; font-family: var(--font-main); font-weight: 800; letter-spacing: 0.5px; transition: var(--transition); }
.btn-primary { background: var(--accent-red); color: white; border: none; padding: 12px 24px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.btn-outline { background: none; border: 1px solid var(--border); color: white; padding: 12px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.btn-outline:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* Global color utilities */
.neon-green { color: var(--neon-green); }
.neon-red   { color: var(--neon-red); }
.red-text   { color: var(--accent-red); }
.high-text  { color: var(--accent-red); text-shadow: 0 0 10px rgba(255, 0, 110, 0.3); }
.medium-text { color: var(--accent-amber); text-shadow: 0 0 10px rgba(255, 183, 3, 0.2); }
.low-text   { color: var(--accent-green); text-shadow: 0 0 10px rgba(46, 204, 113, 0.2); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.font-mono      { font-family: var(--font-mono); }


/* ── Search Autocomplete ──────────────────────────────────────────────────── */

.search-wrapper {
    position: relative;
    width: 400px;
}

.search-wrapper .search-container {
    width: 100%;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(10, 10, 14, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 0, 110, 0.08);
    overflow: hidden;
    z-index: 9000;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height 0.2s ease, opacity 0.18s ease, transform 0.18s ease;
}

.search-dropdown.visible {
    max-height: 380px;
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
    overflow-y: auto;
}

.search-dropdown::-webkit-scrollbar { width: 4px; }
.search-dropdown::-webkit-scrollbar-track { background: transparent; }
.search-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.12s ease;
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover,
.search-result-item.highlighted {
    background: rgba(255, 0, 110, 0.07);
}

.search-result-item.highlighted {
    background: rgba(255, 0, 110, 0.1);
    border-left: 2px solid var(--accent-red);
}

.sri-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sri-ticker {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-primary);
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

.sri-company {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sri-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sri-prob {
    font-size: 15px;
    font-weight: 900;
    font-family: var(--font-mono);
}

.sri-badge {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 7px;
    border-radius: 100px;
}

.sri-badge.high   { background: rgba(255,0,110,0.15);   color: var(--accent-red);   border: 1px solid rgba(255,0,110,0.4); }
.sri-badge.medium { background: rgba(255,183,3,0.12);   color: var(--accent-amber); border: 1px solid rgba(255,183,3,0.4); }
.sri-badge.low    { background: rgba(46,204,113,0.12);  color: var(--accent-green); border: 1px solid rgba(46,204,113,0.4); }

.sri-days {
    font-size: 9px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 600;
    white-space: nowrap;
}

/* Highlighted match text */
.search-result-item mark {
    background: none;
    color: var(--accent-red);
    font-weight: 900;
}

/* Empty state */
.search-empty {
    padding: 20px 18px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.search-empty strong {
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Confirmed flash on input after selection */
@keyframes confirmFlash {
    0%   { border-color: var(--accent-green); box-shadow: 0 0 0 2px rgba(46,204,113,0.3); }
    60%  { border-color: var(--accent-green); box-shadow: 0 0 0 4px rgba(46,204,113,0.15); }
    100% { border-color: transparent; box-shadow: none; }
}

.search-wrapper .search-container:has(#ticker-search.confirmed) {
    animation: confirmFlash 0.7s ease-out forwards;
}

/* Backtest runner adjustments */
.backtest-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 40px; 
    gap: 40px; 
}

.backtest-header h1 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.backtest-header h1::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--accent-red);
    border-radius: 4px;
    box-shadow: 0 0 12px var(--accent-red);
}

.backtest-header p {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.5px;
}

.backtest-controls { display: flex; align-items: flex-end; gap: 16px; background: rgba(255,255,255,0.03); padding: 20px; border-radius: 16px; border: 1px solid var(--border); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.metric-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; }
.metric-label { font-size: 10px; font-weight: 800; color: var(--text-muted); letter-spacing: 1px; }
.metric-value { font-size: 32px; font-weight: 900; font-family: var(--font-mono); }
.metric-subtext { font-size: 11px; color: var(--text-muted); }

.chart-card { height: auto; min-height: 450px; display: flex; flex-direction: column; margin-bottom: 32px; }
.performance-chart-container { flex: 1; position: relative; margin-top: 24px; padding: 32px; background: rgba(0,0,0,0.3); border-radius: 16px; border: 1px solid var(--border); }
.chart-legend { display: flex; gap: 24px; margin-bottom: 24px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.gmp { background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); }
.dot.sp500 { background: var(--text-muted); }

.mock-chart { 
    position: relative; 
    width: 100%; 
    height: 280px; 
    margin-top: 20px; 
    overflow: hidden; 
    border-bottom: 2px solid var(--border); 
    border-left: 2px solid var(--border); 
    background: rgba(0,0,0,0.1);
}

.chart-line-sp500 { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 150%; 
    height: 1px; 
    background: var(--text-secondary); 
    opacity: 0.2; 
    transform: rotate(-15deg); 
    transform-origin: left bottom; 
}

.chart-line-gmp { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 150%; 
    height: 2px; 
    background: var(--accent-red); 
    transform: rotate(-25deg); 
    transform-origin: left bottom; 
    box-shadow: 0 0 20px rgba(255,0,110,0.4); 
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1); 
}

.transparency-section { margin-top: 48px; }
.transparency-section h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.transparency-section h2::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--accent-red);
    border-radius: 2px;
}

.weights-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; margin-top: 24px; }
.weight-item { display: flex; flex-direction: column; gap: 12px; }
.weight-header { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; color: var(--text-secondary); letter-spacing: 0.5px; }
.weight-bar { height: 12px; background: rgba(255,255,255,0.05); border-radius: 100px; overflow: hidden; }
.weight-bar .fill { height: 100%; background: var(--accent-red); border-radius: 100px; box-shadow: 0 0 10px var(--accent-red); }

/* ── Mobile Responsiveness ────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 40px 10px;
        align-items: center;
    }
    .logo-text, .nav-item span, .user-info, .status { display: none; }
    .nav-item { margin: 0; padding: 14px; justify-content: center; width: 44px; height: 44px; }
    .hero-section { grid-template-columns: 1fr; }
    .search-wrapper { width: 100%; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 0 20px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        justify-content: space-between;
    }
    .logo { margin-bottom: 0; }
    .nav-menu { flex-direction: row; gap: 4px; }
    .sidebar-footer { display: none; }
    .main-content { height: calc(100vh - 70px); }
    .top-bar { padding: 0 20px; height: 120px; flex-direction: column; justify-content: center; gap: 15px; }
    .top-status { width: 100%; justify-content: space-between; display: flex; }
    .dashboard-scroll { padding: 20px; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .weights-grid { grid-template-columns: 1fr; }
    .toast { min-width: auto; width: calc(100vw - 40px); }
}
/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.section-header h2 {
    font-size: 24px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2), 0 0 20px var(--accent-red-dim);
}

.section-header h2::before {
    content: '';
    display: block;
    width: 6px;
    height: 28px;
    background: var(--accent-red);
    border-radius: 1px;
    box-shadow: 0 0 25px var(--accent-red), 0 0 10px var(--accent-red);
    animation: neon-pulse 2s infinite ease-in-out;
}

.section-header h2::after {
    content: 'SYS.DIAGNOSTIC_v4.2';
    font-size: 9px;
    color: var(--accent-red);
    font-family: var(--font-mono);
    letter-spacing: 2px;
    background: rgba(255, 0, 110, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 0, 110, 0.2);
    margin-left: 10px;
}

@keyframes neon-pulse {
    0%, 100% { opacity: 1; filter: brightness(1.2); }
    50% { opacity: 0.6; filter: brightness(0.8); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.header-main h2 {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.analysis-card {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.analysis-card.wide {
    grid-column: span 2;
}

.sentiment-gauge {
    height: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 100px;
    margin: 16px 0;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-amber));
    box-shadow: 0 0 15px var(--accent-red);
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
}

.accuracy-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 24px;
    font-weight: 900;
    font-family: var(--font-mono);
}

.stat-desc {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.analysis-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.peer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.peer-item {
    text-align: center;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.peer-ticker {
    display: block;
    font-weight: 900;
    font-size: 12px;
    margin-bottom: 4px;
}

.peer-risk {
    font-size: 9px;
    font-weight: 700;
}

.report-card { max-width: 700px; }
.report-summary { display: flex; flex-direction: column; gap: 24px; }
.report-section h4 { font-size: 11px; font-weight: 800; color: var(--text-muted); margin-bottom: 12px; letter-spacing: 1px; }
.report-section p { font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.report-section ul { padding-left: 20px; color: var(--text-secondary); font-size: 14px; }
.report-section li { margin-bottom: 8px; }
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 20px; background: rgba(0,0,0,0.2); border-radius: 12px; border: 1px solid var(--border); }
.report-stat { display: flex; flex-direction: column; gap: 4px; }
.report-stat .label { font-size: 9px; font-weight: 800; color: var(--text-muted); }
.report-stat .val { font-size: 20px; font-weight: 900; font-family: var(--font-mono); }

.modal-footer {
    margin-top: 32px;
    border-top: 1px solid var(--border);
    padding-top: 32px;
    display: flex;
    justify-content: flex-end;
}

/* Generating State */
.btn-outline.generating {
    background: var(--border);
    color: var(--text-muted);
    cursor: wait;
    position: relative;
    overflow: hidden;
}

.btn-outline.generating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    to { transform: translateX(100%); }
}

/* ── Payment System (Strategic Premium) ────────────────────────────────── */
.pay-card { max-width: 500px; padding: 40px; }
.pricing-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.pricing-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(45deg, #ff006e, #ffb703);
    color: white;
    font-size: 9px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 20px;
}

.price-header {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 20px;
}

.price-header .currency { font-size: 24px; font-weight: 400; color: var(--text-secondary); }
.price-header .amount { font-size: 56px; font-weight: 900; letter-spacing: -2px; }
.price-header .period { font-size: 14px; color: var(--text-muted); }

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.check-icon {
    width: 16px;
    height: 16px;
    stroke: var(--accent-green);
    stroke-width: 3;
    fill: none;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.pay-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-family: var(--font-mono);
    font-size: 14px;
    outline: none;
}

.pay-input:focus { border-color: var(--accent-red); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-green);
    color: white;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleUp {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.gradient-text {
    background: linear-gradient(45deg, #ff006e, #ffb703);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

/* ── User Display (Top Bar) ──────────────────────────────────────────────── */
.user-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.user-display:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-red);
}

.user-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.user-name {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-green);
    letter-spacing: 0.5px;
}

/* ── Profile View ───────────────────────────────────────────────────────── */
.profile-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 24px;
    margin-top: 20px;
}

.profile-main {
    padding: 40px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent-red), var(--neon-blue));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 900;
    color: white;
    box-shadow: 0 15px 45px rgba(255, 0, 110, 0.3);
}

.profile-title h2 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.profile-email {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 14px;
}

.tier-badge {
    margin-left: auto;
    padding: 8px 16px;
    background: rgba(46, 204, 113, 0.1);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 2px;
}

.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-group label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

.detail-val {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.tier-card {
    padding: 32px;
}

.current-tier-info {
    margin-bottom: 32px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.tier-name {
    display: block;
    font-size: 18px;
    font-weight: 900;
    color: var(--accent-red);
    margin-bottom: 4px;
}

.tier-price {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.benefit-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.benefit-list li {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.benefit-list li::before {
    content: '✓';
    color: var(--accent-green);
    font-weight: 900;
}

.btn-block {
    width: 100%;
}

/* ── Command Center (Refined Design Signature) ──────────────────────────── */
.command-grid {
    display: grid;
    grid-template-columns: 320px 1fr 300px;
    gap: 24px;
    margin-top: 24px;
    height: calc(100vh - 200px);
}

.command-pane {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pane-intel .pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.pane-matrix {
    display: flex;
    flex-direction: column;
}

.matrix-viz-container {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#command-matrix-canvas {
    width: 100%;
    height: 100%;
}

.matrix-header-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.target-id label { font-size: 9px; color: var(--text-muted); font-weight: 800; letter-spacing: 1px; }
.target-id h2 { font-size: 24px; font-weight: 900; color: white; }

.confidence-meter { text-align: right; }
.meter-ring { font-size: 20px; font-weight: 900; color: var(--accent-green); }
.confidence-meter label { font-size: 9px; color: var(--text-muted); font-weight: 800; }

.matrix-ui-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glitch-data {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-red);
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
}

.scanline {
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(255, 0, 110, 0.02) 50%);
    background-size: 100% 4px;
    z-index: 5;
}

/* Intel Feed Refinement */
.pane-intel .pane-content {
    display: flex;
    flex-direction: column;
}

.intel-entry {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 16px;
    transition: var(--transition);
}

.intel-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.intel-tag {
    font-size: 10px;
    font-weight: 900;
    color: var(--accent-red);
    text-align: center;
    padding: 4px 0;
    border: 1px solid rgba(255, 0, 110, 0.3);
    border-radius: 4px;
    height: fit-content;
    font-family: var(--font-mono);
}

.intel-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 6px;
}

.intel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.intel-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.intel-source {
    font-size: 9px;
    font-weight: 800;
    color: var(--accent-blue);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Monte Carlo Refinement */
.monte-carlo-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mc-scenario {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.mc-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.mc-value {
    font-size: 14px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.mc-value.red { color: var(--accent-red); }
.mc-value.green { color: var(--accent-green); }

/* Sentiment Container Refinement */
.sentiment-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sentiment-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 6px;
    border-left: 2px solid var(--accent-red);
}

/* --- Premium Profile & Subscription --- */
.identity-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.pricing-card-new {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    cursor: default;
}

.pricing-card-new:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.pricing-card-new.featured {
    background: rgba(255, 0, 110, 0.02);
}

.pricing-card-new.featured:hover {
    background: rgba(255, 0, 110, 0.04);
}

.sovereign-glow {
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.2);
    animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.pricing-header-new h3 {
    letter-spacing: 2px;
    font-weight: 800;
}

.pricing-body-new li {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.pricing-body-new li span {
    font-weight: 900;
}

/* Elite Intelligence Center Interactivity */
.clickable-intel {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clickable-intel:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateX(5px);
    box-shadow: -5px 0 15px rgba(255, 0, 110, 0.2);
    border-left: 3px solid var(--accent-red);
}

.clickable-intel:active {
    transform: scale(0.98) translateX(3px);
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Modal Pricing Selection */
.modal-pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.modal-tier-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-tier-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.modal-tier-card.selected {
    background: rgba(255, 0, 110, 0.05);
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.15);
}

.modal-tier-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-red);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
}

.modal-tier-card h4 {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.modal-tier-card .tier-price {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 10px;
}

.modal-tier-card .tier-price span {
    font-size: 10px;
    opacity: 0.5;
}

.modal-tier-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-tier-card li {
    font-size: 9px;
    margin-bottom: 4px;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-tier-card li::before {
    content: '→';
    color: var(--accent-red);
}


/* Module Intelligence Briefs */
.card-brief {
    font-size: 9px;
    line-height: 1.4;
    color: var(--text-muted);
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    font-weight: 500;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.card-brief b {
    color: var(--text-primary);
    font-weight: 800;
}

/* Live Price Ticker */
.price-ticker {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-left: 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* ── Sovereign Intelligence Dossier ───────────────────────────────────────── */

.dossier-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 40px;
    background: radial-gradient(circle at center, rgba(255, 0, 110, 0.08) 0%, transparent 70%);
    border-bottom: 1px solid var(--border);
    position: relative;
    text-align: center;
}

.dossier-hero::before {
    content: 'DEEP INTEL';
    position: absolute;
    top: 20px;
    left: 40px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-red);
    letter-spacing: 3px;
    opacity: 0.5;
}

.dossier-label-large {
    font-size: 14px;
    letter-spacing: 5px;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
}

.dossier-gmp-value {
    font-size: 180px;
    font-weight: 950;
    line-height: 0.9;
    letter-spacing: -8px;
    margin: 30px 0;
    color: var(--text-primary);
    text-shadow: 0 0 80px rgba(255, 0, 110, 0.3);
}

.dossier-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    padding: 60px;
    max-width: 1800px;
    margin: 0 auto;
}

.dossier-main {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.dossier-section {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.dossier-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-red), transparent);
    opacity: 0.3;
}

.dossier-section-title {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.icon-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
/* ── Dossier Layout & Grid System ────────────────────────────────────────── */

.dossier-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 32px;
    height: 100%;
    padding: 32px;
    overflow: hidden;
}

.dossier-main {
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
    padding-right: 12px;
}

.dossier-main::-webkit-scrollbar {
    width: 4px;
}

.dossier-main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.dossier-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    overflow-y: auto;
}

/* Dossier Hero Section */
.dossier-hero {
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.08) 0%, rgba(15, 23, 42, 0.4) 100%);
    border: 1px solid rgba(255, 0, 110, 0.2);
    border-radius: 24px;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.dossier-hero::before {
    content: 'TOP SECRET // SOVEREIGN CLASSIFIED';
    position: absolute;
    top: 16px;
    left: 24px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--accent-red);
    opacity: 0.6;
}

.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dossier-metadata {
    margin-bottom: 24px;
}

.dossier-metadata .ticker {
    font-size: 64px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: -3px;
    margin-bottom: 8px;
}

.dossier-metadata .company-name {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.stat-item .value {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.gauge-container {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 12;
}

.gauge-fill {
    fill: none;
    stroke: var(--accent-red);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 660;
    stroke-dashoffset: 200; /* Calculated by JS */
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-content {
    position: absolute;
    text-align: center;
}

.prob-number {
    font-size: 72px;
    font-weight: 950;
    line-height: 1;
    color: var(--text-primary);
}

.prob-label {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 800;
    margin-top: 8px;
}

/* Dossier Section Styles */
.dossier-section {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    position: relative;
}

.dossier-section-title {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.icon-dot.red { background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); }
.icon-dot.blue { background: var(--accent-blue); box-shadow: 0 0 10px var(--accent-blue); }
.icon-dot.amber { background: var(--accent-amber); box-shadow: 0 0 10px var(--accent-amber); }

/* Tactical Briefing Styles */
.brief-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
}

.play-primary h4 {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 12px;
}

.play-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.detail-row span:first-child {
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-muted);
}

.detail-row .font-mono {
    font-weight: 800;
}

.play-rationale ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.play-rationale ul li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: flex;
    gap: 12px;
}

.bullet {
    color: var(--accent-red);
    font-weight: 900;
}

/* Signal Attribution (Staircase Waterfall) */
.waterfall-staircase {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 250px;
    padding-top: 40px;
}

.waterfall-step {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-bar {
    width: 40px;
    background: var(--accent-red);
    position: absolute;
    bottom: 0;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.1);
}

.step-value {
    position: absolute;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 12px;
}

.step-label {
    position: absolute;
    bottom: -24px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.waterfall-step.baseline .step-bar { background: var(--text-muted); opacity: 0.3; }
.waterfall-step.final .step-bar { 
    background: linear-gradient(to top, var(--accent-red), #ff70a6);
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.3);
}

/* Gated Feature Overlays */
.gated-feature {
    position: relative;
}

.pro-badge {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--accent-amber);
    background: rgba(255, 183, 3, 0.1);
    border: 1px solid rgba(255, 183, 3, 0.3);
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: 12px;
}

.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 7, 8, 0.5);
    backdrop-filter: blur(12px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
}

.lock-content {
    max-width: 320px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.lock-icon {
    width: 48px;
    height: 48px;
    stroke: var(--accent-amber);
    stroke-width: 1.5;
    margin-bottom: 24px;
    fill: none;
}

.lock-content p {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.btn-activate {
    width: 100%;
    height: 48px;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: 1px;
}

.blur-content {
    filter: blur(16px);
    opacity: 0.4;
    pointer-events: none;
}

/* Operational Handbook (Bayesian) */
.handbook-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.handbook-item {
    display: flex;
    gap: 20px;
}

.item-num {
    font-family: var(--font-mono);
    font-weight: 900;
    color: var(--accent-blue);
    font-size: 18px;
}

.item-content h5 {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 8px;
}

.item-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Event Timeline Sidebar */
.event-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 0, 110, 0.3);
    transform: translateX(4px);
}

.t-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.t-ticker {
    font-size: 18px;
    font-weight: 950;
}

.t-prob {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
}

.t-company {
    font-size: 12px;
    color: var(--text-muted);
}

.t-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* Modal Enhancements */
.modal-content {
    background: #0f172a;
    border: 1px solid var(--accent-red);
    box-shadow: 0 0 50px rgba(255, 0, 110, 0.2);
}

.payment-box {
    transition: var(--transition);
}

.payment-box:hover {
    border-color: var(--accent-red);
    background: rgba(255, 0, 110, 0.02);
}

.payment-box.active {
    border-color: var(--accent-red);
    background: rgba(255, 0, 110, 0.05);
}

/* High Fidelity Details */
.ticker-val { color: var(--text-primary); font-weight: 700; }
.ticker-delta.up { color: var(--neon-green); }
.ticker-delta.down { color: var(--neon-red); }

/* Remove old card/workspace styles */
.glass-card { display: none !important; }
.dashboard-workspace { display: none !important; }
.drag-handle { display: none !important; }

