        /* --- ENHANCED VISUAL DESIGN 3.0 --- */
        
        /* Theme Variables */
        :root {
            --border-radius: 16px;
            --transition-speed: 0.4s;
            --transition-ease: cubic-bezier(0.4, 0.0, 0.2, 1);
            --shadow-elevation-1: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            --shadow-elevation-2: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            --shadow-elevation-3: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 20px 25px -5px rgba(0, 0, 0, 0.1);
            --glow-intensity: 0.8;
        }

        .dark-mode {
            --background: #0a0a0f;
            --background-gradient: radial-gradient(ellipse 120% 80% at 50% -30%, rgba(123, 97, 255, 0.15), transparent),
                                  radial-gradient(ellipse 100% 60% at 80% 80%, rgba(255, 61, 113, 0.08), transparent);
            --card-bg: #16161f;
            --card-bg-hover: #1d1d2a;
            --text-primary: #fafafa;
            --text-secondary: #b8bdd6;
            --text-muted: #6c7293;
            --accent: #2a2a3e;
            --accent-hover: #363648;
            --shadow: rgba(0, 0, 0, 0.6);
            --primary-gradient: linear-gradient(135deg, #7b61ff 0%, #8f4ddb 100%);
            --secondary-gradient: linear-gradient(135deg, #295e9e 0%, #3498db 100%);
            --border-light: rgba(255, 255, 255, 0.06);
            --scrollbar-track: rgba(255, 255, 255, 0.02);
            --scrollbar-thumb: rgba(255, 255, 255, 0.1);
            --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), var(--shadow-elevation-2);
            --chart-grid: rgba(255, 255, 255, 0.04);
            --chart-overlay: rgba(16, 16, 31, 0.75);
            --zoom-hint-color: rgba(123, 97, 255, 0.3);
            --approve-color: #4ade80;
            --disapprove-color: #ff3d71;
            --approve-color-glow: rgba(74, 222, 128, 0.4);
            --disapprove-color-glow: rgba(255, 61, 113, 0.4);
            --favorable-color: #a855f7;
            --unfavorable-color: #f97316;
            --favorable-color-glow: rgba(168, 85, 247, 0.4);
            --unfavorable-color-glow: rgba(249, 115, 22, 0.4);
            --trump-color: #ef4444;
            --harris-color: #3b82f6;
            --vance-color: #dc2626;
            --newsom-color: #2563eb;
            --trump-color-glow: rgba(239, 68, 68, 0.4);
            --harris-color-glow: rgba(59, 130, 246, 0.4);
            --vance-color-glow: rgba(220, 38, 38, 0.4);
            --newsom-color-glow: rgba(37, 99, 235, 0.4);
            --highlight-zoom-border: #8b5cf6;
            --highlight-zoom-bg: rgba(139, 92, 246, 0.15);
            --glass-bg: rgba(255, 255, 255, 0.02);
            --glass-border: rgba(255, 255, 255, 0.08);
            --title-static-color: var(--text-primary);
        }

        .dark-mode-minimal {
            --background: #000000;
            --background-gradient: none;
            --card-bg: #111111;
            --card-bg-hover: #1a1a1a;
            --text-primary: #ffffff;
            --text-secondary: #cccccc;
            --text-muted: #888888;
            --accent: #222222;
            --accent-hover: #333333;
            --shadow: rgba(0, 0, 0, 0.8);
            --primary-gradient: linear-gradient(135deg, #7b61ff 0%, #8f4ddb 100%);
            --secondary-gradient: linear-gradient(135deg, #295e9e 0%, #3498db 100%);
            --border-light: rgba(255, 255, 255, 0.1);
            --scrollbar-track: rgba(255, 255, 255, 0.05);
            --scrollbar-thumb: rgba(255, 255, 255, 0.2);
            --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), var(--shadow-elevation-2);
            --chart-grid: rgba(255, 255, 255, 0.1);
            --chart-overlay: rgba(0, 0, 0, 0.75);
            --zoom-hint-color: rgba(123, 97, 255, 0.3);
            --approve-color: #4ade80;
            --disapprove-color: #ff3d71;
            --approve-color-glow: rgba(74, 222, 128, 0.4);
            --disapprove-color-glow: rgba(255, 61, 113, 0.4);
            --favorable-color: #a855f7;
            --unfavorable-color: #f97316;
            --favorable-color-glow: rgba(168, 85, 247, 0.4);
            --unfavorable-color-glow: rgba(249, 115, 22, 0.4);
            --trump-color: #ef4444;
            --harris-color: #3b82f6;
            --vance-color: #dc2626;
            --newsom-color: #2563eb;
            --trump-color-glow: rgba(239, 68, 68, 0.4);
            --harris-color-glow: rgba(59, 130, 246, 0.4);
            --vance-color-glow: rgba(220, 38, 38, 0.4);
            --newsom-color-glow: rgba(37, 99, 235, 0.4);
            --highlight-zoom-border: #8b5cf6;
            --highlight-zoom-bg: rgba(139, 92, 246, 0.15);
            --glass-bg: rgba(255, 255, 255, 0.05);
            --glass-border: rgba(255, 255, 255, 0.15);
            --title-static-color: var(--text-primary);
        }
        
        .light-mode {
            --background: #fafafa;
            --background-gradient: radial-gradient(ellipse 120% 80% at 50% -30%, rgba(123, 97, 255, 0.08), transparent),
                                  radial-gradient(ellipse 100% 60% at 80% 80%, rgba(59, 130, 246, 0.05), transparent);
            --card-bg: #ffffff;
            --card-bg-hover: #f8f9fc;
            --text-primary: #1a1a2e;
            --text-secondary: #4a5568;
            --text-muted: #718096;
            --accent: #e2e8f0;
            --accent-hover: #cbd5e0;
            --shadow: rgba(0, 0, 0, 0.08);
            --primary-gradient: linear-gradient(135deg, #7b61ff 0%, #8f4ddb 100%);
            --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
            --border-light: rgba(0, 0, 0, 0.06);
            --scrollbar-track: rgba(0, 0, 0, 0.02);
            --scrollbar-thumb: rgba(0, 0, 0, 0.1);
            --card-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03), var(--shadow-elevation-1);
            --chart-grid: rgba(0, 0, 0, 0.04);
            --chart-overlay: rgba(255, 255, 255, 0.75);
            --zoom-hint-color: rgba(123, 97, 255, 0.15);
            --approve-color: #22c55e;
            --disapprove-color: #ef4444;
            --approve-color-glow: rgba(34, 197, 94, 0.3);
            --disapprove-color-glow: rgba(239, 68, 68, 0.3);
            --favorable-color: #8b5cf6;
            --unfavorable-color: #f59e0b;
            --favorable-color-glow: rgba(139, 92, 246, 0.3);
            --unfavorable-color-glow: rgba(245, 158, 11, 0.3);
            --trump-color: #dc2626;
            --harris-color: #2563eb;
            --vance-color: #b91c1c;
            --newsom-color: #1e3a8a;
            --trump-color-glow: rgba(220, 38, 38, 0.3);
            --harris-color-glow: rgba(37, 99, 235, 0.3);
            --vance-color-glow: rgba(185, 28, 28, 0.3);
            --newsom-color-glow: rgba(30, 58, 138, 0.3);
            --highlight-zoom-border: #7c3aed;
            --highlight-zoom-bg: rgba(124, 58, 237, 0.1);
            --glass-bg: rgba(0, 0, 0, 0.01);
            --glass-border: rgba(0, 0, 0, 0.06);
            --title-static-color: var(--text-primary);
        }
        
        * { 
            box-sizing: border-box; 
            margin: 0; 
            padding: 0; 
        }
        
        body { 
            background-color: var(--background); 
            background-image: var(--background-gradient); 
            background-attachment: fixed;
            color: var(--text-primary); 
            font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
            line-height: 1.6; 
            font-size: 16px; 
            font-weight: 400; 
            min-height: 100vh; 
            overflow-x: hidden; 
            transition: background-color var(--transition-speed) var(--transition-ease), 
                        color var(--transition-speed) var(--transition-ease);
            padding: 20px;
        }

        body.loading {
            overflow: hidden;
            height: 100vh;
        }
        
        @keyframes gradientShift {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }

        .main-title { 
            text-align: center; 
            margin: 30px auto 50px; 
            font-size: 5rem; 
            font-weight: 900; 
            letter-spacing: -0.04em; 
            line-height: 0.9; 
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            max-width: 500px; 
            text-transform: uppercase; 
            font-family: 'Inter', sans-serif; 
            position: relative;
            z-index: 1;
        }
        
        .main-title sup {
            font-size: 1.6rem;
            font-weight: 800;
            margin-left: 8px;
            top: -2.5em; 
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: 0.02em;
            text-shadow: 0 0 20px rgba(123, 97, 255, 0.5);
        }
        
        .main-title::before {
            content: '';
            position: absolute;
            inset: -20px;
            background: radial-gradient(circle at center, var(--primary-gradient) 0%, transparent 70%);
            opacity: 0.1;
            filter: blur(40px);
            z-index: -1;
            animation: pulse 4s ease-in-out infinite;
        }
        
        .title-top { 
            display: flex; 
            align-items: baseline; 
            justify-content: center; 
        }
        
        .title-on { 
            color: var(--text-primary); 
            text-shadow: 0 0 30px rgba(255,255,255,0.2);
            transition: text-shadow 0.3s ease;
        }
        
        .title-on:hover {
            text-shadow: 0 0 40px rgba(255,255,255,0.3);
        }
        
        .light-mode .title-on { 
            color: var(--text-primary); 
            text-shadow: 0 0 30px rgba(0,0,0,0.1);
        }
        
        .title-point { 
            background: linear-gradient(90deg, #0092ff, #00d4ff, #0092ff);
            background-size: 200% 100%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-shadow: none;
            animation: gradientShift 3s ease infinite;
        }
        
        .title-aggregate { 
            background: linear-gradient(90deg, #e42535, #ff3d71, #e42535);
            background-size: 200% 100%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-size: 4.5rem; 
            letter-spacing: -0.01em; 
            margin-top: -3px;
            animation: gradientShift 3s ease infinite;
        }
        
        h1 { 
            font-size: 2.75rem; 
            font-weight: 700; 
            margin: 15px 0; 
            letter-spacing: -0.025em; 
            text-shadow: none;
            position: relative;
            display: flex;
            align-items: baseline; 
            justify-content: center;
            flex-wrap: wrap;
        }

        #poll-title .title-text {
            color: var(--title-static-color);
        }
        

        #poll-title .word-cycler {
            display: inline-block;
            position: relative;
            width: 180px;
            text-align: center;
            margin: 0 8px;
            height: 1.1em;
        }

        #poll-title .word-cycler.inline-flex {
            display: inline-flex;
            align-items: baseline;
            width: auto;
            height: auto;
        }

        #poll-title .word-cycler.inline-flex .vs {
            margin: 0 4px;
            font-weight: 700;
        }


      


        .animate-word { 
            display: inline-block;
            font-weight: 700;
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            opacity: 0;
        }
        
        .animate-word.pop-in {
            transform: translateY(20px);
            transition: opacity 0.0s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .animate-word.fade-in {
            transition: opacity 0.4s ease-in-out;
            transform: translateY(0);
        }

        .animate-word.visible {
            opacity: 1;
            transform: translateY(0);
        }

        /* Inline variant for titles that show multiple words simultaneously */
        .animate-word.inline {
            position: static;
            width: auto;
        }
        
        .animate-word.approve { color: var(--approve-color); }
        .animate-word.disapprove { color: var(--disapprove-color); }
        .animate-word.favorable { color: var(--favorable-color); }
        .animate-word.unfavorable { color: var(--unfavorable-color); }
        .animate-word.trump { color: var(--trump-color); }
        .animate-word.republican { color: var(--trump-color); }
        .animate-word.harris { color: var(--harris-color); }
        .animate-word.democrat { color: var(--harris-color); }
        .animate-word.vance { color: var(--vance-color); }
        .animate-word.newsom { color: var(--newsom-color); }

        .selectors-wrapper { 
            display: flex; 
            justify-content: center; 
            align-items: stretch; 
            margin-bottom: 20px; 
            gap: 0;
            position: relative;
            z-index: 20; 
        }
        
        .dropdown-container { 
            position: relative; 
            width: 100%; 
            max-width: 320px; 
        }
        
        .dropdown-selected { 
            display: flex; 
            align-items: center; 
            justify-content: space-between; 
            padding: 0 20px;
            height: 54px;
            background: var(--glass-bg); 
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border); 
            border-radius: var(--border-radius); 
            color: var(--text-primary); 
            font-weight: 500; 
            font-size: 1rem; 
            cursor: pointer; 
            transition: all var(--transition-speed) var(--transition-ease); 
            box-shadow: var(--shadow-elevation-1);
            position: relative;
            overflow: hidden;
        }
        
        .dropdown-selected::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--primary-gradient);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .dropdown-selected:hover::before {
            opacity: 0.05;
        }
        
        .dropdown-selected:hover { 
            transform: translateY(-2px); 
            box-shadow: var(--shadow-elevation-2);
            border-color: rgba(123, 97, 255, 0.2);
        }
        
        .dropdown-selected.active { 
            border-radius: var(--border-radius) var(--border-radius) 0 0; 
            box-shadow: var(--shadow-elevation-3);
            border-color: rgba(123, 97, 255, 0.3);
        }
        
        .dropdown-options { 
            position: absolute; 
            top: 100%; 
            left: 0; 
            right: 0; 
            background: var(--card-bg); 
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border); 
            border-top: none; 
            border-radius: 0 0 var(--border-radius) var(--border-radius); 
            overflow: hidden; 
            z-index: 1000; 
            max-height: 0; 
            opacity: 0; 
            transition: max-height 0.4s var(--transition-ease), 
                        opacity 0.3s var(--transition-ease); 
            box-shadow: var(--shadow-elevation-3);
        }
        
        .dropdown-options.active { 
            max-height: 400px; 
            opacity: 1; 
            overflow-y: auto; 
        }
        
        .dropdown-option { 
            padding: 14px 20px; 
            cursor: pointer; 
            transition: all 0.2s ease; 
            display: flex; 
            align-items: center; 
            gap: 12px; 
            position: relative;
            overflow: hidden;
        }
        
        .dropdown-option::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--primary-gradient);
            opacity: 0;
            transform: translateX(-100%);
            transition: all 0.3s ease;
        }
        
        .dropdown-option:hover::before {
            opacity: 0.08;
            transform: translateX(0);
        }
        
        .dropdown-option:hover { 
            background: var(--card-bg-hover); 
            padding-left: 24px;
        }
        
        .dropdown-option.selected { 
            background: var(--primary-gradient); 
            color: #ffffff;
        }
        
        .dropdown-option.selected::before {
            display: none;
        }

        .dropdown-option.coming-soon {
            color: var(--text-muted);
            cursor: not-allowed;
        }

        .dropdown-option.coming-soon:hover {
            background: none;
            padding-left: 20px;
        }

        .dropdown-option.coming-soon::before {
            display: none;
        }
        
        .card { 
            background: var(--card-bg); 
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: var(--border-radius); 
            border: 1px solid var(--glass-border); 
            box-shadow: var(--card-shadow); 
            padding: 30px; 
            position: relative; 
            transition: all var(--transition-speed) var(--transition-ease); 
            overflow: hidden;
        }
        
        .card::before { 
            content: ''; 
            position: absolute; 
            top: 0; 
            left: 0; 
            right: 0; 
            height: 3px; 
            background: var(--primary-gradient); 
            opacity: 0.8; 
            transition: all 0.4s ease;
            transform: scaleX(0);
            transform-origin: left;
        }
        
        .card:hover::before { 
            transform: scaleX(1);
        }
        
        .card:hover { 
            transform: translateY(-4px);
            box-shadow: var(--shadow-elevation-3);
            border-color: rgba(123, 97, 255, 0.1);
        }
        
        ::-webkit-scrollbar { 
            width: 10px; 
            height: 10px; 
        }
        
        ::-webkit-scrollbar-track { 
            background: var(--scrollbar-track); 
            border-radius: 5px; 
        }
        
        ::-webkit-scrollbar-thumb { 
            background: var(--scrollbar-thumb); 
            border-radius: 5px;
            transition: background 0.3s ease;
        }
        
        ::-webkit-scrollbar-thumb:hover { 
            background: rgba(123, 97, 255, 0.3); 
        }
        
        header { 
            text-align: center; 
            margin-bottom: 40px; 
            padding-top: 10px; 
        }

        /* Articles Navigation */
        .header-top-nav {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
            padding: 0 20px;
        }

        .articles-nav-btn {
            position: relative;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 12px 24px;
            color: var(--text-secondary);
            font-weight: 500;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.4s var(--transition-ease);
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: var(--shadow-elevation-1);
            overflow: hidden;
            font-family: 'Inter', sans-serif;
        }

        .articles-nav-btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--primary-gradient);
            opacity: 0;
            transition: opacity 0.4s ease;
            z-index: 1;
        }

        .articles-nav-btn:hover::before {
            opacity: 0.1;
        }

        .articles-nav-btn:hover {
            transform: translateY(-2px) scale(1.01);
            box-shadow: var(--shadow-elevation-2);
            border-color: rgba(123, 97, 255, 0.2);
            color: var(--text-primary);
        }

        .articles-nav-btn i {
            position: relative;
            z-index: 2;
            transition: all 0.3s ease;
        }

        .articles-nav-btn span {
            position: relative;
            z-index: 2;
            letter-spacing: 0.02em;
        }

        .articles-nav-btn:hover i {
            transform: rotate(15deg) scale(1.1);
        }

        .btn-glow {
            position: absolute;
            inset: -2px;
            background: var(--primary-gradient);
            border-radius: var(--border-radius);
            opacity: 0;
            filter: blur(8px);
            transition: opacity 0.4s ease;
            z-index: 0;
        }

        .articles-nav-btn:hover .btn-glow {
            opacity: 0.3;
        }

        
        .container { 
            max-width: 1400px; 
            margin: 0 auto; 
            padding: 0 15px; 
        }
        
        .theme-toggle-container { 
            position: fixed; 
            top: 20px; 
            right: 20px; 
            z-index: 999; 
            display: flex; 
            align-items: center; 
            gap: 8px; 
            background: var(--glass-bg); 
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: 30px; 
            padding: 8px 12px; 
            box-shadow: var(--shadow-elevation-2); 
            border: 1px solid var(--glass-border);
            transition: all 0.3s ease;
        }
        
        .theme-toggle-container:hover {
            box-shadow: var(--shadow-elevation-3);
            transform: translateY(-2px);
        }
        
        .theme-toggle { 
            position: relative; 
            width: 56px; 
            height: 28px; 
            cursor: pointer; 
        }
        
        .theme-toggle input { 
            opacity: 0; 
            width: 0; 
            height: 0; 
        }
        
        .theme-toggle .slider { 
            position: absolute; 
            top: 0; 
            left: 0; 
            right: 0; 
            bottom: 0; 
            background: var(--accent); 
            border-radius: 28px; 
            transition: all 0.4s var(--transition-ease);
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .theme-toggle .slider:before { 
            position: absolute; 
            content: ""; 
            height: 20px; 
            width: 20px; 
            left: 4px; 
            bottom: 4px; 
            background: white; 
            border-radius: 50%; 
            transition: all 0.4s var(--transition-ease);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .theme-toggle input:checked + .slider { 
            background: var(--primary-gradient);
        }
        
        .theme-toggle input:checked + .slider:before { 
            transform: translateX(28px); 
        }
        
        .theme-icon { 
            font-size: 14px; 
            color: var(--text-secondary);
            transition: color 0.3s ease;
            cursor: pointer;
            padding: 4px;
            border-radius: 50%;
            transition: all 0.3s ease;
        }
        
        .theme-icon:hover {
            background: var(--accent);
        }
        
        .theme-toggle-container:hover .theme-icon {
            color: var(--text-primary);
        }
        
        .dropdown-icon { 
            transition: transform 0.3s var(--transition-ease); 
        }
        
        .dropdown-selected.active .dropdown-icon { 
            transform: rotate(180deg); 
        }
        
        .dropdown-option-header { 
            padding: 12px 20px 8px; 
            font-size: 0.75rem; 
            font-weight: 700; 
            color: var(--text-muted); 
            text-transform: uppercase; 
            letter-spacing: 0.08em; 
            background: var(--glass-bg);
            backdrop-filter: blur(5px);
            border-bottom: 1px solid var(--border-light); 
            border-top: 1px solid var(--border-light); 
            margin-top: -1px;
        }
        
        .dropdown-option-header:first-child { 
            border-top: none; 
            margin-top: 0; 
        }
        
        .option-icon { 
            color: var(--text-secondary); 
            width: 20px; 
            text-align: center;
            transition: all 0.3s ease;
        }
        
        .dropdown-option:hover .option-icon {
            color: var(--text-primary);
            transform: scale(1.1);
        }
        
        .option-badge { 
            margin-left: auto; 
            font-size: 0.75rem; 
            font-weight: 600; 
            background: var(--glass-bg);
            backdrop-filter: blur(5px);
            padding: 4px 10px; 
            border-radius: 12px;
            border: 1px solid var(--glass-border);
            transition: all 0.3s ease;
        }
        
        .dropdown-option:hover .option-badge {
            transform: scale(1.05);
        }
        
        .term-selector { 
            display: flex; 
            align-items: center; 
            gap: 12px; 
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: 20px; 
            padding: 6px 20px; 
            box-shadow: var(--shadow-elevation-1);
            border: 1px solid var(--glass-border);
            transition: all var(--transition-speed) var(--transition-ease);
        }
        
        .term-selector:hover {
            box-shadow: var(--shadow-elevation-2);
            transform: translateY(-2px);
        }
        
        .term-label { 
            font-size: 0.95rem; 
            color: var(--text-primary);
            font-weight: 500;
        }
        
        .term-options { 
            display: flex; 
            gap: 8px; 
        }
        
        .term-option { 
            padding: 8px 18px; 
            border-radius: 14px; 
            cursor: pointer; 
            font-size: 0.9rem; 
            font-weight: 500; 
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        
        .term-option::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--primary-gradient);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .term-option:hover::before {
            opacity: 0.1;
        }
        
        .term-option:hover { 
            transform: translateY(-1px);
        }
        
        .term-option.selected { 
            background: var(--primary-gradient);
            box-shadow: 0 4px 12px rgba(123, 97, 255, 0.4);
            color: white !important;
        }
        
        .term-option.selected::before {
            display: none;
        }
        
        .filter-container { 
            display: flex; 
            gap: 24px; 
            margin: 0 auto 40px; 
            max-width: 900px; 
            align-items: flex-end;
            justify-content: center; 
            flex-wrap: wrap; 
            position: relative;
            z-index: 10;
        }
        
        .pollster-filter { 
            position: relative; 
            flex: 1; 
            min-width: 250px; 
            max-width: 350px; 
            z-index: 2500; /* raise stacking for dropdown */
        }
        
        .filter-label { 
            font-size: 0.85rem; 
            margin-bottom: 8px; 
            color: var(--text-secondary);
            font-weight: 500;
            letter-spacing: 0.02em;
            text-align: left;
        }
        
        .pollster-dropdown { 
            width: 100%; 
            max-width: 100%; 
            margin: 0; 
        }
        
        .pollster-dropdown .dropdown-options {
            max-height: 300px;
            z-index: 3000; /* keep above other UI */
        }

        /* Rollout overlay GUI */
        .rollout-overlay {
            position: fixed;
            inset: 0;
            background: rgba(10,10,15,0.75);
            backdrop-filter: blur(16px) saturate(140%);
            -webkit-backdrop-filter: blur(16px) saturate(140%);
            z-index: 5000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }

        .rollout-overlay.active { display: flex; }

        .rollout-modal {
            width: min(900px, 95vw);
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--glass-border);
            border-radius: 18px;
            box-shadow: 0 20px 80px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.04);
            padding: 22px 22px 18px;
            color: var(--text-primary);
        }

        .rollout-title {
            font-weight: 800;
            font-size: 1.3rem;
            letter-spacing: -0.02em;
            margin: 4px 6px 14px;
            text-align: center;
        }

        .rollout-player {
            position: relative;
            border-radius: 14px;
            overflow: hidden;
            background: #000;
            border: 1px solid var(--glass-border);
        }

        .rollout-player iframe {
            display: block;
            width: 100%;
            height: min(68vh, 720px);
            border: 0;
        }

        .rollout-summary {
            margin: 14px 6px 16px;
            color: var(--text-secondary);
            text-align: center;
            line-height: 1.6;
            font-size: 0.98rem;
        }

        .rollout-actions { display: flex; justify-content: center; }

        .rollout-btn {
            background: var(--glass-bg);
            color: var(--text-primary);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 10px 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.25s ease;
        }

        .rollout-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-elevation-2); border-color: rgba(123,97,255,0.25); }
        
        .reset-filters { 
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            color: var(--text-primary); 
            border: 1px solid var(--glass-border);
            padding: 0 24px;
            height: 54px;
            border-radius: var(--border-radius); 
            cursor: pointer; 
            font-weight: 500; 
            transition: all var(--transition-speed) var(--transition-ease); 
            display: flex; 
            align-items: center; 
            gap: 10px; 
            box-shadow: var(--shadow-elevation-1);
            position: relative;
            overflow: hidden;
        }
        
        .reset-filters::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--primary-gradient);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .reset-filters:hover::before {
            opacity: 0.1;
        }
        
        .reset-filters:hover { 
            transform: translateY(-2px); 
            box-shadow: var(--shadow-elevation-2);
            border-color: rgba(123, 97, 255, 0.2);
        }
        
        .reset-filters i { 
            font-size: 0.9rem;
            transition: transform 0.3s ease;
        }
        
        .reset-filters:hover i {
            transform: rotate(180deg);
        }
        
        .filtered-mode-indicator { 
            background: var(--primary-gradient); 
            color: white;
            padding: 8px 16px; 
            border-radius: 24px; 
            font-weight: 600; 
            font-size: 0.85rem; 
            margin-top: 10px; 
            display: inline-flex; 
            align-items: center; 
            gap: 10px; 
            box-shadow: 0 4px 12px rgba(123, 97, 255, 0.3);
            opacity: 0; 
            transform: translateY(10px) scale(0.9); 
            transition: all 0.4s var(--transition-ease); 
            pointer-events: none; 
        }
        
        .filtered-mode-indicator.active { 
            opacity: 1; 
            transform: translateY(0) scale(1); 
        }
        
        .search-container { 
            position: relative; 
            max-width: 650px; 
            width: 100%; 
            margin: 0 auto 30px;
            z-index: 10;
        }
        
        .search-input { 
            width: 100%; 
            height: 58px;
            padding: 16px 24px 16px 56px; 
            background: var(--glass-bg);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1.5px solid var(--glass-border); 
            border-radius: var(--border-radius); 
            color: var(--text-primary); 
            font-weight: 500; 
            font-size: 1rem; 
            transition: all var(--transition-speed) var(--transition-ease); 
            box-shadow: var(--shadow-elevation-1);
            cursor: text;
        }
        
        .search-input::placeholder {
            color: var(--text-muted);
        }
        
        .search-input:focus { 
            outline: none; 
            border-color: rgba(123, 97, 255, 0.5);
            box-shadow: 0 0 0 4px rgba(123, 97, 255, 0.12), var(--shadow-elevation-2);
            transform: translateY(-3px);
            background: rgba(255, 255, 255, 0.03);
        }

        .search-input:focus-visible {
            outline: 2px solid rgba(123, 97, 255, 0.6);
            outline-offset: 2px;
        }

        .suggestion-item:focus {
            outline: none;
            background: rgba(123, 97, 255, 0.08);
            border-left: 3px solid rgba(123, 97, 255, 0.4);
            padding-left: 21px;
            transform: translateX(2px);
        }

        .suggestion-item:focus-visible {
            outline: 2px solid rgba(123, 97, 255, 0.6);
            outline-offset: -2px;
        }

        .search-input:hover:not(:focus) {
            border-color: rgba(255, 255, 255, 0.15);
            transform: translateY(-1px);
        }
        

        .search-icon {
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            pointer-events: none;
            transition: all 0.3s ease;
            font-size: 1.1rem;
        }
        
        .search-input:focus ~ .search-icon {
            color: #7b61ff;
            transform: scale(1.1);
            filter: drop-shadow(0 0 8px rgba(123, 97, 255, 0.4));
        }

        /* Enhanced search container focus state */
        .search-container:focus-within {
            transform: translateY(-2px);
        }

        .search-container:focus-within .search-input {
            border-color: rgba(123, 97, 255, 0.6);
            box-shadow: 
                0 0 0 4px rgba(123, 97, 255, 0.15), 
                0 8px 32px rgba(123, 97, 255, 0.1),
                var(--shadow-elevation-2);
        }
        
        .clear-search { 
            position: absolute; 
            right: 20px; 
            top: 50%; 
            transform: translateY(-50%); 
            color: var(--text-muted); 
            background: none; 
            border: none; 
            cursor: pointer; 
            padding: 8px; 
            font-size: 1rem; 
            transition: all 0.3s ease;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: none;
            align-items: center;
            justify-content: center;
        }

        .clear-search.visible {
            display: flex;
        }
        
        .clear-search:hover { 
            color: var(--text-primary);
            background: var(--accent);
        }
        
        .search-help { 
            color: var(--text-muted); 
            font-size: 0.85rem; 
            margin-top: 12px; 
            display: flex; 
            justify-content: center;
            gap: 12px; 
            flex-wrap: wrap; 
            transition: all 0.3s ease;
        }

        .search-container:focus-within .search-help {
            opacity: 0;
            transform: translateY(-10px);
            pointer-events: none;
        }

        .search-suggestions {
            position: absolute;
            top: 58px;
            left: 0;
            right: 0;
            background: var(--glass-bg);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1.5px solid var(--glass-border);
            border-top: none;
            border-radius: 0 0 var(--border-radius) var(--border-radius);
            z-index: 98;
            max-height: 0;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            opacity: 0;
            transform: translateY(-8px);
            box-shadow: 
                0 0 0 1px rgba(123, 97, 255, 0.1),
                0 8px 32px rgba(0, 0, 0, 0.12);
        }

        .search-suggestions.hiding {
            animation: collapseUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }

        @keyframes collapseUp {
            0% {
                max-height: 140px;
                opacity: 1;
                transform: translateY(0) scaleY(1);
            }
            40% {
                opacity: 0.3;
                transform: translateY(-4px) scaleY(0.95);
            }
            100% {
                max-height: 0;
                opacity: 0;
                transform: translateY(-8px) scaleY(0.8);
            }
        }

        .search-suggestions.visible {
            max-height: 140px;
            opacity: 1;
            transform: translateY(0);
            animation: expandDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }

        @keyframes expandDown {
            0% {
                max-height: 0;
                opacity: 0;
                transform: translateY(-8px) scaleY(0.8);
                transform-origin: top;
            }
            60% {
                opacity: 0.7;
                transform: translateY(-2px) scaleY(0.95);
            }
            100% {
                max-height: 140px;
                opacity: 1;
                transform: translateY(0) scaleY(1);
            }
        }

        /* Enhanced search input when suggestions are active */
        .search-container.suggestions-active .search-input {
            border-radius: var(--border-radius) var(--border-radius) 0 0;
            border-bottom-color: transparent;
            border-color: rgba(123, 97, 255, 0.4);
            box-shadow: 
                0 0 0 1px rgba(123, 97, 255, 0.2),
                0 4px 20px rgba(123, 97, 255, 0.1);
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            background: rgba(255, 255, 255, 0.04);
            transform: translateY(0);
            animation: searchInputExpand 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }

        @keyframes searchInputExpand {
            0% {
                border-radius: var(--border-radius);
                border-bottom-color: var(--glass-border);
            }
            50% {
                border-radius: var(--border-radius) var(--border-radius) calc(var(--border-radius) * 0.5) calc(var(--border-radius) * 0.5);
                border-bottom-color: rgba(123, 97, 255, 0.2);
            }
            100% {
                border-radius: var(--border-radius) var(--border-radius) 0 0;
                border-bottom-color: transparent;
            }
        }

        .search-container.suggestions-active {
            z-index: 99;
            transform: translateY(-1px);
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .search-container.suggestions-active::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            height: calc(58px + 4px);
            background: linear-gradient(135deg, rgba(123, 97, 255, 0.1), rgba(123, 97, 255, 0.05));
            border-radius: calc(var(--border-radius) + 2px) calc(var(--border-radius) + 2px) 0 0;
            z-index: -1;
            opacity: 0;
            animation: connectionGlow 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }

        @keyframes connectionGlow {
            0% {
                opacity: 0;
                transform: scale(0.98);
            }
            50% {
                opacity: 0.6;
                transform: scale(1.01);
            }
            100% {
                opacity: 0.3;
                transform: scale(1);
            }
        }

        .suggestion-header {
            display: none;
        }

        .suggestions-list {
            padding: 0;
        }

        .suggestion-item {
            padding: 12px 24px;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: relative;
            color: var(--text-secondary);
            background: rgba(255, 255, 255, 0.01);
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            opacity: 0;
            transform: translateY(12px);
            animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }

        .suggestion-item:nth-child(1) { animation-delay: 0.05s; }
        .suggestion-item:nth-child(2) { animation-delay: 0.1s; }
        .suggestion-item:last-child { border-bottom: none; }

        @keyframes slideUp {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .suggestion-item:hover {
            color: var(--text-primary);
            background: rgba(123, 97, 255, 0.08);
            transform: translateY(0) translateX(2px);
            border-left: 3px solid rgba(123, 97, 255, 0.4);
            padding-left: 21px;
        }

        .suggestion-item:last-child {
            border-bottom: none;
        }

        .suggestion-item.selected {
            color: var(--text-primary);
            background: rgba(123, 97, 255, 0.12);
            transform: translateY(0) translateX(2px);
            border-left: 3px solid rgba(123, 97, 255, 0.6);
            padding-left: 21px;
            box-shadow: 
                inset 0 0 0 1px rgba(123, 97, 255, 0.2),
                0 2px 8px rgba(123, 97, 255, 0.15);
        }

        .suggestion-item.selected .suggestion-query {
            color: var(--text-primary);
            opacity: 1;
            transform: translateX(2px);
            font-weight: 500;
        }

        .suggestion-item.selected .suggestion-shortcut {
            background: rgba(123, 97, 255, 0.2);
            color: var(--text-primary);
            transform: scale(1.05);
            opacity: 1;
        }

        .suggestion-title {
            font-weight: 500;
            font-size: 0.85rem;
            line-height: 1.3;
            margin: 0;
        }

        .suggestion-shortcut {
            font-size: 0.7rem;
            color: var(--text-muted);
            background: var(--glass-bg);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
            min-width: 18px;
            text-align: center;
            border: 1px solid var(--border-light);
        }
            flex-direction: column;
            gap: 4px;
            position: relative;
            z-index: 2;
        }

        .suggestion-title {
            font-weight: 500;
            font-size: 0.92rem;
            color: var(--text-primary);
            line-height: 1.3;
            margin: 0;
            transition: color 0.2s ease;
        }

        .suggestion-query {
            font-size: 0.8rem;
            color: var(--text-muted);
            line-height: 1.4;
            opacity: 0.8;
            font-weight: 400;
            font-family: 'SF Mono', Monaco, 'Inconsolata', 'Fira Code', 'Droid Sans Mono', monospace;
            transition: all 0.2s ease;
        }

        .suggestion-item:hover .suggestion-query {
            opacity: 1;
            color: var(--text-secondary);
            transform: translateX(2px);
        }

        .suggestion-item:hover .suggestion-shortcut {
            opacity: 1;
            background: rgba(123, 97, 255, 0.15);
            transform: scale(1.05);
        }

        .suggestion-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 2px;
            position: relative;
            z-index: 2;
        }

        .suggestion-shortcut {
            font-size: 0.7rem;
            color: var(--text-muted);
            background: var(--glass-bg);
            backdrop-filter: blur(4px);
            padding: 3px 8px;
            border-radius: 6px;
            border: 1px solid var(--border-light);
            font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
            font-weight: 500;
            opacity: 0.6;
            transition: all 0.2s ease;
            letter-spacing: 0.02em;
        }

        .suggestion-item:hover .suggestion-shortcut {
            opacity: 1;
            background: var(--accent);
            border-color: var(--glass-border);
        }


        .suggestion-item.selected {
            background: var(--glass-bg);
            color: var(--text-primary);
            transform: translateX(4px);
        }

        .suggestion-item.selected::before {
            transform: scaleY(1);
        }

        .suggestion-item.selected::after {
            opacity: 1;
        }

        .suggestion-item.selected .suggestion-indicator {
            background: var(--text-primary);
            opacity: 1;
            transform: scale(1.2);
        }

        .suggestion-item.selected .suggestion-query {
            opacity: 1;
            color: var(--text-secondary);
        }

        .suggestion-item.selected .suggestion-shortcut {
            opacity: 1;
            background: var(--accent);
            border-color: var(--glass-border);
        }


        /* Custom scrollbar for suggestions */
        .suggestions-list::-webkit-scrollbar {
            width: 4px;
        }

        .suggestions-list::-webkit-scrollbar-track {
            background: transparent;
        }

        .suggestions-list::-webkit-scrollbar-thumb {
            background: var(--glass-border);
            border-radius: 2px;
            transition: background 0.2s ease;
        }

        .suggestions-list::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        .suggestions-empty {
            padding: 32px 24px;
            text-align: center;
            color: var(--text-muted);
            font-size: 0.85rem;
            opacity: 0.6;
            font-weight: 400;
        }

        .suggestion-icon {
            width: 24px;
            height: 24px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            background: var(--primary-gradient);
            color: white;
            flex-shrink: 0;
        }

        .suggestion-content {
            flex: 1;
        }

        .suggestion-title {
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 2px;
        }

        .suggestion-query {
            font-size: 0.8rem;
            color: var(--text-muted);
            font-family: 'SF Mono', Monaco, 'Inconsolata', 'Fira Code', 'Droid Sans Mono', monospace;
        }

        .suggestion-shortcut {
            font-size: 0.75rem;
            color: var(--text-muted);
            background: var(--glass-bg);
            padding: 2px 6px;
            border-radius: 4px;
            border: 1px solid var(--glass-border);
        }
        
        .search-tag { 
            background: var(--glass-bg);
            backdrop-filter: blur(8px);
            padding: 6px 14px; 
            border-radius: 16px; 
            transition: all 0.3s ease; 
            cursor: pointer; 
            border: 1px solid var(--glass-border);
            font-weight: 500;
            font-size: 0.8rem;
            user-select: none;
        }
        
        .search-tag:hover { 
            background: var(--primary-gradient);
            color: white;
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 6px 12px rgba(123, 97, 255, 0.25);
            border-color: transparent;
        }

        .search-tag:active {
            transform: translateY(-1px) scale(1.02);
        }
        
        .date-display { 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            font-size: 1.15rem; 
            color: var(--text-secondary); 
            margin-top: 10px;
            font-weight: 500;
            letter-spacing: 0.02em;
        }
        
        .chart-container { 
            margin-bottom: 50px; 
        }
        
        .card-header { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            margin-bottom: 24px; 
        }
        
        .card-title { 
            font-size: 1.5rem; 
            font-weight: 600; 
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        #pollChart {
            position: relative;
            width: 100%;
            height: 450px;
            margin: 20px 0 30px;
            border-radius: 12px;
            overflow: hidden;
            background: var(--glass-bg);
            cursor: crosshair;
            touch-action: none;
        }
        
        #chartCanvas, #overlayCanvas, #fadeCanvas { 
            position: absolute; 
            top: 0; 
            left: 0; 
            width: 100%; 
            height: 100%; 
        }

        #chartCanvas { z-index: 5; }
        #fadeCanvas { z-index: 10; pointer-events: none; }
        #overlayCanvas { z-index: 15; pointer-events: none; }
        
        #pollTooltip { 
            position: absolute; 
            background: var(--chart-overlay); 
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: var(--text-primary); 
            padding: 16px 20px; 
            border-radius: 12px; 
            font-size: 0.95rem; 
            pointer-events: none; 
            display: none; 
            z-index: 1020;
            box-shadow: var(--shadow-elevation-3);
            border: 1px solid var(--glass-border);
            font-weight: 500; 
            line-height: 1.7; 
            max-width: 280px;
            animation: tooltipFadeIn 0.3s ease;
        }
        
        @keyframes tooltipFadeIn {
            from { opacity: 0; transform: scale(0.9); }
            to { opacity: 1; transform: scale(1); }
        }
        
        #emptyState { 
            position: absolute; 
            top: 50%; 
            left: 50%; 
            transform: translate(-50%, -50%); 
            text-align: center; 
            color: var(--text-secondary); 
            display: none; 
            flex-direction: column; 
            align-items: center; 
            gap: 20px;
            animation: fadeIn 0.5s ease;
            z-index: 1;
        }
        
        #emptyState i {
            font-size: 4rem;
            opacity: 0.2;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translate(-50%, -45%); }
            to { opacity: 1; transform: translate(-50%, -50%); }
        }
        
        #hoverOverlayElements { 
            position: absolute; 
            top: 0; 
            left: 0; 
            width: 100%; 
            height: 100%; 
            pointer-events: none; 
            z-index: 60; 
            opacity: 0; 
            transition: opacity 0.2s ease; 
        }
        
        #hoverOverlayElements.active { 
            opacity: 1; 
        }
        
        .hover-info-top-container { 
            position: absolute; 
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            gap: 8px; 
            will-change: transform;
        }
        
        .hover-info-top-item {
            padding: 8px 16px;
            border-radius: 10px;
            font-weight: 600;
            white-space: nowrap;
            background: var(--chart-overlay);
            opacity: 0.5;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: var(--text-primary);
            font-size: 0.9rem;
            border: 1px solid var(--glass-border);
            box-shadow: var(--shadow-elevation-2);
        }
        
        #hoverInfoSpread .spread-label-text { 
            margin-right: 8px; 
        }
        
        #hoverInfoSpread .spread-value {
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 14px;
            background: var(--chart-overlay);
            opacity: 0.5;
            color: white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }
        
        .hover-value-circle { 
            position: absolute; 
            border-radius: 50%; 
            border: 2px solid var(--background);
            box-shadow: 0 0 0 2px currentColor, var(--shadow-elevation-2);
            will-change: left, top;
            animation: pulseCircle 2s ease-in-out infinite;
            z-index: 20;
        }
        
        @keyframes pulseCircle {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }
        

        .hover-value-label {
            position: absolute;
            font-size: 0.85rem;
            font-weight: 700;
            padding: 6px 12px;
            border-radius: 8px;
            background: var(--chart-overlay);
            opacity: 0.5;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            white-space: nowrap;
            border: 1px solid var(--glass-border);
            box-shadow: var(--shadow-elevation-1);

            pointer-events: none;
            will-change: left, top;
            z-index: 20;
        }
        
        #highlightZoomRect { 
            position: absolute; 
            border: 2px solid rgba(59, 130, 246, 0.6);
            background-color: rgba(59, 130, 246, 0.1);
            pointer-events: none; 
            z-index: 25; 
            display: none; 
            box-shadow: 
                0 0 20px rgba(59, 130, 246, 0.3),
                inset 0 0 20px rgba(59, 130, 246, 0.1);
            border-radius: 4px;
            backdrop-filter: blur(2px);
            transition: all 0.1s ease-out;
        }
        
        #highlightZoomRect.valid {
            border-color: rgba(34, 197, 94, 0.6);
            background-color: rgba(34, 197, 94, 0.1);
            box-shadow: 
                0 0 20px rgba(34, 197, 94, 0.3),
                inset 0 0 20px rgba(34, 197, 94, 0.1);
        }
        
        #highlightZoomRect.invalid {
            border-color: rgba(239, 68, 68, 0.6);
            background-color: rgba(239, 68, 68, 0.1);
            box-shadow: 
                0 0 20px rgba(239, 68, 68, 0.3),
                inset 0 0 20px rgba(239, 68, 68, 0.1);
        }
        
        .controls { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            flex-wrap: wrap; 
            gap: 20px; 
            padding-top: 20px; 
            border-top: 1px solid var(--border-light); 
        }
        
        .toggle-group { 
            display: flex; 
            flex-wrap: wrap; 
            gap: 24px; 
            align-items: center; 
        }
        
        .zoom-controls { 
            display: flex; 
            gap: 12px; 
            align-items: center; 
        }
        
        .toggle { 
            display: flex; 
            align-items: center; 
            gap: 10px; 
            user-select: none; 
            cursor: pointer; 
            transition: color var(--transition-speed) ease;
            font-weight: 500;
        }
        
        .toggle:hover { 
            color: var(--text-primary); 
        }
        
        .toggle input[type="range"] {
             -webkit-appearance: none; appearance: none; width: 100px; height: 6px; background: var(--accent); border-radius: 3px; outline: none; transition: background 0.3s;
        }
        .toggle input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; background: #fff; cursor: pointer; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
        .toggle input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; background: #fff; cursor: pointer; border-radius: 50%; border: none; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
        .light-mode .toggle input[type="range"] { background: var(--accent); }

        .toggle input[type="checkbox"] { 
            position: relative; 
            width: 44px; 
            height: 24px; 
            appearance: none; 
            background: var(--accent);
            border-radius: 24px; 
            transition: all var(--transition-speed) ease; 
            cursor: pointer; 
            margin: 0;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .toggle input[type="checkbox"]:checked { 
            background: var(--primary-gradient);
        }
        
        .toggle input[type="checkbox"]::before { 
            content: ''; 
            position: absolute; 
            width: 18px; 
            height: 18px; 
            border-radius: 50%; 
            top: 3px; 
            left: 3px; 
            background: white; 
            transition: all var(--transition-speed) var(--transition-ease);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .toggle input[type="checkbox"]:checked::before { 
            left: 23px; 
        }
        
        .zoom-btn { 
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            color: var(--text-primary); 
            width: 40px; 
            height: 40px; 
            border-radius: 12px; 
            cursor: pointer; 
            transition: all var(--transition-speed) var(--transition-ease); 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            font-size: 0.9rem; 
            position: relative; 
            overflow: hidden;
            box-shadow: var(--shadow-elevation-1);
        }
        
        .zoom-btn::before { 
            content: ''; 
            position: absolute; 
            inset: 0;
            background: var(--primary-gradient);
            opacity: 0; 
            transition: opacity 0.3s ease;
        }
        
        .zoom-btn:hover::before { 
            opacity: 0.1; 
        }
        
        .zoom-btn:hover { 
            transform: translateY(-2px) scale(1.05); 
            box-shadow: var(--shadow-elevation-2);
            border-color: rgba(123, 97, 255, 0.2);
        }
        
        .zoom-btn:active { 
            transform: translateY(0) scale(0.98); 
        }
        
        .zoom-btn.max-zoom { 
            animation: shake 0.4s ease-in-out;
            background: rgba(255, 61, 113, 0.1);
            border-color: rgba(255, 61, 113, 0.3);
        }
        
        @keyframes shake { 
            0%, 100% { transform: translateX(0); } 
            25% { transform: translateX(-4px) rotate(-5deg); } 
            75% { transform: translateX(4px) rotate(5deg); } 
        }
        
        #yRangeDisplay { 
            background: var(--glass-bg);
            backdrop-filter: blur(5px);
            padding: 8px 16px; 
            border-radius: 10px; 
            font-size: 0.9rem; 
            font-weight: 600;
            color: var(--text-primary);
            border: 1px solid var(--glass-border);
            box-shadow: var(--shadow-elevation-1);
        }
        
        .poll-list-container { 
            margin-bottom: 40px; 
        }
        
        .section-title { 
            display: flex; 
            align-items: center; 
            gap: 12px; 
            font-size: 1.5rem; 
            margin-bottom: 25px; 
            font-weight: 600;
            color: var(--text-primary);
        }
        
        .section-title i { 
            color: var(--text-secondary); 
            opacity: 0.8;
            transition: all 0.3s ease;
        }
        
        .card:hover .section-title i {
            color: var(--text-primary);
            transform: rotate(360deg);
        }
        
        .poll-list-header { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            margin-bottom: 20px; 
            flex-wrap: wrap; 
            gap: 15px; 
        }
        
        .poll-list-table { 
            width: 100%; 
            border-collapse: collapse;
            color: var(--text-primary); 
            border-radius: var(--border-radius);
            overflow: hidden;
            box-shadow: var(--shadow-elevation-1);
        }
        
        .poll-list-table th, 
        .poll-list-table td { 
            padding: 18px 20px; 
            text-align: left; 
            vertical-align: middle;
            border-bottom: 1px solid var(--border-light); 
        }

        .poll-list-table td:last-child {
            font-size: 0.8rem;
            opacity: 0.7;
            text-align: right;
        }
        .poll-list-table th:last-child {
            text-align: right;
        }

        .poll-list-table th { 
            font-weight: 600; 
            position: sticky; 
            top: 0; 
            z-index: 1; 
            color: var(--text-secondary); 
            letter-spacing: 0.05em; 
            font-size: 0.85rem; 
            text-transform: uppercase;
            transition: all 0.3s ease;
            white-space: nowrap;
            background: var(--card-bg);
            border-bottom: 2px solid var(--border-light);
        }
        
        .poll-list-table tr {
            transition: all 0.3s ease;
            background: var(--card-bg);
        }
        
        .poll-list-table tr:hover { 
            background: rgba(123, 97, 255, 0.08);
            box-shadow: inset 3px 0 0 0 var(--favorable-color);
            transform: translateX(2px);
        }
        
        .poll-list-wrapper { 
            max-height: 500px; 
            overflow-y: auto; 
            border: 1px solid var(--glass-border);
            border-radius: var(--border-radius); 
            position: relative;
            box-shadow: var(--shadow-elevation-2);
            background: var(--card-bg);
        }
        
        .poll-quality { 
            display: flex; 
            gap: 2px; 
            color: #fbbf24;
            font-size: 0.9rem; 
            letter-spacing: 1px;
            filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.3));
        }
        
        .no-polls-message { 
            display: none; 
            flex-direction: column; 
            align-items: center; 
            justify-content: center; 
            height: 250px; 
            color: var(--text-secondary); 
            text-align: center; 
            gap: 20px;
            animation: fadeIn 0.5s ease;
        }
        
        .no-polls-message i { 
            font-size: 4rem; 
            opacity: 0.2;
        }
        
        footer { 
            text-align: center; 
            margin-top: 60px; 
            margin-bottom: 30px; 
            color: var(--text-secondary); 
            font-size: 0.9rem; 
            padding-top: 30px; 
            border-top: 1px solid var(--border-light);
            font-weight: 500;
        }
        
        .legend { 
            display: flex; 
            justify-content: center; 
            flex-wrap: wrap; 
            gap: 24px; 
            margin: 15px 0 25px;
        }
        
        .legend-item { 
            display: flex; 
            align-items: center; 
            gap: 10px; 
            font-weight: 500; 
            font-size: 0.95rem;
            transition: all 0.3s ease;
            cursor: pointer;
            white-space: nowrap;
        }
        
        .legend-item:hover {
            transform: translateY(-2px);
        }
        
        .legend-color { 
            width: 28px; 
            height: 4px; 
            border-radius: 2px;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px currentColor;
        }
        
        .legend-item:hover .legend-color {
            height: 6px;
            box-shadow: 0 4px 12px currentColor;
        }
        
        .card-glow { 
            position: absolute; 
            width: 200px; 
            height: 200px; 
            border-radius: 50%; 
            filter: blur(100px); 
            opacity: var(--glow-intensity);
            z-index: 0;
            pointer-events: none;
            transition: all 1s ease;
        }
        
        .glow-1 { 
            top: -100px; 
            right: 20%; 
            animation: floatGlow1 15s ease-in-out infinite;
        }
        
        .glow-2 { 
            bottom: -80px; 
            left: 30%; 
            animation: floatGlow2 12s ease-in-out infinite reverse;
        }
        
        @keyframes floatGlow1 { 
            0%, 100% { 
                transform: translate(0, 0) scale(1); 
                opacity: var(--glow-intensity);
            }
            33% { 
                transform: translate(30px, -20px) scale(1.1); 
                opacity: calc(var(--glow-intensity) * 0.8);
            }
            66% { 
                transform: translate(-20px, 10px) scale(0.9); 
                opacity: calc(var(--glow-intensity) * 1.2);
            }
        }
        
        @keyframes floatGlow2 { 
            0%, 100% { 
                transform: translate(0, 0) scale(1); 
                opacity: var(--glow-intensity);
            }
            50% { 
                transform: translate(-40px, -30px) scale(1.2); 
                opacity: calc(var(--glow-intensity) * 0.7);
            }
        }
        
        .poll-percentage { 
            font-weight: 700; 
            font-size: 1.05rem;
            transition: all 0.3s ease;
            position: relative;
        }
        
        .poll-percentage.approve { color: var(--approve-color); }
        .poll-percentage.disapprove { color: var(--disapprove-color); }
        .poll-percentage.favorable { color: var(--favorable-color); }
        .poll-percentage.unfavorable { color: var(--unfavorable-color); }
        .poll-percentage.trump { color: var(--trump-color); }
        .poll-percentage.harris { color: var(--harris-color); }
        .poll-percentage.republican { color: var(--trump-color); }
        .poll-percentage.democrat { color: var(--harris-color); }
        .poll-percentage.vance { color: var(--vance-color); }
        .poll-percentage.newsom { color: var(--newsom-color); }
        
        .poll-date { 
            color: var(--text-secondary);
            font-weight: 500;
        }
        
        .poll-info { 
            color: var(--text-muted); 
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        .pollster-name { 
            font-weight: 600; 
            display: flex; 
            align-items: center; 
            gap: 10px;
            transition: all 0.3s ease;
        }
        
        tr:hover .pollster-name {
            transform: translateX(5px);
        }
        
        .pollster-logo { 
            width: 24px; 
            height: 24px; 
            border-radius: 50%; 
            background: var(--primary-gradient);
            display: flex; 
            align-items: center; 
            justify-content: center; 
            font-size: 0.7rem; 
            font-weight: 700;
            color: white;
            box-shadow: 0 2px 8px rgba(123, 97, 255, 0.3);
            transition: all 0.3s ease;
        }
        
        tr:hover .pollster-logo {
            transform: scale(1.1) rotate(360deg);
        }
        
        #comparativeChart { 
            position: relative; 
            width: 100%; 
            height: 120px; 
            margin: 0 0 25px; 
            border-radius: 12px; 
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            overflow: hidden; 
            padding: 0; 
            box-sizing: border-box;
            box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
        }
        
        #comparativeBarsCanvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        
        .comparative-divider { 
            position: absolute; 
            left: 0; 
            width: 100%; 
            height: 2px; 
            background: var(--primary-gradient);
            opacity: 0.3;
            top: 50%; 
            transform: translateY(-50%); 
            z-index: 1;
        }
        
        .comparative-scale { 
            position: absolute; 
            color: var(--text-muted); 
            font-size: 0.8rem; 
            font-weight: 600; 
            z-index: 5; 
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            padding: 4px 10px; 
            border-radius: 6px; 
            border: 1px solid var(--glass-border);
            box-shadow: var(--shadow-elevation-1);
        }
        
        .comparative-scale.top { 
            top: 8px; 
            left: 12px; 
        }
        
        .comparative-scale.bottom { 
            bottom: 8px; 
            left: 12px; 
        }
        
        .comparative-overlay { 
            position: absolute; 
            height: 100%; 
            width: 2px; 
            background: var(--primary-gradient);
            display: none; 
            z-index: 3; 
            pointer-events: none; 
            box-shadow: 0 0 12px rgba(123, 97, 255, 0.5);
            animation: overlayPulse 1s ease-in-out infinite;
        }
        
        @keyframes overlayPulse {
            0%, 100% { opacity: 0.8; }
            50% { opacity: 1; }
        }
        
        .mini-aggregate-container { 
            overflow: hidden; 
            width: 100%; 
            height: auto; 
            margin-bottom: 40px; 
            position: relative; 
            padding: 15px 0;
            background: transparent;
            -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
            mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
        }
        
        #miniAggregateScroller { 
            display: flex; 
            flex-shrink: 0; 
            gap: 20px; 
            will-change: transform;
            padding: 0 20px;
            transition: none;
        }
        
        .mini-aggregate-display { 
            background: var(--card-bg);
            border-radius: 14px; 
            box-shadow: var(--shadow-elevation-1);
            padding: 16px 18px 18px; 
            width: 280px; 
            min-width: 280px; 
            position: relative; 
            overflow: hidden; 
            transition: all 0.4s var(--transition-ease); 
            cursor: pointer;
            border: 1px solid var(--glass-border);
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }
        
        .mini-aggregate-display::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--primary-gradient);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .mini-aggregate-display:hover::before {
            opacity: 0.05;
        }
        
        .mini-aggregate-display:hover { 
            transform: translateY(-5px) scale(1.02);
            box-shadow: var(--shadow-elevation-3);
            border-color: rgba(123, 97, 255, 0.2);
        }
        
        .mini-aggregate-display.selected { 
            outline: 2px solid #7b61ff;
            outline-offset: 2px;
            transform: translateY(-2px) scale(1.01);
            box-shadow: 0 0 25px rgba(123, 97, 255, 0.3);
        }
        
        .mini-aggregate-display.selected::before {
            opacity: 0.08;
        }
        
        .mini-aggregate-header { 
            display: flex; 
            justify-content: space-between; 
            align-items: center;
            margin-bottom: 4px; 
            position: relative; 
            z-index: 2; 
        }
        
        .mini-aggregate-title { 
            font-size: 0.95rem; 
            font-weight: 600; 
            color: var(--text-primary); 
            letter-spacing: 0.01em; 
            white-space: nowrap; 
            overflow: hidden; 
            text-overflow: ellipsis;
            flex-grow: 1;
            text-align: center;
        }
        
        .mini-aggregate-values {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            font-size: 1rem;
            font-weight: 700;
            padding: 4px 0;
            position: relative;
        }
        .mini-aggregate-values span {
            padding: 2px 6px;
        }
        .mini-aggregate-values .separator {
            width: 1px;
            height: 14px;
            background-color: var(--glass-border);
        }
        
        .mini-aggregate-chart { 
            position: relative; 
            height: 60px;
            width: 100%; 
            margin-top: 8px;
            border-radius: 8px;
            overflow: hidden;
            background: var(--glass-bg);
        }
        
        .mini-aggregate-chart svg { 
            display: block; 
            width: 100%; 
            height: 100%; 
        }
        
        .grid-line { 
            stroke: var(--chart-grid);
            stroke-width: 1; 
            vector-effect: non-scaling-stroke; 
        }
        
        .trend-line { 
            fill: none; 
            stroke-width: 3;
            vector-effect: non-scaling-stroke;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        
        .approve-line { filter: drop-shadow(0 0 4px var(--approve-color-glow)); }
        .disapprove-line { filter: drop-shadow(0 0 4px var(--disapprove-color-glow)); }
        .favorable-line { filter: drop-shadow(0 0 4px var(--favorable-color-glow)); }
        .unfavorable-line { filter: drop-shadow(0 0 4px var(--unfavorable-color-glow)); }
        .trump-line { filter: drop-shadow(0 0 4px var(--trump-color-glow)); }
        .harris-line { filter: drop-shadow(0 0 4px var(--harris-color-glow)); }
        .vance-line { filter: drop-shadow(0 0 4px var(--vance-color-glow)); }
        .newsom-line { filter: drop-shadow(0 0 4px var(--newsom-color-glow)); }
        
        .mini-aggregate-display::after { 
            content: ''; 
            position: absolute; 
            top: 0; 
            left: 0; 
            right: 0; 
            height: 60%; 
            background: linear-gradient(to bottom, 
                rgba(255,255,255,0.05) 0%, 
                rgba(255,255,255,0.02) 50%, 
                transparent 100%);
            pointer-events: none;
        }
        
        #pageLoader {
            position: fixed;
            inset: 0;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--background);
            background-image: var(--background-gradient);
            background-attachment: fixed;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 40px;
            opacity: 1;
            transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
            overflow: hidden;
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            pointer-events: all;
        }

        #pageLoader::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at center, rgba(123, 97, 255, 0.08) 0%, transparent 70%);
            animation: pulseBackground 4s ease-in-out infinite;
            pointer-events: none;
        }

        @keyframes pulseBackground {
            0%, 100% { 
                transform: scale(1);
                opacity: 0.5; 
            }
            50% { 
                transform: scale(1.1);
                opacity: 0.8; 
            }
        }

        #pageLoader.hidden {
            opacity: 0;
            transform: scale(0.95);
            pointer-events: none;
        }
        
        #pageLoader .loading-logo {
            font-family: 'Inter', sans-serif;
            font-size: 4rem;
            font-weight: 900;
            text-transform: uppercase;
            text-align: center;
            line-height: 0.95;
            position: relative;
            z-index: 2;
            transform: scale(0.7) translateY(20px);
            opacity: 0;
            animation: logoEntrance 1.2s cubic-bezier(0.23, 1, 0.32, 1) 0.3s forwards;
        }

        @keyframes logoEntrance {
            0% {
                transform: scale(0.7) translateY(20px) rotateX(15deg);
                opacity: 0;
            }
            60% {
                transform: scale(1.05) translateY(-5px) rotateX(0deg);
                opacity: 0.9;
            }
            100% {
                transform: scale(1) translateY(0) rotateX(0deg);
                opacity: 1;
            }
        }

        #pageLoader .loading-logo::before {
            content: '';
            position: absolute;
            inset: -40px;
            background: radial-gradient(ellipse 80px 40px at 50% 50%, rgba(123, 97, 255, 0.08) 0%, transparent 70%);
            opacity: 0;
            animation: subtleGlow 3s ease-in-out infinite 2s;
            z-index: -1;
            filter: blur(20px);
        }

        @keyframes subtleGlow {
            0%, 100% { 
                opacity: 0;
                transform: scale(0.9); 
            }
            50% { 
                opacity: 0.6;
                transform: scale(1.1); 
            }
        }
        
        #pageLoader .on { 
            color: var(--text-primary);
            display: inline-block;
            animation: simpleEnter 0.6s ease 1.8s both;
        }

        #pageLoader .point {
            background: linear-gradient(90deg, #0092ff, #00d4ff, #0092ff);
            background-size: 200% 100%;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            display: inline-block;
            animation: gradientShift 3s ease infinite, simpleEnter 0.6s ease 2s both;
            margin-left: 0.1em;
        }

        #pageLoader .aggregate {
            display: block;
            font-size: 3rem;
            letter-spacing: -0.02em;
            margin-top: 12px;
            background: linear-gradient(90deg, #e42535, #ff3d71, #e42535);
            background-size: 200% 100%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: gradientShift 3.5s ease infinite reverse, simpleEnter 0.6s ease 2.2s both;
        }

        @keyframes simpleEnter {
            0% {
                transform: translateY(20px);
                opacity: 0;
            }
            100% {
                transform: translateY(0);
                opacity: 1;
            }
        }

        @keyframes letterPop {
            0% {
                transform: translateY(20px) scale(0.8);
                opacity: 0;
            }
            70% {
                transform: translateY(-5px) scale(1.1);
                opacity: 0.8;
            }
            100% {
                transform: translateY(0) scale(1);
                opacity: 1;
            }
        }

        @keyframes aggregateSlide {
            0% {
                transform: translateX(-30px) scale(0.9);
                opacity: 0;
            }
            60% {
                transform: translateX(5px) scale(1.05);
                opacity: 0.9;
            }
            100% {
                transform: translateX(0) scale(1);
                opacity: 1;
            }
        }

        #pageLoader .version {
            font-size: 1.4rem;
            color: #7b61ff;
            margin-left: 16px;
            font-weight: 800;
            display: inline-block;
            animation: simpleEnter 0.6s ease 2.6s both;
        }

        #pageLoader .loading-text {
            color: var(--text-secondary);
            font-weight: 500;
            font-size: 1.1rem;
            letter-spacing: 0.05em;
            position: relative;
            z-index: 2;
            text-align: center;
            margin-top: 24px;
            animation: simpleEnter 0.8s ease 3s both;
        }

        /* Elegant loading progress indicator */
        #pageLoader::after {
            content: '';
            position: absolute;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            width: 180px;
            height: 2px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 1px;
            overflow: hidden;
            opacity: 0;
            animation: progressBarFade 0.6s ease 4.2s forwards;
        }

        #pageLoader::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(ellipse 600px 300px at center, rgba(123, 97, 255, 0.08) 0%, transparent 60%);
            animation: pulseBackground 6s ease-in-out infinite;
            pointer-events: none;
        }

        @keyframes progressBarFade {
            0% {
                opacity: 0;
                transform: translateX(-50%) scaleX(0);
            }
            100% {
                opacity: 1;
                transform: translateX(-50%) scaleX(1);
            }
        }

        /* Elegant progress bar fill */
        #pageLoader .progress-fill {
            position: absolute;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            width: 0%;
            height: 2px;
            background: var(--primary-gradient);
            border-radius: 1px;
            box-shadow: 0 0 15px rgba(123, 97, 255, 0.4);
            animation: progressFill 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 4.4s forwards;
            z-index: 10001;
        }

        @keyframes progressFill {
            0% { width: 0%; }
            40% { width: 30%; }
            80% { width: 85%; }
            100% { width: 100%; }
        }

        /* CLEAN PROFESSIONAL EFFECTS */

        /* Clean Wave Background */
        .wave-canvas {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 0;
            background: 
                linear-gradient(90deg, transparent 0%, rgba(123, 97, 255, 0.06) 30%, transparent 60%, rgba(255, 61, 113, 0.04) 80%, transparent 100%);
            background-size: 1200px 3px;
            background-position: 0 50%;
            animation: gentleWave 12s ease-in-out infinite;
            opacity: 0;
            animation-delay: 1.5s;
            animation-fill-mode: forwards;
        }

        .wave-canvas::before {
            content: '';
            position: absolute;
            inset: 0;
            background: 
                linear-gradient(90deg, transparent 0%, rgba(0, 146, 255, 0.04) 40%, transparent 70%);
            background-size: 800px 2px;
            background-position: 0 30%;
            animation: gentleWave2 8s ease-in-out infinite reverse;
        }

        @keyframes gentleWave {
            0%, 100% { 
                background-position: 0 50%;
                opacity: 0;
            }
            10% {
                opacity: 1;
            }
            50% { 
                background-position: 600px 50%;
                opacity: 0.8;
            }
            90% {
                opacity: 0.6;
            }
        }

        @keyframes gentleWave2 {
            0%, 100% { 
                background-position: 0 30%;
            }
            50% { 
                background-position: -400px 30%;
            }
        }

        .chart-container .loading-indicator {
            position: absolute;
            inset: 0;
            background-color: rgba(10, 10, 15, 0.7);
            backdrop-filter: blur(4px);
            z-index: 100;
            display: none;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
        }
        
        .chart-container .loading-indicator.active {
            display: flex;
        }

        .chart-container .spinner {
            width: 3px;
            height: 40px;
            background: var(--primary-gradient);
            border-radius: 2px;
            position: relative;
            animation: pulseHeight 1.2s ease-in-out infinite;
        }

        .chart-container .spinner::before,
        .chart-container .spinner::after {
            content: '';
            position: absolute;
            top: 0;
            width: 3px;
            height: 40px;
            background: var(--primary-gradient);
            border-radius: 2px;
            animation: pulseHeight 1.2s ease-in-out infinite;
        }

        .chart-container .spinner::before {
            left: -8px;
            animation-delay: -0.4s;
        }

        .chart-container .spinner::after {
            right: -8px;
            animation-delay: -0.8s;
        }
        
        @keyframes pulseHeight {
            0%, 40%, 100% { 
                transform: scaleY(0.4); 
                opacity: 0.6;
            }
            20% { 
                transform: scaleY(1); 
                opacity: 1;
            }
        }

        /* Download Modal Styles */
        .download-modal {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(8px);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .download-modal.active {
            display: flex;
            opacity: 1;
        }

        .download-modal-content {
            background: var(--card-bg);
            border-radius: var(--border-radius);
            padding: 40px;
            max-width: 600px;
            width: 100%;
            box-shadow: var(--shadow-elevation-3);
            border: 1px solid var(--glass-border);
            transform: scale(0.9);
            transition: transform 0.3s ease;
        }

        .download-modal.active .download-modal-content {
            transform: scale(1);
        }

        .download-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
        }

        .download-modal-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .download-modal-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .download-modal-close:hover {
            background: var(--accent);
            color: var(--text-primary);
        }

        .download-options {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .download-option {
            background: var(--glass-bg);
            border: 2px solid var(--glass-border);
            border-radius: var(--border-radius);
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        .download-option:hover {
            border-color: rgba(123, 97, 255, 0.5);
            background: rgba(123, 97, 255, 0.05);
        }

        .download-option.selected {
            border-color: #7b61ff;
            background: rgba(123, 97, 255, 0.1);
        }

        .download-option-icon {
            font-size: 2rem;
            color: var(--text-secondary);
            margin-bottom: 10px;
        }

        .download-option-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 5px;
        }

        .download-option-desc {
            font-size: 0.9rem;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        .download-actions {
            display: flex;
            gap: 15px;
            justify-content: flex-end;
        }

        .download-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: var(--border-radius);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(123, 97, 255, 0.3);
        }

        .download-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(123, 97, 255, 0.4);
        }

        .download-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .download-cancel-btn {
            background: var(--glass-bg);
            color: var(--text-primary);
            border: 1px solid var(--glass-border);
            padding: 12px 24px;
            border-radius: var(--border-radius);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .download-cancel-btn:hover {
            background: var(--accent);
        }

        .download-controls {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 20px;
        }

        .download-action-btn {
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border);
            color: var(--text-primary);
            padding: 12px 20px;
            border-radius: var(--border-radius);
            cursor: pointer;
            font-weight: 500;
            transition: all var(--transition-speed) var(--transition-ease);
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: var(--shadow-elevation-1);
        }

        .download-action-btn:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-elevation-2);
            border-color: rgba(123, 97, 255, 0.3);
        }

        @media (max-width: 992px) { 
            .controls { 
                flex-direction: column; 
                align-items: flex-start; 
            }
            .toggle-group, .zoom-controls { 
                width: 100%; 
                justify-content: space-between; 
            }
            #pollChart { 
                height: 350px; 
            }
            #comparativeChart { 
                height: 100px; 
            }
            .main-title {
                font-size: 4rem;
            }
            .title-aggregate {
                font-size: 3.5rem;
            }
        }
        
        @media (max-width: 768px) { 
            body { 
                padding: 15px; 
            }
            h1 { 
                font-size: 2rem; 
            }
            .card { 
                padding: 20px; 
            }
            .poll-list-table th, 
            .poll-list-table td { 
                padding: 12px 10px; 
                font-size: 0.85rem; 
            }
            .section-title { 
                font-size: 1.25rem; 
            }
            #pollChart { 
                height: 300px; 
            }
            #comparativeChart { 
                height: 80px; 
            }
            .main-title {
                font-size: 3rem;
            }
            .title-aggregate {
                font-size: 2.5rem;
            }
            .dropdown-container {
                max-width: 100%;
            }
            .term-selector {
                padding: 6px 15px;
            }
            .selectors-wrapper {
                 flex-direction: column; 
                 gap: 15px;
            }
            .dropdown-selected, .reset-filters {
                height: auto;
                padding: 14px 20px;
            }
            .download-modal-content {
                padding: 30px 20px;
            }

            .download-options {
                grid-template-columns: 1fr;
            }

            /* Smaller hover overlay elements for mobile */
            .hover-info-top-item {
                font-size: 0.75rem;
                padding: 6px 10px;
                border-radius: 8px;
                opacity: 0.5;
            }
            .hover-value-label {
                font-size: 0.75rem;
                padding: 4px 8px;
                border-radius: 6px;
            }
        }

        
        [data-tooltip] { 
            position: relative; 
        }
        
        [data-tooltip]:before { 
            content: attr(data-tooltip); 
            position: absolute; 
            bottom: 100%; 
            left: 50%; 
            transform: translateX(-50%) translateY(-5px) scale(0.9); 
            padding: 10px 14px; 
            background: var(--chart-overlay);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            color: var(--text-primary); 
            border-radius: 10px; 
            white-space: nowrap; 
            opacity: 0; 
            visibility: hidden; 
            transition: all 0.3s var(--transition-ease); 
            font-size: 0.85rem; 
            font-weight: 500; 
            pointer-events: none; 
            box-shadow: var(--shadow-elevation-2);
            border: 1px solid var(--glass-border);
            z-index: 100;
        }
        
        [data-tooltip]:hover:before { 
            opacity: 1; 
            visibility: visible; 
            transform: translateX(-50%) translateY(-10px) scale(1); 
        }
        
        .shortcut-badge { 
            font-family: monospace; 
            background: var(--glass-bg);
            backdrop-filter: blur(5px);
            padding: 3px 8px; 
            border-radius: 5px; 
            margin: 0 3px;
            border: 1px solid var(--glass-border);
            font-weight: 600;
        }
        
        .highlight-match { 
            background: rgba(123, 97, 255, 0.3);
            border-radius: 4px; 
            padding: 1px 4px;
            font-weight: 600;
        }
        
        .poll-count-badge { 
            background: var(--primary-gradient);
            color: white;
            font-size: 0.8rem; 
            padding: 4px 12px; 
            border-radius: 16px; 
            margin-left: 12px; 
            font-weight: 600; 
            display: inline-flex; 
            align-items: center; 
            justify-content: center;
            box-shadow: 0 2px 8px rgba(123, 97, 255, 0.3);
            animation: badgePulse 2s ease-in-out infinite;
        }
        
        @keyframes badgePulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        * {
            -webkit-transform: translateZ(0);
            -webkit-backface-visibility: hidden;
            -webkit-perspective: 1000;

        }

        @media (max-width: 480px) {
            .poll-list-wrapper {
                overflow-x: auto;
            }
            .mini-aggregate-display {
                width: 240px;
                min-width: 240px;
                padding: 14px;
            }

            /* Mobile loading screen optimizations */
            #pageLoader .loading-logo {
                font-size: 2.5rem;
            }
            
            #pageLoader .aggregate {
                font-size: 2rem;
                margin-top: 8px;
            }
            
            #pageLoader .version {
                font-size: 1rem;
                margin-left: 10px;
            }
            
            #pageLoader .loading-text {
                font-size: 1rem;
            }
            
            #pageLoader::after {
                bottom: 60px;
                width: 45px;
                height: 45px;
            }
        }

        @media (max-width: 768px) {
            /* Tablet loading screen optimizations */
            #pageLoader .loading-logo {
                font-size: 3.2rem;
            }
            
            #pageLoader .aggregate {
                font-size: 2.4rem;
            }
            
            #pageLoader .version {
                font-size: 1.2rem;
            }
            
            #pageLoader .loading-text {
                font-size: 1.1rem;
            }

            /* Mobile Articles Button */
            .header-top-nav {
                justify-content: center;
                padding: 0 20px;
                margin-bottom: 15px;
            }

            .articles-nav-btn {
                padding: 10px 18px;
                font-size: 0.85rem;
                gap: 8px;
            }

            .articles-nav-btn span {
                display: none;
            }

            .articles-nav-btn::after {
                content: 'Articles';
                position: relative;
                z-index: 2;
            }

            /* Mobile Search Suggestions */
            .search-suggestions {
                width: calc(100% + 20px);
                border-radius: 14px;
            }

            .suggestions-list {
                padding: 12px;
            }

            .suggestion-item {
                padding: 10px 12px;
                font-size: 0.85rem;
            }

            .suggestion-shortcut {
                font-size: 0.65rem;
                padding: 1px 4px;
            }
        }
