.data-evaluation-chart .mud-chart-bar {
    stroke-linecap: butt;
    clip-path: inset(0 round var(--bar-top-corner-radius) var(--bar-top-corner-radius) 0 0);
}

.donut-summary-chart .svg-tooltip {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(2.0);
    font-weight: 600;
}

/* Das aktive Chart muss über seinem Nachbarn liegen, damit dessen Tooltip nicht verdeckt wird. */
.donut-summary-chart {
    position: relative;
    z-index: 0;
}

/* Tooltips werden durch Hoover ausgelöst der Hover liegt durch z-index: 1; jetzt vor den Tooltips */
.donut-summary-chart:hover {
    z-index: 1;
}

/* ── Zeitreihen-Chart der Chart-Auswertung (EvaluationTimeSeriesChart) ──
   Global statt .razor.css: App.razor bindet kein Scoped-CSS-Bundle ein. */
/* Etwas heller als die Umgebung (Kontrast im Dark-Mode); im Light-Mode bleibt Weiß weiß. */
.evaluation-chart {
    --evaluation-chart-background: color-mix(in srgb, var(--mud-palette-surface), white 10%);
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
    border-radius: var(--mud-default-borderradius);
    background: var(--evaluation-chart-background);
}

.evaluation-chart svg {
    display: block;
    font-family: inherit;
    font-size: 12px;
}

.evaluation-chart-grid line {
    stroke: var(--mud-palette-lines-default);
    stroke-width: 1;
    opacity: 0.6;
}

.evaluation-chart-baseline {
    stroke: var(--mud-palette-text-secondary);
    stroke-width: 1;
}

.evaluation-chart-tick {
    stroke: var(--mud-palette-text-secondary);
    stroke-width: 1;
}

.evaluation-chart-axis-text text {
    fill: var(--mud-palette-text-secondary);
    transition: opacity 120ms ease-in-out;
}

.evaluation-chart-axis-text text.evaluation-chart-faded {
    opacity: 0.15;
}

.evaluation-chart-axis-text text.evaluation-chart-context {
    fill: var(--mud-palette-text-primary);
    font-weight: 500;
}

.evaluation-chart-marker {
    fill: var(--evaluation-chart-background);
    stroke-width: 2;
}

.evaluation-chart-hover-band {
    fill: var(--mud-palette-action-default-hover);
}

.evaluation-chart-crosshair {
    stroke: var(--mud-palette-text-secondary);
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.evaluation-chart-hover-point {
    stroke: var(--evaluation-chart-background);
    stroke-width: 2;
}

.evaluation-chart-hover-label rect {
    fill: var(--mud-palette-primary);
}

.evaluation-chart-hover-label text {
    fill: var(--mud-palette-primary-text);
    font-weight: 500;
}

.evaluation-chart-hit-area {
    position: absolute;
    cursor: crosshair;
    touch-action: pan-y;
}

/* Klick auf einen Bucket öffnet dessen Detailansicht (Drill-down). */
.evaluation-chart-hit-area.evaluation-chart-drillable {
    cursor: zoom-in;
}

/* Markierter Zoom-Bereich während des Ziehens. */
.evaluation-chart-selection {
    fill: var(--mud-palette-primary);
    fill-opacity: 0.15;
    stroke: var(--mud-palette-primary);
    stroke-width: 1;
    stroke-opacity: 0.6;
}

.evaluation-chart-zoom-reset {
    position: absolute;
    z-index: 2;
}

.evaluation-chart-tooltip {
    position: absolute;
    z-index: 1;
    min-width: 180px;
    max-width: min(360px, 80%);
    padding: 8px 12px;
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    pointer-events: none;
    font-size: 0.8125rem;
}

.evaluation-chart-tooltip-title {
    margin-bottom: 6px;
    font-weight: 600;
    white-space: nowrap;
}

.evaluation-chart-tooltip-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    column-gap: 8px;
    line-height: 1.6;
}

.evaluation-chart-tooltip-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.evaluation-chart-tooltip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.evaluation-chart-tooltip-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.evaluation-chart-tooltip-hint {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
}

/* Pfad der Detailansichten (Gesamter Zeitraum › Tag › Stunde). */
.evaluation-chart-drill-link {
    padding: 2px 4px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--mud-palette-primary);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.evaluation-chart-drill-link:hover:not(:disabled) {
    background: var(--mud-palette-action-default-hover);
    text-decoration: underline;
}

.evaluation-chart-drill-link:disabled {
    color: var(--mud-palette-text-disabled);
    cursor: default;
}

.evaluation-chart-drill-link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

.evaluation-chart-drill-current {
    font-weight: 600;
}

/* Hinweis auf die Zeitfilter, um die die Werte bereits bereinigt sind: Titel, darunter je Filter eine Zeile
   (Zeitplan | Gültigkeit, Herkunft …), eingerückt auf Höhe des Titeltexts und spaltenweise ausgerichtet. */
.evaluation-chart-time-filters {
    margin-top: 2px;
}

.evaluation-chart-time-filters-title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.evaluation-chart-time-filter-list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 12px;
    padding-left: 24px;
}

