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

:root {
  /* Helles Design – abgestimmt auf die Illustrationen */
  --propolis: #f7efdd;   /* Seitenhintergrund (Pergament) */
  --wabe:     #fffaf0;   /* Karten */
  --wabe-hell:#e6d6b4;   /* Linien und Ränder */
  --honig:    #c98212;   /* Akzent, auf Hell gut lesbar */
  --wachs:    #3d2f1c;   /* Schriftfarbe */
  --rauch:    #8a7a62;   /* Nebentext */
  --alarm:    #c0392b;
  --blatt:    #5f7f28;
  --schatten: 0 2px 10px rgba(90, 70, 40, .10);
  --radius: 14px;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

body[data-theme="dunkel"] {
  --propolis: #221a12;
  --wabe:     #33271a;
  --wabe-hell:#40311f;
  --honig:    #e8a020;
  --wachs:    #f6e8c8;
  --rauch:    #9a8f80;
  --alarm:    #d4452c;
  --blatt:    #7a9b3a;
  --schatten: 0 2px 10px rgba(0, 0, 0, .35);
}

* { 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(--wabe); color: var(--wachs);
  border: 1px solid var(--wabe-hell); border-radius: 10px;
  padding: 12px; width: 100%;
}
body[data-theme="dunkel"] input,
body[data-theme="dunkel"] textarea,
body[data-theme="dunkel"] select { background: var(--propolis); }
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: #fffaf0; }
body[data-theme="dunkel"] .btn-primary { 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; }
.logo-bild { width: 108px; height: 108px; object-fit: contain; }
.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: 25;
  display: flex; background: var(--wabe);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--wabe-hell);
  box-shadow: 0 -2px 12px rgba(90, 70, 40, .10);
}
.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 img.tab-icon {
  width: 30px; height: 30px; object-fit: contain;
  filter: grayscale(.5) opacity(.6);
  transition: filter .15s ease, transform .15s ease;
}
.tab.active img.tab-icon { filter: none; transform: scale(1.08); }
.tab.active { color: var(--honig); }

