:root {
            /* Institutional Dark Palette (Bloomberg/Refinitiv Style) */
            --primary-gold: #d4af37;
            /* Flat Metallic Gold */
            --primary-gold-gradient: linear-gradient(135deg, #d4af37 0%, #fdb931 100%);
            /* Gold Gradient for Buttons */
            --bg-deep-blue: #05080c;
            /* Ultra Dark Neutral */

            --glass-surface: #0b0f14;
            /* Solid Card Background */
            --glass-border: #1e2329;
            /* Subtle Border */
            --glass-shadow: none;
            /* No Glow */

            --text-main: #e2e8f0;
            --text-muted: #94a3b8;

            /* Login Variables */
            --login-bg: #0b0f14;
            --login-card-bg: #0b0f14;
            --login-border: #1e2329;
            --login-input-bg: #05080c;
            --login-input-border: #2d3748;
            --login-text-main: #e2e8f0;
            --login-text-muted: #94a3b8;
        }

        body,
        html {
            width: 100%;
            min-height: 100vh;
            font-family: 'Poppins', sans-serif;
            color: var(--text-main);
            background-color: var(--bg-deep-blue);
            overflow-x: hidden;
            position: relative;
        }

        /* Lightweight visual texture (replaces heavy embedded noise asset) */
        body::after {
            content: "";
            position: fixed;
            inset: 0;
            background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0);
            background-size: 6px 6px;
            opacity: 0.06;
            pointer-events: none;
            z-index: 1000;
        }

        /* Header Styles */
        header {
            background: rgba(11, 15, 20, 0.95);
            /* High opacity solid */
            backdrop-filter: blur(8px);
            /* Minimal functional blur */
            padding: 15px 0;
            border-bottom: 1px solid var(--glass-border);
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
        }

        .header-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 20px;
            display: grid;
            grid-template-columns: 240px 1fr 240px;
            /* Logo - Nav - Actions */
            align-items: center;
            gap: 20px;
        }

        .logo-box {
            display: inline-flex;
            align-items: center;
            gap: 15px;
            padding: 0;
            background: transparent;
            border: none;
            box-shadow: none;
            text-decoration: none;
        }

        .logo-icon {
            width: 50px;
            height: 50px;
            border-radius: 0;
            overflow: visible;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            box-shadow: none;
        }

        .logo-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 12px;
            /* Slight rounding on the image itself if needed */
        }

        .logo-box:hover {
            transform: translateY(-1px);
        }

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

        .logo-text {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            line-height: 1.2;
        }

        .logo-box:hover {
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
            border-color: rgba(255, 215, 0, 0.6);
        }

        /* Removed .fl-letters as we use image now */
        .fl-letters {
            display: none;
        }

        .company-name {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--primary-gold);
            /* Flat Gold */
            /* Gradient Text Removed */
            letter-spacing: 0.5px;
        }

        .company-subtitle {
            font-size: 0.75rem;
            color: #ccc;
            letter-spacing: 3px;
            text-transform: uppercase;
            font-weight: 500;
        }

        .nav-menu {
            display: flex;
            justify-content: center;
            /* Center the navigation */
            gap: 20px;
            flex-wrap: wrap;
            overflow-x: visible;
            width: 100%;
        }

        .nav-item {
            color: #d4af37;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 0.9rem;
        }

        .nav-item:hover {
            background: rgba(212, 175, 55, 0.1);
        }

        .nav-item.active {
            background: rgba(212, 175, 55, 0.2);
            border-bottom: 2px solid #d4af37;
        }

        .header-actions {
            display: flex;
            gap: 10px;
            align-items: center;
            justify-content: flex-end;
            /* Push actions to the right */
        }

        .export-btn {
            background: var(--primary-gold);
            /* Solid Gold */
            color: #000;
            border: none;
            border-radius: 6px;
            padding: 10px 20px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
        }

        .export-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
        }

        .export-btn::before {
            content: '📄';
            font-size: 1.2rem;
        }

        /* Main Content */
        main {
            max-width: 1400px;
            margin: 0 auto;
            padding: 30px 20px;
        }

        .content-section {
            display: none;
        }

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

        /* Card & Section Styles - Pro Max Glassmorphism */
        .risk-calculator,
        .filter-section,
        .stats-container .stat-card,
        .trading-plan,
        .analysis-card,
        .chart-container {
            background: var(--glass-surface);
            border: 1px solid var(--glass-border);
            border-radius: 4px;
            /* Professional corners */
            padding: 25px;
            /* backdrop-filter removed */
            box-shadow: none;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .risk-calculator:hover,
        .filter-section:hover,
        .stat-card:hover,
        .trading-plan:hover,
        .analysis-card:hover,
        .chart-container:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
            border-color: rgba(255, 215, 0, 0.4);
        }

        .calculator-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .calc-card {
            background: rgba(30, 30, 30, 0.7);
            border-radius: 10px;
            padding: 15px;
            border: 1px solid rgba(212, 175, 55, 0.2);
            overflow: hidden;
            word-wrap: break-word;
            overflow-wrap: break-word;
            min-width: 0;
            box-sizing: border-box;
        }

        .calc-title {
            font-size: 0.95rem;
            color: #d4af37;
            margin-bottom: 12px;
            font-weight: 600;
            word-wrap: break-word;
            overflow-wrap: break-word;
            line-height: 1.3;
        }

        .calc-form {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .calc-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .calc-input {
            padding: 8px 10px;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 6px;
            color: #fff;
            font-family: 'Poppins', sans-serif;
            font-size: 0.9rem;
            box-sizing: border-box;
            width: 100%;
            min-width: 0;
        }

        .calc-input::placeholder {
            font-size: 0.85rem;
        }

        .calc-input:focus {
            outline: none;
            border-color: rgba(212, 175, 55, 0.5);
        }

        .calc-result {
            background: rgba(212, 175, 55, 0.1);
            border: 1px solid rgba(212, 175, 55, 0.3);
            border-radius: 6px;
            padding: 10px 12px;
            margin-top: 10px;
            overflow: hidden;
            word-wrap: break-word;
            overflow-wrap: break-word;
            max-width: 100%;
            box-sizing: border-box;
        }

        .result-label {
            font-size: 0.8rem;
            color: #a0a0a0;
            margin-bottom: 4px;
            word-wrap: break-word;
            overflow-wrap: break-word;
            line-height: 1.2;
        }

        .result-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: #d4af37;
            word-wrap: break-word;
            overflow-wrap: break-word;
            overflow: hidden;
            max-width: 100%;
            line-height: 1.2;
            hyphens: auto;
        }

        .calc-btn {
            background: linear-gradient(135deg, #d4af37, #f9f295);
            color: #000;
            border: none;
            border-radius: 6px;
            padding: 10px 20px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 10px;
        }

        .calc-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
        }

        /* Portfolio Risk */
        .portfolio-risk {
            background: rgba(248, 113, 113, 0.1);
            border: 1px solid rgba(248, 113, 113, 0.3);
            border-radius: 8px;
            padding: 12px;
            margin-top: 15px;
            overflow: hidden;
            word-wrap: break-word;
            overflow-wrap: break-word;
            box-sizing: border-box;
        }

        .risk-warning {
            color: #f87171;
            font-weight: 600;
            margin-bottom: 10px;
            font-size: 0.9rem;
            word-wrap: break-word;
            overflow-wrap: break-word;
            line-height: 1.3;
        }

        .risk-details {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 8px;
            min-width: 0;
        }

        .risk-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 8px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 4px;
            gap: 8px;
            min-width: 0;
            box-sizing: border-box;
        }

        .risk-item span {
            font-size: 0.85rem;
            word-wrap: break-word;
            overflow-wrap: break-word;
            line-height: 1.2;
            flex-shrink: 1;
            min-width: 0;
        }

        .risk-item span:first-child {
            color: #a0a0a0;
        }

        .risk-item span:last-child {
            color: #fff;
            font-weight: 600;
            text-align: right;
            flex-shrink: 0;
        }

        /* Filter Section */
        .filter-section {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 30px;
            backdrop-filter: blur(10px);
        }

        .filter-title {
            font-size: 1.2rem;
            color: #d4af37;
            margin-bottom: 15px;
            font-weight: 600;
        }

        .filter-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
        }

        .filter-label {
            font-size: 0.9rem;
            color: #a0a0a0;
            margin-bottom: 5px;
        }

        .filter-input,
        .filter-select {
            padding: 8px 12px;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 6px;
            color: #fff;
            font-family: 'Poppins', sans-serif;
        }

        .filter-actions {
            display: flex;
            gap: 10px;
            margin-top: 15px;
            flex-wrap: wrap;
        }

        .filter-advanced-panel {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px dashed rgba(212, 175, 55, 0.25);
        }

        .advanced-tools-toggle {
            display: flex;
            justify-content: flex-end;
            margin: 0 0 12px;
        }

        #advancedToolsPanel {
            display: none;
        }

        #advancedToolsPanel.open {
            display: block;
        }

        .btn-filter,
        .btn-reset {
            padding: 8px 20px;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-filter {
            background: linear-gradient(135deg, #d4af37, #f9f295);
            color: #000;
        }

        .btn-reset {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        .btn-filter:hover,
        .btn-reset:hover {
            transform: translateY(-2px);
        }

        /* Stats Container */
        .stats-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 12px;
            padding: 20px;
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(212, 175, 55, 0.1);
        }

        .stat-title {
            font-size: 0.9rem;
            color: #a0a0a0;
            margin-bottom: 8px;
        }

        .stat-value {
            font-size: 1.8rem;
            font-weight: 700;
            color: #d4af37;
        }

        .stat-change {
            font-size: 0.8rem;
            margin-top: 5px;
        }

        .positive {
            color: #4ade80;
        }

        .negative {
            color: #f87171;
        }

        /* Chart Container */
        .chart-container {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            backdrop-filter: blur(10px);
        }

        .chart-title {
            font-size: 1.2rem;
            color: #d4af37;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
        }

        .chart-wrapper {
            position: relative;
            height: 300px;
        }

        /* Calendar View Styles */
        .calendar-container {
            background: var(--glass-surface);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
        }

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

        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 10px;
        }

        .calendar-day-header {
            text-align: center;
            color: var(--text-muted);
            font-size: 0.8rem;
            padding-bottom: 10px;
        }

        .calendar-day {
            aspect-ratio: 1;
            background: rgba(30, 30, 30, 0.5);
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.05);
            padding: 5px;
            position: relative;
            cursor: pointer;
            transition: all 0.2s;
        }

        .calendar-day:hover {
            transform: scale(1.05);
            z-index: 2;
        }

        .calendar-day.has-profit {
            background: rgba(74, 222, 128, 0.15);
            border-color: rgba(74, 222, 128, 0.3);
        }

        .calendar-day.has-loss {
            background: rgba(248, 113, 113, 0.15);
            border-color: rgba(248, 113, 113, 0.3);
        }

        .day-number {
            font-size: 0.8rem;
            color: var(--text-muted);
            position: absolute;
            top: 5px;
            left: 8px;
        }

        .day-pnl {
            position: absolute;
            bottom: 5px;
            right: 8px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .day-count {
            position: absolute;
            bottom: 5px;
            left: 8px;
            font-size: 0.68rem;
            color: #94a3b8;
        }

        .calendar-day.is-today {
            border-color: rgba(212, 175, 55, 0.7);
            box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35) inset;
        }

        /* Trading Plan Section */
        .trading-plan {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 12px;
            padding: 25px;
            margin-bottom: 30px;
            backdrop-filter: blur(10px);
        }

        .plan-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        }

        .plan-tab {
            padding: 10px 20px;
            color: #a0a0a0;
            cursor: pointer;
            transition: all 0.3s ease;
            border-bottom: 2px solid transparent;
        }

        .plan-tab:hover {
            color: #d4af37;
        }

        .plan-tab.active {
            color: #d4af37;
            border-bottom-color: #d4af37;
        }

        .plan-content {
            display: none;
        }

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

        .checklist {
            background: rgba(30, 30, 30, 0.7);
            border-radius: 10px;
            padding: 20px;
        }

        .checklist-container {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .checklist-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px;
            background: rgba(30, 30, 30, 0.5);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 6px;
            transition: all 0.3s ease;
        }

        .checklist-item:hover {
            background: rgba(30, 30, 30, 0.7);
            border-color: rgba(212, 175, 55, 0.4);
        }

        .checklist-item input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            accent-color: #d4af37;
            flex-shrink: 0;
        }

        .checklist-item input[type="text"] {
            flex: 1;
            padding: 8px;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 4px;
            color: #fff;
            font-family: 'Poppins', sans-serif;
            font-size: 0.95rem;
            min-width: 0;
        }

        .checklist-item input[type="text"]:focus {
            outline: none;
            border-color: rgba(212, 175, 55, 0.5);
        }

        .checklist-item.checked input[type="text"] {
            text-decoration: line-through;
            opacity: 0.6;
        }

        .checklist-item button {
            padding: 6px 10px;
            background: rgba(248, 113, 113, 0.2);
            border: 1px solid rgba(248, 113, 113, 0.3);
            border-radius: 4px;
            color: #f87171;
            cursor: pointer;
            font-size: 0.85rem;
            flex-shrink: 0;
        }

        .checklist-item button:hover {
            background: rgba(248, 113, 113, 0.3);
        }

        .discipline-score {
            background: rgba(74, 222, 128, 0.1);
            border: 1px solid rgba(74, 222, 128, 0.3);
            border-radius: 8px;
            padding: 15px;
            margin-top: 20px;
            text-align: center;
        }

        .score-value {
            font-size: 2rem;
            font-weight: 700;
            color: #4ade80;
        }

        .score-label {
            color: #a0a0a0;
            margin-top: 5px;
        }

        /* Advanced Analysis */
        .analysis-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .analysis-card {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 12px;
            padding: 20px;
            backdrop-filter: blur(10px);
        }

        .analysis-title {
            font-size: 1.2rem;
            color: #d4af37;
            margin-bottom: 15px;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
        }

        .metric-confidence-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.66rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 3px 8px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.3);
            background: rgba(15, 23, 42, 0.5);
            color: #cbd5e1;
        }

        .metric-confidence-badge.low {
            color: #f87171;
            border-color: rgba(248, 113, 113, 0.45);
            background: rgba(127, 29, 29, 0.28);
        }

        .metric-confidence-badge.medium {
            color: #facc15;
            border-color: rgba(250, 204, 21, 0.45);
            background: rgba(120, 53, 15, 0.25);
        }

        .metric-confidence-badge.high {
            color: #4ade80;
            border-color: rgba(74, 222, 128, 0.45);
            background: rgba(22, 101, 52, 0.22);
        }

        .monte-carlo {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .simulation-controls {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .run-simulation {
            background: linear-gradient(135deg, #d4af37, #f9f295);
            color: #000;
            border: none;
            border-radius: 6px;
            padding: 12px 20px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .run-simulation:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
        }

        .simulation-results {
            background: rgba(30, 30, 30, 0.7);
            border-radius: 8px;
            padding: 15px;
        }

        .result-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid rgba(212, 175, 55, 0.1);
        }

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

        .correlation-matrix {
            overflow-x: auto;
        }

        .correlation-table {
            width: 100%;
            border-collapse: collapse;
        }

        .correlation-table th,
        .correlation-table td {
            padding: 10px;
            text-align: center;
            border: 1px solid rgba(212, 175, 55, 0.2);
        }

        .correlation-table th {
            background: rgba(212, 175, 55, 0.1);
            color: #d4af37;
        }

        .correlation-high {
            background: rgba(74, 222, 128, 0.2);
            color: #4ade80;
        }

        .correlation-low {
            background: rgba(248, 113, 113, 0.2);
            color: #f87171;
        }

        /* Advanced Charts */
        .heatmap-container {
            position: relative;
            height: 400px;
            margin: 20px 0;
        }

        .scatter-plot {
            position: relative;
            height: 400px;
            margin: 20px 0;
        }

        /* Calendar Tooltip */
        .calendar-tooltip {
            position: fixed;
            background: linear-gradient(135deg, rgba(20, 20, 30, 0.98), rgba(30, 25, 45, 0.98));
            border: 2px solid #d4af37;
            border-radius: 12px;
            padding: 18px;
            color: #fff;
            font-family: 'Poppins', sans-serif;
            font-size: 0.9rem;
            z-index: 10000;
            pointer-events: none;
            max-width: 500px;
            min-width: 350px;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(212, 175, 55, 0.3);
            backdrop-filter: blur(15px);
            display: none;
            line-height: 1.7;
            opacity: 0;
            transform: scale(0.95);
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .calendar-tooltip.active {
            display: block;
            opacity: 1;
            transform: scale(1);
        }

        .calendar-tooltip-header {
            font-size: 1rem;
            font-weight: 700;
            color: #d4af37;
            margin-bottom: 10px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(212, 175, 55, 0.3);
        }

        .calendar-tooltip-trade {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid rgba(212, 175, 55, 0.2);
        }

        .calendar-tooltip-trade:first-of-type {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

        .calendar-tooltip-row {
            display: flex;
            justify-content: space-between;
            margin: 4px 0;
            font-size: 0.8rem;
        }

        .calendar-tooltip-label {
            color: #a0a0a0;
        }

        .calendar-tooltip-value {
            color: #fff;
            font-weight: 600;
        }

        /* Trade Journal Section */
        .journal-section {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 12px;
            padding: 25px;
            margin-bottom: 30px;
            backdrop-filter: blur(10px);
        }

        .section-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: #d4af37;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .section-title::before {
            content: '';
            width: 5px;
            height: 25px;
            background: linear-gradient(to bottom, #d4af37, #f9f295);
            border-radius: 3px;
        }

        .trades-container {
            display: grid;
            gap: 20px;
        }

        .trade-card {
            background: rgba(30, 30, 30, 0.7);
            border-radius: 10px;
            padding: 20px;
            border-left: 4px solid;
            transition: all 0.3s ease;
        }

        .trade-card:hover {
            transform: translateX(5px);
        }

        .profit-trade {
            border-left-color: #4ade80;
        }

        .loss-trade {
            border-left-color: #f87171;
        }

        .breakeven-trade {
            border-left-color: #d4af37;
        }

        .ongoing-trade {
            border-left-color: #3b82f6;
        }

        .trade-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            flex-wrap: wrap;
            gap: 10px;
        }

        .trade-pair {
            font-size: 1.2rem;
            font-weight: 600;
        }

        .trade-date {
            color: #a0a0a0;
            font-size: 0.9rem;
        }

        .trade-result {
            font-size: 1.5rem;
            font-weight: 700;
        }

        .trade-details {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 15px;
            margin-bottom: 15px;
        }

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

        .detail-label {
            font-size: 0.8rem;
            color: #a0a0a0;
            margin-bottom: 3px;
        }

        .detail-value {
            font-size: 1rem;
            font-weight: 500;
        }

        .trade-images {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 15px;
        }

        .image-container {
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            min-height: 250px;
            aspect-ratio: 16 / 9;
        }

        .image-container img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            background: rgba(0, 0, 0, 0.3);
        }

        .image-label {
            position: absolute;
            top: 10px;
            left: 10px;
            background: rgba(0, 0, 0, 0.7);
            color: #d4af37;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .trade-thoughts {
            background: rgba(20, 20, 20, 0.7);
            border-radius: 8px;
            padding: 15px;
        }

        .thoughts-title {
            font-size: 1rem;
            color: #d4af37;
            margin-bottom: 10px;
            font-weight: 600;
        }

        .thoughts-content {
            color: #e0e0e0;
            line-height: 1.5;
        }

        .strategy-tag {
            display: inline-block;
            background: rgba(212, 175, 55, 0.2);
            color: #d4af37;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            margin-right: 5px;
        }

        .emotional-state {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            margin-left: 10px;
        }

        .emotional-positive {
            background: rgba(74, 222, 128, 0.2);
            color: #4ade80;
        }

        .emotional-negative {
            background: rgba(248, 113, 113, 0.2);
            color: #f87171;
        }

        .emotional-neutral {
            background: rgba(212, 175, 55, 0.2);
            color: #d4af37;
        }

        /* Goals Section */
        .goals-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .goal-card {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 12px;
            padding: 20px;
            backdrop-filter: blur(10px);
        }

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

        .goal-title {
            font-size: 1.1rem;
            color: #d4af37;
            font-weight: 600;
        }

        .goal-progress {
            width: 100%;
            height: 20px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        .goal-progress-bar {
            height: 100%;
            background: linear-gradient(135deg, #d4af37, #f9f295);
            transition: width 0.3s ease;
        }

        .goal-stats {
            display: flex;
            justify-content: space-between;
            font-size: 0.9rem;
            color: #a0a0a0;
        }

        /* Add Trade Button */
        .add-trade-btn {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #d4af37, #f9f295);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
            transition: all 0.3s ease;
            z-index: 50;
        }

        .add-trade-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
        }

        .add-trade-btn::before {
            content: '+';
            font-size: 2rem;
            font-weight: 700;
            color: #000;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 200;
            align-items: center;
            justify-content: center;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: #1a1a1a;
            border: 1px solid rgba(212, 175, 55, 0.3);
            border-radius: 12px;
            padding: 30px;
            width: 90%;
            max-width: 700px;
            max-height: 90vh;
            overflow-y: auto;
        }

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

        .modal-title {
            font-size: 1.5rem;
            color: #d4af37;
            font-weight: 600;
        }

        .close-modal {
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .close-modal:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .close-modal::before {
            content: '×';
            font-size: 1.5rem;
            color: #fff;
        }

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

        .form-label {
            display: block;
            margin-bottom: 8px;
            color: #d4af37;
            font-weight: 500;
        }

        .form-input,
        .form-select,
        .form-textarea {
            width: 100%;
            padding: 12px;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(212, 175, 55, 0.2);
            border-radius: 6px;
            color: #fff;
            font-family: 'Poppins', sans-serif;
            font-size: 16px;
            /* Prevent iOS zoom */
            transition: border-color 0.3s ease;
        }

        .form-input:focus,
        .form-select:focus,
        .form-textarea:focus {
            outline: none;
            border-color: rgba(212, 175, 55, 0.5);
        }

        .form-input.error,
        .form-select.error,
        .form-textarea.error {
            border-color: #f87171;
        }

        .form-textarea {
            min-height: 100px;
            max-height: 200px;
            resize: vertical;
            overflow-y: auto;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

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

        .form-submit {
            background: linear-gradient(135deg, #d4af37, #f9f295);
            color: #000;
            border: none;
            border-radius: 6px;
            padding: 12px 20px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .form-submit:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
        }

        .form-submit:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .error-message {
            color: #f87171;
            font-size: 0.8rem;
            margin-top: 5px;
            display: none;
        }

        .error-message.show {
            display: block;
        }

        /* Loading Spinner */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(212, 175, 55, 0.3);
            border-radius: 50%;
            border-top-color: #d4af37;
            animation: spin 1s ease-in-out infinite;
        }

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

        /* Tabs */
        .tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        }

        .tab {
            padding: 10px 20px;
            color: #a0a0a0;
            cursor: pointer;
            transition: all 0.3s ease;
            border-bottom: 2px solid transparent;
        }

        .tab:hover {
            color: #d4af37;
        }

        .tab.active {
            color: #d4af37;
            border-bottom-color: #d4af37;
        }

        .tab-content {
            display: none;
        }

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

        /* Duration Metrics */
        .duration-metrics {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .duration-card {
            background: rgba(30, 30, 30, 0.7);
            border-radius: 8px;
            padding: 15px;
            border: 1px solid rgba(212, 175, 55, 0.2);
        }

        .duration-title {
            font-size: 0.9rem;
            color: #a0a0a0;
            margin-bottom: 5px;
        }

        .duration-value {
            font-size: 1.2rem;
            font-weight: 600;
            color: #d4af37;
        }

        /* Promo Screen Styles */
        .promo-overlay {
            position: fixed;
            inset: 0;
            z-index: 10020;
            display: flex;
            align-items: stretch;
            justify-content: stretch;
            padding: 0;
            overflow: hidden;
            overscroll-behavior-y: contain;
            -webkit-overflow-scrolling: touch;
            touch-action: pan-y;
            background:
                radial-gradient(1200px 640px at 12% -12%, rgba(212, 175, 55, 0.2), transparent 46%),
                radial-gradient(1000px 540px at 90% 114%, rgba(126, 197, 255, 0.12), transparent 52%),
                linear-gradient(155deg, #070a10 0%, #0b0f14 50%, #111826 100%);
            backdrop-filter: blur(10px);
        }

        .promo-tubes-canvas,
        .promo-noise,
        .promo-vignette {
            position: absolute;
            inset: 0;
        }

        .promo-tubes-canvas {
            z-index: 1;
            opacity: 1;
            pointer-events: none;
            filter: saturate(1.16) contrast(1.08);
        }

        .promo-noise,
        .promo-vignette {
            pointer-events: none;
        }

        .promo-noise {
            z-index: 2;
            opacity: 0.03;
            mix-blend-mode: soft-light;
            background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.9) 1px, transparent 0);
            background-size: 3px 3px;
            animation: promoNoiseShift 0.28s steps(2) infinite;
        }

        .promo-vignette {
            z-index: 3;
            background: radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.32) 100%);
        }

        .promo-debug-hero {
            position: relative;
            z-index: 6;
            width: 100%;
            min-height: 100dvh;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            pointer-events: none;
            text-align: center;
            color: #fff;
            text-shadow: 0 0 20px rgba(0, 0, 0, 1);
        }

        .promo-debug-hero .promo-debug-line-1,
        .promo-debug-hero .promo-debug-line-2,
        .promo-debug-hero p {
            margin: 0;
            padding: 0;
            user-select: none;
            line-height: 1;
        }

        .promo-debug-hero .promo-debug-line-1 {
            font-size: clamp(54px, 7vw, 92px);
            font-weight: 700;
            text-transform: uppercase;
        }

        .promo-debug-hero .promo-debug-line-2 {
            font-size: clamp(40px, 5vw, 68px);
            font-weight: 500;
            text-transform: uppercase;
        }

        .promo-debug-hero p {
            margin-top: 8px;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.86);
        }

        .promo-overlay.debug-mode .promo-container {
            display: none;
        }

        .promo-overlay.debug-mode .promo-debug-hero {
            display: flex;
        }

        .promo-overlay.debug-mode .promo-noise {
            opacity: 0;
        }

        .promo-candle-river {
            display: none;
        }

        .promo-candle-track {
            display: flex;
            gap: 34px;
            width: max-content;
            min-width: 100%;
            align-items: flex-end;
            transform: translateX(0);
            animation: candleDrift 70s linear infinite;
        }

        @keyframes candleDrift {
            0% { transform: translateX(0); }
            100% { transform: translateX(-34%); }
        }

        @keyframes promoNoiseShift {
            0% { transform: translate3d(0, 0, 0); }
            100% { transform: translate3d(-1px, 1px, 0); }
        }

        .promo-container {
            position: relative;
            z-index: 4;
            width: 100%;
            min-height: 100vh;
            display: flex;
            touch-action: pan-y;
        }

        .promo-card {
            width: 100%;
            min-height: 100dvh;
            display: grid;
            grid-template-columns: 1.05fr .95fr;
            align-items: center;
            gap: clamp(20px, 3.5vw, 48px);
            padding:
                max(18px, env(safe-area-inset-top))
                clamp(20px, 7vw, 96px)
                max(18px, env(safe-area-inset-bottom));
            background: linear-gradient(120deg, rgba(8, 11, 16, 0.7), rgba(8, 11, 16, 0.44));
            box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.16);
            animation: promoFadeIn 0.45s ease;
            touch-action: pan-y;
        }

        .promo-left { text-align: left; }

        .promo-right {
            display: grid;
            gap: 12px;
            align-content: center;
        }

        @keyframes promoFadeIn {
            from { opacity: 0; transform: scale(0.99); }
            to { opacity: 1; transform: scale(1); }
        }

        .promo-logo-wrap {
            margin: 0 0 14px;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            background: transparent;
            border: none;
            box-shadow: none;
        }

        .promo-logo {
            width: clamp(82px, 7.2vw, 118px);
            height: clamp(82px, 7.2vw, 118px);
            object-fit: contain;
            image-rendering: auto;
            filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.45));
        }

        .promo-logo-fallback {
            width: 78px;
            height: 78px;
            border-radius: 16px;
            align-items: center;
            justify-content: center;
            font-size: 2.1rem;
            font-weight: 800;
            color: #d4af37;
            background: transparent;
            box-shadow: none;
            font-family: 'Poppins', sans-serif;
            letter-spacing: .5px;
            text-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(212, 175, 55, 0.35);
        }

        .promo-badge {
            margin: 2px 0 16px;
            width: fit-content;
            padding: 5px 12px;
            border-radius: 999px;
            border: 1px solid rgba(212, 175, 55, 0.28);
            background: rgba(212, 175, 55, 0.1);
            color: #d4af37;
            font-size: 0.66rem;
            font-weight: 700;
            letter-spacing: 1.15px;
            text-shadow: 0 0 10px rgba(212, 175, 55, 0.28);
        }

        .promo-title {
            margin: 0 0 10px;
            color: #ffffff;
            font-size: clamp(1.9rem, 4vw, 3.2rem);
            font-weight: 800;
            letter-spacing: -0.6px;
            line-height: 1.08;
            text-wrap: balance;
        }

        .promo-title-accent {
            display: block;
            background: linear-gradient(90deg, #d4af37, #f9f295 60%, #9ad7ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .promo-subtitle {
            margin: 0;
            max-width: 640px;
            color: #d7deeb;
            font-size: clamp(0.98rem, 1.2vw, 1.12rem);
            line-height: 1.62;
        }

        .promo-feature-list {
            margin: 18px 0;
            display: grid;
            gap: 8px;
        }

        .promo-feature-item {
            display: flex;
            flex-direction: column;
            gap: 2px;
            color: #e2e8f0;
            font-size: clamp(0.9rem, 0.98vw, 0.98rem);
            line-height: 1.4;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid rgba(212, 175, 55, 0.18);
            background: rgba(0, 0, 0, 0.34);
            backdrop-filter: blur(4px);
        }

        .promo-feature-item strong { color: #f8f0d1; font-weight: 700; }
        .promo-feature-item span { color: #d2daea; }

        .promo-actions {
            margin-top: 8px;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 12px;
            flex-wrap: wrap;
        }


        .promo-site-footer {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: 1.1fr 1fr;
            gap: 14px;
            margin-top: 6px;
            padding: 12px 14px;
            border-radius: 12px;
            border: 1px solid rgba(212, 175, 55, 0.18);
            background: rgba(6, 10, 16, 0.72);
            backdrop-filter: blur(6px);
        }

        .promo-footer-title {
            margin: 0 0 8px;
            color: #f8f0d1;
            line-height: 1.25;
            font-size: 0.86rem;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            font-weight: 700;
        }

        .promo-footer-brand .promo-footer-title {
            font-size: 0.9rem;
            text-transform: none;
            letter-spacing: 0;
            margin-bottom: 4px;
        }

        .promo-site-footer p {
            margin: 0;
            color: #cbd5e6;
            font-size: 0.76rem;
            line-height: 1.45;
        }

        .promo-footer-meta p {
            font-size: 0.74rem;
            line-height: 1.4;
        }

        .promo-footer-meta p strong {
            font-size: 0.74rem;
            font-weight: 700;
            color: #f0f4fb;
        }

        .promo-footer-link-grid {
            display: grid;
            gap: 6px;
        }

        .promo-footer-link-grid a,
        .promo-footer-legal-inline a,
        .promo-footer-meta a {
            color: #d4af37;
            text-decoration: none;
            font-size: 0.81rem;
        }

        .promo-footer-link-grid a:hover,
        .promo-footer-legal-inline a:hover,
        .promo-footer-meta a:hover {
            color: #f8ebbc;
        }

        .promo-footer-legal-inline {
            margin-top: 8px;
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .promo-footer-meta-compact {
            display: flex;
            flex-direction: column;
            gap: 6px;
            align-items: flex-end;
        }

        .promo-meta-row {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            color: #cbd5e6;
            font-size: 0.72rem;
            line-height: 1.35;
        }

        .promo-meta-label {
            color: #f8f0d1;
            font-weight: 700;
            font-size: 0.72rem;
            white-space: nowrap;
        }

        .promo-meta-text {
            color: #cbd5e6;
            font-size: 0.72rem;
        }

        .promo-meta-sep {
            color: #7f8da6;
            font-size: 0.74rem;
        }

        .promo-meta-row-right {
            justify-content: flex-end;
            text-align: right;
        }

        .promo-meta-links {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .promo-meta-row-copy {
            margin-top: -1px;
        }

        .promo-footer-copy {
            color: #95a4bb !important;
            font-size: 0.7rem !important;
        }

        .promo-cta-primary,
        .promo-cta-secondary {
            --btn-grad-start: #d4af37;
            --btn-grad-end: #f9f295;
            width: 9.8em;
            min-width: 210px;
            height: 3em;
            min-height: 48px;
            border-radius: 30em;
            font-size: 15px;
            font-family: inherit;
            font-weight: 700;
            border: 1px solid rgba(212, 175, 55, 0.42);
            position: relative;
            overflow: hidden;
            z-index: 1;
            cursor: pointer;
            transition: transform .25s ease, box-shadow .25s ease, color .25s ease;
            box-shadow:
                0 10px 24px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 rgba(255, 240, 173, 0.18);
            background: rgba(17, 15, 10, 0.82);
        }

        .promo-cta-primary::before,
        .promo-cta-secondary::before {
            content: '';
            width: 0;
            height: 100%;
            border-radius: 30em;
            position: absolute;
            top: 0;
            left: 0;
            background-image: linear-gradient(90deg, var(--btn-grad-start) 0%, var(--btn-grad-end) 100%);
            transition: width .45s ease;
            display: block;
            z-index: -1;
        }

        .promo-cta-primary:hover::before,
        .promo-cta-secondary:hover::before {
            width: 100%;
        }

        .promo-cta-primary {
            color: #f8ebbc;
            background: rgba(26, 23, 13, 0.82);
            border-color: rgba(249, 242, 149, 0.58);
            --btn-grad-start: #d4af37;
            --btn-grad-end: #f9f295;
            box-shadow:
                0 12px 30px rgba(212, 175, 55, 0.28),
                0 8px 22px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 rgba(255, 246, 192, 0.24);
        }

        .promo-cta-primary:hover {
            color: #0d1b2a;
            transform: translateY(-2px);
            box-shadow:
                0 14px 34px rgba(212, 175, 55, 0.38),
                0 10px 24px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 251, 217, 0.26);
        }

        .promo-cta-primary:active {
            transform: translateY(0);
            box-shadow:
                0 7px 18px rgba(212, 175, 55, 0.28),
                0 6px 16px rgba(0, 0, 0, 0.42);
        }

        .promo-cta-secondary {
            color: #f2e1ab;
            background: rgba(28, 23, 12, 0.84);
            border-color: rgba(214, 175, 77, 0.58);
            --btn-grad-start: #8f6f22;
            --btn-grad-end: #cfb053;
            box-shadow:
                0 10px 24px rgba(109, 83, 24, 0.34),
                0 8px 22px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 rgba(255, 236, 170, 0.14);
        }

        .promo-cta-secondary:hover {
            color: #faefc8;
            transform: translateY(-1px);
            box-shadow:
                0 12px 28px rgba(170, 131, 38, 0.35),
                0 9px 20px rgba(0, 0, 0, 0.48),
                inset 0 1px 0 rgba(255, 241, 190, 0.2);
        }

        .promo-cta-secondary:active {
            transform: translateY(0);
        }

        .promo-cta-primary:focus-visible,
        .promo-cta-secondary:focus-visible {
            outline: 2px solid rgba(154, 215, 255, 0.95);
            outline-offset: 2px;
            box-shadow: 0 0 0 4px rgba(154, 215, 255, 0.25);
        }

        .promo-mini-card {
            border: 1px solid rgba(212, 175, 55, 0.22);
            background: linear-gradient(160deg, rgba(14, 18, 28, 0.78), rgba(11, 14, 22, 0.56));
            border-radius: 14px;
            padding: 16px;
            backdrop-filter: blur(5px);
            box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
        }

        .promo-mini-card-top {
            border-color: rgba(122, 198, 255, 0.24);
            background: linear-gradient(145deg, rgba(24, 35, 56, 0.62), rgba(11, 14, 22, 0.54));
        }

        .promo-grid-cards {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .pm-head {
            font-size: 0.68rem;
            letter-spacing: 1.1px;
            color: #b6c5de;
            font-weight: 700;
            text-transform: uppercase;
            margin-bottom: 8px;
        }

        .pm-value {
            font-size: clamp(1.25rem, 2vw, 1.85rem);
            color: #f6f3e6;
            font-weight: 800;
            line-height: 1;
            margin-bottom: 6px;
        }

        .pm-value-text {
            font-size: clamp(1.02rem, 1.35vw, 1.22rem);
            line-height: 1.35;
            font-weight: 700;
        }

        .pm-sub {
            font-size: 0.82rem;
            color: #d1d9e8;
            line-height: 1.56;
        }

        .promo-mini-card-chart {
            padding-bottom: 10px;
        }

        .promo-mini-card-lb {
            padding: 12px 14px;
            min-height: 300px;
        }

        .promo-lb-periods {
            display: flex;
            gap: 6px;
            margin-bottom: 10px;
        }

        .promo-lb-period-btn {
            border: 1px solid rgba(241, 199, 93, 0.22);
            background: rgba(10, 14, 22, 0.28);
            color: #cfd9ea;
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 0.74rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .promo-lb-period-btn:hover {
            border-color: rgba(241, 199, 93, 0.4);
            color: #f5d479;
        }

        .promo-lb-period-btn.active {
            border-color: rgba(241, 199, 93, 0.72);
            color: #f5d479;
            background: rgba(241, 199, 93, 0.12);
        }

        .promo-lb-list {
            display: grid;
            gap: 6px;
            max-height: 248px;
            overflow: auto;
            padding-right: 2px;
        }

        .promo-lb-row {
            display: grid;
            grid-template-columns: 22px 1fr auto;
            align-items: center;
            gap: 7px;
            border: 1px solid rgba(241, 199, 93, 0.1);
            border-radius: 8px;
            padding: 5px 7px;
            background: rgba(10, 14, 22, 0.34);
            backdrop-filter: blur(2px);
        }

        .promo-lb-rank {
            color: #f1c75d;
            font-weight: 700;
            font-size: .78rem;
            text-align: center;
        }

        .promo-lb-name {
            color: #e7edf7;
            font-size: .82rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .promo-lb-val {
            color: #86efac;
            font-size: .8rem;
            font-weight: 700;
        }

        .promo-lb-empty {
            color: #aebcd3;
            font-size: .82rem;
        }

        .promo-mini-card-access {
            padding: 12px 14px;
            min-height: 180px;
        }

        .promo-access-list {
            display: grid;
            gap: 6px;
            max-height: 160px;
            overflow: auto;
            padding-right: 2px;
        }

        .promo-access-row {
            display: grid;
            grid-template-columns: 68px 1fr auto;
            align-items: center;
            gap: 8px;
            border: 1px solid rgba(122, 198, 255, 0.16);
            border-radius: 8px;
            padding: 5px 8px;
            background: rgba(10, 14, 22, 0.30);
        }

        .promo-access-time {
            color: #9db2d6;
            font-size: .74rem;
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        }

        .promo-access-name {
            color: #e7edf7;
            font-size: .82rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .promo-access-action {
            font-size: .74rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .05em;
        }

        .promo-access-action.in {
            color: #86efac;
        }

        .promo-access-action.out {
            color: #fca5a5;
        }

        /* From Uiverse.io by bilal_9731 */
        .candle-wrapper {
            --candle-main: #c27b76;
            --candle-light: #ffe3d2;
            --candle-mid: #e9b1a3;
            --candle-wick: #ffe9df;
            display: flex;
            justify-content: center;
            padding: 2px 0 10px;
            background: #00000000;
        }

        .candle-chart {
            display: flex;
            align-items: flex-end;
            overflow: hidden;
        }

        .candle-chart--card {
            justify-content: space-between;
            width: min(100%, 520px);
            height: 124px;
            gap: 8px;
        }

        .candle-chart--ambient {
            justify-content: space-between;
            width: 220px;
            height: 190px;
            gap: 6px;
            opacity: .9;
        }

        .candle {
            width: 10px;
            height: 100%;
            position: relative;
            transform-origin: bottom;
            animation: fade 2.6s infinite ease-in-out;
            filter: drop-shadow(0 0 6px rgba(194, 123, 118, 0.64));
        }

        .candle-chart--ambient .candle {
            width: 8px;
            animation-duration: 3.2s;
            filter: drop-shadow(0 0 8px rgba(194, 123, 118, 0.72));
        }

        .candle::after {
            content: "";
            position: absolute;
            left: 0;
            width: 100%;
            background: linear-gradient(180deg, var(--candle-light) 0%, var(--candle-mid) 52%, var(--candle-main) 100%);
            border: 1px solid rgba(255, 223, 214, 0.88);
            box-shadow: 0 0 10px rgba(194, 123, 118, 0.56);
            bottom: var(--b);
            height: var(--h);
        }

        .candle::before {
            content: "";
            position: absolute;
            left: 63%;
            transform: translateX(-50%);
            width: 2px;
            background: var(--candle-wick);
            box-shadow: 0 0 9px rgba(255, 228, 220, 0.5);
            bottom: var(--wb);
            height: var(--wh);
        }

        .candle:nth-child(1) {
            --b: 7.1%;
            --h: 18.93%;
            --wb: 0%;
            --wh: 31.95%;
            animation-delay: 0s;
        }

        .candle:nth-child(2) {
            --b: 26.04%;
            --h: 2.37%;
            --wb: 19.41%;
            --wh: 14.91%;
            animation-delay: 0.065s;
        }

        .candle:nth-child(3) {
            --b: 28.64%;
            --h: 4.5%;
            --wb: 16.92%;
            --wh: 21.66%;
            animation-delay: 0.13s;
        }

        .candle:nth-child(4) {
            --b: 31.42%;
            --h: 3.43%;
            --wb: 19.76%;
            --wh: 27.93%;
            animation-delay: 0.195s;
        }

        .candle:nth-child(5) {
            --b: 31.42%;
            --h: 15.44%;
            --wb: 27.43%;
            --wh: 28.07%;
            animation-delay: 0.26s;
        }

        .candle:nth-child(6) {
            --b: 46.54%;
            --h: 0.28%;
            --wb: 43.43%;
            --wh: 24.38%;
            animation-delay: 0.325s;
        }

        .candle:nth-child(7) {
            --b: 35.86%;
            --h: 8.7%;
            --wb: 29.7%;
            --wh: 24.5%;
            animation-delay: 0.39s;
        }

        .candle:nth-child(8) {
            --b: 11.67%;
            --h: 24.19%;
            --wb: 5.33%;
            --wh: 31.83%;
            animation-delay: 0.455s;
        }

        .candle:nth-child(9) {
            --b: 11.83%;
            --h: 15.1%;
            --wb: 7.93%;
            --wh: 24.97%;
            animation-delay: 0.52s;
        }

        .candle:nth-child(10) {
            --b: 27.81%;
            --h: 12.04%;
            --wb: 27.69%;
            --wh: 28.17%;
            animation-delay: 0.585s;
        }

        .candle:nth-child(11) {
            --b: 39.85%;
            --h: 28.25%;
            --wb: 39.53%;
            --wh: 28.58%;
            animation-delay: 0.65s;
        }

        .candle:nth-child(12) {
            --b: 70.8%;
            --h: 6.27%;
            --wb: 60.96%;
            --wh: 24.84%;
            animation-delay: 0.715s;
        }

        .candle:nth-child(13) {
            --b: 75.8%;
            --h: 2.71%;
            --wb: 68.38%;
            --wh: 31.62%;
            animation-delay: 0.78s;
        }

        .candle:nth-child(14) {
            --b: 67.23%;
            --h: 8.71%;
            --wb: 64.8%;
            --wh: 24.97%;
            animation-delay: 0.845s;
        }

        .candle:nth-child(15) {
            --b: 67.81%;
            --h: 7.85%;
            --wb: 57.54%;
            --wh: 27.55%;
            animation-delay: 0.91s;
        }

        .candle:nth-child(16) {
            --b: 70.08%;
            --h: 6.14%;
            --wb: 55.68%;
            --wh: 21.83%;
            animation-delay: 0.975s;
        }

        .candle:nth-child(17) {
            --b: 66.39%;
            --h: 3.69%;
            --wb: 58.11%;
            --wh: 26.11%;
            animation-delay: 1.04s;
        }

        .candle:nth-child(18) {
            --b: 64.8%;
            --h: 9.78%;
            --wb: 45.47%;
            --wh: 29.61%;
            animation-delay: 1.105s;
        }

        @keyframes fade {
            0% {
                opacity: 0.35;
                transform: scaleY(0.86);
            }

            18% {
                opacity: 0.95;
                transform: scaleY(1.08);
            }

            52% {
                opacity: 1;
                transform: scaleY(1);
            }

            80% {
                opacity: 0.84;
                transform: scaleY(1.06);
            }

            100% {
                opacity: 0.4;
                transform: scaleY(0.88);
            }
        }

        @media (max-height: 900px) and (min-width: 981px) {
            .promo-card {
                padding: 18px 52px 22px;
                gap: 20px;
            }

            .promo-title {
                font-size: clamp(1.7rem, 3vw, 2.75rem);
                line-height: 1.1;
                margin-bottom: 10px;
            }

            .promo-subtitle {
                font-size: clamp(0.95rem, 1vw, 1.06rem);
                line-height: 1.58;
            }

            .promo-feature-list {
                margin: 16px 0;
                gap: 8px;
            }

            .promo-feature-item {
                padding: 10px 12px;
            }

            .promo-mini-card {
                padding: 13px;
            }

            .pm-sub {
                font-size: 0.78rem;
                line-height: 1.45;
            }

            .promo-cta-primary,
            .promo-cta-secondary {
                min-height: 44px;
                padding: 12px 18px;
                font-size: 0.95rem;
            }
        }

        @media (max-height: 820px) and (min-width: 981px) {
            .promo-card {
                grid-template-columns: 1fr;
                gap: 12px;
                align-content: center;
                padding: 14px 30px 16px;
            }

            .promo-right {
                display: none;
            }

            .promo-left {
                max-width: 980px;
                margin: 0 auto;
            }

            .promo-title {
                font-size: clamp(1.55rem, 2.5vw, 2.2rem);
                margin-bottom: 8px;
            }

            .promo-subtitle {
                font-size: 0.98rem;
                line-height: 1.52;
            }

            .promo-feature-list {
                margin: 12px 0;
                gap: 7px;
            }

            .promo-feature-item {
                padding: 8px 11px;
                font-size: 0.92rem;
            }
        }

        @media (max-width: 980px) {
            .promo-overlay {
                overflow-y: auto;
                align-items: flex-start;
                backdrop-filter: none;
                -webkit-backdrop-filter: none;
            }

            .promo-container {
                min-height: 100%;
            }

            .promo-card {
                min-height: auto;
                grid-template-columns: 1fr;
                align-content: flex-start;
                align-items: start;
                gap: 18px;
                padding: 24px 16px 26px;
            }

            .promo-left { text-align: center; }
            .promo-logo-wrap,
            .promo-badge,
            .promo-subtitle { margin-left: auto; margin-right: auto; }
            .promo-logo-wrap { justify-content: center; }
            .promo-actions { justify-content: center; }
            .promo-right { width: min(680px, 100%); margin: 0 auto; }

            .promo-site-footer {
                grid-template-columns: 1fr;
                text-align: left;
                gap: 14px;
            }

            .promo-footer-link-grid a,
            .promo-footer-legal-inline a,
            .promo-footer-meta a {
                min-height: 44px;
                display: inline-flex;
                align-items: center;
            }
        }

        @media (max-width: 768px) {
            .promo-noise { opacity: 0.05; }
            .promo-title { font-size: clamp(1.6rem, 8vw, 2.2rem); }
            .promo-subtitle { font-size: 0.95rem; }
            .promo-feature-item { font-size: 0.86rem; }
            .promo-grid-cards { grid-template-columns: 1fr; }
            .promo-mini-card-lb { min-height: auto; }
            .promo-mini-card-access { min-height: auto; }
            .promo-lb-periods { flex-wrap: wrap; }
            .promo-lb-list { max-height: 180px; }
            .promo-access-list { max-height: 140px; }
            .candle-chart--card { height: 96px; gap: 6px; }
            .candle-chart--card .candle { width: 8px; }
            .promo-candle-river {
                height: 24vh;
                opacity: 0.22;
            }
            .candle-chart--ambient {
                width: 160px;
                height: 124px;
                gap: 4px;
            }
            .candle-chart--ambient .candle { width: 6px; }

            .promo-cta-primary,
            .promo-cta-secondary {
                width: 100%;
                min-width: 0;
            }

            .promo-footer-link-grid a,
            .promo-footer-legal-inline a {
                font-size: 0.76rem;
            }

            .promo-meta-row {
                font-size: 0.74rem;
                gap: 6px;
            }

            .promo-footer-meta-compact {
                align-items: flex-start;
            }

            .promo-meta-label,
            .promo-meta-text {
                font-size: 0.74rem;
            }

            .promo-meta-row-right {
                justify-content: flex-start;
                text-align: left;
            }

            .promo-meta-links {
                justify-content: flex-start;
            }
        }

        @media (pointer: coarse) {
            .promo-tubes-canvas,
            .promo-noise,
            .promo-candle-river {
                display: none;
            }

            .promo-vignette {
                background: radial-gradient(circle at center, transparent 52%, rgba(0, 0, 0, 0.2) 100%);
            }

            .promo-noise,
            .promo-candle-track,
            .candle {
                animation: none !important;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .promo-noise,
            .promo-candle-track { animation: none; }
            .candle { animation: none; opacity: 0.9; transform: none; }
            .promo-cta-primary,
            .promo-cta-secondary { transition: none; }
        }

        /* Login Styles */

        /* Design System - Login Component tokens */
        :root {
            --login-bg: radial-gradient(1200px 600px at 18% -10%, rgba(212,175,55,0.14), transparent 40%), linear-gradient(145deg, #05070c 0%, #0b0f14 55%, #121722 100%);
            --login-card-bg: rgba(10, 14, 20, 0.88);
            --login-border: rgba(212, 175, 55, 0.28);
            --login-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
            --login-input-bg: rgba(0, 0, 0, 0.45);
            --login-input-border: rgba(212, 175, 55, 0.22);
            --login-input-focus: rgba(212, 175, 55, 0.5);
            --login-text-primary: #ffffff;
            --login-text-secondary: #a0a8b8;
            --login-Gold: #FFD700;
        }

        .login-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--login-bg);
            display: flex;
            justify-content: center;
            align-items: center;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            z-index: 10000;
            backdrop-filter: blur(20px);
            padding: 12px 0;
            box-sizing: border-box;
        }

        .login-container {
            width: 100%;
            max-width: 620px;
            padding: clamp(24px, 4vw, 56px);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100dvh;
            box-sizing: border-box;
        }

        .login-box {
            background: var(--login-card-bg);
            border: 1px solid var(--login-border);
            padding: 42px 36px;
            border-radius: 18px;
            width: 100%;
            text-align: center;
            box-shadow: var(--login-shadow);
            backdrop-filter: blur(8px);
            position: relative;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            max-height: calc(100dvh - 72px);
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        .login-box::before {
            display: none;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        .login-header {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }

        .login-logo {
            width: 100px;
            height: 100px;
            margin: 0 auto;
            background: transparent;
            border: none;
            box-shadow: none;
        }

        .login-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
        }

        .login-header h2 {
            font-size: 2rem;
            font-weight: 700;
            background: var(--primary-gold-gradient);
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: -0.5px;
            line-height: 1.2;
            margin: 0;
        }

        .login-header p {
            color: var(--login-text-secondary);
            font-size: 0.95rem;
            font-weight: 400;
            margin: 0;
        }

        .auth-mode-tabs {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 6px;
            width: 100%;
            padding: 6px;
            border-radius: 14px;
            border: 1px solid rgba(212, 175, 55, 0.22);
            background: rgba(10, 14, 22, 0.58);
            backdrop-filter: blur(10px);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
        }

        .auth-mode-tab {
            -webkit-appearance: none;
            appearance: none;
            min-height: 36px;
            border-radius: 10px;
            border: 1px solid transparent !important;
            background: transparent !important;
            color: #b8c4d9 !important;
            font-size: 0.76rem;
            font-weight: 650;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .auth-mode-tab:hover {
            color: #f3e8bb !important;
            background: rgba(212, 175, 55, 0.08) !important;
        }

        .auth-mode-tab.active {
            background: linear-gradient(135deg, rgba(212,175,55,0.95), rgba(249,242,149,0.95)) !important;
            color: #111827 !important;
            border-color: rgba(212, 175, 55, 0.98) !important;
            box-shadow: 0 6px 14px rgba(212, 175, 55, 0.26), inset 0 1px 0 rgba(255,255,255,0.35);
        }

        .login-form {
            display: flex;
            flex-direction: column;
            gap: 24px;
            position: relative;
            z-index: 1;
            width: 100%;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
            text-align: left;
            /* Fixed: left-aligned for better UX */
            width: 100%;
        }

        .login-label {
            color: var(--primary-gold);
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            text-align: center;
            /* Keep labels centered */
        }

        .login-input {
            width: 100%;
            padding: 16px;
            background: var(--login-input-bg);
            border: 1px solid var(--login-input-border);
            border-radius: 12px;
            color: var(--login-text-main);
            font-size: 1rem;
            font-family: 'Poppins', sans-serif;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            text-align: center;
            box-sizing: border-box;
            /* CRITICAL: prevents overflow */
        }

        .login-input:focus {
            outline: none;
            border-color: var(--primary-gold);
            background: rgba(0, 0, 0, 0.6);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
        }

        .login-input::placeholder {
            color: rgba(255, 255, 255, 0.3);
        }

        .login-submit {
            background: var(--primary-gold-gradient);
            color: #0d1b2a;
            border: none;
            padding: 18px;
            border-radius: 14px;
            font-weight: 700;
            font-size: 1.05rem;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            letter-spacing: 1.5px;
            text-transform: uppercase;
            width: 100%;
            box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4), 0 0 40px rgba(212, 175, 55, 0.15);
            position: relative;
            overflow: hidden;
        }

        .login-submit::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s;
        }

        .login-submit:hover::before {
            left: 100%;
        }

        .login-submit:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 30px rgba(212, 175, 55, 0.6), 0 0 50px rgba(212, 175, 55, 0.25);
            filter: brightness(1.15);
        }

        .login-submit:active {
            transform: translateY(0);
        }

        .error-message {
            background: rgba(220, 38, 38, 0.1);
            border: 1px solid rgba(220, 38, 38, 0.3);
            color: #ef4444;
            padding: 12px;
            border-radius: 10px;
            font-size: 0.85rem;
            display: none;
            text-align: center;
        }

        .error-message.show {
            display: block;
            animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
        }

        .success-message {
            background: rgba(22, 163, 74, 0.12);
            border: 1px solid rgba(34, 197, 94, 0.35);
            color: #86efac;
            padding: 12px;
            border-radius: 10px;
            font-size: 0.84rem;
            display: none;
            text-align: center;
        }

        .success-message.show {
            display: block;
        }

        .auth-inline-row {
            margin-top: -6px;
            display: flex;
            justify-content: center;
        }

        .auth-mini-row,
        .auth-remember-row {
            margin-top: -4px;
            display: grid;
            grid-template-columns: 14px 1fr;
            align-items: start;
            gap: 8px;
            color: #b7c3d9;
            font-size: 0.8rem;
            line-height: 1.35;
            text-align: left;
            cursor: pointer;
        }

        .auth-mini-row {
            margin-top: -8px;
            font-size: 0.76rem;
            color: #9eb0c8;
        }

        .auth-mini-row input[type="checkbox"],
        .auth-remember-row input[type="checkbox"] {
            margin-top: 2px;
            width: 14px;
            height: 14px;
            accent-color: #d4af37;
        }

        .auth-link-btn {
            background: transparent;
            border: none;
            color: #c9d2e0;
            font-size: 0.84rem;
            text-decoration: underline;
            text-underline-offset: 2px;
            cursor: pointer;
            padding: 0;
        }

        .auth-link-btn:hover {
            color: #d4af37;
        }

        .auth-switch-row {
            margin-top: 4px;
            display: flex;
            justify-content: center;
            gap: 8px;
            color: #a0a8b8;
            font-size: 0.86rem;
        }

        .auth-switch-btn {
            background: transparent;
            border: none;
            color: #d4af37;
            font-weight: 600;
            cursor: pointer;
            padding: 0;
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        .legal-consent-group {
            display: grid;
            gap: 8px;
            margin-top: -6px;
            text-align: left;
        }

        .legal-consent-item {
            display: grid;
            grid-template-columns: 16px 1fr;
            align-items: start;
            gap: 8px;
            color: #c9d2e0;
            font-size: 0.8rem;
            line-height: 1.45;
        }

        .legal-consent-item.optional {
            color: #9ba7bb;
        }

        .legal-consent-item input[type="checkbox"] {
            margin-top: 2px;
            accent-color: #d4af37;
            width: 14px;
            height: 14px;
        }

        .legal-consent-item a,
        .legal-consent-note a {
            color: #d4af37;
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        .legal-consent-note {
            color: #8f9bb0;
            font-size: 0.74rem;
            line-height: 1.4;
            margin-top: 2px;
        }

        @media (max-width: 768px) {
            .login-overlay {
                height: 100dvh;
                align-items: flex-start;
                justify-content: center;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                touch-action: pan-y;
                padding: max(10px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
                backdrop-filter: blur(8px);
                -webkit-backdrop-filter: blur(8px);
            }

            .login-container {
                max-width: 100%;
                min-height: 100%;
                padding: 10px 12px;
                align-items: flex-start;
            }

            .login-box {
                max-width: 100%;
                max-height: calc(100dvh - max(22px, env(safe-area-inset-top)) - max(26px, env(safe-area-inset-bottom)));
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                padding: 18px 14px 16px;
                gap: 14px;
                border-radius: 14px;
            }

            .login-logo {
                width: 72px;
                height: 72px;
            }

            .login-header h2 {
                font-size: clamp(1.65rem, 8vw, 2rem);
            }

            .login-header p {
                font-size: 0.9rem;
            }

            .login-form {
                gap: 14px;
            }

            .form-group {
                gap: 6px;
            }

            .login-input {
                padding: 13px 12px;
                font-size: 0.98rem;
            }

            .login-submit {
                min-height: 46px;
                padding: 14px;
                font-size: 0.95rem;
                letter-spacing: 1px;
            }

            .legal-consent-group {
                gap: 6px;
            }

            .legal-consent-item {
                font-size: 0.76rem;
                line-height: 1.35;
                gap: 6px;
            }

            .legal-consent-note {
                font-size: 0.72rem;
                line-height: 1.3;
            }

            .auth-switch-row {
                margin-top: 4px;
                font-size: 0.82rem;
            }
        }

        @media (max-width: 430px) {
            .login-container {
                padding: 8px 10px;
            }

            .login-box {
                max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(18px, env(safe-area-inset-bottom)));
                padding: 14px 12px 12px;
                gap: 12px;
            }

            .login-logo {
                width: 64px;
                height: 64px;
            }

            .login-header h2 {
                font-size: clamp(1.5rem, 7vw, 1.8rem);
            }

            .login-form {
                gap: 10px;
            }

            .login-input {
                padding: 11px 10px;
            }

            .legal-consent-item {
                font-size: 0.72rem;
                line-height: 1.28;
            }

            .legal-consent-note {
                font-size: 0.68rem;
                line-height: 1.25;
            }

            .login-submit {
                min-height: 42px;
                padding: 11px;
            }
        }

        @keyframes shake {

            10%,
            90% {
                transform: translate3d(-1px, 0, 0);
            }

            20%,
            80% {
                transform: translate3d(2px, 0, 0);
            }

            30%,
            50%,
            70% {
                transform: translate3d(-4px, 0, 0);
            }

            40%,
            60% {
                transform: translate3d(4px, 0, 0);
            }
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
            color: #d4af37;
            font-size: 0.9rem;
        }

        .user-email {
            color: #ffffff;
        }

        .logout-btn {
            padding: 8px 16px;
            background: rgba(212, 175, 55, 0.2);
            border: 1px solid rgba(212, 175, 55, 0.3);
            border-radius: 6px;
            color: #d4af37;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 0.85rem;
        }

        .logout-btn:hover {
            background: rgba(212, 175, 55, 0.3);
        }

        /* Calendar Styles */
        .calendar-controls {
            margin-bottom: 20px;
        }

        .calendar-day-cell {
            aspect-ratio: 1;
            border-radius: 6px;
            padding: 8px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            position: relative;
        }

        .calendar-day-cell:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
        }

        .calendar-day-profit {
            font-size: 0.75rem;
            font-weight: 600;
            text-align: center;
            margin-top: auto;
        }

        /* Shareable cards */
        .share-card {
            width: 100%;
            max-width: 600px;
        }

        .share-card-grid {
            width: 100%;
        }

        /* Mobile Performance Optimizations */
        @media (hover: none) and (pointer: coarse) {
            * {
                -webkit-tap-highlight-color: transparent;
            }

            .btn-filter,
            .calc-btn,
            .form-submit,
            .login-submit,
            .nav-item {
                touch-action: manipulation;
                -webkit-touch-callout: none;
            }

            .trade-card,
            .stat-card,
            .goal-card {
                will-change: transform;
            }
        }

        /* Reduce motion for accessibility */
        @media (prefers-reduced-motion: reduce) {

            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* Safe area for notched devices */
        @supports (padding: max(0px)) {
            body {
                padding-left: max(0px, env(safe-area-inset-left));
                padding-right: max(0px, env(safe-area-inset-right));
                padding-bottom: max(0px, env(safe-area-inset-bottom));
            }
        }

        /* Responsive Design */
        @media (max-width: 768px) {

            .header-container {
                flex-direction: column;
                gap: 20px;
                align-items: stretch;
            }

            .logo-box {
                width: 100%;
                justify-content: flex-start;
                padding: 12px;
            }

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

            .fl-letters {
                font-size: 20px;
            }

            .company-name {
                font-size: 1rem;
            }

            .company-subtitle {
                font-size: 0.75rem;
                letter-spacing: 1.5px;
            }

            .nav-menu {
                width: 100%;
                justify-content: flex-start;
                overflow-x: auto;
                padding-bottom: 10px;
                gap: 12px;
                flex-wrap: nowrap;
                scrollbar-width: none;
            }

            .nav-menu::-webkit-scrollbar {
                display: none;
            }

            .nav-item {
                flex: 0 0 auto;
                font-size: 0.9rem;
                padding: 6px 10px;
            }

            .header-actions {
                width: 100%;
                justify-content: center;
                flex-wrap: wrap;
                gap: 10px;
            }

            .header-actions button {
                width: 100%;
            }

            .user-info {
                width: 100%;
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }

            .user-email {
                width: 100%;
                overflow-wrap: anywhere;
            }

            .trade-images {
                grid-template-columns: 1fr;
            }

            .trade-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .image-container {
                min-height: 200px;
                aspect-ratio: 4 / 3;
            }

            .section-title {
                flex-direction: column;
                align-items: flex-start;
                gap: 6px;
                font-size: 1.3rem;
            }

            .journal-section,
            .trading-plan,
            .filter-section,
            .risk-calculator,
            .chart-container {
                padding: 20px;
            }

            .calc-card,
            .stat-card,
            .trade-card {
                padding: 15px;
            }

            .form-row {
                grid-template-columns: 1fr;
            }

            .filter-grid {
                grid-template-columns: 1fr;
            }

            .filter-actions {
                flex-direction: column;
                width: 100%;
            }

            .filter-actions button {
                width: 100%;
            }

            .plan-tabs,
            .tabs {
                flex-direction: column;
                align-items: stretch;
            }

            .trade-details {
                grid-template-columns: 1fr;
            }

            .calculator-grid {
                grid-template-columns: 1fr;
            }

            .calc-row {
                grid-template-columns: 1fr;
            }

            .share-card {
                padding: 20px !important;
            }

            [style*="grid-template-columns: 1fr 1fr"],
            [style*="grid-template-columns: repeat(2, 1fr)"],
            [style*="grid-template-columns: repeat(3, 1fr)"] {
                grid-template-columns: 1fr !important;
            }
        }

        @media (max-width: 480px) {
            .logo-box {
                padding: 10px;
            }

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

            .fl-letters {
                font-size: 18px;
            }

            .nav-item {
                font-size: 0.85rem;
                padding: 6px 10px;
            }

            .login-box {
                padding: 25px 18px;
            }

            .section-title {
                font-size: 1.1rem;
            }

            .trade-result {
                font-size: 1.2rem;
            }

            .share-card-grid {
                grid-template-columns: 1fr !important;
            }

            .share-card h2 {
                font-size: 1.5rem !important;
            }
        }


/* ===== 2026 UI cleanup layer ===== */
:root {
    --ui-radius-sm: 8px;
    --ui-radius-md: 12px;
    --ui-radius-lg: 16px;
    --ui-border-soft: 1px solid rgba(212, 175, 55, 0.18);
    --ui-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
    --ui-shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.38);
}

body {
    line-height: 1.45;
}

header {
    background: rgba(8, 11, 16, 0.9);
    border-bottom: var(--ui-border-soft);
}

.logo-box,
.nav-item,
.export-btn,
.logout-btn,
.login-submit,
.btn-filter,
.btn-reset,
.form-submit,
.calc-btn,
.run-simulation {
    transition: all 0.22s ease;
}

.risk-calculator,
.filter-section,
.stats-container .stat-card,
.trading-plan,
.analysis-card,
.chart-container,
.journal-section,
.goal-card,
.modal-content,
.calendar-container {
    border-radius: var(--ui-radius-md);
    border: var(--ui-border-soft);
    box-shadow: var(--ui-shadow-soft);
}

.risk-calculator:hover,
.filter-section:hover,
.stat-card:hover,
.trading-plan:hover,
.analysis-card:hover,
.chart-container:hover,
.goal-card:hover {
    box-shadow: var(--ui-shadow-hover);
}

.nav-item {
    border: 1px solid transparent;
}

.nav-item.active {
    border-color: rgba(212, 175, 55, 0.35);
}

#languageToggle {
    padding: 8px 16px !important;
    background: rgba(212, 175, 55, 0.12) !important;
    border: var(--ui-border-soft) !important;
    border-radius: var(--ui-radius-sm) !important;
    color: #d4af37 !important;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
}

#languageToggle:hover {
    background: rgba(212, 175, 55, 0.2) !important;
    transform: translateY(-1px);
}

#loadMoreBtn:hover {
    background: rgba(212, 175, 55, 0.1) !important;
    transform: translateY(-2px);
}

.login-box {
    max-width: 460px;
    margin: 0 auto;
    border-radius: var(--ui-radius-lg);
    border: var(--ui-border-soft);
    box-shadow: var(--ui-shadow-soft);
}

.login-header h2 {
    letter-spacing: 0.2px;
}

.login-input {
    border-radius: var(--ui-radius-sm);
}

.login-submit {
    border-radius: var(--ui-radius-sm);
    box-shadow: none;
}

.login-submit:hover {
    box-shadow: 0 8px 22px rgba(212, 175, 55, 0.35);
}

.trade-card,
.calc-card,
.duration-card,
.checklist,
.simulation-results {
    border-radius: var(--ui-radius-sm);
}

.modal-content {
    width: min(860px, 94vw);
    border-radius: var(--ui-radius-lg);
}

.form-input,
.form-select,
.form-textarea,
.filter-input,
.filter-select,
.calc-input {
    border-radius: var(--ui-radius-sm);
}

@media (max-width: 768px) {
    .header-container {
        display: flex;
        flex-direction: column;
    }

    .header-actions {
        justify-content: stretch;
    }

    #languageToggle,
    .export-btn,
    .logout-btn {
        width: 100%;
        margin-right: 0;
    }

    .modal-content {
        padding: 20px;
        width: 96vw;
    }
}


/* ===== Phase 1.2: layout and dashboard clarity ===== */
.header-container {
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) minmax(200px, 300px);
}

.nav-menu {
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    min-width: 0;
    padding: 0 4px;
}

.nav-item {
    white-space: nowrap;
    text-transform: none;
    flex: 0 0 auto;
}

@media (max-width: 1280px) {
    .header-container {
        grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) minmax(170px, 250px);
        gap: 12px;
    }

    .company-name {
        font-size: 1.02rem;
    }

    .company-subtitle {
        font-size: 0.66rem;
        letter-spacing: 2px;
    }

    .nav-item {
        padding: 7px 10px;
        font-size: 0.82rem;
    }

    .user-info {
        gap: 8px;
    }

    .user-email {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .logout-btn {
        padding: 7px 10px;
        font-size: 0.8rem;
    }
}

.decision-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 24px;
}

.decision-item {
    border: 1px solid rgba(212, 175, 55, 0.2);
    background: rgba(5, 8, 12, 0.7);
    border-radius: 10px;
    padding: 12px 14px;
}

.decision-label {
    color: #8c98ab;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.decision-value {
    color: #d4af37;
    font-size: 1rem;
    font-weight: 700;
}

.action-grid .action-card {
    box-shadow: none !important;
}

.action-grid .action-card img {
    opacity: 0.06 !important;
    filter: grayscale(1);
}

.action-grid .action-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.45) !important;
}

.trade-form-tools {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0 12px;
}

.trade-advanced-group {
    display: none;
}

.trade-advanced-group.visible {
    display: block;
}

@media (max-width: 980px) {
    .decision-panel {
        grid-template-columns: 1fr;
    }
}


/* Trade wizard */
.trade-wizard-header {
    margin-bottom: 16px;
}

.trade-wizard-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.trade-step-chip {
    border: 1px solid rgba(212, 175, 55, 0.2);
    background: rgba(0, 0, 0, 0.45);
    color: #94a3b8;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: default;
}

.trade-step-chip.active {
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(212, 175, 55, 0.08);
}

.trade-wizard-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.trade-wizard-progress span {
    display: block;
    height: 100%;
    width: 33.33%;
    background: linear-gradient(90deg, #d4af37, #f9f295);
    transition: width 0.2s ease;
}

.trade-wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.trade-wizard-actions .form-submit {
    margin-left: auto;
}


.quant-section {
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.quant-title {
    color: #d4af37;
    font-size: 1.05rem;
    margin-bottom: 14px;
}

.quant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.quant-card {
    background: rgba(0, 0, 0, 0.46);
    border: 1px solid rgba(212, 175, 55, 0.14);
    border-radius: 10px;
    padding: 12px;
}

.quant-label {
    color: #94a3b8;
    font-size: 0.74rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.quant-value {
    color: #e2e8f0;
    font-size: 1.12rem;
    font-weight: 700;
}


.quant-warning {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    color: #94a3b8;
    font-size: 0.82rem;
}

.quant-confidence-wrap {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.34);
    border: 1px solid rgba(212, 175, 55, 0.16);
    border-radius: 8px;
    padding: 10px 12px;
}

.quant-confidence-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #cbd5e1;
    font-size: 0.78rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.quant-confidence-track {
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.quant-confidence-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
    transition: width .35s ease, background .35s ease;
}

.quant-confidence-meta {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.78rem;
}

.quant-breakdown {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.quant-breakdown-item {
    background: rgba(0, 0, 0, 0.34);
    border: 1px solid rgba(212, 175, 55, 0.14);
    border-radius: 8px;
    padding: 10px;
}

@media (max-width: 980px) {
    .quant-breakdown {
        grid-template-columns: 1fr;
    }
}


.edge-alert-banner {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.32);
    color: #fecaca;
    font-size: 0.88rem;
    font-weight: 600;
}

.edge-rank-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.edge-rank-card {
    background: rgba(0,0,0,0.34);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.82rem;
    color: #cbd5e1;
}

.edge-rank-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dashed rgba(148,163,184,0.15);
    padding: 4px 0;
}

.edge-rank-line:last-child { border-bottom: none; }

.edge-rank-line strong { color: #e2e8f0; font-weight: 600; }

@media (max-width: 980px) {
    .edge-rank-grid { grid-template-columns: 1fr; }
}



/* ===== Mobile comfort pass ===== */
@media (max-width: 768px) {
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
        padding-bottom: 92px;
        -webkit-overflow-scrolling: touch;
    }

    .trade-wizard-actions {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 5;
        padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
        margin-top: 14px;
        background: linear-gradient(180deg, rgba(11, 15, 20, 0.2), rgba(11, 15, 20, 0.96));
        backdrop-filter: blur(4px);
    }

    .trade-wizard-actions .btn-reset,
    .trade-wizard-actions .btn-filter,
    .trade-wizard-actions .form-submit {
        min-height: 44px;
        padding: 10px 14px;
    }

    .trade-wizard-steps {
        grid-template-columns: 1fr;
    }

    .quant-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nav-item,
    .btn-filter,
    .btn-reset,
    .export-btn,
    .logout-btn {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .quant-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 97vw;
        padding-left: 14px;
        padding-right: 14px;
    }

    .section-title {
        line-height: 1.25;
    }
}


/* Desktop clean mode */
@media (min-width: 1024px) {
    .action-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

.action-grid .action-card {
    min-height: 112px;
}

/* Consolidated: removed legacy mobile auth fit block. Mobile auth now uses the final single-source overrides near file end. */

/* Removed deprecated MODE B auth block to reduce conflicting mobile overrides. */

/* ===== Uiverse-inspired auth redesign (brand-adapted, final override) ===== */
#loginOverlay {
    background:
        radial-gradient(900px 380px at 50% -10%, rgba(212, 175, 55, 0.22), transparent 60%),
        radial-gradient(900px 440px at 100% 120%, rgba(37, 99, 235, 0.14), transparent 60%),
        linear-gradient(155deg, #05080f 0%, #070c15 45%, #091326 100%) !important;
}

#loginOverlay .login-container {
    max-width: 560px !important;
    width: 100% !important;
    padding: 14px !important;
}

#loginOverlay .login-box {
    border-radius: 22px !important;
    border: 1px solid rgba(212, 175, 55, 0.22) !important;
    background: #101319 !important;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 241, 189, 0.18),
        inset 0 -18px 36px rgba(0, 0, 0, 0.35) !important;
    padding: 28px 24px !important;
}

#loginOverlay .login-header {
    gap: 8px !important;
}

