:root {
    --bg: #0b1220;
    --panel: #111827;
    --panel-2: #0f172a;
    --card: #ffffff;
    --line: #d7dfeb;
    --line-soft: rgba(148, 163, 184, 0.22);
    --text: #0f172a;
    --muted: #64748b;
    --accent: #f05a28;
    --accent-soft: #ffdccd;
    --c1: #1a56a8;
    --c2: #d35400;
    --blue-soft: #dbeafe;
    --orange-soft: #ffedd5;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(91, 141, 217, 0.18), transparent 34%),
                radial-gradient(circle at top right, rgba(232, 147, 90, 0.24), transparent 26%),
                linear-gradient(180deg, #f5f7fb 0%, #e8eef6 100%);
}

a { color: inherit; }
code { font-family: Consolas, monospace; }

.app-shell {
    max-width: 1380px;
    margin: 0 auto;
    padding: 24px 18px 56px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}

.eyebrow {
    display: inline-block;
    font-size: .82rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c1);
    text-decoration: none;
    font-weight: 700;
}

.topbar h1 {
    margin: 6px 0 8px;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.05;
}

.topbar p {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.meta-chip {
    background: var(--panel);
    color: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: .8rem;
    font-weight: 700;
}

.meta-chip-soft {
    background: rgba(255,255,255,0.75);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.app-nav a {
    text-decoration: none;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: var(--muted);
    font-weight: 600;
    font-size: .82rem;
    white-space: nowrap;
}

.app-nav a.active,
.app-nav a:hover {
    background: var(--panel);
    color: #fff;
}

.app-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    margin-bottom: 18px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.section-head.compact h2,
.section-head h2 {
    margin: 4px 0 0;
    font-size: 1.35rem;
}

.section-kicker {
    display: inline-block;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c1);
}

.section-meta,
.back-link {
    color: var(--muted);
    font-size: .92rem;
}

.back-link { text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.card-error {
    border-color: #ef4444;
    background: #fff5f5;
}

.filter-card { padding: 18px 20px; }

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}

/* Compact single-row variant used in detalle.php */
.filters.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.filters.filters-row .filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .82rem;
    color: var(--muted);
    flex: 1 1 130px;
    min-width: 0;
}

.filters.filters-row .filter-item-sm { flex: 0 1 110px; }

.filters.filters-row .filter-checks {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filters.filters-row .filter-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filters.filters-row .filter-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.checkbox-filter {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .82rem;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}

.filters label:not(.multiselect-option),
.filter-label-dist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .84rem;
    color: var(--muted);
}

.filters select,
.multiselect-btn {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    min-height: 46px;
}

/* Compact row selects — slightly smaller */
.filters.filters-row select,
.filters.filters-row .multiselect-btn {
    padding: 9px 10px;
    min-height: 42px;
    font-size: .84rem;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-actions button,
.filter-btns button {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    background: var(--panel);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.reset-link { color: var(--muted); text-decoration: none; font-size: .84rem; }
.reset-link:hover { text-decoration: underline; }
.filter-disabled { opacity: .55; }

/* Toggle chip — checkbox styled as pill */
.toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}
.toggle-chip:hover { border-color: var(--c1); color: var(--c1); }
.toggle-chip--on {
    background: rgba(26,86,168,.1);
    color: var(--c1);
    border-color: rgba(26,86,168,.35);
}

/* Primary submit button */
.filter-submit-btn {
    border: 0;
    border-radius: 999px;
    padding: 8px 20px;
    background: var(--panel);
    color: #fff;
    font-weight: 700;
    font-size: .84rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s;
}
.filter-submit-btn:hover { opacity: .85; }

.multiselect-wrap { position: relative; }

.multiselect-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.multiselect-btn:disabled { cursor: not-allowed; }

.multiselect-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: max(100%, 220px);
    width: max-content;
    max-width: 340px;
    max-height: 260px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.14);
    padding: 8px;
    z-index: 30;
}

.multiselect-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    font-size: .85rem;
    cursor: pointer;
    user-select: none;
}

.multiselect-option:hover { background: #f1f5f9; }

.multiselect-option input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--c1);
}

