/* Reusable UI pieces. One block per component, named block__element--modifier. */

/* Icon button (nav) */
.icon-btn {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.icon-btn img {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    opacity: 0.8;
}

/* Card */
.card {
    padding: var(--sp-4);
    background: var(--c-white);
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.card--stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.card__title {
    margin-bottom: var(--sp-2);
    font-size: var(--fs-lg);
    font-weight: 700;
}

/* Form field (label + select) */
.field__label {
    display: block;
    margin-bottom: var(--sp-1);
    font-size: var(--fs-md);
    font-weight: 700;
}

.field__select {
    width: 100%;
    padding: var(--sp-2);
    font-size: var(--fs-sm);
    background: var(--c-slate-50);
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius-sm);
    outline: none;
}

.field__select:focus {
    border-color: var(--c-primary-light);
}

/* Layer list */
.layer-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--c-slate-600);
}

.layer-item__label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    cursor: pointer;
}

.layer-item__icon {
    width: 16px;
    height: 16px;
}

/* Toggle switch: <span.switch><input.switch__input><span.switch__track></span> */
.switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.switch__input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.switch__track {
    width: 40px;
    height: 24px;
    background: var(--c-switch-off);
    border-radius: var(--radius-full);
    transition: background-color 0.2s;
}

.switch__track::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    background: var(--c-white);
    border-radius: var(--radius-full);
    transition: transform 0.2s;
}

.switch__input:checked + .switch__track {
    background: var(--c-primary);
}

.switch__input:checked + .switch__track::after {
    transform: translateX(16px);
}

.switch__input:focus-visible + .switch__track {
    box-shadow: 0 0 0 2px var(--c-primary-light);
}

/* Tabs */
.tabs {
    overflow: hidden;
    background: var(--c-white);
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius-sm);
}

.tabs__list {
    display: flex;
    border-bottom: 1px solid var(--c-slate-200);
}

.tabs__tab {
    flex: 1;
    padding: var(--sp-2) 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-slate-500);
    background: var(--c-white);
    border: 0;
    cursor: pointer;
}

.tabs__tab + .tabs__tab {
    border-left: 1px solid var(--c-slate-200);
}

.tabs__tab[aria-selected="true"] {
    color: var(--c-slate-800);
    background: var(--c-slate-100);
}

/* Log / message box */
.log {
    height: 128px;
    overflow-y: auto;
    padding: var(--sp-3);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    line-height: 1.625;
    color: var(--c-slate-700);
    background: var(--c-slate-50);
}

.log--text {
    font-family: var(--font-sans);
}

.log__line--success {
    color: var(--c-success);
}

.log__line--error {
    color: var(--c-danger);
}

.log__cursor {
    color: var(--c-slate-400);
    animation: blink 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

/* Tools and legend over the map */
.map-dock {
    position: absolute;
    right: 40px;
    bottom: 40px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-2);
    width: 240px;
    max-height: calc(100% - 80px);
}

/* Map legend: a card with an X in its corner; hidden, a button takes the same corner */
.legend-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    background: var(--c-white);
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.legend-panel[hidden],
.map-dock--legend-hidden .legend-panel,
.map-dock:not(.map-dock--legend-hidden) .legend-show {
    display: none;
}

.legend-panel__close {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    color: var(--c-slate-500);
    background: var(--c-white);
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.legend-panel__close:hover {
    color: var(--c-slate-800);
    background: var(--c-slate-100);
}

.legend {
    min-height: 0;
    overflow-y: auto;
    padding: var(--sp-3);
}

.legend__block:first-child .legend__title {
    padding-right: var(--sp-4);
}

.legend-show {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 6px var(--sp-3);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--c-slate-700);
    background: var(--c-white);
    border: 1px solid var(--c-slate-300);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.legend-show:hover {
    color: var(--c-primary);
    border-color: var(--c-primary);
}

.legend__title {
    margin-bottom: var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--c-slate-700);
}

.legend__ramp {
    height: 12px;
    border-radius: var(--radius-full);
    background: linear-gradient(to right, var(--ramp-low), var(--ramp-mid), var(--ramp-high));
}