/* ---------- Karten & Listen ---------- */
.card {
  background: var(--wabe); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
  border: 1px solid var(--wabe-hell);
  box-shadow: var(--schatten);
}
body[data-theme="dunkel"] .card { border-color: transparent; }
.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: var(--alarm); }
.tip-text  { color: var(--blatt); }
body[data-theme="dunkel"] .warn-text { color: #ff9b8a; }
body[data-theme="dunkel"] .tip-text  { color: #b9d18a; }

/* ---------- Overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  background: var(--propolis);
  overflow-y: auto;
  /* Platz für die Navigationsleiste, damit sie sichtbar bleibt */
  bottom: calc(64px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { .overlay { bottom: 0; } }
body[data-theme="dunkel"] .overlay { background: rgba(15, 11, 7, .96); }
.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: #fffaf0;
  border-bottom-right-radius: 4px;
}
body[data-theme="dunkel"] .bubble.user { color: var(--propolis); }
.bubble.ki {
  align-self: flex-start; background: var(--wabe);
  border: 1px solid var(--wabe-hell); border-bottom-left-radius: 4px;
}
body[data-theme="dunkel"] .bubble.ki { border-color: transparent; }
.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;
}

/* Auswahl: Kamera oder Mediathek */
.media-sheet {
  position: fixed; left: 12px; right: 12px; z-index: 40;
  bottom: calc(20px + env(safe-area-inset-bottom));
  background: var(--wabe); border: 1px solid var(--wabe-hell);
  border-radius: var(--radius); padding: 10px;
  box-shadow: 0 10px 34px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 8px;
}
.media-sheet button {
  padding: 16px; border: none; border-radius: 10px;
  background: var(--honig); color: var(--propolis);
  font-weight: 700; font-size: 16px; text-align: left;
}
.media-sheet .ms-cancel {
  background: transparent; color: var(--rauch);
  border: 1px solid var(--wabe-hell); text-align: center; font-weight: 400;
}

.icon-btn.icon-klein { width: 46px; height: 58px; font-size: 19px; opacity: .85; }

/* Wissenssammlung */
.qa .qa-frage { font-weight: 700; color: var(--honig); margin-bottom: 6px; }
.qa .qa-antwort {
  max-height: 4.4em; overflow: hidden; position: relative;
  cursor: pointer; white-space: pre-wrap;
}
.qa .qa-antwort::after {
  content: "… mehr"; position: absolute; right: 0; bottom: 0;
  background: var(--wabe); color: var(--rauch); padding-left: 8px; font-size: 14px;
}
.qa .qa-antwort.offen { max-height: none; }
.qa .qa-antwort.offen::after { content: ""; }
.qa .qa-fuss {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.qa .qa-fuss button { margin-left: 4px; }

/* Wischen für Bearbeiten/Löschen */
.swipe-karte { position: relative; overflow: hidden; padding: 0; }
.swipe-karte .swipe-inhalt {
  position: relative; z-index: 2;
  background: var(--wabe); padding: 16px;
  will-change: transform;
}
.swipe-karte.entry .swipe-inhalt { border-left: 3px solid var(--honig); }
.swipe-karte.entry.warn .swipe-inhalt { border-left-color: var(--alarm); }
.swipe-actions {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: stretch;
}
.swipe-actions button {
  width: 70px; border: none; font-size: 22px;
  background: var(--wabe-hell); color: var(--wachs);
}
.swipe-karte .swipe-inhalt { border-radius: var(--radius); }
.swipe-actions .sw-del, .swipe-actions .w-del { background: var(--alarm); color: #fff; }
.swipe-hinweis { color: var(--rauch); font-size: 14px; margin: 4px 4px 10px; }

/* Wettervorhersage */
.wetter-leiste {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 4px 0 6px; -webkit-overflow-scrolling: touch;
}
.wtag {
  flex: none; width: 58px; text-align: center;
  background: var(--propolis); border: 1px solid var(--wabe-hell);
  box-shadow: var(--schatten);
  border-radius: 10px; padding: 8px 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.wtag.heiss { border-color: var(--alarm); }
.wtag-tag { font-size: 13px; color: var(--rauch); }
.wtag-sym { font-size: 18px; }
.wtag-max { font-weight: 700; color: var(--honig); }
.wtag.heiss .wtag-max { color: var(--alarm); }
.wtag-min { font-size: 13px; color: var(--rauch); }
.wtag-regen { font-size: 12px; color: #8fb8d8; }

.zwei-spalten { display: flex; gap: 10px; }
.zwei-spalten label { flex: 1; }

/* Kleine Werkzeuge in den Chat-Blasen */
.bubble { position: relative; padding-bottom: 22px; }
.bubble-tool {
  position: absolute; right: 6px; bottom: 2px;
  background: none; border: none; padding: 2px 4px;
  font-size: 13px; opacity: .45; line-height: 1;
}
.bubble-tool:active, .bubble-tool:hover { opacity: 1; }
.bubble.note, .bubble.thinking { padding-bottom: 12px; }
.bubble.fehler { border: 1px solid var(--alarm); padding-bottom: 12px; }
input[type=range] { accent-color: var(--honig); }

/* Eingebaute Kamera */
.kamera {
  position: fixed; inset: 0; z-index: 60;
  background: #000; display: flex; flex-direction: column;
}
.kamera video { flex: 1; width: 100%; object-fit: cover; }
.kam-kopf {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(rgba(0,0,0,.55), transparent);
}
.kam-text {
  background: none; border: none; color: #fff;
  font-size: 16px; font-weight: 700; padding: 8px 10px;
}
.kam-text.kam-ok { color: var(--honig); }
.kam-zahl { color: #fff; font-size: 15px; }
.kam-leiste {
  display: flex; align-items: center; justify-content: space-around;
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
  background: #000;
}
.kam-ausloeser {
  width: 74px; height: 74px; border-radius: 50%;
  background: #fff; border: 5px solid rgba(255,255,255,.35);
}
.kam-ausloeser:active { transform: scale(.92); }
.kam-neben {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 22px;
}
.kam-galerie {
  position: absolute; left: 0; right: 0; bottom: calc(112px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px;
}
.kam-mini { position: relative; flex: none; }
.kam-mini img { height: 60px; border-radius: 8px; display: block; }
.kam-mini button {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: var(--alarm); color: #fff; font-size: 12px; line-height: 1;
}

/* Vorschau mehrerer Bilder */
.vorschau-reihe { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.vorschau-reihe .photo-preview { flex: none; }

/* Wischbare Listenzeilen (Völker, Stände) */
.zeile-karte { background: transparent; margin-bottom: 10px; }
.zeile-karte .swipe-inhalt { padding: 0; background: transparent; }
.zeile-karte .volk-row { margin-bottom: 0; width: 100%; }
.zeile-karte .swipe-actions button { border-radius: 0 var(--radius) var(--radius) 0; }

/* Wissen in Kurzform */
.qa.kompakt .swipe-inhalt { padding: 0; }
.qa-kopf {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 14px 16px;
  background: none; border: none; color: var(--wachs);
}
.qa-kopf .qa-frage { font-weight: 700; color: var(--honig); font-size: 16px; }
.qa-pfeil { color: var(--rauch); flex: none; }
.qa-body { padding: 0 16px 14px; }
.qa.kompakt .qa-antwort { max-height: none; white-space: pre-wrap; }
.qa.kompakt .qa-antwort::after { content: ""; }

/* Anstehende Aufgaben */
.aufgabe {
  border-left: 3px solid var(--rauch);
  padding: 10px 0 10px 12px; margin: 12px 0;
}
.aufgabe.hoch   { border-left-color: var(--alarm); }
.aufgabe.mittel { border-left-color: var(--honig); }
.aufgabe-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.aufgabe-kopf strong { font-size: 16px; }
.aufgabe-wann { color: var(--honig); font-size: 15px; margin: 4px 0 2px; }
.aufgabe .muted { font-size: 14px; }

/* Bienenjahr-Kalender */
.monat { border-bottom: 1px solid var(--wabe-hell); }
.monat:last-child { border-bottom: none; }
.monat-kopf {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 12px 0;
  background: none; border: none; color: var(--wachs); font-size: 15px;
}
.monat.jetzt .monat-kopf strong { color: var(--honig); }
.monat-body { margin: 0 0 10px; }

/* Anklickbare Themen */
.thema-link {
  background: none; border: none; padding: 0; text-align: left;
  color: var(--wachs); font: inherit;
  border-bottom: 1px dotted var(--rauch);
}
.thema-link.stark { color: var(--wachs); border-bottom: none; font-weight: 700; }
.thema-link:active { color: var(--honig); }

/* Erklärungstext */
.erklaerung h3 {
  color: var(--honig); font-size: 16px; margin: 16px 0 6px;
  font-family: var(--font-display);
}
.erklaerung h3:first-child { margin-top: 4px; }
.erklaerung p { margin: 4px 0; }
.erk-punkt { padding: 5px 0 5px 20px; position: relative; }
.erk-punkt::before {
  content: ""; position: absolute; left: 2px; top: 11px;
  width: 9px; height: 11px; background: var(--honig);
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}

/* Varroa-Monitoring */
.varroa-aktuell { font-size: 18px; margin: 4px 0; }
.varroa-kurve {
  display: flex; align-items: flex-end; gap: 6px;
  height: 96px; margin: 12px 0 6px; overflow-x: auto; padding-bottom: 4px;
}
.vbalken { flex: none; width: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.vbalken span { display: block; width: 18px; border-radius: 4px 4px 0 0; }
.vbalken em { font-style: normal; font-size: 11px; color: var(--rauch); margin-top: 4px; }
.varroa-liste { margin-top: 8px; }
.varroa-zeile {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--wabe-hell); font-size: 14px;
}
.varroa-zeile:last-child { border-bottom: none; }

/* Fotogalerie */
.foto-galerie { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.foto-mini { position: relative; width: 88px; }
.foto-mini img {
  width: 88px; height: 88px; object-fit: cover;
  border-radius: 10px; display: block; background: var(--propolis);
}
.foto-mini span {
  position: absolute; bottom: 4px; right: 5px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; padding: 1px 5px; border-radius: 5px;
}

/* Offline-Hinweis */
.offline-leiste {
  position: fixed; left: 12px; right: 12px; z-index: 35;
  bottom: calc(64px + env(safe-area-inset-bottom));
  background: var(--wabe-hell); color: var(--wachs);
  border: 1px solid var(--honig); border-radius: var(--radius);
  padding: 10px 14px; font-size: 14px; text-align: center;
}

/* Kalender-Anleitungen */
.anleitung-wahl { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.anleitung-wahl button { text-align: left; }
.kal-schritt {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--wabe-hell);
}
.kal-schritt:last-of-type { border-bottom: none; }
.kal-schritt span {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--honig); color: var(--propolis);
  font-weight: 700; font-size: 14px; text-align: center; line-height: 24px;
}

/* ===== Größere Bildschirme: mehr Platz nutzen ===== */
@media (min-width: 900px) {
  body { font-size: 16px; }

  .topbar {
    padding: 14px 32px;
    border-bottom: 1px solid var(--wabe);
  }
  .brand { font-size: 26px; }

  /* Navigation wandert nach oben und wird zur Leiste */
  .tabbar {
    position: sticky; top: 0; bottom: auto;
    border-top: none; border-bottom: 1px solid var(--wabe-hell);
    justify-content: center; gap: 8px; padding: 6px 24px;
  }
  .tab {
    flex: 0 0 auto; flex-direction: row; gap: 8px;
    padding: 10px 20px; border-radius: 999px; font-size: 15px;
  }
  .tab.active { background: var(--wabe-hell); }
  .tab img.tab-icon { width: 26px; height: 26px; }

  .view {
    max-width: 1160px;
    padding: 24px 32px 48px;
    column-count: 2; column-gap: 22px;
  }
  /* Karten nicht über den Spaltenumbruch zerreißen */
  .view > .card {
    break-inside: avoid; page-break-inside: avoid;
    display: inline-block; width: 100%; margin-bottom: 22px;
  }
  .card { padding: 22px 24px; }
  .card h2 { font-size: 23px; }

  /* Einspaltige Bereiche, die von Breite nicht profitieren */
  .view.einspaltig { column-count: 1; max-width: 820px; }

  .chat { max-width: 820px; }
  .bubble { max-width: 74%; }
  .mentor-controls, .mentor-text, .live-text { max-width: 820px; }

  .install-banner, .offline-leiste { left: auto; right: 24px; width: 380px; }
  .overlay-inner { max-width: 780px; padding: 32px; }

  .foto-mini, .foto-mini img { width: 108px; }
  .foto-mini img { height: 108px; }
  .wtag { width: 66px; }
}

@media (min-width: 1400px) {
  .view { max-width: 1400px; column-count: 3; }
}

/* Zeigefinger-Bedienung nur am Touchgerät nötig */
@media (min-width: 900px) and (hover: hover) {
  .volk-row:hover, .btn-ghost:hover { filter: brightness(1.12); }
  .swipe-hinweis::after { content: " (am Rechner: Doppelklick)"; }
}

.aufgabe.geplant { border-left-color: var(--rauch); opacity: .92; }
.aufgabe.geplant .aufgabe-wann { color: var(--rauch); }

/* Kopfbereich mit Illustration */
.kopf-mit-bild { display: flex; gap: 16px; align-items: center; }
.kopf-mit-bild .kopf-bild {
  width: 92px; height: auto; flex: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}
.kopf-mit-bild h2 { margin-top: 0; }
@media (min-width: 900px) {
  .kopf-mit-bild .kopf-bild { width: 120px; }
}

/* Verhindert kurzes Aufblitzen des hellen Designs beim Start */
html[data-vorab="dunkel"] body {
  --propolis: #221a12; --wabe: #33271a; --wabe-hell: #40311f;
  --honig: #e8a020; --wachs: #f6e8c8; --rauch: #9a8f80;
  --alarm: #d4452c; --blatt: #7a9b3a;
}

/* Aufgabenkarten mit Symbol */
.aufgabe { display: flex; gap: 12px; align-items: flex-start; }
.aufgabe-bild {
  width: 46px; height: 46px; object-fit: contain; flex: none;
  margin-top: 2px;
}
.aufgabe-inhalt { flex: 1; min-width: 0; }
.volk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.volk-chips .badge { margin-left: 0; }

/* Kopfbild rechts */
.kopf-bild-rechts { margin-left: auto; opacity: .95; }
.kopf-mit-bild { justify-content: space-between; }
@media (max-width: 420px) {
  .kopf-bild-rechts { width: 74px; }
  .aufgabe-bild { width: 38px; height: 38px; }
}

.titel-icon {
  width: 30px; height: 30px; object-fit: contain;
  vertical-align: -7px; margin-right: 8px;
}

/* Wettersymbole als Bild */
.wtag-bild { width: 40px; height: 40px; object-fit: contain; margin: 2px auto; display: block; }

/* Monatsmotive im Bienenjahr */
.monat-bild {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  object-fit: cover; margin-right: 10px;
  box-shadow: var(--schatten);
}
.monat-kopf { align-items: center; }
.monat.jetzt .monat-bild { outline: 2px solid var(--honig); outline-offset: 1px; }

/* Dekostreifen über den Bereichen */
.deko-streifen {
  width: 100%; height: 120px; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 14px;
  box-shadow: var(--schatten);
}
@media (min-width: 900px) {
  .deko-streifen { height: 170px; }
}

/* Mikrofonsymbol im Sprechknopf */
.mic-bild { width: 26px; height: 26px; object-fit: contain; vertical-align: -7px; margin-right: 8px; }

/* Leerer Zustand */
.leer-hinweis { text-align: center; padding: 6px 0; }
.leer-hinweis img { width: 100%; max-width: 320px; opacity: .8; border-radius: var(--radius); }

/* Symbolbilder in Knöpfen und Überschriften */
.btn-icon { width: 24px; height: 24px; object-fit: contain; vertical-align: -6px; margin-right: 8px; }
.knopf-bild { width: 30px; height: 30px; object-fit: contain; vertical-align: -8px; }
.knopf-bild-klein { width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; margin-right: 6px; }
.bubble-icon { width: 18px; height: 18px; object-fit: contain; }
.swipe-icon { width: 30px; height: 30px; object-fit: contain; }
.icon-btn .knopf-bild { width: 30px; height: 30px; }
.bubble-tool { opacity: .5; }
.label-icon { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; margin-right: 6px; }

/* Dateiauswahl: eigener Knopf statt des uneinheitlichen Standardfeldes */
.datei-versteckt {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.datei-name {
  margin: 6px 0 10px; padding: 10px 12px;
  border: 1px dashed var(--wabe-hell); border-radius: 10px;
  font-size: 15px; text-align: center;
}
.datei-name.gewaehlt {
  border-style: solid; border-color: var(--honig);
  color: var(--wachs); font-weight: 700;
}
.btn:disabled { opacity: .45; }
.inline-icon { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; margin-right: 4px; }

/* Während der Aufnahme: deutliche Kennzeichnung */
body.nimmt-auf .mic-btn { box-shadow: 0 0 0 3px rgba(212, 69, 44, .35); }
.mic-btn.fortsetzen { background: var(--blatt); color: #fffaf0; }

/* Futterbilanz */
.futter-balken {
  height: 14px; background: var(--propolis);
  border: 1px solid var(--wabe-hell); border-radius: 999px;
  overflow: hidden; margin: 8px 0;
}
.futter-balken span { display: block; height: 100%; border-radius: 999px; transition: width .3s ease; }

/* Honigraum-Steuerung */
.hr-steuerung { display: flex; gap: 8px; margin: 10px 0; }
.hr-steuerung button { flex: 1; }

/* Jahresplan */
.planpunkt {
  padding: 10px 0 10px 12px; margin: 10px 0;
  border-left: 3px solid var(--wabe-hell);
}
.planpunkt.jetzt { border-left-color: var(--honig); }
.planpunkt-kopf {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.planpunkt .muted { font-size: 14px; margin: 2px 0; }
.planpunkt em { color: var(--honig); font-style: normal; font-weight: 700; }

/* Ziehen zum Aktualisieren */
.zieh-anzeige {
  position: fixed; top: 0; left: 50%; z-index: 40;
  transform: translateX(-50%);
  margin-left: -90px;
  background: var(--wabe); color: var(--wachs);
  border: 1px solid var(--wabe-hell); border-radius: 999px;
  padding: 8px 18px; font-size: 14px;
  box-shadow: var(--schatten);
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.zieh-anzeige.sichtbar { opacity: 1; }

/* Dezenter Futterstand in der Völkerliste */
.futter-mini { display: block; margin-top: 6px; }
.futter-mini-balken {
  display: block; height: 5px; border-radius: 999px;
  background: var(--wabe-hell); overflow: hidden; max-width: 220px;
}
.futter-mini-balken i {
  display: block; height: 100%; background: var(--honig);
  border-radius: 999px;
}
.futter-mini-text {
  display: block; font-size: 12px; color: var(--rauch); margin-top: 3px;
}

/* Kurze Hervorhebung der Volk-Auswahl nach Gesprächswechsel */
select.hervor {
  outline: 2px solid var(--honig); outline-offset: 2px;
  transition: outline-color .3s ease;
}

/* Mitgliederverwaltung */
.mitglied-zeile {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--wabe-hell);
  flex-wrap: wrap;
}
.mitglied-zeile:last-child { border-bottom: none; }
.mitglied-zeile > span:first-child { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
.mitglied-rechte {
  display: flex; align-items: center; gap: 8px;
  flex: 1 1 100%; margin-top: 6px;
}
.mitglied-rechte select { flex: 1; min-width: 0; padding: 8px; font-size: 14px; }
.mitglied-rechte .im-weg { flex: none; }

/* Ab Tablet passt beides nebeneinander */
@media (min-width: 620px) {
  .mitglied-zeile > span:first-child { flex: 1 1 auto; }
  .mitglied-rechte { flex: 0 0 auto; margin-top: 0; }
  .mitglied-rechte select { flex: none; width: auto; }
}

/* Systemprüfung */
.sys-liste { margin: 10px 0; }
.sys-zeile {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--wabe-hell);
  font-size: 14px;
}
.sys-zeile:last-child { border-bottom: none; }
.sys-zeichen { flex: none; }
.sys-zeile.fehler strong { color: var(--alarm); }
.sys-zeile.warnung strong { color: var(--honig); }

.cron-ausgabe {
  background: var(--propolis); border: 1px solid var(--wabe-hell);
  border-radius: 10px; padding: 12px; margin-top: 10px;
  font-size: 12px; white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow-y: auto; color: var(--rauch);
}
.cron-ausgabe.fehlerhaft { border-color: var(--alarm); color: var(--wachs); }

/* Lange E-Mail-Adressen und Namen dürfen nicht überlaufen */
.varroa-zeile, .user-row, .mitglied-zeile { overflow-wrap: anywhere; }
.card, .view { max-width: 100%; }
.card input, .card select, .card textarea { max-width: 100%; }

/* Kompakte Statuszeile (z. B. Benachrichtigungen, wenn alles läuft) */
.card.schmal { padding: 12px 16px; }
.zeile-kompakt {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; font-size: 15px;
}
.zeile-kompakt > span:first-child { display: flex; align-items: center; }
.muted.klein { font-size: 13px; margin: 4px 0 0; }

/* Wünsche und Fehlermeldungen */
.meldung {
  border: 1px solid var(--wabe-hell); border-radius: var(--radius);
  padding: 12px 14px; margin: 10px 0; background: var(--propolis);
}
.meldung-kopf {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; flex-wrap: wrap; margin-bottom: 4px;
}
.meldung-status { font-size: 13px; font-weight: 700; white-space: nowrap; }
.meldung-antwort {
  margin-top: 8px; padding: 8px 10px;
  background: var(--wabe); border-left: 3px solid var(--honig);
  border-radius: 6px; font-size: 14px;
}
.meld-aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.meld-aktionen button { flex: 1; min-width: 90px; }
.meld-original summary { cursor: pointer; font-size: 13px; color: var(--rauch); margin: 6px 0; }
.badge-zahl {
  display: inline-block; margin-left: 8px; min-width: 22px;
  padding: 1px 7px; border-radius: 999px;
  background: var(--alarm); color: #fff; font-size: 13px; font-weight: 700;
}
.mic-btn.recording, .btn.recording { background: var(--alarm); color: #fff; }

/* Eigene Meldungen hervorheben */
.meldung.eigene { border-left: 3px solid var(--honig); }

/* Volksnummer */
.volk-nr {
  display: inline-block; min-width: 26px; padding: 1px 8px;
  margin-right: 8px; border-radius: 999px;
  background: var(--honig); color: #fffaf0;
  font-size: 14px; font-weight: 700; text-align: center;
  vertical-align: 2px;
}
.volk-nr.gross { font-size: 17px; padding: 2px 10px; }

/* Volkauswahl mit Scan-Knopf */
.volk-wahl-zeile { display: flex; align-items: flex-end; gap: 10px; }
.scan-mini {
  flex: none; width: 52px; height: 52px;
  border: 1px solid var(--wabe-hell); border-radius: 12px;
  background: var(--wabe); display: flex; align-items: center; justify-content: center;
}
.scan-knopf { margin-bottom: 10px; }

/* Scanner */
.scan-rahmen {
  position: relative; width: 100%; max-width: 420px; margin: 10px auto;
  aspect-ratio: 4/3; background: #000;
  border-radius: var(--radius); overflow: hidden;
}
.scan-rahmen video { width: 100%; height: 100%; object-fit: cover; }
.scan-fenster {
  position: absolute; inset: 18%;
  border: 3px solid var(--honig); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
}

/* QR-Etikett */
.qr-karte { text-align: center; }
.qr-bild svg { max-width: 200px; height: auto; }
.qr-titel { font-size: 20px; font-weight: 700; margin: 8px 0 2px;
  font-family: var(--font-display); }
.qr-kennung { font-family: monospace; letter-spacing: 2px; color: var(--rauch); margin: 0; }

.qr-domain {
  font-size: 13px; color: var(--rauch); margin: 6px 0 0;
  letter-spacing: 1px; border-top: 1px solid var(--wabe-hell);
  padding-top: 8px;
}
