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

:root {
    /* Base Colors - Deep Obsidian Palette */
    --bg-main: #030303;
    --bg-surface: #0a0a0a;
    --bg-card: rgba(20, 20, 20, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.02);
    
    /* Premium Accents */
    --accent: #FFD700; /* Electric Cyan */
    --accent-alt: #FFD700; /* Cyber Purple */
    --accent-glow: rgba(255, 215, 0, 0.15);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.2);
    
    /* Semantic Colors - High Contrast Neon */
    --success: #00E676; /* Hyper Green */
    --danger: #FF3366; /* Lava Red */
    --warning: #FFCC00; /* Laser Yellow */
    
    /* Text Palette */
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #888888;
    
    /* Elevation & Glassmorphism */
    --border-light: rgba(255, 215, 0, 0.15);
    --border-rich: rgba(255, 215, 0, 0.3);
    --card-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9);
    --glow-shadow: 0 0 40px -10px var(--accent-glow);
    
    /* Animation Tokens */
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease-out;
}




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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    padding-top: 80px; /* More space for top ticker */
}



/* Top Ticker Bar */
.top-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(2, 4, 8, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2000;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.ticker-item strong {
    color: var(--accent);
}

.ticker-value {
    font-family: 'Rajdhani';
    color: #fff;
    font-size: 1.1rem;
    text-shadow: 0 0 15px var(--accent-glow);
    font-weight: 700;
}

/* Background Effects */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 10%, rgba(188, 19, 254, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(0, 242, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(2, 4, 8, 1) 0%, #000 100%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Optimized Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.25rem 2rem;
    background: rgba(10, 15, 25, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    gap: 1.5rem;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}

.logo {
    text-align: left;
}

.logo h1 {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0;
}

.logo span {
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.6em;
    display: block;
}

/* Premium Navigation Pill */
header nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: 12px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    min-width: unset;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.nav-link.active {
    color: #fff;
    background: var(--bg-card);
    border-color: var(--accent);
    box-shadow: 0 10px 20px -10px var(--accent-glow);
}

.nav-link i, .nav-link span {
    font-size: 1rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.status-badge:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: var(--accent);
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--success);
    position: relative;
}

.status-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1px solid var(--success);
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; }
}

.status-dot.loading {
    background: var(--warning);
    box-shadow: 0 0 12px var(--warning);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Navigation Links */
.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 150px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-glow);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    font-weight: 700;
}

.nav-link.active i, .nav-link.active span {
    filter: drop-shadow(0 0 5px var(--accent));
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    .stat-value {
        font-size: 1.5rem;
    }
    .container {
        padding: 1rem;
    }
}

/* Navigation Horizontal Scroll on Mobile */
@media (max-width: 768px) {
    header nav {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start !important;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        gap: 0.75rem !important;
    }
    
    header nav::-webkit-scrollbar {
        height: 4px;
    }

    header nav a {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .balance-card {
        width: 100%;
        justify-content: center;
    }
}

.balance-card {
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.08) 0%, rgba(0, 245, 160, 0.08) 100%);
    border: 1px solid var(--border-rich);
    border-radius: 20px;
    padding: 0.75rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition-smooth);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.balance-card:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.12) 0%, rgba(0, 245, 160, 0.12) 100%);
    border-color: var(--accent);
    box-shadow: 0 20px 40px -15px rgba(0, 229, 255, 0.2);
}

.balance-separator {
    width: 1px;
    height: 30px;
    background: var(--border-rich);
}

.stat-card {
    background: linear-gradient(165deg, rgba(20, 24, 40, 0.5), rgba(10, 12, 18, 0.4));
    padding: 2rem;
    border-radius: 30px;
    border: 1px solid var(--border-light);
    transition: var(--transition-smooth);
    backdrop-filter: blur(24px);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

.stat-card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 229, 255, 0.1);
}

.stat-label {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    font-family: 'Rajdhani', monospace;
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Institutional Value Locking */
.value-lock-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    height: 60px; /* Locked Height */
    align-content: center;
}

.locked-price {
    font-family: 'Rajdhani', monospace !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums !important;
    line-height: 1.2;
}

.locked-change {
    font-family: 'Rajdhani', monospace !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums !important;
    line-height: 1;
}

/* Data Table Overhaul */
.table-container {
    background: var(--bg-surface);
    border-radius: 32px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    backdrop-filter: blur(30px);
    box-shadow: var(--card-shadow);
    margin-top: 2rem;
    padding: 1rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 1.25rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    vertical-align: middle;
    font-variant-numeric: tabular-nums; /* Prevents number jitter */
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: background-color 0.2s ease-out; /* Only animate background */
}