.evaluation-chart-time-filter-schedule {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.evaluation-chart-legend-total {
    cursor: help;
    font-variant-numeric: tabular-nums;
}

/* ── Aufbau der Chart-Auswertung (ChartEvaluationView) ── */
.evaluation-chart-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.evaluation-chart-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Kopf: Name/Zeitraum/Zeitfilter links, Bedienhinweise und Aktionen (Schließen) rechts. */
.evaluation-chart-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 16px;
}

.evaluation-chart-heading {
    flex: 1 1 320px;
    min-width: 0;
}

.evaluation-chart-header-actions-only {
    justify-content: flex-end;
}

/* Rahmen für die Container-Query: Legende neben statt unter dem Chart, sobald der Platz reicht. */
.evaluation-chart-frame {
    container: evaluation-chart / inline-size;
}

.evaluation-chart-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evaluation-chart-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
}

.evaluation-chart-legend-item {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 4px;
}

.evaluation-chart-legend-values {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 4px;
}

.evaluation-chart-legend-values::before {
    content: "·";
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
}

@container evaluation-chart (min-width: 960px) {
    .evaluation-chart-body {
        display: grid;
        grid-template-columns: fit-content(280px) minmax(0, 1fr);
        column-gap: 16px;
    }

    .evaluation-chart-body > .evaluation-chart,
    .evaluation-chart-body > .evaluation-chart-no-data {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
    }

    .evaluation-chart-legend {
        grid-column: 1;
        grid-row: 1;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
        padding-top: 8px;
        overflow-y: auto;
    }

    .evaluation-chart-legend-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        row-gap: 2px;
    }

    /* Werte unter dem Namen, bündig mit dem Text; geänderte Informationswerte je Abschnitt in einer eigenen Zeile. */
    .evaluation-chart-legend-values {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 24px;
    }

    .evaluation-chart-legend-values::before,
    .evaluation-chart-legend-values .evaluation-chart-separator {
        display: none;
    }

    .evaluation-chart-legend-reset {
        align-self: flex-start;
    }
}

/* Dialog: fast volle Viewport-Höhe, der Chart füllt, was Kopf, Legende und Informationswerte übrig lassen.
   Reicht die Höhe nicht (Mindesthöhe des Charts), scrollt der Dialog-Inhalt wie gewohnt. */
.evaluation-chart-dialog {
    height: calc(100vh - var(--mud-appbar-height));
    height: calc(100dvh - var(--mud-appbar-height));
}

.mud-dialog .mud-dialog-content.evaluation-chart-dialog-content {
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
}

/* EvaluationView lädt die Auswertung und reicht die Füllhöhe an die Darstellung der Art weiter. */
.evaluation-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.evaluation-view-fill {
    flex: 1 1 auto;
    min-height: 0;
}

/* Live: überall dasselbe Zeichen – pulsierender Punkt in kräftigem Rot (--eos-live), damit Echtzeit sofort auffällt
   (Kopf jeder Live-Auswertung, Editor, Art-Auswahl, Vorlagen). */
:root {
    --eos-live: #ff1744;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 1px 8px 1px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 18px;
    white-space: nowrap;
    color: #fff;
    background-color: var(--eos-live);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--eos-live) 40%, transparent);
}

.live-badge--header {
    align-self: flex-start;
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 600;
}

.live-badge--overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
}

.live-badge__dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #fff;
}

.live-badge__dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: live-badge-pulse 1.6s ease-out infinite;
}

@keyframes live-badge-pulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.8); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .live-badge__dot::after {
        animation: none;
    }
}

/* Hauptbereich der Art-Auswahl und der Vorlagen: „Auswertungen“ oder „Live“ als zwei große Schalter. */
.evaluation-kind-picker-root {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.evaluation-kind-card--report {
    max-width: 520px;
}

.evaluation-area-switch {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 12px;
}

.evaluation-area-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.evaluation-area-card:hover,
.evaluation-area-card:focus-visible {
    background-color: var(--mud-palette-action-default-hover);
    outline: none;
}

.evaluation-area-card--selected {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}

.evaluation-area-card--live {
    border-color: color-mix(in srgb, var(--eos-live) 45%, var(--mud-palette-lines-default));
    background-image: linear-gradient(120deg, color-mix(in srgb, var(--eos-live) 10%, transparent), transparent 60%);
}

.evaluation-area-card--live.evaluation-area-card--selected {
    border-color: var(--eos-live);
    box-shadow: 0 0 0 1px var(--eos-live), 0 4px 18px color-mix(in srgb, var(--eos-live) 25%, transparent);
}

.evaluation-area-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.evaluation-area-card__title {
    font-size: 1rem;
    font-weight: 600;
}

.evaluation-area-card__description {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}

/* Grundlage innerhalb eines Bereichs: zählbasiert / zonenbasiert. */
.evaluation-kind-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evaluation-kind-section__head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.evaluation-kind-section--live .evaluation-kind-section__head .mud-icon-root {
    color: var(--eos-live) !important;
}

/* Art-Karte im Bereich Live: rote Kante oben und der Live-Punkt auf der Miniatur. */
.evaluation-kind-card--live {
    border-top: 3px solid var(--eos-live) !important;
}

.evaluation-kind-card--live.evaluation-kind-card--selected {
    border-color: var(--eos-live) !important;
    box-shadow: 0 0 0 1px var(--eos-live);
}

/* Editor einer Live-Auswertung: der Kopf trägt das Live-Zeichen und eine rote Kante. */
.editor-layout__header--live {
    padding-left: 10px;
    border-left: 3px solid var(--eos-live);
}

/* Art-Auswahl im Konfigurationsdialog (EvaluationKindPicker): Karten mit Miniatur wie die Template-Auswahl. */
.evaluation-kind-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 12px;
}

