:root {
  --grund: #f4f4f5;
  --flaeche: #ffffff;
  --text: #18181b;
  --leise: #71717a;
  --linie: #e4e4e7;
  --petrol: #0f5c63;
  --petrol-hell: #e3f0f1;
  --auf-petrol: #ffffff;
  --gruen: #15803d;
  --rot: #b91c1c;
  --gelb: #a16207;
  --nutzer: #0f5c63;
  --auf-nutzer: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #09090b;
    --flaeche: #18181b;
    --text: #f4f4f5;
    --leise: #a1a1aa;
    --linie: #27272a;
    --petrol: #2a9ba5;
    --petrol-hell: #11363a;
    --auf-petrol: #041a1c;
    --gruen: #4ade80;
    --rot: #f87171;
    --gelb: #facc15;
    --nutzer: #1d4f54;
    --auf-nutzer: #f4f4f5;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--grund);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }

button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--text);
  padding: .55rem 1rem;
  cursor: pointer;
}
button.haupt { background: var(--petrol); color: var(--auf-petrol); border-color: var(--petrol); font-weight: 600; }
button.flach { background: transparent; border-color: transparent; color: var(--petrol); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }

input, textarea {
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 10px;
  padding: .6rem .75rem;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--petrol); outline-offset: -1px; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 1.25rem; }
.fehler { color: var(--rot); min-height: 1.5em; margin: .5rem 0 0; }

/* Anmeldung */
#anmeldung { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.anmeldekarte { width: 100%; max-width: 380px; display: grid; gap: .6rem; }
.anmeldekarte h1 { margin: 0 0 .5rem; font-size: 1.3rem; }

/* App */
#app { height: 100%; display: grid; grid-template-rows: auto 1fr auto; max-width: 760px; margin: 0 auto; }
header {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem;
  padding: calc(.4rem + env(safe-area-inset-top)) 8px .4rem;
  border-bottom: 1px solid var(--linie);
  background: var(--grund);
}
header h1 { margin: 0; font-size: 1rem; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#verlauf {
  position: fixed; inset: 0 auto 0 0; width: min(85vw, 340px); z-index: 10;
  background: var(--flaeche); border-right: 1px solid var(--linie);
  padding: calc(1rem + env(safe-area-inset-top)) 0 1rem; overflow-y: auto;
  box-shadow: 0 0 40px rgb(0 0 0 / .25);
}
#gespraechsliste { list-style: none; margin: 0 0 1rem; padding: 0; }
#gespraechsliste button {
  width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent;
  padding: .7rem 16px; border-bottom: 1px solid var(--linie);
}
#gespraechsliste .datum { display: block; color: var(--leise); font-size: .8rem; font-variant-numeric: tabular-nums; }
#abmelden { margin-left: 8px; }

#nachrichten { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: .75rem; }
.leer { color: var(--leise); text-align: center; margin: auto; max-width: 30ch; }
.blase { max-width: 88%; padding: .6rem .85rem; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.blase.nutzer { align-self: flex-end; background: var(--nutzer); color: var(--auf-nutzer); border-bottom-right-radius: 4px; }
.blase.assistent { align-self: flex-start; background: var(--flaeche); border: 1px solid var(--linie); border-bottom-left-radius: 4px; }
.denkt { align-self: flex-start; color: var(--leise); font-style: italic; }

.aktion { align-self: stretch; border: 1px solid var(--petrol); background: var(--petrol-hell); border-radius: 12px; padding: .75rem .9rem; }
.aktion p { margin: 0 0 .6rem; white-space: pre-wrap; }
.aktion .knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; }
.aktion .zustand { font-size: .85rem; font-weight: 600; margin: 0; }
.aktion.ausgefuehrt { border-color: var(--gruen); background: var(--flaeche); }
.aktion.ausgefuehrt .zustand { color: var(--gruen); }
.aktion.abgelehnt, .aktion.fehler { border-color: var(--linie); background: var(--flaeche); }
.aktion.abgelehnt .zustand { color: var(--leise); }
.aktion.fehler .zustand { color: var(--rot); }

footer { border-top: 1px solid var(--linie); padding: .5rem 16px calc(.5rem + env(safe-area-inset-bottom)); background: var(--grund); }
.hinweis { margin: 0 0 .4rem; color: var(--leise); font-size: .85rem; min-height: 1.2em; }
.hinweis.fehler { color: var(--rot); }
.eingabe { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; }
.eingabe textarea { resize: none; max-height: 9rem; }
.leiste { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: .5rem; }
.schalter { display: flex; align-items: center; gap: .4rem; color: var(--leise); font-size: .9rem; }
.schalter input { width: auto; }
.kosten { justify-self: end; color: var(--leise); font-size: .8rem; font-variant-numeric: tabular-nums; }

.mikro {
  width: 72px; height: 72px; border-radius: 50%; padding: 0;
  background: var(--petrol); border: 0; display: grid; place-items: center;
}
.mikro svg { width: 32px; height: 32px; fill: var(--auf-petrol); }
.mikro.hoert { background: var(--rot); animation: puls 1.2s ease-in-out infinite; }
@keyframes puls { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .mikro.hoert { animation: none; } }
