/* Cockpit – Grundgestaltung (Schritt 0.5a). Farben nur ueber Variablen; Dunkelmodus folgt der Systemeinstellung. */
:root {
    --bg: #f4f6fa;
    --flaeche: #ffffff;
    --rand: #dde3ec;
    --text: #1d2b44;
    --leise: #5b6b85;
    --akzent: #2457a6;
    --akzent-text: #ffffff;
    --ok: #1f7a4d;
    --ok-flaeche: #e3f4ea;
    --warn: #8a5a00;
    --warn-flaeche: #fff4d6;
    --fehler: #b42318;
    --fehler-flaeche: #fde8e6;
    --radius: 10px;
    --schatten: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f141c;
        --flaeche: #172030;
        --rand: #2a3549;
        --text: #e6ebf3;
        --leise: #9aa7bd;
        --akzent: #7aa7ec;
        --akzent-text: #0f141c;
        --ok: #4cc38a;
        --ok-flaeche: #15301f;
        --warn: #f0c060;
        --warn-flaeche: #33280f;
        --fehler: #ff8a80;
        --fehler-flaeche: #3a1916;
        --schatten: none;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--akzent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Kopfzeile */
.kopf { background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.kopf-innen {
    max-width: 1100px; margin: 0 auto; padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.marke { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.marke-zeichen {
    width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
    background: var(--akzent); color: var(--akzent-text); font-size: .95rem;
}
.umgebung {
    font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
    background: var(--warn-flaeche); color: var(--warn); border: 1px solid currentColor;
}

/* Inhalt */
.inhalt { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; }
.inhalt h1 { font-size: 1.8rem; line-height: 1.2; margin: 0 0 .4rem; }
.unter { color: var(--leise); margin: 0 0 1.5rem; }
.karte {
    background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
    box-shadow: var(--schatten); padding: 20px; margin-bottom: 16px;
}
.karte h2 { font-size: 1.1rem; margin: 0 0 .75rem; }

/* Hinweismeldungen */
.meldungen { display: grid; gap: 8px; margin-bottom: 16px; }
.meldung { border-radius: var(--radius); padding: 10px 14px; border: 1px solid currentColor; }
.meldung-ok { background: var(--ok-flaeche); color: var(--ok); }
.meldung-hinweis { background: var(--warn-flaeche); color: var(--warn); }
.meldung-fehler { background: var(--fehler-flaeche); color: var(--fehler); }

/* Systemstatus */
.status { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.status .ok span { color: var(--ok); }
.status .fehler { color: var(--fehler); }

/* Schaltflaechen */
.knopf {
    display: inline-block; padding: 10px 18px; border-radius: 8px; border: 0;
    background: var(--akzent); color: var(--akzent-text); font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer;
}

/* Fehlerseiten */
.fehlerseite { text-align: center; padding-top: 6vh; }
.fehlerseite .code { font-size: 4rem; font-weight: 800; color: var(--leise); line-height: 1; margin: 0 0 .5rem; }
.fehlerseite p { max-width: 520px; margin: 0 auto 1.5rem; color: var(--leise); }

/* Fusszeile */
.fuss { border-top: 1px solid var(--rand); color: var(--leise); font-size: .875rem; }
.fuss-innen { max-width: 1100px; margin: 0 auto; padding: 14px 16px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* Formulare (Schritt 1.1) */
.schmal { max-width: 480px; margin: 0 auto; }
.formular { display: grid; gap: 6px; }
.formular label { font-weight: 600; margin-top: 10px; }
.formular input[type="email"], .formular input[type="text"], .formular input[type="password"] {
    font: inherit; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 8px;
    background: var(--bg); color: var(--text); width: 100%;
}
.formular input[aria-invalid="true"] { border-color: var(--fehler); }
.formular .knopf { margin-top: 16px; justify-self: start; }
.feld-hinweis { margin: 0; font-size: .875rem; color: var(--leise); }
.feld-fehler { margin: 0; font-size: .875rem; color: var(--fehler); }
.haken { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.haken input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.leise { color: var(--leise); }
/* Anmeldung und Kopfzeile (Schritt 1.2) */
.kopf-rechts { display: flex; align-items: center; gap: 12px; }
.kopf-name { color: var(--text); text-decoration: none; font-weight: 600; }
.kopf-form { margin: 0; }
.knopf-leise {
    font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 8px; cursor: pointer;
    background: transparent; color: var(--akzent); border: 1px solid var(--rand);
}
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; }
.knopf-zweit { background: transparent; color: var(--akzent); border: 1px solid var(--akzent); }
.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.angaben dt { color: var(--leise); }
.angaben dd { margin: 0; overflow-wrap: anywhere; }

/* Passwort anzeigen/verbergen */
.passwort-huelle { position: relative; }
.passwort-huelle input { padding-right: 96px !important; }
.passwort-anzeigen {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font: inherit; font-size: .85rem; padding: 4px 10px; border-radius: 6px; cursor: pointer;
    background: var(--flaeche); color: var(--akzent); border: 1px solid var(--rand);
}

/* Lockfeld gegen Programme: fuer Menschen unsichtbar */
.lockfeld { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 600px) {
    .inhalt h1 { font-size: 1.5rem; }
    .fehlerseite .code { font-size: 3rem; }
}

.verweise { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.knopf-gefahr { background: var(--fehler); color: #fff; }
a.gefahr { color: var(--fehler); }

/* Hintergrundaufgaben (Schritt 0.4) */
.mittel { max-width: 760px; margin: 0 auto; }
.aufgaben { list-style: none; padding: 0; margin: 0; }
.aufgabe-kopf { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.status { font-size: .85rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; }
.status-laeuft, .status-wartend { color: var(--akzent); }
.status-fertig { color: var(--ok); }
.status-abgebrochen { color: var(--leise); }
.status-fehler { color: var(--fehler); }
.balken { height: 8px; background: var(--bg); border: 1px solid var(--rand); border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.balken span { display: block; height: 100%; background: var(--akzent); transition: width .4s ease; }
.aufgabe-knoepfe { display: flex; gap: 8px; }
.aufgabe-knoepfe form { margin: 0; }
.probe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.probe input[type="number"] { width: 90px; font: inherit; padding: 6px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--bg); color: var(--text); }

/* Assistent (Schritt 2.1) */
.schritte { list-style: none; padding: 0; margin: 0; }
.schritt h2 { font-size: 1.05rem; margin: 0; }
.schritt.naechster { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent); }
.schritt.zustand-gesperrt { opacity: .7; }
.status-offen { color: var(--akzent); }
.status-erledigt { color: var(--ok); }
.status-uebersprungen, .status-gesperrt { color: var(--leise); }
.knopf-leise { text-decoration: none; display: inline-block; }

/* Quellen (Schritt 2.2) */
.quellen { list-style: none; padding: 0; margin: 0 0 1rem; }
details.einstellungen { margin: 1rem 0; }
details.einstellungen summary { cursor: pointer; color: var(--leise); }
details.einstellungen[open] summary { margin-bottom: .5rem; }

/* Umfang waehlen (Schritt 2.3) */
.ordner-tabelle { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.ordner-tabelle th, .ordner-tabelle td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--rand, #dde3ec); vertical-align: middle; }
.ordner-tabelle .zahl { text-align: right; white-space: nowrap; }
.ordner-tabelle tr.aus td { color: var(--leise); }
.ordner-tabelle tfoot th, .ordner-tabelle tfoot td { font-weight: 600; border-bottom: 0; }
.marke { display: inline-block; font-size: .75rem; padding: 0 .4rem; margin-left: .4rem; border-radius: .6rem; border: 1px solid var(--leise); color: var(--leise); }

/* Meine Mails (Schritt 2.4) */
.breit { max-width: 72rem; margin: 0 auto; }
.tabelle-huelle { overflow-x: auto; }
.mail-tabelle { width: 100%; border-collapse: collapse; background: var(--flaeche, #fff); }
.mail-tabelle th, .mail-tabelle td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
.mail-tabelle .datum { white-space: nowrap; }
.mail-tabelle .wer { min-width: 12rem; }
.blaettern { display: flex; gap: 1.5rem; align-items: center; justify-content: center; margin: 1rem 0; }

/* Suche und Mail (Schritt 2.5) */
.suche { display: flex; gap: .5rem; margin: .5rem 0; }
.suche input[type=search] { flex: 1; min-width: 0; }
.ausschnitt { font-size: .875rem; margin-top: .25rem; color: var(--text, inherit); }
mark { background: #fde68a; color: #1a1a1a; padding: 0 .1em; border-radius: 2px; }
.mailtext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.5; max-height: 40rem; overflow-y: auto; }
.mail-titel { overflow-wrap: anywhere; }
details.anhang { border-top: 1px solid var(--rand); padding: .5rem 0; }
details.anhang summary { cursor: pointer; overflow-wrap: anywhere; }

/* Stand nach dem Einlesen */
.stand { list-style: none; padding: 0; margin: 0; }
.stand li { padding: .3rem 0 .3rem 1.6rem; position: relative; }
.stand li::before { position: absolute; left: 0; font-weight: 700; }
.stand li.ok::before { content: "✓"; color: #1e7f4f; }
.stand li.offen::before { content: "…"; color: var(--leise); }
.stand li.aus::before { content: "–"; color: var(--leise); }
.stand li.aus { color: var(--leise); }
.erfolg strong { font-size: 1.05rem; }
.naechster-schritt { border-left: 4px solid var(--akzent, #2456a6); }
.knopf-reihe { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.knopf-form { margin: 0; }

/* Ausblick */
.ausblick-liste { padding-left: 1.25rem; margin: .5rem 0 0; }
.ausblick-liste li { margin-bottom: .6rem; }

/* Assistent: Uebersichtstabelle und Zuruecksetzen */
.schritt-tabelle { width: 100%; border-collapse: collapse; }
.schritt-tabelle th, .schritt-tabelle td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
.schritt-tabelle .haken { width: 1.5rem; text-align: center; font-weight: 700; }
.schritt-tabelle tr.zustand-erledigt .haken { color: #1e7f4f; }
.schritt-tabelle tr.naechster { background: color-mix(in srgb, var(--akzent) 8%, transparent); }
.schritt-tabelle tr.geplant td { color: var(--leise); }
form.zuruecksetzen { margin-top: .75rem; border-top: 1px dashed var(--rand); padding-top: .5rem; }

/* Kontakte (Schritt B) */
.reiter { display: flex; gap: .25rem; border-bottom: 1px solid var(--rand); margin: 1rem 0 .5rem; }
.reiter a { padding: .4rem .9rem; border-radius: .4rem .4rem 0 0; text-decoration: none; }
.reiter a[aria-current="page"] { background: var(--flaeche); border: 1px solid var(--rand); border-bottom-color: var(--flaeche); margin-bottom: -1px; font-weight: 600; }
.haken-label { display: flex; align-items: center; gap: .35rem; white-space: nowrap; font-size: .9rem; }
.mail-tabelle .zahl { text-align: right; }
.filter-zeile { margin: .5rem 0; }

/* Vorgaenge (Schritt C) */
.verlauf { padding-left: 1.25rem; margin: 0; }
.verlauf li { padding: .4rem 0; border-bottom: 1px solid var(--rand); overflow-wrap: anywhere; }
.verlauf .datum { font-variant-numeric: tabular-nums; margin-right: .5rem; }
a.marke { text-decoration: none; }

/* Suchfenster (Cockpit) */
.kriterien { margin: .75rem 0; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); padding: .5rem 1rem; }
.kriterien summary { cursor: pointer; font-weight: 600; padding: .25rem 0; }
.such-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem 1.25rem; margin-top: .75rem; }
.such-raster fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: .3rem; align-content: start; }
.such-raster legend { font-weight: 600; margin-bottom: .2rem; padding: 0; }
.such-raster select, .such-raster input[type=text], .such-raster input[type=date] { font: inherit; padding: 6px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; }
.such-raster label { display: block; }
.von-bis { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.von-bis label { font-size: .875rem; color: var(--leise); }
.ordner-wahl { grid-column: 1 / -1; }
.ordner-liste { max-height: 14rem; overflow-y: auto; columns: 3 220px; column-gap: 1.25rem; }
.ordner-liste label, .ordner-liste p { break-inside: avoid; }
.klein { font-size: .8rem; margin: .4rem 0 .1rem; }
.such-knoepfe { display: flex; gap: 1rem; align-items: center; margin: .75rem 0 .25rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .5rem 0; }
.chips li { border: 1px solid var(--akzent); color: var(--akzent); border-radius: 1rem; padding: .1rem .3rem .1rem .7rem; font-size: .875rem; }
.chips li a { text-decoration: none; font-weight: 700; padding: 0 .35rem; }
.chips .chips-alle { border-color: transparent; }
.ergebnis-zeile { margin: .5rem 0; }

/* Netzgrafik "Erscheint häufig mit" */
.netz { margin: .5rem 0; }
.netz svg { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }
.netz-linie { stroke: var(--rand); }
.netz-linie.zum-zentrum { stroke: var(--leise); opacity: .55; }
.netz-knoten circle { fill: var(--flaeche); stroke: var(--akzent); stroke-width: 2; }
.netz-knoten.zentrum circle { fill: var(--akzent); }
.netz-knoten text { fill: var(--text); font-size: 13px; }
.netz-knoten.zentrum text { font-weight: 700; }
.netz-knoten:hover circle, .netz-knoten:focus circle { fill: var(--akzent); }
.netz-knoten:hover text, .netz-knoten:focus text { text-decoration: underline; }
.gruppe-namen { font-size: .9rem; }

/* Relevanz */
.rel-form { display: inline-flex; gap: .25rem; flex-wrap: wrap; margin: 0; }
.rel-knopf { font: inherit; font-size: .85rem; padding: 3px 9px; border-radius: 1rem; border: 1px solid var(--rand); background: var(--flaeche); color: var(--leise); cursor: pointer; }
.rel-mail.klein .rel-knopf { padding: 1px 6px; font-size: .8rem; }
.rel-knopf:hover { border-color: var(--akzent); color: var(--akzent); }
.rel-knopf.aktiv.rel-wichtig { background: #b7791f; border-color: #b7791f; color: #fff; }
.rel-knopf.aktiv.rel-behalten { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.rel-knopf.aktiv.rel-ignoriert { background: var(--leise); border-color: var(--leise); color: var(--flaeche); }
.rel-zahl { display: inline-block; margin-right: 1rem; }
.rel-zahl.rel-wichtig { color: #b7791f; }
.rel-gruppen { list-style: none; padding: 0; margin: 0; }
.rel-gruppe { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--rand); flex-wrap: wrap; }
.rel-gruppe-text { flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.knopf-reihe { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0; }
.rel-quelle { font-size: .8rem; }

/* nur fuer Bildschirmleser sichtbar (Beschriftungen von Feldern, deren Zweck optisch klar ist) */
.unsichtbar { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Relevanz: Ausnahmen mit Betreff-Stichwort */
.ausnahme { border-left: 3px solid #b7791f; padding: .4rem .8rem; background: var(--bg); border-radius: 0 8px 8px 0; flex: 1 1 100%; }
.ausnahme p { margin: .2rem 0 .5rem; }
.ausnahme-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 0; }
.ausnahme-form input[type=text], .ausnahme-neu input[type=text] { font: inherit; padding: 4px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--flaeche); color: var(--text); }
.ausnahme-regel td { background: var(--bg); }
.ausnahme-neu { margin-top: .3rem; }
.ausnahme-neu summary { cursor: pointer; color: var(--akzent); font-size: .85rem; }
.ausnahme-neu form { margin-top: .3rem; align-items: center; }

/* Gruppen nach Organisation */
.abschnitt { margin-top: 2rem; }
.org-gruppen { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.org-gruppe h3 { margin: 0 0 .5rem; font-size: 1.05rem; }

/* Sortierbare Spaltenkoepfe */
.spalten-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.spalten-sort:hover { text-decoration: underline; }
.spalten-sort.aktiv { color: var(--akzent); }
.sort-pfeil { font-size: .8em; color: var(--leise); opacity: .55; }
.spalten-sort:hover .sort-pfeil { opacity: 1; }
.spalten-sort.aktiv .sort-pfeil { color: var(--akzent); opacity: 1; }
th[aria-sort] { background: color-mix(in srgb, var(--akzent) 10%, transparent); }
.meine-gespeicherten { position: relative; }
.meine-gespeicherten > summary { list-style: none; cursor: pointer; }
.meine-gespeicherten > summary::-webkit-details-marker { display: none; }
.gespeichert-liste { position: absolute; z-index: 20; top: calc(100% + .3rem); left: 0; min-width: 16rem; max-width: 90vw; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: .6rem; background: var(--flaeche, var(--bg)); border: 1px solid var(--rand); border-radius: .5rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); }

/* Themen */
.themen-liste { list-style: none; padding: 0; margin: .5rem 0 0; }
.themen-liste > li { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding: .45rem 0; border-top: 1px solid var(--rand); }
.thema-bearbeiten summary { cursor: pointer; color: var(--akzent); font-size: .85rem; }
.thema-bearbeiten form { margin-top: .4rem; }
.thema-bearbeiten input[type=text], .thema-bearbeiten select { font: inherit; padding: 4px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--flaeche); color: var(--text); max-width: 100%; }

/* Themen an einer Mail */
.themen-an-mail { list-style: none; padding: 0; margin: 0 0 .3rem; display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.inline-form { display: inline; margin: 0; }
.knopf-mini { font: inherit; line-height: 1; padding: 0 .35rem; border: 1px solid var(--rand); border-radius: 1rem; background: var(--flaeche); color: var(--leise); cursor: pointer; }
.knopf-mini:hover { color: var(--fehler, #b42318); border-color: currentColor; }

/* Themen in der Mailliste */
.mail-themen { min-width: 8rem; }
.thema-chip { display: inline-block; margin: 0 .25rem .2rem 0; padding: 0 .45rem; border: 1px solid var(--rand); border-radius: .8rem; font-size: .82rem; text-decoration: none; color: var(--text); white-space: nowrap; }
.thema-chip:hover { border-color: var(--akzent); color: var(--akzent); }
.thema-chip.ki { border-style: dashed; }
.ki-marke { font-size: .68rem; font-weight: 700; color: var(--akzent); }

/* Themen in der Mailliste bearbeiten */
.thema-chip a { color: inherit; text-decoration: none; }
.thema-chip .chip-x { font: inherit; line-height: 1; border: 0; background: none; color: var(--leise); cursor: pointer; padding: 0 0 0 .15rem; }
.thema-chip .chip-x:hover, .thema-chip .chip-x:focus { color: var(--fehler, #b42318); }
.thema-plus { display: inline-block; padding: 0 .4rem; border: 1px dashed var(--rand); border-radius: .8rem; text-decoration: none; color: var(--leise); font-size: .82rem; }
.thema-plus:hover, .thema-plus:focus { color: var(--akzent); border-color: var(--akzent); }
.mail-themen select.thema-wahl { display: block; margin-top: .3rem; max-width: 14rem; font: inherit; font-size: .85rem; }

/* Hilfe */
.kopf-hilfe { color: var(--leise); text-decoration: none; margin-right: .5rem; }
.kopf-hilfe:hover { color: var(--akzent); text-decoration: underline; }
.hilfe h3 { margin: 1rem 0 .3rem; font-size: 1.02rem; }
.hilfe li { margin: .25rem 0; }
.hilfe-inhalt ol { columns: 2 260px; margin: .3rem 0 0; }
.hilfe-tabelle { border-collapse: collapse; width: 100%; margin: .5rem 0; }
.hilfe-tabelle th, .hilfe-tabelle td { text-align: left; padding: .35rem .6rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
.hilfe section { scroll-margin-top: 1rem; }

/* Wartet auf Antwort */
.offen-einstieg strong { font-weight: 700; }
.wartet { font-size: .8rem; color: var(--leise); }
.wartet.lange { color: #b7791f; font-weight: 600; }
.erledigt-form { margin: .3rem 0 0; }
.erledigt-knopf { font-size: .8rem; padding: 2px 8px; }

/* Meine Mails: Schnellzugriff (wartet + gespeicherte Suchen), Status-Spalte, Mailsystem */
.meine-suchen { margin: .2rem 0 .8rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.gesucht { display: inline-flex; align-items: center; border: 1px solid var(--rand); border-radius: 1rem; padding: .15rem .3rem .15rem .75rem; font-size: .9rem; }
.gesucht a { text-decoration: none; }
.gesucht.aktiv { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent) 12%, transparent); font-weight: 600; }
.suche-speichern { margin: .2rem 0 .8rem; }
.suche-speichern summary { cursor: pointer; color: var(--akzent); }
.status-zelle { white-space: nowrap; }
.status-zelle .antwort { margin-top: .25rem; white-space: normal; min-width: 7rem; }
.im-mailsystem { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.im-mailsystem .leise { flex-basis: 100%; }
.mails-seite { max-width: 110rem; }
.mail-tabelle .betreff { min-width: 20rem; }
.mail-tabelle .wer { min-width: 11rem; max-width: 18rem; overflow-wrap: anywhere; }
.mail-tabelle .ordner-zelle { min-width: 6rem; }
.betreff-link { font-weight: 600; }
.vorschau { font-size: .85rem; color: var(--leise); margin-top: .2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-merkmale { display: flex; flex-wrap: wrap; gap: .3rem .5rem; margin-top: .3rem; align-items: center; }
.mail-merkmale:empty { display: none; }
.anhang-chip { font-size: .78rem; border: 1px solid var(--rand); border-radius: .3rem; padding: 0 .35rem; white-space: nowrap; }
.anhang-chip.unlesbar { color: var(--leise); border-style: dashed; }
a.still { color: inherit; text-decoration: none; }
a.still:hover { text-decoration: underline; }
.rel-quelle { margin-top: .15rem; }
.suchorte { border: 0; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.suchorte legend { float: left; padding: 0; margin-right: .3rem; font-weight: 600; }
/* Mailliste: möglichst ohne seitliches Scrollen; wenn doch nötig, eigene Höhe = Fenster, damit die Scrollbar sichtbar bleibt */
.mails-seite .tabelle-huelle { max-height: calc(100vh - 2rem); overflow: auto; border: 1px solid var(--rand); border-radius: .4rem; }
.mails-seite .mail-tabelle thead th { position: sticky; top: 0; z-index: 1; background: var(--flaeche, #fff); box-shadow: 0 1px 0 var(--rand); }
.mails-seite .mail-tabelle .datum { white-space: normal; min-width: 5.5rem; }
.mails-seite .mail-tabelle .datum .zeit { display: block; color: var(--leise); font-size: .85rem; }
.mails-seite .mail-tabelle .wer { min-width: 10rem; max-width: 15rem; }
.mails-seite .mail-tabelle .betreff { min-width: 16rem; }
.mails-seite .mail-tabelle .ordner-zelle { min-width: 6rem; max-width: 10rem; overflow-wrap: anywhere; }
.mails-seite .mail-tabelle .status-zelle { white-space: normal; min-width: 7.5rem; }
.mails-seite .mail-tabelle .status-zelle .rel-form { white-space: nowrap; }
.mails-seite .mail-themen { min-width: 7rem; max-width: 12rem; }
/* feste Spaltenbreiten: lange Links/Adressen dürfen die Tabelle nie verbreitern (Ordner und Status bleiben immer sichtbar) */
.mails-seite .mail-tabelle { table-layout: fixed; min-width: 60rem; }
.mails-seite .mail-tabelle td, .mails-seite .mail-tabelle th { overflow-wrap: anywhere; }
.mails-seite .mail-tabelle th:nth-child(1) { width: 2rem; }
.mails-seite .mail-tabelle th:nth-child(2) { width: 7rem; }
.mails-seite .mail-tabelle th:nth-child(3) { width: 15%; }
.mails-seite .mail-tabelle th:nth-child(5) { width: 12%; }
.mails-seite .mail-tabelle th:nth-child(6) { width: 10%; }
.mails-seite .mail-tabelle th:nth-child(7) { width: 11rem; }
.mails-seite .mail-tabelle .wer, .mails-seite .mail-tabelle .betreff, .mails-seite .mail-themen, .mails-seite .mail-tabelle .ordner-zelle { min-width: 0; max-width: none; }
.mails-seite .mail-tabelle .status-zelle { min-width: 0; }

/* Handlungsbedarf */
.hb { margin-bottom: .35rem; }
.hb-marke { font-weight: 700; font-size: .85rem; }
.hb-dringend .hb-marke { color: #c53030; }
.hb-vorhanden .hb-marke { color: #b7791f; }
.hb-frist { font-size: .8rem; margin-left: .3rem; }
.hb-frist.ueberfaellig { color: #c53030; font-weight: 600; }
.hb-was { font-size: .85rem; margin-top: .1rem; }
.hb-form { margin-top: .2rem; }
.hb-wahl { font: inherit; font-size: .78rem; max-width: 100%; }
.hb-voll { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.hb-voll .hb-wahl { font-size: .9rem; }
.hb-was-feld input { min-width: 16rem; }
.zutun-einstieg strong { font-weight: 700; }

/* Status-Spalte: beschriftete Zeilen; Wählbares als Auswahlfeld, Aktionen als Knopf mit Verb */
.status-zeile { margin-bottom: .5rem; }
.status-zeile:last-child { margin-bottom: 0; }
.status-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); margin-bottom: .1rem; }
.status-zeile .hb { display: flex; flex-direction: column; margin: 0; }
.status-zeile .hb-form { order: -1; margin: 0 0 .15rem; }
.rel-wahl, .status-zeile .hb-wahl { font: inherit; font-size: .82rem; width: 100%; max-width: 11rem; padding: .1rem .2rem; border: 1px solid var(--rand); border-radius: .3rem; background: var(--flaeche, #fff); color: inherit; }
.rel-wahl-wichtig { border-color: #b7791f; font-weight: 600; }
.rel-wahl-ignoriert { color: var(--leise); }
.hb-dringend .hb-wahl { border-color: #c53030; color: #c53030; font-weight: 600; }
.hb-vorhanden .hb-wahl { border-color: #b7791f; font-weight: 600; }
.erledigt-knopf { margin-top: .15rem; }
.erledigt-stand { color: #2f855a; font-weight: 600; }
.mail-themen .thema-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.rel-wahl-form { margin: 0; }
.kopf-nav { color: var(--text); text-decoration: none; padding: .2rem .55rem; border-radius: .35rem; margin-right: .2rem; }
.kopf-nav:hover { background: color-mix(in srgb, var(--akzent) 10%, transparent); }
.kopf-nav.aktiv { font-weight: 600; color: var(--akzent); background: color-mix(in srgb, var(--akzent) 12%, transparent); }
.klappe > summary { cursor: pointer; font-weight: 600; }
.klappe[open] > summary { margin-bottom: .3rem; }
.kriterien > .suchorte, .kriterien > .feld-hinweis { margin-left: .2rem; }

/* Werkzeugleiste über der Trefferliste */
.listen-leiste { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; margin: .3rem 0 .5rem; }
.leiste-gruppe { display: inline-flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.leiste-gruppe .status-label { display: inline; margin: 0 .2rem 0 0; }
.ansicht-knopf[aria-pressed="true"] { background: color-mix(in srgb, var(--akzent) 14%, transparent); border-color: var(--akzent); font-weight: 600; }
.liste-speichern { position: relative; }
.liste-speichern > summary { list-style: none; display: inline-block; cursor: pointer; }
.liste-speichern > summary::-webkit-details-marker { display: none; }
.liste-speichern[open] > form { position: absolute; z-index: 5; right: 0; top: 2.2rem; width: 24rem; background: var(--flaeche, #fff); border: 1px solid var(--rand); border-radius: .4rem; padding: .6rem; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.mail-tabelle td.wahl, .mail-tabelle th.wahl { padding-left: .4rem; padding-right: 0; }
.mail-tabelle tr.gewaehlt td { background: color-mix(in srgb, var(--akzent) 7%, transparent); }

/* kompakte Ansicht: ein bis zwei Zeilen je Mail */
.mail-tabelle.kompakt td { padding-top: .25rem; padding-bottom: .25rem; }
.mail-tabelle.kompakt .vorschau, .mail-tabelle.kompakt .anhang-chip, .mail-tabelle.kompakt .mail-merkmale .leise,
.mail-tabelle.kompakt td.wer .klein, .mail-tabelle.kompakt td.wer .leise, .mail-tabelle.kompakt .ordner-zelle .klein,
.mail-tabelle.kompakt .status-label, .mail-tabelle.kompakt .rel-quelle, .mail-tabelle.kompakt .hb-herkunft, .mail-tabelle.kompakt .hb-was,
.mail-tabelle.kompakt .antwort .erledigt-form, .mail-tabelle.kompakt .ausschnitt .leise, .mail-tabelle.kompakt .thema-plus { display: none; }
.mail-tabelle.kompakt .datum .zeit { display: inline; }
.mail-tabelle.kompakt .mail-merkmale { margin-top: .1rem; }
.mail-tabelle.kompakt .ausschnitt { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mail-tabelle.kompakt .status-zeile { margin-bottom: .15rem; }
.mail-tabelle.kompakt .antwort .wartet { font-size: .75rem; }
/* kompakt: Handlung und Relevanz nebeneinander in einer Zeile, Details nur in der ausführlichen Ansicht */
.mails-seite .mail-tabelle.kompakt th:nth-child(7) { width: 17rem; }
.mail-tabelle.kompakt .status-zelle .status-zeile { display: inline-block; width: 49%; vertical-align: top; margin: 0; }
.mail-tabelle.kompakt .status-zelle .antwort, .mail-tabelle.kompakt .hb-anzeige { display: none; }
.mail-tabelle.kompakt td.wer { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seiten-hilfe { float: right; margin: .4rem 0 0; }

/* Fragen an eine Liste */
.ki-frage textarea { width: 100%; font: inherit; padding: .4rem; border: 1px solid var(--rand); border-radius: .35rem; }
.ki-gespraech { border-top: 1px solid var(--rand); margin-top: .8rem; padding-top: .6rem; }
.ki-gespraech-kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.ki-frage-text { margin: .5rem 0 .2rem; }
.ki-antwort { background: color-mix(in srgb, var(--akzent) 5%, transparent); border-left: 3px solid var(--akzent); padding: .4rem .7rem; border-radius: .3rem; }
.ki-antwort p { margin: .3rem 0; }
.ki-antwort ul { margin: .3rem 0 .3rem 1.2rem; padding: 0; }
.ki-antwort a.beleg { font-size: .8rem; text-decoration: none; font-weight: 600; }
.ki-nachfrage { display: flex; gap: .4rem; margin-top: .5rem; }
.ki-nachfrage input[type=text] { flex: 1; font: inherit; padding: .25rem .4rem; border: 1px solid var(--rand); border-radius: .3rem; }

/* Testumgebung: Sonnet und Haiku nebeneinander */
.ki-vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 52rem) { .ki-vergleich { grid-template-columns: 1fr; } }
.ki-antwort-vergleich { border-left-color: #b7791f; background: color-mix(in srgb, #b7791f 6%, transparent); }

/* Knopf "KI fragen" in der Werkzeugleiste */
.ki-knopf { font-weight: 600; border-color: var(--akzent) !important; color: var(--akzent); }
.ki-treffer[open] > form { display: flex; flex-direction: column; gap: .5rem; width: min(40rem, 92vw); }
.ki-einleitung { margin: 0; font-size: .9rem; color: var(--leise); }
.ki-einleitung strong { color: var(--text); }
.ki-treffer textarea, .ki-treffer input[type=text] { width: 100%; font: inherit; padding: .3rem .4rem; border: 1px solid var(--rand); border-radius: .3rem; }
.ki-treffer label { font-size: .9rem; }

.modell-wahl { display: inline-flex; flex-wrap: wrap; gap: .2rem .7rem; align-items: center; }
.modell-wahl label { font-weight: normal; }

/* Kontaktdaten */
.kd-bearbeiten > summary { cursor: pointer; color: var(--akzent); }
.kd-form { display: flex; flex-direction: column; gap: .4rem; max-width: 30rem; margin-top: .4rem; }
.kd-form input[type=text], .kd-form textarea { width: 100%; font: inherit; padding: .3rem .4rem; border: 1px solid var(--rand); border-radius: .3rem; }
.anschrift { white-space: normal; }

.liste-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .3rem 1rem; }
.liste-kopf p { margin: .3rem 0; }
a.sortier { color: inherit; text-decoration: none; }
a.sortier:hover { text-decoration: underline; }

/* Themen bei Vorgängen */
.thema-chip { display: inline-block; padding: .05rem .45rem; margin: .1rem 0; border: 1px solid var(--rand); border-radius: 1rem; font-size: .85em; text-decoration: none; }
.thema-chip.haupt { font-weight: 600; }

/* Vorgänge nach Thema: Themen links */
.zwei-spalten { display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.themen-nav { position: sticky; top: .5rem; max-height: calc(100vh - 1rem); overflow: auto; border: 1px solid var(--rand); border-radius: .5rem; padding: .4rem 0; background: var(--flaeche); }
.themen-nav ul { list-style: none; margin: 0; padding: 0; }
.themen-nav a { display: flex; gap: .3rem; align-items: baseline; padding: .25rem .6rem; text-decoration: none; color: inherit; }
.themen-nav a:hover { background: var(--hover, rgba(127,127,127,.12)); }
.themen-nav a[aria-current="page"] { background: var(--akzent); color: var(--akzent-text); }
.themen-nav .pfeil { width: .8rem; flex: none; opacity: .7; }
.themen-nav .anzahl { margin-left: auto; font-size: .85em; opacity: .75; }
.themen-nav .ohne { border-top: 1px solid var(--rand); margin-top: .3rem; padding-top: .3rem; }
.klein-h { font-size: 1.1rem; margin: 0 0 .4rem; }
@media (max-width: 760px) { .zwei-spalten { grid-template-columns: 1fr; } .themen-nav { position: static; max-height: 16rem; } }

/* Suchkriterien als kompakte Auswahlfelder */
.such-raster { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem .8rem; }
.mehrfach, .such-raster .einfach { position: relative; display: flex; flex-direction: column; gap: .15rem; }
.mf-titel { font-size: .8rem; font-weight: 600; color: var(--leise); }
.mehrfach > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: .15rem; }
.mehrfach > summary::-webkit-details-marker { display: none; }
.mf-wert { display: block; padding: 6px 1.6rem 6px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.mf-wert::after { content: '▾'; position: absolute; right: .5rem; color: var(--leise); }
.mf-wert.leer { color: var(--leise); }
.mehrfach[open] .mf-wert { border-color: var(--akzent); }
.mf-liste { position: absolute; top: 100%; left: 0; z-index: 20; min-width: 100%; max-height: 20rem; overflow: auto; margin-top: .2rem; padding: .4rem .6rem;
    background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.mf-liste label { display: block; padding: .15rem 0; white-space: nowrap; }
.mf-liste.breit-liste { min-width: 18rem; }
.mail-themen .thema-plus { white-space: nowrap; }
.version { font-size: .8em; opacity: .75; }
.mf-zahl { color: var(--leise); font-size: .85em; }
.baum-zeile { display: flex; align-items: baseline; gap: .2rem; }
.baum-zeile label { padding: .15rem 0; }
.baum-auf, .baum-auf-platz { width: 1.3rem; flex: none; }
.baum-auf { border: 0; background: none; cursor: pointer; color: var(--akzent); font: inherit; padding: 0; }
.baum-gruppe .baum-name { font-weight: 600; }
.vorgang-wahl .mf-liste { min-width: 24rem; }
.vg-text { display: flex !important; gap: .4rem; align-items: center; margin-bottom: .3rem; white-space: nowrap; }
.vg-text input { flex: 1; min-width: 8rem; }

/* „hidden“ gilt immer – auch bei Elementen mit eigener display-Regel (z. B. .baum-zeile) */
[hidden] { display: none !important; }

/* Darstellung einfach/vollständig */
.titel-zeile { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; }
.ansicht-wahl { display: flex; align-items: center; gap: .3rem; }
.ansicht-wahl [aria-pressed="true"] { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }

/* Suchbeispiele hinter "?" */
.such-tipps { position: relative; }
.such-tipps > summary { list-style: none; cursor: pointer; height: 100%; display: flex; align-items: center; padding: 0 .8rem; font-weight: 700; }
.such-tipps > summary::-webkit-details-marker { display: none; }
.such-tipps-inhalt { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 30; width: min(30rem, 90vw); padding: .7rem .9rem; background: var(--flaeche, var(--bg)); border: 1px solid var(--rand); border-radius: .5rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.such-tipps-inhalt table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.such-tipps-inhalt td { padding: .2rem .4rem .2rem 0; vertical-align: top; }

.ungefaehr-wahl { margin-left: .8rem; }
.meinten-sie { margin: .4rem 0; padding: .4rem .7rem; border-left: 3px solid var(--akzent); background: color-mix(in srgb, var(--akzent) 8%, transparent); }