.race-header-card {
    background: linear-gradient(135deg, #09101d 0%, #12243f 48%, #2f1708 100%);
    color: #fff;
    overflow: hidden;
}

.race-header-card .section-kicker,
.race-header-card .back-link,
.race-header-card .section-meta,
.race-header-card h2 { color: #fff; }

.race-header {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(120px, 1fr) minmax(0, 1.15fr);
    gap: 18px;
    align-items: center;
}

.candidate-side {
    display: flex;
    align-items: center;
    gap: 16px;
}

.candidate-side.right { justify-content: flex-end; text-align: right; }

.candidate-photo {
    width: 94px;
    height: 94px;
    object-fit: cover;
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.08);
}

.candidate-label {
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .9;
}

.candidate-big {
    font-size: clamp(2.8rem, 4.8vw, 4.15rem);
    line-height: .95;
    font-weight: 900;
    margin: 8px 0 10px;
}

.pct-blue { color: var(--c1); }
.pct-orange { color: var(--c2); }
.race-header-card .pct-blue { color: #8db9ff; }
.race-header-card .pct-orange { color: #ffb37f; }

.candidate-votes {
    font-size: 1rem;
    color: rgba(255,255,255,.78);
}

.race-bar-wrap { display: flex; flex-direction: column; gap: 10px; }

.race-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-btn {
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08);
    color: #fff;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
    cursor: pointer;
}

.race-bar {
    position: relative;
    height: 36px;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 16px 24px rgba(0,0,0,.16);
}

.race-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 40%, rgba(0,0,0,.18));
}

.race-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(255,255,255,.7);
    transform: translateX(-50%);
}

.race-caption {
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,.78);
    font-size: .9rem;
    font-weight: 700;
}

.projection-note {
    color: rgba(255,255,255,.86);
    font-size: .95rem;
    font-weight: 600;
}

.historical-pill {
    display: inline-flex;
    align-self: flex-start;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: rgba(255,255,255,.82);
    font-size: .82rem;
}

.margin-label {
    font-size: .82rem;
    font-weight: 700;
    color: rgba(255,255,255,.72);
    letter-spacing: .04em;
    text-align: center;
    margin-top: 4px;
}

.ticker-strip {
    overflow: hidden;
    padding-block: 12px;
}

.ticker-track {
    display: flex;
    gap: 28px;
    width: max-content;
    animation: ticker-scroll 22s linear infinite;
    white-space: nowrap;
}

.ticker-item {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
}

.ticker-item-static {
    color: var(--text);
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.locator-card {
    padding: 16px 20px;
}

.locator-head h2 {
    margin: 4px 0 0;
    font-size: 1.2rem;
}

.locator-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.locator-input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 1rem;
    background: #fff;
}

