/* CM51D3_MAP_EXPLORER */

.me-main {
    --me-teal: #498383;
    --me-dark: #29434b;
    --me-muted: #75858d;
    --me-border: #dfe6e9;
    --me-bg: #f5f7f8;
    color: var(--me-dark);
    min-width: 0;
}

.me-main *,
.me-main *::before,
.me-main *::after {
    box-sizing: border-box;
}

.me-main [hidden] {
    display: none !important;
}

.me-top-title {
    font-size: 16px;
    font-weight: 600;
}

.me-home {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
}

.me-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 30px;
    border: 1px solid #dce6e6;
    border-radius: 12px;
    background: linear-gradient(
        115deg, #ffffff, #edf5f4
    );
    margin-bottom: 20px;
}

.me-eyebrow {
    display: block;
    color: #498383;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    line-height: 1.5;
}

.me-hero h1 {
    margin: 8px 0;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 700;
    letter-spacing: -1px;
    color: #29434b;
}

.me-hero p {
    color: #70818a;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}

.me-hero-icon {
    color: #498383;
    opacity: .25;
    font-size: 56px;
    margin-left: 20px;
}

.me-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.me-stat {
    padding: 17px 20px;
    border: 1px solid var(--me-border);
    border-radius: 9px;
    background: #fff;
}

.me-stat span,
.me-stat small {
    display: block;
    color: var(--me-muted);
    font-size: 11px;
    line-height: 1.5;
}

.me-stat strong {
    display: block;
    color: var(--me-teal);
    font-size: 24px;
    font-weight: 700;
    margin: 7px 0 4px;
}

.me-toolbar {
    display: grid;
    grid-template-columns:
        minmax(210px, 1.7fr)
        minmax(130px, 1fr)
        minmax(150px, 1fr)
        minmax(115px, .8fr)
        auto;
    align-items: end;
    gap: 12px;
    padding: 17px;
    background: #fff;
    border: 1px solid var(--me-border);
    border-radius: 10px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1001;
}

.me-toolbar label {
    display: block;
    color: #52666e;
    font-size: 11px;
    font-weight: 600;
}

.me-toolbar select,
.me-search {
    margin-top: 7px;
    width: 100%;
    height: 41px;
    border: 1px solid #dce4e7;
    border-radius: 6px;
    background: #f8fafb;
    color: #344b54;
}

.me-toolbar select {
    padding: 0 10px;
    font: inherit;
    font-size: 12px;
}

.me-search {
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 9px;
}

.me-search i {
    color: #84969e;
    font-size: 13px;
}

.me-search input {
    border: 0;
    outline: none;
    background: transparent;
    width: 100%;
    min-width: 0;
    color: #344b54;
    font-size: 12px;
}

.me-search:focus-within,
.me-toolbar select:focus {
    outline: 2px solid #a9cccc;
    outline-offset: 1px;
}

.me-search-wrap {
    position: relative;
    min-width: 0;
}

.me-search-results {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    max-height: 330px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--me-border);
    border-radius: 8px;
    box-shadow: 0 10px 28px #20383f20;
}

.me-search-result {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px;
    border: 0;
    border-bottom: 1px solid #edf1f2;
    background: #fff;
    color: #29434b;
    cursor: pointer;
}

.me-search-result:hover,
.me-search-result:focus {
    background: #edf5f4;
}

.me-search-result strong,
.me-search-result small {
    display: block;
}

.me-search-result strong {
    font-size: 12px;
}

.me-search-result small {
    color: #788990;
    font-size: 11px;
    margin-top: 4px;
}

.me-search-message {
    padding: 15px;
    color: #75858d;
    font-size: 12px;
}

.me-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    padding: 11px 15px;
    border: 0;
    border-radius: 6px;
    background: #498383;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
}

.me-button:hover {
    background: #356969;
    color: #fff;
}

.me-reset {
    height: 41px;
    white-space: nowrap;
}

.me-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

.me-map-panel,
.me-information {
    background: #fff;
    border: 1px solid var(--me-border);
    border-radius: 11px;
    min-width: 0;
}

.me-map-panel {
    overflow: hidden;
}

.me-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.me-map-header h2 {
    margin: 5px 0 0;
    color: #29434b;
    font-size: 19px;
}