tr td:first-child { border-radius: 12px 0 0 12px; border-left: 1px solid transparent; }
tr td:last-child { border-radius: 0 12px 12px 0; border-right: 1px solid transparent; }

tr:hover td:first-child { border-left-color: var(--accent); }

tr:last-child td {
    border-bottom: none;
}

@keyframes pulse-glow {
    0% { opacity: 0.6; box-shadow: 0 0 0px var(--success); }
    50% { opacity: 1; box-shadow: 0 0 15px var(--success); }
    100% { opacity: 0.6; box-shadow: 0 0 0px var(--success); }
}

.priority-glow {
    animation: gold-pulse 2s infinite;
    box-shadow: inset 0 0 0 2px #ffb800, 0 0 25px rgba(255, 184, 0, 0.3) !important;
    background: rgba(255, 184, 0, 0.05) !important;
}

@keyframes gold-pulse {
    0% { border-color: rgba(255, 184, 0, 0.3); box-shadow: 0 0 5px rgba(255, 184, 0, 0.1); }
    50% { border-color: #ffb800; box-shadow: 0 0 25px rgba(255, 184, 0, 0.4); }
    100% { border-color: rgba(255, 184, 0, 0.3); box-shadow: 0 0 5px rgba(255, 184, 0, 0.1); }
}

.ai-narrative-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-style: italic;
    display: block;
}

.ai-narrative-text strong {
    color: var(--accent);
}

/* Fixed Widths for Jitter Prevention */
th:nth-child(2), td:nth-child(2) { width: 220px; } /* Symbol */
th:nth-child(3), td:nth-child(3) { width: 140px; text-align: right !important; font-family: 'Rajdhani', monospace !important; } /* Price */
th:nth-child(4), td:nth-child(4) { width: 140px; text-align: right !important; font-family: 'Rajdhani', monospace !important; } /* Change % */
th:nth-child(7), td:nth-child(7) { width: 100px; text-align: right !important; font-family: 'Rajdhani', monospace !important; } /* Score */


tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.symbol-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.or-range {
    color: var(--text-secondary);
    font-family: 'Rajdhani';
    font-size: 0.65rem;
    margin-left: 0.5rem;
}

.symbol-dash {
    color: rgba(255, 255, 255, 0.2);
    margin: 0 0.25rem;
}

.symbol-name {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}

/* Global Numerical Stability */
.stat-card div[style*="font-family:'JetBrains Mono'"],
.stat-card div[style*="color:var(--success)"],
.stat-card div[style*="color:var(--danger)"],
.alert-card span[style*="font-family: 'Rajdhani'"] {
    font-variant-numeric: tabular-nums !important;
    display: inline-block;
}

.price-cell {
    font-family: 'Rajdhani', monospace;
    font-weight: 600;
}

.score-bar-container {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.score-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7000ff);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.5px;
}

.badge-success { background: rgba(0, 255, 170, 0.1); color: var(--success); border: 1px solid rgba(0, 255, 170, 0.15); }
.badge-danger { background: rgba(255, 77, 77, 0.1); color: var(--danger); border: 1px solid rgba(255, 77, 77, 0.15); }
.badge-warning { background: rgba(255, 184, 0, 0.1); color: var(--warning); border: 1px solid rgba(255, 184, 0, 0.15); }
.badge-tfs { 
    background: rgba(0, 255, 170, 0.08); 
    color: #00ffaa; 
    border: 1px solid rgba(0, 255, 170, 0.2);
    font-family: 'Rajdhani';
    font-size: 0.6rem;
}
.badge-pre {
    background: rgba(255, 184, 0, 0.1);
    color: #ffb800;
    border: 1px solid rgba(255, 184, 0, 0.2);
}
.badge-breakout {
    background: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.3);
}
.badge-retest-long {
    background: rgba(0, 242, 255, 0.1);
    color: #00f2ff;
    border: 1px solid rgba(0, 242, 255, 0.2);
}
.badge-retest-short {
    background: rgba(255, 184, 0, 0.1);
    color: #ffb800;
    border: 1px solid rgba(255, 184, 0, 0.2);
}
.badge-signal-buy {
    background: transparent;
    color: #00ffaa;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0;
}
.badge-signal-sell {
    background: transparent;
    color: #ff4d4d;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0;
}
.badge-signal-retest {
    background: rgba(255, 184, 0, 0.15);
    color: #ffb800;
    border: 1px solid rgba(255, 184, 0, 0.3);
}