#loginOverlay .login-header h2 {
    color: #f7d14a;
    text-shadow: 0 3px 16px rgba(212, 175, 55, 0.28);
    letter-spacing: 0.6px;
}

#loginOverlay .login-header p {
    color: #a9b6cc !important;
}

#loginOverlay .login-form {
    gap: 14px !important;
}

#loginOverlay .form-group {
    gap: 6px !important;
}

#loginOverlay .login-label {
    font-size: 0.68rem !important;
    letter-spacing: 1.4px !important;
    color: #e8c85d !important;
}

#loginOverlay .login-input {
    border-radius: 24px !important;
    border: 1px solid rgba(212, 175, 55, 0.24) !important;
    background: #121212 !important;
    box-shadow: inset 2px 5px 10px rgba(5, 5, 5, 0.75) !important;
    color: #d6dded !important;
    min-height: 46px !important;
    padding: 11px 16px !important;
    text-align: center !important;
}

#loginOverlay .login-input::placeholder {
    color: rgba(214, 221, 237, 0.34) !important;
}

#loginOverlay .login-input:focus {
    border-color: rgba(190, 146, 48, 0.62) !important;
    box-shadow:
        0 0 0 2px rgba(171, 131, 43, 0.22),
        inset 2px 5px 12px rgba(5, 5, 5, 0.85) !important;
}

