/* auswertung.css — gemeinsames Aussehen der Auswertungs-Beispiele auf design.ma-ki.io.
   Farben nach dem Dataviz-Verfahren (Reihenfarben fest in dieser Reihenfolge, nie neu verteilt),
   hell als Grundfall, dunkel eigens gewählt. Schrift lokal (Mona Sans, OFL). */

@font-face {
  font-family: "Mona Sans";
  src: url("../../schrift/mona-sans-var.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  color-scheme: light;
  --flaeche-0: #f3f2ee;          /* Seitengrund */
  --flaeche-1: #fcfcfb;          /* Karten, Diagrammfläche */
  --flaeche-2: #ecebe6;          /* Felder, Schaltflächen */
  --linie: #dcdad3;
  --raster: #e9e7e1;
  --text-1: #0b0b0b;
  --text-2: #52514e;
  --text-3: #75736d;
  --akzent: #2a78d6;
  --akzent-text: #1c5cab;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --gut: #0ca30c; --warn: #fab219; --ernst: #ec835a; --kritisch: #d03b3b;
  --gut-text: #006300; --kritisch-text: #b02a2a;
  --q1: #cde2fb; --q2: #9ec5f4; --q3: #6da7ec; --q4: #3987e5; --q5: #256abf; --q6: #184f95; --q7: #0d366b;
  --mitte: #f0efec; --div-kalt: #2a78d6; --div-warm: #e34948;
  --schatten: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px -12px rgb(0 0 0 / .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --flaeche-0: #121211;
    --flaeche-1: #1a1a19;
    --flaeche-2: #262624;
    --linie: #34342f;
    --raster: #2a2a27;
    --text-1: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #9a998f;
    --akzent: #3987e5;
    --akzent-text: #86b6ef;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --gut-text: #4cc94c; --kritisch-text: #ff8a8a;
    --q1: #104281; --q2: #184f95; --q3: #1c5cab; --q4: #2a78d6; --q5: #5598e7; --q6: #86b6ef; --q7: #cde2fb;
    --mitte: #383835;
    --schatten: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --flaeche-0: #121211; --flaeche-1: #1a1a19; --flaeche-2: #262624;
  --linie: #34342f; --raster: #2a2a27;
  --text-1: #f0efec; --text-2: #c3c2b7; --text-3: #9a998f;
  --akzent: #3987e5; --akzent-text: #86b6ef;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --gut-text: #4cc94c; --kritisch-text: #ff8a8a;
  --q1: #104281; --q2: #184f95; --q3: #1c5cab; --q4: #2a78d6; --q5: #5598e7; --q6: #86b6ef; --q7: #cde2fb;
  --mitte: #383835;
  --schatten: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--flaeche-0);
  color: var(--text-1);
  font: 400 16px/1.5 "Mona Sans", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--akzent-text); }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.breite { width: min(100% - 32px, 1440px); margin-inline: auto; }

/* ---------- Kopfleiste ---------- */
.a-kopf {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--flaeche-0) 92%, transparent);
  border-bottom: 1px solid var(--linie);
}
.a-kopf .breite { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.a-zurueck { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.a-zurueck:hover { color: var(--text-1); }
.a-kopf .a-name { font-weight: 650; font-size: 15px; margin: 0; }
.a-kopf .a-rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- Seitenkopf ---------- */
.a-titel { padding: 48px 0 24px; }
.a-titel h1 { font-size: clamp(30px, 4.4vw, 54px); line-height: 1.04; font-weight: 720; font-stretch: 92%; letter-spacing: -.02em; margin: 0 0 14px; max-width: 18ch; }
.a-titel p { margin: 0; max-width: 62ch; color: var(--text-2); font-size: 17px; }
.a-quelle { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 22px; font-size: 14px; color: var(--text-2); }
.a-schild { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--flaeche-2); color: var(--text-1); font-size: 13px; font-weight: 550; }
.a-schild i { width: 8px; height: 8px; border-radius: 50%; background: var(--s4); }
.a-schild.eigen i { background: var(--gut); }

/* ---------- Ablagefeld ---------- */
.ablage {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 18px 20px; margin: 8px 0 28px;
  border: 1.5px dashed var(--linie); border-radius: 14px; background: var(--flaeche-1);
  transition: border-color .2s, background-color .2s;
}
.ablage.drueber { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent) 7%, var(--flaeche-1)); }
.ablage svg { width: 34px; height: 34px; color: var(--akzent); }
.ablage b { display: block; font-weight: 650; }
.ablage span { color: var(--text-2); font-size: 14px; }
.ablage .knoepfe { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ablage .fehler { grid-column: 1 / -1; margin: 0; color: var(--kritisch-text); font-size: 14px; }
@media (max-width: 720px) { .ablage { grid-template-columns: 1fr; text-align: left; } .ablage svg { display: none; } .ablage .knoepfe { justify-content: flex-start; } }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--akzent); color: #fff;
}
.knopf:hover { filter: brightness(1.07); }
.knopf.leise { background: var(--flaeche-2); color: var(--text-1); border-color: var(--linie); }

