/* SuKI – Basis-CSS. Hell, licht, luftig (Apple-artig). Mobil zuerst. */
:root {
  --bg: #f5f6f2; --flaeche: #ffffff; --text: #2b2d24; --text-leise: #6b6e5e;
  --lime: #cad85a; --lime-hell: #eef2c4; --lime-dunkel: #bccb43;
  --oliv: #818438; --oliv-text: #5f6128;
  --linie: rgba(43,45,36,.08);
  --schatten: 0 1px 2px rgba(43,45,36,.05), 0 6px 20px rgba(43,45,36,.07);
  --schatten-klein: 0 1px 2px rgba(43,45,36,.06), 0 2px 8px rgba(43,45,36,.05);
  --ok: #3f6b1f; --warn: #86550a; --fehler: #b3261e;
  --ok-bg: #e9f2d3; --warn-bg: #fbf0d2; --fehler-bg: #fbe6e3;
  --radius: 20px; --radius-gross: 28px;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--oliv-text); }

/* ---------- Chat-Rahmen ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 860px; margin: 0 auto; background: var(--bg); }
.kopf { flex: none; background: rgba(245,246,242,.88); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  color: var(--text); z-index: 2; box-shadow: 0 1px 0 var(--linie);
  padding: calc(8px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) 10px calc(16px + env(safe-area-inset-left, 0px)); }
.kopf-zeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.marke { font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em; }
.marke small { font-weight: 400; color: var(--text-leise); margin-left: 8px; font-size: .8rem; letter-spacing: 0; }
.kopf a { color: var(--oliv-text); text-decoration: none; font-weight: 500; font-size: .92rem; padding: 12px 10px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 12px; }
.kopf a:hover, .textknopf:hover { background: rgba(129,132,56,.1); }
.pillen { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pillen::-webkit-scrollbar { display: none; }
.pille { flex: none; font-size: .8rem; padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--text); white-space: nowrap; box-shadow: var(--schatten-klein); }
.pille.ok { background: var(--lime-hell); color: #3b4a0f; }
.pille.warn { background: var(--warn-bg); color: var(--warn); }
.pille.fehler { background: var(--fehler-bg); color: var(--fehler); }

.verlauf { flex: 1; overflow-y: auto; padding: 20px calc(16px + env(safe-area-inset-right, 0px)) 20px calc(16px + env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
.verlauf > * { flex: none; }   /* sonst schrumpft eine Karte mit overflow:hidden auf 3 px */
.verlauf > .leer { flex: 0 1 auto; }
.leer { color: var(--text-leise); text-align: center; margin: auto; max-width: 30em; }
.msg { max-width: 88%; padding: 11px 16px; border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--schatten-klein); }
.msg.dennis { align-self: flex-end; background: var(--lime); color: var(--text); border-bottom-right-radius: 6px; box-shadow: none; }
.msg.suki { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; }
.msg code { background: rgba(43,45,36,.07); padding: 1px 5px; border-radius: 6px; font-size: .92em; }
.zeit { display: block; font-size: .72rem; color: var(--text-leise); margin-top: 3px; }
.msg.dennis .zeit { color: rgba(43,45,36,.65); }

.karte { align-self: stretch; border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--schatten); }
.karte-kopf { padding: 12px 16px; background: var(--lime-hell); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.karte-text { padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; }
.karte-hinweis { padding: 10px 16px; background: var(--warn-bg); color: var(--warn); font-size: .88rem; }
.karte-status { padding: 12px 16px; font-weight: 600; }
.karte-status.ok { background: var(--ok-bg); color: var(--ok); }
.karte-status.leise { background: #f0f1ea; color: var(--text-leise); }
.karte textarea { width: 100%; min-height: 40vh; border: 0; border-top: 1px solid var(--linie); padding: 14px 16px; resize: vertical; background: #fbfbf9;
  font: .88rem/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px 16px; }

.knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.knopf { min-height: 44px; padding: 8px 20px; border-radius: 999px; border: 0; background: #fff; color: var(--text); box-shadow: var(--schatten-klein);
  cursor: pointer; font-weight: 600; touch-action: manipulation; transition: background .15s, box-shadow .15s; }
.knopf:hover { box-shadow: 0 1px 2px rgba(43,45,36,.08), 0 4px 14px rgba(43,45,36,.1); }
.knopf.primaer { background: var(--lime); color: var(--text); box-shadow: none; }
.knopf.primaer:hover { background: var(--lime-dunkel); }
.knopf.gefahr { color: var(--fehler); }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf:focus-visible, .eingabe textarea:focus-visible, .formular input:focus-visible, .textknopf:focus-visible, .kopf a:focus-visible {
  outline: 3px solid var(--oliv); outline-offset: 2px; }

.nachweise { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px 16px; }
.nachweise a { display: block; border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--oliv-text); font-size: .8rem; box-shadow: var(--schatten-klein); }
.nachweise img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f0f1ea; }
.nachweise span { display: block; padding: 6px 8px; overflow-wrap: anywhere; }
.nachweise a.datei { padding: 12px; min-height: 44px; }

