/* =====================================================
   APOLLO AI AGENT - 2026 RESPONSIVE DESIGN SYSTEM
   Apollo.io Brand Colors | Cross-Platform Optimized
   Supports: Desktop, iOS, Android, All Modern Browsers
   ===================================================== */

/* =====================================================
   CSS LAYERS - 2026 Best Practice for Cascade Control
   ===================================================== */
@layer reset, tokens, base, components, utilities;

/* =====================================================
   DESIGN TOKENS - Apollo.io Brand Colors
   ===================================================== */
@layer tokens {
    :root {
        /* Apollo.io Official Brand Colors */
        --apollo-yellow: #f9ff2d;
        --apollo-yellow-hover: #e6eb00;
        --apollo-yellow-subtle: rgba(249, 255, 45, 0.15);
        --apollo-black: #000000;
        --apollo-black-light: #1a1a1a;
        --apollo-white: #FFFFFF;
        --apollo-gray: #6B7280;
        --apollo-gray-light: #9CA3AF;

        /* Legacy aliases for compatibility */
        --apollo-navy: #000000;
        --apollo-navy-dark: #000000;
        --apollo-navy-light: #1a1a1a;
        --apollo-gold: #f9ff2d;
        --apollo-gold-hover: #e6eb00;
        --apollo-gold-subtle: rgba(249, 255, 45, 0.15);

        /* Accent Colors */
        --apollo-purple: #7C3AED;
        --apollo-purple-light: rgba(124, 58, 237, 0.15);
        --apollo-blue: #3B82F6;
        --apollo-blue-light: rgba(59, 130, 246, 0.15);
        --apollo-green: #10B981;
        --apollo-green-light: rgba(16, 185, 129, 0.15);
        --apollo-red: #EF4444;

        /* Background Colors */
        --bg-primary: #FFFFFF;
        --bg-secondary: #F9FAFB;
        --bg-tertiary: #F3F4F6;
        --bg-elevated: #FFFFFF;
        --bg-overlay: rgba(0, 0, 0, 0.6);

        /* Text Colors */
        --text-primary: #000000;
        --text-secondary: #374151;
        --text-tertiary: #6B7280;
        --text-muted: #9CA3AF;
        --text-inverse: #FFFFFF;

        /* Border Colors */
        --border-light: #E5E7EB;
        --border-medium: #D1D5DB;
        --border-strong: #9CA3AF;
        --border-focus: var(--apollo-yellow);

        /* Shadows - Optimized for Performance */
        --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
        --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
        --shadow-glow-yellow: 0 4px 20px rgba(249, 255, 45, 0.5);
        --shadow-glow-gold: 0 4px 20px rgba(249, 255, 45, 0.5);
        --shadow-glow-purple: 0 4px 20px rgba(124, 58, 237, 0.3);

        /* Typography - Fluid Sizing (2026 Best Practice) */
        --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

        /* Fluid Font Sizes using clamp() */
        --text-xs: clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);
        --text-sm: clamp(0.8125rem, 0.775rem + 0.15vw, 0.875rem);
        --text-base: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
        --text-lg: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
        --text-xl: clamp(1.1875rem, 1.1rem + 0.35vw, 1.25rem);
        --text-2xl: clamp(1.375rem, 1.25rem + 0.5vw, 1.5rem);
        --text-3xl: clamp(1.625rem, 1.4rem + 0.9vw, 1.875rem);

        /* Spacing Scale */
        --space-1: 0.25rem;
        --space-2: 0.5rem;
        --space-3: 0.75rem;
        --space-4: 1rem;
        --space-5: 1.25rem;
        --space-6: 1.5rem;
        --space-8: 2rem;
        --space-10: 2.5rem;
        --space-12: 3rem;

        /* Layout */
        --header-height: 60px;
        --input-height: 80px;
        --max-content-width: 800px;
        --touch-target-min: 44px;
        /* Apple HIG minimum */
        --touch-target-comfortable: 48px;
        /* Material Design recommended */

        /* Safe Areas (iOS/Android) */
        --safe-top: env(safe-area-inset-top, 0px);
        --safe-right: env(safe-area-inset-right, 0px);
        --safe-bottom: env(safe-area-inset-bottom, 0px);
        --safe-left: env(safe-area-inset-left, 0px);

        /* Transitions */
        --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
        --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
        --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
        --duration-fast: 150ms;
        --duration-base: 250ms;
        --duration-slow: 400ms;

        /* Border Radius */
        --radius-sm: 0.375rem;
        --radius-md: 0.5rem;
        --radius-lg: 0.75rem;
        --radius-xl: 1rem;
        --radius-2xl: 1.25rem;
        --radius-full: 9999px;
    }

    /* Dark Mode Support (System Preference) */
    @media (prefers-color-scheme: dark) {
        :root {
            --bg-primary: #0F1419;
            --bg-secondary: #1A2332;
            --bg-tertiary: #243447;
            --bg-elevated: #1E2B3A;

            --text-primary: #F8FAFC;
            --text-secondary: #CBD5E1;
            --text-tertiary: #94A3B8;
            --text-muted: #64748B;

            --border-light: #2A3F54;
            --border-medium: #3D556E;
            --border-strong: #5A7A99;

            --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
            --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
            --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
            --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
        }
    }
}

/* =====================================================
   CSS RESET - Modern 2026 Reset
   ===================================================== */
@layer reset {

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

    html {
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
        scroll-behavior: smooth;
        hanging-punctuation: first last;
    }

    body {
        min-height: 100vh;
        min-height: 100dvh;
        /* Dynamic viewport height - 2026 standard */
        line-height: 1.5;
        -webkit-tap-highlight-color: transparent;
    }

    img,
    picture,
    video,
    canvas,
    svg {
        display: block;
        max-width: 100%;
        height: auto;
    }

    input,
    button,
    textarea,
    select {
        font: inherit;
        color: inherit;
    }

    button {
        cursor: pointer;
        border: none;
        background: none;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        overflow-wrap: break-word;
    }

    /* Improve media defaults */
    img,
    video {
        max-block-size: 100%;
        object-fit: cover;
    }

    /* Remove list styles */
    ul,
    ol {
        list-style: none;
    }
}

/* =====================================================
   BASE STYLES
   ===================================================== */
