        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        :root {
            --oxygen-light: #E3F2FD;
            --oxygen-pale: #BBDEFB;
            --oxygen-medium: #90CAF9;
            --oxygen-vivid: #64B5F6;
            --oxygen-deep: #42A5F5;
            --oxygen-intense: #2196F3;
            --oxygen-dark: #1E88E5;
            --oxygen-darker: #1976D2;
            --oxygen-deepest: #1565C0;

            --accent-red-light: #FFCDD2;
            --accent-red: #EF5350;
            --accent-red-dark: #E53935;

            --bg-primary: #FFFFFF;
            --bg-secondary: #F5F9FF;
            --bg-card: rgba(255, 255, 255, 0.9);

            --text-primary: #263238;
            --text-secondary: #546E7A;
            --text-light: #78909C;

            --border-color: rgba(33, 150, 243, 0.3);
            --border-light: rgba(33, 150, 243, 0.15);

            --glass-blur: 12px;
            --shadow-color: rgba(33, 150, 243, 0.15);

            --waveform-color: #90CAF9;
            --waveform-cursor: #2196F3;
                /* Small extra spacing applied to header offset; editable in CSS for designers
                    Set to a negative value to move anchors slightly closer to the header. */
     --anchor-extra-spacing: -75px;
     /* Approximate fixed header height used for scroll-padding and section sizing.
         Adjust if header changes. Applied only on larger viewports. */
     --header-height: 72px;
    /* Placeholder visual tweak (opacity) for consistent UI across forms */
    --placeholder-opacity: 0.8;
    /* Agent-specific placeholder font size so designers can tune without editing rules */
    --placeholder-agent-size: 0.825rem;
        }

        [data-theme="dark"] {
            --bg-primary: #0A1929;
            --bg-secondary: #001E3C;
            --bg-card: rgba(20, 40, 65, 0.9);

            --text-primary: #FFFFFF;
            --text-secondary: #B2BAC2;
            --text-light: #8A919A;

            --border-color: rgba(100, 181, 246, 0.4);
            --disabled-text: rgba(255, 255, 255, 0.7);
            --disabled-bg: rgba(255, 255, 255, 0.15);
            --disabled-border: rgba(255, 255, 255, 0.4);
            --disabled-glow: rgba(255, 255, 255, 0.1);
            --border-light: rgba(100, 181, 246, 0.2);

            --shadow-color: rgba(0, 0, 0, 0.5);

            --waveform-color: #64B5F6;
            --waveform-cursor: #90CAF9;
        }

        /* Make the fixed header slightly lighter than the page background in dark mode
           to improve contrast and legibility. This overrides the Tailwind dark:bg value. */
        [data-theme="dark"] header {
            background-color: rgba(20, 40, 65, 0.88) !important;
            /* keep the subtle backdrop blur and transition behavior */
            backdrop-filter: blur(var(--glass-blur));
            transition: background-color 0.25s ease;
        }

        /* Make the footer slightly lighter than the page background in dark mode
           to improve contrast and legibility and match the header treatment. */
        [data-theme="dark"] footer {
            background-color: rgba(20, 40, 65, 0.84) !important;
            backdrop-filter: blur(var(--glass-blur));
            transition: background-color 0.25s ease;
            border-top: 1px solid rgba(100, 181, 246, 0.06);
        }

        /* Reusable Voxygen logo styling - ensures consistency across header and modals */
        .voxygen-logo {
            font-size: 1.875rem; /* 3xl */
            font-weight: 500; /* medium for thinner appearance */
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(to right, var(--oxygen-deep), var(--accent-red));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        [data-theme="dark"] .voxygen-logo {
            background: linear-gradient(to right, var(--oxygen-vivid), var(--accent-red));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
            color: var(--text-primary);
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            font-weight: 300;
            line-height: 1.6;
            overflow-x: hidden;
            position: relative;
            transition: background 0.3s ease, color 0.3s ease;
            min-height: 100vh;
        }

        /* On larger viewports, snap each top-level <section> to the viewport so
           only one section is visible at a time. This helps UHD/4K screens where
           multiple sections may otherwise be partially visible. */
        @media (min-width: 1200px) {
            html, body { height: 100%; }
            body {
                scroll-snap-type: y mandatory;
                scroll-behavior: smooth;
                scroll-padding-top: var(--header-height);
            }

            /* Make each section fill the viewport minus the fixed header height */
            section {
                scroll-snap-align: start;
                min-height: calc(100vh - var(--header-height));
                display: flex;
                flex-direction: column;
                justify-content: flex-start;
                box-sizing: border-box;
            }
        }
        
                /* Light Theme Gradient Background with Waveform */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 25%, #90CAF9 50%, #BBDEFB 75%, #E3F2FD 100%);
            z-index: -2;
            transition: opacity 0.3s ease;
        }

        /* Waveform Pattern */
        body::after {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: 
                repeating-linear-gradient(
                    90deg,
                    transparent,
                    transparent 50px,
                    rgba(33, 150, 243, 0.03) 50px,
                    rgba(33, 150, 243, 0.03) 51px
                ),
                repeating-linear-gradient(
                    0deg,
                    transparent,
                    transparent 50px,
                    rgba(33, 150, 243, 0.03) 50px,
                    rgba(33, 150, 243, 0.03) 51px
                );
            z-index: -1;
            opacity: 1;
            transition: opacity 0.3s ease;
        }

        /* Waveform SVG Pattern */
        .waveform-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
            pointer-events: none;
            overflow: hidden;
            opacity: 1;
            transition: opacity 0.3s ease;
        }

        .waveform-layer {
            position: absolute;
            width: 200%;
            height: 100%;
            left: -50%;
        }

        .wave-path {
            stroke: rgba(33, 150, 243, 0.08);
            stroke-width: 2;
            fill: none;
            stroke-linecap: round;
        }

        .wave-path-2 {
                    stroke: rgba(66, 165, 245, 0.06);
                    stroke-width: 3;
                    fill: none;
                }

        /* Dark theme adjustments */
        [data-theme="dark"] body::before {
            background: linear-gradient(180deg, #0A1929 0%, #001E3C 100%);
        }

        [data-theme="dark"] body::after {
            opacity: 0;
        }

        [data-theme="dark"] .waveform-container {
            opacity: 0;
        }

        /* Parallax effect on scroll */
        .parallax-section {
            position: relative;
            z-index: 10;
        }

/* Ensure waveform placeholder is perfectly centered in its container */
#waveformContainer { position: relative; }
#waveformPlaceholder {
    position: absolute;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0 1rem; /* keep a bit of horizontal breathing room */
    z-index: 5;
}

