﻿:root {
    --bg: #f3f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4fa;
    --surface-ink: #dbe7f3;
    --text: #0f172a;
    --muted: #5b6779;
    --line: #d7e1ec;
    --navy: #0b1b34;
    --blue: #2563eb;
    --teal: #14b8a6;
    --green: #22c55e;
    --amber: #f59e0b;
    --rose: #ef4444;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(11, 27, 52, 0.03), rgba(11, 27, 52, 0)),
        var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(215, 225, 236, 0.9);
}

.header-shell,
.section-shell,
.footer-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.header-shell {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}



.brand-logo {
    display: block;
    height: 40px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.header-nav a:hover,
.header-nav a.active {
    background: #eef4ff;
    color: var(--navy);
}

.menu-toggle {
    display: none;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--navy);
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 2px 0;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.header-shell.is-open .menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.header-shell.is-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

.header-shell.is-open .menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}


.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-copy strong {
    font-size: 1rem;
}

.brand-copy span {
    font-size: 0.82rem;
    color: var(--muted);
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 0.85rem;
}

.main {
    padding: 28px 0 48px;
}

.hero {
    padding: 8px 0 28px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 20px;
    align-items: stretch;
}

.hero-copy,
.hero-focus,
.surface,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 34px;
    min-height: 390px;
    height: 100%;
    display: grid;
    align-content: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.76)),
        #fff;
}

.hero-copy::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 72% 22%, rgba(20, 184, 166, 0.16), transparent 30%),
        radial-gradient(circle at 18% 78%, rgba(37, 99, 235, 0.14), transparent 34%);
}

.hero-video,
.hero-motion {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -3;
}

.hero-video {
    opacity: 0.08;
}

.hero-motion {
    z-index: -2;
    opacity: 0.28;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(15, 23, 42, 0.07) 1px, transparent 1px),
        linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(20, 184, 166, 0.08), rgba(255,255,255,0));
    background-size: 42px 42px, 42px 42px, 100% 100%;
    animation: heroDrift 18s linear infinite;
}

.hero-motion::after {
    content: "";
    position: absolute;
    inset: 18% -10% auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.28), transparent);
    box-shadow:
        0 56px 0 rgba(20, 184, 166, 0.2),
        0 128px 0 rgba(245, 158, 11, 0.15);
    transform: rotate(-9deg);
}