/* Base Responsive Grid Fix */
#nifty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

@media (max-width: 600px) {
    #nifty-grid {
        grid-template-columns: 1fr !important;
    }
    
    .table-container h2 {
        font-size: 1rem !important;
        white-space: normal !important;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    position: relative;
    width: 42px;
    height: 42px;
    margin-left: 10px;
}

.theme-toggle-btn:active {
    transform: scale(0.9);
}

.power-icon {
    font-size: 1.4rem;
    color: var(--accent);
    transition: var(--transition-smooth);
    filter: drop-shadow(0 0 8px var(--accent-glow));
    z-index: 2;
}

.theme-toggle-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent);
    border-radius: 50%;
    opacity: 0.4;
    animation: ring-pulse 2s infinite;
    z-index: 1;
}

@keyframes ring-pulse {
    0% { transform: scale(0.92); opacity: 0.4; }
    50% { transform: scale(1.08); opacity: 0.15; }
    100% { transform: scale(0.92); opacity: 0.4; }
}

.theme-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    z-index: 9999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.theme-transitioning .theme-transition-overlay {
    opacity: 1;
    pointer-events: all;
}

/* Terms Modal */
#terms-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.terms-content {
    background: var(--bg-surface);
    border: 1px solid var(--accent);
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 50px var(--accent-glow);
    animation: modal-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.terms-content h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.terms-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.terms-accept-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 12px 40px;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
    letter-spacing: 1px;
}

.terms-accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--accent-glow);
}
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════
   GODSTOCKS — COMPLETE RESPONSIVE SYSTEM
   Mobile: 320-480px | Tablet: 481-768px | Laptop: 769-1024px
   ═══════════════════════════════════════════════════════════════ */

/* ── GLOBAL MOBILE TOUCH IMPROVEMENTS ───────────────────────── */
@media (max-width: 1024px) {
    * { -webkit-tap-highlight-color: transparent; }

    .nav-link,
    button,
    a[href],
    input,
    select { min-height: 44px; }

    .top-ticker {
        padding: 0.4rem 1rem;
        gap: 0.75rem;
    }
}

/* ── TABLET (481px – 768px) ─────────────────────────────────── */
@media (max-width: 768px) {
    body { padding-top: 60px; }

    .container { padding: 1rem; }

    /* Header — wrap to 2 rows */
    header {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
        border-radius: 16px;
        margin-bottom: 1.25rem;
    }

    .logo { flex: 0 0 auto; }
    .logo h1 { font-size: 1.1rem; }
    .logo span { font-size: 0.58rem; letter-spacing: 0.25em; }

    /* Nav — horizontal scroll strip */
    header nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 0.5rem !important;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    header nav::-webkit-scrollbar { display: none; }

    .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
        min-width: unset !important;
        padding: 0.5rem 0.9rem !important;
        font-size: 0.72rem !important;
        border-radius: 10px !important;
        min-height: 40px;
    }

    /* Status badge — compress */
    .status-badge {
        padding: 0.5rem 0.9rem;
        font-size: 0.68rem;
    }

    /* Balance card — full width */
    .balance-card {
        width: 100%;
        justify-content: space-between;
        padding: 0.65rem 1rem;
    }

    /* Stats grid — 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 1.25rem !important;
        border-radius: 20px;
    }

    .stat-value {
        font-size: 1.6rem !important;
    }

    .stat-label {
        font-size: 0.65rem !important;
        letter-spacing: 0.1em;
    }

    /* Table — horizontal scroll */
    .table-container {
        border-radius: 18px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        min-width: 600px;
    }

    th, td {
        font-size: 0.78rem !important;
        padding: 0.7rem 0.6rem !important;
        white-space: nowrap;
    }

    .symbol-name { font-size: 0.85rem !important; }
    .price-cell { font-size: 0.8rem !important; }
    .score-bar-container { width: 55px !important; }

    /* Box headers — stack on tablet */
    .box-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1rem 1.25rem !important;
    }
    .box-title { font-size: 0.85rem !important; }

    /* Alerts grid */
    #alerts-view {
        grid-template-columns: 1fr !important;
    }

    /* Signal filters */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        width: 100%;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }

    .nav-tab {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.72rem;
        padding: 0.45rem 0.85rem !important;
        min-height: 38px;
    }

    /* Search bar */
    #search {
        width: 100% !important;
        max-width: none !important;
    }

    /* Top ticker — hide less important items */
    .top-ticker .ticker-item:nth-child(n+4) {
        display: none;
    }

    .ticker-value { font-size: 0.9rem; }

    /* Terms modal */
    .terms-content {
        padding: 1.5rem;
        border-radius: 16px;
    }
}