#loginOverlay .login-input.invalid-field {
    border-color: rgba(255, 87, 87, 0.95) !important;
    box-shadow:
        0 0 0 3px rgba(255, 87, 87, 0.2),
        inset 2px 5px 12px rgba(35, 0, 0, 0.65) !important;
}

#loginOverlay .login-submit {
    border-radius: 12px !important;
    min-height: 46px !important;
    border: none !important;
    background-image: linear-gradient(145deg, #f2c94c 0%, #d4af37 65%, #7aa2ff 100%) !important;
    color: #0b1020 !important;
    font-weight: 800 !important;
    letter-spacing: 1.2px !important;
    transition: transform .2s ease, filter .2s ease, box-shadow .2s ease !important;
}

#loginOverlay .login-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 10px 26px rgba(212, 175, 55, 0.35) !important;
}

#loginOverlay .auth-inline-row,
#loginOverlay .auth-switch-row {
    color: #a5b2c8 !important;
}

#loginOverlay .auth-link-btn,
#loginOverlay .auth-switch-btn {
    color: #f0ca55 !important;
}

#loginOverlay .legal-consent-item {
    color: #c6d0e0 !important;
}

#loginOverlay .legal-consent-note {
    color: #94a4bd !important;
}

#loginOverlay .field-hint {
    margin-top: 4px;
    display: block;
    font-size: 0.74rem;
    color: #8ea0bd;
    line-height: 1.25;
}