/* Helper to force-hide the placeholder when visualization is shown */
#waveformPlaceholder.hidden { display: none !important; }

        .bubble-container {
            position: fixed;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: 1;
            pointer-events: none;
        }

        .bubble {
            position: absolute;
            border-radius: 50%;
            background: radial-gradient(circle at 30% 30%, 
                rgba(33, 150, 243, 0.3), 
                rgba(239, 83, 80, 0.1));
            backdrop-filter: blur(2px);
            animation: float-up 20s infinite;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        [data-theme="dark"] .bubble {
            background: radial-gradient(circle at 30% 30%, 
                rgba(100, 181, 246, 0.2), 
                rgba(239, 83, 80, 0.05));
        }

        @keyframes float-up {
            0% {
                transform: translateY(100vh) translateX(0) scale(0);
                opacity: 0;
            }
            10% {
                opacity: 0.4;
                transform: translateY(90vh) translateX(10px) scale(1);
            }
            50% {
                opacity: 0.6;
                transform: translateY(50vh) translateX(-20px) scale(1.1);
            }
            90% {
                opacity: 0.3;
                transform: translateY(10vh) translateX(10px) scale(0.9);
            }
            100% {
                transform: translateY(-10vh) translateX(0) scale(0.5);
                opacity: 0;
            }
        }

        .bubble:nth-child(1) { width: 80px; height: 80px; left: 10%; animation-duration: 25s; }
        .bubble:nth-child(2) { width: 120px; height: 120px; left: 25%; animation-duration: 30s; animation-delay: 2s; }
        .bubble:nth-child(3) { width: 60px; height: 60px; left: 40%; animation-duration: 22s; animation-delay: 4s; }
        .bubble:nth-child(4) { width: 100px; height: 100px; left: 60%; animation-duration: 28s; animation-delay: 1s; }
        .bubble:nth-child(5) { width: 70px; height: 70px; left: 75%; animation-duration: 24s; animation-delay: 3s; }
        .bubble:nth-child(6) { width: 90px; height: 90px; left: 85%; animation-duration: 26s; animation-delay: 5s; }

        .glass-card {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border: 2px solid var(--border-color);
            border-radius: 20px;
            padding: 2rem;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            box-shadow: 0 8px 32px var(--shadow-color);
        }

        .glass-card:hover {
            transform: translateY(-5px);
            border-color: var(--oxygen-vivid);
            box-shadow: 0 12px 40px var(--shadow-color);
        }

        .btn-primary {
            display: inline-block;
            padding: 0.75rem 2rem;
            background: linear-gradient(135deg, var(--oxygen-deep) 0%, var(--accent-red) 100%);
            border: none;
            border-radius: 999px;
            color: white;
            font-weight: 500;
            font-size: 0.925rem;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
            background-origin: border-box;
            vertical-align: middle;
            line-height: 1.5;
            text-align: center;
        }

        .btn-primary::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transform: rotate(45deg);
            animation: shimmer 3s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
            100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
        }

        .btn-secondary {
            display: inline-block;
            padding: 0.75rem 2rem;
            background: var(--bg-card);
            border: none;
            border-radius: 999px;
            color: var(--text-primary);
            font-weight: 500;
            font-size: 0.925rem;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            box-shadow: inset 0 0 0 1.5px var(--border-color);
            background-origin: border-box;
            vertical-align: middle;
            line-height: 1.5;
            text-align: center;
        }

        .btn-secondary::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(33, 150, 243, 0.1), transparent);
            transform: rotate(45deg);
            animation: shimmer 3s infinite;
        }

        .btn-secondary:hover {
            background: linear-gradient(135deg, rgba(33, 150, 243, 0.08), rgba(239, 83, 80, 0.08));
            box-shadow: inset 0 0 0 1.5px var(--oxygen-vivid);
            transform: translateY(-2px);
        }

        /* Disabled button states */
        .btn-primary:disabled,
        .btn-primary.disabled {
            cursor: not-allowed;
            opacity: 0.6;
            transform: none !important;
            box-shadow: 0 0 0 rgba(0,0,0,0);
            background: linear-gradient(135deg, rgba(33,150,243,0.35) 0%, rgba(239,83,80,0.35) 100%);
            color: rgba(255,255,255,0.9);
            pointer-events: none; /* prevent hover effects */
        }

        .btn-primary:disabled::before,
        .btn-primary.disabled::before {
            animation: none;
            opacity: 0;
        }

        .btn-secondary:disabled,
        .btn-secondary.disabled {
            cursor: not-allowed;
            opacity: 0.8;
            transform: none !important;
            box-shadow: inset 0 0 0 1.5px var(--border-color);
        }

        [data-theme="dark"] .btn-secondary:disabled,
        [data-theme="dark"] .btn-secondary.disabled {
            color: var(--disabled-text);
            background: var(--disabled-bg);
            box-shadow: inset 0 0 0 1.5px var(--disabled-border), 0 0 10px var(--disabled-glow);
        }

        [data-theme="dark"] .btn-secondary:disabled::before,
        [data-theme="dark"] .btn-secondary.disabled::before {
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            animation: none;
        }

        [data-theme="dark"] .btn-primary:disabled,
        [data-theme="dark"] .btn-primary.disabled {
            color: var(--disabled-text);
            background: rgba(76, 156, 246, 0.4);
            opacity: 0.8;
            transform: none !important;
            box-shadow: 0 0 10px rgba(76, 156, 246, 0.2);
        }

        .theme-toggle {
            padding: 0.5rem;
            background: var(--bg-card);
            border: 2px solid var(--border-color);
            border-radius: 50%;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.3s;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            align-self: flex-end; /* Align bottom edge with avatar */
        }

        .theme-toggle:hover {
            transform: rotate(180deg);
            border-color: var(--oxygen-vivid);
        }

        .header-actions {
            display: flex;
            align-items: flex-end;
            gap: 1rem;
        }

        .logo {
            font-size: 2.5rem;
            font-weight: 400;
            font-family:"Poppins",sans-serif;
            background: linear-gradient(135deg, var(--oxygen-deepest) 0%, var(--oxygen-vivid) 25%, var(--accent-red-dark) 100%);
            -webkit-background-clip: text;
               -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: -0.02em;
            text-decoration: none;
            display: inline-flex;
        }

        .nav-toggle {
            display: none;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            border: 2px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-primary);
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-toggle:hover {
            border-color: var(--oxygen-vivid);
            transform: rotate(90deg);
        }

        .nav-toggle i {
            font-size: 1.1rem;
            pointer-events: none;
        }

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

        header nav.open {
            display: flex !important;
        }

        /* Mobile navigation appearance: make the opened panel more solid and readable
           Reduce transparency and add subtle border/shadow for contrast on small screens. */
        @media (max-width: 767px) {
            header nav {
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                display: none; /* toggled via .open */
                flex-direction: column;
                gap: 0.5rem;
                padding: 0.75rem 1rem;
                backdrop-filter: blur(var(--glass-blur));
                background-color: rgba(255, 255, 255, 0.99);
                border-top: 1px solid rgba(33, 150, 243, 0.06);
                box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
                z-index: 1200;
            }

            /* Dark theme adjustment */
            [data-theme="dark"] header nav {
                background-color: rgba(20, 40, 65, 0.99) !important;
                border-top: 1px solid rgba(100, 181, 246, 0.06);
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
            }

            /* Ensure the open state displays the panel */
            header nav.open {
                display: flex !important;
            }
        }

        /* Ensure mobile hamburger icon and nav buttons follow theme colors
           Use theme-aware CSS variables so dark/light themes are respected. */
        @media (max-width: 767px) {
            /* Hamburger icon color and background - default light mode */
            header #navToggle {
                color: #263238 !important;
                background-color: transparent !important;
            }

            header #navToggle i {
                color: #263238 !important;
            }

            /* Mobile nav links and buttons should use theme-aware text color */
            header nav a,
            header nav button:not(#mobileThemeToggle):not(#mobileAuthBtn):not(.btn-primary),
            header nav .btn-secondary,
            header nav .btn-link {
                color: var(--text-primary) !important;
                background-color: transparent !important;
                border-color: rgba(0,0,0,0.04) !important;
            }

            /* Make the mobile theme toggle and sign-in button visually coherent */
            header nav .btn-primary {
                /* Keep button styling but ensure text color matches theme */
                color: var(--text-primary) !important;
            }

            /* Mobile action buttons - no border, background matches modal dialog, consistent font */
            header nav #mobileThemeToggle,
            header nav #mobileAuthContainer button {
                border: none !important;
                background-color: transparent !important;
                font-size: 0.875rem !important;
                font-weight: 500 !important;
                color: var(--text-primary) !important;
            }

            [data-theme="dark"] header nav #mobileThemeToggle,
            [data-theme="dark"] header nav #mobileAuthContainer button {
                border: none !important;
                background-color: rgba(20, 40, 65, 0.99) !important;
                color: #B2BAC2 !important;
            }

            /* Ensure text inside buttons has consistent styling */
            header nav #mobileThemeToggle span,
            header nav #mobileAuthContainer button span {
                font-size: 0.875rem !important;
                font-weight: 500 !important;
            }

            /* Mobile separator line - elegant fade effect like footer */
            header nav > div.md\:hidden {
                border-top: none !important;
                margin-top: 1rem !important;
                padding-top: 1rem !important;
                width: 100% !important;
                position: relative;
            }

            /* Create elegant gradient separator line with fade effect */
            header nav > div.md\:hidden::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 2px;
                background: linear-gradient(to right, transparent, #cbd5e0, transparent);
            }

            [data-theme="dark"] header nav > div.md\:hidden::before {
                background: linear-gradient(to right, transparent, rgba(100, 181, 246, 0.4), transparent);
            }

            /* Dark theme overrides - hamburger icon should be white text on transparent background */
            [data-theme="dark"] header #navToggle {
                color: #FFFFFF !important;
                background-color: transparent !important;
            }

            [data-theme="dark"] header #navToggle i {
                color: #FFFFFF !important;
            }

            [data-theme="dark"] header nav a,
            [data-theme="dark"] header nav button:not(#mobileThemeToggle):not(#mobileAuthBtn):not(.btn-primary),
            [data-theme="dark"] header nav .btn-secondary,
            [data-theme="dark"] header nav .btn-link {
                color: var(--text-primary) !important;
            }
        }

        /* Extra specificity for FontAwesome icons used in the hamburger button
           to ensure they match the theme color even if FontAwesome sets styles. */
        @media (max-width: 767px) {
            header #navToggle i.fas,
            header #navToggle i.fa-bars,
            header #navToggle i.fa-times,
            header #navToggle i.fa-xmark,
            header #navToggle .fa {
                color: #263238 !important;
                fill: currentColor !important;
            }

            [data-theme="dark"] header #navToggle i.fas,
            [data-theme="dark"] header #navToggle i.fa-bars,
            [data-theme="dark"] header #navToggle i.fa-times,
            [data-theme="dark"] header #navToggle i.fa-xmark,
            [data-theme="dark"] header #navToggle .fa {
                color: #FFFFFF !important;
                fill: currentColor !important;
            }
        }

        /* Ensure FontAwesome pseudo-elements inherit the color (some builds use ::before glyphs) */
        @media (max-width: 767px) {
            header #navToggle i::before,
            header #navToggle i::after,
            header #navToggle .fa::before,
            header #navToggle .fa::after,
            header #navToggle i.fas::before,
            header #navToggle i.fas::after {
                color: #263238 !important;
                -webkit-text-fill-color: #263238 !important;
                fill: currentColor !important;
                opacity: 1 !important;
            }

            [data-theme="dark"] header #navToggle i::before,
            [data-theme="dark"] header #navToggle i::after,
            [data-theme="dark"] header #navToggle .fa::before,
            [data-theme="dark"] header #navToggle .fa::after,
            [data-theme="dark"] header #navToggle i.fas::before,
            [data-theme="dark"] header #navToggle i.fas::after {
                color: #FFFFFF !important;
                -webkit-text-fill-color: #FFFFFF !important;
                fill: currentColor !important;
                opacity: 1 !important;
            }

            /* Navigation links active state - visual feedback on click */
            /* Only target links inside the nav element, not the logo link */
            header nav#primaryNav a:active,
            header nav#primaryNav a.active {
                color: var(--oxygen-deep) !important;
                background: rgba(33, 150, 243, 0.08);
                border-radius: 0.5rem;
            }

            [data-theme="dark"] header nav#primaryNav a:active,
            [data-theme="dark"] header nav#primaryNav a.active {
                color: var(--oxygen-vivid) !important;
                background: rgba(33, 150, 243, 0.12);
            }
        }

        header {
            /* Position and z-index now controlled by Tailwind classes in HTML */
            /* Keeping transition for smooth effects */
            transition: all 0.3s ease;
        }

        /* Fixed width for auth container to prevent layout shift on sign-in/sign-out */
        #authContainer {
            min-width: 95px;
            display: inline-flex;
            justify-content: center;
            align-items: center;
        }

        /* Fixed width for Try Free button to prevent layout shift */
        #tryFreeBtn {
            min-width: 100px;
        }

        /* Ensure anchored sections are scrolled into view below the fixed
           header so their titles aren't occluded. Use a slightly larger
           offset specifically for the Features section to keep its title
           comfortably visible. */
        section {
            scroll-margin-top: calc(var(--header-height, 72px) + 12px);
        }

        /* Larger offset for the #features anchor to provide extra spacing */
        #features {
            scroll-margin-top: calc(var(--header-height, 72px) + 36px);
        }
        
        /* Apply similar larger offsets to other main anchors so their
           headings are visible below the fixed header when navigated to. */
        #demo,
        #voices,
        #pricing,
        #api {
            scroll-margin-top: calc(var(--header-height, 72px) + 36px);
        }

        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        nav {
            display: none;
            gap: 2.5rem;
            align-items: center;
        }

        @media (min-width: 768px) {
            nav { display: flex; }
            .nav-toggle { display: none; }
            .header-actions { flex-wrap: nowrap; justify-content: flex-end; }
        }

        @media (max-width: 1024px) {
            section {
                padding: 2.5rem 1.75rem;
            }

            #demo {
                padding-top: 0.9rem;
            }

            #voices {
                padding-top: 0.9rem;
            }

            #pricing {
                padding-top: 0.5rem;
            }

            .hero {
                padding: 5.5rem 1.75rem 2.5rem;
            }

            .header-actions {
                gap: 0.75rem;
            }
        }

        @media (max-width: 767px) {
            header {
                padding: 0.75rem 1.25rem;
            }

            .header-content {
                position: relative;
                align-items: center;
                gap: 0.75rem;
                flex-wrap: wrap;
            }

            .nav-toggle {
                display: flex;
            }

            nav {
                position: absolute;
                top: calc(100% + 0.75rem);
                right: 0;
                width: min(280px, calc(100vw - 2.5rem));
                flex-direction: column;
                align-items: flex-start;
                gap: 0.25rem;
                background: var(--bg-card);
                border: 2px solid var(--border-light);
                border-radius: 16px;
                padding: 0.75rem;
                box-shadow: 0 18px 40px var(--shadow-color);
                z-index: 1001;
            }

            nav a {
                width: 100%;
                padding: 0.4rem 0;
            }

            nav a::after {
                display: none;
            }

            .logo {
                font-size: 2.2rem;
            }

            .header-actions {
                order: 3;
                width: 100%;
                justify-content: flex-end;
                flex-wrap: wrap;
                gap: 0.5rem;
            }

            .header-actions .btn-primary,
            .header-actions .btn-link {
                flex: 1 1 auto;
                min-width: 140px;
                text-align: center;
            }

            section {
                padding: 2rem 1.25rem;
            }

            #demo {
                padding-top: 1.25rem;
            }

            #voices {
                padding-top: 1.25rem;
            }

            #pricing {
                padding-top: 0.5rem;
            }

            .hero {
                padding: 5rem 1.25rem 2rem;
            }

            .feature-card,
            .pricing-card,
            .demo-section {
                padding: 1.75rem;
            }

            .pad {
                padding: 1.5rem;
            }

            .demo-row {
                flex-direction: column;
                align-items: stretch;
            }

            .code-wrapper {
                padding-bottom: 0.5rem;
            }

            .line-numbers {
                display: none;
            }

            .code-content {
                font-size: 0.9rem;
                padding: 1.25rem;
            }
        }

        @media (max-width: 540px) {
            .logo {
                font-size: 2rem;
            }

            .hero {
                padding: 4.5rem 1rem 2rem;
            }

            section {
                padding: 3.5rem 1rem;
            }

            .language-selector {
                grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
            }

            .header-actions .btn-primary,
            .header-actions .btn-link {
                min-width: 120px;
            }
        }

        nav a {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.925rem;
            font-weight: 400;
            transition: color 0.3s;
            position: relative;
        }

        nav a::after {
            content: '';
            position: absolute;
            bottom: -4px;
            left: 0;
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, var(--oxygen-vivid), var(--accent-red));
            transition: width 0.3s ease;
        }

        nav a:hover {
            color: var(--oxygen-deep);
        }

        nav a:hover::after {
            width: 100%;
        }

        .hero {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 6rem 2rem 3rem;
            position: relative;
            z-index: 10;
        }

        h1 {
            font-family: 'Poppins', sans-serif;
            font-size: clamp(2.5rem, 7vw, 4rem);
            font-weight: 200;
            line-height: 1.2;
            margin-bottom: 1.5rem;
            letter-spacing: -0.03em;
        }

        .gradient-text {
            background: linear-gradient(135deg, var(--oxygen-intense), var(--accent-red));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-weight: 400;
        }

        .feature-card {
            background: var(--bg-card);
            backdrop-filter: blur(10px);
            border: 2px solid var(--border-color);
            border-radius: 16px;
            padding: 2rem;
            transition: all 0.3s ease;
            cursor: pointer;
            box-shadow: 0 4px 20px var(--shadow-color);
        }

        .feature-card:hover {
            transform: translateY(-8px) scale(1.02);
            border-color: var(--oxygen-vivid);
            box-shadow: 0 8px 30px var(--shadow-color);
        }

        .demo-section {
            background: var(--bg-card);
            border: 1px solid var(--border-light);
            border-radius: 16px;
            /* base padding — specific modes may override */
            padding: 1.5rem;
            /* Reduced vertical gap between mode-toggle and demo card */
            margin: 0.5rem 0;
            box-shadow: 0 6px 20px var(--shadow-color);
        }

        .demo-text-box {
            background: var(--bg-secondary);
            border: 2px solid var(--border-light);
            border-radius: 12px;
            padding: 1.5rem;
            margin: 1rem 0;
            font-size: 1rem;
            line-height: 1.6;
            color: var(--text-primary);
        }

        /* Compact TTS demo overrides to reduce vertical height and improve balance */
        /* Make TTS demo card match the voice agent card spacing and padding */
        .demo-section.tts-content {
            padding: 2rem; /* match .pad */
            border: 1px solid var(--border-light);
            border-radius: 16px;
            box-shadow: 0 6px 20px var(--shadow-color);
            background: var(--bg-card);
            margin: 1rem 0;
            overflow-x: hidden;
        }

        .demo-section.tts-content .demo-text-box {
            padding: 0.75rem; /* smaller inner padding */
            margin: 0.6rem 0; /* tighter spacing between blocks */
            font-size: 1.35rem;
            line-height: 1.7;
            border-radius: 10px;
        }

        /* Use inline placeholder labels inside the text boxes to save vertical space */
        .demo-section.tts-content .demo-text-box {
            position: relative;
        }

        .demo-section.tts-content .demo-text-box::before {
            content: attr(data-label);
            display: block;
            font-size: 0.825rem;
            color: var(--text-secondary);
            margin-bottom: 0.35rem;
            line-height: 1;
        }

        /* Fixed height with overflow to reduce the card's vertical footprint */
        .demo-section.tts-content .demo-text-box {
            max-height: 84px; /* compact fixed height */
            overflow: auto;
        }

        /* Word highlighting for audio synchronization */
        .demo-text-box .word {
            display: inline;
            transition: all 0.2s ease;
            padding: 2px 1px;
            border-radius: 3px;
        }

        .demo-text-box .word.highlight {
            background: linear-gradient(90deg, rgba(33,150,243,0.3), rgba(239,83,80,0.2));
            color: var(--primary-color);
            /* avoid changing font-weight to prevent layout shift/jumpiness */
            transform: scale(1.02);
        }

        [data-theme="dark"] .demo-text-box .word.highlight {
            background: linear-gradient(90deg, rgba(66,165,245,0.4), rgba(239,83,80,0.3));
            color: #42A5F5;
        }

        .demo-section.tts-content h3 {
            margin-top: 0.25rem;
            margin-bottom: 0.5rem;
            font-size: 1rem;
        }

        /* Make toolbar and controls denser */
        .demo-section.tts-content .demo-row { gap: 0.5rem; }
        .demo-section.tts-content .country-dropdown .toggle,
        .demo-section.tts-content .select-trigger,
        .demo-section.tts-content .input-field { padding: 0.45rem 0.65rem; }

        .demo-section.tts-content .language-selector { gap: 0.5rem; }

        /* Match Generate Audio button height to Create Agent button */
        .demo-section.tts-content .btn-primary {
            padding: 1rem 2rem;
            font-size: 0.95rem;
        }

        /* .language-selector - Migrated to Tailwind: grid grid-cols-[repeat(auto-fit,minmax(100px,1fr))] gap-3 my-4 */

        .language-selector .lang-btn {
            width: 100%;
            justify-content: center;
            text-align: center;
        }

        /* Country selector (flag + name) - custom dropdown */
        .demo-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
        }

        .country-select {
            margin: 0;
            max-width: 420px;
            width: 100%;
            display: flex;
            justify-content: flex-end;
        }

        .country-dropdown {
            position: relative;
            min-width: 220px;
            max-width: 420px;
            width: 100%;
            display: inline-block;
            text-align: left;
        }

        /* When header layout is in use, make dropdown sit inline and compact */
        .country-header .country-dropdown { max-width: 280px; }

        /* Group container for label + dropdown so they share width and alignment */
        .country-field { display: grid; grid-template-rows: auto auto; gap: 0.35rem; }
    /* Match Agent "input-label" styling for consistency */
    .country-field .country-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; text-align: left; font-weight: 500; line-height:1.2; }
    /* Translation label should match country/agent label */
    .translation-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; text-align: left; font-weight: 500; line-height:1.2; }
        .country-field .country-select { width: 100%; }
        /* ensure the grouped field sits in the right column */
        .country-header > .country-field { justify-self: end; max-width: 280px; }

        @media (max-width: 640px) {
            .country-header { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 0.5rem; }
            .country-header .country-label { grid-column: 1 / -1; justify-self: start; }
            .country-header .country-select { justify-self: start; max-width: 100%; }
        }

        /* Very small screens: collapse dropdown to icon-only (hide label text inside the toggle) */
        @media (max-width: 420px) {
            .country-dropdown .toggle .label { display: none; }
            .country-dropdown .toggle { padding-left: 0.4rem; padding-right: 0.4rem; }
            .country-dropdown .toggle img { width: 28px; height: 18px; }
        }

        .country-dropdown .toggle {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            justify-content: space-between;
            width: 100%;
            padding: 0.6rem 0.9rem;
            border-radius: 12px;
            border: 2px solid var(--border-light);
            background: var(--bg-secondary);
            cursor: pointer;
        }

        .country-dropdown .toggle img {
            width: 22px;
            height: 16px;
            object-fit: cover;
            border-radius: 2px;
            display: inline-block;
        }

        .country-dropdown .toggle .label {
            flex: 1;
            color: var(--text-primary);
            font-size: 0.95rem;
            margin-right: 0.5rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .country-dropdown .list {
            position: absolute;
            right: 0;
            top: calc(100% + 8px);
            width: 100%;
            max-height: 280px;
            overflow-y: auto;
            background: var(--bg-card);
            border: 2px solid var(--border-light);
            border-radius: 12px;
            box-shadow: 0 10px 30px var(--shadow-color);
            z-index: 1200;
            display: none;
        }

        .country-dropdown.open .list {
            display: block;
        }

        .country-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem 0.75rem;
            cursor: pointer;
            transition: background 0.12s ease;
        }

        .country-item:hover {
            background: linear-gradient(90deg, rgba(33,150,243,0.04), rgba(239,83,80,0.02));
        }

        .country-item img { width: 26px; height: 18px; object-fit: cover; border-radius: 2px; }

        .country-item .name { color: var(--text-primary); font-size: 0.95rem; }

        .country-dropdown .search {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border-bottom: 1px solid var(--border-light);
            background: transparent;
        }

        .country-dropdown .search input {
            width: 100%;
            padding: 0.5rem 0.5rem;
            border-radius: 8px;
            border: 1px solid var(--border-light);
            background: var(--bg-secondary);
        }

        /* Dark mode: make country dropdown caret icon white */
        [data-theme="dark"] .country-dropdown .toggle .fa-caret-down {
            color: #ffffff;
        }

        /* Custom scrollbar for country dropdown list */
        .country-dropdown .list::-webkit-scrollbar {
            width: 8px;
        }

        .country-dropdown .list::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.05);
            border-radius: 4px;
        }

        .country-dropdown .list::-webkit-scrollbar-thumb {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 4px;
        }

        .country-dropdown .list::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 0, 0, 0.4);
        }

        /* Dark mode scrollbar for country dropdown */
        [data-theme="dark"] .country-dropdown .list::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.08);
        }

        [data-theme="dark"] .country-dropdown .list::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.25);
        }

        [data-theme="dark"] .country-dropdown .list::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.35);
        }

        .lang-btn {
            padding: 0.75rem 1rem;
            background: var(--bg-card);
            border: none;
            border-radius: 999px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.3s;
            font-size: 0.875rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.25rem;
            box-shadow: inset 0 0 0 1.5px var(--border-light);
            background-origin: border-box;
            overflow: hidden;
        }

        .lang-btn-label {
            font-size: 0.75rem;
            font-weight: 500;
            color: var(--text-secondary);
        }

        .lang-btn-script {
            font-size: 0.65rem;
            font-weight: 400;
        }

        .lang-btn.active {
            background: linear-gradient(135deg, var(--oxygen-deep), var(--accent-red));
            color: white;
            box-shadow: none;
        }

        .lang-btn.active .lang-btn-label,
        .lang-btn.active .lang-btn-script {
            color: white;
        }

        /* Code Block with Line Numbers */
        .code-container {
            position: relative;
            background: linear-gradient(135deg, #1b1d24 0%, #13151b 100%);
            border: 2px solid rgba(100, 181, 246, 0.35);
            border-radius: 14px;
            overflow: hidden;
            box-shadow: 0 16px 45px rgba(5, 12, 22, 0.45);
            display: none;
            width: 100%;
            min-width: 0;
        }

        .code-container.active {
            display: block;
        }

        [data-theme="dark"] .code-container {
            background: linear-gradient(135deg, #0f141d 0%, #080b11 100%);
            border-color: rgba(100, 181, 246, 0.45);
            box-shadow: 0 18px 55px rgba(0, 0, 0, 0.6);
        }

        .code-wrapper {
            display: flex;
            overflow-x: auto;
            overflow-y: hidden;
            height: auto;
            font-variant-ligatures: none;
            background: radial-gradient(circle at top left, rgba(100, 181, 246, 0.12), transparent 55%);
        }

        .line-numbers {
            background: rgba(9, 13, 22, 0.78);
            color: #a0adc2;
            padding: 1rem 0.5rem 1rem 0.75rem;
            text-align: right;
            font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
            font-size: 0.875rem;
            line-height: 1.5;
            user-select: none;
            border-right: 1px solid rgba(148, 163, 184, 0.18);
            min-width: 45px;
            height: auto;
            overflow: hidden;
            flex-shrink: 0;
        }

        [data-theme="dark"] .line-numbers {
            background: rgba(4, 7, 12, 0.82);
            color: #9aa6bf;
            border-right-color: rgba(148, 163, 184, 0.22);
        }

        .line-numbers span {
            display: block;
            padding: 0;
            opacity: 0.95;
            line-height: 1.5;
            height: 1.5em;
        }

        #api .line-numbers span {
            line-height: 1.5;
            height: 1.5em;
        }

        .code-content {
            flex: 1;
            padding: 1rem 1.25rem;
            font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
            font-size: 0.875rem;
            line-height: 1.5;
            letter-spacing: 0;
            white-space: pre;
            overflow-x: auto;
            overflow-y: hidden;
            height: auto;
            color: #f8fafc;
            text-shadow: 0 1px 2px rgba(3, 6, 12, 0.45);
            font-feature-settings: "liga" 1, "calt" 1;
            min-width: 950px;
        }

        .code-keyword { color: #9aa7ff; font-weight: 600; }
        .code-string { color: #c8f7a0; }
        .code-comment { color: #8a94b3; font-style: italic; }
        .code-function { color: #7fd3ff; }
        .code-number { color: #f7a16c; }
        .code-operator { color: #9cdcfe; }
        .code-punctuation { color: #9cdcfe; opacity: 0.9; }
        .code-class { color: #ffdf8d; }
        .code-variable { color: #f8fafc; }

        .pricing-card {
            background: var(--bg-card);
            border: 2px solid var(--border-color);
            border-radius: 20px;
            padding: 1.5rem;
            transition: all 0.3s ease;
            position: relative;
            box-shadow: 0 4px 20px var(--shadow-color);
            display: flex;
            flex-direction: column;
        }

        /* Reduce vertical space between feature list items inside pricing cards */
        .pricing-card ul.list-none li,
        .pricing-card ul li {
            padding-top: 0.5rem !important;
            padding-bottom: 0.5rem !important;
            margin-bottom: 0 !important;
        }

        /* (Enterprise joined badge removed - reverted) */

        .pricing-card.highlight {
            border: 3px solid var(--oxygen-vivid);
            transform: scale(1.05);
            box-shadow: 0 8px 40px var(--shadow-color);
        }

        .pricing-badge {
            position: absolute;
            top: -12px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, var(--oxygen-deep), var(--accent-red));
            padding: 0.3rem 1.2rem;
            border-radius: 50px;
            font-size: 0.75rem;
            font-weight: 600;
            color: white;
        }

        /* Compact layout for Developer API section: reduce trailing space and line gaps */
        #api {
            padding-top: 1.5rem;
            padding-bottom: 1.5rem;
        }

        #api .card.pad {
            padding: 0.75rem 0.9rem;
        }

        /* Make the language toggles denser */
        #api .lang-btn {
            padding: 0.45rem 0.6rem;
            gap: 0.15rem;
            font-size: 0.78rem;
            min-height: 36px;
        }

        /* Reduce gaps around code containers and make code blocks more compact */
        #api .code-container {
            margin-bottom: 0.4rem;
            border-radius: 10px;
            box-shadow: 0 8px 20px rgba(5,12,22,0.25);
        }

        #api .code-wrapper {
            padding-bottom: 0.15rem;
            /* Set fixed height to 22 lines for uniform container height across all languages.
               Line height is 1.5em. */
            min-height: calc(1.5em * 22);
            max-height: calc(1.5em * 22);
            overflow-y: auto;
            display: flex;
            align-items: stretch;
        }

        /* Line numbers column stretches to match container height */
        #api .line-numbers {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        #api .code-content {
            padding-top: 0.45rem;
            padding-bottom: 0.45rem;
            padding-left: 0.6rem;
            padding-right: 0.6rem;
            font-size: 0.925rem;
            line-height: 1.5;
            font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
            white-space: pre;
            overflow-x: auto;
            flex: 1;
        }

        #api .line-numbers {
            padding-top: 0.45rem;
            padding-bottom: 0.45rem;
            padding-left: 0.75rem;
            padding-right: 0.5rem;
            min-width: 38px;
            font-size: 0.925rem;
            line-height: 1.5;
            font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
            flex-shrink: 0;
            position: sticky;
            left: 0;
            background: rgba(9, 13, 22, 0.95);
            z-index: 1;
        }

        #api .line-numbers span {
            display: block;
            line-height: 1.5;
            height: 1.5em;
            margin: 0;
            padding: 0;
        }

        /* Tighten headings and paragraph spacing inside API card */
        #api h2, #api p {
            margin-top: 0;
            margin-bottom: 0.4rem;
        }

        /* Ensure direct-tts and with-translate spans don't introduce vertical gaps */
        #api .with-translate, #api .direct-tts {
            display: inline-block;
            margin: 0;
            padding: 0;
        }

        /* Reduce line-height for inline code-comments inside API examples to avoid trailing blank lines */
        #api .code-comment { line-height: 1.2; }

        /* Reduce top padding for demo section */
        #demo {
            padding-top: 0.5rem;
        }

        /* Reduce gap between heading and description in demo section */
        #demo h2 {
            margin-bottom: 0.5rem;
        }

        /* Reduce top padding for voices section */
        #voices {
            padding-top: 0.5rem;
        }

        /* Reduce gap between heading and description in voices section */
        #voices h2 {
            margin-bottom: 0.2rem;
        }

        /* Reduce top padding for pricing section */
        #pricing {
            padding-top: 0.5rem;
        }

        section {
            position: relative;
            padding: 3rem 2rem;
            max-width: 1400px;
            margin: 0 auto;
            z-index: 10;
            /* Ensure anchored headings offset below the fixed header.
               This value is updated at runtime to match the header height. */
            scroll-margin-top: var(--header-offset, 84px);
        }

        h2 {
            font-family: 'Poppins', sans-serif;
            font-size: clamp(2rem, 5vw, 3rem);
            font-weight: 50;
            margin-bottom: 1rem;
            letter-spacing: -0.02em;
        }

        h3 {
            font-family: 'Poppins', sans-serif;
            font-weight: 500;
        }

        .stat-card {
            background: var(--bg-card);
            border: 2px solid var(--border-light);
            border-radius: 16px;
            padding: 1.5rem;
            text-align: center;
            transition: all 0.3s ease;
            box-shadow: 0 4px 20px var(--shadow-color);
        }

        .stat-card:hover {
            transform: translateY(-5px);
            border-color: var(--oxygen-vivid);
        }

        .stat-number {
            font-size: 2rem;
            font-weight: 600;
            background: linear-gradient(135deg, var(--oxygen-intense), var(--accent-red));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .card {
            background: var(--bg-card);
            border: 1px solid var(--border-light);
            border-radius: 16px;
            box-shadow: 0 6px 20px var(--shadow-color);
        }

        /* .pad - Migrated to Tailwind: p-8 */

        /* .toolbar - Migrated to Tailwind: flex items-center justify-between gap-4 mb-3 flex-wrap */

        /* Compact tweaks specifically for the Voices section */
        #voices .card.pad { padding: 1.25rem; }
        #voices .toolbar { margin-bottom: 0.5rem; }
        #voices .chip { padding: 0.3rem 0.65rem; font-size: 0.9rem; }

        .chip {
            box-shadow: inset 0 0 0 1.5px var(--border-light);
            border: none;
            padding: 0.35rem 0.8rem;
            border-radius: 999px;
            background: var(--bg-card);
            cursor: pointer;
            transition: all 0.3s ease;
            background-origin: border-box;
        }

        .chip.active {
            background: linear-gradient(135deg, var(--oxygen-deep), var(--accent-red));
            color: white;
            box-shadow: none;
        }

        [data-theme="dark"] .chip {
            color: rgba(255, 255, 255, 0.92);
            box-shadow: inset 0 0 0 1.5px rgba(144, 202, 249, 0.35);
        }

        [data-theme="dark"] .chip:hover {
            color: #ffffff;
            box-shadow: inset 0 0 0 1.5px rgba(144, 202, 249, 0.6);
        }

        /* .voices-grid - Migrated to Tailwind: grid grid-cols-[repeat(auto-fit,minmax(240px,1fr))] gap-3 */

        .voices-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem; /* tighter vertical spacing */
        }

        .voice {
            display: flex;
            gap: 0.75rem; /* reduced internal gap */
            padding: 0.65rem 0.75rem; /* more compact padding */
            border: 1px solid var(--border-light);
            border-radius: 12px; /* slightly smaller radius */
            background: var(--bg-card);
            align-items: center;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
            min-height: 76px; /* Ensure consistent height regardless of gender text */
        }

        .voice:hover {
            border-color: var(--oxygen-vivid);
            transform: translateY(-3px);
            box-shadow: 0 6px 16px var(--shadow-color);
        }

        .voice.active {
            border: 2px solid var(--oxygen-vivid);
        }

        .avatar {
            width: 44px; /* smaller avatar size */
            height: 44px;
            min-width: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border-light);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
            color: white;
            font-weight: 600;
            font-size: 1.05rem; /* smaller initial text */
            letter-spacing: 0.02em;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
        }

        .v-name {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .v-meta {
            color: var(--text-secondary);
            font-size: 0.85rem; /* slightly smaller persona text */
            line-height: 1.25;
        }

        /* Alternative Design: Minimalist Ghost Button with Glow */
        .voice-play-btn {
            width: 38px;
            height: 38px;
            min-width: 38px;
            border-radius: 50%;
            border: 1.5px solid rgba(123, 31, 162, 0.25);
            background: transparent;
            color: var(--oxygen-vivid);
            display: flex !important;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
            font-size: 0.95rem;
            position: relative;
            overflow: visible;
            flex-shrink: 0;
        }

        /* Pulsating aura ring for light mode */
        .voice-play-btn::after {
            content: '';
            position: absolute;
            inset: -2px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.6);
            opacity: 0;
            transition: opacity 0.35s ease;
            z-index: -1;
        }

        /* Light mode styles */
        .voice-play-btn:hover {
            border-color: var(--oxygen-vivid);
            background: transparent;
            transform: scale(1.08);
            box-shadow: 
                0 0 0 3px rgba(123, 31, 162, 0.06),
                0 3px 12px rgba(123, 31, 162, 0.2);
        }

        .voice-play-btn:hover::after {
            opacity: 0.8;
            animation: pulse 1.2s ease-in-out infinite;
        }

        /* Playing state - white circle with pulsating aura */
        .voice-play-btn.playing {
            background: transparent;
            border-color: var(--oxygen-vivid);
            color: var(--oxygen-vivid);
            box-shadow: 
                0 0 0 2px rgba(123, 31, 162, 0.15),
                0 4px 12px rgba(123, 31, 162, 0.3);
            transform: scale(1.08);
        }

        /* Show pulsating aura while playing */
        .voice-play-btn.playing::after {
            opacity: 0.9;
            animation: pulse 1.2s ease-in-out infinite;
        }

        .voice-play-btn.playing:hover {
            transform: scale(1.1);
            box-shadow: 
                0 0 0 3px rgba(123, 31, 162, 0.12),
                0 5px 16px rgba(123, 31, 162, 0.35);
        }

        /* Dark mode styles - ethereal glow effect */
        [data-theme="dark"] .voice-play-btn {
            border-color: rgba(186, 104, 200, 0.3);
            color: rgba(186, 104, 200, 0.9);
        }

        [data-theme="dark"] .voice-play-btn::after {
            background: rgba(186, 104, 200, 0.3);
        }

        [data-theme="dark"] .voice-play-btn:hover {
            border-color: rgba(186, 104, 200, 0.8);
            background: rgba(186, 104, 200, 0.12);
            box-shadow: 
                0 0 0 3px rgba(186, 104, 200, 0.1),
                0 0 16px rgba(186, 104, 200, 0.3),
                0 0 32px rgba(186, 104, 200, 0.15);
            color: rgba(255, 255, 255, 0.95);
        }

        [data-theme="dark"] .voice-play-btn:hover::after {
            opacity: 0.8;
            animation: pulse 1.2s ease-in-out infinite;
        }

        [data-theme="dark"] .voice-play-btn.playing {
            background: transparent;
            border-color: rgba(186, 104, 200, 0.8);
            color: rgba(255, 255, 255, 0.95);
            box-shadow: 
                0 0 0 2px rgba(186, 104, 200, 0.2),
                0 0 16px rgba(186, 104, 200, 0.5),
                0 4px 12px rgba(123, 31, 162, 0.4);
            transform: scale(1.08);
        }

        /* Show pulsating aura while playing in dark mode */
        [data-theme="dark"] .voice-play-btn.playing::after {
            opacity: 0.9;
            animation: pulse 1.2s ease-in-out infinite;
        }

        [data-theme="dark"] .voice-play-btn.playing:hover {
            transform: scale(1.1);
            box-shadow: 
                0 0 0 3px rgba(186, 104, 200, 0.18),
                0 0 20px rgba(186, 104, 200, 0.5),
                0 0 40px rgba(186, 104, 200, 0.25),
                0 5px 16px rgba(123, 31, 162, 0.4);
        }

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

        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
                opacity: 0.6;
            }
            50% {
                transform: scale(1.15);
                opacity: 0.3;
            }
        }

        .voice-play-btn:active {
            transform: scale(0.95);
            transition-duration: 0.1s;
        }

        /* Custom play icon - use inline SVG centered inside the button */
        .voice-play-btn .play-icon {
            display: flex !important;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            margin-left: 0;
            transition: all 0.3s ease;
        }

        /* Custom pause icon - two bars */
        .voice-play-btn .pause-icon {
            display: none !important;
            gap: 4px;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            color: inherit;
            transform: translateZ(0); /* Force hardware acceleration for consistent rendering */
        }

        .voice-play-btn .pause-icon::before,
        .voice-play-btn .pause-icon::after {
            content: '';
            width: 3px;
            height: 13px;
            background-color: currentColor;
            border-radius: 0.5px;
            transform: translateZ(0); /* Force hardware acceleration */
            will-change: transform;
        }

        /* Hide icons by default */
        .voice-play-btn .pause-icon {
            display: none !important;
        }

        /* Show appropriate icon based on state */
        .voice-play-btn.playing .play-icon {
            display: none !important;
        }

        .voice-play-btn.playing .pause-icon {
            display: flex !important;
            color: inherit;
        }

        /* Ensure consistent icon colors in all states */
        .voice-play-btn.playing .pause-icon::before,
        .voice-play-btn.playing .pause-icon::after {
            background-color: currentColor;
        }

        .voice-play-btn i {
            pointer-events: none;
        }
        
        /* Modal Styles - Only animation states, all other styling via Tailwind */
        .modal-overlay.active {
            opacity: 1 !important;
            visibility: visible !important;
        }

        .modal-overlay.active .modal-content {
            transform: translateY(0) !important;
            opacity: 1 !important;
        }

        /* Ensure modals sit above the fixed header and are not occluded
           Increase z-index and on small viewports position modal content
           below the header using padding and max-height to avoid clipping. */
        .modal-overlay {
            z-index: 1300 !important; /* header uses 1100 */
        }

        @media (max-width: 767px) {
            .modal-overlay {
                align-items: flex-start !important; /* start from top so we can offset below header */
                padding-top: calc(var(--header-height, 72px) + 1rem) !important;
                padding-left: 0.75rem !important;
                padding-right: 0.75rem !important;
            }

            .modal-overlay .modal-content {
                max-height: calc(100vh - (var(--header-height, 72px) + 2.25rem));
                margin-top: 0 !important;
                border-radius: 14px;
                box-shadow: 0 18px 48px rgba(2,6,23,0.45);
            }
        }

        /* Extra-small devices (phones) - make auth modals take most of viewport
           while still leaving space for header and comfortable margins. */
        @media (max-width: 480px) {
            /* Slightly reduce overlay top padding so modal is near header but visible */
            .modal-overlay {
                padding-top: calc(var(--header-height, 72px) + 0.5rem) !important;
                padding-left: 0.5rem !important;
                padding-right: 0.5rem !important;
            }

            /* Target sign-in / sign-up / forgot-password modals specifically */
            #signInModal .modal-content,
            #signUpModal .modal-content,
            #forgotPasswordModal .modal-content {
                width: 100% !important;
                max-width: calc(100vw - 1rem) !important;
                padding: 0.75rem !important;
                border-radius: 12px !important;
                transform: translateY(0) !important;
                margin: 0 auto !important;
                box-shadow: 0 20px 50px rgba(2,6,23,0.55) !important;
                overflow: hidden;
            }

            /* Ensure the modal content body can scroll if it exceeds available height */
            #signInModal .modal-content > .modal-body,
            #signUpModal .modal-content > .modal-body,
            #forgotPasswordModal .modal-content > .modal-body {
                max-height: calc(100vh - (var(--header-height, 72px) + 3rem));
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            /* Fallback: if modal markup doesn't use .modal-body, apply to modal-content itself */
            #signInModal .modal-content,
            #signUpModal .modal-content,
            #forgotPasswordModal .modal-content {
                max-height: calc(100vh - (var(--header-height, 72px) + 3rem)) !important;
                overflow-y: auto !important;
                -webkit-overflow-scrolling: touch !important;
            }
        }

        /* Status message styles */
            .status-message {
                padding: 0.75rem 1rem;
                border-radius: 8px;
                font-size: 0.9rem;
                animation: fadeIn 0.3s ease;
            }
            .status-message.success {
                background: var(--success-bg, rgba(0, 200, 83, 0.1));
                color: var(--success-text, rgb(0, 150, 62));
            }
            .status-message.error {
                background: var(--error-bg, rgba(255, 59, 48, 0.1));
                color: var(--error-text, rgb(255, 59, 48));
            }
            @keyframes fadeIn {
                from { opacity: 0; transform: translateY(-10px); }
                to { opacity: 1; transform: translateY(0); }
            }

            /* Toast notifications */
            .toast-container {
                position: fixed;
                right: 1rem;
                top: 1rem;
                z-index: 9999;
                display: flex;
                flex-direction: column;
                gap: 0.5rem;
                pointer-events: none;
            }
            .toast {
                pointer-events: auto;
                min-width: 220px;
                max-width: 360px;
                padding: 0.6rem 0.9rem;
                border-radius: 8px;
                box-shadow: 0 6px 18px rgba(0,0,0,0.12);
                background: #fff;
                color: #222;
                font-size: 0.95rem;
                animation: slideIn 0.25s ease;
            }
            .toast.success { border-left: 4px solid #0a8a00; }
            .toast.error { border-left: 4px solid #b00020; }

            /* Dark mode toast styling */
            [data-theme="dark"] .toast {
                background: #2a2a2a;
                color: #e0e0e0;
                box-shadow: 0 6px 18px rgba(0,0,0,0.4);
            }
            [data-theme="dark"] .toast.success { border-left: 4px solid #10c010; }
            [data-theme="dark"] .toast.error { border-left: 4px solid #ff4444; }

            @keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

            /* Header user avatar */
            .user-avatar {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 24px;
                height: 24px;
                border-radius: 50%;
                /* default header gradient (fallback) */
                background: linear-gradient(135deg, var(--oxygen-vivid), var(--oxygen-deep));
                color: #fff;
                font-weight: 600;
                cursor: pointer;
                border: 2px solid rgba(255,255,255,0.06);
                position: relative;
                overflow: hidden; /* Ensure image fits within circle */
                padding: 0; /* Remove any button padding */
                align-self: flex-end; /* Align bottom edge with theme toggle */
            }
            
            /* Profile picture styling */
            .user-avatar img {
                width: 100%;
                height: 100%;
                border-radius: 50%;
                object-fit: cover;
                border: 2px solid var(--border-color);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
                display: block; /* Ensure image is displayed as block */
            }
            
            /* Dark mode - keeps same border style as theme toggle */
            [data-theme="dark"] .user-avatar img {
                border: 2px solid var(--border-color);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            }
            
            /* Tooltip for full name on hover */
            .user-avatar[data-fullname]:hover::after {
                content: attr(data-fullname);
                position: absolute;
                bottom: -35px;
                left: 50%;
                transform: translateX(-50%);
                background: var(--bg-card);
                color: var(--text-primary);
                padding: 6px 12px;
                border-radius: 8px;
                font-size: 0.875rem;
                font-weight: 500;
                white-space: nowrap;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
                border: 1px solid var(--border-light);
                z-index: 1001;
                pointer-events: none;
            }
            
            /* When header avatar also has the shared .avatar class, enforce
               exact parity with the voice avatars (size, border, shadow, font) */
            .user-avatar.avatar {
                width: 30px;
                height: 30px;
                min-width: 30px;
                border-radius: 50%;
                border: 1px solid var(--border-light);
                box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
                color: white;
                font-weight: 600;
                font-size: 0.9rem;
                letter-spacing: 0.02em;
                text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
            }
            
            .user-avatar.avatar img {
                border: 2px solid var(--oxygen-intense);
                box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
            }
            
            .user-avatar.small { width:28px; height:28px; font-size:0.9rem }
            .user-dropdown {
                position: absolute;
                right: 0;
                top: 44px;
                background: linear-gradient(180deg, rgba(255,255,255,0.02), var(--bg-card));
                border: 1px solid rgba(255,255,255,0.04);
                border-radius: 12px;
                padding: 6px;
                box-shadow: 0 10px 30px rgba(0,0,0,0.16);
                min-width: 180px;
                z-index: 1000;
                display: flex;
                flex-direction: column;
                gap: 6px;
            }

            /* Compact sign-out button that sits to the right of the header avatar */
            .signout-btn {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 36px;
                height: 36px;
                border-radius: 50%;
                border: 1px solid rgba(33, 150, 243, 0.3);
                background: transparent;
                color: var(--text-secondary);
                cursor: pointer;
                transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
                font-size: 0.95rem;
            }

            [data-theme="dark"] .signout-btn {
                border-color: rgba(100, 181, 246, 0.3);
            }

            .signout-btn:hover {
                background: linear-gradient(90deg, rgba(33,150,243,0.04), rgba(239,83,80,0.02));
                color: var(--text-primary);
                border-color: rgba(33, 150, 243, 0.5);
            }

            [data-theme="dark"] .signout-btn:hover {
                border-color: rgba(100, 181, 246, 0.5);
            }

            /* When we want the dropdown to appear to the right of the avatar (desktop)
               place it horizontally adjacent and vertically centered to the avatar. */
            .user-dropdown.right-of-avatar {
                left: calc(100% + 8px);
                right: auto;
                top: 50%;
                transform: translateY(-50%);
                min-width: 160px;
            }

            /* On small screens, revert to the below-avatar placement for better fit */
            @media (max-width: 767px) {
                .user-dropdown.right-of-avatar {
                    left: auto;
                    right: 0;
                    top: 44px;
                    transform: none;
                }
            }

            .user-dropdown .user-name {
                padding: 8px 12px;
                font-weight: 600;
                border-radius: 8px;
                background: transparent;
                color: var(--text-primary);
            }
            .user-dropdown button {
                background: transparent;
                border: none;
                text-align: left;
                padding: 8px 12px;
                border-radius: 8px;
                cursor: pointer;
                transition: background 0.12s ease;
                color: var(--text-primary);
            }
            .user-dropdown button:hover { background: rgba(255,255,255,0.02); }

        }

        /* Reset Password Page styles */
        #resetPage {
            min-height: 100vh;
            display: flex;
            /* Align to top so the reset card is immediately visible and easy to access */
            align-items: flex-start;
            justify-content: center;
            padding: 4.5rem 2rem 2rem; /* Slightly larger top padding so card sits lower below header */
            position: relative;
            box-sizing: border-box;
        }
        
        #resetPage .glass-card {
            width: 100%;
            max-width: 500px;
            margin: 0 auto; /* Extra insurance for horizontal centering */
        }
        
        /* Ensure the card doesn't get too close to edges on small screens */
        @media (max-width: 640px) {
            #resetPage {
                padding: 6rem 1rem 2rem;
            }
        }
        
        /* On very short screens, allow scrolling and adjust alignment */
        @media (max-height: 700px) {
            #resetPage {
                /* Keep top-aligned on short screens */
                align-items: flex-start;
                justify-content: flex-start;
                padding-top: 3.5rem;
            }

            #resetPage .glass-card {
                margin-top: 0;
            }
        }
        
        #resetPage .back-to-login { 
            margin-top: 1.5rem; 
            font-size: 0.9rem;
            text-align: center; 
        }

        #resetPage .back-to-login a {
            color: var(--oxygen-deep);
            text-decoration: underline;
            font-weight: 600;
            transition: color 0.2s ease;
        }

        #resetPage .back-to-login a:hover,
        #resetPage .back-to-login a:focus {
            color: var(--oxygen-intense);
        }

        [data-theme="dark"] #resetPage .back-to-login a {
            color: rgba(187, 222, 251, 0.97);
        }

        [data-theme="dark"] #resetPage .back-to-login a:hover,
        [data-theme="dark"] #resetPage .back-to-login a:focus {
            color: #ffffff;
        }

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


        .input-field:focus {
            outline: none;
            border-color: transparent;
            background: var(--bg-card);
        }

        /* Global placeholder styles applied to all .input-field elements for consistency
           Use a tunable variable so designers can tweak placeholder sizes centrally */
        .input-field::placeholder,
        .input-field::-webkit-input-placeholder,
        .input-field:-ms-input-placeholder,
        .input-field::-ms-input-placeholder,
        .input-field::-moz-placeholder {
            font-size: var(--placeholder-agent-size, 0.825rem);
            color: var(--text-secondary);
            opacity: var(--placeholder-opacity, 0.8);
        }

        /* Smooth dropdown background transition and dark-mode defaults
           - apply to select elements using the input-field class and their options
           - many UAs render native dropdowns but these rules improve appearance where supported
        */
        select.input-field {
            transition: background-color 220ms ease, color 220ms ease;
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        select.input-field:focus {
            background: var(--bg-card);
        }

        select.input-field option {
            transition: background-color 160ms ease, color 160ms ease;
            background: var(--bg-card);
            color: var(--text-primary);
        }

        select.input-field option:focus,
        select.input-field option:hover {
            background: linear-gradient(90deg, rgba(33,150,243,0.06), rgba(239,83,80,0.04));
        }

        /* Dark theme: avoid white flash by defaulting dropdown backgrounds to dark values */
        [data-theme="dark"] select.input-field {
            background: rgba(13,27,42,0.98); /* near-card dark */
            color: var(--text-primary);
        }

        [data-theme="dark"] select.input-field option {
            background: rgba(13,27,42,0.98);
            color: var(--text-primary);
        }

        [data-theme="dark"] select.input-field option:focus,
        [data-theme="dark"] select.input-field option:hover {
            background: linear-gradient(90deg, rgba(66,165,245,0.06), rgba(239,83,80,0.04));
            color: #fff;
        }

        /* Grouping block for Voice Agent form row */
        .agent-block-row { display: flex; gap: 1rem; align-items: stretch; }
        /* Grouping block for Voice Agent form (excluding Create Agent button) */
        .agent-create-block {
            width: 70%;
            margin: 0;
            border: 1px solid var(--border-light);
            border-radius: 12px;
            padding: 1rem;
        }
        /* Control block: center all inner UI horizontally and vertically */
        .agent-control-block {
            width: 30%;
            margin: 0;
            border: 1px solid var(--border-light);
            border-radius: 12px;
            padding: 1rem;
            background: transparent;
            display: flex;                 /* center child (agent-creating) */
            align-items: center;           /* vertical center within block height */
            justify-content: center;       /* horizontal center */
            text-align: center;            /* ensure text inside centers too */
        }
        @media (max-width: 900px) { 
            .agent-block-row { flex-direction: column; }
            .agent-create-block, .agent-control-block { width: 100%; }
        }

    /* Custom select (combobox) styles */
        .custom-select { position: relative; display: inline-block; width: 100%; }
        .select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
        /* Ensure the Select a voice trigger matches input padding/shape within Agents section */
        .agents-content .custom-select .select-trigger.input-field {
            padding: 0.75rem 1rem;    /* match .agents-content .input-field */
            border-radius: 10px;      /* match inputs in agents */
            line-height: 1.5;         /* match inputs in agents */
            width: 100%;
            font-size: 0.95rem;       /* match Agent Name input height exactly */
        }
        /* Reduce dropdown text sizes for better information density */
        .agents-content .select-dropdown .option-item { font-size: 0.8rem; }
        .agents-content .select-dropdown .optgroup-label { font-size: 0.8rem; }
        /* Normalize block flow so its spacing matches text inputs inside wrappers */
        .agents-content .custom-select { display: block; }
        .select-dropdown {
            position: absolute;
            left: 0; right: 0;
            margin-top: 8px;
            background: var(--bg-card);
            border: 1px solid var(--border-light);
            border-radius: 10px;
            box-shadow: 0 12px 40px var(--shadow-color);
            z-index: 1300;
            max-height: 220px;
            overflow: auto;
            padding: 0.5rem;
            transition: opacity 160ms ease, transform 160ms ease;
        }
        .select-dropdown[hidden] { display: none; }
        .select-search { padding: 0.25rem 0.25rem 0.5rem 0; }
        .options-container { display: block; }
        /* group label (language) */
        .optgroup-label { font-weight: 700; padding: 0.35rem 0.5rem; color: var(--text-secondary); }
        /* group container spacing */
        .optgroup { padding: 0.1rem 0; }
        /* option items: slight left indent to visually separate them from the group label */
        .option-item { padding: 0.45rem 0.5rem 0.45rem 1.1rem; border-radius: 8px; cursor: pointer; color: var(--text-primary); }
        .option-item[aria-selected="true"] { background: linear-gradient(135deg, rgba(33,150,243,0.08), rgba(239,83,80,0.06)); }
        .option-item:hover, .option-item:focus { background: linear-gradient(90deg, rgba(33,150,243,0.06), rgba(239,83,80,0.04)); outline: none; }

        /* Dark theme defaults for the custom dropdown */
        [data-theme="dark"] .select-dropdown { background: rgba(13,27,42,0.98); border-color: rgba(100,181,246,0.06); box-shadow: 0 12px 40px rgba(0,0,0,0.6); }
        [data-theme="dark"] .optgroup-label { color: var(--text-secondary); }
        [data-theme="dark"] .option-item { color: var(--text-primary); }

        .checkbox-group {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.5rem;
            font-size: 0.875rem;
        }

        .checkbox-label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--text-secondary);
        }

        .checkbox-group a {
            color: var(--oxygen-deep);
            text-decoration: underline;
            font-weight: 600;
        }

        .checkbox-group a:hover,
        .checkbox-group a:focus {
            color: var(--oxygen-intense);
        }

        [data-theme="dark"] .checkbox-group a {
            color: rgba(144, 202, 249, 0.95);
        }

        [data-theme="dark"] .checkbox-group a:hover,
        [data-theme="dark"] .checkbox-group a:focus {
            color: rgba(187, 222, 251, 1);
        }

        .forgot-link {
            color: var(--oxygen-deep);
            text-decoration: none;
            font-weight: 500;
        }

        .signup-link {
            text-align: center;
            margin-top: 1.5rem;
            font-size: 0.95rem;
            color: var(--text-secondary);
        }

        .signup-link a {
            color: var(--oxygen-deep);
            text-decoration: none;
            font-weight: 600;
        }

        .btn-link {
            padding: 0.75rem 1.5rem;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-weight: 500;
            cursor: pointer;
            transition: color 0.3s;
        }

        .btn-link:hover {
            color: var(--oxygen-deep);
        }

        /* Demo mode toggle (TTS vs Conversational AI) - match currency toggle visuals for parity */
        .mode-toggle {
            display: inline-flex;
            gap: 0.5rem;
            justify-content: center;
            /* Reduced spacing so demo controls sit closer to the demo card */
            margin-bottom: 0.6rem;
        }
        /* Copy base styles from .currency-btn for pixel parity */
        .mode-toggle .mode-btn {
            padding: 0.5rem 1.2rem;
            border-radius: 999px;
            border: none;
            background: var(--bg-card);
            color: var(--text-primary);
            cursor: pointer;
            font-weight: 600;
            transition: all 0.25s ease;
            box-shadow: inset 0 0 0 1.5px var(--border-color);
            background-origin: border-box;
            overflow: hidden;
        }

        .mode-toggle .mode-btn:hover {
            box-shadow: inset 0 0 0 1.5px var(--oxygen-deep);
        }

        .mode-toggle .mode-btn.active {
            background: linear-gradient(135deg, var(--oxygen-deep), var(--accent-red));
            color: #ffffff;
            box-shadow: 0 6px 16px rgba(33, 150, 243, 0.25);
        }

        /* Accessibility: subtle focus-visible outline for keyboard users */
        .mode-toggle .mode-btn:focus-visible {
            outline: 3px solid rgba(100, 181, 246, 0.36);
            outline-offset: 3px;
            border-radius: 999px;
        }

        /* Dark theme: copy currency toggle dark values for consistent contrast */
        [data-theme="dark"] .mode-toggle .mode-btn {
            color: rgba(255, 255, 255, 0.9);
            box-shadow: inset 0 0 0 1.5px rgba(144, 202, 249, 0.35);
        }

        [data-theme="dark"] .mode-toggle .mode-btn:hover {
            box-shadow: inset 0 0 0 1.5px rgba(144, 202, 249, 0.7);
        }

        [data-theme="dark"] .mode-toggle .mode-btn.active {
            box-shadow: 0 6px 16px rgba(21, 101, 192, 0.45);
            color: #ffffff;
        }

        [data-theme="dark"] .mode-toggle .mode-btn:focus-visible {
            outline: 3px solid rgba(100, 181, 246, 0.62);
            outline-offset: 3px;
        }

        /* Coming Soon button styling */
        .mode-toggle .mode-btn.coming-soon {
            position: relative;
            cursor: not-allowed;
            opacity: 0.6;
            background: var(--bg-secondary);
            color: var(--text-secondary);
        }

        .mode-toggle .mode-btn.coming-soon:hover {
            box-shadow: inset 0 0 0 1.5px var(--border-color);
            transform: none;
        }

        .coming-soon-badge {
            display: inline-block;
            margin-left: 0.5rem;
            padding: 0.15rem 0.45rem;
            border-radius: 12px;
            background: linear-gradient(135deg, #FFA726, #FF7043);
            color: white;
            font-size: 0.55rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            box-shadow: 0 2px 6px rgba(255, 167, 38, 0.3);
            animation: pulse-badge 2s ease-in-out infinite;
        }

        @keyframes pulse-badge {
            0%, 100% {
                transform: scale(1);
                opacity: 1;
            }
            50% {
                transform: scale(1.05);
                opacity: 0.9;
            }
        }

        [data-theme="dark"] .mode-toggle .mode-btn.coming-soon {
            background: rgba(13, 27, 42, 0.6);
            color: rgba(255, 255, 255, 0.5);
        }

        [data-theme="dark"] .coming-soon-badge {
            background: linear-gradient(135deg, #FF9800, #F57C00);
            box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
        }

        /* Conversational AI form and accordion */
    /* Agents content should match demo-section spacing for parity */
    .agents-content { 
        display: none; 
        margin: 1rem 0; 
    }
    .agents-content.active { display: block; }
    
    /* Match the agents card styling to header/footer glassmorphism */
    .agents-content .agent-card {
        padding: 2rem; /* match TTS padding */
        min-height: 580px; /* set minimum height to match TTS section */
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        border: 2px solid rgba(33, 150, 243, 0.2);
    }

        /* Ensure Agent form inputs match compact TTS demo spacing/padding with enhanced styling */
        .agents-content .input-field {
            padding: 0.75rem 1rem;
            border-radius: 10px;
            font-size: 0.95rem;
            font-family: 'Poppins', sans-serif;
            line-height: 1.5;
            margin-bottom: 0.25rem;
            background: var(--bg-secondary);
            border: 1.5px solid var(--border-light);
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
            transition: all 0.3s ease;
        }
        
        .agents-content .input-field:hover {
            border-color: rgba(33, 150, 243, 0.3);
            box-shadow: 0 4px 12px rgba(33, 150, 243, 0.08);
        }
        
        .agents-content .input-field:focus {
            outline: none;
            border-color: var(--oxygen-deep);
            box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1), 0 4px 12px rgba(33, 150, 243, 0.15);
            background: var(--bg-card);
        }

        /* Agent-specific placeholder tweaks inherit from global rules but use central opacity */
        .agents-content .input-field::placeholder,
        .agents-content .input-field::-webkit-input-placeholder,
        .agents-content .input-field:-ms-input-placeholder,
        .agents-content .input-field::-ms-input-placeholder,
        .agents-content .input-field::-moz-placeholder {
            /* Use tunable variable to match TTS demo label size exactly */
            font-size: var(--placeholder-agent-size, 0.9rem);
            color: var(--text-secondary);
            opacity: var(--placeholder-opacity, 0.8);
        }

        .agent-card { position: relative; }

        .agent-form .input-row { display:flex; gap:1rem; margin-bottom:1.5rem; }
        .agent-form .input-row .input-wrapper { flex:1; }
        
        /* Add spacing and styling for labels */
        .agent-form .input-label {
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.9rem;
            display: block;
        }
        
        /* Add spacing for agent block row */
        .agent-block-row {
            margin-bottom: 1.5rem;
        }
        
        /* Match Create Agent button height to Generate Audio button */
        .agents-content .btn-primary {
            padding: 1rem 2rem;
            font-size: 0.95rem;
        }

        .agent-accordion {
            margin-top: 1rem;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.45s cubic-bezier(.2,.9,.2,1), transform 0.35s ease;
            transform-origin: bottom center;
            background: rgba(33, 150, 243, 0.02);
            border-radius: 10px;
        }

        .agent-accordion.open { 
            max-height: 420px;
            padding: 1rem;
            border: 1.5px solid rgba(33, 150, 243, 0.15);
        }

        .agent-creating {
            display: flex; /* visible by default so pulse, Start button, and timer are shown */
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 1rem;
            /* padding, background, border, border-radius, and box-shadow now handled by Tailwind classes in HTML for consistency */
        }

        .agent-creating.active { display:flex; }

        /* Voice feedback animation container with microphone and concentric circles */
        .voice-feedback-container {
            position: relative;
            width: 140px;
            height: 140px;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0.6;
            transition: opacity 0.3s ease;
            --audio-level: 0;
            margin-top: -20px;
        }

        .voice-feedback-container.active {
            opacity: 1;
        }

        /* Microphone icon wrapper - central element */
        .mic-icon-wrapper {
            position: relative;
            z-index: 10;
            width: 64px;
            height: 64px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, var(--oxygen-deep), var(--oxygen-vivid));
            box-shadow: 
                0 4px 16px rgba(66, 165, 245, 0.3),
                0 0 24px rgba(66, 165, 245, 0.15),
                inset 0 2px 8px rgba(255, 255, 255, 0.2);
            transition: transform 0.15s ease, box-shadow 0.2s ease;
        }

        .voice-feedback-container.active .mic-icon-wrapper {
            box-shadow: 
                0 6px 24px rgba(66, 165, 245, 0.45),
                0 0 32px rgba(66, 165, 245, 0.25),
                inset 0 2px 8px rgba(255, 255, 255, 0.25);
        }

        .mic-icon {
            font-size: 28px;
            color: white;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
            transition: transform 0.1s ease;
        }

        /* Concentric circles for ripple effect - enhanced gradients with better visibility */
        .concentric-circle {
            position: absolute;
            border-radius: 50%;
            opacity: 0;
            pointer-events: none;
            background: radial-gradient(
                circle at center,
                transparent 20%,
                rgba(66, 165, 245, 0.18) 40%,
                rgba(66, 165, 245, 0.12) 60%,
                transparent 80%
            );
            border: none;
        }

        /* Add subtle gradient border effect */
        .concentric-circle::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: radial-gradient(
                circle at center,
                transparent 35%,
                rgba(66, 165, 245, 0.35) 45%,
                rgba(100, 181, 246, 0.22) 55%,
                transparent 65%
            );
            opacity: 0.7;
        }

        /* Circle sizing - balanced sizes for elegance and visibility */
        .circle-1 {
            width: 65px;
            height: 65px;
        }

        .circle-2 {
            width: 82px;
            height: 82px;
        }

        .circle-3 {
            width: 100px;
            height: 100px;
        }

        /* Ripple animation when active - smooth and elegant */
        .voice-feedback-container.active .concentric-circle {
            animation: ripple 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
        }

        /* Stagger the animation for each circle - creates flowing wave effect */
        .voice-feedback-container.active .circle-1 {
            animation-delay: 0s;
        }

        .voice-feedback-container.active .circle-2 {
            animation-delay: 0.5s;
        }

        .voice-feedback-container.active .circle-3 {
            animation-delay: 1s;
        }

        /* Speaking state - triggered when user or AI is speaking */
        .voice-feedback-container.speaking .concentric-circle {
            animation: ripple-intense 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
        }

        .voice-feedback-container.speaking .concentric-circle::before {
            opacity: 1;
        }

        .voice-feedback-container.speaking .mic-icon {
            animation: mic-pulse 0.35s ease-in-out;
        }

        /* Microphone bounce animation */
        @keyframes mic-pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.12); }
        }

        /* small status dot used beside agent status (red = offline, green = online) */
        .status-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
            box-shadow: 0 0 0 4px rgba(0,0,0,0.04);
            transition: background-color 180ms ease, box-shadow 180ms ease;
        }
        .status-dot.offline { background: #f44336; box-shadow: 0 0 0 6px rgba(244,67,54,0.06); }
        .status-dot.online { background: #4caf50; box-shadow: 0 0 0 6px rgba(76,175,80,0.06); }

        /* Fixed-width font for agent timer to prevent layout shift */
        #agentTimer {
            /* Use a specific monospace font for consistent cross-platform look */
            font-family: 'Roboto Mono', monospace;
            font-variant-numeric: tabular-nums;
            font-weight: 600;
            font-size: 0.95rem;
            letter-spacing: 0.02em;
            transition: color 0.3s ease;
        }

        /* Blinking animation for timer when time is running out (last 10 seconds) */
        #agentTimer.warning {
            animation: timerBlink 0.8s ease-in-out infinite;
            color: #f44336 !important; /* Red color for urgency */
            font-weight: 700; /* Make it slightly bolder for emphasis */
        }

        @keyframes timerBlink {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: 0.3;
            }
        }

        /* Reduce font size for agent status line (e.g., "Creating agent and initializing conversation…") */
        #agentStatus { font-size: 0.9rem; }

        /* Smooth ripple animation for concentric circles - balanced scale and visibility */
        @keyframes ripple {
            0% {
                transform: scale(0.8);
                opacity: 0;
            }
            5% {
                opacity: 0;
            }
            15% {
                opacity: 0.65;
            }
            40% {
                opacity: 0.45;
            }
            70% {
                opacity: 0.2;
            }
            100% {
                transform: scale(1.45);
                opacity: 0;
            }
        }

        /* Intense ripple for active speaking - balanced scale */
        @keyframes ripple-intense {
            0% {
                transform: scale(0.75);
                opacity: 0;
            }
            10% {
                opacity: 0.85;
            }
            30% {
                opacity: 0.75;
            }
            60% {
                opacity: 0.35;
            }
            100% {
                transform: scale(1.5);
                opacity: 0;
            }
        }

        /* Slight dim/out-of-focus state for accordion when agent is created */
        .agent-accordion.out-of-focus { opacity: 0.35; filter: blur(0.6px); transform: scale(0.995); }

        /* Spinner Animation for Loading States */
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .spinner {
            display: inline-block;
            width: 1em;
            height: 1em;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top: 2px solid #fff;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin-right: 0.5rem;
        }

        /* Button loading state */
        .btn-loading {
            position: relative;
            pointer-events: none;
            opacity: 0.85;
        }

        .btn-loading .spinner {
            vertical-align: middle;
        }

        /* Waveform container - prevent scrollbars */
        #waveformContainer {
            overflow: hidden !important;
            max-width: 100%;
            border: none;
            border-radius: 999px;
        }

        [data-theme="dark"] #waveformContainer {
            border: none;
        }

        #waveformContent {
            overflow: hidden !important;
            max-width: 50%;
            margin-left: auto;
            margin-right: auto;
            border: 1.5px solid #dadada;
            border-radius: 999px;
            height: 60%;
            padding: 0;
        }

        [data-theme="dark"] #waveformContent {
            border: 1.5px solid rgba(255,255,255,0.08);
        }

        /* Canvas-based waveform with gradient background */
        #waveform {
            width: 100% !important;
            height: 100% !important;
            display: block;
            border-radius: 999px;
            background: transparent;
            cursor: pointer;
            transition: transform 0.2s ease;
        }

        #waveform:hover {
            transform: scale(1.01);
        }

        /* Dark theme canvas background */
        [data-theme="dark"] #waveform {
            background: transparent;
        }

        /* Ensure WaveSurfer wrapper doesn't overflow (fallback mode) */
        #waveform > div {
            max-width: 100% !important;
            overflow: hidden !important;
        }

        /* Constrain canvas if it gets too wide */
        #waveform canvas {
            max-width: 100% !important;
        }

        /* Smooth animation for waveform (fallback mode) */
        #waveform wave {
            transition: all 0.1s ease-out;
        }

        /* Dark theme support for Conversational AI section - match header glassmorphism */
        [data-theme="dark"] .agents-content .agent-card {
            background: rgba(10, 25, 41, 0.95);
            backdrop-filter: blur(12px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            border: 2px solid rgba(100, 181, 246, 0.2);
        }

        [data-theme="dark"] .agents-content .input-field {
            background: rgba(13, 27, 42, 0.8);
            border: 1.5px solid rgba(100, 181, 246, 0.2);
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
            color: rgba(255, 255, 255, 0.9);
        }

        [data-theme="dark"] .agents-content .input-field:hover {
            border-color: rgba(144, 202, 249, 0.4);
            box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
        }

        [data-theme="dark"] .agents-content .input-field:focus {
            border-color: rgba(144, 202, 249, 0.7);
            box-shadow: 0 0 0 3px rgba(144, 202, 249, 0.15), 0 4px 12px rgba(144, 202, 249, 0.25);
            background: rgba(13, 27, 42, 0.9);
        }

        /* Dark mode support - enhanced gradients with better visibility */
        [data-theme="dark"] .concentric-circle {
            background: radial-gradient(
                circle at center,
                transparent 20%,
                rgba(144, 202, 249, 0.2) 40%,
                rgba(144, 202, 249, 0.14) 60%,
                transparent 80%
            );
        }

        [data-theme="dark"] .concentric-circle::before {
            background: radial-gradient(
                circle at center,
                transparent 35%,
                rgba(144, 202, 249, 0.4) 45%,
                rgba(100, 181, 246, 0.25) 55%,
                transparent 65%
            );
            opacity: 0.75;
        }

        [data-theme="dark"] .voice-feedback-container.speaking .concentric-circle::before {
            opacity: 0.9;
        }

        [data-theme="dark"] .mic-icon-wrapper {
            background: linear-gradient(135deg, var(--oxygen-vivid), #90CAF9);
            box-shadow: 
                0 4px 20px rgba(144, 202, 249, 0.4),
                0 0 32px rgba(144, 202, 249, 0.2),
                inset 0 2px 8px rgba(255, 255, 255, 0.15);
        }

        [data-theme="dark"] .voice-feedback-container.active .mic-icon-wrapper {
            box-shadow: 
                0 6px 28px rgba(144, 202, 249, 0.6),
                0 0 40px rgba(144, 202, 249, 0.3),
                inset 0 2px 8px rgba(255, 255, 255, 0.2);
        }

        /* Custom scrollbar styling for textareas in light mode */
        textarea.input-field::-webkit-scrollbar {
            width: 8px;
        }

        textarea.input-field::-webkit-scrollbar-track {
            background: rgba(33, 150, 243, 0.08);
            border-radius: 4px;
        }

        textarea.input-field::-webkit-scrollbar-thumb {
            background: rgba(33, 150, 243, 0.3);
            border-radius: 4px;
            transition: background 0.3s ease;
        }

        textarea.input-field::-webkit-scrollbar-thumb:hover {
            background: rgba(33, 150, 243, 0.5);
        }

        /* Firefox scrollbar styling for light mode */
        textarea.input-field {
            scrollbar-width: thin;
            scrollbar-color: rgba(33, 150, 243, 0.3) rgba(33, 150, 243, 0.08);
        }

        /* Custom scrollbar styling for textareas in dark mode */
        [data-theme="dark"] textarea.input-field::-webkit-scrollbar {
            width: 8px;
        }

        [data-theme="dark"] textarea.input-field::-webkit-scrollbar-track {
            background: rgba(13, 27, 42, 0.6);
            border-radius: 4px;
        }

        [data-theme="dark"] textarea.input-field::-webkit-scrollbar-thumb {
            background: rgba(100, 181, 246, 0.3);
            border-radius: 4px;
            transition: background 0.3s ease;
        }

        [data-theme="dark"] textarea.input-field::-webkit-scrollbar-thumb:hover {
            background: rgba(100, 181, 246, 0.5);
        }

        /* Firefox scrollbar styling for dark mode */
        [data-theme="dark"] textarea.input-field {
            scrollbar-width: thin;
            scrollbar-color: rgba(100, 181, 246, 0.3) rgba(13, 27, 42, 0.6);
        }

        [data-theme="dark"] .agent-creating {
            /* Background and border now handled by Tailwind classes in HTML for consistency */
        }

        [data-theme="dark"] .agent-accordion {
            background: rgba(33, 150, 243, 0.05);
        }

        [data-theme="dark"] .agent-accordion.open {
            border: 1.5px solid rgba(144, 202, 249, 0.25);
        }

        [data-theme="dark"] .agent-form .input-label {
            color: rgba(255, 255, 255, 0.95);
        }




/* Ensure carousel buttons sit above transition overlays on all viewports */
#useCaseCarousel .carousel-button, #useCaseCarousel .carousel-button * {
    position: relative !important;
    z-index: 2000 !important; /* ensure buttons render above most overlays on mobile */
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.12);
}

