/* ==========================================================================
   QuickConnect Backend — Gestaltungssystem
   Haltung: docs/design/stille-frequenz.md

   Grundsätze, die überall gelten:
   - Gruppiert wird durch Abstand und Gewicht, nicht durch Rahmen. Wo eine
     Linie nötig scheint, fehlt in Wahrheit Luft.
   - Farbe ist ein Signalkanal. Sie bleibt dem Zustand vorbehalten; die
     Markenfarben treten nur im Rahmenwerk auf, nie in den Daten.
   - Drei Schriftgrade zählen, dazwischen nichts. Hierarchie durch
     Entschiedenheit statt durch Abstufung.
   - Zahlen stehen tabellarisch und fluchten über alle Zeilen.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Marken- und Farbwerte
   Rot und Grün stammen aus dem Logo (aus der Bilddatei ausgemessen).
   -------------------------------------------------------------------------- */

:root {
    color-scheme: light dark;

    /* Marke */
    --rot:          #c61836;
    --gruen:        #66a830;

    /* Flächen */
    --grund:        #f6f6f4;
    --flaeche:      #ffffff;
    --flaeche-weich:#f2f3f1;
    --leiste-grund: #ffffff;

    /* Linien: sehr zurückhaltend, oft nur angedeutet */
    --haarlinie:    #e8e9e7;
    --haarlinie-stark: #d8dad7;

    /* Schrift */
    --tinte:        #14161a;
    --tinte-leise:  #5d6470;
    --tinte-schwach:#949aa4;

    /* Zustände */
    --ok:           #4c8425;
    --ok-grund:     #eef6e8;
    --info:         #245f9e;
    --info-grund:   #e9f1fa;
    --warten:       #8a6410;
    --warten-grund: #faf2e0;
    --stopp:        #b31730;
    --stopp-grund:  #fceaed;
    --ruhe-grund:   #f0f1ef;

    /* Handlung */
    --aktiv:        #14161a;
    --aktiv-text:   #ffffff;
    --markierung:   var(--rot);

    /* Tiefe: drei Stufen, alle kaum wahrnehmbar */
    --tiefe-1: 0 1px 2px rgba(20, 22, 26, .04);
    --tiefe-2: 0 1px 3px rgba(20, 22, 26, .06), 0 1px 2px rgba(20, 22, 26, .04);
    --tiefe-3: 0 8px 28px rgba(20, 22, 26, .12);

    --rundung:       10px;
    --rundung-klein: 7px;
    --leiste-breite: 256px;

    --schwung: 140ms cubic-bezier(.4, 0, .2, 1);
}

/* Dunkle Fassung.

   Sie gilt in zwei Fällen: wenn das Betriebssystem dunkel eingestellt ist
   und der Benutzer nichts anderes gewählt hat, oder wenn er sie selbst
   gewählt hat. Deshalb steht die Werteliste zweimal – reines CSS kann
   einen Block nicht an zwei Bedingungen hängen, und ein Bauschritt nur
   dafür wäre unverhältnismäßig. Änderungen also immer an BEIDEN Stellen.
   Der Test darstellung-umschalten prüft, dass sie gleich bleiben. */

@media (prefers-color-scheme: dark) {
    :root:not([data-darstellung="hell"]) {
        --rot:          #e35673;
        --gruen:        #7cc246;

        --grund:        #0c0e12;
        --flaeche:      #14171d;
        --flaeche-weich:#191d24;
        --leiste-grund: #101318;

        --haarlinie:    #232730;
        --haarlinie-stark: #323843;

        --tinte:        #e9ecf1;
        --tinte-leise:  #98a1ae;
        --tinte-schwach:#6b7481;

        --ok:           #7cc246;
        --ok-grund:     #152113;
        --info:         #86b6ea;
        --info-grund:   #14202e;
        --warten:       #d5a63c;
        --warten-grund: #241e10;
        --stopp:        #ef7288;
        --stopp-grund:  #2a1319;
        --ruhe-grund:   #1b1f26;

        --aktiv:        #e9ecf1;
        --aktiv-text:   #0c0e12;

        --tiefe-1: 0 1px 2px rgba(0, 0, 0, .3);
        --tiefe-2: 0 1px 3px rgba(0, 0, 0, .4);
        --tiefe-3: 0 10px 34px rgba(0, 0, 0, .55);
    }
}

:root[data-darstellung="dunkel"] {

    --rot:          #e35673;
    --gruen:        #7cc246;

    --grund:        #0c0e12;
    --flaeche:      #14171d;
    --flaeche-weich:#191d24;
    --leiste-grund: #101318;

    --haarlinie:    #232730;
    --haarlinie-stark: #323843;

    --tinte:        #e9ecf1;
    --tinte-leise:  #98a1ae;
    --tinte-schwach:#6b7481;

    --ok:           #7cc246;
    --ok-grund:     #152113;
    --info:         #86b6ea;
    --info-grund:   #14202e;
    --warten:       #d5a63c;
    --warten-grund: #241e10;
    --stopp:        #ef7288;
    --stopp-grund:  #2a1319;
    --ruhe-grund:   #1b1f26;

    --aktiv:        #e9ecf1;
    --aktiv-text:   #0c0e12;

    --tiefe-1: 0 1px 2px rgba(0, 0, 0, .3);
    --tiefe-2: 0 1px 3px rgba(0, 0, 0, .4);
    --tiefe-3: 0 10px 34px rgba(0, 0, 0, .55);
}

/* --------------------------------------------------------------------------
   2. Grundlagen
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--tinte);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    font-feature-settings: 'cv05' 1, 'cv11' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Ein einziger, überall gleicher Fokusring. */
:focus-visible {
    outline: 2px solid var(--markierung);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: color-mix(in srgb, var(--rot) 22%, transparent); }

/* --------------------------------------------------------------------------
   3. Gerüst
   -------------------------------------------------------------------------- */

.rahmen { display: flex; min-height: 100%; }

.leiste {
    width: var(--leiste-breite);
    flex: 0 0 var(--leiste-breite);
    background: var(--leiste-grund);
    border-right: 1px solid var(--haarlinie);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

/* Marke: die vollständige Sperrmarke, in der Breite begrenzt durch die
   Seitenleiste. Höhe statt Breite gesetzt, damit nichts beschnitten wird. */
.marke {
    display: block;
    padding: 20px 20px 16px;
}
.sperrmarke {
    display: block;
    height: auto;
    width: 100%;
    max-width: 196px;
}
.sperrmarke-hell { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-darstellung="hell"]) .sperrmarke-dunkel { display: none; }
    :root:not([data-darstellung="hell"]) .sperrmarke-hell { display: block; }
}
:root[data-darstellung="dunkel"] .sperrmarke-dunkel { display: none; }
:root[data-darstellung="dunkel"] .sperrmarke-hell { display: block; }