#loginOverlay .field-hint.invalid {
    color: #f87171;
}

@media (max-width: 768px) {
    #loginOverlay .login-container {
        padding: 10px !important;
    }

    #loginOverlay .login-box {
        padding: 12px 10px !important;
        border-radius: 14px !important;
    }

    #loginOverlay .login-logo {
        width: 52px !important;
        height: 52px !important;
    }

    #loginOverlay .login-header h2 {
        font-size: clamp(1.35rem, 6.4vw, 1.7rem) !important;
    }

    #loginOverlay .login-header p {
        font-size: 0.84rem !important;
    }

    #loginOverlay .login-form {
        gap: 8px !important;
    }

    #loginOverlay .auth-mode-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    #loginOverlay .auth-mode-tab {
        min-height: 34px;
        font-size: 0.73rem;
        color: #cbd5e1 !important;
    }

    #loginOverlay .login-input {
        min-height: 38px !important;
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }

    #loginOverlay .login-submit {
        min-height: 38px !important;
        padding: 8px !important;
        font-size: 0.86rem !important;
    }
}



/* Leaderboard modal button contrast fixes */
#leaderboardModal .lb-tab {
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

#leaderboardModal .lb-tab:hover {
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
    border-color: rgba(212, 175, 55, 0.45);
}