.me-icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    background: #f8fafb;
    color: #498383;
    cursor: pointer;
}

.me-icon-button:hover {
    background: #e6f0ef;
}

.me-map-container {
    position: relative;
    isolation: isolate;
}

#meMap {
    height: clamp(540px, 68vh, 850px);
    width: 100%;
    background: #e6edf0;
    font-family: inherit;
    z-index: 1;
}

#meMap .leaflet-interactive:focus-visible {
    outline: 2px solid #29434b;
}

#meMap .leaflet-control-zoom {
    border: 1px solid #d4dfe2;
    box-shadow: 0 3px 10px #29434b12;
    border-radius: 6px;
}

#meMap .leaflet-control-zoom a {
    color: #29434b;
}

.me-map-tooltip {
    border: 1px solid #dfe6e9;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #29434b;
    box-shadow: 0 4px 15px #20383f15;
}

.me-legend {
    position: absolute;
    bottom: 28px;
    left: 14px;
    z-index: 500;
    padding: 12px 15px;
    border: 1px solid #dfe6e9;
    border-radius: 7px;
    background: #ffffffed;
    color: #52666e;
    font-size: 11px;
    pointer-events: none;
}

.me-legend strong {
    display: block;
    color: #29434b;
    margin-bottom: 9px;
}

.me-legend > div {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.me-swatch {
    width: 13px;
    height: 13px;
    background: #a8c6bf;
    border: 1px solid #fff;
    border-radius: 2px;
}

.me-swatch.selected {
    background: #356969;
}

.me-loading {
    position: absolute;
    inset: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    background: #edf3f5e8;
    color: #498383;
    font-size: 13px;
    font-weight: 600;
}

.me-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #d3e2e1;
    border-top-color: #498383;
    border-radius: 50%;
    animation: me-spin .8s linear infinite;
}

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

.me-error {
    position: absolute;
    inset: 0;
    z-index: 850;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f5f8f9ed;
    color: #647981;
    padding: 25px;
    text-align: center;
}

.me-error > i {
    font-size: 28px;
    color: #b58250;
}

.me-map-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 17px;
    color: #75858d;
    font-size: 11px;
}

.me-information {
    padding: 20px;
}

.me-information-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.me-information-header > i {
    color: #9abbb8;
    font-size: 19px;
}

.me-empty {
    padding: 32px 3px 28px;
    text-align: center;
}

.me-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 16px;
    background: #eaf3f2;
    color: #498383;
    font-size: 23px;
}

.me-empty h2 {
    font-size: 19px;
    color: #29434b;
    margin: 0 0 10px;
}

.me-empty p {
    color: #75858d;
    font-size: 13px;
    line-height: 1.8;
}

.me-empty-hint {
    color: #498383;
    font-size: 11px;
    margin-top: 20px;
}

#meCouncilName {
    margin: 22px 0 6px;
    color: #29434b;
    font-size: 25px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.me-official-name {
    color: #75858d;
    font-size: 12px;
    line-height: 1.6;
    margin: 0 0 10px;
}

.me-location {
    font-size: 12px;
    font-weight: 600;
    color: #498383;
}

.me-info-divider {
    border-top: 1px solid #e6ecee;
    margin: 20px 0;
}

.me-council-details {
    margin: 0;
}

.me-council-details > div {
    margin-bottom: 17px;
}

.me-council-details dt {
    font-size: 11px;
    color: #75858d;
    margin-bottom: 5px;
}

.me-council-details dd {
    margin: 0;
    color: #344b54;
    font-size: 13px;
    font-weight: 600;
}

.me-boundary-note {
    background: #f7f4eb;
    border-radius: 6px;
    padding: 10px;
    margin: 12px 0;
    color: #857347;
    font-size: 11px;
    line-height: 1.6;
}

.me-profile {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 22px;
}

.me-clear {
    display: block;
    margin: 13px auto;
    border: 0;
    background: transparent;
    color: #75858d;
    font-size: 11px;
    cursor: pointer;
}

.me-clear:hover {
    color: #498383;
}

.me-coverage {
    border-top: 1px solid #e6ecee;
    padding-top: 20px;
    margin-top: 15px;
}

