        :root {
            color-scheme: dark;
            /* Nano Dark Theme */
            --bg-page: #000000;
            --bg-surface: #121212;
            --bg-surface-elevated: #1e1e1e;
            --text-primary: #ededed;
            --text-secondary: #a1a1aa;
            --text-muted: #52525b;

            --primary: #6366f1;
            --primary-dim: rgba(99, 102, 241, 0.15);
            --primary-hover: #4f46e5;

            --accent-success: #10b981;
            --accent-success-dim: rgba(16, 185, 129, 0.1);
            --accent-danger: #ef4444;
            --accent-warning: #f59e0b;
            --accent-danger-dim: rgba(239, 68, 68, 0.08);
            --accent-best: #f59e0b;

            --border: #27272a;

            --radius: 0.5rem;
            --font-family: 'Inter', sans-serif;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html,
        body {
            background-color: var(--bg-page);
            color: var(--text-primary);
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
            overflow-x: hidden;
            width: 100%;
        }

        @media (max-width: 768px) {
            html, body {
                position: relative;
                max-width: 100vw;
            }
            input[type="text"], input[type="number"], select, textarea {
                font-size: 16px !important;
            }
            button, .btn-cta, .btn-secondary, a, .toggle-wrap {
                touch-action: manipulation;
                cursor: pointer;
            }
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 1.5rem;
        }

        .screen {
            display: none !important;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .screen.active {
            display: block !important;
            opacity: 1 !important;
        }

        /* Enhanced Slider Handles */
        input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: #ffffff;
            cursor: pointer;
            box-shadow: 0 0 10px rgba(0,0,0,0.3);
            border: 2px solid rgba(255,255,255,0.1);
            margin-top: -8px; /* Centers handle on track */
        }

        input[type=range]::-moz-range-thumb {
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: #ffffff;
            cursor: pointer;
            border: 2px solid rgba(255,255,255,0.1);
        }

        input[type=range] {
            -webkit-appearance: none;
            background: transparent;
        }

        input[type=range]:focus {
            outline: none;
        }

        /* HEADER */
        header {
            border-bottom: 1px solid var(--border);
            padding: 1rem 0;
            margin-bottom: 0;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .brand {
            font-size: 1.25rem;
            font-weight: 700;
            color: white;
        }

        .currency-select {
            background: var(--bg-surface);
            border: 1px solid var(--border);
            color: var(--text-primary);
            padding: 0.4rem 0.75rem;
            border-radius: var(--radius);
            cursor: pointer;
        }

        select option {
            background-color: var(--bg-surface-elevated);
            color: var(--text-primary);
        }

        /* STICKY SUMMARY */
        .sticky-summary {
            position: sticky;
            top: 0;
            z-index: 50;
            background: rgba(18, 18, 18, 0.95);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--border);
            padding: 0.75rem 0;
            margin-bottom: 2rem;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .summary-grid {
            display: grid;
            grid-template-columns: auto 1fr auto;
            gap: 2rem;
            align-items: center;
        }

        .summary-stats {
            display: flex;
            gap: 1.5rem;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .stat-item {
            display: flex;
            flex-direction: column;
        }

        .stat-item strong {
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .stat-sep {
            width: 1px;
            background: var(--border);
        }

        .btn-text-back {
            border: 1px solid var(--border);
            color: var(--text-secondary);
            padding: 0.4rem 0.8rem;
            border-radius: var(--radius);
            cursor: pointer;
            font-size: 0.8rem;
        }

        .btn-text-back:hover {
            border-color: white;
        }

        /* REFINED KPI DASHBOARD ROW */
        .kpi-dashboard-row {
            display: grid;
            grid-template-columns: auto 1.5fr repeat(3, 1fr) auto;
            gap: 1rem;
            align-items: stretch;
            padding: 0 1.5rem;
            max-width: 1400px;
            margin: 0 auto;
        }

        .kpi-back-wrapper {
            display: flex;
            align-items: center;
        }

        .kpi-card {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0.75rem 1rem;
            position: relative;
            overflow: hidden;
        }

        .kpi-card label {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-secondary);
            margin-bottom: 0.25rem;
        }

        .kpi-card span {
            font-weight: 700;
            color: white;
            line-height: 1;
        }

        .target-profit-card {
            background: linear-gradient(145deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
            border: 1px solid rgba(168, 85, 247, 0.3);
            box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
        }

        .target-profit-card label {
            color: rgba(255, 255, 255, 0.8);
        }

        .target-profit-card span {
            font-size: 1.75rem;
            background: linear-gradient(to right, #fff, #e0e7ff);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .secondary-card span {
            font-size: 1.25rem;
        }

        .kpi-status-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .goal-status-badge {
            padding: 0.75rem 1.5rem;
            border-radius: 12px;
            font-size: 0.9rem;
            font-weight: 700;
            text-transform: uppercase;
            border: 1px solid transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            min-width: 140px;
        }

        .status-track {
            background: rgba(16, 185, 129, 0.1);
            color: #34d399;
            /* brighter green text */
            border-color: rgba(16, 185, 129, 0.3);
            box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
        }

        .status-below {
            background: rgba(245, 158, 11, 0.1);
            color: #fbbf24;
            border-color: rgba(245, 158, 11, 0.3);
        }

        .status-off {
            background: rgba(239, 68, 68, 0.1);
            color: #f87171;
            border-color: rgba(239, 68, 68, 0.3);
        }

        @media (max-width: 1100px) {
            .kpi-dashboard-row {
                grid-template-columns: 1fr 1fr;
                grid-template-rows: auto auto;
            }

            .kpi-back-wrapper {
                grid-column: 1 / -1;
            }

            .target-profit-card {
                grid-column: 1 / -1;
            }

            .kpi-status-wrapper {
                grid-column: 1 / -1;
                margin-top: 0.5rem;
            }
        }

        /* SCREEN 1: INPUTS */
        .inputs-centered {
            max-width: 500px;
            margin: 3rem auto;
        }

        .metric-card,
        .store-metrics-card {
            background: var(--bg-surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 2rem;
        }

        .metric-header,
        .store-metrics-header {
            background: var(--bg-surface-elevated);
            padding: 1rem;
            text-align: center;
            font-weight: 600;
            color: var(--text-primary);
            border-bottom: 1px solid var(--border);
        }

        .metric-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border);
        }

        .metric-row.highlight-target {
            background: rgba(99, 102, 241, 0.1);
            border-top: 1px solid var(--primary);
            border-bottom: 1px solid var(--primary);
            position: relative;
        }

        /* Error message positioning */
        .metric-row.highlight-target+#profitError {
            margin-top: -1px;
            /* Tuck under border if desired, or handle logic */
        }

        .metric-row:last-child {
            border-bottom: none;
        }

        .metric-row label {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--primary);
        }

        .metric-row.total-row {
            background: rgba(255, 255, 255, 0.03);
            font-weight: 700;
        }

        .metric-row.total-row label {
            color: #fff;
        }

        .form-num-input {
            width: 120px;
            text-align: right;
            background: transparent;
            border: none;
            color: white;
            font-weight: 600;
            font-size: 1rem;
            border-bottom: 1px solid transparent;
        }

        .form-num-input:focus {
            outline: none;
            border-bottom-color: var(--primary);
        }

        /* Hide number input spinners */
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        input[type=number] {
            -moz-appearance: textfield;
            appearance: textfield;
        }

        .cta-group {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .btn-cta {
            background: var(--primary);
            color: white;
            border: none;
            padding: 0.9rem 2rem;
            border-radius: var(--radius);
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            font-size: 1rem;
            transition: transform 0.1s;
            text-align: center;
        }

        .btn-cta:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
        }

        .btn-secondary {
            background: var(--bg-surface-elevated);
            border: 1px solid var(--border);
            color: var(--text-primary);
            padding: 0.9rem 2rem;
            border-radius: var(--radius);
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            font-size: 1rem;
            transition: background 0.2s;
        }

        .btn-secondary:hover {
            background: var(--border);
        }

        /* DASHBOARD CONTROLS */
        .controls-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .toggle-wrap {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            font-size: 0.9rem;
            color: var(--text-secondary);
            cursor: pointer;
            font-weight: 500;
        }

        .toggle-switch {
            width: 36px;
            height: 20px;
            background: var(--border);
            border-radius: 99px;
            position: relative;
            transition: background 0.2s;
        }

        .toggle-switch::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            background: white;
            border-radius: 50%;
            transition: left 0.2s;
        }

        .toggle-wrap.active .toggle-switch {
            background: var(--primary);
        }

        .toggle-wrap.active .toggle-switch::after {
            left: 18px;
        }

        .btn-sm {
            background: var(--bg-surface-elevated);
            border: 1px solid var(--border);
            color: var(--text-secondary);
            padding: 0.4rem 0.8rem;
            border-radius: var(--radius);
            cursor: pointer;
            font-size: 0.8rem;
        }

        /* SCENARIO COMPARISON REDESIGN */
        /* SCENARIO COMPARISON - HYBRID GRID & CARD LAYOUT */
        /* LEGACY TABLE CSS REMOVED */

        /* UNIFIED DASHBOARD MOBILE FIXES */
        /* UNIFIED DASHBOARD MOBILE FIXES */
        .dashboard-container {
            position: relative;
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
        }

        .sticky-col {
            position: sticky;
            left: 0;
            z-index: 20;
            background-color: #121212;
            /* Match bg-surface */
            box-shadow: 10px 0 15px -10px rgba(0, 0, 0, 0.8);
            border-right: 1px solid rgba(255, 255, 255, 0.05);
        }

        @media (max-width: 768px) {
            .sticky-col {
                width: 130px !important;
                min-width: 130px !important;
            }

            #unifiedDashboard {
                padding: 1rem !important;
                gap: 1rem !important;
            }

            .dashboard-card {
                padding: 1rem !important;
                border-radius: 1.25rem !important;
            }
        }

        /* REFRESHED TABLE SCROLLING */
        .table-container {
            position: relative;
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* GLOBAL FOOTER */
        .global-footer {
            background: var(--bg-page);
            border-top: 1px solid var(--border);
            padding: 1.5rem 0;
            color: var(--text-secondary);
            font-size: 0.85rem;
            z-index: 50;
        }

        .footer-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 1.5rem;
        }

        .footer-logo {
            font-weight: 800;
            color: var(--text-primary);
            letter-spacing: -0.02em;
        }

        .footer-center {
            text-align: center;
        }

        .footer-right {
            text-align: right;
        }

        @media (max-width: 768px) {
            .footer-content {
                flex-direction: column;
                gap: 1rem;
                text-align: center;
            }

            .footer-right {
                text-align: center;
            }
        }

        .sticky-first-col th:first-child,
        .sticky-first-col td:first-child {
            position: sticky;
            left: 0;
            z-index: 10;
            background-color: #0c0c0c;
            box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
        }

        .no-scrollbar::-webkit-scrollbar {
            display: none;
        }

        .no-scrollbar {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        .col-scenario.is-goal-target .bottom-cell {
            border-bottom: none;
        }

        .tooltip-badge-rec {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--primary);
            color: white;
            padding: 4px 12px;
            border-radius: 99px;
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
            z-index: 5;
        }

        /* GOAL MODE HIGHLIGHT */
        .col-scenario.is-goal-target div {
            position: relative;
        }

        .col-scenario.is-goal-target div::after {
            display: none;
        }

        .col-scenario.is-goal-target .top-cell {
            border-top: 2px solid var(--primary);
        }

        .col-scenario.is-goal-target .bottom-cell {
            border-bottom: 2px solid var(--primary);
        }

        .col-scenario.is-goal-target .cell-highlight-best {
            border-color: var(--primary) !important;
        }

        .badge-rec {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--primary);
            color: white;
            padding: 4px 12px;
            border-radius: 99px;
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
            z-index: 5;
            white-space: nowrap;
        }

        .hero-profit-val {
            font-size: 1.75rem;
            font-weight: 700;
            color: white;
            line-height: 1;
        }

        .hero-profit-val.pos {
            color: var(--accent-success);
        }

        .hero-profit-val.neg {
            color: var(--accent-danger);
        }

        .hero-chips-row {
            display: flex;
            gap: 0.5rem;
        }

        .hero-chip {
            background: var(--bg-surface-elevated);
            border: 1px solid var(--border);
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            color: var(--text-secondary);
            font-weight: 500;
            display: flex;
            gap: 4px;
            align-items: center;
        }

        .hero-chip strong {
            color: var(--text-primary);
        }

        .badge-best {
            font-size: 0.65rem;
            font-weight: 800;
            padding: 2px 8px;
            border-radius: 4px;
            text-transform: uppercase;
            background: var(--bg-surface-elevated);
            border: 1px solid var(--border);
            color: var(--text-muted);
            margin-bottom: 0.25rem;
        }

        .badge-best.active-profit {
            background: var(--accent-success);
            color: black;
            border-color: var(--accent-success);
        }

        .input-group {
            margin-bottom: 0.75rem;
            position: relative;
            width: 100%;
        }

        .input-row-main {
            display: flex;
            gap: 4px;
            align-items: center;
        }

        .btn-icon-reset {
            width: 24px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 1rem;
        }

        .btn-icon-reset:hover {
            color: white;
        }

        .input-cpa {
            width: 100%;
            background: #000;
            border: 1px solid var(--border);
            color: white;
            padding: 0.5rem 0.25rem;
            font-size: 1.1rem;
            font-weight: 700;
            border-radius: 6px;
            text-align: center;
        }

        .cpa-context {
            font-size: 0.7rem;
            text-align: center;
            margin-top: 4px;
            font-weight: 500;
        }

        .cpa-context.good {
            color: var(--accent-success);
        }

        .cpa-context.bad {
            color: var(--accent-danger);
        }

        .overrides-accordion {
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg-surface);
            width: 100%;
            margin-top: 0.5rem;
        }

        .accordion-head {
            background: rgba(255, 255, 255, 0.02);
            padding: 8px 10px;
            font-size: 0.75rem;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .accordion-body {
            padding: 8px;
            background: #080808;
            display: none;
            grid-template-columns: 1fr;
            gap: 8px;
        }

        .accordion-body.open {
            display: grid;
        }

        .ov-row {
            display: grid;
            grid-template-columns: 80px 1fr auto;
            gap: 8px;
            align-items: center;
            border-bottom: 1px solid #1a1a1a;
            padding-bottom: 6px;
        }

        .ov-row:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .ov-label {
            font-size: 0.7rem;
            color: var(--text-muted);
        }

        .ov-input {
            width: 100%;
            background: #111;
            border: 1px solid #333;
            color: white;
            font-size: 0.8rem;
            padding: 4px;
            text-align: right;
            border-radius: 4px;
        }

        .ov-input:disabled {
            opacity: 0.3;
            cursor: not-allowed;
            border-color: transparent;
        }

        .ov-check {
            cursor: pointer;
            transform: scale(0.9);
            opacity: 0.7;
        }

        .ov-check:checked {
            opacity: 1;
            accent-color: var(--primary);
        }

        .delta-sub {
            font-size: 0.7rem;
            color: var(--text-muted);
            margin-left: 6px;
            font-weight: 400;
            vertical-align: super;
        }

        .delta-sub.pos {
            color: var(--accent-success);
        }

        .delta-sub.neg {
            color: var(--accent-danger);
        }

        /* Goal Helper & Modals */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(5px);
            z-index: 1000;
            display: none;
            align-items: center;
            justify-content: center;
        }

        .modal-card {
            background: var(--bg-surface-elevated);
            border: 1px solid var(--border);
            width: 90%;
            max-width: 400px;
            padding: 1.5rem;
            border-radius: var(--radius);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
        }

        .goal-popover {
            position: absolute;
            top: 100%;
            right: 0;
            background: var(--bg-surface-elevated);
            margin-top: 12px;
            border: 1px solid var(--border);
            padding: 1.25rem;
            border-radius: var(--radius);
            width: 320px;
            z-index: 100;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
            display: none;
        }

        .goal-popover h4 {
            margin-bottom: 1rem;
            font-size: 0.95rem;
            color: var(--text-primary);
            border-bottom: 1px solid var(--border);
            padding-bottom: 0.5rem;
        }

        .goal-inp {
            width: 100%;
            background: #000;
            border: 1px solid var(--border);
            color: white;
            padding: 8px;
            margin-bottom: 12px;
            font-size: 1rem;
            border-radius: 4px;
        }

        .goal-inp:focus {
            border-color: var(--primary);
            outline: none;
        }

        .goal-res-row {
            display: flex;
            justify-content: space-between;
            font-size: 0.85rem;
            margin-bottom: 4px;
            color: var(--text-secondary);
        }

        .goal-res-row strong {
            color: white;
        }

        .goal-note {
            font-size: 0.7rem;
            color: var(--text-muted);
            margin-top: 8px;
            line-height: 1.4;
            border-top: 1px solid var(--border);
            padding-top: 8px;
        }

        @media (max-width: 900px) {

            /* 1. TOP SUMMARY: FIX OVERFLOW & REMOVE STICKY TRAP */
            .sticky-summary {
                position: relative !important;
                /* Disable sticky on mobile */
                top: auto !important;
                margin-bottom: 1rem;
            }

            .summary-grid {
                grid-template-columns: 1fr;
                gap: 1rem;
                text-align: left;
                width: 100%;
                /* Ensure fits */
            }

            .summary-stats {
                flex-wrap: wrap;
                /* Allow chips to wrap */
                justify-content: flex-start !important;
                gap: 0.5rem;
            }

            .stat-item {
                font-size: 0.8rem;
                /* Slightly smaller text */
            }

            .goal-kpi-bar {
                flex-direction: column;
                gap: 1rem;
                align-items: flex-start;
            }

            /* NEW: FORCE KPI ROW TO STACK */
            .kpi-dashboard-row {
                display: flex !important;
                flex-direction: column !important;
                gap: 1rem;
            }

            .kpi-card {
                width: 100% !important;
                margin-bottom: 0.5rem;
            }

            /* 2. CONTROLS BAR: STACK VERTICALLY */
            .controls-bar {
                flex-direction: column;
                align-items: stretch !important;
                /* Full width */
                gap: 1rem;
                height: auto;
                /* Remove fixed height if any */
                padding: 1rem;
            }

            .controls-bar h2 {
                justify-content: center;
                /* Center title */
                margin-bottom: 0.5rem;
            }

            .controls-bar>div:last-child {
                flex-direction: column;
                /* Stack controls */
                gap: 1rem;
                width: 100%;
            }

            .toggle-wrap {
                width: 100%;
                justify-content: center;
                /* Center toggle */
                padding: 0.75rem;
                background: rgba(255, 255, 255, 0.05);
                /* Card-like background */
                border-radius: 8px;
            }


            /* End of mobile media query */
        }

        /* LANDING PAGE / HERO STYLES */
        .hero-section {
            padding: 4rem 1.5rem 0;
            text-align: center;
            background: #000000;
            margin-bottom: 1rem;
            position: relative;
        }

        .hero-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 1000px;
            margin: 0 auto 3rem;
            position: relative;
            z-index: 10;
        }

        .hero-brand {
            font-size: 1.5rem;
            font-weight: 800;
            color: white;
            /* background: linear-gradient(to right, #fff, #94a3b8); */
            /* -webkit-background-clip: text; */
            /* background-clip: text; */
            /* -webkit-text-fill-color: transparent; */
            letter-spacing: -0.02em;
        }

        .hero-content {
            max-width: 800px;
            margin: 0 auto;
            position: relative;
            z-index: 5;
        }

        .hero-title {
            font-size: 2.25rem;
            font-weight: 800;
            margin-bottom: 1rem;
            line-height: 1.1;
            letter-spacing: -0.03em;
            color: white;
            /* background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%); */
            /* -webkit-background-clip: text; */
            /* background-clip: text; */
            /* -webkit-text-fill-color: transparent; */
        }

        .hero-sub {
            font-size: 1.05rem;
            color: var(--text-secondary);
            margin-bottom: 2rem;
            line-height: 1.6;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }

        .hero-actions {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }

        .hero-trust {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 2rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .hero-trust::before {
            content: "";
            display: block;
            width: 6px;
            height: 6px;
            background: var(--accent-success);
            border-radius: 50%;
        }

        .benefit-bullets {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 1.5rem;
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-bottom: 1rem;
        }

        .benefit-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .benefit-icon {
            color: var(--primary);
            background: var(--primary-dim);
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-size: 0.7rem;
            font-weight: bold;
        }

        /* INPUTS CARD RE-STYLE */
        .inputs-centered {
            max-width: 500px;
            margin: 0 auto 4rem;
        }

        .input-section-header {
            text-align: center;
            margin-bottom: 1.5rem;
        }

        .input-section-header h3 {
            color: white;
            font-size: 1.25rem;
            margin-bottom: 0.25rem;
            font-weight: 700;
        }

        .input-section-header p {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin: 0;
        }

        .store-metrics-card {
            background: rgba(18, 18, 18, 0.6);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
            overflow: hidden;
        }

        .store-metrics-header {
            padding: 1rem;
            background: rgba(255, 255, 255, 0.02);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .input-calculation-note {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-align: center;
            margin-top: 0.75rem;
        }

        .btn-cta-hero {
            background: var(--primary);
            color: white;
            border: none;
            padding: 0.8rem 1.75rem;
            border-radius: 99px;
            /* Pill shape */
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 4px 12px var(--primary-dim);
        }

        .btn-cta-hero:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px var(--primary-dim);
            background: var(--primary-hover);
        }

        .btn-sec-hero {
            background: rgba(255, 255, 255, 0.05);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 0.8rem 1.75rem;
            border-radius: 99px;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-sec-hero:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.2);
        }

        /* MEDIA PLAN MODAL STYLES */
        .modal-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(12px);
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        @media (max-width: 640px) {
            .hero-title {
                font-size: 1.75rem;
                line-height: 1.2;
            }

            .hero-sub {
                font-size: 0.95rem;
                padding: 0 1rem;
            }

            .hero-actions {
                flex-direction: column;
                width: 100%;
                max-width: 320px;
                margin-left: auto;
                margin-right: auto;
                gap: 1rem;
            }

            .btn-cta-hero,
            .btn-sec-hero {
                width: 100%;
                padding: 1rem;
            }

            .hero-section {
                padding-top: 3rem;
                padding-bottom: 3rem;
            }

            /* Stack all landing grids vertically */
            #screen-landing .grid-cols-2, #screen-landing .grid-cols-3, #screen-landing .grid-cols-4, #screen-landing .lg\:grid-cols-2, #screen-landing .lg\:grid-cols-4, #screen-landing .md\:grid-cols-2 {
                grid-template-columns: 1fr !important;
            }
            
            .max-w-6xl {
                padding-left: 1.5rem !important;
                padding-right: 1.5rem !important;
            }

            .benefit-bullets {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
                padding-left: 2rem;
            }
        }

        .modal-card {
            background: #121212;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 850px;
            height: auto;
            max-height: 90vh;
            overflow: hidden;
            position: relative;
        }

        .modal-body {
            overflow-y: auto;
            flex-grow: 1;
            padding: 2rem;
            padding-bottom: 4rem;
            /* Spacing for footer */
            scrollbar-width: thin;
            scrollbar-color: var(--primary) transparent;
        }

        .modal-body::-webkit-scrollbar {
            width: 6px;
        }

        /* NEW MOBILE DASHBOARD UI */
        @media (max-width: 1024px) {
            #screen-results .sticky {
                position: relative !important;
                background: var(--bg-surface) !important;
                backdrop-filter: none !important;
                box-shadow: none !important;
            }

            .dashboard-container {
                overflow-x: hidden !important;
            }

            #unifiedDashboard {
                padding: 1rem !important;
                width: 100% !important;
                min-width: 0 !important;
            }

            /* Stack Sticky KPI Header */
            #defaultSummary, #goalModeSummary {
                flex-direction: column !important;
                align-items: stretch !important;
                padding: 1rem 0;
                gap: 1rem !important;
                height: auto !important;
            }

            #defaultSummary > div, #goalModeSummary > div {
                width: 100% !important;
                justify-content: center !important;
                flex-wrap: wrap !important;
            }

            /* Force KPI items to be full width or 100% */
            .bg-white\/\[0\.03\].border.border-white\/10.rounded-xl,
            .bg-primary\/5.border.border-primary\/30.rounded-xl {
                width: 100% !important;
                margin-bottom: 0.5rem;
            }

            /* Controls Bar Stacking */
            .flex.flex-col.lg\:flex-row.justify-between.items-center.gap-6.mb-8 {
                flex-direction: column !important;
                align-items: stretch !important;
            }

            .flex.items-center.gap-3.mb-1 h2 {
                font-size: 1.5rem !important;
                text-align: center;
                width: 100%;
            }

            /* Hide Scenario Chart on very small screens if it breaks, but user wants visibility? 
               The plan said "Make the chart visible on mobile but with a fixed height". 
            */
            #scenarioChartSection {
                display: block !important;
                padding: 0 1rem;
            }
            #scenarioChart {
                height: 250px !important;
            }

            .mobile-kpi-list {
                border-top: 1px solid rgba(255, 255, 255, 0.05);
                margin-top: 1.5rem;
                padding-top: 1.25rem;
                display: flex;
                flex-direction: column;
                gap: 0.85rem;
            }

            .mobile-kpi-item {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 0.35rem 0;
                border-bottom: 1px solid rgba(255, 255, 255, 0.02);
            }

            .mobile-kpi-label {
                font-size: 9px;
                font-weight: 700;
                color: var(--text-muted);
                text-transform: uppercase;
                letter-spacing: 0.1em;
            }

            .mobile-kpi-value {
                font-size: 13px;
                font-weight: 800;
                color: white;
            }
        }

        /* ROW LOCK & ALIGNMENT STYLES */
        .kpi-row {
            display: flex;
            align-items: center;
            height: 48px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            transition: background-color 0.2s ease;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hero-kpi-row {
            height: 80px;
            border-bottom: none;
            background: rgba(var(--primary-rgb), 0.02);
            margin-top: auto;
        }

        .kpi-row:hover {
            background-color: rgba(255, 255, 255, 0.01);
        }

        .kpi-row:last-child {
            border-bottom: none;
        }

        .sidebar-header-spacer {
            width: 100%;
            transition: height 0.3s ease;
        }

        .desktop-kpi-sidebar {
            width: 220px;
            min-width: 220px;
            padding-right: 2rem;
        }

        .scenario-block {
            display: flex;
            flex-direction: column;
            border: 2px solid rgba(255, 255, 255, 0.05);
            border-radius: 2.5rem;
            overflow: hidden;
            background: rgba(255, 255, 255, 0.02);
            transition: all 0.3s ease;
        }

        .scenario-block.is-best {
            border-color: rgba(var(--primary-rgb), 0.5);
            background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0.02) 100%);
            box-shadow: 0 0 40px -10px rgba(var(--primary-rgb), 0.2), inset 0 0 20px rgba(var(--primary-rgb), 0.05);
        }

        .scenario-block.is-goal {
            border-color: rgba(255, 255, 255, 0.15);
            background: rgba(255, 255, 255, 0.03);
            box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.02);
        }

        @keyframes premiumPulse {
            0% {
                box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
            }

            70% {
                box-shadow: 0 0 0 15px rgba(var(--primary-rgb), 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
            }
        }

        .cta-pulse {
            animation: premiumPulse 2.5s infinite;
        }

        .modal-body::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 10px;
        }

        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(255, 255, 255, 0.02);
        }

        .modal-header h3 {
            margin: 0;
            font-size: 1.25rem;
            color: #fff;
        }

        .btn-icon-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--text-secondary);
            cursor: pointer;
        }

        .btn-icon-close:hover {
            color: #fff;
        }

        .scen-radio-card {
            position: relative;
            cursor: pointer;
        }

        .scen-radio-card input {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .scen-card-inner {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            transition: all 0.2s;
        }

        .scen-radio-card input:checked+.scen-card-inner {
            background: rgba(99, 102, 241, 0.15);
            border-color: var(--primary);
            box-shadow: 0 0 0 2px var(--primary);
        }

        .scen-name {
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-bottom: 0.25rem;
        }

        .scen-val {
            font-size: 1.1rem;
            font-weight: 700;
            color: #fff;
        }

        .ch-row {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            position: relative;
        }

        .ch-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
        }

        .ch-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 1rem;
        }

        .ch-field label {
            font-size: 0.75rem;
            color: var(--text-secondary);
            display: block;
            margin-bottom: 4px;
        }

        /* PREMIUM FORM STYLES */
        .mp-card {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }

        .mp-card-header {
            font-size: 0.95rem;
            font-weight: 600;
            color: #fff;
            margin-bottom: 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .mp-grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.25rem;
        }

        .input-group.input-error {
            border-color: #ef4444 !important;
            box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
        }

        .field-error {
            color: #ef4444;
            font-size: 0.7rem;
            margin-top: 4px;
            font-weight: 500;
            display: none;
        }

        .mp-footer {
            padding: 1.5rem 2rem;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            background: #121212;
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            z-index: 10;
        }

        .input-group:focus-within {
            background: rgba(255, 255, 255, 0.08);
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
        }

        /* PREMIUM SCENARIO CARDS */
        .scen-card {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 12px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            gap: 6px;
            text-align: left;
            position: relative;
        }

        .scen-card:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .scen-card.selected {
            background: rgba(99, 102, 241, 0.1);
            border-color: var(--primary);
            box-shadow: 0 0 0 1px var(--primary);
        }

        .scen-card input {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .scen-title {
            font-size: 0.95rem;
            font-weight: 600;
            color: #fff;
        }

        .scen-val {
            font-size: 0.85rem;
            color: var(--accent-success);
            font-weight: 500;
        }

        .scen-micro {
            font-size: 0.75rem;
            color: var(--text-secondary);
            line-height: 1.3;
        }

        /* WIZARD HEADER */
        .mp-wizard-header {
            margin-bottom: 2rem;
            text-align: center;
        }

        .mp-wizard-title {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: #fff;
        }

        .mp-wizard-subtitle {
            font-size: 0.9rem;
            color: var(--text-secondary);
            max-width: 400px;
            margin: 0 auto;
        }

        /* STICKY FOOTER */
        .mp-footer {
            position: sticky;
            bottom: -24px;
            margin: 2rem -24px -24px -24px;
            padding: 1.5rem;
            background: #111827;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 10;
        }

        .input-group input,
        .input-group select {
            background: transparent;
            border: none;
            color: #fff;
            width: 100%;
            padding: 6px 0;
            font-size: 0.95rem;
            outline: none;
        }

        .input-suffix-pill {
            font-size: 0.75rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 2px 6px;
            border-radius: 4px;
            color: var(--text-secondary);
            margin-left: 8px;
            white-space: nowrap;
            user-select: none;
        }

        .form-label {
            display: block;
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 6px;
            font-weight: 500;
        }

        .helper-text {
            font-size: 0.7rem;
            color: rgba(255, 255, 255, 0.4);
            margin-top: 4px;
        }

        .ch-item {
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            padding-bottom: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .ch-item:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }

        /* Segmented Control for Scenarios */
        .seg-control {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 4px;
            background: rgba(0, 0, 0, 0.2);
            padding: 4px;
            border-radius: 8px;
        }

        .seg-option {
            cursor: pointer;
            text-align: center;
            padding: 10px 4px;
            border-radius: 6px;
            transition: all 0.2s;
            border: 1px solid transparent;
        }

        .seg-option:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .seg-option input {
            display: none;
        }

        .seg-option.selected {
            background: rgba(99, 102, 241, 0.15);
            border-color: var(--primary);
        }

        .seg-label {
            display: block;
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 2px;
        }

        .seg-value {
            display: block;
            font-size: 1rem;
            font-weight: 700;
            color: #fff;
        }

        .validation-msg {
            color: #ef4444;
            font-size: 0.75rem;
            margin-top: 4px;
            display: none;
        }

        .has-error .input-group {
            border-color: #ef4444;
            background: rgba(239, 68, 68, 0.05);
        }

        @media (max-width: 600px) {
            .mp-grid-2 {
                grid-template-columns: 1fr;
            }
        }

        .ch-field input:focus,
        .ch-field select:focus {
            background: rgba(255, 255, 255, 0.1);
            border-color: var(--primary);
            outline: none;
        }

        .input-error {
            border-color: #ef4444 !important;
            background: rgba(239, 68, 68, 0.05) !important;
        }

        .ch-field-error {
            color: #ef4444;
            font-size: 0.75rem;
            margin-top: 4px;
            display: none;
        }

        /* REPORT SCREEN STYLES (PDF-READY TRANSFORM) */
        .report-document {
            background: #fff;
            color: #111;
            padding: 2.5rem;
            margin: 0 auto;
            max-width: 1024px;
            min-height: 100vh;
            box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
        }

        .report-plan-section {
            page-break-after: always;
            border-bottom: 2px solid #eee;
            margin-bottom: 4rem;
            padding-bottom: 4rem;
        }

        .report-plan-section:last-child {
            page-break-after: auto;
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }

        .report-header-v2 {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: start;
            border-bottom: 2px solid #111;
            padding-bottom: 1.5rem;
            margin-bottom: 2.5rem;
        }

        .report-logo-group {
            text-align: left;
        }

        .report-meta-group {
            text-align: center;
        }

        .report-status-group {
            text-align: right;
        }

        .report-kpi-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 2.5rem;
        }

        .report-kpi-card {
            border: 1px solid #ddd;
            padding: 1rem;
            border-radius: 4px;
            background: #fcfcfc;
        }

        .report-kpi-label {
            font-size: 9px;
            font-weight: 800;
            text-transform: uppercase;
            color: #666;
            margin-bottom: 4px;
            display: block;
        }

        .report-kpi-value {
            font-size: 1.25rem;
            font-weight: 900;
            color: #111;
            font-family: 'Inter', sans-serif;
            font-variant-numeric: tabular-nums;
        }

        .report-table-v2 {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
            font-size: 11px;
            margin-bottom: 1.5rem;
        }

        .report-table-v2 tr {
            page-break-inside: avoid;
        }

        .report-table-v2 th {
            background: #f4f4f4;
            color: #333;
            font-weight: 800;
            text-transform: uppercase;
            padding: 8px 6px;
            border: 1px solid #ddd;
            text-align: right;
            word-wrap: break-word;
        }

        .report-table-v2 td {
            padding: 8px 6px;
            border: 1px solid #eee;
            text-align: right;
            color: #111;
            font-variant-numeric: tabular-nums;
        }

        .report-table-v2 .text-left {
            text-align: left;
        }

        .report-table-v2 .text-center {
            text-align: center;
        }

        .no-print {
            display: block;
        }

        @media print {
            body {
                background: #fff !important;
                color: #111 !important;
            }

            .screen {
                display: none !important;
            }

            #screen-media-report {
                display: block !important;
                padding: 0 !important;
                margin: 0 !important;
            }

            .report-document {
                box-shadow: none !important;
                margin: 0 !important;
                padding: 0 !important;
                width: 100% !important;
                max-width: none !important;
            }

            .no-print {
                display: none !important;
            }

            .report-plan-section {
                page-break-before: always;
                border-bottom: none;
            }

            .report-plan-section:first-child {
                page-break-before: auto;
            }

            * {
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }
        }

        @media (max-width: 640px) {
            /* Force inputs to not expand grids past viewport and prevent iOS zoom drift */
            input, select, textarea {
                min-width: 0 !important;
                max-width: 100% !important;
                font-size: 16px !important; /* Prevents auto-zoom acting as screen drift */
                touch-action: pan-x pan-y;
            }
            
            .ch-grid {
                grid-template-columns: 1fr;
            }

            .modal-card {
                width: 100%;
                height: 100%;
                border-radius: 0;
            }

            .report-summary-grid {
                grid-template-columns: 1fr;
            }

            /* Report KPI Grid to 1 Column */
            .report-kpi-grid {
                grid-template-columns: 1fr !important;
                gap: 1rem;
            }

            /* Report Table to Cards */
            .report-table-v2, .report-table-v2 thead, .report-table-v2 tbody, .report-table-v2 th, .report-table-v2 td, .report-table-v2 tr {
                display: block !important;
                width: 100% !important;
            }

            .report-table-v2 thead tr {
                position: absolute;
                top: -9999px;
                left: -9999px;
            }

            .report-table-v2 tr {
                border: 1px solid #ddd;
                margin-bottom: 1rem;
                border-radius: 8px;
                padding: 0.5rem;
                background: #fcfcfc;
            }

            .report-table-v2 td {
                border: none !important;
                border-bottom: 1px solid #eee !important;
                position: relative;
                padding-left: 50% !important;
                text-align: right !important;
                min-height: 2rem;
            }

            .report-table-v2 td:last-child {
                border-bottom: 0 !important;
            }

            .report-table-v2 td:before {
                position: absolute;
                top: 8px;
                left: 6px;
                width: 45%;
                padding-right: 10px;
                white-space: nowrap;
                content: attr(data-label);
                font-weight: 800;
                text-align: left;
                color: #666;
                text-transform: uppercase;
                font-size: 9px;
            }
            
            .report-header-v2 {
                grid-template-columns: 1fr !important;
                gap: 1.5rem;
                text-align: center;
            }
            .report-logo-group, .report-meta-group, .report-status-group {
                text-align: center !important;
            }

            /* Home Table to Cards (Dark Theme) */
            .home-table-v2, .home-table-v2 thead, .home-table-v2 tbody, .home-table-v2 th, .home-table-v2 td, .home-table-v2 tr {
                display: block !important;
                width: 100% !important;
            }

            .home-table-v2 thead tr {
                position: absolute;
                top: -9999px;
                left: -9999px;
            }

            .home-table-v2 tr {
                border: 1px solid rgba(255, 255, 255, 0.1);
                margin-bottom: 1rem;
                border-radius: 8px;
                padding: 0.5rem;
                background: rgba(255, 255, 255, 0.05);
            }

            .home-table-v2 td {
                border: none !important;
                border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
                position: relative;
                padding-left: 50% !important;
                text-align: right !important;
                min-height: 2rem;
            }

            .home-table-v2 td:last-child {
                border-bottom: 0 !important;
            }

            .home-table-v2 td:before {
                position: absolute;
                top: 8px;
                left: 6px;
                width: 45%;
                padding-right: 10px;
                white-space: nowrap;
                content: attr(data-label);
                font-weight: 800;
                text-align: left;
                color: rgba(255, 255, 255, 0.4);
                text-transform: uppercase;
                font-size: 9px;
            }
        }

        /* BUILDER SCREEN STYLES */
        #screen-media-builder {
            background: var(--bg-page);
            padding-top: 2rem;
        }

        .builder-layout {
            display: grid;
            grid-template-columns: 1fr 320px;
            gap: 2rem;
            align-items: start;
        }

        .builder-main {
            background: var(--bg-surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 2rem;
        }

        /* PLAN TABS */
        .plan-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--border);
            padding-bottom: 0px;
        }

        .plan-tab {
            padding: 0.6rem 1.2rem;
            border-radius: 8px 8px 0 0;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--border);
            border-bottom: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            position: relative;
            top: 1px;
        }

        .plan-tab.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .plan-tab:hover:not(.active) {
            background: rgba(255, 255, 255, 0.08);
        }

        /* COMPARISON SUMMARY STRIP */
        .comparison-summary-strip {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
            overflow-x: auto;
            padding-bottom: 0.5rem;
        }

        .comp-plan-card {
            min-width: 220px;
            background: var(--bg-surface);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .comp-plan-card.active {
            border-color: var(--primary);
            background: rgba(99, 102, 241, 0.05);
            box-shadow: 0 0 0 1px var(--primary);
        }

        .comp-plan-card .plan-name {
            font-size: 0.75rem;
            text-transform: uppercase;
            color: var(--text-secondary);
            font-weight: 700;
            margin-bottom: 0.75rem;
            display: flex;
            justify-content: space-between;
        }

        .comp-plan-row {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            margin-bottom: 0.35rem;
        }

        .comp-plan-row span {
            color: var(--text-muted);
        }

        .comp-plan-row strong {
            color: white;
        }

        .builder-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }

        .builder-table th {
            background: var(--bg-surface-elevated);
            padding: 1rem 0.75rem;
            text-align: left;
            color: var(--text-secondary);
            font-weight: 600;
            border-bottom: 1px solid var(--border);
        }

        .builder-table td {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border);
            vertical-align: middle;
        }

        .builder-input {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--border);
            color: white;
            padding: 6px 8px;
            border-radius: 4px;
            width: 100%;
            font-size: 0.85rem;
        }

        .builder-input:focus {
            outline: none;
            border-color: var(--primary);
            background: rgba(255, 255, 255, 0.08);
        }

        .live-totals-panel {
            background: var(--bg-surface);
            border: 1px solid var(--primary);
            border-radius: 12px;
            padding: 1.5rem;
            position: sticky;
            top: 100px;
            box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
        }

        .live-totals-panel h3 {
            font-size: 1rem;
            margin-bottom: 1.25rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--border);
            color: var(--primary);
        }

        .live-total-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.75rem;
            font-size: 0.85rem;
        }

        .live-total-row span {
            color: var(--text-secondary);
        }

        .live-total-row strong {
            color: white;
        }

        .live-delta-row {
            margin-top: 1.25rem;
            padding-top: 1rem;
            border-top: 1px dashed var(--border);
        }

        .live-delta-item {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            margin-bottom: 0.5rem;
        }

        .builder-footer {
            margin-top: 2rem;
            display: flex;
            justify-content: space-between;
            gap: 1rem;
        }

        @media (max-width: 1100px) {
            .builder-layout {
                grid-template-columns: 1fr;
            }

            .live-totals-panel {
                position: static;
            }
        }

        /* SUPABASE UI STYLES */
        .auth-gate {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(8px);
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .sync-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            padding: 2px 8px;
            border-radius: 4px;
            letter-spacing: 0.1em;
            transition: all 0.3s ease;
        }

        .sync-online {
            background: rgba(16, 185, 129, 0.1);
            color: var(--accent-success);
        }

        .sync-offline {
            background: rgba(161, 161, 170, 0.1);
            color: var(--text-secondary);
        }

        .sync-error {
            background: rgba(239, 68, 68, 0.1);
            color: var(--accent-danger);
        }

        .cloud-info-bar {
            display: flex;
            align-items: center;
            gap: 1rem;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
        }

        /* GLOBAL HEADER & LAYOUT */
        .global-nav {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 64px;
            z-index: 1000;
            background: rgba(13, 14, 18, 0.8);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            display: flex;
            align-items: center;
            padding: 0 1.5rem;
        }

        .app-container {
            padding-top: 64px;
        }

        /* Ensure all sticky bars sit below global nav */
        .sticky {
            top: 64px !important;
        }

        .header-selectors {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        /* Mobile Header Optimization */
        @media (max-width: 640px) {
            .global-nav {
                padding: 0 1rem;
                height: 56px;
            }

            .app-container {
                padding-top: 56px;
            }

            .sticky {
                top: 56px !important;
            }

            .header-selectors {
                display: none;
                /* Hide complex selectors on mobile header to keep it single row */
            }

            .user-info-text {
                display: none;
                /* Hide name/email text on mobile to stay in one row */
            }

            .global-nav .auth-text {
                display: none;
                /* Hide Login text, just show icon if we had one, but for now we keep it minimal */
            }

            .user-profile-block {
                gap: 0.5rem;
            }

            .user-name-label {
                display: none;
                /* Only show avatar/icon on mobile if space is tight */
            }
        }

        .library-modal {
            position: fixed;
            inset: 0;
            /* Standard fixed inset-0 */
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(12px);
            z-index: 9999;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px;
            transform: none !important;
            /* Force reset transforms */
        }

        .library-content {
            width: 100%;
            max-width: 1140px;
            /* max-w-6xl equivalent or 1000px if preferred, 6xl is ~1152px */
            max-height: 85vh;
            background: var(--bg-surface);
            border: 1px solid var(--border);
            border-radius: 32px;
            box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
            transform: none !important;
            /* Force reset transforms */
        }

        .library-table-container {
            flex-grow: 1;
            overflow-y: auto;
            padding: 0 32px 32px;
        }

        .library-table {
            width: 100%;
            border-collapse: collapse;
            text-align: left;
        }

        .library-table th {
            position: sticky;
            top: 0;
            background: var(--bg-surface);
            padding: 16px 8px;
            border-bottom: 1px solid var(--border-dim);
            z-index: 10;
        }

        .library-table td {
            padding: 20px 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            vertical-align: middle;
        }

        .library-btn {
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 10px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            transition: all 0.3s ease;
        }

        .sync-badge {
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .sync-badge:hover {
            opacity: 0.8;
            transform: translateY(-1px);
        }

        #globalErrorBanner {
            position: fixed;
            top: 72px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 9999;
            background: #7f1d1d;
            color: #fca5a5;
            padding: 12px 24px;
            border-radius: 12px;
            border: 1px solid rgba(248, 113, 113, 0.2);
            font-size: 11px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            display: none;
            align-items: center;
            gap: 12px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
            max-width: 90%;
            text-align: center;
        }

        .lib-btn-load {
            background: var(--primary);
            color: white;
        }

        .lib-btn-danger {
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.2);
        }

        .lib-btn-danger:hover {
            background: rgba(239, 68, 68, 0.1);
        }

        .client-selector-mini {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: white;
            border-radius: 8px;
            padding: 4px 12px;
            font-size: 11px;
            font-weight: 700;
        }

        .client-selector-mini option {
            background: #1a1a1a !important;
            color: white !important;
        }

        /* PREMIUM ANIMATION UTILITIES */
        @keyframes verticalFlow {
            0% { background-position: 50% -100%; opacity: 0.5; }
            50% { background-position: 50% 100%; opacity: 0.9; }
            100% { background-position: 50% -100%; opacity: 0.5; }
        }

        @keyframes subtlePulse {
            0% { transform: scale(1); opacity: 0.5; }
            50% { transform: scale(1.02); opacity: 0.8; }
            100% { transform: scale(1); opacity: 0.5; }
        }

        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0px); }
        }

        .animate-flowing-lines {
            background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.45), transparent);
            background-size: 100% 200%;
            animation: verticalFlow 4s linear infinite;
        }

        .animate-subtle-pulse {
            animation: subtlePulse 4s ease-in-out infinite;
        }

        .animate-float {
            animation: float 3s ease-in-out infinite;
        }

        .hover-lift:hover {
            transform: translateY(-4px) scale(1.01);
        }

        /* PREMIUM MOTION ENHANCEMENTS */
        @keyframes modernGrid {
            0% { background-position: 0 0; }
            100% { background-position: 40px 40px; }
        }

        @keyframes movingGlow {
            0% { transform: translate(-50%, -50%) rotate(0deg); }
            100% { transform: translate(-50%, -50%) rotate(360deg); }
        }

        @keyframes signalFlow {
            0% { transform: translateY(-100%) translateX(-10%); opacity: 0; }
            20% { opacity: 0.4; }
            80% { opacity: 0.4; }
            100% { transform: translateY(100%) translateX(10%); opacity: 0; }
        }

        .animate-modern-grid {
            background-image: 
                linear-gradient(to right, rgba(99, 102, 241, 0.12) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(99, 102, 241, 0.12) 1px, transparent 1px);
            background-size: 50px 50px;
            animation: modernGrid 20s linear infinite;
        }

        .premium-glow-bg {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 200%;
            height: 200%;
            background: conic-gradient(from 0deg, transparent, var(--primary), transparent, var(--primary), transparent);
            opacity: 0.1;
            filter: blur(140px);
            animation: movingGlow 20s linear infinite;
            pointer-events: none;
            z-index: 0;
        }

        .bg-signal-line {
            position: absolute;
            width: 1px;
            height: 300px;
            background: linear-gradient(to bottom, transparent, var(--primary), transparent);
            filter: blur(1px);
            z-index: 1;
            pointer-events: none;
        }

        /* REVEAL ON SCROLL - Safe Defaults */
        .reveal-on-scroll {
            transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
        }

        /* Elements are visible by default. JS will hide them IF it can animate them. */
        .reveal-on-scroll.revealed {
            opacity: 1 !important;
            transform: translateY(0) !important;
        }

        .premium-card-hover {
            transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            z-index: 1;
        }

        .premium-card-hover:hover {
            background: rgba(255, 255, 255, 0.07) !important;
            border-color: rgba(99, 102, 241, 0.4) !important;
            box-shadow: 
                0 20px 40px -10px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(99, 102, 241, 0.1);
            transform: translateY(-6px) scale(1.01);
            z-index: 10;
        }

        .premium-card-hover::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.06), transparent 40%);
            opacity: 0;
            transition: opacity 0.5s;
            pointer-events: none;
            z-index: -1;
        }

        .premium-card-hover:hover::before {
            opacity: 1;
        }

        .progress-fill-animate {
            transition: width 1.2s cubic-bezier(0.65, 0, 0.35, 1);
        }

        /* AI LOADING PULSE */
        @keyframes aiPulse {
            0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
            70% { box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); }
            100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
        }

        .ai-loading-pulse {
            animation: aiPulse 2s infinite;
        }

        /* Respect Reduced Motion */
        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
                scroll-behavior: auto !important;
            }
            .reveal-on-scroll {
                opacity: 1 !important;
                transform: none !important;
            }
        }

        .hover-glow {
            transition: all 0.3s ease;
        }

        .hover-glow:hover {
            box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
            border-color: rgba(99, 102, 241, 0.4) !important;
        }

        .glass-card {
            background: rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        /* ADD CHANNEL MODAL */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(8px);
            z-index: 9999;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal-content {
            background: var(--bg-surface);
            border: 1px solid var(--border);
            border-radius: 1.5rem;
            width: 100%;
            max-width: 500px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            overflow: hidden;
            animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes modalFadeIn {
            from {
                opacity: 0;
                transform: scale(0.95) translateY(10px);
            }

            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-body {
            padding: 1.5rem;
            max-height: 70vh;
            overflow-y: auto;
        }

        .modal-footer {
            padding: 1.25rem 1.5rem;
            border-top: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.02);
            display: flex;
            justify-content: flex-end;
            gap: 0.75rem;
        }

        .alloc-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
            padding: 0.75rem;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 0.75rem;
            border: 1px solid transparent;
            transition: all 0.2s ease;
        }

        .alloc-row:focus-within {
            border-color: var(--primary);
            background: rgba(99, 102, 241, 0.05);
        }

        .alloc-input {
            background: transparent;
            border: none;
            color: white;
            font-weight: 700;
            font-size: 1rem;
            width: 60px;
            text-align: right;
            outline: none;
        }

        .alloc-input::-webkit-inner-spin-button,
        .alloc-input::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .alloc-total-bar {
            margin-top: 1.5rem;
            padding-top: 1rem;
            border-top: 1px dashed var(--border);
        }

        .total-display {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
        }

        .total-status {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .progress-bg {
            height: 6px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: var(--primary);
            transition: width 0.3s ease, background 0.3s ease;
        }

        .progress-fill.error {
            background: var(--accent-danger);
        }

        .progress-fill.success {
            background: var(--accent-success);
        }

        /* AI STRATEGIST STYLES */
        .ai-panel {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
            border: 1px solid rgba(99, 102, 241, 0.2);
            border-radius: 2rem;
            padding: 2rem;
            margin-top: 2rem;
            position: relative;
            overflow: hidden;
        }

        .ai-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, transparent, var(--primary), transparent);
            animation: ai-glow 3s infinite;
        }

        @keyframes ai-glow {
            0% {
                transform: translateX(-100%);
            }

            100% {
                transform: translateX(100%);
            }
        }

        .ai-shimmer {
            background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        .ai-content {
            font-size: 0.95rem;
            line-height: 1.6;
            color: var(--text-secondary);
        }

        .ai-content h3 {
            color: white;
            font-weight: 800;
            margin-top: 1.5rem;
            margin-bottom: 0.75rem;
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.1em;
            display: block;
        }

        .ai-content ul {
            list-style: none;
            padding-left: 0;
            margin-bottom: 1rem;
        }
        /* --- MODULE 2: CUSTOMER ECONOMICS ENGINE --- */
        .m2-dashboard {
            animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .m2-input-panel {
            position: sticky;
            top: 2rem;
        }

        /* Custom range styling to match premium aesthetic */
        input[type=range] {
            -webkit-appearance: none;
            appearance: none;
            background: transparent;
        }

        input[type=range]::-webkit-slider-runnable-track {
            width: 100%;
            height: 6px;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
        }

        input[type=range]::-webkit-slider-thumb {
            height: 18px;
            width: 18px;
            border-radius: 50%;
            background: #fff;
            cursor: pointer;
            -webkit-appearance: none;
            appearance: none;
            margin-top: -6px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
            transition: transform 0.2s ease;
        }

        input[type=range]:active::-webkit-slider-thumb {
            transform: scale(1.2);
        }

        /* Health Score Color Utilities */
        .m2-score-high { color: var(--accent-success); }
        .m2-score-med { color: #f59e0b; }
        .m2-score-low { color: var(--accent-danger); }

        /* Animation for recommendation panel */
        .m2-recommendation-pulse {
            animation: m2-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }

        @keyframes m2-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        .m2-snapshot-section {
            margin-top: 2rem;
        }
        .m2-snapshot-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin-top: 1.5rem;
            border-radius: 12px;
            overflow: hidden;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.05);
        }
        .m2-snapshot-header th {
            background: rgba(255, 255, 255, 0.04);
            padding: 1rem;
            text-align: left;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }
        .m2-snapshot-row td {
            padding: 1rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            vertical-align: middle;
        }
        .m2-snapshot-row:last-child td {
            border-bottom: none;
        }
        .m2-row-red {
            background: rgba(239, 68, 68, 0.03) !important;
        }
        .m2-row-green {
            background: rgba(16, 185, 129, 0.03) !important;
        }
        .m2-row-transition {
            border-left: 3px solid #10b981 !important;
        }
        .m2-insight-box {
            margin-top: 1.5rem;
            padding: 1.5rem;
            background: rgba(99, 102, 241, 0.05);
            border-left: 4px solid #6366f1;
            border-radius: 0 12px 12px 0;
        }
        @media (max-width: 768px) {
            .m2-desktop-hidden {
                display: none !important;
            }
        }

        /* Mobile specific adjustments for Module 2 */
        @media (max-width: 768px) {
            .m2-dashboard {
                padding-bottom: 5rem;
            }
        }

        /* --- MODULE 2 - NEW WHAT-IF CARDS (REFINED) --- */
        .m2-sim-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.25rem;
            margin-top: 2rem;
        }

        .m2-sim-card {
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 1.5rem;
            padding: 1.5rem 1.25rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            overflow: hidden;
        }

        .m2-sim-card:hover {
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(255, 255, 255, 0.15);
            transform: translateY(-3px);
            box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
        }

        .m2-sim-label {
            font-size: 8px;
            font-weight: 900;
            color: rgba(255, 255, 255, 0.3);
            text-transform: uppercase;
            letter-spacing: 0.2em;
            margin-bottom: 1rem;
        }

        .m2-sim-base {
            font-size: 10px;
            font-weight: 800;
            color: rgba(255, 255, 255, 0.15);
            text-decoration: line-through !important;
            margin-bottom: 0.25rem;
            display: block;
        }

        .m2-sim-value {
            font-size: 1.5rem;
            font-weight: 950;
            color: #ffffff;
            letter-spacing: -0.03em;
            line-height: 1.1;
            margin-bottom: 1rem;
        }

        .m2-sim-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.4rem 0.75rem;
            border-radius: 0.75rem;
            font-size: 9px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.02em;
        }

        .m2-badge-green {
            background: rgba(16, 185, 129, 0.12) !important;
            color: #10b981 !important;
            border: 1px solid rgba(16, 185, 129, 0.1);
        }

        .m2-badge-red {
            background: rgba(239, 68, 68, 0.12) !important;
            color: #ef4444 !important;
            border: 1px solid rgba(239, 68, 68, 0.1);
        }

        .m2-badge-grey {
            background: rgba(255, 255, 255, 0.08) !important;
            color: rgba(255, 255, 255, 0.4) !important;
        }

        @media (max-width: 768px) {
            .m2-sim-grid {
                grid-template-columns: 1fr;
                gap: 1.25rem;
            }
            .m2-sim-card {
                padding: 1.75rem;
            }
        }

        /* --- MODULE 2 - TOOLTIP SYSTEM --- */
        .m2-tooltip-trigger {
            cursor: help;
            display: inline-flex;
            align-items: center;
            margin-left: 6px;
            color: rgba(255, 255, 255, 0.7);
            transition: all 0.2s ease;
            vertical-align: middle;
            font-size: 14px;
        }

        .m2-tooltip-trigger:hover {
            color: #6366f1;
            transform: scale(1.1);
        }

        .m2-tooltip-container {
            position: fixed;
            z-index: 10000;
            background: #1a1a2e;
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #ffffff;
            padding: 1.25rem;
            border-radius: 1.25rem;
            font-size: 12px;
            width: 300px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease, transform 0.2s ease;
            transform: translateY(10px);
            backdrop-filter: blur(10px);
        }

        .m2-tooltip-container.active {
            opacity: 1;
            transform: translateY(0);
        }

        .m2-tooltip-title {
            font-weight: 900;
            color: #ffffff;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            margin-bottom: 0.75rem;
            display: block;
            font-size: 11px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding-bottom: 0.5rem;
        }

        .m2-tooltip-body {
            color: rgba(255, 255, 255, 0.8);
            line-height: 1.6;
            margin-bottom: 1rem;
        }

        .m2-tooltip-formula-box {
            background: rgba(0, 0, 0, 0.4);
            padding: 0.85rem;
            border-radius: 0.75rem;
            margin-bottom: 1rem;
            border: 1px solid rgba(99, 102, 241, 0.3);
        }

        .m2-tooltip-formula {
            display: block;
            font-family: 'Mono', monospace;
            font-size: 11px;
            color: #818cf8;
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

        .m2-tooltip-example {
            display: block;
            font-size: 10px;
            color: rgba(255, 255, 255, 0.4);
            line-height: 1.4;
            letter-spacing: 0.02em;
        }

        .m2-tooltip-bottom {
            font-weight: 800;
            color: #10b981;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 0.75rem;
            margin-top: 0.25rem;
        }

        /* ApexCharts Tooltip Sync */
        .apexcharts-tooltip.apexcharts-theme-dark {
            background: #1a1a2e !important;
            border: 1px solid rgba(255, 255, 255, 0.2) !important;
            border-radius: 1rem !important;
            box-shadow: 0 15px 30px rgba(0,0,0,0.5) !important;
        }

        /* --- PREMIUM VISUAL UTILITIES --- */
        .visual-container {
            position: relative;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 1.5rem;
            overflow: hidden;
            box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5), 
                        0 0 30px rgba(99, 102, 241, 0.1);
            transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                        box-shadow 0.5s ease;
        }

        .visual-container:hover {
            transform: translateY(-5px) scale(1.01);
            box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6), 
                        0 0 45px rgba(99, 102, 241, 0.2);
        }

        .browser-chrome {
            height: 28px;
            background: rgba(255, 255, 255, 0.03);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            display: flex;
            align-items: center;
            padding: 0 0.75rem;
            gap: 0.4rem;
        }

        .chrome-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
        }

        .dot-red { background: #ff5f56; }
        .dot-yellow { background: #ffbd2e; }
        .dot-green { background: #27c93f; }

        .hero-floating {
            animation: heroFloat 6s ease-in-out infinite;
        }

        @keyframes heroFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-15px); }
        }

        .blurred-bg-visual {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100%;
            height: 100%;
            opacity: 0.12;
            filter: blur(60px);
            z-index: -1;
            pointer-events: none;
            object-fit: cover;
        }

        @media (max-width: 1024px) {
            .visual-container {
                border-radius: 1rem;
            }
        }