@layer base {
    body {
        font-family: var(--font-primary);
        font-size: var(--text-base);
        color: var(--text-primary);
        background-color: var(--bg-secondary);
        overflow: hidden;
    }

    /* Focus Visible - Accessibility */
    :focus-visible {
        outline: 2px solid var(--apollo-gold);
        outline-offset: 2px;
    }

    :focus:not(:focus-visible) {
        outline: none;
    }

    /* Selection */
    ::selection {
        background: var(--apollo-gold);
        color: var(--apollo-navy);
    }

    /* Reduce motion for users who prefer it */
    @media (prefers-reduced-motion: reduce) {

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

/* =====================================================
   MAIN APP CONTAINER
   ===================================================== */
@layer components {
    .agent-app {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        background: var(--bg-primary);
        position: relative;
        overflow: hidden;
    }

    /* Desktop: Centered container with max-width */
    @media (min-width: 768px) {
        .agent-app {
            max-width: var(--max-content-width);
            height: calc(100dvh - 2rem);
            margin: 1rem auto;
            border-radius: var(--radius-2xl);
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-xl);
        }
    }

    @media (min-width: 1024px) {
        .agent-app {
            max-width: 900px;
        }
    }

    @media (min-width: 1440px) {
        .agent-app {
            max-width: 1000px;
        }
    }

    /* =====================================================
       HEADER
       ===================================================== */
    .agent-header {
        position: sticky;
        top: 0;
        inset-inline: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        gap: var(--space-3);
        block-size: var(--header-height);
        padding-block-start: var(--safe-top);
        padding-inline: var(--space-3);
        background: var(--bg-primary);
        border-block-end: 1px solid var(--border-light);
        /* GPU acceleration for smooth scroll */
        will-change: transform;
        transform: translateZ(0);
    }

    .header-brand {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        flex: 1;
        min-width: 0;
        /* Allow shrinking */
    }

    .brand-info {
        overflow: hidden;
    }

    .brand-name {
        font-size: var(--text-sm);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        inline-size: 40px;
        block-size: 40px;
        border-radius: var(--radius-lg);
        overflow: hidden;
        flex-shrink: 0;
    }

    .brand-logo img {
        width: 40px;
        height: 40px;
        object-fit: cover;
    }

    .brand-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .brand-name {
        font-size: var(--text-base);
        font-weight: 700;
        color: var(--text-primary);
        letter-spacing: -0.01em;
    }

    .brand-status {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        font-size: var(--text-xs);
        font-weight: 500;
        color: var(--apollo-green);
    }

    .status-dot {
        inline-size: 6px;
        block-size: 6px;
        background: var(--apollo-green);
        border-radius: var(--radius-full);
        animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {

        0%,
        100% {
            opacity: 1;
            transform: scale(1);
        }

        50% {
            opacity: 0.6;
            transform: scale(1.2);
        }
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: var(--space-2);
    }

    .header-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        min-inline-size: var(--touch-target-min);
        min-block-size: var(--touch-target-min);
        padding: var(--space-2);
        background: var(--bg-tertiary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-lg);
        color: var(--text-secondary);
        transition: all var(--duration-fast) var(--ease-out);
    }

    .header-btn:hover,
    .header-btn:active {
        background: var(--apollo-gold-subtle);
        border-color: var(--apollo-gold);
        color: var(--apollo-navy);
    }

    /* Script Guide Button - More Visible */
    .script-guide-btn {
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
        background: linear-gradient(135deg, var(--apollo-gold) 0%, #FFA94D 100%);
        border-color: var(--apollo-gold);
        color: var(--apollo-navy);
        font-weight: 600;
        font-size: var(--text-sm);
        text-decoration: none;
        box-shadow: var(--shadow-glow-gold);
    }

    .script-guide-btn:hover {
        background: linear-gradient(135deg, var(--apollo-gold-hover) 0%, #FF9A2E 100%);
        transform: scale(1.02);
    }

    .script-guide-label {
        display: none;
    }

    /* Show label on larger screens */
    @media (min-width: 400px) {
        .script-guide-label {
            display: inline;
        }
    }

    /* =====================================================
       MODE TOGGLE
       ===================================================== */
    .mode-toggle-container {
        flex-shrink: 0;
    }

    .mode-toggle {
        display: flex;
        align-items: center;
        gap: var(--space-1);
        padding: var(--space-2);
        background: var(--bg-secondary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-full);
        cursor: pointer;
        font-size: var(--text-xs);
        font-weight: 600;
        color: var(--text-primary);
        transition: all var(--duration-base) var(--ease-out);
        flex-shrink: 0;
    }

    .mode-toggle:hover {
        background: var(--bg-tertiary);
        border-color: var(--apollo-gold);
    }

    .mode-toggle:active {
        transform: scale(0.98);
    }

    .mode-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        transition: all var(--duration-base);
    }

    .mode-icon.active {
        color: var(--apollo-gold);
    }

    .mode-label {
        min-width: 32px;
        text-align: center;
        display: none;
        /* Hidden on very small screens */
    }

    @media (min-width: 350px) {
        .mode-label {
            display: inline;
        }
    }

    /* Voice mode active state */
    .mode-toggle.voice-active {
        background: linear-gradient(135deg, rgba(249, 255, 45, 0.15) 0%, rgba(255, 169, 77, 0.1) 100%);
        border-color: var(--apollo-gold);
        box-shadow: var(--shadow-glow-gold);
    }

    .mode-toggle.voice-active .mode-icon-voice {
        color: var(--apollo-gold);
    }

    .mode-toggle.voice-active .mode-icon-chat {
        color: var(--text-muted);
    }

    /* Mode info card in settings */
    .mode-info-card {
        background: var(--bg-secondary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-lg);
        padding: var(--space-4);
        margin-bottom: var(--space-4);
    }

    .mode-info-header {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        margin-bottom: var(--space-2);
    }

    .mode-info-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--apollo-gold);
        color: var(--apollo-navy);
        border-radius: var(--radius-md);
    }

    .mode-info-title {
        font-size: var(--text-lg);
        font-weight: 700;
        color: var(--text-primary);
    }

    .mode-info-desc {
        font-size: var(--text-sm);
        color: var(--text-secondary);
        line-height: 1.6;
        margin: 0;
    }

    /* =====================================================
       SIDEBAR NAVIGATION
       ===================================================== */
    .sidebar {
        position: fixed;
        inset: 0;
        z-index: 1100;
        pointer-events: none;
        visibility: hidden;
    }

    .sidebar.open {
        pointer-events: auto;
        visibility: visible;
    }

    .sidebar-backdrop {
        position: absolute;
        inset: 0;
        background: var(--bg-overlay);
        backdrop-filter: blur(4px);
        opacity: 0;
        transition: opacity var(--duration-base) var(--ease-out);
    }

    .sidebar.open .sidebar-backdrop {
        opacity: 1;
    }

    .sidebar-content {
        position: absolute;
        top: 0;
        left: 0;
        width: min(320px, 85vw);
        height: 100%;
        background: var(--bg-primary);
        border-right: 1px solid var(--border-light);
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform var(--duration-base) var(--ease-out);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open .sidebar-content {
        transform: translateX(0);
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-4);
        padding-top: calc(var(--space-4) + var(--safe-top));
        border-bottom: 1px solid var(--border-light);
        background: var(--bg-secondary);
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        font-size: var(--text-lg);
        font-weight: 700;
        color: var(--text-primary);
    }

    .sidebar-brand img {
        width: 32px;
        height: 32px;
        border-radius: var(--radius-md);
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        border-radius: var(--radius-md);
        color: var(--text-secondary);
        cursor: pointer;
        transition: all var(--duration-fast);
    }

    .sidebar-close:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .sidebar-nav {
        flex: 1;
        overflow-y: auto;
        padding: var(--space-4);
    }

    .sidebar-section {
        margin-bottom: var(--space-6);
    }

    .sidebar-section.hidden {
        display: none;
    }

    .sidebar-section-title {
        font-size: var(--text-xs);
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: var(--space-2);
        padding: 0 var(--space-3);
    }

    .sidebar-item {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        width: 100%;
        padding: var(--space-3);
        background: transparent;
        border: none;
        border-radius: var(--radius-lg);
        color: var(--text-primary);
        font-size: var(--text-sm);
        font-weight: 500;
        text-decoration: none;
        cursor: pointer;
        transition: all var(--duration-fast);
        text-align: left;
    }

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

    .sidebar-item:active {
        background: var(--bg-tertiary);
        transform: scale(0.98);
    }

    .sidebar-item svg {
        flex-shrink: 0;
        color: var(--apollo-gold);
    }

    .sidebar-item span {
        flex: 1;
    }

    .sidebar-item-badge {
        font-size: var(--text-xs);
        font-weight: 600;
        padding: var(--space-1) var(--space-2);
        background: var(--apollo-gold-subtle);
        color: var(--apollo-navy);
        border-radius: var(--radius-full);
    }

    .external-icon {
        color: var(--text-muted) !important;
        margin-left: auto;
    }

    .sidebar-footer {
        padding: var(--space-4);
        padding-bottom: calc(var(--space-4) + var(--safe-bottom));
        border-top: 1px solid var(--border-light);
        background: var(--bg-secondary);
    }

    .sidebar-footer-text {
        font-size: var(--text-xs);
        color: var(--text-muted);
        text-align: center;
    }

    /* Menu button style */
    .menu-btn {
        display: flex !important;
    }

    /* =====================================================
       MODALS - Bottom Sheet on Mobile, Centered on Desktop
       ===================================================== */
    .modal {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: var(--space-4);
        padding-block-end: 0;
        transition: visibility var(--duration-base), opacity var(--duration-base);
    }

    .modal.hidden {
        visibility: hidden;
        pointer-events: none;
    }

    .modal.hidden .modal-backdrop {
        opacity: 0;
    }

    .modal.hidden .modal-content {
        transform: translateY(100%);
    }

    .modal-backdrop {
        position: absolute;
        inset: 0;
        background: var(--bg-overlay);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        transition: opacity var(--duration-base);
    }

    .modal-content {
        position: relative;
        inline-size: 100%;
        max-inline-size: 480px;
        max-block-size: 85dvh;
        background: var(--bg-primary);
        border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
        border: 1px solid var(--border-light);
        border-block-end: none;
        overflow: hidden;
        transform: translateY(0);
        transition: transform var(--duration-slow) var(--ease-out);
    }

    /* Desktop: Centered modal */
    @media (min-width: 768px) {
        .modal {
            align-items: center;
            padding: var(--space-8);
        }

        .modal-content {
            border-radius: var(--radius-2xl);
            border-block-end: 1px solid var(--border-light);
            max-block-size: 80vh;
        }

        .modal.hidden .modal-content {
            transform: translateY(20px) scale(0.95);
        }
    }

    .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-5) var(--space-5) var(--space-4);
        border-block-end: 1px solid var(--border-light);
    }

    .modal-header h3 {
        font-size: var(--text-lg);
        font-weight: 700;
        color: var(--text-primary);
    }

    .modal-close {
        display: flex;
        align-items: center;
        justify-content: center;
        inline-size: 36px;
        block-size: 36px;
        background: var(--bg-tertiary);
        border-radius: var(--radius-full);
        color: var(--text-secondary);
        transition: all var(--duration-fast);
    }

    .modal-close:hover {
        background: rgba(239, 68, 68, 0.1);
        color: var(--apollo-red);
    }

    /* Voice Options */
    .voice-options {
        padding: var(--space-4);
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        max-block-size: 50dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        /* Smooth scrolling on iOS */
        -webkit-overflow-scrolling: touch;
    }

    .voice-option {
        display: flex;
        align-items: center;
        gap: var(--space-4);
        padding: var(--space-4);
        background: var(--bg-secondary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-xl);
        min-block-size: var(--touch-target-comfortable);
        transition: all var(--duration-fast);
        text-align: start;
    }

    .voice-option:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-medium);
    }

    .voice-option.active {
        background: var(--apollo-gold-subtle);
        border-color: var(--apollo-gold);
    }

    .voice-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        inline-size: 44px;
        block-size: 44px;
        border-radius: var(--radius-full);
        flex-shrink: 0;
    }

    .voice-icon.male {
        background: linear-gradient(135deg, var(--apollo-blue) 0%, #1D4ED8 100%);
        color: white;
    }

    .voice-icon.female {
        background: linear-gradient(135deg, var(--apollo-purple) 0%, #9333EA 100%);
        color: white;
    }

    .voice-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .voice-name {
        font-size: var(--text-base);
        font-weight: 600;
        color: var(--text-primary);
    }

    .voice-desc {
        font-size: var(--text-sm);
        color: var(--text-tertiary);
    }

    .voice-check {
        display: flex;
        align-items: center;
        justify-content: center;
        inline-size: 24px;
        block-size: 24px;
        background: var(--apollo-gold);
        border-radius: var(--radius-full);
        color: var(--apollo-navy);
        opacity: 0;
        transform: scale(0.8);
        transition: all var(--duration-fast) var(--ease-spring);
    }

    .voice-option.active .voice-check {
        opacity: 1;
        transform: scale(1);
    }

    /* Toggle Controls */
    .voice-toggle-section,
    .settings-options {
        padding: var(--space-4) var(--space-5);
        border-block-start: 1px solid var(--border-light);
    }

    .toggle-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-4);
        font-size: var(--text-base);
        font-weight: 500;
        color: var(--text-primary);
        cursor: pointer;
    }

    .toggle-switch {
        position: relative;
        inline-size: 52px;
        block-size: 28px;
        flex-shrink: 0;
    }

    .toggle-switch input {
        opacity: 0;
        inline-size: 0;
        block-size: 0;
        position: absolute;
    }

    .toggle-slider {
        position: absolute;
        inset: 0;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-medium);
        border-radius: var(--radius-full);
        transition: all var(--duration-fast);
        cursor: pointer;
    }

    .toggle-slider::before {
        content: '';
        position: absolute;
        inset-block-start: 3px;
        inset-inline-start: 3px;
        inline-size: 20px;
        block-size: 20px;
        background: var(--text-muted);
        border-radius: var(--radius-full);
        transition: all var(--duration-fast);
    }

    .toggle-switch input:checked+.toggle-slider {
        background: var(--apollo-gold);
        border-color: var(--apollo-gold);
    }

    .toggle-switch input:checked+.toggle-slider::before {
        transform: translateX(24px);
        background: var(--apollo-navy);
    }

    /* Settings Items */
    .setting-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-4);
        padding-block: var(--space-4);
        border-block-end: 1px solid var(--border-light);
    }

    .setting-item:last-child {
        border-block-end: none;
    }

    .setting-info {
        display: flex;
        flex-direction: column;
        gap: var(--space-1);
    }

    .setting-label {
        font-size: var(--text-base);
        font-weight: 600;
        color: var(--text-primary);
    }

    .setting-desc {
        font-size: var(--text-sm);
        color: var(--text-tertiary);
    }

    .setting-btn {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-4);
        background: rgba(239, 68, 68, 0.1);
        border: 1px solid rgba(239, 68, 68, 0.3);
        border-radius: var(--radius-md);
        color: var(--apollo-red);
        font-size: var(--text-sm);
        font-weight: 500;
        min-block-size: var(--touch-target-min);
        transition: all var(--duration-fast);
    }

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

    /* =====================================================
       CHAT CONTAINER
       ===================================================== */
    .chat-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
    }

    .chat-messages {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: var(--space-4);
        padding-block-end: var(--space-6);
        display: flex;
        flex-direction: column;
        gap: var(--space-4);
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    @media (min-width: 768px) {
        .chat-messages {
            padding: var(--space-6);
        }
    }

    /* Custom Scrollbar */
    .chat-messages::-webkit-scrollbar {
        inline-size: 6px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: transparent;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: var(--border-medium);
        border-radius: var(--radius-full);
    }

    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: var(--border-strong);
    }

    /* =====================================================
       WELCOME CARD
       ===================================================== */
    .welcome-card {
        background: linear-gradient(135deg, var(--apollo-navy) 0%, var(--apollo-navy-light) 100%);
        border-radius: var(--radius-2xl);
        padding: var(--space-6);
        text-align: center;
        color: var(--text-inverse);
        animation: fadeInUp 0.5s var(--ease-out);
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .welcome-avatar {
        display: flex;
        align-items: center;
        justify-content: center;
        inline-size: 64px;
        block-size: 64px;
        margin-inline: auto;
        margin-block-end: var(--space-5);
        border-radius: var(--radius-xl);
        overflow: hidden;
        box-shadow: var(--shadow-glow-gold);
    }

    .welcome-avatar img {
        width: 64px;
        height: 64px;
        object-fit: cover;
    }

    @media (min-width: 768px) {
        .welcome-avatar {
            inline-size: 80px;
            block-size: 80px;
        }

        .welcome-avatar img {
            width: 80px;
            height: 80px;
        }
    }

    .welcome-title {
        font-size: var(--text-2xl);
        font-weight: 800;
        margin-block-end: var(--space-3);
        letter-spacing: -0.02em;
    }

    .welcome-desc {
        font-size: var(--text-base);
        color: rgba(255, 255, 255, 0.8);
        line-height: 1.6;
        margin-block-end: var(--space-6);
        max-inline-size: 400px;
        margin-inline: auto;
    }

    /* Welcome Action Buttons - Optimized for Click UX */
    .welcome-actions {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        text-align: start;
    }

    .welcome-action-btn {
        display: flex;
        align-items: center;
        gap: var(--space-4);
        inline-size: 100%;
        padding: var(--space-4);
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: var(--radius-xl);
        color: var(--text-inverse);
        font-family: var(--font-primary);
        text-align: start;
        cursor: pointer;
        min-block-size: var(--touch-target-comfortable);
        transition: all var(--duration-fast) var(--ease-out);
    }

    .welcome-action-btn:hover,
    .welcome-action-btn:focus-visible {
        background: rgba(255, 216, 77, 0.15);
        border-color: var(--apollo-gold);
        transform: translateX(4px);
    }

    .welcome-action-btn:active {
        transform: translateX(2px);
        background: rgba(255, 216, 77, 0.2);
    }

    .welcome-action-btn>svg:first-child {
        flex-shrink: 0;
        inline-size: 24px;
        block-size: 24px;
        padding: var(--space-2);
        background: var(--apollo-gold);
        border-radius: var(--radius-md);
        color: var(--apollo-navy);
    }

    .action-text {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .action-text strong {
        font-size: var(--text-base);
        font-weight: 600;
        color: var(--text-inverse);
    }

    .action-text small {
        font-size: var(--text-sm);
        color: rgba(255, 255, 255, 0.6);
    }

    .action-arrow {
        flex-shrink: 0;
        color: rgba(255, 255, 255, 0.4);
        transition: all var(--duration-fast);
    }

    .welcome-action-btn:hover .action-arrow {
        color: var(--apollo-gold);
        transform: translateX(4px);
    }

    /* Desktop: 2-column layout for action buttons */
    @media (min-width: 600px) {
        .welcome-actions {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: var(--space-3);
        }
    }

    /* =====================================================
       MESSAGES
       ===================================================== */
    .message {
        display: flex;
        gap: var(--space-3);
        max-inline-size: 90%;
        animation: messageIn 0.3s var(--ease-out);
    }

    @media (min-width: 768px) {
        .message {
            max-inline-size: 80%;
        }
    }

    @keyframes messageIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .message.bot-message {
        align-self: flex-start;
    }

    .message.user-message {
        align-self: flex-end;
        flex-direction: row-reverse;
    }

    .message-avatar {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        inline-size: 40px;
        block-size: 40px;
        border-radius: var(--radius-lg);
        overflow: hidden;
    }

    .message-avatar img {
        width: 40px;
        height: 40px;
        object-fit: cover;
    }


    .user-message .message-avatar {
        background: var(--apollo-navy);
        color: var(--apollo-gold);
    }

    .message-bubble {
        position: relative;
        padding: var(--space-4);
        border-radius: var(--radius-xl);
        font-size: var(--text-base);
        line-height: 1.6;
    }

    .bot-message .message-bubble {
        background: var(--bg-secondary);
        border: 1px solid var(--border-light);
        color: var(--text-primary);
        border-start-start-radius: var(--radius-sm);
    }

    .user-message .message-bubble {
        background: linear-gradient(135deg, var(--apollo-navy) 0%, var(--apollo-navy-light) 100%);
        color: var(--text-inverse);
        border-start-end-radius: var(--radius-sm);
    }

    .message-bubble p {
        margin: 0;
    }

    .message-bubble strong {
        font-weight: 700;
    }

    .message-bubble code {
        background: rgba(0, 0, 0, 0.08);
        padding: 2px 6px;
        border-radius: var(--radius-sm);
        font-family: var(--font-mono);
        font-size: var(--text-sm);
    }

    .user-message .message-bubble code {
        background: rgba(255, 255, 255, 0.15);
    }

    .message-bubble pre {
        background: var(--apollo-navy-dark);
        color: #E2E8F0;
        padding: var(--space-4);
        border-radius: var(--radius-lg);
        overflow-x: auto;
        margin-block: var(--space-3);
        font-size: var(--text-sm);
    }

    .message-bubble pre code {
        background: transparent;
        padding: 0;
    }

    /* Play Button */
    .play-btn {
        position: absolute;
        inset-block-end: var(--space-2);
        inset-inline-end: var(--space-2);
        display: flex;
        align-items: center;
        justify-content: center;
        inline-size: 28px;
        block-size: 28px;
        background: var(--apollo-blue-light);
        border-radius: var(--radius-full);
        color: var(--apollo-blue);
        opacity: 0;
        transition: all var(--duration-fast);
    }

    .message-bubble:hover .play-btn {
        opacity: 1;
    }

    .play-btn:hover {
        background: var(--apollo-blue);
        color: white;
        transform: scale(1.1);
    }

    /* Typing Indicator */
    .typing-indicator {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: var(--space-2) 0;
    }

    .typing-indicator span {
        inline-size: 8px;
        block-size: 8px;
        background: var(--apollo-gold);
        border-radius: var(--radius-full);
        animation: typingBounce 1.4s infinite ease-in-out;
    }

    .typing-indicator span:nth-child(1) {
        animation-delay: 0s;
    }

    .typing-indicator span:nth-child(2) {
        animation-delay: 0.2s;
    }

    .typing-indicator span:nth-child(3) {
        animation-delay: 0.4s;
    }

    @keyframes typingBounce {

        0%,
        80%,
        100% {
            transform: scale(0.8);
            opacity: 0.5;
        }

        40% {
            transform: scale(1.1);
            opacity: 1;
        }
    }

    /* Streaming Text Cursor Effect */
    .streaming-text::after {
        content: '▋';
        display: inline-block;
        color: var(--apollo-gold);
        animation: cursorBlink 0.8s steps(1) infinite;
        margin-inline-start: 2px;
    }

    @keyframes cursorBlink {

        0%,
        50% {
            opacity: 1;
        }

        51%,
        100% {
            opacity: 0;
        }
    }

    /* =====================================================
       QUICK ACTIONS
       ===================================================== */
    .quick-actions {
        display: flex;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .quick-actions::-webkit-scrollbar {
        display: none;
    }

    .quick-action {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-3) var(--space-4);
        background: var(--bg-primary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-full);
        color: var(--text-secondary);
        font-size: var(--text-sm);
        font-weight: 500;
        font-family: var(--font-primary);
        min-block-size: var(--touch-target-min);
        scroll-snap-align: start;
        white-space: nowrap;
        transition: all var(--duration-fast);
    }

    .quick-action:hover,
    .quick-action:active {
        background: var(--apollo-gold-subtle);
        border-color: var(--apollo-gold);
        color: var(--apollo-navy);
    }

    .quick-action svg {
        flex-shrink: 0;
        color: var(--apollo-gold);
    }

    .quick-action:hover svg {
        color: var(--apollo-navy);
    }

    /* =====================================================
       INPUT AREA
       ===================================================== */
    .input-area {
        flex-shrink: 0;
        padding: var(--space-4);
        padding-block-end: calc(var(--space-4) + var(--safe-bottom));
        background: linear-gradient(to top, var(--bg-primary) 0%, var(--bg-primary) 85%, transparent 100%);
    }

    .input-container {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-2);
        background: var(--bg-secondary);
        border: 2px solid var(--border-light);
        border-radius: var(--radius-2xl);
        box-shadow: var(--shadow-lg);
        transition: all var(--duration-fast);
    }

    .input-container:focus-within {
        border-color: var(--apollo-gold);
        box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
    }

    .input-btn {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        inline-size: var(--touch-target-comfortable);
        block-size: var(--touch-target-comfortable);
        background: var(--bg-tertiary);
        border-radius: var(--radius-xl);
        color: var(--text-secondary);
        transition: all var(--duration-fast);
    }

    .input-btn:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .mic-btn:hover {
        color: var(--apollo-purple);
    }

    .mic-btn.listening {
        background: var(--apollo-purple);
        color: white;
        animation: micPulse 1.5s infinite;
    }

    @keyframes micPulse {

        0%,
        100% {
            box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.5);
        }

        50% {
            box-shadow: 0 0 0 12px rgba(124, 58, 237, 0);
        }
    }

    .mic-btn .hidden {
        display: none;
    }

    .input-container input {
        flex: 1;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: var(--text-base);
        font-family: var(--font-primary);
        padding: var(--space-2) var(--space-1);
        outline: none;
        min-inline-size: 0;
    }

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

    .send-btn {
        background: linear-gradient(135deg, var(--apollo-gold) 0%, #FFA94D 100%) !important;
        color: var(--apollo-navy) !important;
        box-shadow: var(--shadow-glow-gold);
    }

    .send-btn:hover {
        transform: scale(1.05);
    }

    .send-btn:active {
        transform: scale(0.98);
    }

    .input-hint {
        text-align: center;
        padding-block-start: var(--space-3);
        font-size: var(--text-xs);
        color: var(--text-muted);
    }
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */
@layer utilities {
    .hidden {
        display: none !important;
    }

    .sr-only {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }
}

/* =====================================================
   PREMIUM LOADING SCREEN - Apollo.io Branded
   ===================================================== */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #1a1a1a 100%);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    z-index: 2;
}

