/* Admin chat: same palette as the site (Konzept A "Glut"), built for phones first. */
:root {
  --kohle: #1a1411;
  --asche: #2b221d;
  --asche-hell: #3a2e27;
  --glut: #f2762e;
  --funke: #ffd08a;
  --rauch: #efe7de;
  --rauch-2: #cfc2b4;
  --holz-text: #b39780;
  --rot: #ff8f7a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--kohle);
  color: var(--rauch);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--funke); }

.center { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.muted { color: var(--holz-text); }
.small { font-size: 14px; }
.error { color: var(--rot); margin: 8px 16px; }

.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-word { font-weight: 800; letter-spacing: 0.32em; font-size: 18px; }
.brand-by { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--holz-text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(239, 231, 222, 0.35);
  border-radius: 10px;
  background: transparent;
  color: var(--rauch);
  font: 600 16px/1 inherit;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--glut); border-color: var(--glut); color: var(--kohle); }
.btn-quiet { border-color: transparent; color: var(--rauch-2); }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 15px; }

.icon-btn {
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--asche);
  color: var(--rauch);
  font-size: 22px;
  cursor: pointer;
}
.icon-btn:disabled { opacity: 0.45; }
.icon-btn.recording { background: var(--rot); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 143, 122, 0.2); } }

/* login and message pages */
.card {
  max-width: 420px;
  margin: 10vh auto 0;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card h1 { margin: 12px 0 0; font-size: 26px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
label { color: var(--rauch-2); font-size: 15px; }
input[type="email"] {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--asche-hell);
  border-radius: 10px;
  background: var(--asche);
  color: var(--rauch);
  font: inherit;
}
.notice { padding: 14px; border-radius: 10px; background: var(--asche); }
.divider { text-align: center; color: var(--holz-text); font-size: 14px; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; }

.chat-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--asche);
}
.menu {
  position: absolute;
  right: 16px;
  top: calc(100% - 4px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  padding: 6px;
  border-radius: 12px;
  background: var(--asche);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.menu button {
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--rauch);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu button:hover:not(:disabled) { background: var(--asche-hell); }
.menu button:disabled { color: var(--holz-text); }

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 16px 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--asche);
}
.banner p { margin: 0 auto 0 0; }

.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.empty { margin: auto 0; color: var(--rauch-2); }
.empty ul { padding-left: 18px; }
.empty li { margin: 6px 0; font-style: italic; }

.bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; overflow-wrap: anywhere; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble-user { align-self: flex-end; background: var(--asche-hell); border-bottom-right-radius: 4px; }
.bubble-assistant { align-self: flex-start; background: var(--asche); border-bottom-left-radius: 4px; }
.thumb { display: block; max-width: 220px; max-height: 220px; margin-bottom: 8px; border-radius: 10px; }

.preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--glut);
  border-radius: 12px;
}
.preview-old { border-color: var(--asche-hell); opacity: 0.7; }
.preview-title { font-weight: 600; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-actions .btn-primary { flex: 1; }

.event { align-self: center; max-width: 92%; color: var(--rauch-2); font-size: 15px; text-align: center; }
.event-error { color: var(--rot); }

.typing { display: flex; gap: 5px; padding: 14px; align-self: flex-start; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--holz-text); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 50% { opacity: 0.25; } }

.composer { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--asche); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 160px;
  padding: 12px 14px;
  border: 1px solid var(--asche-hell);
  border-radius: 12px;
  background: var(--asche);
  color: var(--rauch);
  font: inherit;
  resize: none;
  field-sizing: content;
}
.send { flex: none; }
.pending-photos { display: flex; gap: 8px; margin-bottom: 8px; }
.pending { position: relative; padding: 0; border: 0; background: none; color: var(--rauch); font-size: 18px; }
.pending img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

@media (max-width: 420px) {
  .send { padding: 0 14px; }
  .icon-btn { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .typing span, .icon-btn.recording { animation: none; }
}