#leaderboardModal .lb-tab.active {
    background: linear-gradient(135deg, #d4af37, #f9f295);
    color: #0b1220;
    border-color: rgba(212, 175, 55, 0.95);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25) inset, 0 6px 18px rgba(212, 175, 55, 0.25);
}

#leaderboardModal .lb-tab:focus-visible {
    outline: 2px solid #f9f295;
    outline-offset: 2px;
}

/* ===== Mobile Excellence Pass (Dashboard + Modals + Reviews + Leaderboard) ===== */
@media (max-width: 980px) {
    body {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .journal-section {
        padding: 16px !important;
    }

    .stats-container,
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .chart-container,
    .calendar-container,
    .quant-section,
    .journal-section,
    .filter-section {
        border-radius: 12px !important;
    }

    #dashboardSourceFilter {
        gap: 6px !important;
    }

    #dashboardSourceFilter .btn-filter {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .action-grid .action-card {
        height: 104px !important;
        min-height: 104px !important;
    }

    .modal-content {
        width: min(96vw, 760px) !important;
        max-height: 90dvh !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header {
        position: sticky;
        top: 0;
        z-index: 8;
        background: rgba(6, 10, 18, 0.92);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    }

    #leaderboardModal .modal-content {
        width: min(96vw, 820px) !important;
        padding: 14px !important;
    }

    #leaderboardModal table th,
    #leaderboardModal table td {
        padding: 10px 8px !important;
        font-size: 0.82rem;
    }

    #leaderboardHeroCard {
        padding: 12px !important;
    }

    #leaderboardHeroCard img {
        width: 40px !important;
        height: 40px !important;
    }

    .trade-details {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .trade-actions {
        gap: 8px !important;
    }

    .trade-actions .btn-filter,
    .trade-actions .btn-reset {
        min-height: 40px;
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
        flex: 1 1 calc(50% - 8px);
    }
}