@keyframes heroDrift {
    from {
        background-position: 0 0, 0 0, 0 0;
    }
    to {
        background-position: 84px 42px, -42px 84px, 0 0;
    }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero-copy h1 {
    margin: 14px 0 0;
    font-size: 3rem;
    line-height: 1.05;
    letter-spacing: 0;
    color: var(--navy);
}

.hero-copy p {
    margin: 0;
    max-width: 60ch;
    color: var(--muted);
}

.search-box {
    margin-top: 26px;
    display: grid;
    gap: 12px;
    position: relative;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 10px;
}

.search-input,
.filter-select,
.copy-field {
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 0 16px;
    outline: none;
}

.search-input:focus,
.filter-select:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.icon-btn,
.search-btn {
    min-width: 52px;
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.search-support {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-suggestions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    right: 62px;
    max-height: 310px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.search-suggestions[hidden] {
    display: none;
}

.search-suggestion {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.search-suggestion:last-child {
    border-bottom: 0;
}

.search-suggestion strong,
.search-suggestion span {
    display: block;
}

.search-suggestion strong {
    color: var(--navy);
    font-size: 0.94rem;
}

.search-suggestion span {
    color: var(--muted);
    font-size: 0.78rem;
}

.search-suggestion b {
    align-self: center;
    color: var(--navy);
    font-size: 0.95rem;
}

.support-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface-soft);
    border: 1px solid var(--surface-ink);
    color: var(--navy);
    font-size: 0.85rem;
    font-weight: 700;
}

.hero-focus {
    padding: 24px;
    display: grid;
    gap: 18px;
    height: 100%;
    min-height: 390px;
    align-content: center;
}

.focus-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.focus-topline strong {
    font-size: 0.92rem;
    color: var(--navy);
}

.status-pill {
    padding: 8px 12px;
    border-radius: 8px;
    background: #eef4ff;
    color: var(--navy);
    font-size: 0.8rem;
    font-weight: 800;
}

.status-pill small {
    color: var(--blue);
    font-size: 0.74rem;
}

.score-ring {
    width: 230px;
    height: 150px;
    border-radius: 150px 150px 18px 18px;
    display: grid;
    place-items: center;
    margin: 6px auto 0;
    background:
        radial-gradient(circle at 50% 88%, #fff 0 36%, transparent 37%),
        conic-gradient(from 230deg at 50% 88%, color-mix(in srgb, var(--score-color), #ffffff 48%) 0deg, var(--score-color) 230deg, transparent 231deg);
    position: relative;
    box-shadow: inset 0 -14px 24px rgba(15, 23, 42, 0.08), 0 18px 38px rgba(15, 23, 42, 0.1);
    overflow: visible;
}

.score-ring::before {
    content: "";
    position: absolute;
    inset: 17px 18px 0;
    border-radius: 130px 130px 14px 14px;
    background: #fff;
    clip-path: polygon(0 0, 100% 0, 100% 82%, 0 82%);
}

.score-ring-inner {
    position: relative;
    z-index: 4;
    display: grid;
    place-items: center;
    gap: 2px;
    text-align: center;
    transform: translateY(16px);
}

.score-ring-inner strong {
    font-size: 3.1rem;
    line-height: 1;
    color: var(--score-color);
}

.score-ring-inner span {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 700;
}

.focus-title {
    display: grid;
    gap: 4px;
    text-align: center;
}

.focus-title strong {
    font-size: 1.35rem;
    color: var(--navy);
}

.focus-title span {
    color: var(--muted);
}

.rank-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.rank-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 14px 12px;
}

.rank-box small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 6px;
    font-weight: 700;
}

.rank-box strong {
    display: block;
    color: var(--navy);
    font-size: 1.15rem;
}

.section {
    padding: 14px 0 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-head h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--navy);
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.explorer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 20px;
}

.map-panel,
.sidebar-panel,
.graph-panel,
.list-panel {
    padding: 20px;
}

.map-panel {
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.92), rgba(238,244,250,0.92)),
        var(--surface);
}

.map-shell {
    display: grid;
    gap: 14px;
}

.map-stage {
    position: relative;
    height: 480px;
    min-height: 360px;
    border-radius: 10px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(11, 27, 52, 0.06), rgba(11, 27, 52, 0)),
        #f8fbff;
    border: 1px solid rgba(11, 27, 52, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.map-stage .leaflet-container,
.leaflet-container {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.map-stage .leaflet-control-zoom {
    border: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.map-stage .leaflet-control-zoom a {
    color: var(--navy);
}

.map-stage .leaflet-control-attribution {
    display: none;
}

.map-stage .leaflet-tile-pane {
    filter: saturate(0.86) contrast(1.02);
}

.map-stage .leaflet-popup-content-wrapper,
.map-stage .leaflet-popup-tip {
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.map-popup {
    min-width: 180px;
    display: grid;
    gap: 4px;
}

.map-popup strong {
    color: var(--navy);
    font-size: 0.98rem;
}

.map-popup span,
.map-popup small {
    color: var(--muted);
}

.map-popup b {
    color: var(--navy);
    font-size: 1.2rem;
}

.map-popup a {
    display: inline-flex;
    width: fit-content;
    margin-top: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
}

.arsa-map-label {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--navy);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 4px 7px;
    text-align: center;
    white-space: nowrap;
}

.arsa-map-label::before {
    display: none;
}

.arsa-map-label span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.map-stage svg {
    width: 100%;
    height: 100%;
    display: block;
}

.map-outline {
    fill: url(#mapFill);
    stroke: rgba(11, 27, 52, 0.18);
    stroke-width: 2;
}

.map-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7);
}

.map-marker.active {
    width: 18px;
    height: 18px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 10px 20px rgba(15, 23, 42, 0.12);
}

.province-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.province-chip {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--navy);
    font-weight: 700;
}

.province-chip.active {
    background: var(--navy);
    color: #fff;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    color: var(--muted);
    font-size: 0.84rem;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

.sidebar-panel {
    display: grid;
    gap: 16px;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.crumbs strong {
    color: var(--navy);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.list-group {
    display: grid;
    gap: 10px;
}

.list-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--navy);
    font-weight: 800;
}

.record-list {
    display: grid;
    gap: 8px;
}

.record-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 78px;
    gap: 10px;
    align-items: center;
    min-height: 56px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
}

.record-row.active {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.1);
}