.umgebung {
    margin: 0 20px 16px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--tinte-schwach);
}
.umgebung::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--rot);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rot) 15%, transparent);
    flex: 0 0 auto;
}

.menue { padding: 0 12px; flex: 1; overflow-y: auto; }

.menue-titel {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tinte-schwach);
    padding: 10px 8px 8px;
}

.menue a,
.menue .gesperrt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    margin-bottom: 2px;
    border-radius: var(--rundung-klein);
    color: var(--tinte-leise);
    font-weight: 500;
    transition: background var(--schwung), color var(--schwung);
}
.menue a:hover { background: var(--flaeche-weich); color: var(--tinte); }

/* Aktiver Eintrag: Markierung als schmaler Balken, nicht als Farbfläche. */
.menue a.aktiv { background: var(--flaeche-weich); color: var(--tinte); font-weight: 600; }
.menue a.aktiv::before {
    content: "";
    position: absolute;
    left: -12px; top: 50%;
    width: 3px; height: 18px;
    margin-top: -9px;
    border-radius: 0 3px 3px 0;
    background: var(--markierung);
}
.menue a.aktiv svg { opacity: 1; color: var(--tinte); }

.menue svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .65; }

.menue .gesperrt { color: var(--tinte-schwach); cursor: default; }
.menue .hinweis {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--tinte-schwach);
    background: var(--ruhe-grund);
    border-radius: 20px;
    padding: 2px 8px;
}

.leisten-fuss {
    padding: 12px 12px 10px;
    margin: 0 8px 8px;
    border-top: 1px solid var(--haarlinie);
}
.benutzerzeile { display: flex; align-items: center; gap: 10px; }

/* Umschalter der Darstellung: drei Zustände, der gewählte ist erhaben. */
.darstellung {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
    margin-bottom: 10px;
    background: var(--flaeche-weich);
    border-radius: var(--rundung-klein);
}
.darstellung button {
    display: grid; place-items: center;
    padding: 5px 0;
    border: 0; border-radius: 5px;
    background: none; color: var(--tinte-schwach);
    cursor: pointer;
    transition: background var(--schwung), color var(--schwung);
}
.darstellung button:hover { color: var(--tinte-leise); }
.darstellung button[aria-pressed="true"] {
    background: var(--flaeche);
    color: var(--tinte);
    box-shadow: var(--tiefe-1);
}
.darstellung svg { width: 15px; height: 15px; display: block; }

/* Nur für Vorleseprogramme, nicht sichtbar. */
.nurlesen {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.kuerzel {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ruhe-grund);
    color: var(--tinte-leise);
    font-size: 11.5px; font-weight: 650;
    letter-spacing: .01em;
    flex: 0 0 auto;
}
.wer { min-width: 0; flex: 1; line-height: 1.3; }
.wer-name {
    display: block; font-weight: 600; font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.wer-name { color: inherit; text-decoration: none; }
a.wer-name:hover { text-decoration: underline; }
.wer-rolle { display: block; font-size: 11.5px; color: var(--tinte-schwach); }

.abmelden button {
    background: none; border: 0; padding: 6px; cursor: pointer;
    color: var(--tinte-schwach); border-radius: 6px;
    display: grid; place-items: center;
    transition: background var(--schwung), color var(--schwung);
}
.abmelden button:hover { background: var(--flaeche-weich); color: var(--stopp); }
.abmelden svg { width: 17px; height: 17px; }

/* --------------------------------------------------------------------------
   4. Bühne und Kopfzeile
   -------------------------------------------------------------------------- */

.buehne { flex: 1; min-width: 0; }

.kopfzeile {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--grund) 80%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--haarlinie);
    padding: 0 32px;
}
.kopf-innen { display: flex; align-items: center; gap: 14px; min-height: 58px; }
.kopf-titel {
    margin: 0;
    font-size: 13.5px; font-weight: 600;
    letter-spacing: .005em;
    color: var(--tinte-leise);
}
.kopf-werkzeuge { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }

.schalter {
    display: none;
    background: none; border: 1px solid var(--haarlinie-stark);
    border-radius: var(--rundung-klein); padding: 6px; cursor: pointer;
}
.schalter svg { width: 18px; height: 18px; display: block; }

main { padding: 30px 32px 72px; max-width: 1340px; }

/* Seitenkopf: die eine große Geste. */
.seiten-kopf { margin-bottom: 24px; }
.seiten-kopf h1 {
    margin: 0 0 5px;
    font-size: 25px; font-weight: 680;
    letter-spacing: -.024em;
    line-height: 1.15;
}
.seiten-kopf p { margin: 0; color: var(--tinte-leise); max-width: 62ch; }

/* --------------------------------------------------------------------------
   5. Tafeln
   -------------------------------------------------------------------------- */

.karte {
    background: var(--flaeche);
    border: 1px solid var(--haarlinie);
    border-radius: var(--rundung);
    box-shadow: var(--tiefe-1);
    overflow: hidden;
    margin-bottom: 18px;
}
.karte-kopf {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--haarlinie);
}
.karte-kopf h2 {
    margin: 0;
    font-size: 13px; font-weight: 650;
    letter-spacing: .005em;
}
.karte-kopf .rechts { margin-left: auto; font-size: 13px; }
.karte-koerper { padding: 18px 20px; }

/* --------------------------------------------------------------------------
   6. Kennzahlen
   -------------------------------------------------------------------------- */

.kennzahlen {
    display: grid; gap: 14px; margin-bottom: 18px;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}
.kennzahl {
    background: var(--flaeche);
    border: 1px solid var(--haarlinie);
    border-radius: var(--rundung);
    box-shadow: var(--tiefe-1);
    padding: 16px 18px;
}
.kennzahl-titel {
    font-size: 11px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--tinte-schwach);
    margin-bottom: 8px;
}
.kennzahl-wert {
    font-size: 27px; font-weight: 660;
    letter-spacing: -.028em; line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.kennzahl-wert.klein { font-size: 18px; letter-spacing: -.015em; }
.kennzahl-fuss { margin-top: 5px; font-size: 12.5px; color: var(--tinte-leise); }

/* --------------------------------------------------------------------------
   7. Tabellen
   Dichte nach dem Vorbild guter Werkzeuge: 40px Zeilen, keine Gitterlinien,
   Zahlen tabellarisch.
   -------------------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }
/* Stehen zwei Tabellen in einer Karte, sagt die Überschrift, welche welche ist. */
table caption {
    text-align: left; padding: 14px 18px 0;
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--tinte-schwach);
}

