:root {
    --bg: #100f0f;
    --panel: #1b1919;
    --panel-2: #231f1f;
    --panel-dark: #121010;
    --text: #f5eded;
    --muted: #c9bcbc;
    --line: #3a3030;
    --red: #c40000;
    --red-dark: #620000;
    --red-soft: #ffb3b3;
    --green-soft: #8fdf8f;
    --grey: #9c9c9c;
    --cream: #fff3dc;
    --radius-small: 13px;
    --radius: 24px;
    --radius-large: 24px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.22);

    --stats-bg: var(--bg);
    --stats-panel: var(--panel);
    --stats-panel-raised: var(--panel-2);
    --stats-border: var(--line);
    --stats-text: var(--text);
    --stats-muted: var(--muted);
    --stats-red: var(--red);
    --stats-red-soft: var(--red-soft);
    --stats-green: var(--green-soft);
    --stats-grey: var(--grey);
    --stats-radius: var(--radius);
    --stats-shadow: var(--shadow);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(196, 0, 0, 0.22), transparent 35%),
        radial-gradient(circle at bottom right, rgba(255, 136, 0, 0.09), transparent 35%),
        var(--bg);
    color: var(--text);
}

button,
select,
input {
    font: inherit;
}

button {
    transition:
        transform 0.18s ease,
        filter 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(255, 179, 179, 0.4);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Shared links and language switchers
   -------------------------------------------------------------------------- */

a {
    color: var(--red-soft);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        text-decoration-color 0.2s ease,
        opacity 0.2s ease;
}

a:visited {
    color: var(--red-soft);
}

a:hover {
    color: #ffffff;
    text-decoration-color: var(--red-soft);
}

a:focus-visible {
    color: #ffffff;
    background: rgba(255, 117, 133, 0.2);
    text-decoration: none;
    border-radius: 4px;
}

a:active {
    color: #ffffff;
    opacity: 0.8;
}

.language-switcher,
.stats-language-switch {
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(19, 15, 18, 0.86);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.language-switcher {
    position: absolute;
    top: 18px;
    right: 24px;
}

.stats-language-switch {
    position: fixed;
    top: 10px;
    right: 14px;
}

.language-switcher a,
.stats-language-switch a {
    display: block;
    padding: 5px 7px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.language-switcher a:visited,
.stats-language-switch a:visited {
    color: var(--muted);
}

.language-switcher a:hover,
.stats-language-switch a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.language-switcher a[aria-current="page"],
.stats-language-switch a[aria-current="page"] {
    color: #ffffff;
    background: var(--red);
}

.language-switcher a:focus-visible,
.stats-language-switch a:focus-visible {
    color: #ffffff;
    outline: 2px solid var(--red-soft);
    outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Main voting page
   -------------------------------------------------------------------------- */

.site-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 28px;
}

.hero {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 34px 0 28px;
    text-align: center;
}

.eyebrow,
.stats-eyebrow {
    margin: 0 0 10px;
    color: var(--red-soft);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(52px, 11vw, 142px);
    line-height: 0.86;
    letter-spacing: -0.08em;
    text-transform: uppercase;
}

.tagline {
    max-width: 1080px;
    margin: 24px auto 0;
    padding: 0 12px;
    color: var(--muted);
    font-size: clamp(18px, 2.4vw, 26px);
    line-height: 1.45;
}

.index-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr) minmax(250px, 0.7fr);
    gap: 18px;
    margin-bottom: 18px;
}

.index-card,
.panel,
.map-card,
.stats-panel,
.summary-card,
.stats-status {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--panel-2), var(--panel));
    box-shadow: var(--shadow);
}

.index-card {
    padding: 26px;
}

