        :root {
            --bg-primary: #0a0e17;
            --bg-secondary: #0f1520;
            --bg-card: #111622;
            --bg-card-hover: #181f2d;
            --border-color: rgba(139, 115, 85, 0.4);
            --border-glow: rgba(139, 115, 85, 0.6);
            --text-primary: #e4e8f1;
            --text-secondary: #8892a6;
            --text-muted: #4a5568;
            --accent-bull: #00ff88;
            --accent-bull-dim: #00cc6a;
            --accent-bear: #ff4757;
            --accent-bear-dim: #cc3a47;
            --accent-cyan: #00d4ff;
            --accent-purple: #a855f7;
            --accent-gold: #8b7355;
            --accent-bronze: #6b5a47;
            --positive: #10b981;
            --negative: #ef4444;
            --grid-line: rgba(30, 42, 69, 0.5);
        }

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

        body {
            font-family: 'JetBrains Mono', monospace;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            overflow-x: hidden;
        }

        /* Grid Background */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image:
                linear-gradient(var(--grid-line) 1px, transparent 1px),
                linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
            background-size: 50px 50px;
            pointer-events: none;
            z-index: 0;
            opacity: 0.3;
        }

        /* Scanline effect */
        body::after {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: repeating-linear-gradient(
                0deg,
                rgba(0, 0, 0, 0.1) 0px,
                rgba(0, 0, 0, 0.1) 1px,
                transparent 1px,
                transparent 2px
            );
            pointer-events: none;
            z-index: 9999;
            opacity: 0.15;
        }

        /* TradingView Ticker */
        .ticker-container {
            position: relative;
            z-index: 2;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-color);
            height: 46px;
            overflow: hidden;
        }

        .ticker-container .tradingview-widget-container {
            height: 46px !important;
        }

        .ticker-container .tradingview-widget-container iframe {
            height: 46px !important;
        }

        /* Technical Analysis Widgets */
        .technical-analysis-widget .tradingview-widget-container {
            height: 250px !important;
            overflow: hidden !important;
            pointer-events: none;
        }

        .technical-analysis-widget .tradingview-widget-container iframe {
            height: 300px !important;
            margin-top: -50px !important;
            overflow: hidden !important;
        }

        .gauge-label {
            text-align: center;
            font-weight: 600;
            font-size: 14px;
            color: var(--accent-gold);
            margin-bottom: 5px;
        }

        .gauge-container {
            border: 1px solid var(--accent-gold);
            border-radius: 8px;
            padding: 10px;
            background: rgba(139, 115, 85, 0.05);
        }

        /* Page Layout */
        .page-wrapper {
            min-height: calc(100vh - 46px);
            position: relative;
            z-index: 1;
        }


        .container {
            position: relative;
            z-index: 1;
            max-width: 1600px;
            flex: 1;
            margin: 0 auto;
            padding: 20px;
        }

        /* Sticky Header Wrapper */
        .sticky-header-wrapper {
            position: sticky;
            top: 0;
            z-index: 100;
            background: var(--bg-primary);
            padding-top: 10px;
            padding-bottom: 5px;
            margin: 0 -30px;
            padding-left: 30px;
            padding-right: 30px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }

        /* Header */
        header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0 15px;
            border-bottom: 1px solid var(--border-color);
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .logo-icon {
            width: 48px;
            height: 48px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 0 20px rgba(255, 191, 36, 0.3);
        }

        .logo-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .logo-text {
            font-family: 'Orbitron', sans-serif;
            font-size: 22px;
            font-weight: 700;
            letter-spacing: 2px;
            background: linear-gradient(90deg, var(--text-primary), var(--accent-gold));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .logo-subtitle {
            font-size: 10px;
            color: var(--accent-gold);
            letter-spacing: 4px;
            text-transform: uppercase;
            margin-top: 2px;
        }

        .header-status {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .status-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 8px;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--accent-bull);
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
            50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
        }

        .status-label {
            font-size: 10px;
            color: var(--accent-gold);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .regime-indicator {
            padding: 8px 16px;
            border-radius: 6px;
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            font-size: 14px;
            letter-spacing: 2px;
            /* "BTC ON" y "ALTS OFF" son una unidad: nunca parten en dos lineas. */
            white-space: nowrap;
        }

        .regime-indicator.bull {
            background: rgba(0, 255, 136, 0.15);
            color: var(--accent-bull);
            border: 1px solid rgba(0, 255, 136, 0.3);
        }

        .regime-indicator.bear {
            background: rgba(255, 71, 87, 0.15);
            color: var(--accent-bear);
            border: 1px solid rgba(255, 71, 87, 0.3);
        }

        /* Tabs */
        .tabs {
            display: flex;
            gap: 8px;
            background: var(--bg-card);
            padding: 6px;
            border-radius: 12px;
            margin-top: 15px;
            margin-bottom: 15px;
            border: 1px solid rgba(139, 115, 85, 0.3);
            border: 1px solid var(--border-color);
            align-items: stretch;
        }

        /* No flex:1 and no min-width on purpose: the highlight of the active
           item has to hug its own label, so the width comes from the padding
           of the element itself. */
        .tab-btn {
            flex: 0 0 auto;
            padding: 14px 20px;
            background: transparent;
            border: none;
            color: #b8956e;
            font-family: 'Orbitron', sans-serif;
            font-size: clamp(11px, 1.1vw, 14px);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            white-space: nowrap;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .tab-btn:hover {
            color: #d4a574;
            background: rgba(139, 115, 85, 0.1);
        }

        .tab-btn.active {
            background: linear-gradient(135deg, rgba(0, 180, 216, 0.2), rgba(0, 150, 199, 0.15));
            color: #00b4d8;
            box-shadow: 0 0 20px rgba(0, 180, 216, 0.15);
        }

        /* The EXPERIMENTAL entry is a link, not a tab: it needs the centring and
           line box a <button> gets for free. */
        a.tab-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            text-decoration: none;
            line-height: normal;
        }

        /* Subscribe: the call to action. margin-left:auto eats the free space,
           which is also what pushes it to the far right of the bar. */
        .tab-btn.cta {
            margin-left: auto;
            border: 1px solid var(--accent-cyan);
            border-radius: 8px;
        }

        .tab-btn.cta.active {
            border-color: var(--accent-cyan);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Daily Rankings tab - adaptive layout with disclaimer at bottom */
        #tab-daily-rankings.active {
            display: flex;
            flex-direction: column;
            height: calc(100vh - 150px);
            overflow: hidden;
        }

        #tab-daily-rankings .card {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            margin-bottom: 0;
        }

        #tab-daily-rankings .card-body {
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        #tab-daily-rankings .table-scroll-container {
            flex: 1;
            overflow-y: hidden;
            max-height: 500px;
            transition: overflow-y 0.2s;
        }

        #tab-daily-rankings .table-scroll-container:hover {
            overflow-y: auto;
        }

        #tab-daily-rankings .warning-box {
            flex-shrink: 0;
            margin-top: 15px;
            margin-bottom: 0;
        }

        /* Cards */
        .card {
            background: var(--bg-card);
            border: 1px solid rgba(139, 115, 85, 0.3);
            border-radius: 16px;
            overflow: hidden;
            transition: all 0.3s ease;
        }

        .card:hover {
            border-color: rgba(139, 115, 85, 0.4);
            box-shadow: 0 0 40px rgba(139, 115, 85, 0.05);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 25px;
            border-bottom: 1px solid var(--border-color);
            background: rgba(0, 0, 0, 0.2);
        }

        .card-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: #d4a563;
        }

        .card-badge {
            font-size: 10px;
            padding: 4px 10px;
            border-radius: 4px;
            background: rgba(139, 115, 85, 0.1);
            color: var(--accent-gold);
            border: 1px solid rgba(139, 115, 85, 0.2);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .card-body {
            padding: 20px 25px;
        }

        /* Summary Row */
        .summary-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-bottom: 25px;
        }

        .summary-card {
            background: var(--bg-card);
            border: 1px solid var(--accent-gold);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
        }

        .summary-value {
            font-family: 'Orbitron', sans-serif;
            font-size: 26px;
            font-weight: 700;
            margin-bottom: 5px;
            color: var(--accent-gold);
        }

        .summary-label {
            font-size: 10px;
            color: var(--accent-gold);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        /* Strategy Cards Grid */
        .strategy-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-bottom: 25px;
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
        }

        .strategy-grid-2x2 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            max-width: 1100px;
            margin-left: auto;
            margin-right: auto;
        }

        .strategy-section-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 12px;
            padding-left: 4px;
        }

        .strategy-grid-3 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
        }

        .strategy-grid-4 {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
        }

        .strategy-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 15px;
            transition: all 0.3s ease;
        }

        .strategy-card:hover {
            border-color: var(--border-glow);
            transform: translateY(-2px);
        }

        .strategy-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 12px;
        }

        .strategy-name {
            font-family: 'Orbitron', sans-serif;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 1px;
            color: var(--text-primary);
        }

        .strategy-signal {
            padding: 4px 12px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 1px;
        }

        .strategy-signal.long {
            background: rgba(0, 255, 136, 0.15);
            color: var(--accent-bull);
        }

        .strategy-signal.cash {
            background: rgba(255, 191, 36, 0.15);
            color: var(--accent-gold);
        }

        .strategy-metrics {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .metric-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .metric-label {
            font-size: 11px;
            color: var(--text-primary);
            opacity: 0.8;
        }

        .metric-value {
            font-family: 'Orbitron', sans-serif;
            font-size: 12px;
            font-weight: 600;
        }

        .strategy-allocation {
            margin-top: 12px;
            padding-top: 10px;
            border-top: 1px solid var(--border-color);
        }

        .allocation-bar {
            height: 6px;
            background: var(--bg-secondary);
            border-radius: 3px;
            margin-top: 8px;
            overflow: hidden;
        }

        .allocation-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
            border-radius: 3px;
        }

        /* Per-Metric TOP 10 Cards */
        .metric-cards-grid {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-bottom: 25px;
        }

        .metric-top5-card {
            flex: 1 1 0;
            min-width: 200px;
            max-width: 320px;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            overflow: hidden;
        }

        .metric-top5-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background: rgba(0, 0, 0, 0.3);
            border-bottom: 1px solid var(--border-color);
        }

        .metric-top5-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 1px;
        }

        .metric-top5-badge {
            font-size: 9px;
            padding: 3px 8px;
            border-radius: 3px;
            background: rgba(168, 85, 247, 0.2);
            color: var(--accent-purple);
            border: 1px solid rgba(168, 85, 247, 0.3);
        }

        .metric-top5-list {
            padding: 10px;
        }

        .metric-top5-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            border-radius: 8px;
            transition: background 0.2s;
        }

        .metric-top5-item:hover {
            background: var(--bg-secondary);
        }

        .metric-top5-rank {
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            font-size: 14px;
            width: 25px;
            color: var(--text-muted);
        }

        .metric-top5-item:nth-child(1) .metric-top5-rank { color: var(--accent-gold); }
        .metric-top5-item:nth-child(2) .metric-top5-rank { color: #c0c0c0; }
        .metric-top5-item:nth-child(3) .metric-top5-rank { color: #cd7f32; }

        .metric-top5-symbol {
            font-weight: 600;
            flex: 1;
            margin-left: 10px;
        }

        .metric-top5-return {
            font-family: 'Orbitron', sans-serif;
            font-size: 12px;
            font-weight: 600;
        }

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

        /* Rebalance Actions */
        .rebalance-container {
            margin-top: 25px;
        }

        .rebalance-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .strategy-actions-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            max-width: 900px;
            margin-left: auto;
            margin-right: auto;
        }

        .strategy-action-card {
            background: var(--bg-secondary);
            border-radius: 10px;
            overflow: hidden;
        }

        .strategy-action-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            background: rgba(0, 0, 0, 0.2);
        }

        .strategy-action-body {
            padding: 12px;
        }

        /* The Lab rule (CCI40 & SMA50, see /experimental) is a preview, never a
           signal: amber marks everything it — and only it — put on screen. */
        .lab-badge {
            display: inline-block;
            border: 1px solid #f97316;
            color: #f97316;
            font-family: 'Orbitron', sans-serif;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: 6px;
        }

        .lab-notice {
            border-left: 3px solid #f97316;
            color: var(--text-muted);
            font-size: 11px;
            padding: 8px 12px;
            margin-bottom: 14px;
        }

        .rebalance-action {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 18px;
            background: var(--bg-secondary);
            border-radius: 10px;
            border-left: 3px solid;
        }

        .rebalance-action.buy {
            border-left-color: var(--positive);
        }

        .rebalance-action.sell {
            border-left-color: var(--negative);
        }

        .action-type {
            font-size: 10px;
            font-weight: 700;
            padding: 5px 10px;
            border-radius: 4px;
            text-transform: uppercase;
            letter-spacing: 1px;
            min-width: 50px;
            text-align: center;
        }

        .action-type.buy {
            background: rgba(16, 185, 129, 0.15);
            color: var(--positive);
        }

        .action-type.sell {
            background: rgba(239, 68, 68, 0.15);
            color: var(--negative);
        }

        .action-symbol {
            font-weight: 600;
            flex: 1;
        }

        .action-value {
            font-family: 'Orbitron', sans-serif;
            font-size: 14px;
        }

        .action-reason {
            font-size: 10px;
            color: var(--text-muted);
            max-width: 200px;
        }

        /* Tables */
        .data-table {
            width: 100%;
            border-collapse: collapse;
        }

        .data-table th {
            text-align: left;
            padding: 8px 12px;
            font-size: 10px;
            font-weight: 600;
            color: var(--accent-gold);
            text-transform: uppercase;
            letter-spacing: 1px;
            border-bottom: 1px solid var(--border-color);
        }

        .sortable-header {
            user-select: none;
            transition: background 0.2s, color 0.2s;
        }

        .sortable-header:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        .sortable-header.active {
            color: var(--accent-cyan) !important;
            background: rgba(0, 212, 255, 0.1);
        }

        .data-table td {
            padding: 6px 12px;
            font-size: 12px;
            border-bottom: 1px solid var(--border-color);
        }

        .data-table tr:hover td {
            background: var(--bg-card-hover);
        }

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

        /* Rankings by Metric Section */
        .rankings-metric-section {
            margin-bottom: 30px;
        }

        .rankings-metric-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border-color);
        }

        .rankings-metric-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: 1px;
        }

        .rankings-metric-description {
            font-size: 12px;
            color: var(--text-secondary);
            max-width: 500px;
        }

        /* Strategies Section */
        .strategies-intro {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 30px;
            margin-bottom: 30px;
        }

        .strategies-intro h2 {
            font-family: 'Orbitron', sans-serif;
            font-size: 18px;
            margin-bottom: 15px;
            color: #d4a563;
        }

        .strategies-intro p {
            font-size: 14px;
            line-height: 1.7;
            color: var(--accent-gold);
            margin-bottom: 15px;
        }

        .strategies-intro ul {
            margin-left: 20px;
            color: var(--accent-gold);
        }

        .strategies-intro li {
            margin-bottom: 8px;
        }

        .strategy-results-card {
            margin-bottom: 25px;
        }

        .strategy-results-card .card-header {
            border-left: 4px solid var(--accent-cyan);
        }

        .strategy-results-card:nth-child(2) .card-header {
            border-left-color: var(--accent-purple);
        }

        .strategy-results-card:nth-child(3) .card-header {
            border-left-color: var(--accent-gold);
        }

        .strategy-description {
            padding: 15px 0;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 15px;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .results-table th.highlight {
            color: var(--accent-cyan);
        }

        .results-table th:nth-child(1),
        .results-table td:nth-child(1) { width: 40%; }
        .results-table th:nth-child(2),
        .results-table td:nth-child(2) { width: 15%; text-align: center; }
        .results-table th:nth-child(3),
        .results-table td:nth-child(3) { width: 15%; text-align: center; }
        .results-table th:nth-child(4),
        .results-table td:nth-child(4) { width: 15%; text-align: center; }
        .results-table th:nth-child(5),
        .results-table td:nth-child(5) { width: 15%; text-align: center; }

        .benchmark-row {
            background: rgba(139, 115, 85, 0.05);
        }

        /* Configuration Form */
        .config-section {
            margin-bottom: 30px;
        }

        .config-section-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 14px;
            font-weight: 600;
            letter-spacing: 2px;
            color: #d4a563;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--accent-gold);
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .form-input {
            width: 100%;
            padding: 12px 16px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-primary);
            font-family: 'JetBrains Mono', monospace;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--accent-cyan);
            box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
        }

        .form-input::placeholder {
            color: var(--text-muted);
        }

        .form-select {
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892a6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 16px center;
            padding-right: 40px;
        }

        .checkbox-group {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
        }

        .checkbox-item input {
            width: 18px;
            height: 18px;
            accent-color: var(--accent-cyan);
        }

        .radio-group {
            display: flex;
            gap: 20px;
        }

        .radio-item {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
        }

        .radio-item input {
            width: 18px;
            height: 18px;
            accent-color: var(--accent-cyan);
        }

        .config-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
        }

        .email-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .email-item {
            display: flex;
            gap: 10px;
        }

        .email-item input {
            flex: 1;
        }

        .btn-remove {
            padding: 12px;
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: var(--negative);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-remove:hover {
            background: rgba(239, 68, 68, 0.2);
        }

        /* Buttons */
        .btn {
            font-family: 'JetBrains Mono', monospace;
            font-size: 12px;
            font-weight: 600;
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 1px;
            transition: all 0.3s ease;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
            color: var(--bg-primary);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .btn-outline:hover {
            border-color: var(--accent-cyan);
            color: var(--accent-cyan);
        }

        .btn-success {
            background: rgba(16, 185, 129, 0.2);
            border: 1px solid var(--positive);
            color: var(--positive);
        }

        .btn-success:hover {
            background: rgba(16, 185, 129, 0.3);
        }

        .btn-small {
            padding: 8px 16px;
            font-size: 10px;
        }

        /* Performance Cards */
        .perf-summary {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 15px;
            margin-bottom: 30px;
        }

        .perf-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
        }

        .perf-period {
            font-size: 10px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 10px;
        }

        .perf-value {
            font-family: 'Orbitron', sans-serif;
            font-size: 24px;
            font-weight: 700;
        }

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

        .perf-usd {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 5px;
        }

        /* Rankings Table */
        .rankings-table th {
            text-align: left;
        }

        .rank-cell {
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            width: 50px;
        }

        .rank-1 { color: var(--accent-gold); }
        .rank-2 { color: #c0c0c0; }
        .rank-3 { color: #cd7f32; }

        .symbol-cell {
            font-weight: 600;
            color: var(--text-primary);
        }

        .score-cell {
            font-family: 'Orbitron', sans-serif;
            color: var(--accent-cyan);
        }

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

        /* TOP 5 List */
        .top5-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .top5-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 16px 18px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            transition: all 0.3s ease;
        }

        .top5-item:hover {
            transform: translateX(5px);
            border-color: var(--accent-cyan);
        }

        .top5-rank {
            font-family: 'Orbitron', sans-serif;
            font-size: 20px;
            font-weight: 800;
            width: 35px;
            color: var(--text-muted);
        }

        .top5-item:nth-child(1) .top5-rank { color: var(--accent-gold); }
        .top5-item:nth-child(2) .top5-rank { color: #c0c0c0; }
        .top5-item:nth-child(3) .top5-rank { color: #cd7f32; }

        .top5-info { flex: 1; }

        .top5-symbol {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 3px;
        }

        .top5-score {
            font-size: 10px;
            color: var(--text-muted);
        }

        .top5-weight {
            text-align: right;
        }

        .top5-weight-value {
            font-family: 'Orbitron', sans-serif;
            font-size: 18px;
            font-weight: 600;
            color: var(--accent-purple);
        }

        .top5-weight-label {
            font-size: 10px;
            color: var(--text-muted);
        }

        /* Grid Layouts */
        .two-col-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 25px;
        }

        .main-sidebar-grid {
            display: grid;
            grid-template-columns: 1fr 400px;
            gap: 25px;
        }

        /* Loading & Error */
        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 40px;
            color: var(--text-muted);
        }

        .loading::after {
            content: '';
            width: 20px;
            height: 20px;
            border: 2px solid var(--border-color);
            border-top-color: var(--accent-cyan);
            border-radius: 50%;
            margin-left: 10px;
            animation: spin 1s linear infinite;
        }

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

        .error {
            color: var(--negative);
            padding: 20px;
            text-align: center;
            font-size: 12px;
        }

        .empty-state {
            color: var(--text-muted);
            text-align: center;
            padding: 30px;
            font-size: 12px;
        }

        /* Tip Box */
        .tip-box {
            background: rgba(0, 212, 255, 0.05);
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: 8px;
            padding: 15px 20px;
            margin-top: 20px;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .tip-box strong {
            color: var(--accent-cyan);
        }

        /* Refresh Button */
        .refresh-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            transition: all 0.2s;
        }

        .refresh-btn:hover {
            background: var(--bg-secondary);
            color: var(--accent-cyan);
        }

        .refresh-btn svg {
            width: 18px;
            height: 18px;
        }

        /* Warning Box */
        .warning-box {
            background: rgba(255, 71, 87, 0.05);
            border: 1px solid rgba(255, 71, 87, 0.3);
            border-radius: 8px;
            padding: 15px 20px;
            margin-top: 15px;
            font-size: 12px;
            color: var(--accent-bear);
        }

        /* Notes List */
        .notes-list {
            background: rgba(168, 85, 247, 0.05);
            border: 1px solid rgba(168, 85, 247, 0.2);
            border-radius: 8px;
            padding: 20px;
            margin-top: 20px;
        }

        .notes-list h4 {
            font-family: 'Orbitron', sans-serif;
            font-size: 12px;
            color: var(--accent-purple);
            margin-bottom: 10px;
        }

        .notes-list ul {
            margin-left: 20px;
            color: var(--text-secondary);
            font-size: 12px;
        }

        .notes-list li {
            margin-bottom: 6px;
        }

        /* Blog Styles */
        .blog-post-card {
            transition: transform 0.2s, border-color 0.2s;
        }

        .blog-post-card:hover {
            transform: translateY(-3px);
            border-color: var(--accent-cyan);
        }

        .blog-content h4 {
            color: var(--accent-cyan);
            margin: 20px 0 10px 0;
            font-size: 16px;
        }

        .blog-content p {
            margin-bottom: 15px;
        }

        .blog-content ul, .blog-content ol {
            margin-left: 25px;
            margin-bottom: 15px;
        }

        .blog-content li {
            margin-bottom: 8px;
        }

        .social-btn:hover {
            transform: translateY(-2px);
            filter: brightness(1.2);
        }

        /* Table Scroll Container for Mobile */
        .table-scroll-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            width: 100%;
        }

        .table-scroll-container .data-table {
            min-width: 550px;
        }

        /* Responsive */
        @media (max-width: 1200px) {
            .main-sidebar-grid,
            .two-col-grid,
            .config-grid {
                grid-template-columns: 1fr;
            }

            .strategy-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .perf-summary {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        /* Below 900px the seven items stop fitting: they scroll sideways,
           they never wrap. */
        @media (max-width: 900px) {
            .tabs {
                overflow-x: auto;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
            }

            .tabs::-webkit-scrollbar {
                display: none;
            }

            .tab-btn.cta {
                margin-left: 0;
            }
        }

        @media (max-width: 768px) {
            /* Daily Rankings tab - remove fixed height on mobile */
            #tab-daily-rankings.active {
                height: auto;
                overflow: visible;
            }

            #tab-daily-rankings .card {
                flex: none;
                overflow: visible;
            }

            #tab-daily-rankings .card-body {
                overflow: visible;
            }

            #tab-daily-rankings .table-scroll-container {
                max-height: none;
                overflow-x: auto;
                overflow-y: visible;
            }

            /* Limit tables to 10 rows on mobile */
            #tab-daily-rankings .data-table tbody tr:nth-child(n+11) {
                display: none;
            }

            /* Cards - allow horizontal scroll inside */
            .card-body {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            /* Container & Layout */
            .container {
                padding: 15px;
            }

            .sticky-header-wrapper {
                margin: 0 -15px;
                padding-left: 15px;
                padding-right: 15px;
            }

            /* Header Compact */
            header {
                padding: 8px 0 12px;
            }

            .logo-icon {
                width: 36px;
                height: 36px;
            }

            .logo-text {
                font-size: 16px;
            }

            .logo-subtitle {
                font-size: 10px;
            }

            .header-status {
                display: none;
            }

            /* Cards */
            .card-header {
                padding: 12px 15px;
            }

            .card-body {
                padding: 15px;
            }

            /* Grids - Collapse to single column */
            .summary-row {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            .strategy-grid,
            .strategy-grid-2x2,
            .strategy-grid-3 {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .strategy-grid-4 {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            .metric-cards-grid {
                flex-wrap: wrap;
            }

            .metric-top5-card {
                flex: 1 1 100%;
                max-width: 100%;
            }

            .perf-summary {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            /* Tabs */
            .tabs {
                gap: 8px;
            }

            /* No font-size here: it would override the clamp() above. */
            .tab-btn {
                padding: 10px 12px;
                min-height: 44px;
            }

            /* Charts Responsive */
            #tab-performance [style*="height: 500px"],
            [style*="height: 500px"] {
                height: 300px !important;
            }

            .technical-analysis-widget .tradingview-widget-container {
                height: 200px !important;
            }

            /* Inline grids (gainers/losers) - collapse to 1 column */
            .live-rankings-grid {
                grid-template-columns: 1fr !important;
            }

            /* Blog Grid */
            #blog-posts-container {
                grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
                gap: 15px !important;
            }

            /* Blog Modal */
            #blog-modal > div {
                max-width: calc(100% - 20px) !important;
                margin: 10px auto !important;
            }

        }

        @media (max-width: 500px) {
            .strategy-grid-2x2,
            .strategy-grid-3,
            .strategy-grid-4 {
                grid-template-columns: 1fr;
            }

            .perf-summary {
                grid-template-columns: 1fr;
            }
        }

        /* Small phones (375px and below) */
        @media (max-width: 375px) {
            .container {
                padding: 10px;
            }

            .sticky-header-wrapper {
                margin: 0 -10px;
                padding-left: 10px;
                padding-right: 10px;
            }

            .card-header {
                padding: 10px 12px;
            }

            .card-body {
                padding: 12px;
            }

            .card-title {
                font-size: 10px;
                letter-spacing: 1px;
            }

            .summary-row {
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .summary-card {
                padding: 12px;
            }

            .summary-value {
                font-size: 18px;
            }

            .tab-btn {
                padding: 8px 10px;
            }

            /* Blog Grid single column */
            #blog-posts-container {
                grid-template-columns: 1fr !important;
            }

            /* Tables need smaller min-width */
            .table-scroll-container .data-table {
                min-width: 500px;
            }

            .data-table th,
            .data-table td {
                padding: 5px 8px;
                font-size: 10px;
            }
        }
