:root {
    --radius: 0.5rem;
    --background: #fafafa;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --primary: #2563eb;
    --primary-foreground: #ffffff;
    --secondary: #f1f5f9;
    --secondary-foreground: #475569;
    --muted: #f8fafc;
    --muted-foreground: #64748b;
    --accent: #f1f5f9;
    --accent-foreground: #475569;
    --destructive: #dc2626;
    --border: #e2e8f0;
    --input: #e2e8f0;
    --chart-1: #3b82f6;
    --chart-2: #8b5cf6;
    --chart-3: #06b6d4;
    --chart-4: #10b981;
    --chart-5: #f59e0b;
    }

    .dark {
    --background: #0f172a;
    --foreground: #f8fafc;
    --card: #1e293b;
    --card-foreground: #f8fafc;
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --secondary: #334155;
    --secondary-foreground: #cbd5e1;
    --muted: #1e293b;
    --muted-foreground: #94a3b8;
    --accent: #334155;
    --accent-foreground: #cbd5e1;
    --destructive: #ef4444;
    --border: #334155;
    --input: #334155;
    --chart-1: #3b82f6;
    --chart-2: #8b5cf6;
    --chart-3: #06b6d4;
    --chart-4: #10b981;
    --chart-5: #f59e0b;
    }
    
    .dark body {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        background-attachment: fixed;
    }
    
    .dark .header {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .dark .header h1 {
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    
.dark .controls {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 2px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
}

.dark .stats-grid,
.dark .comparison-table,
.dark .gender-gap-section,
.dark .chart-section,
.dark .stats-section,
.dark .disclaimer {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
    
    .dark .stat-card {
        background: rgba(30, 41, 59, 0.5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .dark .stat-card:hover {
        background: rgba(30, 41, 59, 0.7);
        border-color: rgba(59, 130, 246, 0.5);
    }
    
    .dark .assumption-group {
        background: rgba(30, 41, 59, 0.5);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .dark .assumption-group:hover {
        background: rgba(30, 41, 59, 0.7);
        border-color: rgba(59, 130, 246, 0.5);
    }
    
    .dark .assumption-group h4 {
        color: var(--card-foreground);
    }
    
    .dark .assumption-group li::before {
        color: var(--primary);
    }
    
    .dark .formula-box {
        background: rgba(30, 41, 59, 0.8);
        border-left-color: var(--primary);
    }
    
    .dark .disclaimer-header {
        border-bottom-color: rgba(255, 255, 255, 0.2);
    }
    
    .dark .section-header {
        border-bottom-color: rgba(255, 255, 255, 0.2);
    }

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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    height: auto;
}
html { scrollbar-gutter: stable both-edges; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    background-attachment: fixed;
    color: var(--foreground);
    min-height: 100vh;
    padding: 0;
    line-height: 1.6;
    font-size: 14px;
}

.container {
    width: 100%;
    margin: 0;
    padding: 0 calc((100vw - min(960px, calc(100vw - 24px))) / 2);
    min-height: 100vh;
    box-sizing: border-box;
}

.main-content {
    width: 100vw;
    padding: 0 calc((100vw - min(960px, calc(100vw - 24px))) / 2);
    left: calc((-100vw + min(960px, calc(100vw - 24px))) / 2);
    position: relative;
    max-height: 100vh;
    display: flex;
    margin-bottom: 0px;
    display: sticky;
    top: 0;

}

.sti{
    display: sticky;
    top: 0;
}
.header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    padding: 32px 16px;
    text-align: center;
    position: relative;
    margin: 16px 0 32px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 100%;
    box-sizing: border-box;
}
.header h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.header p {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}
#themeToggle {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 6px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 400;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    cursor: pointer;
    box-sizing: border-box;
}
.dark #themeToggle {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-foreground);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
#themeToggle:hover, #themeToggle:focus {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-foreground);
    outline: none;
    opacity: 1;
    transform: scale(1.05);
}
main {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 48px;
    overflow-y: auto; 
    scrollbar-width: none;  
    max-height: 100vh; 
}

.controls {
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.95) 0%, rgba(226, 232, 240, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    position: -webkit-sticky;
    position: sticky;
    z-index: 100;
    top: 0;
    width: 100%;
    align-self: stretch;
}
.filter-group {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0;
}
.filter-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 140px;
    max-width: 100%;
    align-items: flex-start;
    flex: 0 1 auto;
}
.filter-item label {
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
    text-align: start;
    display: block;
    box-sizing: border-box;
    line-height: 1.6;
}
.filter-item select, .filter-item input {
    padding: 10px 14px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--card);
    color: var(--card-foreground);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}