@media (max-width: 768px) {
    .header-container {
        gap: 10px !important;
    }

    .company-name {
        font-size: 1rem !important;
    }

    .company-subtitle {
        font-size: 0.64rem !important;
    }

    .nav-menu {
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        min-height: 38px;
        padding: 7px 10px !important;
        font-size: 0.78rem !important;
        border-radius: 999px;
    }

    #dashboardSourceFilter {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #dashboardSourceFilter .btn-filter {
        width: 100%;
    }

    .decision-panel {
        gap: 8px !important;
    }

    .decision-item {
        padding: 10px 12px !important;
    }

    .decision-value {
        font-size: 0.92rem !important;
    }

    .section-title {
        font-size: 1.15rem !important;
        line-height: 1.28;
    }

    .chart-title {
        font-size: 1rem !important;
    }

    .chart-wrapper {
        min-height: 220px;
    }

    .calendar-grid {
        gap: 4px !important;
    }

    .calendar-day,
    .calendar-cell {
        min-height: 52px !important;
        padding: 4px !important;
    }

    .modal-content {
        width: 97vw !important;
        padding: 14px !important;
    }

    #leaderboardModal table th:nth-child(3),
    #leaderboardModal table td:nth-child(3) {
        display: none;
    }

    #leaderboardModal table th,
    #leaderboardModal table td {
        font-size: 0.8rem !important;
    }

    #leaderboardModal .close-modal {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 10px !important;
    }

    .journal-section {
        padding: 12px !important;
    }

    .action-grid {
        grid-template-columns: 1fr !important;
    }

    #dashboardSourceFilter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #dashboardSourceFilter .btn-filter {
        min-height: 38px;
        font-size: 0.76rem;
        padding: 7px 8px;
    }

    .trade-details {
        grid-template-columns: 1fr !important;
    }

    .trade-actions .btn-filter,
    .trade-actions .btn-reset {
        flex: 1 1 100%;
    }

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

    .quant-value {
        font-size: 1rem !important;
    }

    .close-modal {
        width: 38px;
        height: 38px;
    }
}