.locator-btn {
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    background: var(--panel);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

/* Inline result card */
.locator-result {
    margin-top: 14px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.locator-result__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 8px;
    font-size: 1rem;
}

.locator-result__link {
    font-size: .82rem;
    color: var(--c1);
    text-decoration: none;
    font-weight: 600;
}
.locator-result__link:hover { text-decoration: underline; }

.locator-result__bar {
    display: flex;
    height: 44px;
    font-size: .82rem;
    font-weight: 700;
}

.locator-result__c1 {
    background: var(--c1);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 10px;
    min-width: 60px;
    transition: width .4s ease;
    white-space: nowrap;
    overflow: hidden;
}

.locator-result__c2 {
    background: var(--c2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    min-width: 60px;
    flex: 1;
    transition: width .4s ease;
    white-space: nowrap;
    overflow: hidden;
}

.locator-result__meta {
    padding: 7px 14px;
    font-size: .78rem;
    color: var(--muted);
}

.locator-not-found {
    margin-top: 10px;
    font-size: .88rem;
    color: var(--muted);
    padding: 4px 2px;
}

.info-banner {
    background: rgba(255,255,255,.94);
    color: var(--text);
    border-left: 4px solid var(--accent);
}

.kpi-grid.app-kpis {
    display: grid;
    grid-template-columns: 1.25fr repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.progress-card h3,
.kpi-card h3 {
    margin: 6px 0 12px;
    font-size: 1rem;
    color: var(--muted);
}

.kpi-value {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}

.kpi-subtle {
    color: var(--muted);
    font-size: .92rem;
}

.kpi-card.emphasis {
    background: linear-gradient(135deg, rgba(26,86,168,.08), rgba(240,90,40,.12));
}

.donut-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.donut {
    width: 116px;
    height: 116px;
    transform: rotate(-90deg);
}

.donut-fill { transition: stroke-dasharray .8s ease; }

.donut-text {
    transform: rotate(90deg);
    transform-origin: 18px 18px;
    font-size: .32rem;
    font-weight: 800;
    fill: var(--text);
}

.badge-complete,
.badge-pending {
    display: inline-flex;
    margin-top: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.badge-complete { background: #dcfce7; color: #166534; }
.badge-pending { background: #ffedd5; color: #9a3412; }

.macro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.macro-card {
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(248,250,252,.96));
}

.macro-top,
.macro-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.macro-top h3 { margin: 0; font-size: 1rem; }
.macro-top span,
.macro-votes { color: var(--muted); font-size: .88rem; }

.macro-bar {
    height: 14px;
    border-radius: 999px;
    margin: 14px 0 10px;
}

.app-grid-2 {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 320px;
    gap: 18px;
}

.peru-map {
    min-height: 560px;
    border-radius: 18px;
    background: radial-gradient(circle at center, rgba(255,255,255,.9), rgba(241,245,249,.8));
    position: relative;
}

.peru-map svg { width: 100%; height: 100%; display: block; }

.map-feature {
    stroke: #f8fafc;
    stroke-width: 1.2;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease;
}

.map-feature:hover { opacity: .88; }

.map-feature.is-selected {
    stroke: #0f172a;
    stroke-width: 2.4;
    filter: drop-shadow(0 6px 14px rgba(15, 23, 42, .2));
}

.map-panel {
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, #0f172a, #111827);
    color: #fff;
    min-height: 560px;
}

.map-panel-empty {
    color: rgba(255,255,255,.78);
    display: grid;
    place-items: center;
    min-height: 100%;
    text-align: center;
}

.map-panel-card { margin-bottom: 18px; }

.panel-kicker {
    display: inline-block;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.62);
}

.map-panel h3 { margin: 8px 0 8px; font-size: 1.65rem; }
.panel-big { font-size: 1.3rem; font-weight: 900; }
.panel-margin { color: rgba(255,255,255,.76); margin-top: 6px; }

.panel-split {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0;
    font-weight: 700;
}

.panel-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.panel-meta-grid div {
    background: rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-meta-grid strong { font-size: 1.1rem; }
.panel-meta-grid span { color: rgba(255,255,255,.72); font-size: .82rem; }

.panel-link {
    display: inline-flex;
    text-decoration: none;
    background: #fff;
    color: var(--text);
    padding: 11px 14px;
    border-radius: 12px;
    font-weight: 700;
}

.map-detail-title {
    margin-bottom: 10px;
    font-size: .92rem;
    color: rgba(255,255,255,.75);
}

.map-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.map-detail-list li {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 12px;
}

.detail-row-top,
.detail-row-bottom {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: .84rem;
}

.detail-row-top span { color: rgba(255,255,255,.68); }

.detail-bar {
    height: 10px;
    border-radius: 999px;
    margin: 7px 0;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 14px;
    font-size: .82rem;
    color: var(--muted);
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.map-legend i {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

.map-tooltip {
    position: fixed;
    z-index: 60;
    pointer-events: none;
    background: rgba(15, 23, 42, .94);
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: .82rem;
    box-shadow: 0 12px 22px rgba(0,0,0,.18);
}

.mini-split-bar {
    height: 12px;
    border-radius: 999px;
    margin: 10px 0 12px;
}

.map-mobile-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .28);
    z-index: 99;
}

.map-mobile-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.15);
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.map-mobile-popup.is-open { transform: translateY(0); }

.map-mobile-popup__close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.4rem;
    cursor: pointer;
    border: 0;
    background: transparent;
}

.map-mobile-popup__content h3 {
    margin: 0 0 12px;
    font-size: 1.45rem;
}

.mobile-popup-split {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-weight: 800;
}

.mobile-popup-mesas {
    color: var(--muted);
    margin-bottom: 14px;
}

.mobile-detail-btn {
    display: inline-flex;
    text-decoration: none;
    background: var(--panel);
    color: #fff;
    border-radius: 12px;
    padding: 11px 14px;
    font-weight: 700;
}

.map-fallback,
.chart-empty {
    display: grid;
    place-items: center;
    min-height: 260px;
    color: var(--muted);
    text-align: center;
}

.chart-wrap {
    position: relative;
    height: 360px;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    font-size: .92rem;
    vertical-align: top;
}

th {
    background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(241,245,249,.9));
    color: var(--muted);
}

.num { text-align: right; white-space: nowrap; }

.geo-link {
    color: var(--c1);
    text-decoration: none;
    font-weight: 700;
}

.geo-link:hover { text-decoration: underline; }
.geo-link-mesa { color: var(--accent); }

.vote-count {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .78rem;
}

.winner-cell {
    background: linear-gradient(180deg, rgba(219, 234, 254, .45), rgba(255,255,255,0));
}

.soft { color: var(--muted); }

.estado-badge {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
}

.estado-c { background: #dcfce7; color: #166534; }
.estado-p { background: #fef3c7; color: #92400e; }
.estado-n { background: #fee2e2; color: #991b1b; }

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    color: var(--muted);
    font-size: .9rem;
    padding: 0 4px;
}

.app-footer a { color: var(--c1); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(1.4); }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 1.5s infinite;
    display: inline-block;
    margin-right: 8px;
}

.app-shell-minimal {
    max-width: 1240px;
}

.topbar-minimal {
    margin-bottom: 14px;
}

.race-header-card-minimal {
    margin-bottom: 14px;
}

.minimal-progress-card {
    padding: 16px 20px;
}

.minimal-progress {
    display: flex;
    align-items: center;
    gap: 18px;
}

.minimal-progress-copy h2 {
    margin: 4px 0 8px;
    font-size: clamp(1.25rem, 2vw, 1.85rem);
}

.minimal-progress-copy p {
    margin: 0;
    color: var(--muted);
}

.map-hero-card {
    padding-bottom: 18px;
}

.peru-map-hero {
    min-height: 660px;
}

.map-legend-compact {
    margin-top: 12px;
    margin-bottom: 14px;
}

.macro-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.macro-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease;
}

.macro-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

.chip-c1 {
    background: rgba(26, 86, 168, 0.10);
    color: var(--c1);
    border-color: rgba(26, 86, 168, 0.18);
}

.chip-c2 {
    background: rgba(211, 84, 0, 0.10);
    color: var(--c2);
    border-color: rgba(211, 84, 0, 0.18);
}

.breadcrumb-card {
    padding: 16px 20px;
}

.detail-back-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.breadcrumb-trail {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}

@media (max-width: 1180px) {
    .app-grid-2,
    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-panel { min-height: auto; }
}

@media (max-width: 800px) {
    .kpi-grid.app-kpis {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .kpi-grid.app-kpis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .race-header {
        grid-template-columns: 1fr;
    }
    .candidate-side.right { justify-content: flex-start; text-align: left; }
}

@media (max-width: 720px) {
    .app-shell { padding-inline: 12px; }
    .topbar { flex-direction: column; }
    .topbar-meta { justify-content: flex-start; }
    .donut-row { flex-direction: column; align-items: flex-start; }
    .minimal-progress { flex-direction: column; align-items: flex-start; }
    .detail-back-row { flex-direction: column; align-items: flex-start; }
    .locator-row { flex-direction: column; }
    .race-actions { width: 100%; justify-content: space-between; }
    .candidate-photo { width: 72px; height: 72px; }
    .app-footer { flex-direction: column; align-items: flex-start; }
    .peru-map-hero { min-height: 500px; }
}

@media (max-width: 768px) {
    .map-tooltip { display: none !important; }
}