.evaluation-kind-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.evaluation-kind-card--clickable {
    cursor: pointer;
}

.evaluation-kind-card--clickable:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.evaluation-kind-card--selected {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}

.evaluation-kind-card--disabled {
    opacity: 0.55;
}

/* Die Miniatur ist die echte Darstellung in Kachelgröße (480 × 270), halb so groß gezeichnet. Die Darstellungen messen
   ihre Layout-Größe (clientWidth), die ein Transform nicht verändert – gezeichnet wird also in voller Größe. */
.evaluation-kind-thumbnail {
    position: relative;
    height: 135px;
    overflow: hidden;
    border-radius: var(--mud-default-borderradius);
    background-color: var(--mud-palette-background);
    pointer-events: none;
}

.evaluation-kind-thumbnail-stage {
    position: absolute;
    top: 0;
    left: 50%;
    width: 480px;
    height: 270px;
    display: flex;
    flex-direction: column;
    padding: 8px;
    transform: translateX(-50%) scale(0.5);
    transform-origin: top center;
}

.evaluation-kind-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* Miniatur einer Vorlage im Dialog „Neu“ (TemplatePreviewThumbnail): wie die Art-Karten, dazu „Groß anzeigen“. */
.template-choice__preview {
    margin-bottom: 8px;
}

.template-preview {
    position: relative;
}

.template-preview--sample {
    opacity: 0.6;
}

.template-preview__zoom {
    position: absolute;
    top: 6px;
    right: 6px;
}

.template-preview__badge {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
}

/* Kachel-Raster einer Berichts-Vorlage: je Kachel Art und Name, Breite und Höhe wie im Bericht. */
.report-template-sketch {
    position: absolute;
    inset: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 22px;
    grid-auto-flow: row dense;
    gap: 4px;
    overflow: hidden;
}

.report-template-sketch__tile {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    padding: 3px 6px;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background-color: var(--mud-palette-surface);
    font-size: 0.7rem;
    line-height: 1.3;
}

.report-template-sketch__tile span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Miniatur der Karte „Bericht“: ein gezeichneter Bericht (drei Kennzahlen über einem Verlauf) im Kachel-Raster. */
.report-kind-sketch {
    position: absolute;
    inset: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 42px minmax(0, 1fr);
    gap: 6px;
}

.report-kind-sketch-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    padding: 4px 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background-color: var(--mud-palette-surface);
}

.report-kind-sketch-value {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.15;
}

.report-kind-sketch-label {
    font-size: 0.65rem;
    color: var(--mud-palette-text-secondary);
}

.report-kind-sketch-chart {
    grid-column: span 3;
    flex-direction: row;
    align-items: flex-end;
    gap: 4px;
    padding-top: 8px;
}

.report-kind-sketch-bar {
    flex: 1 1 0;
    border-radius: 2px 2px 0 0;
    background-color: var(--mud-palette-primary);
    opacity: 0.8;
}

/* Vorschau einer noch nicht gespeicherten Auswertung (EvaluationPreviewDialog). */
.evaluation-preview-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.evaluation-chart-view-fill,
.evaluation-chart-view-fill .evaluation-chart-panel,
.evaluation-chart-view-fill .evaluation-chart-frame,
.evaluation-chart-view-fill .evaluation-chart-body {
    flex: 1 1 auto;
}

.evaluation-chart-view-fill .evaluation-chart-frame {
    display: flex;
    flex-direction: column;
}

/* contain: size – die Höhe kommt nur aus dem Restplatz, nie aus dem Inhalt. Sonst meldet das gezeichnete SVG
   (viewBox) seine letzte Höhe als Mindestgröße, und jede weitere Zeile (Detailansicht-Pfad) käme obendrauf,
   statt dem Chart abgezogen zu werden – der Dialog würde mit jeder Drill-down-Stufe höher. */
.evaluation-chart-view-fill .evaluation-chart-body > .evaluation-chart {
    flex: 1 1 0;
    min-height: 280px;
    contain: size;
}

@container evaluation-chart (min-width: 960px) {
    /* Neben dem Chart scrollt eine lange Legende für sich, statt den Chart zu verkleinern. */
    .evaluation-chart-view-fill .evaluation-chart-body {
        grid-template-rows: minmax(0, 1fr);
        min-height: 0;
    }

    .evaluation-chart-view-fill .evaluation-chart-body > .evaluation-chart {
        align-self: stretch;
    }
}

/* Legenden-Eintrag als Schalter: Klick blendet die Serie im Chart ein/aus. */
.evaluation-chart-legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.evaluation-chart-legend-toggle:hover {
    background: var(--mud-palette-action-default-hover);
}

.evaluation-chart-legend-toggle:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

/* Bedienhinweis oben rechts im Chart-Kopf. */
.evaluation-chart-hint kbd {
    padding: 0 4px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.95em;
}

.evaluation-chart-legend-hidden {
    opacity: 0.5;
}

