/* Webdesign-Assistent – Aussehen (aus dem Jayzee-Chat übernommen, Farben von Kinoviq; Meldungen als Karten) */
:root {
  --dunkel: #050818;
  --akzent: #4f6bff;
  --akzent-hell: #eef0ff;
  --ich: #dfe5ff;
  --assistent: #ffffff;
  --grund: #eef1f5;
  --text: #111827;
  --grau: #6b7280;
  --linie: #e5e7eb;
  --gruen: #16a34a;
  --rot: #dc2626;
  --oben: env(safe-area-inset-top, 0px);
  --unten: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--dunkel); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { width: 24px; height: 24px; fill: currentColor; display: block; }

/* ---------- Rahmen ---------- */
#app {
  position: fixed; left: 0; right: 0; top: 0; height: 100dvh;
  display: flex; flex-direction: column; background: var(--grund);
  max-width: 900px; margin: 0 auto;
}
@media (min-width: 900px) { #app { box-shadow: 0 0 0 1px var(--linie), 0 10px 40px rgba(0,0,0,.25); } }

#kopf {
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--oben)) 12px 8px; background: var(--dunkel); color: #fff; flex: none;
}
.avatar { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.kopf-text { flex: 1; min-width: 0; }
.kopf-name { font-weight: 650; font-size: 17px; }
.kopf-status { font-size: 13px; color: #b6c2d1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-status.aktiv { color: #a5f3c4; }
.icon-knopf {
  background: none; border: 0; padding: 8px; border-radius: 50%; color: var(--grau); flex: none;
  display: grid; place-items: center;
}
#kopf .icon-knopf { color: #cbd5e1; }
#glocke.an { color: #a5f3c4; }
.icon-knopf:active { background: rgba(127,127,127,.15); }

/* ---------- Hinweis-Leiste ---------- */
.hinweis {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff8e1; border-bottom: 1px solid #f3e3a5;
  font-size: 14px; flex: none;
}
.hinweis-text { flex: 1; }
.hinweis-knoepfe { display: flex; align-items: center; gap: 4px; }
.hinweis .teilen { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- Nachrichten ---------- */
#liste {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 10px 6px;
  display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain;
}
.leer { margin: auto; max-width: 340px; text-align: center; color: var(--grau); padding: 20px; }
.leer img { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 8px; }
.tag { align-self: center; margin: 10px 0 6px; padding: 4px 12px; border-radius: 10px; background: #dfe4ec; color: #475569; font-size: 12.5px; }
.blase {
  max-width: min(82%, 620px); padding: 7px 10px 5px; border-radius: 14px; position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,.08); word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
}
.blase.assistent { align-self: flex-start; background: var(--assistent); border-top-left-radius: 4px; }
.blase.ich { align-self: flex-end; background: var(--ich); border-top-right-radius: 4px; }
.blase.folge.assistent { border-top-left-radius: 14px; }
.blase.folge.ich { border-top-right-radius: 14px; }
.blase + .blase:not(.folge) { margin-top: 6px; }
.blase .text a { color: var(--akzent); }
.fuss { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11.5px; color: var(--grau); margin-top: 2px; white-space: nowrap; }
.haken { font-size: 13px; color: var(--grau); }
.haken.blau { color: #3b82f6; }
.blase.wartet { opacity: .75; }
.blase.fehler { outline: 1.5px solid var(--rot); }
.fehlerzeile { color: var(--rot); font-size: 13px; margin-top: 4px; white-space: normal; }
.fehlerzeile button { background: none; border: 0; color: var(--akzent); text-decoration: underline; padding: 0 0 0 6px; font-size: 13px; }

/* ---------- Statuszeilen ---------- */
.arbeitet {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 13.5px; color: #475569; background: var(--grund); flex: none;
}
.punkte { display: inline-flex; gap: 3px; }
.punkte i { width: 6px; height: 6px; border-radius: 50%; background: var(--akzent); animation: hupf 1.2s infinite ease-in-out; }
.punkte i:nth-child(2) { animation-delay: .15s; } .punkte i:nth-child(3) { animation-delay: .3s; }
@keyframes hupf { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Eingabe ---------- */
#eingabe {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px 8px calc(8px + var(--unten)); background: #f6f7f9;
  border-top: 1px solid var(--linie); flex: none;
}
#text {
  flex: 1; resize: none; border: 1px solid var(--linie); background: #fff; border-radius: 20px; padding: 9px 14px;
  font: inherit; font-size: 16px; line-height: 1.35; max-height: 160px; min-height: 42px; outline: none; color: var(--text);
}
#text:focus { border-color: #c3ccff; box-shadow: 0 0 0 3px rgba(79,107,255,.14); }
.rund {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--akzent); color: #fff; display: grid; place-items: center;
  flex: none; transition: transform .1s;
}
.rund:active { transform: scale(.92); }
.rund:disabled { background: #aab4e8; }
.rund svg { width: 22px; height: 22px; }
/* ---------- Sonstiges ---------- */
.meldung {
  position: absolute; left: 50%; bottom: calc(80px + var(--unten)); transform: translateX(-50%); background: rgba(17,24,39,.92);
  color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 14px; max-width: 90%; text-align: center; z-index: 6;
}
.haupt { background: var(--akzent); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600; }
.haupt.klein { padding: 6px 12px; font-size: 14px; border-radius: 8px; }
.text-knopf { background: none; border: 0; color: var(--grau); padding: 6px 8px; }

.anmeldung, .start {
  position: fixed; inset: 0; background: var(--dunkel); color: #e5e7eb; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px; text-align: center; gap: 6px;
}
.anmeldung h1 { margin: 6px 0 2px; color: #fff; }
.anmeldung p { margin: 4px 0; max-width: 340px; }
.anmeldung .klein { font-size: 14px; color: #94a3b8; margin-top: 18px; }
.anmeldung input { width: min(340px, 100%); padding: 11px 12px; border-radius: 10px; border: 1px solid #334155; background: #1e2a38; color: #fff; font: inherit; font-size: 16px; }
.anmeldung .haupt { margin-top: 10px; width: min(340px, 100%); }
.gross { width: 96px; height: 96px; border-radius: 24px; }
.fehlertext { color: #fca5a5; min-height: 1.4em; }
.start img { width: 84px; height: 84px; border-radius: 21px; animation: atmen 1.6s infinite ease-in-out; }
@keyframes atmen { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- Schnelle Fragen (Stand, Heute, Postkarten) ---------- */
.schnell { display: flex; gap: 8px; padding: 8px 10px; background: var(--dunkel); flex: none; border-top: 1px solid rgba(120,140,255,.16); }
.schnell button {
  flex: 1; border: 1px solid rgba(120,140,255,.32); background: rgba(79,107,255,.14); color: #e6eaff; border-radius: 999px;
  padding: 7px 6px; font-size: 14.5px; font-weight: 550;
}
.schnell button:active { background: rgba(79,107,255,.4); }

/* ---------- Meldungen vom System: Karten über die ganze Breite, Farbe je Art ---------- */
.karte {
  --farbe: #64748b; --hell: #f1f5f9;
  align-self: stretch; margin: 6px 2px; padding: 9px 12px 10px; border-radius: 12px; background: #fff;
  border: 1px solid var(--linie); border-left: 5px solid var(--farbe); box-shadow: 0 1px 2px rgba(0,0,0,.06);
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.karte-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.karte-art {
  font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--farbe);
  background: var(--hell); padding: 2px 8px; border-radius: 6px;
}
.karte-zeit { font-size: 11.5px; color: var(--grau); }
.karte .text { font-size: 15.5px; }
.karte .text a { color: var(--akzent); }
.karte.art-erstbesuch { --farbe: #2563eb; --hell: #e8f0ff; }
.karte.art-besuch_wieder { --farbe: #0e7490; --hell: #e3f6fa; }
.karte.art-film { --farbe: #7c3aed; --hell: #f1e9ff; }
.karte.art-anfrage { --farbe: #dc2626; --hell: #fee9e9; background: #fffafa; border-color: #f6c9c9; border-left-color: var(--farbe); }
.karte.art-anfrage .text { font-weight: 550; }
.karte.art-fragebogen { --farbe: #15803d; --hell: #e5f6ea; }
.karte.art-tagesbericht { --farbe: #475569; --hell: #eef1f5; }
.karte.art-karte_faellig { --farbe: #b45309; --hell: #fdf0d8; }

/* Hinweise des Systems (Kosten, Fehler, „KI noch nicht eingerichtet“) */
.blase.hinweis-blase { background: #fff8e1; border: 1px solid #f3e3a5; box-shadow: none; }

/* Ja/Nein, wenn der Assistent vor einer Änderung nachfragt */
.janein { display: flex; gap: 8px; padding: 8px 10px 2px; background: #f6f7f9; border-top: 1px solid var(--linie); flex: none; }
.janein .haupt { flex: 2; }
.janein .neben { flex: 1; background: #fff; border: 1px solid var(--linie); border-radius: 10px; padding: 11px 18px; font-weight: 600; color: #374151; }
.janein:not([hidden]) + #eingabe { border-top: 0; }
