/* Waggle – Design-Token
   Palette: Propolis #221a12 · Wabe dunkel #33271a · Honig #e8a020 · Wachs #f6e8c8
            Rauch #9a8f80 · Alarm #d4452c · Blatt #7a9b3a                        */

:root {
  --propolis: #221a12;
  --wabe:     #33271a;
  --wabe-hell:#40311f;
  --honig:    #e8a020;
  --wachs:    #f6e8c8;
  --rauch:    #9a8f80;
  --alarm:    #d4452c;
  --blatt:    #7a9b3a;
  --radius: 14px;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--propolis);
  color: var(--wachs);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  min-height: 100dvh;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit; font-size: 17px;
  background: var(--propolis); color: var(--wachs);
  border: 1px solid var(--wabe-hell); border-radius: 10px;
  padding: 12px; width: 100%;
}
label { display: block; margin: 10px 0 2px; color: var(--rauch); font-size: 15px; }
label input, label select, label textarea { margin-top: 4px; }

/* ---------- Buttons (handschuhtauglich) ---------- */
.btn {
  display: block; width: 100%;
  padding: 15px 18px; margin-top: 12px;
  border: none; border-radius: var(--radius);
  font-weight: 700; font-size: 17px;
}
.btn-primary { background: var(--honig); color: var(--propolis); }
.btn-primary:active { filter: brightness(.9); }
.btn-ghost {
  background: transparent; color: var(--honig);
  border: 1px solid var(--wabe-hell); border-radius: var(--radius);
  padding: 12px;
}
.btn-ghost.small { width: auto; padding: 8px 14px; font-size: 15px; margin: 0; }
.btn-danger { background: var(--alarm); color: #fff; }
button:focus-visible, .tab:focus-visible { outline: 3px solid var(--honig); outline-offset: 2px; }

/* ---------- Auth ---------- */
.auth { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; text-align: center; }
.auth-card h1 { font-size: 44px; margin: 14px 0 4px; color: var(--honig); }
.tagline { color: var(--rauch); margin-top: 0; }
.auth-card form { text-align: left; margin-top: 20px; }
.form-error { color: var(--alarm); min-height: 1.2em; margin: 8px 0 0; font-size: 15px; }

/* Sechseck-Logo */
.logo-hex, .brand-hex {
  display: inline-block;
  background: var(--honig);
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}
.logo-hex { width: 72px; height: 80px; }
.brand-hex { width: 18px; height: 20px; margin-right: 8px; vertical-align: -3px; }

/* ---------- Shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--propolis); border-bottom: 1px solid var(--wabe);
}
.brand { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--honig); }

.view { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; background: var(--wabe);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--wabe-hell);
}
.tab {
  flex: 1; padding: 10px 4px 12px;
  background: none; border: none; color: var(--rauch);
  font-size: 14px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab .tab-icon { font-size: 22px; }
.tab.active { color: var(--honig); }

/* ---------- Karten & Listen ---------- */
.card {
  background: var(--wabe); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 8px; font-size: 21px; color: var(--honig); }
.card h3 { margin: 12px 0 6px; font-size: 17px; }
.muted { color: var(--rauch); font-size: 15px; }
.task-list { list-style: none; padding: 0; margin: 8px 0 0; }
.task-list li { padding: 8px 0 8px 26px; position: relative; border-bottom: 1px solid var(--wabe-hell); }
.task-list li:last-child { border-bottom: none; }
.task-list li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 12px; height: 14px; background: var(--honig);
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}

.volk-row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; text-align: left;
  background: var(--wabe); border: none; color: var(--wachs);
  border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
}
.volk-row strong { font-size: 19px; }
.volk-row .chev { color: var(--honig); font-size: 22px; }