.filter-item select:focus, .filter-item input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}
.filter-item select.disabled,
.filter-item select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--muted);
    border-color: var(--border);
}
.filter-item select.disabled:hover,
.filter-item select:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
    border-color: var(--border);
}

/* Multi-select checkbox styles */
.filter-multiselect {
    min-width: 280px;
    max-width: 100%;
}

.checkbox-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 4px;
    width: 100%;
    overflow: visible;
}

.checkbox-label {
    display: flex;
    flex-direction: flex-row;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: .8rem !important;
    color: var(--card-foreground);
    padding: 0;
    white-space: nowrap;
    line-height: 1;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    vertical-align: middle;
    align-self: center;
}

.checkbox-label span {
    user-select: none;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    line-height: 1;
}


.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 6px;
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: var(--foreground);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.stat-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(255, 255, 255, 0.98);
}
.stat-card h3 {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}
.stat-sub {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted-foreground);
}
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.6;
}
.badge-flinta {
    background: #e0f2fe;
    color: #0ea5e9;
}
.badge-nonflinta {
    background: #fee2e2;
    color: #ef4444;
}
.ratio-sep {
    display: inline-block;
    margin: 0 6px;
    color: var(--muted-foreground);
    font-weight: 700;
}
.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    background: var(--muted);
    color: var(--muted-foreground);
    margin-top: 4px;
}
.stat-change.positive, {
    background: #dcfce7;
    color: #166534;
    padding: 4px 8px;
    border-radius: 16px;
}
.stat-change.negative,  {
    background: #fef2f2;
    color: #dc2626;
    padding: 4px 8px;
    border-radius: 16px;
}
.stat-value.positive {
    background: #dcfce7;
    color: #166534;
    padding: 8px 8px;
    border-radius: 40px;
}
.stat-value.negative {
    background: #fef2f2;
    color: #dc2626;
    padding: 4px 8px;
    border-radius: 16px;
}

.stat-change.neutral {
    background: var(--muted);
    color: var(--muted-foreground);
}
.comparison-table {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.table-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 24px 32px;
    text-align: center;
}
.table-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: var(--muted);
    font-weight: 600;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sort-indicator {
    margin-left: 8px;
    font-size: 0.8rem;
    opacity: 0.7;
}
tr:hover {
    background: var(--muted);
}
.currency {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-weight: 600;
    font-size: 0.875rem;
}
.loading {
    text-align: center;
    padding: 60px 0;
    color: var(--muted-foreground);
    font-size: 1.18rem;
}
.error {
    background: rgba(231, 76, 60, 0.09);
    color: #e74c3c;
    padding: 15px;
    border-radius: var(--radius);
    margin: 24px 32px;
    border: 1.5px solid #e74c3c;
}
.disclaimer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-top: 32px;
    margin-bottom: 32px;
}
.disclaimer-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}
.disclaimer h3 {
    color: var(--foreground);
    margin: 0 0 8px 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.disclaimer-subtitle {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    margin: 0;
    font-style: italic;
}
.disclaimer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}
.assumption-group {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 32px 28px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: var(--foreground);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}
.assumption-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}
.assumption-group:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(255, 255, 255, 0.85);
}
.assumption-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    text-align: center;
    line-height: 1;
}
.assumption-group h4 {
    color: var(--foreground);
    margin: 0 0 12px 0;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
}
.assumption-intro {
    color: var(--muted-foreground);
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    font-style: italic;
}
.formula-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 16px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.formula-box code {
    color: var(--foreground);
    font-size: 0.9rem;
    font-weight: 600;
    background: transparent;
    padding: 0;
    letter-spacing: 0.02em;
}
.assumption-group p {
    color: var(--foreground);
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}
.assumption-group ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}
.assumption-group li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--foreground);
    font-size: 0.95rem;
    position: relative;
    padding-left: 20px;
}
.assumption-group li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}
.assumption-group strong {
    color: var(--foreground);
    font-weight: 600;
}
.gender-gap-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.section-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}
.section-header h2 {
    color: var(--foreground);
    margin: 0 0 8px 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.section-header p {
    color: var(--muted-foreground);
    margin: 0;
    font-size: 0.95rem;
    font-style: italic;
}
.section-header p:first-of-type {
    margin-bottom: 8px;
}
.stats-filter-text {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.9rem;
    margin: 0 0 16px 0;
    font-style: normal;
}
#stats-filter-text {
    font-weight: 500;
    color: var(--foreground);
}
.gap-explanation {
    background: var(--muted);
    border-radius: var(--radius);
    padding: 13px 14px;
    margin-bottom: 18px;
    border-left: 4px solid var(--destructive);
    box-shadow: 0 1px 4px rgba(30,34,90,0.03);
}
.gap-explanation p {
    margin: 4px 0;
    color: var(--muted-foreground);
    font-size: 0.97rem;
}
.gap-table-container {
    overflow-x: auto;
}
.gap-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(30,34,90,0.04);
}
.gap-table th {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.97rem;
}
.gap-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.97rem;
}
.gap-table tr:hover {
    background: var(--muted);
}
.gap-value {
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}
.gap-positive {
    color: var(--destructive);
}
.gap-negative {
    color: var(--primary);
}
.gap-neutral {
    color: var(--muted-foreground);
}
.trend-improving {
    color: var(--primary);
    font-weight: 600;
}
.trend-worsening {
    color: var(--destructive);
    font-weight: 600;
}
.trend-neutral {
    color: var(--muted-foreground);
}
.questions-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px 22px;
    margin: 32px 32px 0 32px;
    box-shadow: 0 2px 12px rgba(30,34,90,0.07);
    border: 1px solid var(--border);
}
.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.question-card {
    background: var(--muted);
    border-radius: var(--radius);
    padding: 18px 16px;
    border-left: 4px solid var(--accent);
    transition: transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 4px rgba(30,34,90,0.03);
}
.question-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 4px 12px rgba(30,34,90,0.09);
}
.question-card h4 {
    color: var(--foreground);
    margin: 0 0 11px 0;
    font-size: 1.07rem;
    font-weight: 600;
}
.question-card p {
    margin: 8px 0;
    line-height: 1.6;
    color: var(--muted-foreground);
    font-size: 0.98rem;
}
.question-card ul {
    margin: 8px 0;
    padding-left: 18px;
}
.question-card li {
    margin: 4px 0;
    color: var(--muted-foreground);
    font-size: 0.98rem;
}
.question-card strong {
    color: var(--foreground);
}
.chart-section, .stats-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin: 16px 0; /* add vertical spacing between sections */
}
.chart-section {
    margin-bottom: 0px;
}