.record-row.is-extra {
    display: none;
}

.record-list.is-expanded .record-row.is-extra {
    display: grid;
}

.record-row button {
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    color: inherit;
}

.record-score {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: #fff;
    font-weight: 900;
    font-size: 0.95rem;
}

.record-meta strong,
.record-meta span {
    display: block;
}

.record-meta strong {
    color: var(--navy);
    font-size: 0.96rem;
}

.record-meta span {
    color: var(--muted);
    font-size: 0.82rem;
}

.record-rank {
    text-align: right;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.show-more-btn {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--navy);
    font-weight: 850;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.show-more-btn:hover {
    border-color: rgba(37, 99, 235, 0.36);
    color: var(--blue);
}

.graph-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.bar-chart {
    display: grid;
    gap: 10px;
}

.bar-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 48px;
    gap: 10px;
    align-items: center;
}

.bar-track {
    height: 12px;
    border-radius: 8px;
    background: #e8eef6;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--amber), var(--green));
}

.note-box {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #f8fbff);
    color: var(--muted);
    font-size: 0.92rem;
}

.index-panel {
    padding: 24px;
}

.index-head {
    align-items: center;
}

.index-badge {
    display: grid;
    place-items: center;
    width: 74px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.index-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.index-step {
    min-height: 170px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,251,255,0.94)),
        #fff;
}

.index-step span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: #eef4ff;
    color: var(--blue);
    font-weight: 900;
}

.index-step strong {
    display: block;
    color: var(--navy);
    font-size: 0.98rem;
    margin-bottom: 8px;
}

.index-step p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.index-scale {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.scale-top,
.scale-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.scale-top strong {
    color: var(--navy);
}

.scale-top span,
.scale-labels {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.scale-track {
    position: relative;
    height: 16px;
    margin: 14px 0 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #166534);
}

.scale-track i {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 5px solid var(--navy);
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
}

.legal-note {
    margin-top: 16px;
    padding: 18px 20px;
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.04);
    color: #7f1d1d;
    font-size: 0.92rem;
}

.ranking-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
}

.ranking-hero h1 {
    margin: 10px 0 6px;
    color: var(--navy);
    font-size: 2.4rem;
    line-height: 1.05;
}

.ranking-hero p {
    margin: 0;
    color: var(--muted);
}

.ranking-kpi {
    display: grid;
    place-items: center;
    min-width: 150px;
    padding: 18px;
    border-radius: 8px;
    background: #eef4ff;
}

.ranking-kpi strong {
    color: var(--navy);
    font-size: 2.2rem;
    line-height: 1;
}

.ranking-kpi span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.district-ranking-panel {
    padding: 18px;
}

.district-ranking-list {
    display: grid;
    gap: 10px;
}

.district-rank-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 110px;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.district-rank-row:hover {
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.district-rank-number {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    font-weight: 900;
}

.district-rank-main strong,
.district-rank-main span {
    display: block;
}

.district-rank-main strong {
    color: var(--navy);
    font-size: 1rem;
}

.district-rank-main span {
    color: var(--muted);
    font-size: 0.84rem;
}

.district-rank-track {
    height: 10px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef6;
}

.district-rank-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--green));
}

.district-rank-score {
    text-align: right;
}

.district-rank-score strong,
.district-rank-score span {
    display: block;
}

.district-rank-score strong {
    color: var(--navy);
    font-size: 1.5rem;
    line-height: 1;
}

.district-rank-score span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.legal-modal.is-hidden {
    display: none;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(10px);
}

.legal-modal-card {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(86vh, 680px);
    overflow: auto;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.legal-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

.legal-modal-head img {
    display: block;
    height: 38px;
    width: auto;
}

.legal-modal-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 1.25rem;
    line-height: 1;
}

.legal-modal-close:hover {
    background: #eef2f7;
    color: var(--navy);
}

.legal-modal-body {
    display: grid;
    gap: 20px;
    padding: 20px 22px 14px;
}

.legal-modal-body h2 {
    margin: 0 0 9px;
    color: var(--navy);
    font-size: 1.3rem;
    letter-spacing: 0;
}