/* Enthält eine Tafel eine Tabelle, darf sie waagerecht laufen. Ohne das
   werden bei mittleren Fensterbreiten Spalten unlesbar gequetscht. */
.karte:has(table) { overflow-x: auto; }
.karte:has(table) table { min-width: 660px; }

thead th {
    text-align: left;
    font-size: 11px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--tinte-schwach);
    background: var(--flaeche);
    padding: 10px 20px;
    border-bottom: 1px solid var(--haarlinie);
    white-space: nowrap;
}

tbody td {
    padding: 9px 20px;
    border-bottom: 1px solid var(--haarlinie);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--schwung); }
tbody tr:hover { background: var(--flaeche-weich); }

td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }

/* Verweise in Tabellen: erst beim Überfahren unterstrichen. */
tbody a { color: var(--tinte); font-weight: 550; }
tbody a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   8. Plaketten für Zustände
   Der Punkt trägt die Farbe, die Schrift bleibt ruhig.
   -------------------------------------------------------------------------- */

.marke-pille {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 550;
    padding: 3px 9px 3px 8px;
    border-radius: 20px;
    background: var(--ruhe-grund);
    color: var(--tinte-leise);
    white-space: nowrap;
}
.marke-pille::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: .55;
    flex: 0 0 auto;
}
.marke-pille.gruen { background: var(--ok-grund); color: var(--ok); }
.marke-pille.gelb  { background: var(--warten-grund); color: var(--warten); }
.marke-pille.rot   { background: var(--stopp-grund); color: var(--stopp); }
.marke-pille.gruen::before,
.marke-pille.gelb::before,
.marke-pille.rot::before { opacity: 1; }

/* --------------------------------------------------------------------------
   9. Knöpfe und Felder
   -------------------------------------------------------------------------- */

.knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 7px 13px;
    border-radius: var(--rundung-klein);
    border: 1px solid var(--haarlinie-stark);
    background: var(--flaeche);
    color: var(--tinte);
    font-size: 13.5px; font-weight: 550;
    cursor: pointer; white-space: nowrap;
    transition: background var(--schwung), border-color var(--schwung), transform var(--schwung);
}
.knopf:hover { background: var(--flaeche-weich); }
.knopf:active { transform: translateY(.5px); }
.knopf svg { width: 15px; height: 15px; }

.knopf.gefaehrlich {
    background: var(--stopp); border-color: var(--stopp); color: #fff;
}
.knopf.gefaehrlich:hover { filter: brightness(1.08); }

/* Aufzählung der Folgen einer Löschung. */
.folgen { margin: 8px 0 0; padding-left: 20px; color: var(--tinte-leise); }
.folgen li { margin-bottom: 4px; }

.knopf.haupt {
    background: var(--aktiv); border-color: var(--aktiv); color: var(--aktiv-text);
}
.knopf.haupt:hover { background: color-mix(in srgb, var(--aktiv) 88%, var(--grund)); }

.feld {
    width: 100%;
    padding: 7px 11px;
    border: 1px solid var(--haarlinie-stark);
    border-radius: var(--rundung-klein);
    background: var(--flaeche);
    font-size: 13.5px;
    transition: border-color var(--schwung), box-shadow var(--schwung);
}
.feld:hover { border-color: var(--tinte-schwach); }
.feld:focus {
    outline: none;
    border-color: var(--markierung);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rot) 14%, transparent);
}
.feld::placeholder { color: var(--tinte-schwach); }

/* Suchleiste: Felder mit Beschriftung darüber, Knöpfe am Ende der Zeile. */
/* .zufuegen ist dieselbe Zeile, aber zum Anlegen statt zum Suchen –
   eine Zeile am Fuß einer Karte, die die Karte wachsen lässt. */
