:root {
    --mpi-primary:   #243B6B;
    --mpi-secondary: #3E8EDE;
    --mpi-bg:        #F5F7FB;
    --mpi-border:    #E5E7EB;
    --mpi-dark:      #152238;
}

/* ── BASE ───────────────────────────────────────────── */
body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2937;
    background: #fff;
}

/* ── SKIP LINK ──────────────────────────────────────── */
/* Off-screen until it takes focus, so the first Tab press on any page jumps
   straight past the eight-item navbar to the page content. */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    background: var(--mpi-primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 0 0 10px 0;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.skip-to-content:focus {
    left: 0;
    color: #fff;
    outline: 3px solid var(--mpi-secondary);
    outline-offset: 2px;
}
#main-content:focus { outline: none; }

/* ── NAVBAR ─────────────────────────────────────────── */
.public-navbar {
    background: rgba(21, 34, 56, 0.98);
    backdrop-filter: blur(12px);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.public-navbar .navbar-brand {
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    text-decoration: none;
    line-height: 1.2;
}

.public-navbar .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3E8EDE, #1a5fa8);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}

.public-navbar .brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
    display: block;
}

.public-navbar .nav-link {
    color: rgba(255,255,255,0.72);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 13px !important;
    border-radius: 8px;
    transition: .15s;
}

.public-navbar .nav-link:hover,
.public-navbar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.lang-switcher {
    display: flex;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: .15s;
    letter-spacing: .04em;
}

.lang-btn:hover { color: #fff; }

.lang-btn.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.navbar-toggler {
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 10px;
}

.navbar-toggler-icon { filter: invert(1); }

/* ── HERO ────────────────────────────────────────────── */
.public-hero {
    background: linear-gradient(135deg, #152238 0%, #243B6B 55%, #2a6db5 100%);
    color: #fff;
    padding: 88px 0 80px;
    position: relative;
    overflow: hidden;
}

.public-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.028'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(62,142,222,0.22);
    border: 1px solid rgba(62,142,222,0.42);
    color: #93c5fd;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 26px;
}

.public-hero h1 {
    font-size: clamp(24px, 4.5vw, 50px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -.025em;
    margin-bottom: 22px;
}

.public-hero h1 .accent { color: #93c5fd; }

.hero-lead {
    font-size: 17px;
    color: rgba(255,255,255,0.68);
    max-width: 540px;
    line-height: 1.7;
    margin-bottom: 26px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.hero-actions .btn-light {
    font-weight: 700;
    color: #152238;
    padding: 12px 24px;
}

.hero-actions .btn-outline-light {
    padding: 12px 24px;
    font-weight: 600;
}

.hero-stats {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 38px;
    flex-wrap: wrap;
}

.hero-stat {
    flex: 1;
    min-width: 110px;
    padding-right: 32px;
    border-right: 1px solid rgba(255,255,255,0.1);
    margin-right: 32px;
}

.hero-stat:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}

.hero-stat strong {
    display: block;
    font-size: clamp(26px, 3.5vw, 40px);
    font-weight: 900;
    line-height: 1;
    color: #fff;
    letter-spacing: -.02em;
}

.hero-stat span {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-top: 6px;
    font-weight: 500;
}

/* ── HERO ACCESS CARD ────────────────────────────────────
   One bar per service, single measure → single hue; bars run from a
   common 0–100% baseline so the length is the share itself, not a
   ranking artefact. Sorted worst-first, value labelled at the tip. */
.hero-visual {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding-left: 24px;
}

.hero-access-card {
    display: block;
    width: 100%;
    max-width: 420px;
    padding: 24px 24px 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.13);
    box-shadow: 0 32px 80px rgba(0,0,0,0.35);
    color: #fff;
    text-decoration: none;
    transition: .2s ease;
}

.hero-access-card:hover,
.hero-access-card:focus {
    color: #fff;
    background: rgba(255,255,255,0.085);
    border-color: rgba(147,197,253,0.45);
    transform: translateY(-2px);
}

.hac-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -.01em;
}

.hac-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    margin-top: 5px;
}

.hac-chart { margin: 22px 0 18px; }

.hac-row + .hac-row { margin-top: 15px; }

.hac-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.82);
    margin-bottom: 7px;
}

.hac-label i {
    color: rgba(147,197,253,0.8);
    font-size: 12px;
    flex: 0 0 14px;
    text-align: center;
}

.hac-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hac-track {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
}

.hac-track span {
    display: block;
    height: 100%;
    min-width: 3px;
    background: #86b6ef;
    border-radius: 0 4px 4px 0;
}

.hac-val {
    min-width: 48px;
    text-align: right;
    font-size: 12.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.hac-val-empty { color: rgba(255,255,255,0.38); font-weight: 600; }

.hac-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 14px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.hac-cta {
    color: #93c5fd;
    font-weight: 700;
    white-space: nowrap;
}

/* ── KPI SECTION ─────────────────────────────────────── */

/* ── PORTAL INTRO (official ATLAS description) ────────────
   Institutional copy used verbatim, so the type has to carry paragraphs of
   real length: generous measure and line-height rather than the short marketing
   lead used elsewhere. The two audience paragraphs are peers, so they sit in an
   even two-column grid that collapses to one column on narrow screens. */
.portal-intro {
    background: #fff;
    padding: 80px 0;
    border-bottom: 1px solid var(--mpi-border);
}

.portal-intro-title {
    font-size: clamp(21px, 2.7vw, 31px);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.25;
    color: #111827;
    max-width: 900px;
    margin: 0 0 20px;
}

.portal-intro-lead {
    color: #4b5563;
    font-size: 16.5px;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 0 40px;
}

.portal-audience {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.portal-audience-card {
    display: flex;
    gap: 16px;
    background: var(--mpi-bg);
    border: 1px solid var(--mpi-border);
    border-radius: 18px;
    padding: 24px 26px;
}

.pa-icon {
    flex: 0 0 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef6ff;
    color: var(--mpi-secondary);
    font-size: 16px;
}

.portal-audience-card p {
    margin: 0;
    color: #4b5563;
    font-size: 14.5px;
    line-height: 1.75;
}

@media (max-width: 991px) {
    .portal-intro          { padding: 56px 0; }
    .portal-audience       { grid-template-columns: 1fr; }
    .portal-intro-lead     { font-size: 15.5px; }
}

.kpi-section {
    background: var(--mpi-bg);
    padding: 64px 0;
}

.public-kpi-card {
    background: #fff;
    border: 1px solid var(--mpi-border);
    border-radius: 18px;
    padding: 28px 22px;
    text-align: center;
    transition: .2s ease;
}

.public-kpi-card:hover {
    box-shadow: 0 12px 32px rgba(15,23,42,.08);
    transform: translateY(-2px);
}

.public-kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #eef6ff;
    color: #243B6B;
    font-size: 21px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
}

.public-kpi-card .kpi-value {
    font-size: 40px;
    font-weight: 900;
    color: #243B6B;
    line-height: 1;
    letter-spacing: -.03em;
}

.public-kpi-card .kpi-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 600;
    margin-top: 8px;
}