.me-coverage > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f2;
    font-size: 12px;
    color: #647981;
}

.me-coverage strong {
    color: #498383;
    font-weight: 700;
}

.me-source {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 20px;
    color: #84949b;
    font-size: 11px;
    line-height: 1.7;
}

.me-source i {
    margin-top: 4px;
}

.me-source p {
    margin: 0;
}

.me-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 22px 0;
    color: #84949b;
    font-size: 11px;
}

.me-workspace:fullscreen {
    padding: 16px;
    background: #f5f7f8;
    overflow: auto;
    align-items: start;
}

.me-workspace:fullscreen #meMap {
    height: calc(100vh - 145px);
    min-height: 300px;
}

@media (max-width: 1350px) {
    .me-toolbar {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .me-workspace {
        grid-template-columns: minmax(0, 1fr) 255px;
        gap: 12px;
    }

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

@media (max-width: 800px) {
    .me-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .me-search-wrap {
        grid-column: 1 / -1;
    }

    .me-hero {
        padding: 20px;
    }

    .me-hero-icon {
        display: none;
    }

    #meMap {
        height: 570px;
        max-height: 75vh;
        min-height: 360px;
    }

    .me-footer {
        flex-direction: column;
        gap: 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .me-main * {
        scroll-behavior: auto;
        transition: none;
    }

    .me-spinner {
        animation-duration: 2s;
    }
}


/* CM51D4_VISUAL_REFINEMENTS */

.me-hero {
    padding: 18px 24px;
    margin-bottom: 14px;
    border-radius: 10px;
}

.me-hero h1 {
    font-size: clamp(25px, 2.5vw, 32px);
    margin: 5px 0;
}

.me-hero p {
    font-size: 12px;
    line-height: 1.6;
}

.me-hero-icon {
    font-size: 42px;
    opacity: .22;
}

.me-stats {
    gap: 12px;
    margin-bottom: 14px;
}

.me-stat {
    padding: 11px 16px;
}

.me-stat strong {
    font-size: 21px;
    margin: 4px 0 2px;
}

.me-toolbar {
    padding: 12px 16px;
    margin-bottom: 14px;
    gap: 10px;
}

.me-toolbar select,
.me-search,
.me-reset {
    height: 38px;
}

.me-workspace {
    gap: 15px;
    grid-template-columns: minmax(0, 1fr) 300px;
}

.me-map-header {
    padding: 12px 17px;
}

.me-map-header h2 {
    font-size: 17px;
}

.me-map-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.me-national-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 34px;
    padding: 0 11px;
    border: 1px solid #dce6e6;
    border-radius: 6px;
    background: #f5f9f8;
    color: #498383;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.me-national-button:hover {
    background: #e6f0ef;
}

#meMap {
    height: clamp(480px, 62vh, 850px);
    background: #e6edf0;
}

.me-information {
    padding: 17px;
}

#meCouncilName {
    font-size: 23px;
    margin: 17px 0 5px;
}

.me-info-divider {
    margin: 15px 0;
}

.me-council-details > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin-bottom: 0;
    padding: 9px 0;
    border-bottom: 1px solid #edf1f2;
}

.me-council-details dt {
    margin: 0;
    font-size: 11px;
}

.me-council-details dd {
    text-align: right;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.me-profile {
    margin-top: 17px;
}

.me-coverage {
    margin-top: 12px;
    padding-top: 14px;
}

.me-coverage > div {
    padding: 7px 0;
    font-size: 11px;
}

.me-source {
    margin-top: 14px;
    font-size: 10px;
}

.me-empty {
    padding: 24px 3px 20px;
}

.me-legend {
    bottom: 25px;
    padding: 10px 12px;
}

.me-swatch.selected {
    border: 1px solid #173e40;
}

.me-footer {
    padding: 14px 0;
}

.me-workspace:fullscreen #meMap {
    height: calc(100vh - 145px);
}

@media (max-width: 1050px) {
    .me-workspace {
        grid-template-columns: minmax(0, 1fr) 255px;
    }
}

@media (max-width: 800px) {
    .me-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .me-hero {
        padding: 15px 18px;
    }

    #meMap {
        height: 520px;
        max-height: 75vh;
        min-height: 360px;
    }

    .me-council-details > div {
        grid-template-columns: 1fr 1fr;
    }
}