/* ---------- Filterzeile ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 20px; }
.filter .f-name { font-size: 13px; color: var(--text-3); margin-right: 4px; }
.wahl { display: inline-flex; background: var(--flaeche-2); border-radius: 10px; padding: 3px; gap: 2px; }
.wahl button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; }
.wahl button[aria-pressed="true"] { background: var(--flaeche-1); color: var(--text-1); box-shadow: var(--schatten); }
select.feld { min-height: 42px; padding: 0 34px 0 12px; border-radius: 10px; border: 1px solid var(--linie); background: var(--flaeche-1); color: var(--text-1); font: inherit; font-size: 14px; }

/* ---------- Kennzahlen ---------- */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kz { background: var(--flaeche-1); border: 1px solid var(--linie); border-radius: 14px; padding: 16px 18px 18px; }
.kz .kz-name { margin: 0; font-size: 13px; color: var(--text-2); }
.kz .kz-wert { margin: 6px 0 2px; font-size: clamp(26px, 2.6vw, 34px); font-weight: 680; font-stretch: 90%; letter-spacing: -.01em; line-height: 1.1; }
.kz .kz-wert small { font-size: .5em; font-weight: 550; color: var(--text-2); margin-left: 3px; }
.kz .kz-neben { margin: 0; font-size: 13px; color: var(--text-3); }
.kz .rauf { color: var(--kritisch-text); }
.kz .runter { color: var(--gut-text); }
.kz.gross { grid-column: span 2; }
@media (max-width: 520px) {
  .kz.gross { grid-column: auto; }
  .kennzahlen { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kz { padding: 12px 14px 14px; }
  .kz .kz-wert { font-size: 24px; }
}

/* ---------- Diagrammkarten ---------- */
.gitter { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.karte { grid-column: span 6; background: var(--flaeche-1); border: 1px solid var(--linie); border-radius: 14px; padding: 18px 18px 14px; min-width: 0; position: relative; }
.karte.voll { grid-column: 1 / -1; }
.karte.drittel { grid-column: span 4; }
.karte.zwei-drittel { grid-column: span 8; }
@media (max-width: 1020px) { .karte, .karte.drittel, .karte.zwei-drittel { grid-column: 1 / -1; } }
.karte-kopf { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.karte-kopf h2 { font-size: 16px; font-weight: 650; margin: 0; line-height: 1.3; }
.karte-kopf p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.karte-kopf .tabelle-knopf { margin-left: auto; flex: none; min-height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--linie); background: transparent; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.karte-kopf .tabelle-knopf:hover { color: var(--text-1); }
.einsicht { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--raster); font-size: 14px; color: var(--text-2); }
.einsicht b { color: var(--text-1); font-weight: 620; }

.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; color: var(--text-2); }
.legende li { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legende i.strich { height: 2px; border-radius: 1px; width: 14px; }

/* ---------- SVG-Diagramme ---------- */
.dia { position: relative; width: 100%; }
.dia svg { display: block; width: 100%; height: auto; overflow: visible; }
.dia .achse text, .dia text.achse { fill: var(--text-3); font-size: 11px; }
.dia .raster line { stroke: var(--raster); stroke-width: 1; }
.dia .grundlinie { stroke: var(--linie); stroke-width: 1; }
.dia .wert-label { fill: var(--text-2); font-size: 11px; font-weight: 550; }
.dia .name-label { fill: var(--text-1); font-size: 12px; }
.dia .treffer { fill: transparent; cursor: crosshair; }
.dia .fadenkreuz { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.dia .punkt-ring { stroke: var(--flaeche-1); stroke-width: 2; }

/* Auftritt: Balken wachsen, Linien zeichnen sich, sobald die Karte ins Bild kommt */
.dia .wachsen { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.dia .wachsen.quer { transform-origin: 0 50%; transform: scaleX(0); }
.dia.sichtbar .wachsen { transform: none; }
.dia .zeichnen { stroke-dasharray: var(--laenge, 2000); stroke-dashoffset: var(--laenge, 2000); transition: stroke-dashoffset 1.4s cubic-bezier(.3,.6,.2,1); }
.dia.sichtbar .zeichnen { stroke-dashoffset: 0; }
.dia .einblenden { opacity: 0; transition: opacity .6s .5s; }
.dia.sichtbar .einblenden { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .dia .wachsen, .dia .zeichnen, .dia .einblenden { transition: none; transform: none; stroke-dashoffset: 0; opacity: 1; }
}

.tipp {
  position: fixed; z-index: 50; pointer-events: none; min-width: 120px; max-width: 280px;
  padding: 8px 10px; border-radius: 10px; background: var(--flaeche-1); color: var(--text-1);
  border: 1px solid var(--linie); box-shadow: var(--schatten); font-size: 13px; line-height: 1.4;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tipp.an { opacity: 1; transform: none; }
.tipp .t-kopf { font-weight: 650; margin-bottom: 2px; }
.tipp .t-zeile { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tipp .t-zeile span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tipp .t-zeile i { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- Tabellen ---------- */
.tabelle-huelle { position: relative; overflow: auto; max-height: 420px; border: 1px solid var(--raster); border-radius: 10px; }
table.daten { width: 100%; border-collapse: collapse; font-size: 13px; }
table.daten th, table.daten td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--raster); white-space: nowrap; }
table.daten th { position: sticky; top: 0; background: var(--flaeche-2); font-weight: 600; color: var(--text-2); z-index: 1; }
table.daten td.z, table.daten th.z { text-align: right; }
table.daten tr:hover td { background: color-mix(in srgb, var(--akzent) 5%, transparent); }

/* Statuszeichen: Farbe nie allein, immer mit Zeichen und Wort */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status.gut { color: var(--gut-text); }
.status.warn { color: #9a6a00; }
.status.ernst { color: #b4552e; }
.status.kritisch { color: var(--kritisch-text); }
:root[data-theme="dark"] .status.warn { color: var(--warn); }
:root[data-theme="dark"] .status.ernst { color: var(--ernst); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .status.warn { color: var(--warn); } :root:not([data-theme="light"]) .status.ernst { color: var(--ernst); } }

/* ---------- Abschnitte ---------- */
.abschnitt { margin: 40px 0 0; }
.abschnitt > h2 { font-size: 22px; font-weight: 680; letter-spacing: -.01em; margin: 0 0 4px; }
.abschnitt > p.unter { margin: 0 0 16px; color: var(--text-2); max-width: 70ch; }

/* ---------- Fuß ---------- */
.a-fuss { margin-top: 64px; border-top: 1px solid var(--linie); padding: 28px 0 40px; color: var(--text-2); font-size: 14px; }
.a-fuss .breite { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.a-fuss p { margin: 0; max-width: 70ch; }
.zeichen-liste { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.zeichen-link { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: var(--text-2); }
.zeichen-link:hover { color: var(--text-1); background: var(--flaeche-2); }
.zeichen { width: 20px; height: 20px; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