/* MK home: the local-language name under an "H (Headcount Ratio ...)" label */
.public-kpi-card .kpi-label-name {
    font-size: 13px;
    color: #374151;
    font-weight: 700;
    margin-top: 2px;
}

.public-kpi-card .kpi-sub {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── MUNICIPALITY TICKER (home, under the KPI strip) ───
   A continuous marquee of all 80 municipalities. The track holds the list
   twice and translates exactly -50%, so the loop closes on itself with no
   seam and no JavaScript. The per-page animation-duration is set inline,
   scaled to the number of entries, so the crawl speed stays constant. */
.muni-ticker {
    background: #fff;
    border-top: 1px solid var(--mpi-border);
    border-bottom: 1px solid var(--mpi-border);
    padding: 22px 0 26px;
    overflow: hidden;
}

.muni-ticker-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.muni-ticker-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #64748b;
}

.muni-ticker-all {
    font-size: 12px;
    font-weight: 700;
    color: #3E8EDE;
    text-decoration: none;
    white-space: nowrap;
}

.muni-ticker-all:hover { color: #1d4ed8; }

/* The mask fades both ends so items enter and leave instead of being clipped. */
.muni-ticker-viewport {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.muni-ticker-track {
    display: flex;
    width: max-content;
    animation-name: muni-ticker-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-duration: 120s;      /* overridden inline, per entry count */
}

/* Stop for anyone reading a name or tabbing through the links. */
.muni-ticker:hover .muni-ticker-track,
.muni-ticker-track:focus-within {
    animation-play-state: paused;
}

.muni-ticker-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 12px;
}

.muni-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px;
    border: 1px solid var(--mpi-border);
    border-radius: 999px;
    background: #fff;
    color: #243B6B;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: .15s ease;
}

.muni-ticker-item:hover {
    border-color: #93c5fd;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
    color: #1d4ed8;
}

.muni-ticker-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.muni-ticker-ext { color: #9ca3af; }

@keyframes muni-ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* No motion: one static row the reader scrolls themselves. The duplicate copy
   is dropped so the list is not simply printed twice. */
@media (prefers-reduced-motion: reduce) {
    .muni-ticker-viewport {
        overflow-x: auto;
        -webkit-mask-image: none;
                mask-image: none;
    }
    .muni-ticker-track { animation: none; }
    .muni-ticker-group[aria-hidden="true"] { display: none; }
}

/* ── MODULES SECTION ──────────────────────────────────── */
.modules-section {
    padding: 80px 0;
    background: #fff;
}

.section-eyebrow {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mpi-secondary);
    margin-bottom: 10px;
}

.section-title {
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: -.025em;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.15;
}

.section-lead {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.7;
    max-width: 520px;
}

.module-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mpi-border);
    border-radius: 20px;
    padding: 28px 22px;
    text-decoration: none;
    color: #1f2937;
    background: #fff;
    transition: .2s ease;
    height: 100%;
}

.module-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 16px 40px rgba(15,23,42,.09);
    transform: translateY(-3px);
    color: #1f2937;
    text-decoration: none;
}

.module-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: linear-gradient(135deg, #243B6B, #3E8EDE);
    color: #fff;
    font-size: 20px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.module-card h5 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
}

.module-card p {
    color: #6b7280;
    font-size: 13.5px;
    line-height: 1.65;
    flex-grow: 1;
    margin-bottom: 18px;
}

.card-arrow {
    color: var(--mpi-secondary);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

/* ── DEPRIVATION TABLE SECTION ────────────────────────── */
.deprivation-section {
    background: var(--mpi-bg);
    padding: 80px 0;
}

.deprivation-section .card {
    border: 1px solid var(--mpi-border);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
    overflow: hidden;
}

.score-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-bar {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #3E8EDE, #243B6B);
    flex-shrink: 0;
}

/* ── ABOUT SECTION ────────────────────────────────────── */
.about-section {
    padding: 88px 0;
    background: #fff;
}

.about-dimension-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--mpi-border);
    border-radius: 14px;
    background: #f8fafc;
    margin-bottom: 12px;
    transition: .2s;
}

.about-dimension-card:hover {
    box-shadow: 0 8px 20px rgba(15,23,42,.06);
    transform: translateX(4px);
}

.dimension-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 17px;
    color: #fff;
    flex-shrink: 0;
}

/* ── FOOTER ───────────────────────────────────────────── */
.public-footer {
    background: #152238;
    color: rgba(255,255,255,0.6);
    padding: 60px 0 0;
}

.footer-brand {
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    text-decoration: none;
}

.footer-brand .brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3E8EDE, #1a5fa8);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.footer-desc {
    font-size: 13.5px;
    line-height: 1.75;
    max-width: 270px;
    margin-bottom: 22px;
}

.footer-heading {
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li { margin-bottom: 10px; }

.footer-links a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 14px;
    transition: .15s;
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    margin-top: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12.5px;
}

.footer-bottom a { color: rgba(255,255,255,0.35); text-decoration: none; }
.footer-bottom a:hover { color: rgba(255,255,255,0.75); }

/* ── PARTNER INSTITUTIONS BAND (sits directly above the footer) ────────── */
.partner-band {
    background: var(--mpi-bg);
    border-top: 1px solid var(--mpi-border);
    padding: 46px 0 50px;
}

.partner-band-heading {
    text-align: center;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #8a94a6;
    margin-bottom: 26px;
}

.partner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 940px;
    margin: 0 auto;
}

/* How-to-cite note that heads the band, above "Developed by". */
.cite-note {
    max-width: 780px;
    margin: 0 auto 38px;
    padding: 18px 22px 16px;
    background: #fff;
    border: 1px solid var(--mpi-border);
    border-left: 4px solid var(--mpi-secondary);
    border-radius: 0 12px 12px 0;
}

.cite-note-heading {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--mpi-primary);
    margin-bottom: 6px;
}

.cite-note-text {
    font-size: 13.5px;
    line-height: 1.7;
    color: #374151;
    margin: 0;
    overflow-wrap: anywhere;
}

.cite-note-text cite { font-style: italic; }
.cite-note-text a    { color: var(--mpi-secondary); }

.cite-note-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7486;
    background: var(--mpi-bg);
    border: 1px solid var(--mpi-border);
    border-radius: 8px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

.cite-note-copy:hover,
.cite-note-copy.is-copied { color: var(--mpi-secondary); border-color: var(--mpi-secondary); }

