/* Design-Tokens BJA (DESIGN.md / StyleGuide 2026) */
:root {
  --dunkelrot: #D66933;
  --dunkelgelb: #F1C631;
  --dunkelblau: #40509E;
  --hellgruen: #29A040;
  --dunkelgrau: #333333;
  --rotrot: #E30613;
  --hellgelb: #F6DC83;
  --mittelgrau: #666666;
  --hellgrau: #AAAAAA;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  color: var(--dunkelgrau);
  background: #ffffff;
  line-height: 1.5;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }
.screen { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.screen .mitte { overflow-y: auto; }
.screen[hidden] { display: none; }

.kopf { padding: 60px 60px 0 60px; position: relative; z-index: 10; } /* transparent: Text scrollt bis zum Bildschirmrand */
/* rote Linie bleibt in allen Ansichten sichtbar (z-index 10 im .kopf) */
.kopf-flex { display: flex; justify-content: space-between; align-items: flex-start; }
.kopf-titel h1 { display: inline-block; }
#begruessung { display: block; margin: 0 0 16px 0; }
#begruessung h1 { display: block; margin: 0 0 12px 0; }
#begruessung p { margin: 0 0 10px 0; font-size: 1rem; font-weight: 400; color: var(--dunkelgrau); }
#begruessung a { color: var(--dunkelrot); }
h1, h2, h3 {
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  font-weight: 600;
  color: var(--dunkelgrau);
  text-transform: uppercase;
  margin: 0;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; margin: 16px 0 8px 0; }
.linie { height: 10px; background: var(--dunkelrot); margin: 6px -60px 0 -60px; }

.mitte { flex: 1; padding: 60px; max-width: 760px; }
.layout .mitte { max-width: none; }
.chat-leer { padding-top: 40px; } /* Inhalt auf gleicher Höhe wie die Begrüßung im Hauptframe */
.mitte.breit { max-width: 760px; }

label { display: block; font-weight: 600; margin: 12px 0 4px 0; text-transform: uppercase; font-size: 0.85rem; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; max-width: 420px; padding: 10px 12px; font-size: 1rem;
  font-family: inherit; color: var(--dunkelgrau);
  border: 2px solid var(--hellgrau); border-radius: 0; background: #fff;
}
input:focus { outline: 3px solid var(--dunkelgelb); border-color: var(--dunkelgrau); }

button { font-family: inherit; cursor: pointer; }
.primaer {
  background: var(--dunkelrot); color: #fff; border: none;
  padding: 12px 20px; font-size: 1rem; font-weight: 600; text-transform: uppercase;
  margin-top: 16px;
}
.primaer:hover, .primaer:focus { background: #b8551f; }
.primaer:disabled, .primaer.busy { background: var(--hellgrau); cursor: not-allowed; }
.primaer.klein { padding: 8px 14px; font-size: 0.85rem; }
.sekundaer {
  background: #fff; color: var(--dunkelrot); border: 2px solid var(--dunkelrot);
  padding: 8px 16px; font-size: 0.9rem; font-weight: 600; text-transform: uppercase;
}
.icon-btn { background: #fff; border: 2px solid var(--hellgrau); font-size: 1.1rem; padding: 8px 10px; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.fehler { color: var(--rotrot); font-weight: 600; }
.hinweis { color: var(--dunkelblau); }
.erfolg { color: var(--hellgruen); font-weight: 600; }

.fuss {
  padding: 60px; border-top: 3px solid var(--dunkelgelb);
  font-size: 0.9rem;
}
.fuss .marke { text-transform: uppercase; font-weight: 600; }
.fuss a { color: var(--dunkelrot); text-decoration: none; }
.fuss a:hover, .fuss a:focus { text-decoration: underline; }

.kopf { position: relative; }
#teambild-link { position: absolute; right: 60px; top: 110px; }
#teambild { max-width: 160px; height: auto; }

/* Hauptansicht */
.layout { flex: 1; display: flex; gap: 60px; padding: 0 60px; align-items: stretch; min-height: 0; }
.spalte {
  width: 300px; flex-shrink: 0;
  background: var(--hellgrau);
  padding: 16px 20px;
  align-self: stretch;
  overflow-y: auto;
  display: flex; flex-direction: column;
  text-align: left;
}
.spalte button, .spalte .liste li { text-align: left; }
.logout-unten { margin-top: auto; align-self: flex-start; }
.fuss-links {
  margin-top: 12px; font-size: 0.75rem; color: #000;
}
.spalte > .fuss-links:first-child { margin-top: auto; } /* ohne weiteren Inhalt: unten im grauen Kasten wie eingeloggt */
.fuss-links a { color: #000; text-decoration: underline; }
.klapp { margin-top: 8px; }
.klapp-kopf {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: none; padding: 8px 0; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 1rem; text-transform: uppercase;
  color: var(--dunkelgrau);
}
.klapp-kopf .pfeil { color: var(--dunkelrot); display: inline-block; transition: transform 0.15s; }
.klapp.geschlossen .pfeil { transform: rotate(-90deg); }
.klapp.geschlossen .liste, .klapp.geschlossen #fortschritt-block { display: none; }
.liste { list-style: none; padding: 0; margin: 0 0 16px 0; }
.liste li { padding: 6px 0; border-bottom: 1px solid var(--hellgelb); font-size: 0.9rem; }
.liste li .loeschen { color: var(--dunkelgrau); background: none; border: none; font-size: 0.8rem; padding: 0 0 0 8px; text-decoration: underline; }
.spalte .liste a, .spalte .liste button { color: var(--dunkelgrau); text-decoration: underline; background: none; }
.liste .aktiv { font-weight: 600; }
.status-abgeschlossen { color: var(--hellgruen); font-weight: 600; }
.status-offen { color: var(--mittelgrau); }

.chat { flex: 1; max-width: 760px; display: flex; flex-direction: column; min-height: 0; min-width: 0; align-self: stretch; position: relative; z-index: 2; margin-top: -105px; } /* Chatbox läuft bis zum oberen Bildschirmrand (über Header + rote Linie) */
.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.karte {
  background: #fff; border: 2px solid var(--dunkelrot); color: var(--dunkelrot);
  padding: 14px; text-align: left; font-size: 0.9rem; font-weight: 600; text-transform: uppercase;
}
.karte:hover, .karte:focus { background: var(--hellgelb); }

#screen-main { height: 100vh; overflow: hidden; }
#screen-main .layout { flex: 1; min-height: 0; }
.screen .fuss { display: none; } /* Footerzeile in der App nicht sichtbar; Inhalte als Links im linken Balken */
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-top: 145px; background: #fff; } /* 105px Header + 40px bis h1-Unterkante = Button-Unterkante; Begruessung + Karten scrollen bis zum Bildschirmrand mit */
#begruessung h1 { margin: 0 0 12px 0; font-size: 1.5rem; line-height: 1.2; }
.verlauf { padding: 8px 0; }
.nachricht { margin: 10px 0; padding: 10px 14px; max-width: 90%; white-space: pre-wrap; }
.nachricht.tn { background: var(--hellgelb); margin-left: auto; }
.nachricht.agent { background: #f5f5f5; border-left: 4px solid var(--dunkelgelb); }
.nachricht img.grafik { display: block; max-width: 320px; margin-top: 8px; border: 1px solid var(--hellgrau); }
.nachricht .quellenangabe { font-size: 0.8rem; color: var(--mittelgrau); display: block; margin-top: 4px; }
.nachricht ul.auswahl { list-style: none; padding: 0; }
.nachricht ul.auswahl li { margin: 4px 0; }
.nachricht ul.auswahl label { display: inline; text-transform: none; font-weight: 400; margin: 0; cursor: pointer; }
.nachricht ul.auswahl input[type="checkbox"] { accent-color: var(--dunkelgelb); width: 18px; height: 18px; margin-right: 8px; }

.nachricht p { margin: 0 0 10px 0; }
.nachricht ul.md-liste { margin: 4px 0 10px 0; padding-left: 20px; }
.md-ueberschrift { display: block; margin-top: 10px; text-transform: uppercase; font-size: 0.95rem; }
.nachricht ul.md-liste li { margin: 2px 0; }
.bild-ref {
  background: none; border: none; padding: 0; color: var(--dunkelrot);
  font-size: inherit; text-decoration: underline; cursor: pointer;
}
.bild-ref:hover, .bild-ref:focus { color: #b8551f; }
.kapitel-ref {
  background: none; border: none; padding: 0; color: var(--dunkelrot);
  font-size: inherit; text-decoration: underline; cursor: pointer;
}
.kapitel-panel {
  margin: 8px 0; padding: 10px 14px; background: #fff;
  border-left: 4px solid var(--dunkelgelb);
}
.kapitel-text { max-height: 40vh; overflow-y: auto; white-space: pre-wrap; font-size: 0.9rem; margin-top: 6px; }
.mehr-erfahren {
  background: none; border: none; padding: 0; margin-top: 6px;
  color: var(--dunkelrot); font-size: 0.9rem; text-decoration: underline; cursor: pointer;
}
#eingabe-frage { margin: 0; font-size: 0.95rem; }
.eingabe {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 0;
  flex-shrink: 0; background: #fff;
  border-top: 3px solid var(--dunkelgelb);
}
.eingabe textarea {
  width: 100%; padding: 10px 12px; font-size: 1rem; font-family: inherit;
  color: var(--dunkelgrau); border: 2px solid var(--hellgrau); border-radius: 0;
  background: #fff; resize: vertical; min-height: 5 * 1.5em;
}
.eingabe textarea:focus { outline: 3px solid var(--dunkelgelb); border-color: var(--dunkelgrau); }
.eingabe-zeile { display: flex; justify-content: space-between; align-items: center; }
.eingabe-links { display: flex; gap: 8px; align-items: center; }
.timer {
  font-weight: 600; font-size: 1rem; color: var(--dunkelblau);
  font-variant-numeric: tabular-nums; padding: 8px 10px;
  border: 2px solid var(--dunkelgelb);
}
.primaer.senden { margin-top: 0; }

/* Tablet: Karten + Textbox volle Breite */
@media (max-width: 1024px) {
  .karten { grid-template-columns: 1fr; }
  .karte { width: 100%; }
  .eingabe textarea { width: 100%; }
}

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .spalte { width: 100%; }
  .linie { margin: 6px -60px 0 -60px; }
}