/* Custom Pulse Glow Animation for Sidebar CTA */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.7); }
    100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
}
.pulse-glow {
    animation: pulse-glow 2s infinite ease-in-out;
}

        /* STRATEGY SIMULATOR ENHANCEMENTS */
        .stress-chips-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 0.75rem;
            padding-left: 1rem;
        }

        .stress-chip {
            padding: 4px 12px;
            border-radius: 99px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.08);
            color: rgba(255,255,255,0.4);
            font-size: 9px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            cursor: pointer;
            transition: all 0.2s;
        }

        .stress-chip:hover {
            background: rgba(255,255,255,0.08);
            border-color: rgba(255,255,255,0.15);
            color: rgba(255,255,255,0.8);
        }

        .stress-chip.active {
            background: rgba(99, 102, 241, 0.1);
            border-color: rgba(99, 102, 241, 0.3);
            color: #6366f1;
            box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
        }

        .lever-card {
            cursor: pointer;
            position: relative;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

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

        .lever-card-edit-overlay {
            position: absolute;
            inset: 0;
            background: #121212;
            border-radius: inherit;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            z-index: 50;
            border: 1px solid rgba(99, 102, 241, 0.5);
            box-shadow: 0 0 30px rgba(0,0,0,0.8);
            animation: leverFadeIn 0.2s ease-out;
        }

        @keyframes leverFadeIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        .lever-input {
            width: 100%;
            background: transparent;
            border: none;
            border-bottom: 2px solid rgba(255,255,255,0.1);
            color: white;
            font-size: 1.25rem;
            font-weight: 900;
            text-align: center;
            padding: 0.5rem 0;
            margin-bottom: 0.75rem;
            font-family: monospace;
        }

        .lever-input:focus {
            outline: none;
            border-bottom-color: #6366f1;
        }

        .lever-slider {
            width: 100%;
            height: 4px;
            -webkit-appearance: none;
            background: rgba(255,255,255,0.1);
            border-radius: 2px;
            outline: none;
        }

        .lever-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 14px;
            height: 14px;
            background: #6366f1;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
        }

        .lever-toggle-btn {
            padding: 4px 12px;
            border-radius: 6px;
            font-size: 8px;
            font-weight: 900;
            text-transform: uppercase;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid rgba(255,255,255,0.1);
            background: rgba(255,255,255,0.05);
            color: rgba(255,255,255,0.4);
        }

        .lever-toggle-btn.active {
            background: #6366f1;
            color: white;
            border-color: #6366f1;
        }