/* Logo Container */
.loading-logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
}

/* Logo Glow Effect */
.loading-logo-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(249, 255, 45, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
    filter: blur(20px);
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Main Logo */
.loading-logo {
    position: relative;
    z-index: 3;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    overflow: hidden;
    animation: logoFloat 3s ease-in-out infinite;
    box-shadow:
        0 0 40px rgba(249, 255, 45, 0.5),
        0 0 80px rgba(249, 255, 45, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

.loading-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Spinning Rings */
.loading-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 2px solid transparent;
    border-top-color: var(--apollo-yellow, #f9ff2d);
    border-right-color: var(--apollo-yellow, #f9ff2d);
    border-radius: 50%;
    animation: ringRotate 1.5s linear infinite;
}

.loading-ring-2 {
    width: 140px;
    height: 140px;
    border-width: 1px;
    border-top-color: rgba(249, 255, 45, 0.4);
    border-right-color: transparent;
    border-bottom-color: rgba(249, 255, 45, 0.4);
    border-left-color: transparent;
    animation: ringRotateReverse 2s linear infinite;
}

@keyframes ringRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes ringRotateReverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

/* Loading Text */
.loading-text {
    text-align: center;
    animation: textFadeIn 0.8s ease-out 0.3s both;
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, var(--apollo-yellow, #f9ff2d) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-subtitle {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Progress Bar */
.loading-progress {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    animation: progressFadeIn 0.5s ease-out 0.5s both;
}

@keyframes progressFadeIn {
    from {
        opacity: 0;
        width: 0;
    }

    to {
        opacity: 1;
        width: 200px;
    }
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--apollo-yellow, #f9ff2d) 0%, #ffffff 50%, var(--apollo-yellow, #f9ff2d) 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressSlide 1.5s ease-in-out infinite;
}

@keyframes progressSlide {
    0% {
        width: 0%;
        background-position: 0% 50%;
    }

    50% {
        width: 70%;
        background-position: 100% 50%;
    }

    100% {
        width: 100%;
        background-position: 0% 50%;
    }
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 8px;
    animation: dotsFadeIn 0.5s ease-out 0.7s both;
}

@keyframes dotsFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--apollo-yellow, #f9ff2d);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Floating Particles */
.loading-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--apollo-yellow, #f9ff2d);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 4s ease-in-out infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 25%;
    animation-delay: 0.8s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(3) {
    left: 45%;
    animation-delay: 1.6s;
}

.particle:nth-child(4) {
    left: 65%;
    animation-delay: 0.4s;
    width: 8px;
    height: 8px;
}

.particle:nth-child(5) {
    left: 80%;
    animation-delay: 1.2s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(6) {
    left: 92%;
    animation-delay: 2s;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        bottom: -20px;
        transform: translateX(0) scale(0);
    }

    10% {
        opacity: 0.8;
        transform: scale(1);
    }

    90% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        bottom: 100%;
        transform: translateX(30px) scale(0.5);
    }
}

/* =====================================================
   VOICE MODE - IMMERSIVE CALL INTERFACE
   ===================================================== */

/* Voice Mode Container - Full Screen Overlay */
.voice-mode-container {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 50%, #0f0f23 100%);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-base) var(--ease-out);
}

.voice-mode-container.active {
    opacity: 1;
    visibility: visible;
}

/* Voice Mode Header */
.voice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    padding-top: calc(var(--space-4) + var(--safe-top));
    background: transparent;
}

.voice-back-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
    backdrop-filter: blur(8px);
}

.voice-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.voice-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.voice-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: #fff;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.voice-settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Scenario Selection Screen */
.scenario-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    overflow-y: auto;
}

.scenario-screen.hidden {
    display: none;
}

.scenario-intro {
    text-align: center;
    margin-bottom: var(--space-8);
}

.scenario-intro h2 {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: #fff;
    margin-bottom: var(--space-2);
}

.scenario-intro p {
    font-size: var(--text-base);
    color: rgba(255, 255, 255, 0.7);
    max-width: 400px;
    margin: 0 auto;
}

/* Scenario Cards Grid */
.scenario-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 500px) {
    .scenario-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.scenario-card {
    position: relative;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    overflow: hidden;
    text-align: left;
}

.scenario-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--apollo-yellow) 0%, #ff9500 100%);
    opacity: 0;
    transition: opacity var(--duration-base);
}