/* The band carries two rows: the two developing institutions, then the funder. */
.partner-grid--duo  { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
.partner-grid--solo { grid-template-columns: 1fr;            max-width: 340px; }

.partner-band-heading--funder {
    margin-top: 34px;
    text-transform: none;
    letter-spacing: .01em;
    font-size: 13px;
    font-weight: 600;
    color: #6b7486;
}

.partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid var(--mpi-border);
    border-radius: 14px;
    padding: 24px 20px 20px;
    text-decoration: none;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}

.partner-card:hover {
    border-color: var(--mpi-secondary);
    box-shadow: 0 10px 26px rgba(36, 59, 107, 0.10);
    transform: translateY(-2px);
}

/* Fixed-height box so logos of different aspect ratios align on one baseline. */
.partner-logo {
    height: 82px;
    width: 100%;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
}

.partner-logo img {
    max-height: 82px;
    max-width: 100%;
    object-fit: contain;
}

/* Fallback while a logo file is missing — keeps the card from collapsing. */
.partner-logo.is-missing {
    border: 1px dashed var(--mpi-border);
    border-radius: 10px;
}

.partner-logo.is-missing img { display: none; }

/* The ministry mark is a filled banner, not line art like the two seals — hold it
   a little smaller and round the corners so it doesn't outweigh them in the row. */
.partner-logo--banner img {
    max-height: 62px;
    border-radius: 6px;
}

.partner-name {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--mpi-primary);
}

.partner-site {
    font-size: 11.5px;
    font-weight: 500;
    color: #8a94a6;
    margin-top: 7px;
}

.partner-card:hover .partner-site { color: var(--mpi-secondary); }

@media (max-width: 767.98px) {
    .partner-band  { padding: 36px 0 40px; }
    .partner-grid  { grid-template-columns: 1fr; gap: 14px; max-width: 420px; }
    .partner-card  { flex-direction: row; align-items: center; text-align: left;
                     gap: 16px; padding: 16px 18px; }
    .partner-logo  { height: 56px; width: 56px; flex: 0 0 56px; margin-bottom: 0; }
    .partner-logo img { max-height: 56px; }
    .partner-card:hover { transform: none; }
}

/* ── PAGE HEADER (inner pages) ───────────────────────── */
.page-header {
    background: linear-gradient(135deg, #152238 0%, #243B6B 100%);
    color: #fff;
    padding: 44px 0 40px;
}

.page-header .breadcrumb {
    margin-bottom: 10px;
    padding: 0;
    background: none;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.3);
    content: "/";
}

.page-header .breadcrumb-item a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13px;
    transition: .15s;
}

.page-header .breadcrumb-item a:hover { color: rgba(255,255,255,0.85); }

.page-header .breadcrumb-item.active {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
}

.page-header h1 {
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 900;
    letter-spacing: -.025em;
    margin: 4px 0 0;
    line-height: 1.1;
}

.page-header .page-lead {
    color: rgba(255,255,255,0.55);
    font-size: 15px;
    margin-top: 10px;
    max-width: 560px;
}

.page-header-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.page-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
}

/* ── REGION CARDS ─────────────────────────────────────── */
.region-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mpi-border);
    border-radius: 20px;
    padding: 24px;
    background: #fff;
    transition: .2s ease;
    text-decoration: none;
    color: #1f2937;
    height: 100%;
}

.region-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 14px 36px rgba(15,23,42,.09);
    transform: translateY(-2px);
    color: #1f2937;
}

.region-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #243B6B, #3E8EDE);
    color: #fff;
    font-size: 19px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.region-card h5 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.2;
}

.region-card .region-names {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 16px;
    line-height: 1.5;
}

.region-stats-row {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--mpi-border);
    padding-top: 16px;
    margin-top: auto;
}

.region-stat-cell {
    flex: 1;
    text-align: center;
    padding: 0 8px;
    border-right: 1px solid var(--mpi-border);
}

.region-stat-cell:first-child { padding-left: 0; }
.region-stat-cell:last-child  { padding-right: 0; border-right: none; }

.region-stat-cell .val {
    display: block;
    font-size: 20px;
    font-weight: 900;
    color: #111827;
    line-height: 1;
    letter-spacing: -.02em;
}

.region-stat-cell .lbl {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    font-weight: 600;
    margin-top: 3px;
    /* Spelled out in full ("Municipalities", not "MUNIS"), which no longer fits
       a third of the card in uppercase with tracking. */
    letter-spacing: .01em;
    line-height: 1.3;
    overflow-wrap: break-word;
    hyphens: auto;
}

.region-deprived-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--mpi-border);
    margin-top: 12px;
    overflow: hidden;
}

.region-deprived-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f97316, #ef4444);
}

.region-card-footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── INNER PAGE TABLE ─────────────────────────────────── */
.public-table-card {
    border: 1px solid var(--mpi-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15,23,42,.04);
}

.public-table-card .table {
    margin-bottom: 0;
}

.public-table-card .table thead th {
    background: #f8fafc;
    padding: 13px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    font-weight: 700;
    border-bottom: 1px solid var(--mpi-border);
    white-space: nowrap;
}

.public-table-card .table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-color: #f3f4f6;
}

.pub-score-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.pub-score-bar {
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #3E8EDE, #243B6B);
    flex-shrink: 0;
}

.class-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
}

