:root { --grund: #f3f5f7; --flaeche: #ffffff; --text: #1f2933; --leise: #5b6773; --linie: #d5dbe1; --haupt: #01666b; --hover: #eaf0f2; --aktiv: #d9ecec; --rot: #c62828; --gelb: #8a5a00; color-scheme: light; }
:root.dunkel { --grund: #1b1d26; --flaeche: #262a36; --text: #e8eaf0; --leise: #aab2c0; --linie: #3c4150; --haupt: #01868c; --hover: #2f3442; --aktiv: #17474a; --rot: #ff8a80; --gelb: #ffd257; color-scheme: dark; }
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { overflow: hidden; }
body { font: 14px/1.4 "Segoe UI", Roboto, Arial, sans-serif; background: var(--grund); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
[hidden] { display: none !important; }
.knopf { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 8px; padding: 6px 12px; min-height: 34px; }
.knopf:hover:not(:disabled) { background: var(--hover); }
.knopf.haupt { background: var(--haupt); border-color: var(--haupt); color: #fff; font-weight: 600; }
.knopf.haupt:hover:not(:disabled) { filter: brightness(1.12); background: var(--haupt); }
.feld { width: 100%; border: 1px solid var(--linie); background: var(--flaeche); border-radius: 8px; padding: 7px 10px; }
.feld:focus, .knopf:focus-visible, .chip:focus-visible, .zeile:focus-visible { outline: 2px solid var(--haupt); outline-offset: 1px; }

.seite { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.oben { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linie); background: transparent; border-radius: 16px; padding: 4px 11px; min-height: 30px; }
.chip:hover { background: var(--hover); }
.chip.aktiv { background: var(--haupt); border-color: var(--haupt); color: #fff; font-weight: 600; }
.punkt { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .6); }
.zahl { font-size: 12px; font-weight: 700; }
.suche { margin-left: auto; display: flex; gap: 6px; flex: 1 1 260px; max-width: 420px; }
.oben select { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 8px; padding: 5px 8px; min-height: 34px; }
.mitte { min-height: 0; display: grid; grid-template-columns: minmax(300px, 400px) 1fr; }
.liste { min-height: 0; overflow-y: auto; border-right: 1px solid var(--linie); background: var(--flaeche); }
.hinweis { padding: 10px 14px; color: var(--leise); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.hinweis .knopf { margin-left: auto; padding: 2px 10px; min-height: 28px; }
.hinweis.fehler { color: var(--rot); font-weight: 600; }
.zeile { display: grid; grid-template-columns: 12px 1fr auto; gap: 1px 8px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--linie); background: transparent; padding: 9px 12px; }
.zeile:hover { background: var(--hover); }
.zeile.aktiv { background: var(--aktiv); }
.zeile .punkt { grid-row: 1 / 3; margin-top: 5px; }
.zeile .wer, .zeile .was { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .was { grid-column: 2 / 4; color: var(--leise); }
.zeile .wann { font-size: 12px; color: var(--leise); white-space: nowrap; }
.zeile.neu .wer, .zeile.neu .was { font-weight: 700; color: var(--text); }
.zeile.neu .wann { color: var(--text); font-weight: 700; }
.mehr { display: block; margin: 12px auto; }

.lesen { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--flaeche); }
.leer { margin: auto; color: var(--leise); text-align: center; padding: 20px; }
.kopf { padding: 12px 18px; border-bottom: 1px solid var(--linie); display: grid; gap: 4px; }
.kopf h1 { font-size: 18px; margin: 0; overflow-wrap: anywhere; }
.kopf .angaben { color: var(--leise); font-size: 13px; overflow-wrap: anywhere; max-height: 64px; overflow-y: auto; }
.leiste { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.anhaenge { display: flex; flex-wrap: wrap; gap: 6px; max-height: 90px; overflow-y: auto; }
.anhaenge a, .anhaenge span { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--linie); border-radius: 8px; padding: 3px 9px; font-size: 13px; color: inherit; text-decoration: none; max-width: 100%; overflow-wrap: anywhere; }
.anhaenge a:hover { background: var(--hover); }
.anhaenge button { border: 0; background: none; padding: 0 2px; }
.inhalt { flex: 1; min-height: 120px; width: 100%; border: 0; background: #fff; }
.zurueck { display: none; }

.antwort { border-top: 3px solid var(--haupt); padding: 12px 18px; display: grid; gap: 7px; max-height: 72%; overflow-y: auto; flex: none; }
.antwort .reihe { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 8px; }
.antwort textarea { min-height: 150px; resize: vertical; }
.signatur { white-space: pre-wrap; color: var(--leise); font-size: 12px; border-left: 3px solid var(--linie); padding-left: 10px; max-height: 92px; overflow-y: auto; }
.antwort .unten { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.antwort .unten .haupt { margin-left: auto; }
.antwort select { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 8px; padding: 5px 8px; min-height: 34px; }

.decke { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.fenster { background: var(--flaeche); border-radius: 14px; padding: 20px; width: min(520px, 100%); max-height: 92vh; overflow-y: auto; display: grid; gap: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .4); }
.fenster h2 { margin: 0; font-size: 18px; }
.fenster dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; overflow-wrap: anywhere; }
.fenster dt { color: var(--leise); } .fenster dd { margin: 0; font-weight: 600; }
.vorschau { white-space: pre-wrap; border: 1px solid var(--linie); border-radius: 8px; padding: 10px; max-height: 200px; overflow-y: auto; overflow-wrap: anywhere; }
.paar { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.fenster label { display: grid; gap: 4px; font-size: 13px; color: var(--leise); } .fenster label > * { font-size: 14px; color: var(--text); }
.meldefehler { color: var(--rot); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1f2933; color: #fff; border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; padding: 10px 18px; z-index: 20; max-width: 92vw; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
.toast.schlecht { background: #b3261e; }

.klein { height: 100%; display: flex; flex-direction: column; background: var(--flaeche); }
.klein .titel { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-weight: 700; font-size: 16px; }
.klein .titel .marke { font-size: 12px; border-radius: 10px; padding: 1px 8px; background: #c62828; color: #fff; }
.klein .titel button { margin-left: auto; font-size: 13px; font-weight: 400; background: none; border: 0; text-decoration: underline; padding: 4px; }
.klein .liste { flex: 1; border: 0; }

@media (max-width: 860px) {
  .mitte { grid-template-columns: 1fr; }
  .seite.offen { grid-template-rows: 1fr; }
  .seite:not(.offen) .lesen { display: none; }
  .seite.offen .liste, .seite.offen .oben { display: none; }
  .zurueck { display: inline-block; }
  .antwort { max-height: 80%; }
}
.angaben .punkt { display: inline-block; vertical-align: -1px; }

.huelle { position: relative; }
.weg { position: absolute; right: 8px; bottom: 4px; width: 30px; height: 30px; padding: 0; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); font-size: 15px; line-height: 1; opacity: 0; }
.huelle:hover .weg, .huelle:focus-within .weg { opacity: 1; }
.weg:hover, .weg:focus-visible { background: #c62828; border-color: #c62828; color: #fff; outline: none; }
.huelle:hover .was, .huelle:focus-within .was { padding-right: 34px; }
@media (hover: none) { .weg { opacity: 1; } .was { padding-right: 34px; } }
.toast { width: max-content; }
.toast button { margin-left: 14px; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 4px; }
.klein .titel button { flex: none; }
.postkopf { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; background: var(--grund); border-bottom: 1px solid var(--linie); border-top: 1px solid var(--linie); }
.postteil + .postteil .postkopf { margin-top: -1px; }
.klappe { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 4px 8px 10px; text-align: left; font-weight: 700; }
.klappe .adresse { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.klappe .marke { flex: none; font-size: 12px; border-radius: 10px; padding: 0 7px; background: #c62828; color: #fff; }
.pfeil { width: 12px; color: var(--leise); }
.postkopf .alle { flex: none; border: 0; background: none; padding: 8px 14px; font-size: 13px; text-decoration: underline; }
.postkopf button:hover { background: var(--hover); }
.postteil .zeile { grid-template-columns: 1fr auto; padding-left: 14px; }
.postteil .zeile .punkt { display: none; }
.postteil .zeile .was { grid-column: 1 / 3; }