.scenario-card:hover {
    transform: translateY(-4px);
    border-color: var(--apollo-yellow);
    box-shadow: 0 8px 32px rgba(249, 255, 45, 0.2);
}

.scenario-card:hover::before {
    opacity: 0.1;
}

.scenario-card:active {
    transform: translateY(-2px) scale(0.98);
}

.scenario-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--apollo-yellow) 0%, #ffd700 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    box-shadow: 0 4px 16px rgba(249, 255, 45, 0.3);
}

.scenario-icon svg {
    width: 28px;
    height: 28px;
    color: #000;
}

.scenario-content {
    position: relative;
}

.scenario-card h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--space-2);
}

.scenario-card p {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    margin-bottom: var(--space-3);
}

.scenario-difficulty {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.scenario-difficulty.easy {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.scenario-difficulty.medium {
    background: rgba(249, 255, 45, 0.2);
    color: var(--apollo-yellow);
}

.scenario-difficulty.hard {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Active Call Screen */
.call-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    text-align: center;
}

.call-screen.hidden {
    display: none;
}

/* Caller Avatar with Audio Visualizer */
.caller-avatar-container {
    position: relative;
    margin-bottom: var(--space-6);
}

.caller-avatar {
    position: relative;
    width: 140px;
    height: 140px;
    background: linear-gradient(145deg, #2a2a4a 0%, #1a1a2e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--apollo-yellow);
    box-shadow: 0 0 40px rgba(249, 255, 45, 0.3);
    z-index: 2;
}

.caller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Audio Visualizer Rings */
.audio-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.audio-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid var(--apollo-yellow);
    opacity: 0;
    animation: audioRingPulse 2s ease-out infinite;
}

.audio-ring:nth-child(1) {
    width: 160px;
    height: 160px;
    animation-delay: 0s;
}

.audio-ring:nth-child(2) {
    width: 200px;
    height: 200px;
    animation-delay: 0.5s;
}

.audio-ring:nth-child(3) {
    width: 240px;
    height: 240px;
    animation-delay: 1s;
}

.call-screen.speaking .audio-ring {
    animation-play-state: running;
}

.call-screen:not(.speaking) .audio-ring {
    animation-play-state: paused;
    opacity: 0;
}

@keyframes audioRingPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Audio Wave Bars */
.audio-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    margin-bottom: var(--space-4);
}

.audio-bar {
    width: 4px;
    height: 8px;
    background: var(--apollo-yellow);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.call-screen.speaking .audio-bar {
    animation: audioBar 0.5s ease-in-out infinite alternate;
}

.audio-bar:nth-child(1) {
    animation-delay: 0s;
}

.audio-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.audio-bar:nth-child(3) {
    animation-delay: 0.05s;
}

.audio-bar:nth-child(4) {
    animation-delay: 0.15s;
}

.audio-bar:nth-child(5) {
    animation-delay: 0.08s;
}

.audio-bar:nth-child(6) {
    animation-delay: 0.12s;
}

.audio-bar:nth-child(7) {
    animation-delay: 0.02s;
}

@keyframes audioBar {
    0% {
        height: 8px;
        opacity: 0.5;
    }

    100% {
        height: 36px;
        opacity: 1;
    }
}

/* Call Info */
.call-info {
    margin-bottom: var(--space-6);
}

.caller-name {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: #fff;
    margin-bottom: var(--space-2);
}

.call-scenario-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(249, 255, 45, 0.15);
    border: 1px solid rgba(249, 255, 45, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--apollo-yellow);
    margin-bottom: var(--space-3);
}

.call-status {
    font-size: var(--text-base);
    color: rgba(255, 255, 255, 0.6);
}

.call-status.connected {
    color: #10b981;
}

.call-duration {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    margin-top: var(--space-2);
}

/* Transcript Display */
.call-transcript {
    width: 100%;
    max-width: 500px;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.transcript-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.transcript-text {
    font-size: var(--text-base);
    color: #fff;
    line-height: 1.6;
    min-height: 40px;
}

.transcript-text.empty {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Call Controls */
.call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    padding-bottom: calc(var(--space-8) + var(--safe-bottom));
}

.call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.call-btn:active {
    transform: scale(0.95);
}

.call-btn svg {
    width: 28px;
    height: 28px;
}

/* Mic Button */
.call-mic-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.call-mic-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.call-mic-btn.active {
    background: var(--apollo-yellow);
    color: #000;
    border-color: var(--apollo-yellow);
    box-shadow: 0 0 30px rgba(249, 255, 45, 0.5);
    animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(249, 255, 45, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(249, 255, 45, 0.6);
    }
}

/* End Call Button */
.call-end-btn {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.call-end-btn:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 6px 30px rgba(239, 68, 68, 0.5);
}

/* Speaker Button */
.call-speaker-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.call-speaker-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.call-speaker-btn.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: #10b981;
}

/* Connecting Animation */
.connecting-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-base);
}