.evaluation-chart-legend-hidden .evaluation-chart-legend-name {
    text-decoration: line-through;
}

/* Schalter „Kennzahlen“ unter der Legende und das Kennzahlen-Popup (ChartInsightsDialog, EvaluationSeriesInsightsPanel):
   je Serie Kopf mit Gesamtwert und Trend ggü. Vorjahr, darunter Einordnung, Ø/Max./Min. je Bucket und Vorjahre. */
.evaluation-chart-legend-insights {
    align-self: flex-start;
}

.evaluation-insights-subtitle {
    display: block;
    margin-bottom: 12px;
}

.evaluation-insights {
    display: grid;
    /* auto-fit: eine einzelne Serie nimmt die ganze Breite ein, statt in der ersten von mehreren leeren Spalten zu stehen. */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px 24px;
    padding-bottom: 8px;
}

.evaluation-insights-series-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-bottom: 4px;
}

.evaluation-insights-total {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: help;
}

.evaluation-chart-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-variant-numeric: tabular-nums;
    cursor: help;
}

.evaluation-chart-stats-link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

.evaluation-chart-trend-up {
    color: var(--mud-palette-success);
}

.evaluation-chart-trend-down {
    color: var(--mud-palette-error);
}

.evaluation-chart-trend-flat {
    color: var(--mud-palette-text-secondary);
}

/* Die Blöcke (Einordnung, Je Bucket, Vorjahre) stehen nebeneinander, solange Platz ist; in jedem Block bricht nur die
   Bezeichnung um, nie ein Wert („303.955 (−0,2 %)“ bleibt eine Zeile). */
.evaluation-chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px 32px;
    padding-left: 28px;
}

/* Bezeichnung und Wert stehen dicht beieinander (Spalten nicht gestreckt), damit klar bleibt, was zusammengehört. */
.evaluation-chart-stats-group {
    display: grid;
    grid-template-columns: minmax(0, auto) max-content;
    justify-content: start;
    column-gap: 16px;
    align-content: start;
}

.evaluation-chart-stats-heading,
.evaluation-chart-stats-list {
    grid-column: 1 / -1;
}

.evaluation-chart-stats-heading {
    font-weight: 500;
}

.evaluation-chart-stats-value {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.evaluation-chart-stats-separator {
    color: var(--mud-palette-text-secondary);
    white-space: pre;
}

/* Mehrere Buckets mit gleichem Extremwert: aufgeklappt, bei sehr vielen scrollbar statt die Legende zu sprengen. */
.evaluation-chart-stats-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
    max-height: 8rem;
    padding-left: 8px;
    overflow-y: auto;
    font-size: 0.75rem;
}

.evaluation-chart-stats-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--mud-palette-primary);
    font: inherit;
    font-variant-numeric: tabular-nums;
    text-decoration: underline dotted;
    cursor: pointer;
}

.evaluation-chart-stats-link:hover {
    text-decoration: underline;
}