/* ── MOBILE (320px – 480px) ─────────────────────────────────── */
@media (max-width: 480px) {
    body { padding-top: 55px; }

    .container { padding: 0.6rem; }

    /* Top ticker — minimal */
    .top-ticker {
        padding: 0.35rem 0.75rem;
    }
    .top-ticker .ticker-item:nth-child(n+3) { display: none; }
    .ticker-value { font-size: 0.85rem; }
    .ticker-item { gap: 0.4rem; font-size: 0.55rem; }

    /* Header — single column */
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.9rem;
        border-radius: 14px;
        margin-bottom: 1rem;
    }

    .logo h1 { font-size: 1rem; }
    .logo span { font-size: 0.55rem; letter-spacing: 3px; }

    header nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 0.4rem !important;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    header nav::-webkit-scrollbar { display: none; }

    .nav-link {
        padding: 0.45rem 0.7rem !important;
        font-size: 0.65rem !important;
        min-width: unset !important;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 38px;
    }

    .status-badge {
        width: 100%;
        justify-content: center;
        font-size: 0.62rem;
        padding: 0.45rem 0.75rem;
    }

    /* Balance card */
    .balance-card {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    .balance-separator { display: none; }

    /* Stats — 1 column */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.65rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 1rem !important;
        border-radius: 14px;
    }

    .stat-value { font-size: 1.4rem !important; }
    .stat-label { font-size: 0.6rem !important; }

    /* Table — minimal horizontal scroll */
    .table-container {
        border-radius: 12px;
        padding: 0.25rem;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th, td {
        font-size: 0.7rem !important;
        padding: 0.55rem 0.35rem !important;
        white-space: nowrap;
    }

    .symbol-name { font-size: 0.75rem !important; }
    .price-cell { font-size: 0.72rem !important; }
    .score-bar-container { width: 45px !important; }
    .badge { font-size: 0.55rem !important; padding: 0.2rem 0.45rem !important; }

    td button {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.6rem !important;
    }

    /* Box headers */
    .box-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        padding: 0.9rem 1rem !important;
    }

    .box-title {
        font-size: 0.75rem !important;
        letter-spacing: 1px !important;
    }

    /* Signal filters */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }

    .nav-tab {
        font-size: 0.65rem;
        padding: 0.4rem 0.7rem !important;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 36px;
    }

    #search {
        width: 100% !important;
        max-width: none !important;
        font-size: 0.85rem;
        padding: 0.6rem 0.9rem;
    }

    /* Signals view header */
    #signals-view .table-container header,
    #signals-view div[style*="background: rgba(0,0,0,0.2)"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 0.9rem !important;
        gap: 0.75rem;
    }

    #signals-view h2 {
        font-size: 0.9rem !important;
        width: 100%;
    }

    /* Terms modal */
    .terms-content {
        padding: 1.25rem;
        border-radius: 14px;
        max-width: 100%;
    }
    .terms-content h2 { font-size: 1rem !important; }
    .terms-content p { font-size: 0.82rem !important; }
    .terms-accept-btn {
        width: 100%;
        padding: 14px;
        font-size: 0.75rem;
    }

    /* Alerts */
    #alerts-view { grid-template-columns: 1fr !important; }
}

/* Index Specific Theme Classes */
.theme-nifty {
    --current-accent: var(--nifty-color);
    --current-glow: var(--nifty-glow);
}

.theme-nn50 {
    --current-accent: var(--nn50-color);
    --current-glow: var(--nn50-glow);
}

.elite-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.elite-card:hover {
    transform: translateY(-5px);
    border-color: var(--current-accent);
    box-shadow: 0 10px 40px var(--current-glow);
}

.elite-badge {
    background: var(--current-glow);
    color: var(--current-accent);
    border: 1px solid var(--current-accent);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Premium Box Containers */
.table-container {
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 28px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.table-container:hover {
    border-color: rgba(255, 184, 0, 0.2);
    box-shadow: 0 25px 60px rgba(255, 184, 0, 0.05);
}

.box-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(90deg, rgba(255, 184, 0, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.box-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    color: #ffb800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Remove TradingView Branding Globally */
.tradingview-widget-copyright,
.tv-widget-watch-list__copyright,
.tv-embed-widget-wrapper__copyright {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

