/* Fallsimulator – Design „Anthrazit & Saphir“ (passend zum Icon Blaulicht) */

:root {
  --akzent: #1f7ae0; --akzent-dunkel: #0f56a8; --akzent-weich: #e3efff;
  --gruen: #1f9d63; --gelb: #c98f25; --rot: #c2405a;
  --bg: #f3f4f6; --karte: #ffffff; --text: #1a1f29; --leise: #737b8a; --linie: #e3e6eb;
  --schatten: 0 1px 2px rgba(15, 25, 45, .06), 0 6px 18px rgba(15, 25, 45, .07);
  --kopf: linear-gradient(115deg, #1b1d20 0%, #2a2f38 55%, #16202e 100%);
}
@media (prefers-color-scheme: dark) {   /* Nachtdienst */
  :root {
    --bg: #101317; --karte: #1a1e25; --text: #eef1f5; --leise: #a0a8b6; --linie: #2a303a;
    --akzent: #4ea3ff; --akzent-dunkel: #8cc4ff; --akzent-weich: rgba(78, 163, 255, .15);
    --gruen: #3ccf8e; --gelb: #e7b04a; --rot: #f07a8f;
    --schatten: 0 1px 2px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(44px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------- Kopfzeile ---------- */
.kopf {
  position: sticky; top: 0; z-index: 10; background: var(--kopf); color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 9px;
  box-shadow: 0 4px 18px rgba(10, 20, 40, .35);
  border-bottom: 2px solid rgba(78, 163, 255, .55);
}
.kopf-zeile { display: flex; align-items: center; gap: 8px; max-width: 760px; margin: 0 auto; }
.logo { margin-right: auto; display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 1.02rem; }
.logo img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.rund {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  text-decoration: none; font-size: .95rem; background: rgba(255,255,255,.16);
}
body:not(.angemeldet) .zahnrad { display: none; }

main { padding: 14px 14px 24px; max-width: 760px; margin: 0 auto; }
h2 { margin: .15em 0 .5em; font-size: 1.3rem; font-weight: 750; letter-spacing: -.015em; }
h3 { margin: 1.4em 0 .5em; font-size: .72rem; font-weight: 700; color: var(--leise); text-transform: uppercase; letter-spacing: .08em; }
.leise { color: var(--leise); }
.klein { font-size: .86rem; }
.mitte { text-align: center; margin-top: 3em; }
.ueber { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--akzent); margin-bottom: 2px; }

/* ---------- Karten ---------- */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 16px; padding: 16px; box-shadow: var(--schatten); margin-bottom: 12px; }
.held { border-top: 3px solid var(--akzent); }
.liste { display: grid; gap: 8px; }
.karte.zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; margin: 0; }
.rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hinweisbox { background: var(--akzent-weich); border-color: transparent; box-shadow: none; margin-top: 18px; }
.hinweisbox p { margin: .3em 0 0; }

.chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--linie); white-space: nowrap; }
.chip.gruen { background: rgba(31,157,99,.12); color: var(--gruen); border-color: transparent; }
.chip.gelb { background: rgba(201,143,37,.14); color: var(--gelb); border-color: transparent; }
.chip.rot { background: rgba(194,64,90,.12); color: var(--rot); border-color: transparent; }
.zeile-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }

/* ---------- Knöpfe & Eingaben ---------- */
button, .primaer, .sekundaer, .gefahr {
  font: inherit; font-weight: 650; border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:active { transform: scale(.97); }
.primaer { background: var(--akzent); color: #fff; }
.sekundaer { background: var(--akzent-weich); color: var(--akzent-dunkel); }
.gefahr { background: rgba(194,64,90,.12); color: var(--rot); }
.breit { display: block; width: 100%; margin-top: 10px; }
.link { background: none; color: var(--leise); text-decoration: underline; padding: 6px 0; font-weight: 400; display: block; }
label { display: block; margin: 10px 0; font-weight: 600; font-size: .88rem; }
input, textarea {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; outline: none;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-weich); }
.eingabe-zeile { display: flex; gap: 8px; align-items: stretch; }
.eingabe-zeile input { margin: 0; }
.eingabe-zeile button { flex: none; padding: 0 14px; }

/* ---------- Fall ---------- */
.fall-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fall-kopf .link { display: inline; padding: 0; }
.leiste { display: flex; gap: 5px; margin: 4px 0 12px; }
.punkt { flex: 1; height: 5px; border-radius: 99px; background: var(--linie); }
.punkt.fertig { background: var(--akzent); opacity: .55; }
.punkt.aktiv { background: var(--akzent); }
.lage { font-size: 1.02rem; margin: 0 0 6px; }
.block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--linie); }
.block-titel { font-weight: 700; font-size: .92rem; margin-bottom: 8px; }
.werte { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .92rem; }
.werte th { text-align: left; font-weight: 600; padding: 5px 10px 5px 0; vertical-align: top; width: 38%; hyphens: auto; }
.werte td { padding: 5px 0; }
.werte tr + tr { border-top: 1px solid var(--linie); }
.chat { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.chat .frage { align-self: flex-end; background: var(--akzent); color: #fff; padding: 7px 12px; border-radius: 14px 14px 4px 14px; max-width: 85%; }
.chat .antwort { align-self: flex-start; background: var(--bg); border: 1px solid var(--linie); padding: 7px 12px; border-radius: 14px 14px 14px 4px; max-width: 85%; }
.meine { background: var(--bg); border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; }

.aufloesung { border-left: 4px solid var(--akzent); }
.soll { padding: 10px 0; border-top: 1px solid var(--linie); }
.soll:first-of-type { border-top: 0; }
.soll-kopf .art { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); }
.soll.pflicht .art { color: var(--gruen); }
.soll.fehler .art { color: var(--rot); }
.soll.vertretbar .art { color: var(--gelb); }
.soll-text { font-weight: 650; margin: 2px 0; }
.soll-erkl { font-size: .88rem; color: var(--leise); }
.quelle { display: inline-block; margin-top: 4px; font-size: .8rem; color: var(--akzent); text-decoration: none; }
.hinweis-zeile { background: var(--akzent-weich); border-radius: 10px; padding: 8px 10px; }
.weiter-im-fall { margin: 12px 0 0; font-weight: 600; }
.lernpunkt { padding: 8px 0; border-top: 1px solid var(--linie); }
.lernpunkt:first-child { border-top: 0; padding-top: 0; }
.lernpunkt .quelle { display: block; }
.rueckblick { padding: 8px 0; border-top: 1px solid var(--linie); }
.rb-text { white-space: pre-wrap; }
.rueckblick:first-child { border-top: 0; padding-top: 0; }

/* ---------- Einstellungen ---------- */
.zeile-info { display: flex; justify-content: space-between; padding: 6px 0; }
.zeile-info + .zeile-info { border-top: 1px solid var(--linie); }
.cl-kopf { font-weight: 700; color: var(--text); margin-top: 8px; }

/* ---------- Fuß, Update, Toast ---------- */
.fuss {
  position: fixed; bottom: 0; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--leise);
  background: var(--bg); border-top: 1px solid var(--linie); padding: 7px 0 calc(7px + env(safe-area-inset-bottom));
}
.update { display: block; width: 100%; border-radius: 0; background: var(--akzent); color: #fff; font-weight: 600; padding: 9px; }
.update[hidden] { display: none; }
.toast {
  position: fixed; left: 50%; bottom: calc(56px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: #222a36; color: #fff; padding: 9px 16px; border-radius: 99px; font-size: .88rem; opacity: 0;
  transition: .25s; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center;
}
.toast.sichtbar { opacity: 1; transform: translateX(-50%); }
.toast.fehler { background: var(--rot); }
.login { max-width: 420px; margin: 2em auto; }