/* Auth layer hard lock: when session is active, overlays can never cover app */
body.session-authenticated #promoOverlay,
body.session-authenticated #loginOverlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.session-authenticated #mainApp {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Smooth post-auth transition */
.auth-enter-transition {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 500px at 50% -10%, rgba(212,175,55,0.2), transparent 60%), rgba(5, 8, 15, 0.72);
    backdrop-filter: blur(8px);
}

.auth-enter-transition.show {
    display: flex;
    animation: authEnterFade 0.22s ease;
}

.auth-enter-transition__card {
    min-width: 220px;
    max-width: min(90vw, 360px);
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(12, 16, 24, 0.92);
    box-shadow: 0 16px 44px rgba(0,0,0,0.5);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-enter-transition__spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.25);
    border-top-color: #f0ca55;
    animation: authSpin 0.9s linear infinite;
    flex: 0 0 auto;
}

.auth-enter-transition__text {
    margin: 0;
    color: #dce4f4;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

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

@keyframes authEnterFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-enter-transition__spinner {
        animation: none;
    }
}

/* Mobile touch quality pass */
@media (hover: none) and (pointer: coarse) {
    button,
    .btn,
    .login-submit,
    .promo-cta-primary,
    .promo-cta-secondary,
    .auth-link-btn,
    .auth-switch-btn,
    .nav-item,
    .logo-box,
    a {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(212, 175, 55, 0.18);
    }

    input,
    textarea,
    select {
        touch-action: manipulation;
        font-size: 16px;
    }

    button,
    .btn,
    .login-submit,
    .promo-cta-primary,
    .promo-cta-secondary,
    .auth-link-btn,
    .auth-switch-btn,
    .nav-item,
    .logo-box {
        transition: transform 120ms ease-out, filter 120ms ease-out;
    }

    .touch-pressed {
        transform: scale(0.985) !important;
        filter: brightness(1.06);
    }
}