.legend__labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--sp-1);
    font-size: var(--fs-2xs);
    font-weight: 700;
    color: var(--c-slate-500);
}

/* Chart section (right panel) */
.chart-section__title {
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--c-primary-dark);
    border-bottom: 1px solid var(--c-slate-200);
}

/* Info note */
.note {
    padding: var(--sp-3);
    font-size: var(--fs-xs);
    font-style: italic;
    color: var(--c-info-text);
    background: var(--c-info-bg);
    border: 1px solid var(--c-info-border);
    border-radius: var(--radius-md);
}

/* Legend blocks built from manifest styles (js/legend.js) */
.legend[hidden] {
    display: none;
}

.legend__block + .legend__block {
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--c-slate-200);
}

.legend__item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    line-height: 1.6;
}

.legend__swatch {
    flex: none;
    width: 14px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgb(0 0 0 / 0.15);
}

.legend__labels--hint {
    font-weight: 400;
}

/* Basemap selector: bottom left beside the zoom buttons, its list opens upwards */
.basemap-select {
    position: absolute;
    left: 47px;
    bottom: 10px;
    z-index: 1001;
}

.basemap-select__button {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 29px;
    padding: 0 var(--sp-2);
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--c-slate-700);
    white-space: nowrap;
    background: var(--c-white);
    border: 1px solid var(--c-slate-300);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.basemap-select__button:hover,
.basemap-select__button[aria-expanded="true"] {
    color: var(--c-primary);
    border-color: var(--c-primary);
}

.basemap-select__caption {
    color: var(--c-slate-500);
}

.basemap-select__name {
    font-weight: 700;
}

.basemap-select__chevron {
    flex: none;
    transition: transform 0.15s ease;
}

.basemap-select__button[aria-expanded="true"] .basemap-select__chevron {
    transform: rotate(180deg);
}

.basemap-select__swatch {
    flex: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--c-slate-300);
    border-radius: var(--radius-sm);
}

.basemap-select__list {
    position: absolute;
    left: 0;
    bottom: calc(100% + var(--sp-1));
    min-width: 100%;
    margin: 0;
    padding: var(--sp-1);
    list-style: none;
    background: var(--c-white);
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.basemap-select__option {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 6px var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--c-slate-700);
    white-space: nowrap;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.basemap-select__option:hover,
.basemap-select__option:focus {
    background: var(--c-slate-100);
    outline: 0;
}

.basemap-select__option:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: -2px;
}

.basemap-select__option[aria-selected="true"] {
    font-weight: 700;
    color: var(--c-primary-dark);
    background: var(--c-info-bg);
}

/* Phones: swatch only, beside the + button, so the map credit stays readable */
@media (max-width: 600px) {
    .basemap-select {
        bottom: 39px;
    }

    .basemap-select__caption,
    .basemap-select__name {
        display: none;
    }
}

/* Status message over the map */
.map-status {
    position: absolute;
    top: var(--sp-4);
    left: 50%;
    z-index: 1000;
    transform: translateX(-50%);
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--fs-sm);
    background: var(--c-white);
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* Layer groups and inline fields */
.layer-group {
    margin-top: var(--sp-3);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--c-slate-500);
}

.layer-group:first-child {
    margin-top: 0;
}

.field--inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
}

.field--inline .field__label {
    flex-shrink: 0;
    white-space: nowrap;
}

.field--inline input[type="range"] {
    flex: 1;
    min-width: 0;
}

/* Year slider under the horizon selector: step buttons, slider, first/last year */
.year-slider__row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.year-slider__row input[type="range"] {
    flex: 1;
    min-width: 0;
}