.main-index-card {
    background: linear-gradient(135deg, #250000, #640000 58%, #2b0b0b);
    border-color: rgba(255, 120, 120, 0.28);
    transition:
        background 0.4s ease,
        border-color 0.4s ease;
}

.card-label {
    display: block;
    color: var(--red-soft);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.giant-number {
    display: block;
    margin: 12px 0;
    color: #ffffff;
    font-size: clamp(86px, 14vw, 178px);
    font-weight: 950;
    line-height: 0.9;
    letter-spacing: -0.08em;
}

.muted,
.panel-copy,
.map-header p,
.leaderboard-header p,
.footer {
    color: var(--muted);
}

.quote-card p {
    margin: 18px 0 0;
    font-size: 24px;
    font-weight: 850;
    line-height: 1.15;
}


.latest-vote-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    transition: border-color 0.3s ease;
}

.latest-vote-score {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 17px 0 15px;
}

.latest-vote-score strong {
    font-size: clamp(48px, 5vw, 72px);
    font-weight: 950;
    line-height: 0.88;
    letter-spacing: -0.07em;
}

.latest-vote-score small {
    color: var(--muted);
    font-size: 18px;
    font-weight: 900;
}

.latest-vote-score small[hidden] {
    display: none;
}

.latest-vote-location {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.latest-vote-arms:empty {
    display: none;
}

.coat-of-arms-pair-latest {
    min-width: 55px;
}

.coat-of-arms-pair-latest .coat-of-arms-canton {
    width: 21px;
    height: 26px;
}

.coat-of-arms-pair-latest .coat-of-arms-commune {
    width: 34px;
    height: 42px;
}

.latest-vote-location-copy {
    min-width: 0;
}

.latest-vote-location-copy strong,
.latest-vote-location-copy span {
    display: block;
}

.latest-vote-location-copy strong {
    overflow: hidden;
    font-size: 20px;
    font-weight: 950;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-vote-location-copy span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.latest-vote-time {
    display: block;
    margin-top: auto;
    padding-top: 17px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.3;
}

.app-grid {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.panel,
.map-card {
    padding: 22px;
}

.vote-panel h2,
.map-header h2,
.leaderboard h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.panel-copy {
    margin: 10px 0 22px;
    line-height: 1.45;
}

label {
    display: block;
    margin: 18px 0 7px;
    font-weight: 900;
}

select,
.table-controls input,
.table-controls select {
    color: var(--text);
    background: #121010;
    border: 1px solid #4a3d3d;
    border-radius: 13px;
    outline: none;
}

select {
    width: 100%;
    padding: 13px 14px;
}

select option {
    color: var(--text);
    background: var(--panel-dark);
}

.gauge-wrap {
    margin-top: 6px;
    padding: 16px;
    border: 1px solid #3a3030;
    border-radius: 18px;
    background: #121010;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--red);
}

#hateRange {
    accent-color: var(--red);
}

#hateButton {
    transition:
        transform 0.18s ease,
        filter 0.18s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.range-number {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    font-size: 64px;
    font-weight: 950;
    letter-spacing: -0.08em;
}

.range-number small {
    color: var(--muted);
    font-size: 22px;
    letter-spacing: 0;
}

.hate-caption {
    min-height: 42px;
    margin: 0;
    color: var(--cream);
    line-height: 1.35;
    text-align: center;
}

/* Primary voting-page button. Component controls below explicitly reset this. */
button {
    width: 100%;
    margin-top: 18px;
    padding: 15px 16px;
    border: 0;
    border-radius: 15px;
    background: var(--red);
    color: #ffffff;
    cursor: pointer;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.12);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.secondary-button {
    width: auto;
    margin: 0;
    border: 1px solid #524444;
    background: #302929;
    color: var(--text);
    white-space: nowrap;
}

.secondary-button:hover:not(:disabled) {
    background: #463939;
}

.result {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #666666;
    border-radius: 16px;
    background: #202020;
    line-height: 1.45;
}

.result a {
    color: var(--red-soft);
    font-weight: 950;
}

.map-card {
    min-width: 0;
}

.map-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.map-header p {
    margin: 8px 0 0;
}

#mapWrapper {
    display: none;
}

#map,
.map-loader {
    width: 100%;
    height: 680px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #111;
}

.map-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--red-soft);
    font-size: clamp(18px, 2.4vw, 28px);
    font-weight: 950;
    letter-spacing: -0.03em;
    text-align: center;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--panel-dark);
    color: var(--text);
}

.leaflet-popup-content strong {
    color: var(--red-soft);
}

.leaderboard {
    margin-top: 18px;
}

.leaderboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.leaderboard-header p {
    margin: 0;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.leaderboard-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.leaderboard-list li {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
}

.leaderboard-name {
    display: block;
    font-weight: 950;
    line-height: 1.1;
}

.leaderboard-score {
    display: block;
    margin-top: 8px;
    color: var(--red-soft);
    font-size: 28px;
    font-weight: 950;
}

.leaderboard-score-positive {
    color: var(--green-soft);
}

.leaderboard-votes {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.footer {
    margin-top: 26px;
    font-size: 14px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Statistics page
   -------------------------------------------------------------------------- */

body.stats-page {
    min-height: 100vh;
}

.stats-shell {
    width: min(1480px, calc(100% - 32px));
    margin: 0 auto;
    padding: 70px 0 80px;
}

.stats-hero {
    max-width: 900px;
    margin-bottom: 30px;
}

.stats-hero h1 {
    max-width: 850px;
    margin: 0;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.055em;
    text-transform: none;
}

.stats-hero > p:not(.stats-eyebrow) {
    max-width: 720px;
    margin: 20px 0;
    color: var(--muted);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.5;
}

.stats-back-link {
    color: var(--red-soft);
    font-weight: 850;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.stats-status {
    margin: 30px 0;
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.stats-status.is-error {
    border-color: rgba(223, 57, 79, 0.55);
    color: var(--red-soft);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 20px;
}

.summary-card {
    min-width: 0;
    padding: 18px;
}


.summary-card span,
.summary-card small {
    display: block;
    color: var(--muted);
}

.summary-card span {
    margin-bottom: 11px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.summary-card strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 950;
    line-height: 1;
    text-overflow: ellipsis;
}

.summary-card small {
    margin-top: 8px;
    font-size: 14px;
}



.summary-card .summary-activity-value {
    display: flex;
    align-items: baseline;
    gap: 0.22em;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.summary-card .summary-activity-value b {
    display: inline;
    min-width: 0;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.summary-card .summary-activity-value small {
    display: inline;
    flex: 0 0 auto;
    margin: 0;
    color: var(--muted);
    font-size: 0.42em;
    font-weight: 850;
    letter-spacing: -0.015em;
    line-height: 1;
}

.summary-card .summary-activity-value small[hidden] {
    display: none;
}

.stats-panel {
    margin-top: 20px;
    padding: 22px;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin: 0;
    font-size: clamp(22px, 3vw, 34px);
    letter-spacing: -0.025em;
}

.panel-heading p {
    max-width: 780px;
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.segmented-control {
    display: inline-flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.16);
}

.segmented-control button,
.pagination button,
.stats-table th button {
    width: auto;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: normal;
    text-transform: none;
}

.segmented-control button {
    padding: 9px 11px;
    border-radius: 9px;
}

.segmented-control button:hover,
.segmented-control button.is-active {
    background: var(--red);
    color: #ffffff;
    filter: none;
    transform: none;
}

.stats-map {
    height: min(68vh, 720px);
    min-height: 480px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #d7d2d4;
}

.map-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

.map-legend-scale {
    width: min(360px, 55vw);
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #76c893 0%, #f2c14e 50%, #9e1b32 100%);
}

.map-legend-scale.volume {
    background: linear-gradient(90deg, #dad7d9 0%, var(--red-soft) 55%, #9e1b32 100%);
}

.leaflet-container {
    font: inherit;
}

.leaflet-tooltip.stats-map-tooltip {
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    color: #21191e;
}

.map-tooltip-title {
    display: block;
    margin-bottom: 5px;
    font-weight: 900;
}

.table-controls {
    display: flex;
    gap: 9px;
}

.table-controls input,
.table-controls select {
    min-height: 42px;
}

.table-controls input {
    width: min(290px, 42vw);
    padding: 0 12px;
}

.table-controls select {
    width: auto;
    padding: 0 34px 0 12px;
}

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 13px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.stats-table th,
.stats-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.stats-table tr:last-child td {
    border-bottom: 0;
}

.stats-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stats-table th.numeric,
.stats-table td.numeric {
    text-align: right;
}

.stats-table th button {
    padding: 0;
    color: inherit;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: inherit;
    text-transform: inherit;
}

.stats-table th button:hover {
    color: var(--text);
    filter: none;
    transform: none;
}

.stats-table tbody tr[data-bfs] {
    cursor: pointer;
}

.stats-table tbody tr:hover,
.stats-table tbody tr.is-selected {
    background: rgba(223, 57, 79, 0.12);
}

.stats-table .rank-cell {
    color: var(--red-soft);
    font-weight: 950;
}

.stats-table .weighted-cell {
    font-weight: 950;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
}

.pagination button {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.16);
    cursor: pointer;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--red);
    color: #ffffff;
    filter: none;
    transform: none;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.pagination span {
    color: var(--muted);
    font-size: 13px;
}

.stats-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.chart-wrapper {
    position: relative;
    height: 380px;
}

.chart-wrapper-large {
    height: 460px;
}

.empty-row {
    color: var(--muted);
    text-align: center !important;
}

/* --------------------------------------------------------------------------
   Responsive layout
   -------------------------------------------------------------------------- */

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

    .stats-two-column {
        grid-template-columns: 1fr;
    }

    .panel-heading {
        flex-direction: column;
    }
}

@media (max-width: 1120px) {
    .index-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-index-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 980px) {
    .app-grid {
        grid-template-columns: 1fr;
    }

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

    #map,
    .map-loader {
        height: 560px;
    }
}

@media (max-width: 800px) {
    .leaderboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .stats-shell {
        width: min(100% - 18px, 1480px);
        padding-top: 64px;
    }

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

    .stats-panel {
        padding: 14px;
    }

    .table-controls {
        width: 100%;
        flex-direction: column;
    }

    .table-controls input,
    .table-controls select {
        width: 100%;
    }

    .segmented-control {
        width: 100%;
    }

    .segmented-control button {
        flex: 1 1 100px;
    }

    .stats-map {
        min-height: 410px;
    }

    .chart-wrapper,
    .chart-wrapper-large {
        height: 340px;
    }
}

@media (max-width: 600px) {
    .language-switcher {
        top: 8px;
        right: 8px;
        gap: 0;
        padding: 2px;
        border: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .language-switcher a {
        padding: 5px 6px;
        font-size: 10px;
    }
}

@media (max-width: 650px) {
    .index-grid {
        grid-template-columns: 1fr;
    }

    .main-index-card {
        grid-column: auto;
    }
}

@media (max-width: 560px) {
    .site-shell {
        width: min(100% - 20px, 1240px);
        padding-top: 14px;
    }

    .index-card,
    .panel,
    .map-card {
        padding: 16px;
        border-radius: var(--radius);
    }

    .map-header,
    .leaderboard-header {
        display: block;
    }

    .secondary-button {
        width: 100%;
        margin-top: 12px;
    }

    .leaderboard-list {
        grid-template-columns: 1fr;
    }

    #map,
    .map-loader {
        height: 430px;
    }
}

@media (max-width: 430px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .stats-hero h1 {
        font-size: 41px;
    }
}

/* --------------------------------------------------------------------------
   Unified homepage: one statistical map beside the voting panel
   -------------------------------------------------------------------------- */

.stats-section {
    margin-top: 56px;
}

.stats-section-header {
    margin-bottom: 20px;
}

.stats-section .summary-grid {
    margin-top: 20px;
}

.shared-map-card {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.shared-map-header {
    margin-bottom: 14px;
}

.map-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.map-toolbar .segmented-control {
    flex: 0 1 auto;
}

.map-reset-button {
    margin-left: auto;
}

.shared-map-shell {
    position: relative;
    min-height: 680px;
}

.shared-map {
    width: 100%;
    height: 680px;
    min-height: 680px;
}

.map-loader-overlay {
    position: absolute;
    inset: 0;
    z-index: 600;
    width: 100%;
    height: auto;
    min-height: 100%;
    margin: 0;
    border-radius: 14px;
    background: rgba(17, 17, 17, 0.94);
    backdrop-filter: blur(4px);
}

.map-loader-overlay[hidden] {
    display: none;
}

.map-loader-overlay.is-error {
    color: var(--red-soft);
}

.stats-table tbody tr[data-canton] {
    cursor: pointer;
}

.result.is-success {
    border-color: rgba(143, 223, 143, 0.6);
}

.result.is-error {
    border-color: rgba(196, 0, 0, 0.75);
    color: var(--red-soft);
}

@media (max-width: 980px) {
    .shared-map-shell,
    .shared-map {
        min-height: 560px;
        height: 560px;
    }
}

@media (max-width: 720px) {
    .stats-section {
        margin-top: 38px;
    }

    .map-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .map-toolbar .segmented-control,
    .map-reset-button {
        width: 100%;
        margin-left: 0;
    }

    .map-toolbar .segmented-control button {
        flex: 1 1 110px;
    }
}

@media (max-width: 560px) {
    .shared-map-shell,
    .shared-map {
        min-height: 430px;
        height: 430px;
    }
}

/* --------------------------------------------------------------------------
   Evidence Locker masthead and 2 × 2 ranking showcase
   -------------------------------------------------------------------------- */

.stats-section-title {
    width: 100%;
    margin: 56px 0 32px;
    padding: 34px 0 20px;
    text-align: center;
}

.stats-section-title h2 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(44px, 8vw, 104px);
    line-height: 0.9;
    letter-spacing: -0.07em;
    text-transform: uppercase;
}

.stats-tagline {
    max-width: 900px;
    margin: 24px auto 0;
    color: var(--muted);
    font-size: clamp(18px, 2.4vw, 26px);
    line-height: 1.35;
}

.stats-section-eyebrow {
    max-width: 900px;
    margin: 0 auto 10px;
    color: var(--red-soft);
    line-height: 1.35;
}

.stats-section > .stats-status {
    margin: 0 0 18px;
}

.ranking-showcase {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 20px 0 24px;
}

.ranking-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(35, 31, 31, 0.96), rgba(20, 18, 18, 0.96));
    box-shadow: var(--shadow);
}

.ranking-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    content: '';
}

.ranking-card-most::before {
    background: linear-gradient(90deg, var(--red-dark), var(--red-soft));
}

.ranking-card-least::before {
    background: linear-gradient(90deg, #315e31, var(--green-soft));
}

.ranking-card-header {
    min-height: 106px;
}

.ranking-card-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ranking-card-header h3 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.ranking-card-header p {
    max-width: 620px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.final-verdict-header .ranking-card-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ranking-list {
    display: grid;
    gap: 9px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.ranking-list li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
}

.ranking-position {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 950;
}

.ranking-identity {
    min-width: 0;
}

.ranking-identity strong,
.ranking-identity small {
    display: block;
}

.ranking-identity strong {
    overflow: hidden;
    font-weight: 950;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-identity small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.ranking-score {
    color: var(--red-soft);
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 950;
    letter-spacing: -0.05em;
}

.ranking-score-positive {
    color: var(--green-soft);
}

.ranking-empty {
    display: block !important;
    color: var(--muted);
    text-align: center;
}

.stats-section .summary-grid {
    margin-top: 0;
}

@media (max-width: 820px) {
    .ranking-showcase {
        grid-template-columns: 1fr;
    }

    .ranking-card-header {
        min-height: 0;
    }
}

@media (max-width: 520px) {
    .ranking-card {
        padding: 17px;
        border-radius: 18px;
    }

    .ranking-list li {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 11px;
    }

    .ranking-position {
        width: 28px;
        height: 28px;
    }

    .ranking-identity strong {
        white-space: normal;
    }
}


/* --------------------------------------------------------------------------
   V8 geographic ranking switcher
   -------------------------------------------------------------------------- */

.ranking-section {
    margin: 22px 0 28px;
}

.ranking-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.ranking-section-header > div:first-child {
    max-width: 820px;
}

.ranking-section-kicker {
    margin: 0 0 7px;
    color: var(--red-soft);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ranking-section-header h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.ranking-section-header p:not(.ranking-section-kicker) {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.ranking-geography-control {
    margin-bottom: 2px;
}

.ranking-card-polarising::before {
    background: linear-gradient(90deg, var(--red-dark), var(--red-soft));
}

.ranking-card-agreed::before {
    background: linear-gradient(90deg, #245a44, #8fdf8f);
}

.ranking-list li[data-ranking-bfs],
.ranking-list li[data-ranking-canton] {
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.ranking-list li[data-ranking-bfs]:hover,
.ranking-list li[data-ranking-canton]:hover {
    border-color: rgba(255, 179, 179, 0.35);
    background: rgba(255, 255, 255, 0.055);
    transform: translateY(-1px);
}

.ranking-list li[data-ranking-bfs]:focus-visible,
.ranking-list li[data-ranking-canton]:focus-visible {
    outline: 3px solid rgba(255, 179, 179, 0.4);
    outline-offset: 2px;
}

.ranking-score-unit {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-align: right;
    text-transform: uppercase;
}

.ranking-threshold-note {
    margin: -6px 2px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: right;
}

@media (max-width: 820px) {
    .ranking-section-header {
        display: block;
    }

    .ranking-geography-control {
        width: 100%;
        margin-top: 16px;
    }

    .ranking-geography-control button {
        flex: 1 1 0;
    }

    .ranking-threshold-note {
        text-align: left;
    }
}


/* --------------------------------------------------------------------------
   V9 shared ranking/table geography switch
   -------------------------------------------------------------------------- */

.prosecution-panels {
    margin-top: 24px;
}

.prosecution-panel {
    margin-top: 0;
}

.prosecution-panel[hidden] {
    display: none;
}

.ranking-card-polarising::before {
    background: linear-gradient(90deg, var(--red-dark), var(--red-soft));
}

/* --------------------------------------------------------------------------
   Coats of arms and location identities
   -------------------------------------------------------------------------- */

.coat-of-arms {
    display: block;
    width: 30px;
    height: 36px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}

.coat-of-arms[hidden],
.location-heraldry[hidden] {
    display: none !important;
}

.coat-of-arms-large {
    width: 58px;
    height: 68px;
}

.coat-of-arms-table {
    width: 27px;
    height: 32px;
}

.coat-of-arms-ranking {
    width: 39px;
    height: 47px;
}

.coat-of-arms-tooltip {
    width: 42px;
    height: 50px;
}

.coat-of-arms-pair {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.coat-of-arms-pair .coat-of-arms-canton {
    width: 22px;
    height: 27px;
    margin: 0;
    transform: none;
}

.coat-of-arms-pair .coat-of-arms-commune {
    width: 34px;
    height: 41px;
    margin: 0;
    transform: none;
}

.coat-of-arms-pair-ranking {
    min-width: 64px;
}

.coat-of-arms-pair-ranking .coat-of-arms-canton {
    width: 24px;
    height: 29px;
}

.coat-of-arms-pair-ranking .coat-of-arms-commune {
    width: 36px;
    height: 44px;
}

.coat-of-arms-pair-tooltip {
    min-width: 67px;
}

.coat-of-arms-pair-tooltip .coat-of-arms-canton {
    width: 25px;
    height: 31px;
}

.coat-of-arms-pair-tooltip .coat-of-arms-commune {
    width: 38px;
    height: 46px;
}

.coat-of-arms-pair-result {
    min-width: 84px;
}

.coat-of-arms-pair-result .coat-of-arms-canton {
    width: 30px;
    height: 36px;
}

.coat-of-arms-pair-result .coat-of-arms-commune {
    width: 46px;
    height: 55px;
}

.location-heraldry {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 14px 0 4px;
    padding: 13px 14px;
    border: 1px solid rgba(255, 179, 179, 0.22);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(196, 0, 0, 0.12), rgba(0, 0, 0, 0.2));
}

.location-heraldry-arms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
}

#selectedCantonCoat {
    width: 30px;
    height: 36px;
    margin: 0;
    transform: none;
}

#selectedCommuneCoat {
    width: 58px;
    height: 68px;
    margin: 0;
    transform: none;
}

.location-heraldry-copy {
    min-width: 0;
}

.location-heraldry-copy span,
.location-heraldry-copy strong,
.location-heraldry-copy small {
    display: block;
}

.location-heraldry-copy span {
    margin-bottom: 4px;
    color: var(--red-soft);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.location-heraldry-copy strong {
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.15;
}

.location-heraldry-copy small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.location-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    font-weight: 850;
}

.location-label-canton {
    font-weight: 750;
}

.ranking-identity-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ranking-identity-main strong {
    min-width: 0;
}

.map-tooltip-location {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 7px;
}

.map-tooltip-location > span:not(.coat-of-arms-pair) {
    display: block;
    min-width: 0;
}

.map-tooltip-location .map-tooltip-title {
    margin-bottom: 0;
    line-height: 1.15;
}

.map-tooltip-location small {
    display: block;
    margin-top: 3px;
    color: rgba(33, 25, 30, 0.72);
}

.result-location {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.result-location strong,
.result-location span {
    display: block;
}

.result-location span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 560px) {
    .location-heraldry {
        align-items: flex-start;
    }

    #selectedCantonCoat {
        width: 25px;
        height: 30px;
    }

    #selectedCommuneCoat {
        width: 50px;
        height: 59px;
    }

    .ranking-identity-main {
        align-items: flex-start;
    }

    .coat-of-arms-pair-ranking .coat-of-arms-canton {
        width: 20px;
        height: 24px;
    }

    .coat-of-arms-pair-ranking .coat-of-arms-commune {
        width: 32px;
        height: 39px;
    }
}

/* --------------------------------------------------------------------------
   Final verdict cards
   -------------------------------------------------------------------------- */

.final-verdict-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 28px;
}

.final-verdict-grid[hidden] {
    display: none !important;
}

.final-verdict-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(35, 31, 31, 0.96), rgba(20, 18, 18, 0.96));
    box-shadow: var(--shadow);
    cursor: pointer;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease;
}

.final-verdict-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    content: '';
}

.final-verdict-card-hate::before {
    background: linear-gradient(90deg, var(--red-dark), var(--red-soft));
}

.final-verdict-card-unhate::before {
    background: linear-gradient(90deg, #315e31, var(--green-soft));
}

.final-verdict-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 179, 179, 0.32);
}

.final-verdict-card:focus-visible {
    outline: 3px solid rgba(255, 179, 179, 0.4);
    outline-offset: 3px;
}

.final-verdict-header {
    min-height: 106px;
}

.final-verdict-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.final-verdict-header h3 {
    max-width: 620px;
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.final-verdict-header p {
    max-width: 620px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.final-verdict-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "location score"
        "metrics metrics";
    gap: 18px 24px;
    align-items: center;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.final-verdict-location {
    grid-area: location;
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.final-verdict-location > div {
    min-width: 0;
}

.final-verdict-location > div > strong,
.final-verdict-location > div > span {
    display: block;
}

.final-verdict-location > div > strong {
    overflow-wrap: anywhere;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.035em;
}

.final-verdict-location > div > span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.final-verdict-score-block {
    grid-area: score;
    text-align: right;
}

.final-verdict-score-block > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.final-verdict-score-block strong {
    color: var(--red-soft);
    font-size: clamp(44px, 6vw, 72px);
    font-weight: 950;
    line-height: 0.82;
    letter-spacing: -0.075em;
}

.final-verdict-card-unhate .final-verdict-score-block strong {
    color: var(--green-soft);
}

.final-verdict-score-block small {
    margin-left: 3px;
    color: var(--muted);
    font-size: 15px;
    letter-spacing: 0;
}

.final-verdict-metrics {
    grid-area: metrics;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.final-verdict-metrics div {
    position: relative;
    min-width: 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.final-verdict-card:focus-within,
.final-verdict-card:hover {
    z-index: 20;
}

.final-verdict-metrics dt {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.final-verdict-metrics dd {
    margin: 7px 0 0;
    font-size: 19px;
    font-weight: 950;
    line-height: 1;
}

.final-verdict-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 980px) {
    .final-verdict-grid {
        grid-template-columns: 1fr;
    }

    .final-verdict-header {
        min-height: 0;
    }
}

@media (max-width: 620px) {
    .final-verdict-card {
        padding: 18px;
        border-radius: 18px;
    }

    .final-verdict-content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "location"
            "score"
            "metrics";
        align-items: start;
    }

    .final-verdict-score-block {
        text-align: left;
    }

    .final-verdict-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Score summary cards: keep the /100 unit visible at every width. */
.summary-card .summary-score {
    display: flex;
    align-items: baseline;
    gap: 0.08em;
    overflow: visible;
    font-size: clamp(28px, 2.45vw, 40px);
    letter-spacing: -0.055em;
    text-overflow: clip;
    white-space: nowrap;
}

.summary-card .summary-score b {
    display: inline;
    min-width: 0;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.summary-card .summary-score small {
    display: inline;
    flex: 0 0 auto;
    margin: 0;
    color: inherit;
    font-size: 0.54em;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
}

.summary-card .summary-score small[hidden] {
    display: none;
}


/* --------------------------------------------------------------------------
   Navigation, methodology, lazy charts and mobile evidence tables
   -------------------------------------------------------------------------- */

:root {
    --line-strong: #554747;
}

#vote,
#statistics {
    scroll-margin-top: 24px;
}

.section-jump-nav {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(18, 16, 16, 0.58);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.section-jump-nav a,
.section-jump-nav .section-jump-button {
    width: auto;
    margin: 0;
    padding: 9px 13px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: none;
}

.section-jump-nav a:hover,
.section-jump-nav a:focus-visible,
.section-jump-nav .section-jump-button:hover:not(:disabled),
.section-jump-nav .section-jump-button:focus-visible {
    background: rgba(196, 0, 0, 0.25);
    color: #ffffff;
    filter: none;
    transform: none;
}

.section-jump-divider {
    width: 1px;
    height: 20px;
    flex: 0 0 auto;
    background: var(--line);
}

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1150;
    padding: 10px 13px;
    border: 1px solid rgba(255, 179, 179, 0.28);
    border-radius: 999px;
    background: rgba(18, 15, 15, 0.92);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.back-to-top:hover {
    background: var(--red);
    color: #ffffff;
}

.back-to-top[hidden] {
    display: none;
}

.footer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.footer-languages {
    margin-top: 8px;
}

.methodology-dialog {
    width: min(760px, calc(100% - 28px));
    max-height: min(86vh, 900px);
    padding: 0;
    border: 1px solid rgba(255, 179, 179, 0.28);
    border-radius: 22px;
    background: linear-gradient(145deg, #241f1f, #151313);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
    color: var(--text);
}

.methodology-dialog::backdrop {
    background: rgba(4, 3, 3, 0.76);
    backdrop-filter: blur(6px);
}

.methodology-dialog-inner {
    overflow-y: auto;
    max-height: min(86vh, 900px);
    padding: 24px;
}

.methodology-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.methodology-dialog-header h2 {
    margin: 7px 0 0;
    font-size: clamp(28px, 5vw, 46px);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.dialog-close {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 25px;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
}

.methodology-intro {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
}

.methodology-dialog section {
    margin-top: 20px;
    padding: 17px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.16);
}

.methodology-dialog section h3 {
    margin: 0;
    font-size: 19px;
}

.methodology-dialog section p {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.methodology-dialog code {
    display: block;
    overflow-x: auto;
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    color: var(--red-soft);
    white-space: nowrap;
}

.chart-panel[data-chart-state="idle"] .chart-wrapper,
.chart-panel[data-chart-state="loading"] .chart-wrapper {
    opacity: 0.32;
}

.chart-panel[data-chart-state="error"] .chart-wrapper {
    display: none;
}

.chart-lazy-status {
    margin: 4px 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.chart-panel[data-chart-state="error"] .chart-lazy-status {
    padding: 13px 14px;
    border: 1px solid rgba(196, 0, 0, 0.45);
    border-radius: 12px;
    color: var(--red-soft);
    background: rgba(196, 0, 0, 0.08);
}

.table-row-toggle,
.mobile-table-details-row {
    display: none;
}

@media (max-width: 720px) {
    .chart-wrapper,
    .chart-wrapper-large {
        height: 295px;
    }
}

@media (max-width: 620px) {
    .section-jump-nav {
        width: 100%;
        border-radius: 16px;
    }

    .section-jump-nav a,
    .section-jump-nav .section-jump-button {
        flex: 1 1 130px;
        text-align: center;
    }

    .section-jump-divider {
        display: none;
    }

    .stats-table th:nth-child(3),
    .stats-table th:nth-child(4),
    .stats-table th:nth-child(5),
    .stats-table tbody tr[data-bfs] > td:nth-child(3),
    .stats-table tbody tr[data-bfs] > td:nth-child(4),
    .stats-table tbody tr[data-bfs] > td:nth-child(5),
    .stats-table tbody tr[data-canton] > td:nth-child(3),
    .stats-table tbody tr[data-canton] > td:nth-child(4),
    .stats-table tbody tr[data-canton] > td:nth-child(5) {
        display: none;
    }

    .stats-table th,
    .stats-table td {
        padding: 11px 9px;
    }

    .stats-table .rank-cell {
        width: 58px;
    }

    .rank-cell > span {
        display: block;
    }

    .table-row-toggle {
        display: grid;
        width: 24px;
        height: 24px;
        margin: 6px 0 0;
        padding: 0;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.05);
        color: var(--muted);
        font-size: 16px;
        line-height: 1;
        letter-spacing: 0;
        text-transform: none;
    }

    .table-row-toggle:hover:not(:disabled),
    .table-row-toggle:focus-visible {
        border-color: var(--red-soft);
        color: #ffffff;
        filter: none;
        transform: none;
    }

    .mobile-table-details-row:not([hidden]) {
        display: table-row;
    }

    .mobile-table-details-row td {
        padding: 0 9px 12px;
        border-bottom: 1px solid var(--line);
        white-space: normal;
    }

    .mobile-table-details-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        margin: 0;
        padding: 10px;
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.2);
    }

    .mobile-table-details-grid div {
        min-width: 0;
    }

    .mobile-table-details-grid dt {
        color: var(--muted);
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .mobile-table-details-grid dd {
        margin: 5px 0 0;
        overflow-wrap: anywhere;
        font-size: 13px;
        font-weight: 900;
    }

    .methodology-dialog-inner {
        padding: 18px;
    }

    .back-to-top {
        right: 10px;
        bottom: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.stats-table tbody tr[data-bfs]:focus-visible,
.stats-table tbody tr[data-canton]:focus-visible {
    outline: 3px solid rgba(255, 179, 179, 0.42);
    outline-offset: -3px;
    background: rgba(223, 57, 79, 0.12);
}

@media (max-width: 620px) {
    .stats-table tbody tr[data-bfs] > td:nth-child(2),
    .stats-table tbody tr[data-canton] > td:nth-child(2) {
        white-space: normal;
    }

    .mobile-table-details-row:hover {
        background: transparent;
    }
}