/* Narrow phone containment fix (9:16 and similar) */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

#promoOverlay,
#loginOverlay,
#mainApp,
.promo-container,
.promo-card,
.login-container,
.login-box {
    max-width: 100vw;
}

.promo-footer-link-grid a,
.promo-footer-legal-inline a,
.promo-footer-meta a {
    word-break: break-word;
}

@media (max-width: 430px), (max-aspect-ratio: 10/16) {
    #promoOverlay .promo-card {
        padding:
            max(10px, env(safe-area-inset-top))
            10px
            max(12px, env(safe-area-inset-bottom)) !important;
        gap: 12px !important;
        min-height: auto !important;
    }

    #promoOverlay .promo-title {
        font-size: clamp(1.36rem, 6.6vw, 1.62rem) !important;
        line-height: 1.16 !important;
    }

    #promoOverlay .promo-subtitle {
        font-size: 0.9rem !important;
        line-height: 1.48 !important;
    }

    #promoOverlay .promo-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px !important;
    }

    #promoOverlay .promo-site-footer {
        grid-template-columns: 1fr !important;
        padding: 12px 10px !important;
        gap: 10px !important;
    }

    #promoOverlay .promo-feature-item,
    #promoOverlay .promo-mini-card {
        padding: 8px 10px !important;
    }

    #loginOverlay {
        padding: 8px 0 !important;
    }

    #loginOverlay .login-container {
        padding: 8px !important;
    }

    #loginOverlay .login-box {
        padding: 10px !important;
        border-radius: 12px !important;
        max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom))) !important;
    }

    #loginOverlay .login-form {
        gap: 10px !important;
    }

    #loginOverlay .auth-mini-row,
    #loginOverlay .auth-remember-row {
        align-items: flex-start !important;
        text-align: left !important;
        line-height: 1.35 !important;
    }

    #loginOverlay .error-message,
    #loginOverlay .success-message {
        font-size: 0.84rem !important;
        line-height: 1.35 !important;
        word-break: break-word;
    }
}

/* Final mobile auth/promo layout lock (single-source overrides) */
@media (max-width: 480px), (max-aspect-ratio: 10/16) {
  #promoOverlay,
  #loginOverlay {
    width: 100vw !important;
    min-height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-top: max(8px, env(safe-area-inset-top)) !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }

  #promoOverlay .promo-container,
  #loginOverlay .login-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  #promoOverlay .promo-card,
  #loginOverlay .login-box {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #promoOverlay .promo-right {
    display: none !important;
  }

  #promoOverlay .promo-site-footer {
    grid-template-columns: 1fr !important;
  }

  #promoOverlay .promo-cta-primary,
  #promoOverlay .promo-cta-secondary,
  #loginOverlay .login-submit {
    width: 100% !important;
    min-height: 44px !important;
  }

  #loginOverlay .login-input {
    min-height: 44px !important;
    font-size: 16px !important;
  }
}