.class-urban  { background: #ede9fe; color: #4f46e5; }
.class-rural  { background: #f0fdf4; color: #166534; }

/* ── EMPTY STATE ──────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
    color: #d1d5db;
}

.empty-state strong { color: #6b7280; }

/* ── UTILITY ──────────────────────────────────────────── */
.fw-800 { font-weight: 800 !important; }
.fw-900 { font-weight: 900 !important; }

/* ── MUNICIPALITIES FILTER BAR ────────────────────────── */
.muni-filter-bar {
    background: #fff;
    border: 1px solid var(--mpi-border);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(15,23,42,.04);
}

.muni-filter-bar label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    margin-bottom: 0;
    white-space: nowrap;
}

.muni-filter-bar .form-select {
    border-radius: 10px;
    border: 1px solid var(--mpi-border);
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    padding: 7px 32px 7px 12px;
    min-width: 180px;
    max-width: 220px;
}

.muni-filter-bar .form-select:focus {
    border-color: #3E8EDE;
    box-shadow: 0 0 0 3px rgba(62,142,222,.12);
}

.type-btn-group {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.type-btn {
    border: 1px solid var(--mpi-border);
    background: #fff;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: .15s;
}

.type-btn:hover { border-color: #3E8EDE; color: #3E8EDE; }

.type-btn.active {
    background: var(--mpi-dark);
    border-color: var(--mpi-dark);
    color: #fff;
}

.filter-summary {
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
    white-space: nowrap;
}

/* ── INDICATOR ICON ROW ───────────────────────────────── */
.ind-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Settlement table: the five indicator columns are icon + short word, so the
   header says what each column is without relying on a hover tooltip. */
/* ── HOME: GUIDED RUNDOWN ───────────────────────────────
   Map on one side, a numbered read-through on the other; hovering either
   highlights the other. An outreach panel, not an analytical one. */
.story-section { background: var(--mpi-bg); padding: 72px 0; }

.story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 28px;
    align-items: start;
}

.story-map-wrap { position: sticky; top: 90px; }

.story-map {
    height: 430px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--mpi-border);
    overflow: hidden;
}

.story-map-hint { font-size: 12px; color: #6b7280; margin-top: 9px; }

.story-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.story-card {
    display: flex;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--mpi-border);
    border-radius: 16px;
    padding: 18px 20px;
    transition: .15s;
}

.story-card.is-focus,
.story-card:hover { border-color: var(--mpi-secondary); box-shadow: 0 8px 22px rgba(36, 59, 107, .1); }
.story-card:focus-visible { outline: 3px solid var(--mpi-secondary); outline-offset: 2px; }

.story-rank {
    font-size: 26px;
    font-weight: 900;
    color: #e2e8f0;
    line-height: 1;
    min-width: 30px;
}

.story-card.is-focus .story-rank { color: var(--mpi-secondary); }

.story-body { min-width: 0; }

.story-name {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    text-decoration: none;
}

.story-name:hover { color: var(--mpi-primary); text-decoration: underline; }
.story-region { font-size: 12.5px; color: #6b7280; margin-top: 1px; }

.story-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 10px;
    font-size: 12.5px;
    color: #6b7280;
}

.story-stats strong { color: var(--mpi-primary); font-weight: 800; }

.story-sentence {
    margin: 10px 0 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #374151;
}

@media (max-width: 991.98px) {
    .story-grid { grid-template-columns: 1fr; }
    .story-map-wrap { position: static; }
    .story-map { height: 300px; }
}

/* Explorer: the AND/OR pairing control and the sentence it produces. */
.expl-ind-mode {
    display: inline-flex;
    gap: 2px;
    background: #eef2f7;
    border-radius: 9px;
    padding: 2px;
}

.expl-compound-note {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 11px;
    padding: 10px 16px;
    margin-bottom: 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: #9a3412;
}

/* Shown when a settlement picked in the home search filters this table. */
.sett-filter-note {
    background: #eef6ff;
    border: 1px solid #c7ddf7;
    border-radius: 11px;
    padding: 10px 15px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #1e40af;
}

/* ── HOME SEARCH ────────────────────────────────────────
   One box over the whole gazetteer. Sits on the dark hero, so the field is
   white and the dropdown hangs below it at a higher stacking order than the
   hero artwork. */
.hero-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 14px;
    padding: 6px 6px 6px 46px;
    margin: 26px 0 34px;
    max-width: 620px;
    box-shadow: 0 10px 30px rgba(8, 20, 45, .28);
    z-index: 30;
}

.hero-search-icon {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 15px;
    pointer-events: none;
}

.hero-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    padding: 11px 0;
    min-width: 0;
}

.hero-search input::placeholder { color: #9ca3af; font-weight: 400; }

.hero-search-go {
    border: 0;
    background: var(--mpi-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: .15s;
    flex-shrink: 0;
}

.hero-search-go:hover { background: #1b2d53; }

.hero-search-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(8, 20, 45, .3);
    max-height: 340px;
    overflow-y: auto;
    z-index: 40;
}

.hero-search-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    color: #111827;
}

.hero-search-list li > i { color: var(--mpi-secondary); font-size: 13px; width: 16px; flex-shrink: 0; }
.hero-search-list li.is-active { background: var(--mpi-bg); }
.hero-search-list .hs-name { font-weight: 700; }
.hero-search-list .hs-context { font-size: 12px; color: #6b7280; margin-left: auto; text-align: right; }
.hero-search-list .hero-search-empty { color: #6b7280; cursor: default; font-size: 13px; }
.hero-search-list .hero-search-empty:hover { background: transparent; }

@media (max-width: 575.98px) {
    .hero-search { padding-left: 40px; }
    .hero-search-go { padding: 11px 14px; font-size: 13px; }
    .hero-search-list .hs-context { display: none; }
}

/* "Embed" action on a chart card — quiet until hovered, and never printed. */
.viz-embed-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--mpi-border);
    color: #6b7280;
    border-radius: 9px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.viz-embed-btn:hover {
    border-color: var(--mpi-secondary);
    color: var(--mpi-primary);
    background: #f5f9ff;
}

/* Comparison table: a band separating the combined headline figures from the
   per-indicator rows. */
.cmp-group td {
    background: var(--mpi-primary) !important;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 8px 14px !important;
}

/* Key takeaway: one sentence above the numbers, so a policy reader gets the
   headline finding without reading a chart. */
.key-takeaway {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, #f0f6ff, #f8fafc);
    border: 1px solid #dbe6f7;
    border-left: 4px solid var(--mpi-secondary);
    border-radius: 14px;
    padding: 18px 22px;
}

.key-takeaway > i {
    color: var(--mpi-secondary);
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.key-takeaway-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mpi-secondary);
    margin-bottom: 4px;
}

.key-takeaway p {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    color: #1f2937;
}

@media (max-width: 575.98px) {
    .key-takeaway { padding: 15px 16px; gap: 12px; }
    .key-takeaway p { font-size: 14px; }
}

.ind-col .ind-col-label {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: none;
    color: #6b7280;
    white-space: nowrap;
}

.ind-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 10px;
}