.entry { border-left: 3px solid var(--honig); padding: 4px 0 4px 12px; margin: 12px 0; }
.entry.warn { border-left-color: var(--alarm); }
.entry-head { font-size: 14px; color: var(--rauch); }
.badge {
  display: inline-block; font-size: 13px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px;
  background: var(--wabe-hell); color: var(--wachs);
}
.badge.durchsicht { background: var(--honig); color: var(--propolis); }
.badge.fuetterung { background: var(--blatt); color: var(--propolis); }
.badge.behandlung { background: var(--alarm); color: #fff; }
.kv { margin: 6px 0 0; font-size: 15px; }
.kv span { color: var(--rauch); }
.warn-text { color: #ff9b8a; }
.tip-text  { color: #b9d18a; }

/* ---------- Overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(15, 11, 7, .92);
  overflow-y: auto;
}
.overlay-inner { max-width: 640px; margin: 0 auto; padding: 20px 16px 40px; }
.overlay-inner h2 { color: var(--honig); }

/* Signatur: Waben-Aufnahmeknopf */
.hex-record {
  width: 150px; height: 168px; margin: 22px auto;
  display: grid; place-items: center;
  background: var(--honig); color: var(--propolis);
  border: none; font-size: 46px;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}
.hex-record.recording { animation: pulse 1.3s ease-in-out infinite; background: var(--alarm); color: #fff; }
@keyframes pulse { 50% { transform: scale(1.06); filter: brightness(1.12); } }
@media (prefers-reduced-motion: reduce) { .hex-record.recording { animation: none; } }
.record-hint { text-align: center; color: var(--rauch); margin-top: -8px; }

/* ---------- Mentor-Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bubble { max-width: 88%; padding: 12px 14px; border-radius: var(--radius); white-space: pre-wrap; }
.bubble.user { align-self: flex-end; background: var(--honig); color: var(--propolis); border-bottom-right-radius: 4px; }
.bubble.ki   { align-self: flex-start; background: var(--wabe); border-bottom-left-radius: 4px; }
.bubble img  { max-width: 100%; border-radius: 8px; display: block; margin-top: 6px; }
.bubble.thinking { color: var(--rauch); font-style: italic; }

.mentor-controls { display: flex; gap: 10px; align-items: center; }
.mic-btn {
  flex: 1; padding: 16px; border: none; border-radius: var(--radius);
  background: var(--honig); color: var(--propolis); font-weight: 700; font-size: 17px;
}
.mic-btn.recording { background: var(--alarm); color: #fff; animation: pulse 1.3s infinite; }
.icon-btn {
  width: 58px; height: 58px; flex: none;
  border-radius: var(--radius); border: 1px solid var(--wabe-hell);
  background: var(--wabe); color: var(--wachs); font-size: 24px;
}
.mentor-text { display: flex; gap: 8px; margin-top: 10px; }
.mentor-text input { flex: 1; }
.mentor-text button { width: 58px; flex: none; border: none; border-radius: 10px; background: var(--honig); color: var(--propolis); font-size: 20px; }

.photo-preview { position: relative; display: inline-block; margin-top: 8px; }
.photo-preview img { height: 74px; border-radius: 8px; display: block; }
.photo-preview button {
  position: absolute; top: -8px; right: -8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--alarm); color: #fff; font-size: 14px; line-height: 1;
}

.transcript-box { min-height: 110px; margin-top: 8px; }
.center { text-align: center; }
.spacer { height: 8px; }

code {
  background: var(--propolis); border: 1px solid var(--wabe-hell);
  border-radius: 6px; padding: 1px 6px; font-size: 14px; word-break: break-all;
}

/* Install-Hinweis */
.install-banner {
  position: fixed; left: 12px; right: 12px; z-index: 30;
  bottom: calc(64px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--honig); color: var(--propolis);
  border-radius: var(--radius); padding: 12px 14px;
  font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.install-actions { display: flex; gap: 8px; flex: none; }
.install-banner button {
  border: none; border-radius: 8px; padding: 8px 12px;
  background: var(--propolis); color: var(--wachs); font-weight: 700;
}

/* Benutzerverwaltung */
.user-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--wabe-hell);
}
.user-row:last-child { border-bottom: none; }
.user-row select { width: auto; }

.bubble.note {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--blatt);
  color: #b9d18a;
  font-size: 15px;
}

/* Ruhiges Live-Transkript beim Sprechen (der Knopf bleibt ruhig) */
.live-text {
  max-height: 96px; overflow-y: auto;
  background: var(--wabe); border: 1px dashed var(--wabe-hell);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px;
  color: var(--rauch); font-size: 15px; line-height: 1.4;
}