/* ==========================================================================
   ONBOARDING SURVEY STYLES
   ========================================================================== */

.survey-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0f; /* Dark brand background */
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Inter', sans-serif;
}

.survey-container, .survey-result-container {
    background: #121212;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.survey-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.05);
}

.survey-progress-fill {
    height: 100%;
    background: #6366f1; /* Primary color */
    width: 10%;
    transition: width 0.4s ease;
}

.survey-content, .survey-result-container {
    padding: 40px;
}

.survey-header {
    margin-bottom: 24px;
    text-align: center;
}

.survey-count-badge {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.survey-question-text {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 40px;
    min-height: 100px;
}

.survey-scale {
    margin-bottom: 40px;
}

.survey-scale-labels {
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding: 0 10px;
}

.survey-buttons {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.survey-btn {
    flex: 1;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 56px;
}

.survey-btn:hover {
    background: rgba(255,255,255,0.1);
}

.survey-btn.selected {
    background: #6366f1;
    border-color: #6366f1;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.survey-footer {
    display: flex;
    justify-content: flex-end;
}

.survey-next-btn {
    background: #6366f1;
    color: white;
    padding: 16px 40px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.survey-next-btn:disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
    cursor: not-allowed;
}

.survey-next-btn:not(:disabled):hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

@media (max-width: 640px) {
    .survey-content, .survey-result-container {
        padding: 24px;
    }
    .survey-question-text {
        font-size: 20px;
    }
    .survey-btn {
        font-size: 14px;
    }
    .survey-scale-labels {
        font-size: 9px;
    }
}