.suchleiste,
.zufuegen {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.suchleiste label,
.zufuegen label { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.suchleiste label.breit,
.zufuegen label.breit { flex: 1; min-width: 200px; }
.suchleiste .beschriftung,
.zufuegen .beschriftung {
    font-size: 11.5px; font-weight: 600;
    color: var(--tinte-schwach);
    letter-spacing: .01em;
}

/* --------------------------------------------------------------------------
   9b. Formulare
   Beschriftung über dem Feld, Hilfstext darunter, Fehler in Signalfarbe.
   Ein Feld je Zeile, außer wo zwei fachlich zusammengehören (PLZ und Ort).
   -------------------------------------------------------------------------- */

.formular { max-width: 640px; }
.formular.breit { max-width: none; }

.feldgruppe { margin-bottom: 18px; }
.feldgruppe > label,
.feldgruppe > .beschriftung {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--tinte-leise);
    margin-bottom: 6px;
}
.feldgruppe .hilfe {
    display: block;
    margin-top: 5px;
    font-size: 12.5px; color: var(--tinte-schwach);
}
.feldgruppe .fehlertext {
    display: block;
    margin-top: 5px;
    font-size: 12.5px; color: var(--stopp); font-weight: 500;
}
.feldgruppe .feld[aria-invalid="true"] { border-color: var(--stopp); }

/* Mehrere Felder nebeneinander, solange Platz ist. */
.feldreihe {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.feldreihe.eng { grid-template-columns: 110px 1fr; }

textarea.feld { min-height: 110px; resize: vertical; line-height: 1.55; }
select.feld { appearance: none; padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, var(--tinte-schwach) 50%),
                      linear-gradient(135deg, var(--tinte-schwach) 50%, transparent 50%);
    background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* Schalter für Ja-Nein-Angaben. */
.schalterfeld { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.schalterfeld input[type="checkbox"] {
    width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 16px;
    accent-color: var(--gruen); cursor: pointer;
}
.schalterfeld .beschriftung { font-weight: 550; color: var(--tinte); margin: 0; }
.schalterfeld .hilfe { margin-top: 2px; }

/* Abschnitte innerhalb eines längeren Formulars. */
.abschnitt { padding: 20px; border-top: 1px solid var(--haarlinie); }
.abschnitt:first-child { border-top: 0; }
.abschnitt > h3 {
    margin: 0 0 4px;
    font-size: 13px; font-weight: 650;
}
.abschnitt > .abschnitt-hilfe {
    margin: 0 0 16px; font-size: 12.5px; color: var(--tinte-schwach); max-width: 60ch;
}

/* Fußleiste mit den Handlungen, klebt am unteren Rand des Formulars. */
.formularfuss {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--haarlinie);
    background: var(--flaeche-weich);
}
.formularfuss .rechts { margin-left: auto; display: flex; gap: 8px; }

/* Rückmeldung nach dem Speichern. */
.meldung {
    display: flex; gap: 9px; align-items: flex-start;
    border-radius: var(--rundung-klein);
    padding: 11px 13px; margin-bottom: 18px;
    font-size: 13.5px;
}
.meldung svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.meldung.gelungen { background: var(--ok-grund); color: var(--ok); }
.meldung.gescheitert { background: var(--stopp-grund); color: var(--stopp); }

/* --------------------------------------------------------------------------
   9c. Auswahlknöpfe
   Im Altsystem sind Anrede und Familienstand Radiobuttons. Ein Auswahlfeld
   wäre bequemer zu bauen, zeigt die Möglichkeiten aber erst nach einem
   Klick – bei drei Werten ist das ein Rückschritt.
   -------------------------------------------------------------------------- */

.wahlgruppe {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.wahlgruppe label {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 12px 7px 10px;
    border: 1px solid var(--haarlinie-stark);
    border-radius: var(--rundung-klein);
    background: var(--flaeche);
    font-size: 13.5px; font-weight: 500;
    cursor: pointer;
    transition: background var(--schwung), border-color var(--schwung);
    margin: 0;
}
.wahlgruppe label:hover { background: var(--flaeche-weich); }
.wahlgruppe input[type="radio"] {
    width: 15px; height: 15px; margin: 0;
    accent-color: var(--rot);
    cursor: pointer;
}
.wahlgruppe input[type="radio"]:checked + span { font-weight: 600; }
.wahlgruppe label:has(input:checked) {
    border-color: var(--markierung);
    background: var(--flaeche);
    box-shadow: 0 0 0 1px var(--markierung);
}

/* Untereinander, wenn die Beschriftungen lang sind. */
.wahlgruppe.untereinander { flex-direction: column; }
.wahlgruppe.untereinander label { width: 100%; }

/* --------------------------------------------------------------------------
   10. Leerzustände
   Sagen, was fehlt und was zu tun ist — nie nur „keine Daten“.
   -------------------------------------------------------------------------- */

.leer { padding: 52px 20px; text-align: center; color: var(--tinte-leise); }
.leer-zeichen {
    width: 42px; height: 42px; margin: 0 auto 14px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--ruhe-grund);
    color: var(--tinte-schwach);
}
.leer-zeichen svg { width: 20px; height: 20px; }
.leer h3 { margin: 0 0 5px; font-size: 15px; font-weight: 620; color: var(--tinte); }
.leer p { margin: 0 auto; max-width: 44ch; font-size: 13.5px; }

/* --------------------------------------------------------------------------
   11. Blättern
   -------------------------------------------------------------------------- */

.blaettern {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 20px;
    border-top: 1px solid var(--haarlinie);
}
.blaettern .leise { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.blaettern nav { margin-left: auto; display: flex; gap: 3px; }
.blaettern nav a,
.blaettern nav span {
    min-width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 8px;
    border-radius: var(--rundung-klein);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    color: var(--tinte-leise);
    transition: background var(--schwung), color var(--schwung);
}
.blaettern nav a:hover { background: var(--flaeche-weich); color: var(--tinte); }
.blaettern nav span[aria-current] {
    background: var(--aktiv); color: var(--aktiv-text); font-weight: 600;
}
.blaettern nav span[aria-disabled] { color: var(--tinte-schwach); opacity: .5; }

/* --------------------------------------------------------------------------
   12. Kleinteiliges
   -------------------------------------------------------------------------- */

.leise { color: var(--tinte-leise); }
.gesperrt-hinweis { color: var(--stopp); font-weight: 600; }
.zeit { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Long tokens (URLs, keys, browsers) may break anywhere; words only when they must. */
.bruch { overflow-wrap: anywhere; }
.feldname { width: 200px; }
.hinweistext { margin: 0; font-size: 12.5px; color: var(--tinte-schwach); max-width: 70ch; }
.schwach { color: var(--tinte-schwach); }

code, .kennung {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    color: var(--tinte-leise);
    background: var(--ruhe-grund);
    border-radius: 5px;
    padding: 2px 6px;
    white-space: nowrap;
}

hr { border: 0; border-top: 1px solid var(--haarlinie); margin: 22px 0; }

/* --------------------------------------------------------------------------
   13. Übersicht (Dashboard)

   Zwei Spalten: links, was Arbeit ist, rechts, was man wissen sollte. Die
   Gewichtung 1.6 : 1 ist Absicht – die rechte Spalte soll begleiten, nicht
   mitreden. Unter 1100px stapeln sie, und zwar Arbeit zuerst.
   -------------------------------------------------------------------------- */

.uebersicht {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 16px; align-items: start;
}
/* Der Abstand zwischen den Tafeln kommt hier aus dem Raster, nicht aus der
   Tafel selbst – sonst steht unter der letzten jeder Spalte Luft zu viel. */
.uebersicht > div > .karte:last-child { margin-bottom: 0; }

/* Eine Kennzahl, die irgendwohin führt. Sie sieht aus wie die anderen –
   die Hand am Zeiger und die Linie sind der ganze Unterschied. */
a.kennzahl { display: block; color: inherit; }
a.kennzahl:hover {
    border-color: var(--haarlinie-stark);
    box-shadow: var(--tiefe-2);
}
a.kennzahl .kennzahl-titel { transition: color var(--schwung); }
a.kennzahl:hover .kennzahl-titel { color: var(--tinte-leise); }

/* Die Kennzahl, die für offene Arbeit steht, trägt links eine Kante in der
   Markenfarbe. Nur diese eine – zwei Betonungen sind keine Betonung. */
.kennzahl.betont { border-left: 3px solid var(--markierung); }

/* Hervorgehobene Karte, etwa für ein Token, das nur einmal angezeigt wird. */
.karte.betont { border-left: 3px solid var(--markierung); }

/* Knöpfe mit eigenem Formular nebeneinander in einer Tabellenzeile. */
form.inline { display: inline; }

/* Stufenverteilung. Beschriftung, Balken, Zahl – in einer festen Spur,
   damit die Zahlen untereinander stehen und der Blick sie vergleichen kann. */
.stufen { display: flex; flex-direction: column; gap: 9px; }
.stufe {
    display: grid; grid-template-columns: 140px minmax(0, 1fr) 44px;
    gap: 12px; align-items: center;
    color: inherit; font-size: 13px;
}
.stufe:hover .stufe-name { color: var(--tinte); }
.stufe-name {
    color: var(--tinte-leise); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    transition: color var(--schwung);
}
.stufe-spur { height: 7px; border-radius: 20px; background: var(--ruhe-grund); overflow: hidden; }
.stufe-spur > i {
    display: block; height: 100%; border-radius: 20px;
    background: var(--tinte-schwach);
    transition: background var(--schwung);
}
.stufe:hover .stufe-spur > i { background: var(--tinte-leise); }
/* Die beiden Stufen, an denen Arbeit hängt, tragen Farbe. Der Rest bleibt
   grau: Wenn alles bunt ist, sagt die Farbe nichts mehr. */
.stufe-spur > i.wartet { background: var(--markierung); }
.stufe-spur > i.fertig { background: var(--ok); }
.stufe-zahl { text-align: right; font-variant-numeric: tabular-nums; font-weight: 560; }
.stufe-zahl.null { color: var(--tinte-schwach); font-weight: 400; }

/* Zustandsliste der Anlage. Ein Punkt trägt die Ampel, der Text erklärt.
   Bewusst keine Flächenfarbe: Ein Bildschirm voller roter Kästen ist
   Panik, kein Bericht. */
.zustaende { list-style: none; margin: 0; padding: 0; }
.zustand {
    display: grid; grid-template-columns: 8px minmax(0, 1fr);
    gap: 11px; padding: 13px 20px;
    border-top: 1px solid var(--haarlinie);
}
.zustand:first-child { border-top: 0; }
.zustand-punkt {
    width: 8px; height: 8px; border-radius: 50%;
    margin-top: 6px; background: var(--tinte-schwach);
}
.zustand-punkt.gut      { background: var(--ok); }
.zustand-punkt.warnung  { background: var(--warten); }
.zustand-punkt.stoerung { background: var(--stopp); }
.zustand-kopf { display: flex; align-items: baseline; gap: 8px; }
.zustand-titel { font-weight: 560; font-size: 13.5px; }
.zustand-wert {
    margin-left: auto; font-size: 12.5px; color: var(--tinte-leise);
    font-variant-numeric: tabular-nums; text-align: right;
}
.zustand-text { margin: 3px 0 0; font-size: 12.5px; color: var(--tinte-leise); }

/* Tabellen in der schmalen Spalte. Die Mindestbreite aus Abschnitt 7 ist für
   Listenseiten gedacht; hier erzwänge sie einen Rollbalken in einer Tafel,
   die nur drei Spalten hat. */
.karte.schmal:has(table) table { min-width: 0; }
.karte.schmal th, .karte.schmal td { padding-left: 16px; padding-right: 16px; }

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

/* --------------------------------------------------------------------------
   13b. Formularvorschau der App
   Nicht das Tablet nachgebaut, sondern gezeigt, was darauf steht: ein
   Abschnitt ist ein Bildschirm, ein Feld eine Zeile. Alles ist stumm – hier
   wird nichts ausgefüllt, hier wird nachgesehen.
   -------------------------------------------------------------------------- */

/* Werkzeuge am Zeilenende: Pfeile sind schmal und brechen nie um, sonst
   springt die Zeile beim Sortieren in der Höhe. */
.werkzeugspalte { white-space: nowrap; }
.knopf.pfeil { padding: 7px 9px; font-size: 13px; }

.schirm { display: flex; flex-wrap: wrap; gap: 16px 14px; margin-bottom: 18px; }
.schirm:last-child { margin-bottom: 0; }
.schirm-feld { flex: 1 1 100%; display: flex; flex-direction: column; gap: 5px; }
.schirm-feld.drittel { flex: 1 1 calc(33.333% - 10px); min-width: 130px; }
.schirm-feld.halb { flex: 1 1 calc(50% - 7px); min-width: 180px; }
.schirm-feld.zweidrittel { flex: 1 1 calc(66.666% - 5px); min-width: 220px; }

/* Ein Abschnitt, der sich an den Bildschirm darüber hängt, bekommt nur eine
   Zwischenüberschrift – der Schnitt liegt beim Bildschirm, nicht hier. */
.schirm-gruppe {
    margin: 22px 0 10px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    color: var(--tinte-schwach);
}

/* Der Text, der mit unterschrieben wird. Er steht über dem Feld und ist
   keine Fußnote. */
.schirm-erklaerung { margin: 0 0 4px; color: var(--tinte-leise); font-size: 13px; line-height: 1.6; }

.schirm-beschriftung { font-size: 12px; font-weight: 600; color: var(--tinte-leise); }

/* Ein Feld, das nichts annimmt: Rahmen und Platzhalter, sonst nichts. */
.schirm-eingabe {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--haarlinie-stark);
    border-radius: var(--rundung-klein);
    background: var(--flaeche-weich);
    color: var(--tinte-schwach);
    font-size: 13.5px;
}
.schirm-eingabe.hoch { min-height: 66px; align-items: flex-start; }

.schirm-hilfe { font-size: 11.5px; color: var(--tinte-schwach); }
.schirm-hinweis {
    margin: 0;
    padding: 10px 12px;
    border-left: 2px solid var(--haarlinie-stark);
    color: var(--tinte-leise);
    font-size: 13.5px;
}

.schirm-schalter {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 0;
    font-size: 13.5px;
}
.schalterbild {
    flex: none; width: 38px; height: 22px;
    border-radius: 11px;
    background: var(--ruhe-grund);
    border: 1px solid var(--haarlinie-stark);
    position: relative;
}
.schalterbild::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--flaeche); box-shadow: var(--tiefe-1);
}

.schirm-wahl { display: flex; flex-wrap: wrap; gap: 7px; }
.wahl-taste {
    padding: 6px 11px;
    border: 1px solid var(--haarlinie-stark);
    border-radius: var(--rundung-klein);
    background: var(--flaeche);
    font-size: 13px; color: var(--tinte-leise);
}
.wahl-taste.leer-wert { color: var(--tinte-schwach); font-style: italic; }

/* Das Unterschriftenfeld ist auf dem Tablet das größte Element der Seite. */
.schirm-unterschrift {
    display: flex; align-items: flex-end; justify-content: center;
    min-height: 92px;
    padding: 0 0 10px;
    border: 1px dashed var(--haarlinie-stark);
    border-radius: var(--rundung-klein);
    background: var(--flaeche-weich);
    color: var(--tinte-schwach);
    font-size: 12px;
}

/* Woran ein Feld hängt, steht über ihm – nicht versteckt in einem Aufklapper. */
.bedingung { font-size: 11px; color: var(--tinte-schwach); font-style: italic; }

/* --------------------------------------------------------------------------
   14. Schmale Fenster
   Tabellen werden zu beschrifteten Karten, die Leiste fährt aus.
   -------------------------------------------------------------------------- */

.schleier {
    display: none; position: fixed; inset: 0; z-index: 19;
    background: rgba(12, 14, 18, .5);
    backdrop-filter: blur(2px);
}

@media (max-width: 920px) {
    .leiste {
        position: fixed; z-index: 20; left: 0; top: 0;
        transform: translateX(-100%);
        transition: transform 180ms cubic-bezier(.4, 0, .2, 1);
        box-shadow: var(--tiefe-3);
    }
    body.menue-offen .leiste { transform: none; }
    body.menue-offen .schleier { display: block; }

    .schalter { display: grid; place-items: center; }
    .kopfzeile { padding: 0 16px; }
    /* Several page actions do not fit beside the title on narrow screens. The
       sticky bar stays one row high: the title shortens and the actions can be
       swiped sideways, instead of the whole page growing wider. */
    .kopf-titel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .kopf-werkzeuge { overflow-x: auto; scrollbar-width: none; flex-shrink: 1; }
    .kopf-werkzeuge::-webkit-scrollbar { display: none; }
    .kopf-werkzeuge .knopf { white-space: nowrap; }
    main { padding: 22px 16px 64px; }

    .suchleiste label, .suchleiste label.breit,
    .zufuegen label, .zufuegen label.breit { min-width: 100%; }
    .blaettern { flex-wrap: wrap; }
}

/* Auf dem Telefon wird aus jeder Zeile eine beschriftete Karte. */
@media (max-width: 720px) {
    .karte:has(table) { overflow-x: visible; }
    .karte:has(table) table { min-width: 0; }

    thead { display: none; }
    tbody tr {
        display: block;
        padding: 14px 16px;
        border-bottom: 1px solid var(--haarlinie);
    }
    tbody tr:hover { background: transparent; }
    tbody td { display: flex; gap: 10px; border: 0; padding: 3px 0; }
    tbody td::before {
        content: attr(data-spalte);
        flex: 0 0 34%;
        font-size: 11px; font-weight: 600;
        letter-spacing: .05em; text-transform: uppercase;
        color: var(--tinte-schwach);
        padding-top: 2px;
    }
    td.zahl { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* --------------------------------------------------------------------------
   15. Druck

   Das Altsystem hat eigene Druckseiten (intern_phase09_<art>_print.php) und
   einen „Diese Seite ausdrucken“-Verweis. Gedruckt wird der Vorgang zur
   Ablage – dafür muss alles weg, was nur auf dem Bildschirm Sinn ergibt,
   und alles lesbar sein, was auf Papier zählt.
   -------------------------------------------------------------------------- */

@media print {
    :root {
        --grund: #fff;
        --flaeche: #fff;
        --flaeche-weich: #fff;
        --haarlinie: #bbb;
        --haarlinie-stark: #999;
        --tinte: #000;
        --tinte-leise: #333;
        --tinte-schwach: #555;
        --ruhe-grund: #fff;
        --tiefe-1: none;
        --tiefe-2: none;
        --tiefe-3: none;
    }

    @page { margin: 16mm 14mm; }

    body {
        background: #fff;
        color: #000;
        font-size: 10.5pt;
        line-height: 1.4;
    }

    /* Bedienelemente haben auf Papier nichts verloren. */
    .leiste,
    .kopfzeile,
    .schleier,
    .suchleiste,
    .zufuegen,
    .blaettern,
    .formularfuss,
    .knopf,
    .abmelden,
    .darstellung,
    .kopf-werkzeuge,
    .nicht-drucken { display: none !important; }

    .rahmen { display: block; }
    .buehne { display: block; }
    main { padding: 0; max-width: none; }

    .karte {
        border: 1px solid var(--haarlinie);
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 10mm;
        /* Eine Tafel soll nicht mitten im Satz umbrechen. */
        break-inside: avoid;
        overflow: visible;
    }
    .karte:has(table) { overflow: visible; }
    .karte:has(table) table { min-width: 0; }

    .seiten-kopf h1 { font-size: 16pt; }

    thead { display: table-header-group; }
    tbody tr { break-inside: avoid; }
    thead th { background: #fff; border-bottom: 1px solid #000; }
    tbody tr:hover { background: transparent; }

    /* Plaketten ohne Farbfläche, der Zustand steht im Text. */
    .marke-pille {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #999;
    }
    .marke-pille::before { display: none; }

    code, .kennung { background: transparent; border: 0; padding: 0; }

    /* Verweise als Text: Auf Papier ist ein blaues Wort nutzlos. */
    a { color: #000; text-decoration: none; }

    /* Nur auf Papier sichtbar, etwa eine Fußzeile mit Datum. */
    .nur-druck { display: block !important; }
}

/* Auf dem Bildschirm unsichtbar, im Druck sichtbar. */
.nur-druck { display: none; }

/* --------------------------------------------------------------------------
   Anmeldung und Kennwort
   Eine Karte, mittig auf ruhiger Fläche. Kein geteilter Satzspiegel – bei
   breiten Schirmen bliebe eine Hälfte leer.
   -------------------------------------------------------------------------- */

body.gast {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px 20px;
}

.saeule { width: 100%; max-width: 396px; }
.saeule .marke { padding: 0 0 26px; display: flex; justify-content: center; }
.saeule .sperrmarke { max-width: 218px; }

.maske {
    background: var(--flaeche);
    border: 1px solid var(--haarlinie);
    border-radius: var(--rundung);
    box-shadow: var(--tiefe-2);
    padding: 32px;
}
.maske h1 { margin: 0 0 5px; font-size: 20px; font-weight: 660; letter-spacing: -.02em; }
.maske .unterzeile { margin: 0 0 26px; color: var(--tinte-leise); font-size: 13.5px; }
.maske label { display: block; font-size: 12px; font-weight: 600; color: var(--tinte-leise); margin-bottom: 6px; }
.maske .feld { margin-bottom: 18px; padding: 9px 12px; width: 100%; }
.maske .knopf { width: 100%; padding: 10px; margin-top: 4px; justify-content: center; }
.maske .meldung { margin-bottom: 20px; }

.fehler {
    display: flex; gap: 9px; align-items: flex-start;
    background: var(--stopp-grund); color: var(--stopp);
    border-radius: var(--rundung-klein);
    padding: 10px 12px; margin-bottom: 20px;
    font-size: 13.5px;
}
.fehler svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }

.saeule .fuss { margin: 20px 0 0; text-align: center; font-size: 12.5px; color: var(--tinte-schwach); }
.saeule .fuss a { color: var(--tinte-leise); }
.saeule .fuss a:hover { color: var(--tinte); text-decoration: underline; }

.ohne-rand-oben { margin-top: 0; }
.ohne-rahmen { border: 0; margin: 0; padding: 0; min-width: 0; }
.schalterfeld.eingerueckt { margin-left: 28px; margin-bottom: 8px; }

/* Einstellungen: Felder nebeneinander, lange Listen über die ganze Breite. */
.einstellungen-raster {
    display: grid; gap: 0 18px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.einstellungen-raster .ganz { grid-column: 1 / -1; }
.einstellungen-hinweis { margin-bottom: 16px; }
.sprungmarken { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -6px 0 18px; font-size: 13px; }
.testversand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; border-top: 1px solid var(--haarlinie); }
.testversand .hinweistext { flex: 1 1 280px; }
.testversand .fehlertext { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--stopp); font-weight: 500; }

/* Projektlogos: Logos sind für hellen Grund gestaltet, die Kachel bleibt deshalb
   auch im dunklen Modus weiß. Ohne Logo stehen die Anfangsbuchstaben darin. */
.projekt-zelle { display: flex; align-items: center; gap: 12px; }
.projekt-zelle .leise { display: block; }
.projekt-logo {
    flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden;
    width: 44px; height: 44px; padding: 4px;
    border: 1px solid var(--haarlinie); border-radius: var(--rundung-klein);
    background: #ffffff;
}
.projekt-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.projekt-logo.gross { width: 72px; height: 72px; padding: 6px; border-radius: var(--rundung); }
.projekt-logo.ohne {
    background: var(--flaeche-weich); color: var(--tinte-leise);
    font-size: 14px; font-weight: 650; letter-spacing: .04em;
}
.projekt-logo.gross.ohne { font-size: 22px; }
.seiten-kopf.mit-logo { display: flex; align-items: center; gap: 16px; }
@media (max-width: 480px) {
    .projekt-logo.gross { width: 56px; height: 56px; }
}

/* Symbole an Informationen (gleiche Nummern wie im Altsystem). */
.info-symbol { flex: none; color: var(--tinte-leise); }
.info-symbol.warnt { color: var(--stopp); }
.mit-symbol { display: inline-flex; align-items: center; gap: 8px; }
.symbolwahl { border: 0; padding: 0; margin: 4px 0 18px; }
.symbolwahl legend { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.symbolwahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.symbolwahl legend { grid-column: 1 / -1; }
.symbolwahl .fehlertext { grid-column: 1 / -1; }
.symbol-option {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 7px 10px; border: 1px solid var(--haarlinie); border-radius: var(--rundung-klein);
    font-size: 13px;
}
.symbol-option input { margin: 0; }
.symbol-option:has(input:checked) { border-color: var(--tinte); background: var(--flaeche-weich); }
.symbol-option:has(input:focus-visible) { outline: 2px solid var(--tinte); outline-offset: 2px; }
.symbol-ohne { width: 22px; text-align: center; color: var(--tinte-schwach); }

/* Projektliste wie im Altsystem: je Projekt ein breites Logo-Banner, rechts
   daneben das Wichtigste in drei ruhigen Zeilen. Die ganze Zeile öffnet das
   Projekt; nur Bearbeiten und Löschen sind eigene Knöpfe. */
.projektliste { list-style: none; margin: 0; padding: 0; }
.projekt {
    position: relative;
    display: grid; grid-template-columns: 208px minmax(0, 1fr) auto;
    align-items: center; gap: 22px;
    padding: 14px 20px 14px 14px;
    border-top: 1px solid var(--haarlinie);
    transition: background-color var(--schwung);
}
.projekt:first-child { border-top: 0; }
.projekt:hover { background: var(--flaeche-weich); }

/* Logos sind für hellen Grund gestaltet: mit Logo bleibt das Banner weiß. */
.projekt-bild {
    display: flex; align-items: center; justify-content: center; min-width: 0;
    height: 84px; padding: 10px 18px; overflow: hidden;
    background: #fdfdfc; border-radius: var(--rundung-klein);
    box-shadow: inset 0 0 0 1px rgba(20, 22, 26, .08);
}
/* Im Flex-Layout richtet sich das Bild sicher nach der festen Höhe des Banners. */
.projekt-bild img { display: block; width: 100%; height: 100%; object-fit: contain; }
.projekt-bild.ohne { background: var(--flaeche-weich); box-shadow: inset 0 0 0 1px var(--haarlinie); }
.projekt:hover .projekt-bild.ohne { background: var(--flaeche); }
.projekt-initialen { font-size: 26px; font-weight: 700; letter-spacing: .06em; color: var(--tinte-schwach); }
.projekt.aus .projekt-bild { opacity: .5; filter: grayscale(1); }

.projekt-text { display: grid; gap: 5px; min-width: 0; }
.projekt-kopf { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.projekt-kopf h2 {
    margin: 0; min-width: 0;
    font-size: 16px; font-weight: 650; letter-spacing: -.01em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.projekt-link { color: var(--tinte); text-decoration: none; }
/* Der Name ist der Link, seine Fläche deckt die ganze Zeile ab. */
.projekt-link::after { content: ''; position: absolute; inset: 0; }
.projekt-link:focus-visible { outline: none; }
.projekt-link:focus-visible::after { outline: 2px solid var(--tinte); outline-offset: -2px; border-radius: var(--rundung-klein); }

.projekt-status { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tinte-schwach); }
.projekt-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tinte-schwach); }
.projekt-status.an { color: var(--ok); }
.projekt-status.an::before { background: var(--gruen); }

.projekt-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0; font-size: 13px; color: var(--tinte-leise); }
.projekt-nr { margin: -3px 0 0; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; color: var(--tinte-schwach); overflow-wrap: anywhere; }

.projekt-zahlen { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.projekt-zahlen a { position: relative; z-index: 1; color: var(--tinte-leise); text-decoration: none; }
.projekt-zahlen a:hover { color: var(--tinte); text-decoration: underline; }
.projekt-zahlen strong { color: var(--tinte); font-weight: 650; font-variant-numeric: tabular-nums; }
.projekt-zahlen .null a, .projekt-zahlen .null strong { color: var(--tinte-schwach); font-weight: 500; }

.projekt-rand { display: grid; justify-items: end; gap: 10px; }
.projekt-kdnr { display: grid; justify-items: end; line-height: 1.2; }
.projekt-kdnr span { font-size: 11px; color: var(--tinte-schwach); }
.projekt-kdnr strong { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.projekt-knoepfe { display: flex; gap: 6px; }
.symbol-knopf {
    position: relative; z-index: 1;
    display: grid; place-items: center; width: 32px; height: 32px;
    border: 1px solid var(--haarlinie-stark); border-radius: var(--rundung-klein);
    background: var(--flaeche); color: var(--tinte-leise);
    transition: color var(--schwung), border-color var(--schwung);
}
.symbol-knopf svg { width: 16px; height: 16px; }
.symbol-knopf:hover { color: var(--tinte); border-color: var(--tinte-schwach); }
.symbol-knopf.gefahr:hover { color: var(--stopp); border-color: var(--stopp); }
.symbol-knopf:focus-visible { outline: 2px solid var(--tinte); outline-offset: 2px; }

@media (max-width: 760px) {
    .projekt { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
    .projekt-bild { height: 96px; }
    .projekt-kopf h2 { white-space: normal; }
    .projekt-rand { grid-auto-flow: column; justify-content: space-between; align-items: center; }
    .projekt-kdnr { justify-items: start; }
}

/* --------------------------------------------------------------------------
   Release Notes: je Version eine Karte, darin die Änderungen nach Art.
   -------------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.menue-punkt { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--markierung); flex: none; }
.knopf.leise-knopf { background: transparent; border-color: transparent; color: var(--tinte-leise); }
.rn-aktuell { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 600; color: var(--tinte); }

.rn-leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.rn-arten { display: flex; flex-wrap: wrap; gap: 6px; }
.rn-art {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 11px; border: 1px solid var(--haarlinie-stark); border-radius: 999px;
    background: var(--flaeche); color: var(--tinte-leise); font-size: 13px; text-decoration: none;
    transition: border-color var(--schwung), color var(--schwung);
}
.rn-art:hover { color: var(--tinte); border-color: var(--tinte-schwach); }
.rn-art.aktiv { background: var(--aktiv); border-color: var(--aktiv); color: var(--aktiv-text); }
.rn-anzahl { font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: .7; }
.rn-suche { flex: 0 1 280px; min-width: 200px; }
.rn-suche .feld { width: 100%; }

.rn-farbe { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.rn-farbe.feature, .rn-marke.feature { --rn: var(--ok); --rn-grund: var(--ok-grund); }
.rn-farbe.improvement, .rn-marke.improvement { --rn: var(--info); --rn-grund: var(--info-grund); }
.rn-farbe.fix, .rn-marke.fix { --rn: var(--warten); --rn-grund: var(--warten-grund); }
.rn-farbe.security, .rn-marke.security { --rn: var(--stopp); --rn-grund: var(--stopp-grund); }
.rn-farbe.removed, .rn-marke.removed { --rn: var(--tinte-schwach); --rn-grund: var(--ruhe-grund); }
.rn-farbe { background: var(--rn); }
.rn-art.aktiv .rn-farbe { box-shadow: 0 0 0 2px var(--aktiv-text); }

.rn-release { padding: 22px 24px 20px; }
.rn-release.entwurf { border-style: dashed; }
.rn-kopf { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; }
.rn-version {
    margin-top: 1px; padding: 4px 10px;
    border: 1px solid var(--haarlinie-stark); border-radius: 999px;
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; font-weight: 600;
    color: var(--tinte); white-space: nowrap;
}
.rn-version.alt { color: var(--tinte-leise); font-weight: 500; }
.rn-titel h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; text-wrap: balance; }
.rn-titel p { margin: 3px 0 0; font-size: 12.5px; color: var(--tinte-schwach); }
.rn-rechts { display: flex; align-items: center; gap: 6px; }
.rn-zusammenfassung { margin: 14px 0 0; max-width: 72ch; color: var(--tinte-leise); font-size: 14px; line-height: 1.55; }

.rn-gruppen { display: grid; gap: 16px; margin-top: 18px; }
.rn-gruppe h3 { margin: 0 0 8px; }
.rn-marke {
    display: inline-block; padding: 2px 9px; border-radius: 5px;
    background: var(--rn-grund); color: var(--rn);
    font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
}
.rn-gruppe ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 1px; }
.rn-gruppe li {
    display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
    padding: 7px 0 7px 14px; border-left: 2px solid var(--haarlinie);
    font-size: 14px; line-height: 1.5;
}
.rn-text { flex: 1 1 420px; min-width: 0; }
.rn-zusatz { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.rn-bereich { padding: 1px 7px; border: 1px solid var(--haarlinie-stark); border-radius: 4px; font-size: 11.5px; color: var(--tinte-leise); white-space: nowrap; }
.rn-ref { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--tinte-schwach); }

/* Formular: Art, Bereich, Text und Entfernen je Zeile. */
.rn-feldreihe { grid-template-columns: 200px 200px; }
.rn-zeilen { display: grid; gap: 10px; margin: 10px 0 14px; }
.rn-zeile { display: grid; grid-template-columns: 150px 170px minmax(0, 1fr) 32px; gap: 8px; align-items: start; }
.rn-zeile .feld { width: 100%; }
.rn-zeile-text { min-height: 38px !important; }
.rn-zeile .symbol-knopf { margin-top: 3px; }
.rn-zeile-fehler { grid-column: 1 / -1; margin: 0; }

@media (max-width: 760px) {
    .rn-release { padding: 18px 16px; }
    .rn-kopf { grid-template-columns: auto minmax(0, 1fr); }
    .rn-rechts { grid-column: 1 / -1; }
    .rn-suche { flex-basis: 100%; }
    .rn-feldreihe { grid-template-columns: 1fr 1fr; }
    .rn-zeile { grid-template-columns: 1fr 1fr 32px; }
    .rn-zeile-text { grid-column: 1 / 3; grid-row: 2; }
}

/* Rahmen der Mail-Vorschau; früher ein Inline-Stil, der die CSP aufgeweicht hätte. */
.mailvorschau {
    width: 100%;
    height: 1100px;
    border: 0;
    display: block;
    background: #fff;
}