.eingabe { flex: none; display: flex; gap: 10px; align-items: flex-end; background: transparent;
  padding: 8px calc(16px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px)); }
.eingabe textarea { flex: 1; min-height: 48px; max-height: 30vh; border: 0; border-radius: 24px; padding: 13px 18px; resize: none; background: #fff; box-shadow: var(--schatten); }
.eingabe textarea::placeholder, .textzeile input::placeholder, .formular input::placeholder { color: #8d907d; }
.denkt { color: var(--text-leise); font-style: italic; align-self: flex-start; padding: 4px 10px; }

/* ---------- Anmeldung / Passwort ---------- */
.mitte { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.formular { width: 100%; max-width: 400px; background: #fff; border-radius: var(--radius-gross); padding: 32px 26px; box-shadow: var(--schatten); }
.formular h1 { margin: 0 0 4px; font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; }
.formular p.leise { margin: 0 0 18px; color: var(--text-leise); }
.formular label.feld { display: block; font-weight: 500; font-size: .9rem; margin: 14px 0 6px; }
.formular input[type=text], .formular input[type=password] { width: 100%; min-height: 48px; padding: 8px 16px; border: 0; border-radius: 14px; background: var(--bg); }
.sc-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; min-height: 44px; cursor: pointer; }
.sc-check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--oliv); }
.sc-check-hinweis { margin: 0 0 0 32px; font-size: .85rem; color: var(--text-leise); }
.formular .knopf { width: 100%; margin-top: 20px; }
.fehlerbox { background: var(--fehler-bg); color: var(--fehler); padding: 10px 14px; border-radius: 14px; margin-bottom: 8px; }

@media (min-width: 700px) {
  .msg { max-width: 78%; }
  .app { margin: 16px auto; height: calc(100vh - 32px); height: calc(100dvh - 32px); border-radius: var(--radius-gross); overflow: hidden; background: var(--bg); box-shadow: var(--schatten); }
  .kopf { padding-top: 8px; }
}
@media (prefers-reduced-motion: no-preference) { .msg, .karte { animation: rein .18s ease-out; } @keyframes rein { from { opacity: 0; transform: translateY(4px); } } }

/* ---------- Passkey, Kopf-Links, Warteschlange ---------- */
.kopf-links { display: flex; align-items: center; gap: 2px; }
.textknopf { background: none; border: 0; color: var(--oliv-text); font-weight: 500; font-size: .92rem; cursor: pointer; padding: 12px 10px; min-height: 44px; border-radius: 12px; touch-action: manipulation; }
.textknopf:disabled { opacity: .5; }
.formular p.leise.trenner { text-align: center; margin: 14px 0 0; }
.formular #passkey-login { margin-top: 10px; }
.formular #passkey-fehler { margin: 12px 0 0; }
.karte-status.warn { background: var(--warn-bg); color: var(--warn); }
.karte-status.fehler { background: var(--fehler-bg); color: var(--fehler); }
.warteschlange { padding: 6px 16px 12px; font-size: .8rem; color: var(--text-leise); }
@media (max-width: 420px) { .textknopf, .kopf a { padding: 12px 6px; font-size: .85rem; } .marke small { display: none; } }

/* ---------- Kopf-Ball (Größe), Ball-Seite (hell) ----------
   ball.css gehört dem Ball-Umbau und wird nach dieser Datei geladen; darum body.ballseite für höhere Spezifität. */
.kopf-ball-link { color: var(--text); }
.kopf .kopf-ball { width: 40px; height: 40px; background: transparent; }
body.ballseite { background: radial-gradient(ellipse at 50% 42%, #1a1d27 0%, #0f1117 55%, #090b10 100%) fixed #0f1117; color: #eef0e4; }
body.ballseite .oben a { color: #dfe97a; font-weight: 500; text-decoration: none; border-radius: 12px; }
body.ballseite .stimmstatus { color: #c9cdb4; background: rgba(255,255,255,.08); padding: 4px 12px; border-radius: 999px; box-shadow: none; }
body.ballseite .untertitel { color: #eef0e4; }
body.ballseite .untertitel .du { color: #aeb39a; }
body.ballseite .knopf { background: rgba(255,255,255,.10); color: #eef0e4; border: 0; }
body.ballseite .knopf.primaer { background: var(--lime); color: #20210e; }
body.ballseite .mikro { width: 92px; height: 92px; margin-bottom: 8px; border: 0; background: var(--lime); color: #20210e; box-shadow: 0 0 32px rgba(202,216,90,.35); }
body.ballseite .mikro[aria-pressed="true"] { background: var(--oliv); color: #fff; box-shadow: 0 0 0 8px rgba(202,216,90,.35), 0 0 40px rgba(202,216,90,.45); }
body.ballseite .textzeile input { border: 0; background: rgba(255,255,255,.10); color: #eef0e4; border-radius: 999px; padding: 8px 18px; box-shadow: none; }
body.ballseite .textzeile input::placeholder { color: #9a9f86; }
body.ballseite :focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