.ind-deprived  { background: #fef2f2; color: #dc2626; }
.ind-ok        { background: #f0fdf4; color: #16a34a; }
.ind-unknown   { background: #f3f4f6; color: #d1d5db; }

/* ── DATATABLES PUBLIC OVERRIDE ───────────────────────── */
.pub-dt-wrapper .dataTables_wrapper {
    font-size: 13px;
}

.pub-dt-wrapper .dataTables_filter input {
    border: 1px solid var(--mpi-border);
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 13px;
    transition: .15s;
}

.pub-dt-wrapper .dataTables_filter input:focus {
    border-color: #3E8EDE;
    box-shadow: 0 0 0 3px rgba(62,142,222,.12);
    outline: none;
}

.pub-dt-wrapper .dataTables_length select {
    border: 1px solid var(--mpi-border);
    border-radius: 10px;
    padding: 4px 8px;
    font-size: 13px;
}

.pub-dt-wrapper table.dataTable thead th {
    background: #f8fafc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    font-weight: 700;
    border-bottom: 1px solid var(--mpi-border) !important;
    padding: 13px 16px;
    white-space: nowrap;
}

.pub-dt-wrapper table.dataTable thead th:before,
.pub-dt-wrapper table.dataTable thead th:after {
    color: #d1d5db;
}

.pub-dt-wrapper table.dataTable tbody td {
    padding: 13px 16px;
    vertical-align: middle;
    border-color: #f3f4f6;
}

.pub-dt-wrapper table.dataTable tbody tr:hover td {
    background: #f8fafc;
}

.pub-dt-wrapper .dataTables_info,
.pub-dt-wrapper .dataTables_paginate {
    margin-top: 12px;
    font-size: 12px;
}

.pub-dt-wrapper .page-link {
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.pub-dt-wrapper .page-item.active .page-link {
    background: var(--mpi-dark);
    border-color: var(--mpi-dark);
}

/* ── SETTLEMENT INDICATOR TABLE ───────────────────────── */
.settlement-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.settlement-indicator .si-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.si-deprived   { background: #ef4444; }
.si-ok         { background: #22c55e; }
.si-unknown    { background: #d1d5db; }

/* ── INDICATOR CARDS (list page) ─────────────────────── */
.indicator-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mpi-border);
    border-radius: 20px;
    padding: 28px 26px;
    background: #fff;
    transition: .2s ease;
    text-decoration: none;
    color: #1f2937;
    height: 100%;
}

.indicator-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 14px 36px rgba(15,23,42,.09);
    transform: translateY(-2px);
    color: #1f2937;
}

/* The seven census indicators have no settlement-level drill-down, so their
   rate cards are not links. Same box, no hover affordance. */
.indicator-card--static { cursor: default; }
.indicator-card--static:hover {
    border-color: var(--mpi-border);
    box-shadow: none;
    transform: none;
}

/* Linked cards end with a "view details" line, static ones do not, which left
   the figures on a mixed row sitting at two different heights. Reserve the same
   space so every rate in a row reads across. */
.indicator-card--static::after {
    content: "";
    display: block;
    margin-top: 16px;
    height: 20px;
}

.indicator-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 22px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.ind-dim-education   { background: #eff6ff; color: #1d4ed8; }
.ind-dim-health      { background: #fff1f2; color: #be123c; }
.ind-dim-environment { background: #f0fdf4; color: #15803d; }
.ind-dim-housing     { background: #fff7ed; color: #c2410c; }
.ind-dim-living      { background: #faf5ff; color: #7e22ce; }
.ind-dim-employment  { background: #faf5ff; color: #7e22ce; }

.indicator-card h5 {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.3;
}

.indicator-card .ind-names {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 14px;
    line-height: 1.5;
}

.indicator-card .ind-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.ind-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    white-space: nowrap;
}

.ind-chip-dim {
    color: inherit;
}

.indicator-card .ind-stats {
    margin-top: auto;
    border-top: 1px solid var(--mpi-border);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.ind-stat-cell {
    text-align: center;
}

.ind-stat-cell .val {
    display: block;
    font-size: 18px;
    font-weight: 900;
    color: #111827;
    line-height: 1;
    letter-spacing: -.02em;
}

.ind-stat-cell .val.danger { color: #dc2626; }

.ind-stat-cell .lbl {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    font-weight: 600;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ind-depr-bar-wrap {
    margin-top: 12px;
}

.ind-depr-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--mpi-border);
    overflow: hidden;
}

.ind-depr-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f97316, #ef4444);
}

/* ── INDICATOR PROFILE ────────────────────────────────── */
.ind-profile-header-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 26px;
    display: inline-grid;
    place-items: center;
    margin-right: 16px;
    vertical-align: middle;
    flex-shrink: 0;
}

.ind-region-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ind-region-bar-bg {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--mpi-border);
    overflow: hidden;
}

.ind-region-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3E8EDE, #243B6B);
}

.ind-region-bar-fill.danger {
    background: linear-gradient(90deg, #f97316, #ef4444);
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 992px) {
    .public-hero          { padding: 60px 0 52px; }
    .hero-visual          { padding-left: 0; margin-top: 40px; justify-content: flex-start; }
    .hero-access-card     { max-width: 100%; }
    .hero-stat            { min-width: 100px; padding-right: 22px; margin-right: 22px; }
    .modules-section      { padding: 60px 0; }
    .deprivation-section  { padding: 60px 0; }
    .about-section        { padding: 60px 0; }
}

@media (max-width: 768px) {
    .hero-actions .btn   { width: 100%; justify-content: center; }
    .hero-stat           { flex: 0 0 calc(50% - 10px); }
}

@media (max-width: 576px) {
    .public-hero         { padding: 44px 0 40px; }
    .hero-stats          { gap: 0; flex-direction: column; }
    .hero-stat           { flex: none; border-right: none; margin-right: 0; padding-right: 0;
                           border-bottom: 1px solid rgba(255,255,255,0.1);
                           padding-bottom: 18px; margin-bottom: 18px; }
    .hero-stat:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
    .kpi-section         { padding: 44px 0; }
    .public-kpi-card .kpi-value { font-size: 32px; }
    .footer-bottom       { flex-direction: column; text-align: center; }
}


/* ═══════════════════════════════════════════════════════════
   MAP PAGE
═══════════════════════════════════════════════════════════ */

.map-page-wrap {
    position: relative;
    height: calc(100vh - 64px);
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    background: #e8eef4;
}

/* ── control panel ───────────────────────────────────────── */
.map-control-panel {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 900;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.16);
    width: 260px;
    overflow: hidden;
    transition: width .2s;
}

.map-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: var(--mpi-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

/* The page has one name; the descriptive line sits under it as a subtitle
   instead of becoming a second label for the same thing. */
.map-panel-sub {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1px;
}

.map-panel-toggle {
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 7px;
    color: #fff;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 11px;
    transition: .15s;
}
.map-panel-toggle:hover { background: rgba(255,255,255,0.25); }

.map-panel-body { padding: 0 0 6px; }

.map-control-panel.is-collapsed                  { width: auto; }
.map-control-panel.is-collapsed .map-panel-body  { display: none; }
.map-control-panel.is-collapsed .map-panel-sub   { display: none; }

.map-panel-section {
    padding: 12px 14px;
    border-bottom: 1px solid var(--mpi-border);
}
.map-panel-section:last-child { border-bottom: none; }

.map-panel-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 8px;
}

/* ── layer buttons ────────────────────────────────────────── */
.map-layer-btns {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-layer-btn {
    background: none;
    border: 1.5px solid var(--mpi-border);
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: .15s;
}
.map-layer-btn:hover {
    border-color: var(--mpi-secondary);
    color: var(--mpi-secondary);
    background: rgba(62,142,222,.06);
}
.map-layer-btn.active {
    background: var(--mpi-primary);
    border-color: var(--mpi-primary);
    color: #fff;
}
.map-layer-btn i { width: 14px; text-align: center; }

/* ── region select ────────────────────────────────────────── */
.map-select {
    width: 100%;
    border: 1.5px solid var(--mpi-border);
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: .15s;
}
.map-select:focus { border-color: var(--mpi-secondary); }

/* ── stats row ────────────────────────────────────────────── */
.map-stats-row {
    display: flex;
    gap: 0;
    justify-content: space-between;
}
.map-stat { text-align: center; flex: 1; }
.map-stat:not(:last-child) { border-right: 1px solid var(--mpi-border); }
.map-stat-val {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--mpi-primary);
    line-height: 1;
    margin-bottom: 3px;
}
.map-stat.danger .map-stat-val { color: #dc2626; }
.map-stat-lbl {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    font-weight: 600;
}

/* ── legend ───────────────────────────────────────────────── */
.map-legend-box {
    position: absolute;
    bottom: 36px;
    right: 16px;
    z-index: 900;
    background: rgba(255,255,255,0.96);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.12);
    min-width: 140px;
}
.map-legend-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 8px;
}
.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.map-legend-item:last-child { margin-bottom: 0; }
.map-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1.5px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

/* ── loading overlay ──────────────────────────────────────── */
.map-loading {
    position: absolute;
    inset: 0;
    z-index: 1000;
    background: rgba(245,247,251,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.map-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--mpi-border);
    border-top-color: var(--mpi-secondary);
    border-radius: 50%;
    animation: map-spin .7s linear infinite;
}
@keyframes map-spin { to { transform: rotate(360deg); } }

/* ── leaflet popup overrides ──────────────────────────────── */
.leaflet-popup-content-wrapper {
    border-radius: 14px !important;
    box-shadow: 0 8px 28px rgba(0,0,0,0.16) !important;
    padding: 0 !important;
    overflow: hidden;
}
.leaflet-popup-content {
    margin: 0 !important;
    padding: 14px 16px !important;
    width: auto !important;
}
.leaflet-popup-tip-container { margin-top: -1px; }

/* ── cluster icon override ────────────────────────────────── */
.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow {
    transition: transform .3s ease-out, opacity .3s ease-in;
}

/* ── boundary layer: basemap, area labels & hover tooltip ─── */

/* Mute the raster basemap so the choropleth above it reads as the only
   colour on the page. Cheaper and keyless compared with a light tile set. */
#map .leaflet-tile-pane {
    filter: grayscale(0.92) brightness(1.07) contrast(0.9);
}

/* Clicking an SVG path focuses it, and the focus ring is drawn around the
   path's bounding BOX — a stray rectangle across the map. The selected
   polygon already carries a heavy dark stroke, so drop the ring. */
#map path:focus { outline: none; }
/* Leaflet owns the icon element's transform, so the half-width shift that
   centres the label on its anchor rides on the inner span instead. */
.map-area-label {
    background: none;
    border: none;
    pointer-events: none;
    width: 0;
    height: 0;
}
.map-area-label span {
    position: relative;
    left: -50%;
    top: -9px;
    display: inline-block;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.25;
    color: #1f2937;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff;
    text-align: center;
}
.map-area-label small {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #4b5563;
}

.map-hover-tip.leaflet-tooltip {
    background: var(--mpi-dark);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
}
.map-hover-tip.leaflet-tooltip::before { display: none; }
.map-hover-tip b { display: block; font-size: 13px; font-weight: 800; }
.map-hover-tip span { color: #93c5fd; font-weight: 700; }

/* ── toggle rows ──────────────────────────────────────────── */
.map-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}
.map-toggle input { accent-color: var(--mpi-secondary); width: 14px; height: 14px; cursor: pointer; }
.map-toggle.disabled { opacity: .45; cursor: not-allowed; }

.map-panel-hint {
    font-size: 10.5px;
    line-height: 1.5;
    color: #9ca3af;
    margin-top: 7px;
}

/* ── graduated legend ─────────────────────────────────────── */
.map-legend-box { max-width: 210px; }

.map-scale { display: flex; flex-direction: column; gap: 3px; }
.map-scale-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
}
.map-swatch {
    width: 20px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,.12);
    flex-shrink: 0;
}
.map-legend-foot {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid var(--mpi-border);
    font-size: 10px;
    line-height: 1.5;
    color: #9ca3af;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ── click-through info panel ─────────────────────────────── */
.map-info-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 950;
    width: 330px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
}
.map-info-panel.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

.map-info-head {
    padding: 16px 18px 14px;
    background: var(--mpi-primary);
    color: #fff;
    flex-shrink: 0;
}
.map-info-kicker {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: rgba(255,255,255,.65);
    margin-bottom: 3px;
}
.map-info-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 26px 0 0;
}
.map-info-sub {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255,255,255,.72);
    margin-top: 5px;
}
.map-info-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 7px;
    background: rgba(255,255,255,.16);
    color: #fff;
    font-size: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: .15s;
}
.map-info-close:hover { background: rgba(255,255,255,.3); }