.connecting-overlay.active {
    opacity: 1;
    visibility: visible;
}

.connecting-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(249, 255, 45, 0.2);
    border-top-color: var(--apollo-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-4);
}

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

.connecting-text {
    font-size: var(--text-lg);
    font-weight: 600;
    color: #fff;
}

/* Voice Tip Card */
.voice-tips {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 600px;
    margin: var(--space-8) auto 0;
    width: 100%;
}

.voice-tip {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
}

.voice-tip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(249, 255, 45, 0.15);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.voice-tip-icon svg {
    width: 18px;
    height: 18px;
    color: var(--apollo-yellow);
}

.voice-tip-content h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.voice-tip-content p {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Quick Start Button */
.quick-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    max-width: 400px;
    margin: var(--space-6) auto;
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, var(--apollo-yellow) 0%, #ffd700 100%);
    border: none;
    border-radius: var(--radius-xl);
    font-size: var(--text-lg);
    font-weight: 700;
    color: #000;
    cursor: pointer;
    transition: all var(--duration-base);
    box-shadow: 0 4px 20px rgba(249, 255, 45, 0.4);
}

.quick-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(249, 255, 45, 0.5);
}

.quick-start-btn:active {
    transform: translateY(0);
}

.quick-start-btn svg {
    width: 24px;
    height: 24px;
}