/* CM51E3B_COUNCIL_INTELLIGENCE */

.me-intel-section {
    padding: 15px 0;
    border-bottom: 1px solid #e6ecee;
}

.me-intel-section h3 {
    font-size: 16px;
    line-height: 1.5;
    color: #29434b;
    margin: 9px 0 5px;
}

.me-intel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
}

.me-intel-metric {
    background: #f7f9fa;
    border: 1px solid #e5ebed;
    border-radius: 7px;
    padding: 11px 9px;
    min-width: 0;
}

.me-intel-metric span,
.me-intel-metric small {
    display: block;
    color: #75858d;
    font-size: 10px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.me-intel-metric strong {
    display: block;
    font-size: clamp(15px, 1.3vw, 20px);
    line-height: 1.4;
    color: #29434b;
    margin: 4px 0;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.me-intel-metric strong.positive {
    color: #498383;
}

.me-intel-metric strong.negative {
    color: #ad554c;
}

.me-intel-note {
    font-size: 10px;
    line-height: 1.7;
    color: #75858d;
    margin: 9px 0 0;
    overflow-wrap: anywhere;
}

.me-intel-trend {
    margin-top: 14px;
}

.me-intel-trend h3 {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 9px;
}

#meIntelSparkline {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.me-intel-trend-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    color: #75858d;
    margin-top: 5px;
}

.me-intel-administration {
    color: #647981;
    font-size: 12px;
    line-height: 1.6;
    margin: 4px 0 12px;
}

.me-intel-party-bar {
    display: flex;
    height: 12px;
    border-radius: 4px;
    overflow: hidden;
    background: #e5ebed;
    margin: 12px 0;
}

.me-intel-party-bar > span {
    min-width: 0;
    height: 100%;
}

.me-intel-party-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    color: #52666e;
    font-size: 11px;
}

.me-intel-party-dot {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex: 0 0 9px;
}

.me-intel-party-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.me-intel-party-row strong {
    color: #29434b;
    font-variant-numeric: tabular-nums;
}

.me-intel-rank {
    display: block;
    font-size: 27px;
    color: #29434b;
    margin-top: 10px;
}

.me-admin-details {
    margin-top: 15px;
    border: 1px solid #e5ebed;
    border-radius: 7px;
    padding: 11px;
}

.me-admin-details summary {
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #52666e;
}

.me-admin-details[open] summary {
    margin-bottom: 10px;
}

.me-intel-loading {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 0;
    font-size: 11px;
    color: #498383;
}

.me-intel-loading .me-spinner {
    width: 17px;
    height: 17px;
    border-width: 2px;
    flex-shrink: 0;
}

.me-intel-error {
    padding: 12px;
    border-radius: 6px;
    background: #f7f4eb;
    color: #857347;
    font-size: 11px;
    line-height: 1.6;
}

.me-intel-error button {
    display: block;
    margin-top: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #498383;
    font-weight: 600;
    cursor: pointer;
}

@media (min-width: 1351px) {
    .me-workspace {
        grid-template-columns: minmax(0, 1fr) 330px;
    }
}


/* CM51F1C2_POPULATION_DENSITY */

.me-density-legend {
    min-width: 175px;
    max-width: 220px;
    padding: 12px 14px;
}

.me-density-legend > small {
    display: block;
    color: #75858d;
    font-size: 10px;
    margin: 5px 0 10px;
}

.me-density-legend .me-density-band {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-size: 11px;
}

.me-density-swatch {
    width: 23px;
    height: 12px;
    flex: 0 0 23px;
    border-radius: 2px;
    border: 1px solid rgba(41,67,75,.15);
}

.me-density-count {
    margin-left: auto;
    color: #75858d;
}

.me-density-legend .me-density-note {
    border-top: 1px solid #dfe6e9;
    padding-top: 8px;
    margin-top: 10px;
    line-height: 1.5;
}

.me-density-status {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 550;
    background: white;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 11px;
    color: #498383;
    max-width: 240px;
}

.me-density-tooltip {
    display: block;
    margin-top: 4px;
    color: #498383;
    font-size: 11px;
    font-weight: 600;
}
