:root {
  --void: #0a0a0a;
  --void-2: #131313;
  --graphit: #262626;
  --nebel: #8a8a8a;
  --bein: #f2f2f2;
  --neon: #ccff00;
  --rot: #ff5a4e;
  --rund: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/*
 * Muss stehen bleiben. Die Browser-Regel [hidden] { display: none } stammt aus
 * dem User-Agent-Stylesheet und wird von JEDER Autoren-Regel mit display
 * ueberstimmt - also von .anmeldung (grid), .panel (flex) und .bilder (flex).
 * Ohne dieses !important zeigt die Seite Anmeldung und Panel gleichzeitig an,
 * und nach dem Login "passiert nichts", weil das Login-Formular stehen bleibt.
 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--bein);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.akzent { color: var(--neon); }

/* ------------------------------------------------------------- Anmeldung */

.anmeldung {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.karte {
  width: 100%;
  max-width: 360px;
  background: var(--void-2);
  border: 1px solid var(--graphit);
  border-radius: var(--rund);
  padding: 28px 24px;
}

.karte h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.karte .hinweis { margin: 4px 0 24px; color: var(--nebel); font-size: 14px; }
.karte label { display: block; font-size: 13px; color: var(--nebel); margin-bottom: 6px; }

input[type="password"], textarea {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--graphit);
  border-radius: 10px;
  color: var(--bein);
  padding: 12px 14px;
  font: inherit;
  resize: none;
}

input[type="password"]:focus, textarea:focus {
  outline: 2px solid var(--neon);
  outline-offset: 1px;
  border-color: transparent;
}

/* ---------------------------------------------------------------- Knöpfe */

.knopf {
  appearance: none;
  border: 1px solid var(--graphit);
  background: var(--void-2);
  color: var(--bein);
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}

.knopf:hover { border-color: var(--nebel); }
.knopf:disabled { opacity: .45; cursor: default; }

.knopf--voll {
  width: 100%;
  margin-top: 18px;
  background: var(--neon);
  color: #000;
  border-color: var(--neon);
  font-weight: 600;
}

.knopf--klein { padding: 6px 12px; font-size: 13px; }

.knopf--rund {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.knopf--senden { background: var(--neon); color: #000; border-color: var(--neon); font-weight: 700; }

.fehler { color: var(--rot); font-size: 14px; margin: 14px 0 0; }

/* ----------------------------------------------------------------- Panel */

.panel {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 780px;
  margin: 0 auto;
}

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--graphit);
  background: var(--void);
}

.kopf__sub { display: block; font-size: 12px; color: var(--nebel); }

.verlauf {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.willkommen h2 { font-size: 20px; margin: 0 0 8px; }
.willkommen p { color: var(--nebel); margin: 0 0 14px; }
.beispiele { margin: 0; padding-left: 18px; color: var(--nebel); font-size: 14px; }
.beispiele li { margin-bottom: 6px; }

/* ------------------------------------------------------------- Nachrichten */

.blase {
  padding: 12px 15px;
  border-radius: var(--rund);
  max-width: 88%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.blase--ich {
  align-self: flex-end;
  background: var(--neon);
  color: #000;
  border-bottom-right-radius: 4px;
}

.blase--claude {
  align-self: flex-start;
  background: var(--void-2);
  border: 1px solid var(--graphit);
  border-bottom-left-radius: 4px;
}

.blase__bilder { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.blase__bilder img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

.schritt {
  align-self: flex-start;
  color: var(--nebel);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
}

.schritt::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--neon);
  flex: 0 0 6px;
}

.schritt--laeuft::before { animation: pulsieren 1.2s ease-in-out infinite; }

@keyframes pulsieren { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

.ergebnis {
  align-self: stretch;
  background: var(--void-2);
  border: 1px solid var(--graphit);
  border-left: 3px solid var(--neon);
  border-radius: var(--rund);
  padding: 14px 16px;
}

.ergebnis h4 { margin: 0 0 6px; font-size: 15px; }
.ergebnis p { margin: 0 0 12px; color: var(--nebel); font-size: 14px; }
.ergebnis__knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }

.ergebnis--fehler { border-left-color: var(--rot); }
.ergebnis--fehler h4 { color: var(--rot); }

a.knopf { text-decoration: none; display: inline-block; }

/* -------------------------------------------------------- Letzte Änderungen */

.letzte {
  border-top: 1px solid var(--graphit);
  padding: 14px 16px;
  max-height: 30vh;
  overflow-y: auto;
}

.letzte h3 { font-size: 13px; color: var(--nebel); margin: 0 0 10px; font-weight: 500; }

.letzte__zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--graphit);
  font-size: 14px;
}

.letzte__zeile:last-child { border-bottom: none; }
.letzte__zeit { color: var(--nebel); font-size: 12px; display: block; }

/* --------------------------------------------------------------- Eingabe */

.eingabe {
  border-top: 1px solid var(--graphit);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--void);
}

.eingabe__zeile { display: flex; align-items: flex-end; gap: 10px; }
.eingabe textarea { max-height: 40vh; }

.eingabe__fuss {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--nebel);
  text-align: center;
}

.bilder { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.bilder__eintrag { position: relative; }
.bilder__eintrag img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }

.bilder__weg {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--rot);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 520px) {
  .blase { max-width: 94%; }
}