/* Informationswerte unter der Legende (Text, Ja/Nein) und Abschnitte geänderter Informationswerte. */
.evaluation-chart-information {
    padding-top: 4px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.evaluation-chart-information-entry {
    font-variant-numeric: tabular-nums;
}

.evaluation-chart-information-space,
.evaluation-chart-information-period {
    color: var(--mud-palette-text-secondary);
}

/* ── Weitere Auswertungs-Module: Kennzahl, Tabelle, Ranking ── */
.evaluation-module-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.evaluation-view-fill .evaluation-module-panel {
    flex: 1 1 auto;
}

.evaluation-kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.evaluation-kpi-value {
    font-size: 2.75rem;
    font-weight: 500;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.evaluation-kpi-value-composed {
    font-size: 2rem;
}

.evaluation-kpi-comparison {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.evaluation-kpi-sparkline {
    width: 100%;
    max-width: 480px;
    height: 48px;
    margin-top: 8px;
}

.evaluation-kpi-sparkline polyline {
    fill: none;
    stroke: var(--mud-palette-primary);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.evaluation-kpi-context {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}

.evaluation-kpi-context-name {
    color: var(--mud-palette-text-secondary);
}

.evaluation-table-scroll {
    overflow: auto;
    min-height: 0;
}

.evaluation-view-fill .evaluation-table-scroll {
    flex: 1 1 0;
}

.evaluation-table-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.evaluation-table-unit {
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.evaluation-table-highlighted td {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent);
}

.evaluation-table-total td {
    font-weight: 600;
    border-top: 2px solid var(--mud-palette-lines-default);
}

.evaluation-table-information {
    display: flex;
    flex-direction: column;
}

/* Ranking als Baum. Alle Zeilen (auch aufgeklappte Ebenen) teilen sich über Subgrid dieselben Spalten – Balken, Werte
   und Trends stehen so bündig untereinander, egal wie lang der Wert einer Zeile ist.
   Spalten: Kopf (Aufklappen, Rang, Icon – je Ebene eingerückt), Name, Balken, Wert, Trend, Aktion (Kundenansicht). */
.evaluation-ranking {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(80px, 1.4fr) auto auto 1.75rem;
    column-gap: 12px;
    row-gap: 2px;
}

.evaluation-ranking-row,
.evaluation-ranking-toggle {
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
}

.evaluation-ranking-row {
    grid-column: 1 / -1;
    min-height: 40px;
    padding: 4px 6px;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}

/* Aufklappbare Zeilen: Button über Kopf bis Trend, rechts daneben der Link in die Kundenansicht. */
.evaluation-ranking-toggle {
    grid-column: 1 / 6;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.evaluation-ranking-row:hover,
.evaluation-ranking-row:focus-visible,
.evaluation-ranking-row:has(.evaluation-ranking-toggle:focus-visible) {
    background-color: var(--mud-palette-action-default-hover);
}

.evaluation-ranking-toggle:focus-visible {
    outline: none;
}

/* Zeile ohne Ziel in der Kundenansicht: nur Anzeige, keine Hover-Hervorhebung. */
.evaluation-ranking-row-static:hover {
    background-color: transparent;
}

.evaluation-ranking-row[data-depth]:not([data-depth="0"]) {
    font-size: 0.875rem;
}

.evaluation-ranking-lead {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: calc(var(--ranking-depth, 0) * 1.5rem);
}

.evaluation-ranking-expander {
    display: inline-flex;
    width: 1.25rem;
    color: var(--mud-palette-text-secondary);
    transition: transform 0.15s ease;
}

.evaluation-ranking-row-expanded .evaluation-ranking-expander {
    transform: rotate(90deg);
}

.evaluation-ranking-rank {
    min-width: 1.5rem;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-secondary);
}

/* Farbe je Space-Art (--ranking-accent am Zeilen-Element, aus SpaceIconCatalog): Icon als getönter Chip, Balken gefüllt. */
.evaluation-ranking-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: var(--ranking-accent, var(--mud-palette-primary));
    background-color: color-mix(in srgb, var(--ranking-accent, var(--mud-palette-primary)) 18%, transparent);
}

.evaluation-ranking-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.evaluation-ranking-name > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.evaluation-ranking-label {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.evaluation-ranking-bar {
    height: 8px;
    border-radius: 4px;
    background-color: var(--mud-palette-background-gray);
    overflow: hidden;
}

.evaluation-ranking-bar > span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background-color: var(--ranking-accent, var(--mud-palette-primary));
}

/* Aufgeklappte Zeile: dezent in ihrer Farbe hinterlegt, damit klar ist, zu wem die Ebene darunter gehört. */
.evaluation-ranking-row-expanded {
    background-color: color-mix(in srgb, var(--ranking-accent, var(--mud-palette-primary)) 8%, transparent);
}

.evaluation-ranking-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.evaluation-ranking-context {
    display: block;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

.evaluation-ranking-trend {
    min-width: 3.5rem;
    text-align: right;
    font-size: 0.75rem;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.evaluation-trend-up {
    color: var(--mud-palette-success);
}

.evaluation-trend-down {
    color: var(--mud-palette-error);
}

.evaluation-ranking-action {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    border-radius: 4px;
    color: var(--mud-palette-text-secondary);
}

a.evaluation-ranking-action:hover,
a.evaluation-ranking-action:focus-visible {
    color: var(--mud-palette-primary);
}

/* Lücke „…", Laden, Fehler und Hinweise einer Ebene: über alle Spalten, eingerückt wie der Name der Ebene. */
.evaluation-ranking-note {
    grid-column: 1 / -1;
    padding: 2px 0 2px calc(var(--ranking-depth, 0) * 1.5rem + 3.5rem);
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

@media (max-width: 600px) {
    .evaluation-ranking {
        grid-template-columns: auto minmax(0, 1fr) auto 1.5rem;
        column-gap: 8px;
    }

    .evaluation-ranking-toggle {
        grid-column: 1 / 4;
    }

    .evaluation-ranking-bar,
    .evaluation-ranking-trend {
        display: none;
    }

    .evaluation-ranking-lead {
        padding-left: calc(var(--ranking-depth, 0) * 0.75rem);
    }
}

/* ── Berichte: 3-Spalten-Raster (ReportView und Editor) ── */
.report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row dense;
    gap: 12px;
}

.report-tile {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.report-tile > * {
    flex: 1 1 auto;
    min-height: 0;
}

.report-tile-span-1 { grid-column: span 1; }
.report-tile-span-2 { grid-column: span 2; }
.report-tile-span-3 { grid-column: span 3; }

.report-grid > .report-tile-small { height: 180px; }
.report-grid > .report-tile-medium { height: 380px; }
.report-grid > .report-tile-large { height: 580px; }

.report-tile .evaluation-view,
.report-tile .evaluation-chart-view {
    height: 100%;
    overflow: hidden;
}

/* Eine Kachel scrollt nur, wenn ihr Inhalt wirklich nicht passt – und dann nur senkrecht: waagerecht ist sie durch das
   Raster begrenzt, ein, zwei Pixel Rundung sollen keinen Scrollbalken erzeugen. */
.report-tile .evaluation-module-panel,
.report-tile .evaluation-chart-panel {
    height: 100%;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Das Chart einer Kachel nimmt nur den Restplatz: mit der Mindesthöhe der Vollansicht (280px) liefen Kopf, Legende und
   Chart in einer mittleren Kachel um einige Pixel über – mit einem kaum sichtbaren, aber störenden Scrollbalken. */
.report-tile .evaluation-chart-view-fill .evaluation-chart-body > .evaluation-chart {
    min-height: 120px;
}

.evaluation-table-scroll,
.evaluation-chart-legend,
.evaluation-chart-stats-list,
.customer-report-stage {
    scrollbar-width: thin;
}

.report-tile-error {
    height: 100%;
}

.report-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-view-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

.report-view-heading {
    flex: 1 1 280px;
    min-width: 0;
}

.customer-report-stage {
    overflow: auto;
}

.report-dialog-content {
    padding: 16px;
}

/* Editor: verfügbare Auswertungen links, Bericht rechts. */
.report-composer {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 3fr);
    gap: 12px;
}

.report-composer-available,
.report-composer-report {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
}

.report-composer-available-zone {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-height: 120px;
}

.report-composer-grid {
    min-height: 200px;
    border: 2px dashed var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 8px;
}

.report-composer-grid > .report-tile-small { height: auto; min-height: 72px; }
.report-composer-grid > .report-tile-medium { height: auto; min-height: 120px; }
.report-composer-grid > .report-tile-large { height: auto; min-height: 168px; }

.report-composer-tile {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: 6px;
    background-color: var(--mud-palette-background-gray);
}

.report-composer-tile-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .report-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .report-tile-span-1,
    .report-tile-span-2,
    .report-tile-span-3 {
        grid-column: span 1;
    }

    .report-composer {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Laden: Skeleton in der Form der Art (EvaluationSkeleton) und abgeblendeter Altinhalt beim Neuladen ── */
.evaluation-skeleton {
    gap: 12px;
}

.report-tile .evaluation-skeleton,
.evaluation-skeleton-body {
    overflow: hidden;
}

.evaluation-skeleton-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Ohne Füllhöhe gibt es keine Fläche, die das Skeleton aufspannt – dann die Mindesthöhe der Vollansicht. */
.evaluation-skeleton.pa-4 .evaluation-skeleton-body {
    min-height: 280px;
}

.evaluation-skeleton-legend {
    display: flex;
    gap: 16px;
}

.evaluation-skeleton-bars {
    flex: 1 1 auto;
    min-height: 60px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.evaluation-skeleton-bars > .mud-skeleton {
    flex: 1 1 0;
    border-radius: 4px 4px 0 0;
}

.evaluation-skeleton-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    padding: 4px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.evaluation-skeleton-table-head {
    border-bottom-width: 2px;
}

.evaluation-skeleton-kpi {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.evaluation-skeleton-pill {
    border-radius: 12px;
}

.evaluation-skeleton-ranking {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.evaluation-skeleton-ranking-row {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) 3fr;
    align-items: center;
    gap: 12px;
}

.evaluation-skeleton-demographics {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.evaluation-skeleton-donut {
    flex: 0 0 auto;
    width: clamp(72px, 30%, 200px);
    height: auto;
    aspect-ratio: 1;
}

.evaluation-skeleton-demographics-legend {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evaluation-skeleton-flow {
    flex: 1 1 auto;
    min-height: 80px;
    display: flex;
    justify-content: space-between;
}

.evaluation-skeleton-flow-column {
    flex: 0 0 12%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evaluation-skeleton-flow-column > .mud-skeleton {
    flex-basis: 0;
    min-height: 12px;
    border-radius: 4px;
}

.evaluation-skeleton-fill {
    flex: 1 1 auto;
    min-height: 80px;
    border-radius: 8px;
}

/* Neu laden: der alte Inhalt bleibt kurz abgeblendet stehen, bevor er dem Skeleton weicht (EvaluationLoadingState). */
.evaluation-view-refreshing > *,
.report-grid > .report-tile-refreshing {
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

/* Verknüpfte Auswahl im Bericht: eine Tabellenzeile setzt den Zeitraum des Berichts. */
.evaluation-table-selectable {
    cursor: pointer;
}

/* ── Demografie und Zonen-Kennzahlen ── */
.evaluation-gender-bar {
    display: flex;
    height: 16px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--mud-palette-background-gray);
}

.evaluation-gender-male { background-color: #1976D2; }
.evaluation-gender-female { background-color: #D81B60; }

.evaluation-gender-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.evaluation-gender-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 4px;
}

.evaluation-distribution {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.evaluation-distribution-row {
    display: grid;
    grid-template-columns: minmax(56px, auto) minmax(60px, 1fr) auto auto;
    align-items: center;
    gap: 8px;
}

.evaluation-distribution-share,
.evaluation-distribution-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.evaluation-distribution-value {
    color: var(--mud-palette-text-secondary);
}

/* Alterspyramide: Männer links (Balken wächst nach links), Klasse in der Mitte, Frauen rechts. */
.evaluation-pyramid {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.evaluation-pyramid-row {
    display: grid;
    grid-template-columns: 44px minmax(40px, 1fr) minmax(56px, auto) minmax(40px, 1fr) 44px;
    align-items: center;
    gap: 6px;
}

.evaluation-pyramid-track {
    display: flex;
    height: 12px;
}

.evaluation-pyramid-track-male { justify-content: flex-end; }
.evaluation-pyramid-track-female { justify-content: flex-start; }

.evaluation-pyramid-bar {
    display: block;
    height: 100%;
    min-width: 1px;
    border-radius: 2px;
}

.evaluation-pyramid-label {
    text-align: center;
    white-space: nowrap;
}

.evaluation-pyramid-share {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.evaluation-pyramid-share-male { text-align: right; }

.evaluation-zone-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.evaluation-zone-metric {
    display: flex;
    flex-direction: column;
    padding: 8px;
    border-radius: 6px;
    background-color: var(--mud-palette-background-gray);
}

.evaluation-zone-metric-value {
    font-size: 1.5rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.evaluation-columns {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    align-items: end;
    gap: 2px;
    height: 120px;
}

.evaluation-columns-weekday {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.evaluation-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.evaluation-column-bar {
    display: block;
    min-height: 1px;
    border-radius: 2px 2px 0 0;
    background-color: var(--mud-palette-primary);
}

.evaluation-column-label {
    height: 16px;
    font-size: 0.7rem;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

/* Info-Bereich unter dem Kopf einer Auswertung: Begriffe mit je einem Satz Erklärung. */
.evaluation-explanation {
    flex: 0 0 auto;
}

.evaluation-explanation-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.evaluation-explanation-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
    margin: 0;
    font-size: 0.875rem;
}

.evaluation-explanation-list dt {
    font-weight: 600;
}

.evaluation-explanation-list dd {
    margin: 0;
}

@media (max-width: 600px) {
    .evaluation-explanation-list {
        grid-template-columns: 1fr;
    }

    .evaluation-explanation-list dd {
        margin-bottom: 4px;
    }
}

/* Zonen-Kennzahlen: Profil (Verlauf) und Zonen-Vergleich (Tabelle, Quadranten, Heatmap). */
.zone-evaluation-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: auto;
}

.zone-occupancy-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
}

.zone-occupancy-plot {
    position: relative;
}

.zone-occupancy-max {
    position: absolute;
    top: 0;
    left: 4px;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

.zone-occupancy-svg {
    display: block;
    width: 100%;
    height: 120px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.zone-occupancy-area {
    fill: color-mix(in srgb, var(--mud-palette-primary) 22%, transparent);
    stroke: none;
}

.zone-occupancy-line {
    fill: none;
    stroke: var(--mud-palette-primary);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.zone-occupancy-grid {
    stroke: var(--mud-palette-lines-default);
    stroke-dasharray: 4 4;
    vector-effect: non-scaling-stroke;
}

.zone-occupancy-peak {
    stroke: var(--mud-palette-warning);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
    vector-effect: non-scaling-stroke;
}

.zone-occupancy-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

.zone-highlight {
    min-width: 0;
}

/* Zonennamen dürfen zwei Zeilen nehmen, erst danach wird gekürzt. */
.zone-highlight-value {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.zone-comparison-switch {
    align-self: flex-start;
}

.zone-comparison-content {
    min-height: 0;
}

.zone-table-wrap {
    overflow-x: auto;
}

.zone-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.zone-table th,
.zone-table td {
    padding: 4px 8px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.zone-table th {
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.zone-table th button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.zone-table .zone-table-name {
    text-align: left;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zone-table-bar-cell {
    min-width: 160px;
}

/* Balken in einer eigenen Spur links, die Zahl rechts daneben – der Balken läuft nie in die Zahl. */
.zone-table-bar-layout {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zone-table-bar-track {
    flex: 1 1 auto;
    min-width: 60px;
    height: 12px;
}

.zone-table-bar {
    display: block;
    height: 100%;
    border-radius: 0 3px 3px 0;
    background-color: color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
}

.zone-table-value {
    flex: 0 0 auto;
    min-width: 5ch;
    text-align: right;
}

.zone-table-share {
    position: relative;
    margin-left: 6px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.zone-table-empty td {
    color: var(--mud-palette-text-disabled);
}

.zone-quadrant-svg {
    display: block;
    width: 100%;
    max-height: 360px;
}

.zone-quadrant-field-best {
    fill: color-mix(in srgb, var(--mud-palette-success) 8%, transparent);
}

.zone-quadrant-split {
    stroke: var(--mud-palette-lines-default);
    stroke-dasharray: 5 4;
}

.zone-quadrant-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    fill: var(--mud-palette-text-disabled);
}

.zone-quadrant-bubble circle {
    fill: color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
    stroke: var(--mud-palette-primary);
    stroke-width: 1.5;
}

.zone-quadrant-bubble:hover circle {
    fill: var(--mud-palette-primary);
}

.zone-quadrant-label {
    font-size: 11px;
    fill: var(--mud-palette-text-primary);
    paint-order: stroke;
    stroke: var(--mud-palette-surface);
    stroke-width: 3px;
}

.zone-quadrant-axes {
    display: flex;
    justify-content: space-between;
}

.zone-heatmap {
    display: grid;
    gap: 2px;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.zone-heatmap-corner,
.zone-heatmap-column {
    color: var(--mud-palette-text-secondary);
    text-align: center;
    white-space: nowrap;
}

.zone-heatmap-corner {
    text-align: left;
}

.zone-heatmap-row {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 6px;
    line-height: 24px;
}

.zone-heatmap-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 3px;
    background-color: var(--mud-palette-background-gray);
}

.zone-heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.zone-heatmap-scale {
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, color-mix(in srgb, var(--mud-palette-primary) 6%, transparent), var(--mud-palette-primary));
}

/* Live-Belegung (Plan 5.3): Tacho gegen die Kapazität, Farbe nach Stufe. */
.live-occupancy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.live-occupancy-gauge {
    width: 100%;
    max-width: 260px;
}

.live-occupancy-track,
.live-occupancy-arc {
    fill: none;
    stroke-width: 16;
    stroke-linecap: round;
}

.live-occupancy-track {
    stroke: var(--mud-palette-lines-default);
}

/* Schriftgröße von Zahl und Einheit kommt als SVG-Attribut aus LiveOccupancyDisplay (je nach Länge) – hier nicht setzen,
   CSS ginge dem Attribut vor. */
.live-occupancy-value {
    font-weight: 600;
    fill: var(--mud-palette-text-primary);
}

.live-occupancy-unit {
    fill: var(--mud-palette-text-secondary);
}

.live-occupancy-normal .live-occupancy-arc { stroke: var(--mud-palette-success); }
.live-occupancy-warning .live-occupancy-arc { stroke: var(--mud-palette-warning); }
.live-occupancy-alarm .live-occupancy-arc { stroke: var(--mud-palette-error); }
.live-occupancy-alarm .live-occupancy-value { fill: var(--mud-palette-error); }

/* Außerhalb der Öffnungszeit (Zeitfilter): weiter der Stand vor Ort, aber ausgegraut – auch Warn-/Alarmfarben. */
.live-occupancy--closed .live-occupancy-value,
.live-occupancy--closed.live-occupancy-alarm .live-occupancy-value { fill: var(--mud-palette-text-disabled); }
.live-occupancy--closed .live-occupancy-arc { stroke: var(--mud-palette-text-disabled); }

.live-occupancy-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.live-occupancy-input {
    max-width: 140px;
}

/* Live-Zonen-Belegung im Vergleich (Raumbezug Kinder): je Zone eine Kachel im Raster – so viele je Zeile, wie die Breite
   hergibt; die Mindestbreite folgt der Kachelgröße (LiveZoneTileSize, Klasse aus LiveZoneOccupancyDisplay.GridClass). */
.live-zone-comparison {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
}

.live-zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--live-zone-tile-min), 100%), 1fr));
    align-content: start;
    gap: 10px;
    width: 100%;
}

.live-zone-grid--small { --live-zone-tile-min: 150px; gap: 8px; }
.live-zone-grid--medium { --live-zone-tile-min: 210px; }
.live-zone-grid--large { --live-zone-tile-min: 300px; }

/* Akzent links nach Stufe – nur mit Kapazität, ohne Kapazität gibt es keine Schwelle. */
.live-zone-tile {
    --live-zone-accent: var(--mud-palette-lines-default);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-left: 4px solid var(--live-zone-accent);
    border-radius: var(--mud-default-borderradius);
    font-variant-numeric: tabular-nums;
}

.live-zone-tile--capacity.live-occupancy-normal { --live-zone-accent: var(--mud-palette-success); }
.live-zone-tile.live-occupancy-warning { --live-zone-accent: var(--mud-palette-warning); }
.live-zone-tile.live-occupancy-alarm {
    --live-zone-accent: var(--mud-palette-error);
    background-color: color-mix(in srgb, var(--mud-palette-error) 10%, transparent);
}

.live-zone-grid--small .live-zone-tile {
    gap: 2px;
    padding: 6px 8px;
}

.live-zone-grid--large .live-zone-tile {
    align-items: center;
    text-align: center;
}

.live-zone-tile__name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
}

.live-zone-grid--small .live-zone-tile__name { font-size: 0.8rem; }

.live-zone-tile__value {
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1.1;
}

.live-zone-grid--small .live-zone-tile__value { font-size: 1.5rem; }

.live-zone-tile.live-occupancy-warning .live-zone-tile__value { color: var(--mud-palette-warning); }
.live-zone-tile.live-occupancy-alarm .live-zone-tile__value { color: var(--mud-palette-error); }

.live-zone-tile__caption {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.live-zone-tile .live-occupancy-gauge {
    max-width: 200px;
}

/* Heute noch keine Daten: keine Stufe, also auch kein farbiger Akzent. */
.live-zone-tile.live-zone-tile--empty {
    --live-zone-accent: var(--mud-palette-lines-default);
    opacity: 0.6;
}

/* Zone außerhalb ihrer Öffnungszeit: Stand vor Ort, ausgegraut (der Tacho über live-occupancy--closed). */
.live-zone-tile.live-zone-tile--closed {
    --live-zone-accent: var(--mud-palette-text-disabled);
    background-color: transparent;
}
.live-zone-tile.live-zone-tile--closed .live-zone-tile__value { color: var(--mud-palette-text-disabled); }
.live-zone-tile--closed .mud-progress-linear { filter: grayscale(1); opacity: 0.6; }

/* Live-Ereignisse (Plan 5.3). */
.live-events-table td,
.live-events-table th {
    white-space: nowrap;
}

.live-events-value {
    margin-left: 4px;
    color: var(--mud-palette-text-secondary);
}

/* Fluss (Sankey): volle Breite; in Kachel und Space-Ansicht füllt er die verbleibende Höhe. */
.evaluation-flow {
    width: 100%;
}

.evaluation-flow-fill {
    flex: 1 1 auto;
    min-height: 220px;
}
