/* =====================================================================
   labor.css – Gestaltung der Labore (Block „::: labor <name>“, web/app/labore/*.js)
   Farben nur über die Variablen der App (kurs.css) → hell und dunkel stimmen automatisch.
   Bedeutung nie nur über Farbe: Klassen zusätzlich über Form (gefüllt/hohl), Muster oder Beschriftung.
   ===================================================================== */
.labor {
  --lab-a: #b5560a;            /* Klasse/Reihe A (z. B. Label 1): Bernstein */
  --lab-a-soft: #fdebd6;
  --lab-b: #5b3bbf;            /* Klasse/Reihe B (z. B. Label 0): Violett */
  --lab-b-soft: #ece6fb;
  --lab-c: #0b7a57;            /* dritte Reihe: Grün */
  --lab-c-soft: #dcf3ea;
  --lab-linie: var(--brand);   /* Entscheidungsgrenze, Modellkurve */
  --lab-gitter: var(--border);
  --lab-ok: #0b6b3a;           /* Erfolg als Schrift auf hellem Grund (Kontrast ≥ 4,5:1) */
  --lab-fehler: #b42323;
  container-type: inline-size;
  margin: 26px 0; padding: 18px 20px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-strong); border-top: 4px solid var(--profi);
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .labor {
  --lab-a: #f2a65a; --lab-a-soft: #3a2611; --lab-b: #b9a3f7; --lab-b-soft: #251d42; --lab-c: #4fd0a2; --lab-c-soft: #0f2c22; --lab-ok: #3ccd80; --lab-fehler: #f58080;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .labor {
  --lab-a: #f2a65a; --lab-a-soft: #3a2611; --lab-b: #b9a3f7; --lab-b-soft: #251d42; --lab-c: #4fd0a2; --lab-c-soft: #0f2c22; --lab-ok: #3ccd80; --lab-fehler: #f58080;
} }
.labor-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 6px; }
.labor-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--profi); }
.labor-kicker .icon { width: 1.15em; height: 1.15em; }
.labor-kopf strong { font-family: var(--display); font-size: 1.18rem; color: var(--text); }
.labor > .prose { font-size: .98rem; color: var(--text-2); }
.labor > .prose p { margin: .3rem 0 .6rem; }
.labor-buehne { margin-top: 10px; min-height: 120px; }
.labor-laedt, .labor-fehler { color: var(--muted); font-size: .95rem; }
.labor-fehler { color: var(--danger); }

/* ---- Layout */
.lab-spalten { display: grid; gap: 16px 22px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 700px) { .lab-spalten { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } .lab-spalten.gleich { grid-template-columns: 1fr 1fr; } }
.lab-spalte { min-width: 0; }
.lab-zeile { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 10px 0; }
.lab-kasten { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0; font-size: .95rem; overflow-wrap: anywhere; }
.lab-kasten p { margin: 0; } .lab-kasten p + p { margin-top: 4px; }
.lab-titel { font-family: var(--display); font-weight: 700; font-size: 1rem; margin: 12px 0 4px; color: var(--text); }
.lab-hinweis { color: var(--muted); font-size: .88rem; margin: 6px 0; }