.year-slider__step {
    flex: none;
    width: 28px;
    height: 28px;
    font: inherit;
    font-size: var(--fs-md);
    line-height: 1;
    color: var(--c-slate-800);
    background: var(--c-white);
    border: 1px solid var(--c-slate-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.year-slider__step:hover:not(:disabled) {
    border-color: var(--c-slate-600);
}

.year-slider__step:disabled {
    opacity: 0.4;
    cursor: default;
}

.year-slider__ends {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: var(--fs-xs);
    color: var(--c-slate-600);
}

.field__select:disabled {
    opacity: 0.5;
}

/* Info blocks and tables */
.info {
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--c-slate-700);
}

.info p + p {
    margin-top: var(--sp-1);
}

.info a {
    color: var(--c-primary);
}

.badge {
    padding: 0 var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: 700;
    border-radius: var(--radius-full);
    background: var(--c-slate-100);
}

.badge--approved {
    color: var(--c-badge-ok-text);
    background: var(--c-badge-ok-bg);
}

.badge--draft,
.badge--reviewed {
    color: var(--c-badge-wait-text);
    background: var(--c-badge-wait-bg);
}

.table-wrap {
    max-height: 260px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-xs);
}

.data-table th {
    position: sticky;
    top: 0;
    text-align: left;
    background: var(--c-slate-100);
}

.data-table th,
.data-table td {
    padding: 3px var(--sp-1);
    border-bottom: 1px solid var(--c-slate-200);
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table .neg {
    color: var(--c-neg-text);
    font-weight: 700;
}

.data-table .pos {
    color: var(--c-pos-text);
    font-weight: 700;
}

.data-table tr.is-selected td {
    background: var(--c-info-bg);
}

/* The map is clickable: a crosshair, a grabbing hand while it is dragged */
.map .maplibregl-canvas-container.maplibregl-interactive {
    cursor: crosshair;
}

.map .maplibregl-canvas-container.maplibregl-interactive:active {
    cursor: grabbing;
}

.maplibregl-map {
    font-family: var(--font-sans);
}

/* Clicked point */
.map-point {
    width: 14px;
    height: 14px;
    background: var(--c-white);
    border: 2px solid var(--c-primary-dark);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

/* Map popup as a table */
.table-popup .maplibregl-popup-content {
    min-width: 320px;
    max-height: min(520px, calc(100vh - 140px));
    overflow-y: auto;
    padding: 26px 12px 12px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.table-popup .maplibregl-popup-close-button {
    width: 24px;
    height: 24px;
    font-size: 18px;
    color: var(--c-slate-500);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    border: 1px solid var(--c-slate-300);
}

.info-table th,
.info-table td {
    padding: 4px var(--sp-2);
    vertical-align: top;
    text-align: left;
    border: 1px solid var(--c-slate-200);
}

.info-table tbody th[scope="row"] {
    font-weight: 400;
    white-space: nowrap;
    color: var(--c-slate-600);
    background: var(--c-slate-50);
}

.info-table td {
    color: var(--c-slate-800);
}

.info-table .info-table__heading th {
    white-space: nowrap;
    font-weight: 700;
    color: var(--c-primary-dark);
    background: var(--c-info-border);
    border-color: var(--c-slate-300);
}

.info-table .identify__row td:first-child {
    min-width: 168px;
}

.info-table .identify__row:nth-child(odd) td {
    background: var(--c-slate-50);
}

.info-table .info-table__value {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.info-table .info-table__value--muted {
    font-weight: 400;
    color: var(--c-slate-400);
}

.info-table .info-table__unit {
    color: var(--c-slate-600);
    white-space: nowrap;
}

.identify__swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -1px;
    border: 1px solid rgb(0 0 0 / 0.2);
    border-radius: 2px;
}

.identify__swatch--none {
    background: repeating-linear-gradient(45deg, var(--c-slate-200) 0 2px, var(--c-white) 2px 4px);
}

/* Tab on the map edge that hides or shows the right panel */
.panel-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 56px;
    padding: 0;
    color: var(--c-slate-600);
    background: var(--c-white);
    border: 1px solid var(--c-slate-300);
    border-right: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    box-shadow: var(--shadow-md);
    transform: translateY(-50%);
    cursor: pointer;
}

.panel-toggle:hover {
    color: var(--c-primary);
}

.panel-toggle svg {
    transition: transform 0.2s ease;
}

.panel-toggle[aria-expanded="false"] svg {
    transform: rotate(180deg);
}

/* Right panel: sticky heading with the selected scenario */
.insights-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    margin: 0 calc(-1 * var(--sp-4));
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-slate-50);
    border-bottom: 1px solid var(--c-slate-200);
}