/* Extra visible hint for debugging on small screens (can be removed later) */
@media (max-width: 640px) {
    #useCaseCarousel .carousel-button {
        box-shadow: 0 6px 18px rgba(2,6,23,0.24);
        transform: translateZ(0);
    }
}

/* Center the Listen button on small portrait devices */
@media (max-width: 640px) and (orientation: portrait) {
    #useCaseCarousel .carousel-slide {
        /* ensure slide right-column uses centered children */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #useCaseCarousel .carousel-slide .carousel-button {
        align-self: center !important;
        margin: 0.75rem auto !important;
        min-width: 140px !important;
        width: auto !important;
        justify-content: center !important;
    }

    /* Ensure the text area remains readable and doesn't expand the button */
    #useCaseCarousel .carousel-slide .carousel-quote {
        text-align: center !important;
    }
}

/* Fallback rules for various mobile emulators where orientation media may not match */
@media (max-width: 768px) {
    /* Allow nav buttons to escape any overflow clipping on small screens */
    #useCaseCarousel,
    #useCaseCarousel + div,
    #useCaseCarousel.parentElement {
        overflow: visible !important;
    }

    #prevSlide, #nextSlide {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 44px !important;
        height: 44px !important;
        left: 8px !important; /* prev */
        right: 8px !important; /* next */
        z-index: 5000 !important;
        box-shadow: 0 10px 30px rgba(2,6,23,0.32) !important;
    }

    /* Ensure chevrons are visible and appropriately colored */
    #prevSlide i, #nextSlide i {
        color: var(--oxygen-deep) !important;
    }
}

/* Mobile-only: wrap carousel text after ~40 characters */
@media (max-width: 640px) {
    #useCaseCarousel .carousel-title,
    #useCaseCarousel .carousel-quote,
    #useCaseCarousel .carousel-category {
        max-width: 40ch !important; /* approx 40 characters */
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        display: block !important;
    }
}

/* Ensure carousel nav arrows are visible and vertically centered on small portrait viewports */
@media (max-width: 640px) and (orientation: portrait) {
    #prevSlide, #nextSlide {
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 44px !important;
        height: 44px !important;
        left: 8px !important; /* prev */
        right: 8px !important; /* next */
        opacity: 1 !important;
        z-index: 3000 !important;
        box-shadow: 0 8px 24px rgba(2,6,23,0.28) !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0.12);
    }

    /* Slightly enlarge hit area on mobile for easier tapping */
    #prevSlide::after, #nextSlide::after {
        content: '';
        position: absolute;
        inset: -6px;
        border-radius: 999px;
    }
}

/* Shake animation for auth required feedback */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
}

/* Auth required button highlight */
.auth-required-highlight {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.5) !important;
    border-color: #ef4444 !important;
}