.chart-section h2, .stats-section h2 {
    color: var(--foreground);
    margin: 0 0 20px 0;
    font-size: 1.45rem;
    font-weight: 500;
    text-align: center;
}
.chart-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    overflow: hidden;
}

.chart-container.compact {
    aspect-ratio: 4 / 3;
}

.compact-chart-container {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.compact-chart-container h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--card-foreground);
}

/* Insights styling */
.insights-section {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.insight-callout {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--foreground);
    padding: 14px 18px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
    margin-bottom: 16px;
    margin-top: 16px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    width: fit-content;
}

.chart-section > .insight-callout {
    display: flex;
    margin-left: auto;
    margin-right: auto;
}

.insight-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    opacity: 0.95;
}

.insight-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.dark .insight-callout {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: var(--foreground);
}

.chart-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(220px, auto);
    gap: 12px;
    height: auto;
}
.chart-cell.span-2 {
    grid-column: 1 / span 2;
    min-height: 280px;
}
.chart-cell {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    padding: 28px 12px 12px 12px; 
}
.chart-cell-title {
    position: absolute;
    top: 8px;
    left: 12px;
    z-index: 2;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted-foreground);
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 8px;
    border-radius: 6px;
}
.chart-cell canvas {
    position: absolute;
    top: 28px;   /* below title */
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 40px);
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(220px, auto);
    }
    .chart-cell.span-2 {
        grid-column: auto;
        min-height: 260px;
    }
}

.dark .chart-cell {
    background: rgba(30, 41, 59, 0.5);
}
.dark .chart-cell-title {
    background: rgba(30, 41, 59, 0.7);
    color: #cbd5e1;
}

@media (max-width: 768px) {
    .container {
        padding: 0 8px;
    }
    
    .header {
        padding: 24px 12px;
        margin: 12px 0 16px 0;
    }
    
    .header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    #themeToggle {
        top: 8px;
        right: 8px;
        min-width: 28px;
        min-height: 28px;
        font-size: 0.9rem;
    }
    
    .controls, .stats-grid, .comparison-table, .disclaimer, .gender-gap-section, .chart-section {
        padding: 20px;
    }
    
    .chart-container {
        aspect-ratio: 4 / 3;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .disclaimer-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .questions-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
.hide {
    display: none;
}
.sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: red;
  }
  .no-data-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    text-align: center;
}