/* Base-Schriftgröße */
html { font-size: 18px; }

/* Reset & Base Styles */
.leaflet-interactive:focus {
    outline: none;
}
 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: #f7f8fb;
            color: #333;
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
        }

/* Header */
.header {
    background: #333333;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: 0;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-btn {
    background: #333333;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #e8e8e8;
    padding: 9px 22px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.header-btn.active {
    background: #ffffff;
    color: #000000;
}

.active-view-btn {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    font-weight: 700;
}

.body-compare {
    padding: 1rem;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.compare-panel {
    background: #f7f8fb;
    border-radius: 8px;
    padding: 1.5rem;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.compare-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid #333333;
    color: #333333;
    font-weight: 600;
    white-space: nowrap;
}

.compare-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.compare-table tr:hover td {
    background: #f9f9f9;
}

.compare-table td.num {
    text-align: right;
}

/* column layout */
.body {
    display: grid;
    grid-template-columns: 250px 1fr 380px;
    gap: 1rem;
    padding: 1rem;
    height: calc(100vh - 60px);
}

.center {
    display: flex;
    flex-direction: column;
}

.sidebar-right {
    overflow-y: auto;
}

.leaflet-tooltip.city-tooltip {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 12px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
    padding: 13px 19px;
    font-size: 0.85rem;
    color: #333;
    white-space: nowrap;
    opacity: 1 !important;
}

.leaflet-tooltip.city-tooltip::before {
    display: none;
}

.map-box {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

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

/* dashboard layout */
.dashboard {
    padding: 1rem;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.dashboard-intro {
    max-width: 70ch;
    margin-bottom: 1.5rem;
}

/* Detailansicht einer Relation: zwei Karten und der Slope nebeneinander */
.pair-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* Leaflet braucht eine feste Hoehe, sonst bleibt die Karte unsichtbar.
   position + z-index kapseln Leaflets eigene Ebenen (bis 1000) in einen eigenen
   Stapelkontext - sonst schoeben sie sich beim Scrollen ueber die sticky
   Toolbar. */
.pair-map {
    position: relative;
    z-index: 0;
    height: 430px;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

/* Basiskarte entsaettigen, damit die farbigen Routen herausstechen.
   Bewusst nur die Kachel-Ebene: Linien, Tooltips und das Attribution-Label
   liegen in anderen Panes und behalten ihre Farbe. */
.pair-map .leaflet-tile-pane,
.stadtnetz-karte .leaflet-tile-pane {
    filter: grayscale(1) contrast(0.82);
}

/* Kartenreihe: befahrenes Netz einer Stadt, je Infrastrukturklasse eine Karte */
/* 3x2-Raster: fuenf Karten und ein Feld mit den Kilometern je Klasse. */
.stadtnetz {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 0.9rem;
}

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

.stadtnetz-titel {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stadtnetz-punkt {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

/* Feste Hoehe fuer Leaflet; position + z-index kapseln seine Ebenen, damit sie
   sich beim Scrollen nicht ueber andere Elemente schieben. */
.stadtnetz-karte {
    position: relative;
    z-index: 0;
    /* Quadratisch: Staedte sind eher rund, hochkant blieb oben und unten ein
       Drittel leer. aspect-ratio liefert Leaflet die noetige Hoehe. */
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

/* Kein Fokusrahmen beim Anklicken - per Tastatur bleibt er sichtbar. */
.stadtnetz-karte:focus:not(:focus-visible) {
    outline: none;
}

/* Sechstes Feld: Lesehilfe, so gross wie eine Karte. */
.stadtnetz-lesehilfe {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    border: 1px solid #eeeeee;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #555555;
}

.stadtnetz-lesehilfe p {
    margin: 0;
}

.stadtnetz-lesehilfe strong {
    color: #333333;
}

.pair-hinweis {
    margin: 0 0 1rem;
    font-size: 0.78rem;
    color: #888888;
}

/* Slope-Chart links, Fliesstext rechts */
.slope-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 1100px) {
    .slope-panel {
        grid-template-columns: 1fr;
    }
}

.slope-intro {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444444;
}

.slope-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* Greift die Linienfarbe aus dem Chart auf - Zuordnung ohne Legende. */
.slope-chip {
    display: inline;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.87rem;
    font-weight: 600;
    line-height: 1.9;
}

.slope-delta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #888888;
}

/* Bedienelemente, die nur zu einer Chart-Karte gehoeren.
   Bewusst abgesetzt: auf der weissen Kachel geht ein weisses Feld unter. */
.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-controls .field {
    min-width: 0;
}

.chart-controls .field-input {
    width: 260px;
    max-width: 100%;
    background: #eef2ee;
    border: 1px solid #2e5339;
    font-weight: 600;
    color: #2e5339;
}

.chart-controls .field-input:hover {
    background: #e3eae4;
}

.field-mit-einheit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-controls .field-mit-einheit .field-input {
    width: 130px;
}

.field-einheit {
    font-size: 0.85rem;
    color: #666666;
}

/* Textkasten - Fliesstext zwischen den Bloecken.
   Die Regeln gelten fuer die Tags darin, damit im Template kein style-Attribut
   noetig ist: h3, p, ul/ol, strong, a. */
.text-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
    max-width: 80ch;
}

/* Variante mit Akzentkante fuer Hinweise */
.text-card.note {
    border-left: 3px solid #2e5339;
}

.text-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #000000;
}

.text-card p,
.text-card ul,
.text-card ol {
    margin: 0 0 0.7rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444444;
}

.text-card ul,
.text-card ol {
    padding-left: 1.2rem;
}

.text-card li {
    margin-bottom: 0.25rem;
}

.text-card > :last-child {
    margin-bottom: 0;
}

.text-card strong {
    font-weight: 600;
    color: #000000;
}

.text-card a {
    color: #2e5339;
}

/* Zeugnis-Tabelle links, Ranking-Chart rechts */
.zeugnis-panel,
.stadtradeln-panel {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 1100px) {
    .zeugnis-panel,
.stadtradeln-panel {
        grid-template-columns: 1fr;
    }
}

.zeugnis {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.zeugnis th {
    padding: 6px 10px;
    border-bottom: 2px solid #333333;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #666666;
    text-align: left;
    white-space: nowrap;
}

.zeugnis td {
    padding: 9px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #333333;
}

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

.zeugnis-zeile {
    cursor: pointer;
}

.zeugnis-zeile:hover td {
    background: #f6f8f6;
}

.zeugnis-zeile:focus-visible {
    outline: 2px solid #2e5339;
    outline-offset: -2px;
}

/* Die gewaehlte Zeile gehoert sichtbar zum Chart daneben. */
.zeugnis-zeile.aktiv td {
    background: #eef2ee;
    font-weight: 600;
}

.zeugnis-zeile.aktiv td:first-child {
    box-shadow: inset 3px 0 0 #2e5339;
}

/* Notenfeld im Zeugnis. Bewusst mit Praefix: '.note' allein kollidiert
   mit der Textkarten-Variante '.text-card note'. */
.zeugnis-note {
    display: inline-block;
    min-width: 46px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}

.zeugnis-note--gut { background: #e3efe6; color: #1f4d2c; }
.zeugnis-note--befriedigend { background: #eaf0e4; color: #4a5a2c; }
.zeugnis-note--ausreichend { background: #fbf0dd; color: #7a4a00; }
.zeugnis-note--mangelhaft { background: #f8e3df; color: #8f2f1e; }
.zeugnis-note--leer { background: #f2f2f2; color: #999999; }

/* Vergleichsstadt tritt zurueck - Stadt 1 traegt das Zeugnis. */
.zeugnis-note--blass {
    opacity: 0.62;
    font-weight: 400;
}

/* Stadtprofil unter den Noten: gleiche Spalten, aber leiser - Kontext, keine
   Bewertung. */
.zeugnis-profil th {
    padding-top: 1.4rem;
    border-bottom: 1px solid #d8d8d8;
}

.zeugnis-profil td {
    padding: 7px 10px;
    font-size: 0.84rem;
    color: #555555;
}

.zeugnis-profil td.zeugnis-num {
    color: #222222;
}

.zeugnis-profil td.zeugnis-profil-vergleich {
    color: #8a8a8a;
}

.zeugnis-fussnote {
    margin: 0.8rem 10px 0;
    font-size: 0.76rem;
    line-height: 1.4;
    color: #888888;
}

/* Metadaten zu den Stadtradeln-Daten unter dem Zeugnis */
.fahrten-zahlen {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin: 0.5rem 0 1.2rem;
}

.fahrten-stadt {
    font-size: 0.78rem;
    color: #888888;
}

.fahrten-punkt {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 0.35rem;
    border-radius: 50%;
    vertical-align: middle;
}

.fahrten-gesamt {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
    color: #000000;
    font-variant-numeric: tabular-nums;
}

.fahrten-abschnitt {
    padding-top: 0.9rem;
    border-top: 1px solid #eeeeee;
}

.fahrten-untertitel {
    margin-bottom: 0.6rem;
    font-size: 0.82rem;
    color: #555555;
}

.fahrten-balken {
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.fahrten-balken-name {
    font-size: 0.84rem;
    color: #333333;
    white-space: nowrap;
}

.fahrten-balken-spur {
    display: block;
    height: 10px;
    border-radius: 5px;
    background: #eeeeee;
    overflow: hidden;
}

.fahrten-balken-fuellung {
    display: block;
    height: 100%;
    border-radius: 5px;
}

.fahrten-balken-wert {
    font-size: 0.8rem;
    color: #333333;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.fahrten-balken-platz {
    margin-left: 0.4rem;
    font-size: 0.74rem;
    color: #999999;
}

.stadtradeln-fussnote {
    max-width: 60ch;
    margin: 1rem 0 0;
    font-size: 0.76rem;
    line-height: 1.5;
    color: #888888;
}

.zeugnis-platz {
    font-weight: 600;
    color: #000000;
}

.zeugnis-von {
    margin-left: 0.3rem;
    font-size: 0.76rem;
    color: #999999;
}

/* ---------------------------------------------------------------------------
   Erzaehl-Layout, angelehnt an Scrollytelling in Tageszeitungen.

   Zwei Breiten steuern alles:
     --inhaltsbreite  Charts und Kacheln
     --lesebreite     Fliesstext, Kapitelueberschriften, Textboxen
   Zum Ausprobieren nur diese Werte aendern. Mit --inhaltsbreite: 100vw
   faellt die Begrenzung weg.
   --------------------------------------------------------------------------- */
.dashboard {
    --inhaltsbreite: 1250px;
    --lesebreite: 781px;
    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

    /* Zentriert ueber die Polsterung statt ueber max-width je Kind: so teilen
       Einleitung, Reiter und Inhalt dieselbe linke Kante. */
    padding-inline: max(1rem, calc((100% - var(--inhaltsbreite)) / 2));
}

/* Kapitelueberschrift direkt auf dem grauen Grund - keine Box. */
.story-kapitel {
    max-width: var(--lesebreite);
    margin: 3.5rem auto 1.5rem;
}

/* Das erste Kapitel eines Reiters steht direkt unter den Reitern. */
#tab-panel > .story-kapitel:first-of-type {
    margin-top: 0.75rem;
}

.story-kapitel--mittig {
    text-align: center;
}

.story-dachzeile {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #2e5339;
}

.story-kapitel h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.7rem, 1.2rem + 1.3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.01em;
    color: #1c1c1c;
    text-wrap: balance;
}

.story-vorspann {
    margin: 0.9rem 0 0;
    font-family: var(--serif);
    font-size: 1.17rem;
    line-height: 1.6;
    color: #3d3d3d;
}

/* Freistehender Fliesstext auf dem grauen Grund */
.story-text {
    max-width: var(--lesebreite);
    margin: 1.5rem auto 2.25rem;
}

.story-text p {
    margin: 0 0 1em;
    font-family: var(--serif);
    font-size: 1.06rem;
    line-height: 1.72;
    color: #333333;
}

.story-text p:last-child {
    margin-bottom: 0;
}

/* Text in einer Box, gleiche Lesebreite wie der Fliesstext */
.story-box {
    max-width: var(--lesebreite);
    margin: 2rem auto;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border: 1px solid #e3e5e8;
    border-radius: 8px;
}

.story-box-titel {
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #777777;
}

.story-box p {
    margin: 0 0 0.8em;
    font-family: var(--serif);
    font-size: 1rem;
    line-height: 1.65;
    color: #333333;
}

.story-box p:last-child {
    margin-bottom: 0;
}

/* Werte im Fliesstext in der Farbe ihrer Infrastrukturklasse - der Text wird so
   zugleich zur Legende des Charts. Dunkle Schrift auf hellem Grund, die
   Klassenfarbe als Unterstrich: bleibt auch bei Gelb und Rosa gut lesbar.
   Farben kommen als --klasse / --klasse-grund inline aus dem Template. */
.story-wert {
    padding: 0 0.25em;
    border-radius: 3px;
    background: var(--klasse-grund, #eeeeee);
    box-shadow: inset 0 -2px 0 var(--klasse, #999999);
    font-weight: 600;
    color: #1c1c1c;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Platzhalter bleiben sichtbar markiert, damit keiner live geht. */
.platzhalter {
    background: #fff1c9;
    border-radius: 2px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Zwei Textbloecke nebeneinander - schmale Einleitung, breiter Inhalt.
   align-items: start, damit der kuerzere Block nicht auf die Hoehe des
   laengeren gestreckt wird. */
.text-split {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Der Abstand kommt vom Grid, sonst steht er doppelt. */
.text-split > * {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .text-split {
        grid-template-columns: 1fr;
    }
}

/* Infobox: Erklaerung der Infrastrukturklassen. Zugleich Legende der Charts. */
.legende-box {
    max-width: none;
}

.legende-box > summary {
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem;
}

.legende-box > summary::marker {
    color: #999999;
}

.legende-titel-zeile {
    font-size: 1.05rem;
    font-weight: 600;
    color: #000000;
}

.legende-hinweis {
    font-size: 0.78rem;
    color: #888888;
}

.legende-intro,
.legende-fussnote,
.legende-quellen {
    max-width: 80ch;
    font-size: 0.85rem;
    line-height: 1.55;
    color: #555555;
}

.legende-intro {
    margin: 0.6rem 0 1rem;
}

.legende {
    display: flex;
    flex-direction: column;
}

.legende-zeile {
    display: grid;
    /* Farbstreifen + Inhalt. Der Streifen bindet die Zeile an die Charts. */
    grid-template-columns: 4px 1fr;
    gap: 0.9rem;
    padding: 0.8rem 0;
    border-top: 1px solid #eeeeee;
}

.legende-zeile:first-child {
    border-top: none;
    padding-top: 0;
}

.legende-farbe {
    border-radius: 2px;
}

.legende-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #000000;
}

.legende-kurz {
    margin: 0.2rem 0 0.5rem;
    max-width: 75ch;
    font-size: 0.87rem;
    line-height: 1.5;
    color: #444444;
}

.legende-faelle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.legende-fall {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f4f5f7;
    font-size: 0.76rem;
    color: #555555;
}

.legende-fall code,
.legende-fussnote code {
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-size: 0.95em;
    color: #1a1a1a;
}

.legende-zeichen {
    padding: 1px 5px;
    border-radius: 3px;
    background: #fdf3e0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #7a4a00;
    white-space: nowrap;
}

.legende-fussnote {
    margin: 1rem 0 0.4rem;
}

.legende-quellen {
    margin: 0;
    font-size: 0.8rem;
}

.legende-quellen a {
    color: #2e5339;
}

/* KPI-Karten */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.1rem 1.1rem;
}

.kpi-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.kpi-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555555;
}

.kpi-info-wrap {
    position: relative;
    display: inline-flex;
}

.kpi-info {
    width: 15px;
    height: 15px;
    padding: 0;
    border: 1px solid #bbbbbb;
    border-radius: 50%;
    background: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #888888;
    cursor: pointer;
}

.kpi-info:hover {
    border-color: #2e5339;
    color: #2e5339;
}

/* Blase oeffnet per Hover und per Klick (Fokus) - ohne JavaScript. */
.kpi-info-bubble {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: -8px;
    z-index: 20;
    width: 210px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #333333;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.45;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.kpi-info:hover + .kpi-info-bubble,
.kpi-info:focus + .kpi-info-bubble {
    display: block;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: #000000;
    font-variant-numeric: tabular-nums;
}

.kpi-unit {
    margin-left: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #777777;
}

.kpi-delta {
    font-size: 0.75rem;
    font-weight: 600;
}

.kpi-delta--gut { color: #2e5339; }
.kpi-delta--schlecht { color: #a33a2a; }
.kpi-delta--neutral { color: #888888; }

.kpi-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.kpi-bar-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-bar-label {
    font-size: 0.7rem;
    color: #888888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-bar-track {
    display: block;
    height: 7px;
    border-radius: 4px;
    background: #f0f0f0;
    overflow: hidden;
}

.kpi-bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
}

.kpi-bar-fill--accent { background: #2e5339; }
.kpi-bar-fill--neutral { background: #bfc6c1; }

/* Filterleiste des Dashboards. Sitzt in der dunklen Kopfzeile und ist damit
   immer sichtbar, ohne Platz im Inhalt zu kosten.
   Der Klassenname bleibt: alle Inhalte haengen per
   "change from:.dashboard-toolbar" und hx-include daran. */
.dashboard-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.header-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    white-space: nowrap;
}

/* Hoehe an .header-btn angeglichen, damit die Kopfzeile nicht waechst -
   .dashboard rechnet mit calc(100vh - 60px). */
.dashboard-toolbar select {
    background: #4a4a4a;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    padding: 5px 8px;
    font-family: inherit;
    font-size: 13px;
    color: #ffffff;
    max-width: 180px;
    cursor: pointer;
}

.dashboard-toolbar select:hover {
    border-color: rgba(255, 255, 255, 0.55);
}

.dashboard-toolbar select:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 1px;
}

/* Das aufgeklappte Menue erbt die dunkle Farbe nicht ueberall von selbst. */
.dashboard-toolbar option {
    background: #333333;
    color: #ffffff;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 230px;
}

.field-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #666666;
}

.field-input {
    padding: 8px 12px;
    border: 1px solid #cccccc;
    border-radius: 6px;
    background: #ffffff;
    font-size: 0.95rem;
    color: #333333;
    cursor: pointer;
}

.field-input:focus-visible {
    outline: 2px solid #2e5339;
    outline-offset: 1px;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1.25rem;
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #777777;
    cursor: pointer;
}

.tab-btn:hover {
    color: #333333;
}

.tab-btn.active {
    color: #2e5339;
    border-bottom-color: #2e5339;
}

.tab-btn:focus-visible {
    outline: 2px solid #2e5339;
    outline-offset: -2px;
}

/* Karten fuellen die Breite und brechen selbst um, sobald sie
   unter 420px fallen wuerden - keine Media Queries noetig. */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1rem;
}

.chart-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* fuer Charts, die eine ganze Reihe brauchen */
.chart-card.wide {
    grid-column: 1 / -1;
}

.chart-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.25rem;
}

.chart-card-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #555555;
    margin-bottom: 1rem;
}

.chart-loading {
    font-size: 0.85rem;
    color: #888888;
}

@media (min-width: 1230px) {
    #infrastructure-zoom-hint .leaflet-popup-content {
        white-space: nowrap;
    }
}