/* Audio Unlock Prompt */
.audio-unlock-prompt {
    position: fixed;
    bottom: calc(var(--space-6) + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(249, 255, 45, 0.3);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    z-index: 600;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-base);
}

.audio-unlock-prompt.visible {
    opacity: 1;
    visibility: visible;
    animation: slideUp 0.3s var(--ease-out);
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.audio-unlock-prompt span {
    font-size: var(--text-sm);
    color: #fff;
}

.audio-unlock-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--apollo-yellow);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    color: #000;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.audio-unlock-btn:hover {
    background: var(--apollo-yellow-hover);
}

/* =====================================================
   VOICE MODE - MOBILE RESPONSIVENESS (iOS/Android)
   ===================================================== */

/* Small Screens (iPhone SE, small Android) */
@media (max-width: 375px) {
    .scenario-grid {
        gap: var(--space-3);
    }

    .scenario-card {
        padding: var(--space-4);
    }

    .scenario-icon {
        width: 48px;
        height: 48px;
        margin-bottom: var(--space-3);
    }

    .scenario-icon svg {
        width: 24px;
        height: 24px;
    }

    .scenario-card h3 {
        font-size: var(--text-base);
    }

    .scenario-card p {
        font-size: var(--text-xs);
        margin-bottom: var(--space-2);
    }

    .caller-avatar {
        width: 100px;
        height: 100px;
    }

    .audio-ring:nth-child(1) {
        width: 120px;
        height: 120px;
    }

    .audio-ring:nth-child(2) {
        width: 150px;
        height: 150px;
    }

    .audio-ring:nth-child(3) {
        width: 180px;
        height: 180px;
    }

    .caller-name {
        font-size: var(--text-xl);
    }

    .call-duration {
        font-size: var(--text-2xl);
    }

    .call-transcript {
        padding: var(--space-3);
    }

    .call-btn {
        width: 56px;
        height: 56px;
    }

    .call-end-btn {
        width: 64px;
        height: 64px;
    }

    .call-controls {
        gap: var(--space-4);
    }
}