.map-info-body {
    padding: 0 18px 18px;
    overflow-y: auto;
    flex: 1;
}
.map-info-body::-webkit-scrollbar { width: 6px; }
.map-info-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.map-info-hero {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px 0 12px;
    border-bottom: 1px solid var(--mpi-border);
}
.map-info-hero-val {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    color: var(--mpi-primary);
}
.map-info-hero-lbl {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    line-height: 1.35;
    padding-bottom: 3px;
}

.map-info-bar {
    margin: 12px 0 4px;
    height: 8px;
    border-radius: 4px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}
.map-info-bar i {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 4px;
    background: var(--mpi-secondary);
}
.map-info-natl {
    font-size: 10.5px;
    font-weight: 600;
    color: #9ca3af;
}

.map-info-section {
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid var(--mpi-border);
}
.map-info-section:first-child { border-top: none; margin-top: 0; }
.map-info-h {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 9px;
}

.map-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.map-info-cell {
    background: var(--mpi-bg);
    border-radius: 10px;
    padding: 9px 11px;
}
.map-info-cell b {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--mpi-primary);
    line-height: 1.1;
}
.map-info-cell span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #9ca3af;
}

.map-info-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.map-info-table td { padding: 5px 0; color: #374151; font-weight: 600; }
.map-info-table td:last-child { text-align: right; font-weight: 800; color: var(--mpi-primary); }
.map-info-table tr + tr td { border-top: 1px solid #f1f5f9; }
.map-info-table .mini {
    display: block;
    font-size: 9.5px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: .03em;
}

.map-info-list { display: flex; flex-direction: column; gap: 2px; }
.map-info-list button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: none;
    background: none;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: .12s;
}
.map-info-list button:hover { background: var(--mpi-bg); color: var(--mpi-primary); }
.map-info-list button i.sw {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.12);
}
.map-info-list button em { margin-left: auto; font-style: normal; font-weight: 800; }