/* ---- Bedienelemente (Tippziele ≥ 44 px) */
.lab-knopf { min-height: 44px; }
.lab-regler { display: grid; grid-template-columns: minmax(6.5em, auto) minmax(0, 1fr) minmax(3.6em, auto); gap: 4px 10px; align-items: center; margin: 4px 0; min-height: 44px; }
.lab-regler label { font-weight: 600; font-size: .93rem; color: var(--text-2); }
.lab-regler input[type="range"] { width: 100%; min-width: 0; height: 32px; accent-color: var(--brand); }
.lab-wert { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; color: var(--text); white-space: nowrap; }
.lab-segmente { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--surface-2); max-width: 100%; }
.lab-segmente button { min-height: 44px; padding: 6px 14px; border: 0; border-right: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font: 600 .92rem var(--font); cursor: pointer; }
.lab-segmente button:last-child { border-right: 0; }
.lab-segmente button[aria-pressed="true"] { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .lab-segmente button[aria-pressed="true"] { color: #04101c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lab-segmente button[aria-pressed="true"] { color: #04101c; } }
.lab-segmente button:focus-visible, .lab-select:focus-visible, .lab-flaeche:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.lab-auswahl { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.lab-auswahl label { font-weight: 600; font-size: .93rem; color: var(--text-2); }
.lab-select { min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 .95rem var(--font); max-width: 100%; }

/* ---- Anzeigen */
.lab-meldung { margin: 8px 0; font-size: .97rem; min-height: 1.4em; color: var(--text-2); }
.lab-meldung[data-art="ok"] { color: var(--lab-ok); font-weight: 600; }
.lab-meldung[data-art="fehler"] { color: var(--lab-fehler); font-weight: 600; }
.lab-kennzahlen { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.lab-kennzahl { flex: 1 1 7.5em; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.lab-kennzahl span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.lab-kennzahl strong { font: 700 1.25rem var(--display); font-variant-numeric: tabular-nums; color: var(--text); }
.lab-kennzahl[data-art="gut"] strong { color: var(--lab-ok); }
.lab-kennzahl[data-art="schlecht"] strong { color: var(--lab-fehler); }
.lab-fragen { margin: 14px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--profi-soft); border: 1px solid color-mix(in srgb, var(--profi) 25%, transparent); font-size: .96rem; }
.lab-fragen > strong { font-family: var(--display); }
.lab-fragen ol { margin: 6px 0 0; padding-left: 1.3em; }
.lab-fragen li { margin: 6px 0; }
.lab-fragen summary { cursor: pointer; color: var(--profi); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.lab-fragen details > div { margin: 2px 0 6px; color: var(--text-2); }
.lab-tabelle-rahmen { overflow: auto; max-height: 22em; border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 10px 0; }
table.lab-tabelle { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.lab-tabelle th, table.lab-tabelle td { padding: 5px 9px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.lab-tabelle th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: 700; }
table.lab-tabelle tr.neu td { background: var(--gold-soft); }

/* ---- Zeichenflächen (SVG) */
.lab-flaeche { display: block; width: 100%; height: auto; max-height: 72vh; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.lab-flaeche text { font-family: var(--font); fill: var(--text-2); }
.lab-zahl { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lab-achsentext { font-size: 12.5px; font-weight: 600; }
.lab-gitter { stroke: var(--lab-gitter); stroke-width: 1; }
.lab-rahmen { fill: none; stroke: var(--border-strong); stroke-width: 1.2; }
.lab-linie { fill: none; stroke: var(--lab-linie); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lab-linie-a { fill: none; stroke: var(--lab-a); stroke-width: 2.4; stroke-linejoin: round; }
.lab-linie-b { fill: none; stroke: var(--lab-b); stroke-width: 2.4; stroke-linejoin: round; stroke-dasharray: 7 4; }
.lab-flaeche-a { fill: var(--lab-a); fill-opacity: .16; stroke: none; }
.lab-flaeche-b { fill: var(--lab-b); fill-opacity: .13; stroke: none; }
.lab-punkt-a { fill: var(--lab-a); stroke: var(--surface); stroke-width: 1.5; }                     /* Klasse A: gefüllt */
.lab-punkt-b { fill: var(--surface); stroke: var(--lab-b); stroke-width: 2.6; }                     /* Klasse B: hohl */
.lab-punkt-c { fill: var(--lab-c); stroke: var(--surface); stroke-width: 1.5; }
.lab-punkt-falsch { fill: none; stroke: var(--danger); stroke-width: 2; stroke-dasharray: 4 3; }
.lab-punkt-aktiv { fill: none; stroke: var(--text); stroke-width: 2.4; }
.lab-legende { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .86rem; color: var(--text-2); margin: 6px 0; }
.lab-legende span { display: inline-flex; align-items: center; gap: 6px; }
.lab-legende i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.lab-legende i.a { background: var(--lab-a); } .lab-legende i.b { border: 3px solid var(--lab-b); background: var(--surface); } .lab-legende i.c { background: var(--lab-c); }
.lab-legende i.linie { width: 20px; height: 0; border-radius: 0; border-top: 3px solid var(--lab-linie); }
@media (prefers-reduced-motion: reduce) { .labor * { transition: none !important; animation: none !important; } }
