/* Global Electricity Map — TransANCHOR on-brand styling */

.em-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(180deg, #0A192F 0%, #0d1f35 100%);
    border-bottom: 1px solid rgba(197, 160, 5, 0.15);
}

.em-kicker {
    color: #64ffda;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 0.75rem;
}

.em-title {
    font-family: 'Playfair Display', serif;
    color: #f0e6c8;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.em-subtitle {
    max-width: 720px;
    margin: 0 auto;
    color: #8b95a8;
    font-size: 1rem;
    line-height: 1.65;
}

.em-map-section {
    padding: 2rem 0 3.5rem;
    background: #0A192F;
    position: relative;
}

.em-controls {
    background: rgba(13, 31, 53, 0.95);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.em-coverage-toggle {
    border: none;
    padding: 0;
    margin: 0;
}

.em-toggle-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.65rem;
}

.em-toggle-option {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    color: #c9d1d9;
    font-size: 0.88rem;
    cursor: pointer;
    margin: 0;
}

.em-toggle-option input {
    margin-top: 0.2rem;
    accent-color: #64ffda;
}

.em-toggle-label strong {
    color: #f0e6c8;
}

.em-toggle-agency {
    display: block;
    color: #8b95a8;
    font-size: 0.78rem;
    line-height: 1.45;
    margin-top: 0.15rem;
    font-weight: 400;
}

.em-mode-info {
    color: #8b95a8;
    font-size: 0.82rem;
    line-height: 1.5;
    padding-left: 0.15rem;
}

.is-hidden {
    display: none !important;
}

.em-crawlable-summary {
    background: rgba(13, 31, 53, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    color: #8b95a8;
    font-size: 0.88rem;
    line-height: 1.6;
}

.em-crawlable-label {
    color: #C5A005;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.em-crawlable-fuels {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.em-noscript {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.em-noscript a {
    color: #0A192F;
    font-weight: 600;
}

.em-label {
    color: #C5A005;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}

.em-select {
    background-color: #0A192F;
    border: 1px solid rgba(100, 255, 218, 0.25);
    color: #e6edf3;
}

.em-select:focus {
    border-color: #64ffda;
    box-shadow: 0 0 0 0.2rem rgba(100, 255, 218, 0.15);
}

.em-range {
    accent-color: #64ffda;
}

.em-year-value {
    color: #64ffda;
    font-weight: 700;
}

.em-stats {
    color: #8b95a8;
    font-size: 0.85rem;
    line-height: 1.4;
}

.em-map-row {
    align-items: stretch;
}

.em-sidebar {
    background: rgba(13, 31, 53, 0.95);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
    min-height: 520px;
    max-height: min(70vh, 640px);
    display: flex;
    flex-direction: column;
}

.em-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.em-sidebar-title {
    font-family: 'Playfair Display', serif;
    color: #f0e6c8;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.em-reset-btn {
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.35);
    background: transparent;
    font-size: 0.75rem;
    white-space: nowrap;
}

.em-reset-btn:hover {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    border-color: #64ffda;
}

.em-filter-input {
    background-color: #0A192F;
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: #e6edf3;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.em-filter-input:focus {
    border-color: #64ffda;
    box-shadow: 0 0 0 0.2rem rgba(100, 255, 218, 0.12);
    background-color: #0A192F;
    color: #e6edf3;
}

.em-filter-input::placeholder {
    color: #6b7280;
}

.em-country-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.em-country-item {
    margin: 0;
}

.em-country-btn {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #c9d1d9;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.em-country-btn:hover {
    background: rgba(100, 255, 218, 0.08);
    color: #e6edf3;
}

.em-country-btn.is-active {
    background: rgba(197, 160, 5, 0.15);
    color: #f0e6c8;
    box-shadow: inset 3px 0 0 #C5A005;
}

.em-country-btn:focus-visible {
    outline: 2px solid #64ffda;
    outline-offset: 1px;
}

.em-country-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.em-country-name-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.em-coverage-pill {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    line-height: 1.2;
}

.em-coverage-pill--both {
    color: #C5A005;
    background: rgba(197, 160, 5, 0.15);
    border: 1px solid rgba(197, 160, 5, 0.35);
}

.em-coverage-pill--eia {
    color: #64ffda;
    background: rgba(100, 255, 218, 0.08);
    border: 1px solid rgba(100, 255, 218, 0.25);
}

.em-country-value {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: #64ffda;
    font-variant-numeric: tabular-nums;
}

.em-country-btn.is-no-data .em-country-value {
    color: #6b7280;
    font-style: italic;
}

.em-country-item.is-hidden {
    display: none;
}

.em-map-col {
    display: flex;
    flex-direction: column;
}

.em-map-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}