.map-info-actions {
    display: flex;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--mpi-border);
    background: #fff;
    flex-shrink: 0;
}
.map-info-btn {
    flex: 1;
    border: 1.5px solid var(--mpi-border);
    background: #fff;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: .15s;
}
.map-info-btn:hover { border-color: var(--mpi-secondary); color: var(--mpi-secondary); }
.map-info-btn.primary {
    background: var(--mpi-primary);
    border-color: var(--mpi-primary);
    color: #fff;
}
.map-info-btn.primary:hover { background: var(--mpi-dark); border-color: var(--mpi-dark); color: #fff; }

@media (max-width: 992px) {
    .map-info-panel { width: 300px; }
}

@media (max-width: 768px) {
    .map-control-panel { width: 220px; }
    .map-legend-box    { bottom: 80px; max-width: 170px; }
    .map-info-panel {
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-height: 62%;
        transform: translateY(calc(100% + 24px));
    }
    .map-info-panel.open { transform: none; }
}


/* ═══════════════════════════════════════════════════════════
   EXPLORER PAGE
═══════════════════════════════════════════════════════════ */

/* ── filter bar ──────────────────────────────────────────── */
.expl-filter-bar {
    background: #fff;
    border-bottom: 1px solid var(--mpi-border);
    padding: 14px 0;
    position: sticky;
    top: 64px;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.expl-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.expl-filter-select {
    border: 1.5px solid var(--mpi-border);
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: .15s;
    min-width: 150px;
}
.expl-filter-select:focus { border-color: var(--mpi-secondary); }

.expl-status-group { display: flex; gap: 4px; }
.expl-status-btn {
    border: 1.5px solid var(--mpi-border);
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    background: #fff;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
}
.expl-status-btn:hover { border-color: var(--mpi-secondary); color: var(--mpi-secondary); }
.expl-status-btn.active {
    background: var(--mpi-primary);
    border-color: var(--mpi-primary);
    color: #fff;
}
.expl-status-btn.dep.active { background: #dc2626; border-color: #dc2626; }
.expl-status-btn.ok.active  { background: #16a34a; border-color: #16a34a; }

.expl-filter-sep { flex: 1; }

.expl-clear-btn {
    border: 1.5px solid var(--mpi-border);
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    background: #fff;
    cursor: pointer;
    transition: .15s;
}
.expl-clear-btn:hover { border-color: #dc2626; color: #dc2626; }

.expl-export-btn {
    border: 1.5px solid var(--mpi-primary);
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--mpi-primary);
    background: #fff;
    cursor: pointer;
    transition: .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.expl-export-btn:hover { background: var(--mpi-primary); color: #fff; }

/* ── stats bar ───────────────────────────────────────────── */
.expl-stats-bar {
    background: var(--mpi-bg);
    border-bottom: 1px solid var(--mpi-border);
    padding: 10px 0;
}
.expl-stats-row {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}
.expl-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    border-right: 1px solid var(--mpi-border);
    font-size: 13px;
}
.expl-stat:first-child { padding-left: 0; }
.expl-stat:last-child  { border-right: none; }
.expl-stat-val {
    font-weight: 800;
    color: var(--mpi-primary);
    font-size: 15px;
}
.expl-stat-val.danger { color: #dc2626; }
.expl-stat-lbl { color: #6b7280; }

/* ── indicator icon cells ────────────────────────────────── */
.xi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}
.xi.dp { background: #fee2e2; color: #dc2626; }
.xi.ok { background: #dcfce7; color: #16a34a; }
.xi.nd { background: #f3f4f6; color: #9ca3af; }

/* ── score bar ───────────────────────────────────────────── */
.expl-score-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}
.expl-score-bar {
    flex: 1;
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.expl-score-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--mpi-secondary);
    transition: width .2s;
}
.expl-score-fill.danger { background: #ef4444; }
.expl-score-val {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    min-width: 36px;
    text-align: right;
}

/* ── status badge ─────────────────────────────────────────── */
.expl-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.expl-badge.dep { background: #fee2e2; color: #dc2626; }
.expl-badge.ok  { background: #dcfce7; color: #16a34a; }
.expl-badge.nd  { background: #f3f4f6; color: #9ca3af; }

/* ── table overrides ─────────────────────────────────────── */
.expl-table-wrap { background: #fff; border-radius: 0; }
.expl-table-wrap .dataTables_wrapper { padding: 0; }
.expl-table-wrap .dataTables_filter  { display: none; }
.expl-table-wrap .dataTables_length  { display: none; }
.expl-table-wrap .dataTables_info    { font-size: 12px; color: #9ca3af; padding: 10px 0; }
.expl-table-wrap .dataTables_paginate { padding: 10px 0; }

#explTable thead th {
    background: #f8fafc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    font-weight: 700;
    padding: 10px 10px;
    border-bottom: 2px solid var(--mpi-border);
    white-space: nowrap;
}
#explTable td {
    padding: 9px 10px;
    font-size: 13px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}
#explTable tbody tr:hover { background: #f8fafc; }
#explTable .expl-muni-link { color: var(--mpi-secondary); font-weight: 600; text-decoration: none; }
#explTable .expl-muni-link:hover { text-decoration: underline; }
#explTable .expl-name-mk { font-weight: 700; color: #1f2937; }
#explTable .expl-name-en { font-size: 11px; color: #9ca3af; display: block; margin-top: 1px; }

/* ── search box ───────────────────────────────────────────── */
#explSearch {
    border: 1.5px solid var(--mpi-border);
    border-radius: 9px;
    padding: 7px 12px 7px 36px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
    outline: none;
    transition: .15s;
    width: 200px;
}
#explSearch:focus { border-color: var(--mpi-secondary); width: 260px; }

@media (max-width: 900px) {
    .expl-filter-sep   { display: none; }
    #explSearch        { width: 100%; }
    .expl-filter-row   { gap: 8px; }
    .expl-filter-select { min-width: 0; flex: 1; }
}


/* ═══════════════════════════════════════════════════════════
   INFO PAGES  (About / Methodology / DataSources / Contact)
═══════════════════════════════════════════════════════════ */

.contact-input {
    border: 1.5px solid var(--mpi-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    transition: .15s;
    box-shadow: none;
}
.contact-input:focus {
    border-color: var(--mpi-secondary);
    box-shadow: 0 0 0 3px rgba(62,142,222,.12);
    outline: none;
}
.contact-input::placeholder { color: #9ca3af; }

.module-card:hover .card-arrow { gap: 10px; }

/* ── Municipality profile: snapshot panel + plain-language chart cards ──── */

/* Snapshot panel that rides on the right of the dark page header — the
   "hero panel" from the reference profile, restyled for our header band. */
.profile-snapshot {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 18px;
    padding: 20px 22px;
    backdrop-filter: blur(4px);
}

.profile-snapshot h3 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.profile-snapshot .snap-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 14px;
}

.profile-snapshot .snap-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.14);
    font-size: 13px;
    color: rgba(255,255,255,0.72);
}

.profile-snapshot .snap-row strong {
    color: #fff;
    font-weight: 800;
    text-align: right;
}

/* Key/value list inside the "Municipality at a glance" card. */
.info-list { margin-top: 4px; }

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--mpi-border);
    font-size: 13px;
    color: #64748b;
}

.info-row:last-child { border-bottom: none; }

.info-row strong {
    color: var(--mpi-primary);
    font-weight: 700;
    text-align: right;
}

/* Card wrapper shared by every plain-language chart. */
.viz-card {
    background: #fff;
    border: 1px solid var(--mpi-border);
    border-radius: 18px;
    padding: 20px 22px 18px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.viz-card h5 {
    font-size: 15px;
    font-weight: 800;
    color: var(--mpi-primary);
    margin-bottom: 4px;
}

.viz-card .viz-sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 10px;
}

.viz-card .viz-plot { flex: 1 1 auto; min-height: 0; }

/* "In plain words" explainer that sits under each chart. */
.viz-note {
    margin-top: 12px;
    border-left: 3px solid var(--mpi-secondary);
    background: var(--mpi-bg);
    border-radius: 0 10px 10px 0;
    padding: 10px 14px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #334155;
}

.viz-note .viz-note-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mpi-secondary);
    margin-bottom: 2px;
}

/* Every chart also ships its numbers as a table, for screen readers, print
   and anyone who would rather read the figures than a picture of them. */
.viz-details { margin-top: 12px; }

.viz-details > summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--mpi-secondary);
    list-style: none;
}

.viz-details > summary::-webkit-details-marker { display: none; }
.viz-details > summary::before { content: "\f0ce"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 7px; }
.viz-details[open] > summary { margin-bottom: 8px; }

/* A long indicator name must scroll inside the card, never widen the page. */
.viz-details .viz-table-scroll { overflow-x: auto; }

.viz-details table {
    width: 100%;
    min-width: 260px;
    font-size: 12px;
    border-collapse: collapse;
}

.viz-details th,
.viz-details td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--mpi-border);
    text-align: left;
}

.viz-details th {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.viz-details td:last-child,
.viz-details th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 575.98px) {
    .viz-card { padding: 16px 16px 14px; }
    .profile-snapshot { padding: 16px 18px; }
}

/* ── Fact sheet printing (municipality / region profiles) ──────────────── */
@media print {
    .public-navbar, .public-footer, .partner-band, .no-print,
    .map-control-panel, .expl-filter-bar, .lang-switcher,
    button, .btn { display: none !important; }
    body { background: #fff !important; }
    .page-header { background: #fff !important; color: #111 !important; }
    .page-header .breadcrumb, .page-header .breadcrumb-item a,
    .page-header h1, .page-header .page-lead { color: #111 !important; }
    .page-tag { border: 1px solid #d1d5db !important; color: #111 !important; background: #fff !important; }
    section { padding: 16px 0 !important; break-inside: avoid; }
    .card, .viz-card { break-inside: avoid; }
    .viz-card { border: 1px solid #d1d5db !important; }
    .profile-snapshot { background: #fff !important; border: 1px solid #d1d5db !important; }
    .profile-snapshot h3, .profile-snapshot .snap-row, .profile-snapshot .snap-row strong,
    .profile-snapshot .snap-sub { color: #111 !important; }
    .profile-snapshot .snap-row { border-top-color: #e5e7eb !important; }
    .viz-details[open] > summary { display: none; }
    .viz-details { display: block !important; }
}

/* ═══════════════════════════════════════════════════════════
   PHONES
   One place for the phone layout of the whole public site.
═══════════════════════════════════════════════════════════ */

/* Tables scroll sideways inside their own box (wrapper added on DataTables
   init in Shared/_Public.cshtml). */
.dt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 575.98px) {

    /* A g-5 row's gutter pulls it 24px past each side of the 12px container
       padding, so every page carrying one was 12px wider than the screen.
       Beyond the sideways wobble, a page wider than the viewport is rescaled
       by the phone, and that mismatch between two pages CANCELS the atlas
       page turn ("Transition was aborted because of invalid state"). */
    .row.g-5, .row.gx-5 { --bs-gutter-x: 1.5rem; }

    /* Belt and braces for the same reason: nothing may widen the page. */
    body { overflow-x: clip; }

    /* ── inner-page header and section rhythm ── */
    .page-header             { padding: 26px 0 24px; }
    .page-header .page-lead  { font-size: 14px; }
    .page-header-tags        { gap: 6px; margin-top: 12px; }
    .page-tag                { font-size: 11.5px; padding: 3px 10px; }
    main > section[style*="padding"] { padding-top: 36px !important; padding-bottom: 36px !important; }

    /* ── footer credit band ── */
    .cite-note               { margin-bottom: 28px; padding: 14px 16px 12px; }
    .cite-note-text          { font-size: 13px; }

    /* ── Municipalities filter bar: stacked, full width ── */
    .muni-filter-bar               { padding: 14px; gap: 10px; }
    .muni-filter-bar .form-select  { min-width: 0; max-width: none; flex: 1 1 100%; }
    .muni-filter-bar label.ms-2    { margin-left: 0 !important; }
    .type-btn-group                { flex: 1 1 100%; }
    .type-btn-group .type-btn      { flex: 1; }
    .muni-filter-bar .ms-auto      { margin-left: 0 !important; width: 100%; }

    /* ── Explorer filter bar ──
       It is sticky on desktop, but on a phone it is taller than half the
       screen and would sit over the table the whole time. Two selects per
       row instead of six squeezed to an unreadable 60px each. */
    .expl-filter-bar                         { position: static; }
    .expl-filter-row > .expl-filter-select   { flex: 1 1 calc(50% - 4px); width: 100%; }
    .expl-filter-row > .expl-ind-mode,
    .expl-filter-row > .expl-status-group    { flex: 1 1 100%; display: flex; }
    .expl-ind-mode .expl-status-btn,
    .expl-status-group .expl-status-btn      { flex: 1; }
    .expl-filter-row > .expl-clear-btn,
    .expl-filter-row > .expl-export-btn      { flex: 1 1 auto; justify-content: center; }
    .expl-stat                               { padding: 2px 12px 2px 0; border-right: none; }

    /* ── Map ── */
    .map-page-wrap { height: calc(100dvh - 64px); }
    .map-control-panel {
        top: 10px; left: 10px;
        width: calc(100% - 20px);
        max-height: calc(100% - 20px);
        display: flex; flex-direction: column;
    }
    .map-control-panel .map-panel-body { overflow-y: auto; }
    .map-control-panel.is-collapsed    { width: auto; max-width: calc(100% - 20px); }
    .map-control-panel.is-collapsed .map-panel-header { padding: 10px 12px; }
    /* No legend on phones (investors' request): it sat on top of the panel's
       last options, the overlay checkboxes. */
    .map-legend-box { display: none; }
}