.insights-head__title {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--c-primary-dark);
}

.insights-head__scenario {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--c-slate-600);
    text-align: right;
}

/* Process strip: data → model → explanation → forecast */
.pipeline {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pipeline__step {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 6px 2px 6px 15px;
    font-size: var(--fs-2xs);
    line-height: 1.3;
    color: var(--c-slate-700);
    background: var(--c-info-border);
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%);
}

.pipeline__step + .pipeline__step {
    margin-left: -6px;
}

.pipeline__step:first-child {
    padding-left: 8px;
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%);
}

.pipeline__stage {
    font-weight: 700;
    color: var(--c-primary-dark);
}

.pipeline__main {
    font-size: var(--fs-sm);
    white-space: nowrap;
}

.pipeline__detail {
    white-space: nowrap;
}

/* Question sections */
.insight {
    background: var(--c-white);
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius-md);
}

.insight__head {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--c-primary-dark);
    list-style: none;
    cursor: pointer;
}

.insight__head::-webkit-details-marker {
    display: none;
}

.insight__head::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid var(--c-slate-400);
    border-bottom: 2px solid var(--c-slate-400);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.insight[open] > .insight__head::after {
    transform: rotate(45deg);
}

.insight__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: var(--fs-xs);
    color: var(--c-on-accent);
    background: var(--c-primary);
    border-radius: var(--radius-full);
}

.insight__body {
    padding: 0 var(--sp-3) var(--sp-3);
}

.insight__subtitle {
    margin: var(--sp-3) 0 var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--c-slate-700);
}

.insight__body > .insight__subtitle:first-child {
    margin-top: 0;
}

.insight__hint {
    margin-top: var(--sp-1);
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--c-slate-500);
}

.chart-box {
    position: relative;
    height: 180px;
}

.chart-box--classes {
    height: 132px;
}

/* KPI tiles */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-2);
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--sp-2);
    background: var(--c-slate-50);
    border: 1px solid var(--c-slate-200);
    border-radius: var(--radius-md);
}

.kpi__label {
    font-size: var(--fs-xs);
    line-height: 1.3;
    color: var(--c-slate-600);
}

.kpi__value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--c-slate-800);
    font-variant-numeric: tabular-nums;
}

.kpi__value small {
    margin-left: 4px;
    font-size: var(--fs-xs);
    font-weight: 400;
    color: var(--c-slate-500);
}

.kpi__note {
    font-size: var(--fs-xs);
    line-height: 1.3;
    color: var(--c-slate-500);
}

.kpi__meter {
    display: block;
    height: 5px;
    overflow: hidden;
    background: var(--c-slate-200);
    border-radius: var(--radius-full);
}

.kpi__meter span {
    display: block;
    height: 100%;
    background: var(--c-primary);
}

/* Reading guide of the selected map */
.guide {
    margin-top: var(--sp-3);
    padding: var(--sp-2);
    background: var(--c-info-bg);
    border-radius: var(--radius-md);
}

.guide:empty {
    display: none;
}

.guide__line {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--c-slate-700);
}

.guide__line b {
    color: var(--c-info-text);
    white-space: nowrap;
}

.guide__line + .guide__line {
    margin-top: 2px;
}

/* Scenario grid: rows SSP, columns year */
.matrix {
    display: grid;
    grid-template-columns: 62px repeat(var(--matrix-columns, 3), minmax(0, 1fr));
    gap: 3px;
    align-items: stretch;
}

.matrix__head {
    font-size: var(--fs-xs);
    font-weight: 700;
    text-align: center;
    color: var(--c-slate-600);
}

.matrix__row-head {
    display: flex;
    align-items: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--c-slate-600);
}