/* Medium Mobile (iPhone, Standard Android) */
@media (max-width: 480px) {
    .voice-header {
        padding-inline: var(--space-3);
    }

    .voice-title {
        font-size: var(--text-base);
    }

    .scenario-intro h2 {
        font-size: var(--text-xl);
    }

    .scenario-intro p {
        font-size: var(--text-sm);
    }

    .voice-tips {
        gap: var(--space-3);
    }

    .voice-tip {
        padding: var(--space-3);
    }

    .call-transcript {
        margin-inline: var(--space-2);
    }
}

/* Landscape Mode on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .scenario-screen {
        padding-top: var(--space-2);
    }

    .scenario-intro {
        margin-bottom: var(--space-4);
    }

    .scenario-intro h2 {
        font-size: var(--text-lg);
        margin-bottom: var(--space-1);
    }

    .scenario-intro p {
        display: none;
    }

    .scenario-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .scenario-card {
        padding: var(--space-3);
    }

    .scenario-icon {
        width: 40px;
        height: 40px;
        margin-bottom: var(--space-2);
    }

    .scenario-card h3 {
        font-size: var(--text-sm);
        margin-bottom: var(--space-1);
    }

    .scenario-card p {
        display: none;
    }

    .voice-tips {
        display: none;
    }

    /* Call screen in landscape */
    .call-screen {
        flex-direction: row;
        padding: var(--space-4);
        gap: var(--space-6);
    }

    .caller-avatar-container {
        margin-bottom: 0;
    }

    .caller-avatar {
        width: 100px;
        height: 100px;
    }

    .audio-rings {
        display: none;
    }

    .audio-bars {
        display: none;
    }

    .call-info {
        flex: 1;
        text-align: left;
        margin-bottom: 0;
    }

    .call-transcript {
        display: none;
    }

    .call-controls {
        flex-direction: column;
        gap: var(--space-3);
        padding-bottom: 0;
    }

    .call-btn {
        width: 52px;
        height: 52px;
    }

    .call-end-btn {
        width: 60px;
        height: 60px;
    }
}

