:root {
    /* Color Palette - Light Theme */
    --bg-dark: #f8fafc;
    --bg-darker: #f1f5f9;
    --panel-bg: rgba(255, 255, 255, 0.85);
    --panel-border: rgba(0, 0, 0, 0.1);

    --text-primary: #0f172a;
    --text-secondary: #334155;

    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-ring: rgba(59, 130, 246, 0.5);

    /* Map Colors */
    --map-base: #e2e8f0;
    --map-stroke: #cbd5e1;
    --map-hover-stroke: #0f172a;

    /* Typography */
    --font-main: 'Outfit', sans-serif;

    /* Shadows & Transitions */
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
    --transition-fast: 0.2s ease;
    --transition-med: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-darker);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.10) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.10) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Layout */
.dashboard-container {
    padding: 1.5rem;
    max-width: none;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header */
header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.header-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.top-report-bar {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.top-report-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.top-report-head h3 {
    margin: 0;
    font-size: 0.88rem;
}

.top-report-head p {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.report-option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.report-option-card {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.45rem;
}

.report-option-card h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.7rem;
    color: #0f172a;
    line-height: 1.3;
}

.report-option-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.report-option-actions .btn {
    padding: 0.24rem 0.32rem;
    font-size: 0.63rem;
    line-height: 1.2;
}

.option3-dropdown {
    width: 100%;
    margin: 0 0 0.35rem 0;
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mw-flag {
    width: 42px;
    height: 28px;
    border-radius: 3px;
    border: 1px solid rgba(15, 23, 42, 0.35);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Crect width='30' height='20' fill='%23007a3d'/%3E%3Crect y='6.666' width='30' height='6.668' fill='%23ce1126'/%3E%3Crect width='30' height='6.666' fill='%23000000'/%3E%3Cg stroke='%23ce1126' stroke-width='0.55'%3E%3Cline x1='15' y1='6.65' x2='8.8' y2='6.65'/%3E%3Cline x1='15' y1='6.65' x2='9.1' y2='4.8'/%3E%3Cline x1='15' y1='6.65' x2='9.9' y2='3.2'/%3E%3Cline x1='15' y1='6.65' x2='11.0' y2='2.0'/%3E%3Cline x1='15' y1='6.65' x2='12.2' y2='1.2'/%3E%3Cline x1='15' y1='6.65' x2='13.6' y2='0.7'/%3E%3Cline x1='15' y1='6.65' x2='15.0' y2='0.55'/%3E%3Cline x1='15' y1='6.65' x2='16.4' y2='0.7'/%3E%3Cline x1='15' y1='6.65' x2='17.8' y2='1.2'/%3E%3Cline x1='15' y1='6.65' x2='19.0' y2='2.0'/%3E%3Cline x1='15' y1='6.65' x2='20.1' y2='3.2'/%3E%3Cline x1='15' y1='6.65' x2='20.9' y2='4.8'/%3E%3Cline x1='15' y1='6.65' x2='21.2' y2='6.65'/%3E%3C/g%3E%3Cpath d='M8.8 6.65 A6.2 6.2 0 0 1 21.2 6.65' fill='none' stroke='%23ce1126' stroke-width='1.2'/%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Buttons & Inputs */
.btn,
.dropdown {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    outline: none;
}

.dropdown {
    background: var(--panel-bg);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    margin-right: 10px;
}

.dropdown option {
    background: var(--bg-dark);
}

.map-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hidden {
    display: none !important;
}

.primary-btn {
    background: var(--accent-primary);
    color: white;
}

.primary-btn:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

.site-blurb {
    padding: 0.7rem 1rem;
}

.site-blurb p {
    margin: 0;
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.45;
}

.population-definition-note {
    margin-top: 0.55rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid #fcd34d;
    background: #fef9c3;
    color: #713f12;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.doc-links-row {
    margin-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.doc-links-row a {
    text-decoration: none;
    font-size: 0.75rem;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 999px;
    padding: 0.24rem 0.52rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.doc-links-row a:hover {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #93c5fd;
}

/* KPI Section */
.kpi-container {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.kpi-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform var(--transition-med);
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.kpi-title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.kpi-subtitle {
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.allocation-compact-card {
    padding: 0.85rem 0.95rem;
    gap: 0.55rem;
}

.allocation-compact-card:hover {
    transform: none;
}

.allocation-compact-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
}

.compact-toggle-btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
}

.allocation-explainer {
    margin: 0;
    font-size: 0.77rem;
    line-height: 1.4;
    color: #334155;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
}

.allocation-tool-content {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.compact-sliders {
    padding: 0.55rem 0.65rem;
    gap: 7px;
    border-radius: 10px;
}

.compact-slider-group label {
    font-size: 0.76rem;
    margin-bottom: 2px;
}

.compact-sliders .slider {
    height: 5px;
}

.compact-sliders .slider::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
}

.compact-table-section {
    margin-top: 2px;
}

.compact-table-title {
    margin: 0 0 6px 0;
    font-size: 0.86rem;
    color: #1e293b;
}

.compact-table-container {
    max-height: 210px;
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.compact-data-table th,
.compact-data-table td {
    font-size: 9px;
    white-space: nowrap;
    padding: 4px 5px;
}

.splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.splash-card {
    width: min(860px, 100%);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.splash-flag-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.splash-flag {
    width: 54px;
    height: 36px;
}

.splash-flag-wrap h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.splash-lead {
    margin: 0;
    color: #334155;
    line-height: 1.5;
}

.splash-pop-note {
    margin-top: 0.1rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #fde68a;
    background: #fffbeb;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #78350f;
}

.splash-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #1e293b;
}

.splash-grid div {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem;
    line-height: 1.4;
}

.splash-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.splash-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #334155;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: 700px;
    align-items: start;
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.hazard-context-note {
    margin-top: 0.35rem;
    max-width: 980px;
    font-size: 0.76rem;
    line-height: 1.35;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.3rem 0.45rem;
}

/* Map */
.map-section {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-self: start;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.map-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-dropdown {
    padding: 0.4rem 0.8rem;
    margin: 0;
    font-size: 0.85rem;
}

.map-container {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--map-base) !important;
    min-height: 70vh;
    height: 70vh;
    margin-top: 1rem;
}

.map-content-layout {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    min-height: auto;
    flex-direction: row;
}

.map-main {
    flex: 1;
    margin-top: 0;
}

.info-sidebar {
    width: 355px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-panel {
    flex: 1 1 0;
    padding: 15px;
    font-size: 14px;
    overflow-y: auto;
}

.outline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.73rem;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.22rem 0.5rem;
    white-space: nowrap;
}

.outline-toggle input {
    width: 12px;
    height: 12px;
}

/* Custom Leaflet Styles for Dark Mode */
.leaflet-container {
    background: var(--map-base) !important;
    font-family: var(--font-main);
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.5) !important;
    color: var(--text-secondary) !important;
}

.leaflet-control-attribution a {
    color: var(--accent-primary) !important;
}

.leaflet-bar a {
    background-color: var(--panel-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--panel-border) !important;
}

.leaflet-bar a:hover {
    background-color: var(--bg-dark) !important;
}

/* Map Tooltips */
.custom-tooltip {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: 8px !important;
    color: white !important;
    font-family: var(--font-main) !important;
    padding: 8px 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(8px) !important;
}

.custom-tooltip::before {
    border-top-color: rgba(15, 23, 42, 0.9) !important;
}

.tooltip-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #3b82f6;
}

.tooltip-value {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Map Legend */
.legend {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-gradient {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    /* Gradient set via JS */
}

/* Leaflet Popups */
.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid var(--panel-border) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(8px);
    border-radius: 12px !important;
}

.leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid var(--panel-border) !important;
}

.leaflet-popup-content {
    margin: 16px;
}

.popup-title {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--accent-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.popup-chart-container {
    width: 280px;
    height: 200px;
    margin-top: 10px;
}

/* Charts Section */
.charts-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chart-card {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.chart-container {
    position: relative;
    flex: 1;
    width: 100%;
}

.chart-accordion {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.chart-accordion summary {
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #0f172a;
}

.chart-accordion summary::-webkit-details-marker {
    display: none;
}

.accordion-help {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #334155;
}

.chart-accordion .chart-card {
    margin: 0 0.6rem 0.6rem 0.6rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-container {
        grid-template-columns: 1fr;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .report-option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-table-container {
        max-height: 210px;
    }

    .splash-grid {
        grid-template-columns: 1fr;
    }

    .map-container {
        min-height: 62vh;
        height: 62vh;
    }

    .map-content-layout {
        flex-direction: column;
    }

    .info-sidebar {
        width: 100%;
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-main-row {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .controls {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }

    .dropdown {
        margin: 0;
        width: 100%;
    }

    .controls .primary-btn {
        width: 100%;
    }

    .map-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .map-header-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .map-controls {
        width: 100%;
    }

    .map-dropdown {
        flex: 1;
    }

    .info-sidebar {
        flex-direction: column;
    }

    .dashboard-container {
        padding: 1rem;
        gap: 1rem;
    }

    .chart-card {
        padding: 1rem;
    }

    .kpi-title {
        font-size: 0.85rem;
    }

    .kpi-value {
        font-size: 2rem;
    }

    .top-report-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .report-option-grid {
        grid-template-columns: 1fr;
    }

    .report-option-actions .btn {
        font-size: 0.7rem;
    }

    .site-blurb p {
        font-size: 0.8rem;
    }

    .population-definition-note {
        font-size: 0.75rem;
    }

    .doc-links-row a {
        font-size: 0.69rem;
    }

    .splash-card {
        padding: 0.85rem;
        gap: 0.65rem;
    }

    .splash-flag-wrap h2 {
        font-size: 1.05rem;
    }

    .splash-lead {
        font-size: 0.9rem;
    }

    .splash-pop-note {
        font-size: 0.76rem;
    }

    .splash-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .map-container {
        min-height: 56vh;
        height: 56vh;
    }

    body.map-only-mode .map-container {
        min-height: calc(100vh - 205px);
        height: calc(100vh - 205px);
    }
}

.secondary-btn {
    background: #e2e8f0;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.secondary-btn:hover {
    background: #cbd5e1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#map-only-btn[aria-pressed="true"] {
    background: #0f172a;
    color: #ffffff;
    border-color: #1e293b;
}

body.map-only-mode .site-blurb,
body.map-only-mode .kpi-container,
body.map-only-mode .charts-section,
body.map-only-mode .top-report-bar {
    display: none !important;
}

body.map-only-mode .dashboard-container {
    padding: 0.45rem;
    gap: 0.45rem;
}

body.map-only-mode header {
    padding: 0.55rem 0.75rem;
}

body.map-only-mode .main-content {
    gap: 0;
    min-height: auto;
}

body.map-only-mode .map-section {
    padding: 0.55rem;
}

body.map-only-mode .map-header {
    margin-bottom: 0.35rem;
}

body.map-only-mode .info-sidebar {
    display: none !important;
}

body.map-only-mode .map-container {
    margin-top: 0.35rem;
    min-height: calc(100vh - 140px);
    height: calc(100vh - 140px);
}

.sliders-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.slider {
    width: 100%;
    height: 8px;
    background: #475569;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 500;
}

.normalization-warning {
    color: #fbbf24;
    font-size: 0.9em;
    font-style: italic;
}

body.printing {
    background: #e2e8f0;
    overflow: auto;
}

body.printing #print-container {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    padding: 12px 0;
    z-index: 99990;
}

body.printing #print-container .print-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 12px auto;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
    padding: 20px;
}

body.printing #print-container .print-map-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 12px auto;
}

body.printing #print-container .print-map-container svg {
    display: block;
    margin: 0 auto;
}

.print-header.with-flag {
    display: flex;
    align-items: center;
    gap: 10px;
}

.district-report-header {
    border-bottom: 2px solid #2563eb;
    background: #eff6ff;
    padding: 10px 12px;
    border-radius: 8px;
}

.constituency-report-header {
    border-bottom: 2px solid #0f766e;
    background: #ecfeff;
    padding: 10px 12px;
    border-radius: 8px;
}

.report-type-badge {
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.report-type-badge.district {
    background: #dbeafe;
    color: #1d4ed8;
}

.report-type-badge.constituency {
    background: #ccfbf1;
    color: #0f766e;
}

.print-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 14px;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 12px;
    color: #1e293b;
}

.print-header.with-flag.center {
    justify-content: center;
}

.print-cover-flag {
    width: 96px;
    height: 62px;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 15mm;
    }

    body.printing>*:not(#print-container) {
        display: none !important;
    }

    body.printing #print-container {
        position: relative !important;
        inset: auto !important;
        width: 100%;
        padding: 0;
        color: black !important;
    }

    .print-page {
        page-break-after: always;
        padding: 20px;
    }

    body.printing #print-container .print-page {
        width: 100%;
        min-height: auto;
        margin: 0;
        box-shadow: none;
    }

    .print-header {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 20px;
        color: black;
        border-bottom: 2px solid #ccc;
        padding-bottom: 10px;
    }

    .print-header.with-flag {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .report-type-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .print-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        font-size: 9pt;
        gap: 4px 10px;
    }

    .print-stats p {
        margin: 5px 0;
        color: black;
    }

    .print-chart-container {
        margin-top: 20px;
        margin-bottom: 30px;
        width: 100%;
    }

    .print-map-container {
        width: 100%;
        margin-bottom: 10px;
        border: 1px solid #cbd5e1;
        background: #f1f5f9;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    .data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 8pt !important;
        margin-bottom: 10px !important;
    }

    .data-table th,
    .data-table td {
        padding: 4px 6px !important;
        border: 1px solid #e2e8f0;
        text-align: right;
    }

    .data-table th {
        background-color: #f8fafc !important;
        color: black !important;
        font-weight: 700;
        white-space: normal;
        line-height: 1.1;
    }

    .data-table th:first-child,
    .data-table td:first-child {
        text-align: left;
    }

    .print-map-container svg {
        max-width: 100%;
        max-height: 100%;
        margin: 0 auto;
    }

    .html-bar-chart {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin-top: 10px;
    }

    .h-bar-row {
        display: flex;
        align-items: center;
        width: 100%;
    }

    .h-bar-label {
        width: 250px;
        font-size: 0.9em;
        font-weight: 600;
        padding-right: 15px;
        text-align: right;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .h-bar-track {
        flex: 1;
        height: 24px;
        background-color: #f1f5f9;
        border-radius: 4px;
        position: relative;
        display: flex;
        align-items: center;
    }

    .h-bar-fill {
        height: 100%;
        border-radius: 4px;
        min-width: 2px;
    }

    .h-bar-val {
        margin-left: 10px;
        font-size: 0.85em;
        font-weight: bold;
        color: #334155;
        position: absolute;
        right: -80px;
        /* pull outside if space permits, or position inside */
    }
}