.matrix__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 2px;
    font: inherit;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.matrix__cell b {
    font-size: var(--fs-md);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.matrix__cell small {
    font-size: var(--fs-2xs);
}

.matrix__cell:hover {
    border-color: var(--c-slate-400);
}

.matrix__cell.is-selected {
    border-color: var(--c-slate-800);
}

/* Many years: one row per year, scrolls inside the card with the SSP header kept on top */
.matrix--years-as-rows {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 2px;
}

.matrix--years-as-rows .matrix__head,
.matrix--years-as-rows .matrix__corner {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 2px 0;
    background: var(--c-white);
}

.matrix--years-as-rows .matrix__cell {
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    padding: 3px 2px;
}

.matrix__cell--empty {
    background: var(--c-slate-100);
    cursor: default;
}

/* Bars growing left or right from zero */
.bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bars__row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) 48px;
    align-items: center;
    gap: var(--sp-2);
    padding: 1px 2px;
    font-size: var(--fs-xs);
    border-radius: var(--radius-sm);
}

.bars--provinces .bars__row {
    grid-template-columns: 92px minmax(0, 1fr) 54px;
    cursor: pointer;
}

.bars--provinces .bars__row:hover,
.bars__row.is-selected {
    background: var(--c-info-bg);
}

.bars__row--total {
    margin-top: 2px;
    padding-top: 4px;
    font-weight: 700;
    border-top: 1px solid var(--c-slate-300);
}

.bars__label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--c-slate-700);
}

.bars__track {
    position: relative;
    height: 12px;
    background: linear-gradient(var(--c-slate-300), var(--c-slate-300)) center / 1px 100% no-repeat;
}

.bars__fill {
    position: absolute;
    top: 1px;
    bottom: 1px;
    border-radius: 2px;
}

.bars__value {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--c-slate-800);
}

.bars__value small {
    font-size: var(--fs-2xs);
    white-space: nowrap;
    color: var(--c-slate-500);
}

/* Share of importance per driver group */
.strip {
    display: flex;
    gap: 2px;
    height: 14px;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.strip__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 2px var(--sp-3);
    margin: var(--sp-1) 0 var(--sp-2);
}

.strip__key {
    font-size: var(--fs-xs);
    color: var(--c-slate-600);
}

.strip__key i {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-radius: 2px;
}

/* Reliability: gauges, change vs error, test rounds */
.gauges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-2);
}

.gauge {
    margin: 0;
    text-align: center;
}

.gauge path {
    fill: none;
    stroke-width: 11;
    stroke-linecap: butt;
}

.gauge__track {
    stroke: var(--c-slate-200);
}

.gauge__fill {
    stroke: var(--c-primary);
}

.gauge text {
    font-family: var(--font-sans);
    font-size: 21px;
    font-weight: 700;
    fill: var(--c-slate-800);
}

.gauge figcaption {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--c-slate-500);
}

.gauge figcaption b {
    color: var(--c-slate-700);
}

.versus {
    margin-top: var(--sp-3);
}

.versus__row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) 34px;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    color: var(--c-slate-600);
}

.versus__row + .versus__row {
    margin-top: 3px;
}

.versus__row b {
    text-align: right;
    color: var(--c-slate-800);
    font-variant-numeric: tabular-nums;
}

.versus__track {
    height: 10px;
    background: var(--c-slate-100);
    border-radius: 2px;
}

.versus__fill {
    display: block;
    height: 100%;
    border-radius: 2px;
}

.versus__fill--signal {
    background: var(--c-primary);
}

.versus__fill--noise {
    background: var(--c-slate-400);
}

.folds {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

.folds__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    font-size: var(--fs-xs);
    color: var(--c-slate-600);
    background: var(--c-slate-100);
    border-radius: var(--radius-full);
}

.folds__chip i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.folds__chip b {
    color: var(--c-slate-800);
}

.map-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    margin-top: var(--sp-2);
}

.chip-btn {
    padding: 3px var(--sp-2);
    font: inherit;
    font-size: var(--fs-xs);
    color: var(--c-primary-dark);
    background: var(--c-white);
    border: 1px solid var(--c-info-border);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.chip-btn:hover {
    border-color: var(--c-primary);
}

.chip-btn[aria-pressed="true"] {
    color: var(--c-on-accent);
    background: var(--c-primary);
    border-color: var(--c-primary);
}
