/* Reiter „Nachrichten" in Teams. Farben und Maße nach dem freigegebenen Entwurf. */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../schrift/inter-latin-wght-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../schrift/jetbrains-mono-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(../schrift/jetbrains-mono-latin-500-normal.woff2) format('woff2');
}

:root {
  color-scheme: light;
  --text: #1B1E23;
  --text-2: #3C4350;
  --leise: #5A6170;
  --grund: #F3F4F6;
  --flaeche: #FFFFFF;
  --rand: #E1E3E8;
  --rand-zeile: #ECEEF1;
  --rand-feld: #C7CBD3;
  --blau: #1A4A85;
  --kopf: #1B1E23;
  --knopf: #1B1E23;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
body[data-marke="vektorbit"] { --kopf: #0A2547; --knopf: #0A2547; }
body[data-marke="mk24"] { --kopf: #000000; --knopf: #E40046; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  font-family: 'Inter Variable', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: var(--grund);
  min-height: 100vh;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blau);
  outline-offset: 2px;
}
.mono { font-family: var(--mono); }

/* Vollflächige Meldungen: Laden, nicht in Teams, kein Zugriff */
.sperre {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  text-align: center;
}
.sperre h1 { margin: 0; font-size: 20px; font-weight: 700; }
.sperre p { margin: 0; max-width: 520px; color: var(--text-2); }

/* Kopf */
.kopf {
  background: var(--kopf);
  color: #FFFFFF;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kopf-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.kopf-logo { display: block; width: auto; height: 28px; }
body[data-marke="mk24"] .kopf-logo { height: 40px; }
.kopf-strich { width: 1px; height: 36px; background: #FFFFFF; opacity: 0.3; }
.kopf-titel { display: flex; flex-direction: column; gap: 2px; }
.kopf-titel h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.kopf-neben { font-size: 13px; color: #D5DBE6; }

.beispiel-band {
  background: #FBEBCB;
  color: #6B4200;
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 600;
}
.hinweis {
  background: #FBE9E7;
  color: #7A1A14;
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 600;
}

main {
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1560px;
  margin: 0 auto;
}

/* Zahlen */
.zahlen {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  overflow: hidden;
}
.zahl { padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.zahl-name { font-size: 12px; font-weight: 600; color: var(--leise); }
.zahl-wert { font-size: 26px; font-weight: 700; font-family: var(--mono); }
.zahl.bald .zahl-name, .zahl.bald .zahl-wert { color: #6B4200; }
.zahl.offen { background: #FBE9E7; }
.zahl.offen .zahl-name, .zahl.offen .zahl-wert { color: #7A1A14; }

/* Filter und Suche */
.leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid var(--rand-feld);
  background: var(--flaeche);
  font-weight: 600;
}
.chip[aria-pressed="true"] { background: #1B1E23; border-color: #1B1E23; color: #FFFFFF; }
.suche { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.suche label { font-size: 13px; font-weight: 600; color: var(--leise); }
.suche input {
  min-height: 44px;
  width: 220px;
  padding: 0 12px;
  border: 1px solid var(--rand-feld);
  border-radius: 6px;
  background: var(--flaeche);
}
.knopf {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rand-feld);
  border-radius: 6px;
  background: var(--flaeche);
  font-weight: 600;
}
.knopf[aria-expanded="true"], .knopf[aria-pressed="true"] { background: #1B1E23; border-color: #1B1E23; color: #FFFFFF; }
.knopf.haupt { border: 0; padding: 0 20px; background: var(--knopf); color: #FFFFFF; }
.knopf.dunkel { border-color: #1B1E23; background: #1B1E23; color: #FFFFFF; padding: 0 16px; }
.knopf.klein { font-size: 13px; }

/* Vorlagen */
.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
}
.vorlagen { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.vorlagen h2 { margin: 0; font-size: 16px; font-weight: 700; }
.vorlagen-text { font-size: 13px; color: var(--text-2); max-width: 860px; margin: 4px 0 0; }
.vorlagen-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.vorlage { border: 1px solid var(--rand); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.vorlage-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.vorlage-name { font-weight: 700; }
.vorlage-wofuer { font-size: 13px; color: var(--leise); }

.pille {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pille.unbeantwortet { background: #A4201A; color: #FFFFFF; }
.pille.beantwortet { background: #E2F0E7; color: #1D5A3A; }
.pille.entwurf { background: #FBEBCB; color: #6B4200; }
.pille.gut { background: #E2F0E7; color: #1D5A3A; }
.pille.schlecht { background: #FBE9E7; color: #7A1A14; }
.pille.offen, .fenster.offen { background: #E2F0E7; color: #1D5A3A; }
.pille.bald, .fenster.bald { background: #FBEBCB; color: #6B4200; }
.pille.zu, .fenster.zu { background: #ECEEF2; color: #3C4350; }

/* Zwei Spalten */
.spalten { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.liste { flex: 1 1 400px; min-width: 0; overflow: hidden; }
.liste-kopf { padding: 0 16px; min-height: 40px; display: flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--leise); }
.zeile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--rand-zeile);
  background: var(--flaeche);
  text-align: left;
}
.zeile[aria-current="true"] { background: #EAF0F8; }
.zeile:focus-visible { outline-offset: -2px; }
.zeile-oben { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.zeile-name { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile-zeit { flex: none; font-size: 12px; color: var(--leise); font-family: var(--mono); }
.zeile-vorschau { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile-unten { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.zeile-zust { font-size: 12px; color: var(--leise); }
.liste-leer { padding: 28px 16px; border-top: 1px solid var(--rand-zeile); color: var(--leise); }

.verlauf { flex: 999 1 560px; min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.verlauf-leer { color: var(--leise); padding: 10px 0; }
.verlauf-inhalt { display: flex; flex-direction: column; gap: 18px; }
.zurueck { display: none; align-self: flex-start; }
.gespraech-kopf { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gespraech-wer { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gespraech-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.gespraech-nummer { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.gespraech-zust { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 220px; }
.gespraech-zust-text { font-size: 13px; }
.gespraech-zust-text span:first-child { color: var(--leise); }
.gespraech-zust-text span:last-child { font-weight: 600; }

.fenster { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 6px; }
.fenster svg { flex: none; margin-top: 1px; }
.fenster-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fenster-lang { font-weight: 600; }
.fenster-hinweis { font-size: 13px; }

.abschnitt { display: flex; flex-direction: column; gap: 10px; }
.abschnitt h2 { margin: 0; font-size: 13px; font-weight: 700; }
.nachrichten {
  margin: 0;
  padding: 14px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--grund);
  border-radius: 8px;
  max-height: min(60vh, 620px);
  overflow-y: auto;
}
.nachricht { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.nachricht.von-uns { align-items: flex-end; }
.blase {
  max-width: min(520px, 86%);
  padding: 10px 12px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #E1E3E8;
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.von-uns .blase { background: #E1ECFA; border-color: #C5D8F0; }
.nachricht.wartet .blase { opacity: 0.7; }
.nachricht.fehler .blase { background: #FBE9E7; border-color: #E8B4AE; }
.datei {
  width: min(360px, 86%);
  padding: 10px 12px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #E1E3E8;
  display: flex;
  align-items: center;
  gap: 10px;
}
.von-uns .datei { background: #E1ECFA; border-color: #C5D8F0; }
.datei svg { flex: none; }
.datei-text { display: flex; flex-direction: column; min-width: 0; }
.datei-art { font-size: 13px; font-weight: 600; }
.datei-info { font-size: 12px; color: var(--leise); }
.meta { font-size: 12px; color: var(--leise); }
.nachricht.fehler .meta { color: #7A1A14; font-weight: 600; }
.nachrichten-leer { color: var(--leise); font-size: 13px; }

.feld {
  padding: 10px 12px;
  border: 1px solid var(--rand-feld);
  border-radius: 6px;
  background: var(--flaeche);
  resize: vertical;
  width: 100%;
}
.feld.klein { font-size: 13px; }
.abschnitt > label { font-size: 13px; font-weight: 700; }
.abschnitt > label.leise { font-size: 12px; font-weight: 600; color: var(--leise); }
.unter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.unter > .knopf { margin-left: auto; }
.unter-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--leise); }
.meldung { font-size: 13px; font-weight: 600; color: #7A1A14; }
.meldung.gut { color: #1D5A3A; }

.wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.vorschau {
  padding: 12px 14px;
  border: 1px dashed #A9AFBA;
  border-radius: 8px;
  background: var(--flaeche);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vorschau-kopf { font-size: 12px; font-weight: 600; color: var(--leise); }
.text-2 { font-size: 13px; color: var(--text-2); }

.notizen { border-top: 1px solid var(--rand-zeile); padding-top: 16px; }
.notiz { background: var(--grund); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.notiz-kopf { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--leise); }
.notiz-kopf span:first-child { font-weight: 600; color: var(--text); }
.notiz-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.erwaehnt { color: var(--blau); font-weight: 600; }
.notizen-leer { font-size: 13px; color: var(--leise); }

/* Schmale Fenster und Handy: entweder Liste oder Verlauf */
@media (max-width: 860px) {
  .kopf, main { padding-left: 14px; padding-right: 14px; }
  .beispiel-band, .hinweis { padding-left: 14px; padding-right: 14px; }
  .suche input { width: min(220px, 100%); flex: 1 1 140px; }
  .spalten { flex-direction: column; align-items: stretch; }
  .liste, .verlauf { flex: none; width: 100%; }
  .zahlen { grid-template-columns: repeat(2, 1fr); }
  .zahl { padding: 10px 14px; }
  .zahl-wert { font-size: 22px; }
  body.hat-auswahl .liste,
  body.hat-auswahl .zahlen,
  body.hat-auswahl .leiste,
  body.hat-auswahl .vorlagen { display: none; }
  body:not(.hat-auswahl) .verlauf { display: none; }
  .zurueck { display: inline-flex; align-items: center; }
  .gespraech-zust { min-width: 0; width: 100%; }
  .nachrichten { max-height: none; }
}