/* iOS Safe Area Adjustments */
@supports (padding: max(0px)) {
    .voice-header {
        padding-top: max(var(--space-4), env(safe-area-inset-top));
    }

    .call-controls {
        padding-bottom: max(var(--space-8), calc(var(--space-4) + env(safe-area-inset-bottom)));
    }

    .scenario-screen {
        padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
    }

    .audio-unlock-prompt {
        bottom: max(var(--space-6), calc(var(--space-4) + env(safe-area-inset-bottom)));
    }
}

/* Touch Target Optimization */
@media (pointer: coarse) {
    .scenario-card {
        min-height: 120px;
    }

    .call-btn {
        min-width: 56px;
        min-height: 56px;
    }

    .call-end-btn {
        min-width: 64px;
        min-height: 64px;
    }

    .voice-back-btn {
        min-height: var(--touch-target-min);
        padding: var(--space-2) var(--space-4);
    }

    .voice-settings-btn {
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
    }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .scenario-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
    }

    .scenario-card {
        padding: var(--space-6);
    }

    .call-screen {
        padding: var(--space-8);
    }

    .caller-avatar {
        width: 160px;
        height: 160px;
    }

    .audio-ring:nth-child(1) {
        width: 180px;
        height: 180px;
    }

    .audio-ring:nth-child(2) {
        width: 220px;
        height: 220px;
    }

    .audio-ring:nth-child(3) {
        width: 260px;
        height: 260px;
    }

    .call-transcript {
        max-width: 600px;
    }

    .call-btn {
        width: 72px;
        height: 72px;
    }

    .call-btn svg {
        width: 32px;
        height: 32px;
    }

    .call-end-btn {
        width: 80px;
        height: 80px;
    }
}

/* Prevent text selection during calls (better touch UX) */
.call-screen {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Smooth scroll behavior for scenario list */
.scenario-screen {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* =====================================================
   BROWSER-SPECIFIC FIXES
   ===================================================== */

/* Firefox scrollbar */
@supports (scrollbar-width: thin) {

    .chat-messages,
    .voice-options {
        scrollbar-width: thin;
        scrollbar-color: var(--border-medium) transparent;
    }
}

/* Safari input zoom prevention */
@supports (-webkit-touch-callout: none) {
    .input-container input {
        font-size: 16px;
        /* Prevents zoom on focus in iOS Safari */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-light: var(--text-tertiary);
        --border-medium: var(--text-secondary);
    }
}

/* Print styles */
@media print {

    .agent-header,
    .input-area,
    .quick-actions,
    .play-btn {
        display: none;
    }

    .chat-messages {
        overflow: visible;
    }
}

/* =====================================================
   ROLE TOGGLE & ROLE INDICATOR
   ===================================================== */

.role-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
}

.role-toggle-container .role-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.role-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(249, 255, 45, 0.3);
    border-radius: var(--radius-full);
    padding: 4px;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    overflow: visible;
    flex-shrink: 0;
}

.role-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(249, 255, 45, 0.5);
}

.role-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-full);
    transition: all var(--duration-fast);
    position: relative;
    z-index: 1;
    white-space: nowrap;
    min-width: max-content;
}

.role-option svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.role-option.specialist {
    color: #fff;
}

.role-toggle-btn.customer-mode .role-option.specialist {
    color: rgba(255, 255, 255, 0.5);
}

.role-toggle-btn.customer-mode .role-option.customer {
    color: #fff;
}

.role-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(249, 255, 45, 0.15);
    border: 1.5px solid var(--apollo-yellow);
    border-radius: var(--radius-full);
    transition: transform var(--duration-base) var(--ease-out);
    box-shadow: 0 0 10px rgba(249, 255, 45, 0.2);
}

.role-toggle-btn.customer-mode .role-slider {
    transform: translateX(100%);
}

/* Mobile responsive for role toggle */
@media (max-width: 480px) {
    .role-toggle-btn {
        flex-wrap: nowrap;
    }

    .role-option {
        padding: 6px 12px;
        font-size: 12px;
        gap: 4px;
    }

    .role-option svg {
        width: 12px;
        height: 12px;
    }
}

.role-hint {
    font-size: var(--text-xs) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic;
    margin-top: var(--space-2) !important;
    text-align: center;
}

/* Role Indicator on Call Screen */
.role-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: #10b981;
    margin-bottom: var(--space-2);
}

.role-indicator.customer-role {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3B82F6;
}

/* =====================================================
   SCORECARD MODAL
   ===================================================== */

.scorecard-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-base);
}

.scorecard-modal.visible {
    opacity: 1;
    visibility: visible;
}

.scorecard-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.scorecard-content {
    position: relative;
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    background: linear-gradient(180deg, #1a2332 0%, #0F1419 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--duration-base) var(--ease-out);
}

.scorecard-modal.visible .scorecard-content {
    transform: scale(1) translateY(0);
}

.scorecard-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.scorecard-header h2 {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: #fff;
    margin-bottom: var(--space-2);
}

.scorecard-scenario {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    text-transform: capitalize;
}

/* Score Ring */
.scorecard-score-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-6);
}

.scorecard-score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
}

.score-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.score-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

/* Stats Row */
.scorecard-stats {
    margin-bottom: var(--space-6);
}

.stat-row {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: 700;
    color: #fff;
}

.stat-item .stat-label {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Metrics */
.scorecard-metrics {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.metric-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.metric-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.metric-value {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--apollo-yellow);
}

.metric-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--apollo-yellow) 0%, #10b981 100%);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.metric-detail {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.5);
}

/* Tips Section */
.scorecard-tips {
    background: rgba(249, 255, 45, 0.05);
    border: 1px solid rgba(249, 255, 45, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.scorecard-tips h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--apollo-yellow);
    margin-bottom: var(--space-3);
}

.scorecard-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scorecard-tips li {
    position: relative;
    padding-left: var(--space-4);
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.scorecard-tips li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--apollo-yellow);
}

.scorecard-tips li+li {
    margin-top: var(--space-2);
}

/* Actions */
.scorecard-actions {
    display: flex;
    gap: var(--space-3);
}

.scorecard-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.scorecard-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.scorecard-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.scorecard-btn.primary {
    background: linear-gradient(135deg, var(--apollo-yellow) 0%, #ffd700 100%);
    color: #000;
}

.scorecard-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(249, 255, 45, 0.4);
}

.scorecard-btn:active {
    transform: scale(0.98);
}

/* Responsive Scorecard */
@media (max-width: 480px) {
    .scorecard-content {
        padding: var(--space-4);
        margin: var(--space-4);
        max-height: calc(100vh - var(--space-8));
    }

    .scorecard-header h2 {
        font-size: var(--text-xl);
    }

    .stat-row {
        gap: var(--space-4);
    }

    .stat-item .stat-value {
        font-size: var(--text-lg);
    }

    .scorecard-actions {
        flex-direction: column;
    }

    .scorecard-btn {
        width: 100%;
    }
}