.em-map-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.em-map-legend {
    color: #C5A005;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.em-map-legend.is-eia-mode {
    color: #64ffda;
}

.em-map-legend-note {
    color: #8b95a8;
    font-size: 0.72rem;
    font-style: italic;
}

.em-map {
    width: 100%;
    flex: 1;
    min-height: 520px;
    height: min(70vh, 640px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(197, 160, 5, 0.12);
    background: #0d2137;
}

.em-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.em-loading.is-visible {
    opacity: 1;
}

.em-error {
    margin-top: 1rem;
}

.em-explore-more {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(100, 255, 218, 0.12);
    border-radius: 12px;
    background: rgba(13, 31, 53, 0.6);
    text-align: center;
}

.em-explore-more-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.em-explore-more-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
}

.em-explore-more-links a {
    color: rgba(100, 255, 218, 0.85);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.em-explore-more-links a:hover {
    color: #64ffda;
}

.em-explore-more-note {
    color: #8b95a8;
    font-size: 0.82rem;
    line-height: 1.5;
}

.em-explore-more-note a,
.em-crawlable-summary a {
    color: #64ffda;
}

.em-crawlable-summary a:hover,
.em-explore-more-note a:hover {
    color: #9effea;
}

/* About this data */
.em-about {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(197, 160, 5, 0.15);
}

.em-about-heading {
    font-family: 'Playfair Display', serif;
    color: #f0e6c8;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.em-about-intro {
    color: #8b95a8;
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: 820px;
    margin-bottom: 1.25rem;
}

.em-about-accordion {
    --bs-accordion-bg: rgba(13, 31, 53, 0.6);
    --bs-accordion-border-color: rgba(100, 255, 218, 0.12);
    --bs-accordion-btn-bg: rgba(13, 31, 53, 0.8);
    --bs-accordion-active-bg: rgba(13, 31, 53, 0.95);
    --bs-accordion-active-color: #f0e6c8;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(100, 255, 218, 0.12);
}

.em-about-item {
    background: rgba(13, 31, 53, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.12);
    margin-bottom: 0.5rem;
    border-radius: 8px !important;
    overflow: hidden;
}

.em-about-item .accordion-button {
    color: #C5A005;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: none;
}

.em-about-item .accordion-button:not(.collapsed) {
    color: #64ffda;
}

.em-about-item .accordion-body {
    color: #8b95a8;
    font-size: 0.9rem;
    line-height: 1.65;
}

.em-about-item .accordion-body p:last-child,
.em-about-item .accordion-body ul:last-child {
    margin-bottom: 0;
}

.em-about-item .accordion-body ul {
    padding-left: 1.25rem;
}

.em-about-item .accordion-body a {
    color: #64ffda;
}

.em-about-item .accordion-body a:hover {
    color: #9effea;
}

@media (max-width: 991px) {
    .em-sidebar {
        min-height: 0;
        max-height: 240px;
    }

    .em-map {
        min-height: 360px;
        height: 55vh;
    }
}

@media (max-width: 767px) {
    .em-stats {
        margin-top: 0.5rem;
    }
}

/* Country detail panel */
.em-detail-panel {
    background: rgba(13, 31, 53, 0.95);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
}

.em-detail-panel.is-hidden {
    display: none;
}

.em-detail-header {
    margin-bottom: 1rem;
}

.em-detail-name {
    font-family: 'Playfair Display', serif;
    color: #f0e6c8;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.em-detail-subtitle {
    color: #6b7280;
    font-size: 0.82rem;
}

.em-detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.em-stat {
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
}

.em-stat-label {
    display: block;
    color: #C5A005;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}

.em-stat-value {
    display: block;
    color: #e6edf3;
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.em-stat-value.is-positive {
    color: #64ffda;
}

.em-stat-value.is-negative {
    color: #f87171;
}

.em-detail-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.2fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.em-detail-section-title {
    color: #C5A005;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.5rem;
}

.em-top-fuels {
    list-style: none;
    margin: 0;
    padding: 0;
}

.em-top-fuels li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(100, 255, 218, 0.08);
    color: #c9d1d9;
    font-size: 0.82rem;
}

.em-top-fuels li:last-child {
    border-bottom: none;
}

.em-top-fuel-value {
    color: #64ffda;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.em-mini-chart {
    height: 200px;
    width: 100%;
}

.em-sparkline-caption {
    color: #6b7280;
    font-size: 0.75rem;
}

.em-detail-subtitle {
    color: #6b7280;
    font-size: 0.82rem;
}

.em-source-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.em-source-badge--iea {
    color: #C5A005;
    background: rgba(197, 160, 5, 0.12);
    border: 1px solid rgba(197, 160, 5, 0.3);
}

.em-source-badge--eia {
    color: #64ffda;
    background: rgba(100, 255, 218, 0.08);
    border: 1px solid rgba(100, 255, 218, 0.25);
}

.em-usa-state-link {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(100, 255, 218, 0.06);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
}

.em-usa-state-link a {
    color: #64ffda;
    font-weight: 600;
    text-decoration: none;
}

.em-usa-state-link a:hover {
    text-decoration: underline;
}

.em-compare-sources {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.em-compare-toggle {
    background: transparent;
    border: 1px solid rgba(100, 255, 218, 0.25);
    color: #64ffda;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.em-compare-toggle:hover {
    background: rgba(100, 255, 218, 0.08);
}

.em-compare-intro,
.em-compare-footer {
    color: #8b95a8;
    font-size: 0.82rem;
}

.em-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 0.65rem;
}

.em-compare-table th,
.em-compare-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    text-align: left;
    vertical-align: top;
}

.em-compare-table thead th {
    color: #C5A005;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.em-compare-table tbody th[scope="row"] {
    color: #f0e6c8;
    font-weight: 600;
    white-space: nowrap;
}

.em-compare-table td {
    color: #64ffda;
    font-variant-numeric: tabular-nums;
}

.em-compare-table td:last-child {
    color: #8b95a8;
}

.em-about-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.em-about-compare-table th,
.em-about-compare-table td {
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(100, 255, 218, 0.12);
    text-align: left;
    vertical-align: top;
}

.em-about-compare-table thead th {
    color: #C5A005;
    background: rgba(10, 25, 47, 0.5);
}

.em-about-compare-table tbody th[scope="row"] {
    color: #f0e6c8;
    font-weight: 600;
    background: rgba(10, 25, 47, 0.35);
}

.em-sparkline {
    height: 90px;
    width: 100%;
}

.em-detail-notes .em-country-notes a {
    color: #64ffda;
}

.em-detail-notes {
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    padding-top: 1rem;
}

.em-eei-wrap.is-hidden {
    display: none;
}

.em-supply-demand-divider {
    align-items: center;
    border-top: 1px solid rgba(197, 160, 5, 0.35);
    display: flex;
    margin-top: 1.25rem;
    padding-top: 1rem;
    position: relative;
}

.em-supply-demand-divider::before,
.em-supply-demand-divider::after {
    background: rgba(100, 255, 218, 0.2);
    content: '';
    flex: 1;
    height: 1px;
}

.em-supply-demand-label {
    color: #C5A005;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0 0.75rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.em-eei-demand {
    margin-top: 0.75rem;
}

.em-eei-demand.is-hidden {
    display: none;
}

.em-eei-guide {
    background: rgba(10, 25, 47, 0.45);
    border: 1px solid rgba(100, 255, 218, 0.12);
    border-radius: 6px;
    color: #8b95a8;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
}

.em-eei-guide summary {
    color: #64ffda;
    cursor: pointer;
    font-weight: 600;
}

.em-eei-guide-list {
    margin-top: 0.5rem;
    padding-left: 1.1rem;
}

.em-eei-guide-list li {
    margin-bottom: 0.35rem;
}

.em-eei-guide-list li:last-child {
    margin-bottom: 0;
}

.em-eei-loading {
    color: #64ffda;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.em-eei-loading.is-hidden {
    display: none;
}

.em-eei-content.is-hidden {
    display: none;
}

.em-eei-disclaimer {
    color: #8b95a8;
    font-size: 0.82rem;
    line-height: 1.5;
}

.em-eei-disclaimer a {
    color: #64ffda;
}

.em-eei-year-note {
    color: #6b7280;
    font-size: 0.78rem;
}

.em-eei-stats {
    margin-bottom: 1rem;
}

.em-eei-charts-row {
    margin-top: 0.5rem;
}

.em-eei-chart-title {
    color: #f0e6c8;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.em-eei-chart-caption {
    color: #6b7280;
    font-size: 0.75rem;
}

.em-eei-chart {
    height: 220px;
    width: 100%;
}

.em-eei-chart--tall {
    height: 240px;
}

.em-eei-sector-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.em-eei-sector-label {
    color: #8b95a8;
    font-size: 0.78rem;
    margin: 0;
}

.em-eei-sector-select {
    max-width: 11rem;
    background: rgba(10, 25, 47, 0.85);
    border-color: rgba(100, 255, 218, 0.2);
    color: #e2e8f0;
    font-size: 0.82rem;
}

.em-eei-co2-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.em-dc-wrap.is-hidden {
    display: none;
}

.em-dc-divider {
    align-items: center;
    border-top: 1px solid rgba(100, 255, 218, 0.2);
    display: flex;
    margin-top: 1.25rem;
    padding-top: 1rem;
    position: relative;
}

.em-dc-divider::before,
.em-dc-divider::after {
    background: rgba(197, 160, 5, 0.25);
    content: '';
    flex: 1;
    height: 1px;
}

.em-dc-divider-label {
    color: #64ffda;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0 0.75rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.em-dc-ai {
    margin-top: 0.75rem;
}

.em-dc-disclaimer {
    color: #8b95a8;
    font-size: 0.85rem;
}

.em-dc-disclaimer a {
    color: #64ffda;
}

.em-dc-guide {
    background: rgba(10, 25, 47, 0.45);
    border: 1px solid rgba(197, 160, 5, 0.15);
    border-radius: 6px;
    color: #8b95a8;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
}

.em-dc-guide summary {
    color: #C5A005;
    cursor: pointer;
    font-weight: 600;
}

.em-dc-guide-list {
    margin-top: 0.5rem;
    padding-left: 1.1rem;
}

.em-dc-guide-list li {
    margin-bottom: 0.35rem;
}

.em-dc-guide-list li:last-child {
    margin-bottom: 0;
}

.em-dc-loading {
    color: #64ffda;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.em-dc-loading.is-hidden {
    display: none;
}

.em-dc-content.is-hidden {
    display: none;
}

.em-dc-year-note {
    color: #8b95a8;
    font-size: 0.82rem;
}

.em-dc-stats {
    margin-bottom: 1rem;
}

.em-dc-chart-title {
    color: #C5A005;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.em-dc-chart-caption {
    color: #8b95a8;
    font-size: 0.78rem;
}

.em-dc-chart {
    min-height: 180px;
    width: 100%;
}

.em-notes-disclaimer {
    color: #6b7280;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.em-country-notes {
    max-height: 180px;
    overflow-y: auto;
    color: #8b95a8;
    font-size: 0.85rem;
    line-height: 1.6;
}

.em-country-notes p {
    margin-bottom: 0.65rem;
}

.em-country-notes p:last-child {
    margin-bottom: 0;
}

@media (max-width: 991px) {
    .em-detail-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .em-detail-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .em-detail-stats {
        grid-template-columns: 1fr;
    }
}