.legal-modal-body p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.65;
}

.active-coverage {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.active-coverage > strong {
    color: var(--navy);
    font-size: 0.92rem;
    letter-spacing: 0;
}

.coverage-list {
    display: grid;
    gap: 8px;
}

.coverage-row {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.coverage-row:last-child {
    border-bottom: 0;
}

.coverage-row span {
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 900;
}

.coverage-row ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.coverage-row li {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.legal-modal-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px 22px 20px;
}

.legal-modal-actions button {
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid var(--navy);
    border-radius: 999px;
    background: var(--navy);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 850;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.legal-modal-actions button:hover {
    background: #1e293b;
}

.footnote {
    margin-top: 20px;
    padding: 18px 20px;
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.04);
    color: #7f1d1d;
}

.app-footer {
    margin-top: 28px;
    padding: 24px 0 36px;
    color: var(--muted);
}

.footer-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.search-results {
    display: grid;
    gap: 10px;
}

.search-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.search-result strong {
    display: block;
    color: var(--navy);
}

.search-result span {
    color: var(--muted);
    font-size: 0.84rem;
}

.search-result-score {
    font-size: 1rem;
    font-weight: 900;
    color: var(--navy);
}

.empty-state,
.empty-pill {
    display: grid;
    place-items: center;
    min-height: 54px;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--muted);
    text-align: center;
}

.empty-state-map {
    position: absolute;
    inset: auto 18px 18px 18px;
    min-height: 48px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(6px);
}

.filter-select:disabled {
    background: #f8fbff;
    color: #8a97a8;
}

@media (max-width: 1040px) {
    .hero-grid,
    .explorer-grid,
    .graph-grid {
        grid-template-columns: 1fr;
    }

    .score-ring {
        margin-left: auto;
        margin-right: auto;
    }

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

@media (max-width: 760px) {
    .header-shell,
    .footer-shell {
        width: min(100% - 20px, 1180px);
    }

    .header-shell {
        display: grid;
        grid-template-columns: 1fr auto;
        flex-wrap: initial;
        padding: 12px 0;
    }

    .menu-toggle {
        display: grid;
    }

    .brand-logo {
        height: 34px;
    }

    .header-nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        justify-content: stretch;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    }

    .header-shell.is-open .header-nav {
        display: grid;
    }

    .header-nav a {
        justify-content: center;
    }

    .header-badge {
        width: 100%;
        justify-content: center;
    }

    .hero-copy {
        padding: 22px;
    }

    .hero-copy h1 {
        font-size: 2.05rem;
    }

    .hero-focus,
    .map-panel,
    .sidebar-panel,
    .graph-panel,
    .list-panel {
        padding: 16px;
    }

    .hero-focus {
        justify-items: center;
        text-align: center;
    }

    .focus-topline,
    .focus-title,
    .rank-grid {
        width: 100%;
    }

    .rank-grid,
    .filter-row {
        grid-template-columns: 1fr;
    }

    .index-panel {
        padding: 16px;
    }

    .index-head {
        align-items: flex-start;
    }

    .index-flow {
        grid-template-columns: 1fr;
    }

    .record-row {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .record-rank {
        grid-column: 1 / -1;
        text-align: left;
    }

    .bar-row {
        grid-template-columns: 38px minmax(0, 1fr) 40px;
    }

    .ranking-hero,
    .district-rank-row {
        grid-template-columns: 1fr;
    }

    .ranking-hero {
        display: grid;
        padding: 20px;
    }

    .ranking-kpi {
        justify-items: start;
        place-items: initial;
    }

    .district-rank-score {
        text-align: left;
    }

    .coverage-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .legal-modal {
        padding: 10px;
    }

    .legal-modal-actions {
        justify-content: flex-end;
    }

    .legal-modal-actions button {
        width: auto;
    }
}

@media (max-width: 520px) {
    .section-shell,
    .footer-shell {
        width: min(100% - 16px, 1180px);
    }

    .hero-copy h1 {
        font-size: 1.8rem;
    }

    .score-ring {
        width: 210px;
        height: 138px;
    }

    .score-ring-inner strong {
        font-size: 2.5rem;
    }

    .map-stage {
        min-height: 300px;
    }
}

