/* ATLAS – Auswertungen (M7): Reiter, Liniendiagramme, Fehler-Heatmap, Funktionsmatrix. Nutzt die Farbvariablen aus atlas.css. */
:root {
    --reihe-0: #c8102e; --reihe-1: #2563eb; --reihe-2: #16a34a; --reihe-3: #ca8a04; --reihe-4: #7c3aed; --reihe-5: #0891b2;
}
@media screen and (prefers-color-scheme: dark) {
    :root:not([data-farbschema="hell"]) {
        --reihe-0: #f87171; --reihe-1: #60a5fa; --reihe-2: #4ade80; --reihe-3: #facc15; --reihe-4: #a78bfa; --reihe-5: #22d3ee;
    }
}
:root[data-farbschema="dunkel"] {
    --reihe-0: #f87171; --reihe-1: #60a5fa; --reihe-2: #4ade80; --reihe-3: #facc15; --reihe-4: #a78bfa; --reihe-5: #22d3ee;
}

/* Reiter */
.reiter { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--linie); margin-top: 4px; }
.reiter-knopf { font: inherit; font-size: 14px; padding: 8px 14px; min-height: 40px; border: 1px solid transparent; border-bottom: none;
                border-radius: 6px 6px 0 0; background: transparent; color: var(--text-2); cursor: pointer; margin-bottom: -1px; }
.reiter-knopf:hover { background: var(--flaeche-hover); }
.reiter-knopf[aria-selected="true"] { background: var(--flaeche); border-color: var(--linie); color: var(--feuer-700); font-weight: 600; }
.link-knopf { font: inherit; font-size: inherit; padding: 0; border: none; background: none; color: var(--link); text-decoration: underline; cursor: pointer; }

/* Liniendiagramm */
.diagramm { margin: 0 0 20px; }
.diagramm figcaption { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 4px; }
.diagramm svg { width: 100%; height: auto; max-height: 320px; display: block; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 6px; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.legende-eintrag { display: inline-flex; align-items: center; gap: 6px; }
.legende-strich { display: inline-block; width: 18px; height: 0; border-top: 3px solid currentColor; }
.legende-strich.gestrichelt { border-top: 2px dashed var(--leise); }
.legende-strich.grenze { border-top: 2px dotted var(--rot); }
.raster-linie { stroke: var(--linie); stroke-width: 1; vector-effect: non-scaling-stroke; }
.achse { fill: var(--leise); font-size: 11px; }
.grenzlinie { stroke: var(--rot); stroke-width: 2; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.grenztext { fill: var(--rot-text); }
.linie { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.linie.gestrichelt { stroke-width: 1.5; stroke-dasharray: 6 4; opacity: .7; }
.punkt { stroke-width: 2; vector-effect: non-scaling-stroke; }
.punkt.ring { fill: var(--flaeche) !important; }
.werte summary { font-size: 13px; color: var(--leise); cursor: pointer; margin-top: 4px; }
.reihe-0 { color: var(--reihe-0); stroke: var(--reihe-0); fill: var(--reihe-0); }
.reihe-1 { color: var(--reihe-1); stroke: var(--reihe-1); fill: var(--reihe-1); }
.reihe-2 { color: var(--reihe-2); stroke: var(--reihe-2); fill: var(--reihe-2); }
.reihe-3 { color: var(--reihe-3); stroke: var(--reihe-3); fill: var(--reihe-3); }
.reihe-4 { color: var(--reihe-4); stroke: var(--reihe-4); fill: var(--reihe-4); }
.reihe-5 { color: var(--reihe-5); stroke: var(--reihe-5); fill: var(--reihe-5); }
path.linie[class*="reihe-"] { fill: none; }
.legende-strich[class*="reihe-"] { background: none; }

/* Abnahme-Reife */
.reife-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 0 16px; }
@media (max-width: 520px) { .reife-raster { grid-template-columns: 1fr; } }

/* Heatmap und Funktionsmatrix */
.tabelle-scroll { overflow-x: auto; }
td.zahl, th.zahl { text-align: center; font-variant-numeric: tabular-nums; }
.heatmap tbody th, .funktionsmatrix tbody th { text-align: left; font-weight: 400; }
.heatmap .zelle { min-width: 44px; }
.heatmap .stufe-1 { background: color-mix(in srgb, var(--rot) 18%, transparent); }
.heatmap .stufe-2 { background: color-mix(in srgb, var(--rot) 38%, transparent); }
.heatmap .stufe-3 { background: color-mix(in srgb, var(--rot) 60%, transparent); font-weight: 600; }
.heatmap .stufe-4 { background: color-mix(in srgb, var(--rot) 85%, transparent); color: #fff; font-weight: 700; }
.trend { font-size: 12px; white-space: nowrap; color: var(--leise); }
.trend.besser { color: var(--gruen-text); }
.trend.schlechter { color: var(--rot-text); font-weight: 600; }
.funktionsmatrix td.nie { background: var(--gelb-grund); color: var(--gelb-text); }

/* Balkendiagramm (Anwesenheit, Alpha-Rückmeldung 6 vom 02.11.2026) */
.diagramm svg.hoch { max-height: none; }
.balken.unter-grenze { fill: var(--rot); }
.legende-strich.unter-grenze { border-top-color: var(--rot); }
.balken-name { fill: var(--text-2); }

/* Leistungskurven-Übersicht (Alpha-Rückmeldung 10 vom 02.11.2026) */
.kurven-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.kurven-kopf h2 { margin: 0; }

/* Personen: Erklärung und Einzelheiten unter der Tabelle (Alpha-Rückmeldung vom 03.11.2026) */
.erklaerung { margin: 0 0 8px; padding-left: 20px; }
.erklaerung li { margin: 2px 0; }
.chip.nie-beispiel { background: var(--gelb-grund); color: var(--gelb-text); }
.funktionsmatrix tr.gewaehlt > * { background: var(--flaeche-2); }
.funktionsmatrix abbr { text-decoration: none; cursor: help; }
.person-detail { margin-top: 12px; padding: 12px; border: 1px solid var(--linie-2); border-radius: 8px; background: var(--flaeche-2); }
.person-detail h3 { margin: 0; }
.person-detail h4 { margin: 8px 0 4px; }
.person-detail-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 8px 24px; align-items: start; }
.person-detail table { width: 100%; }
.person-detail td, .person-detail th { white-space: nowrap; }
