/* BienenNavigator V10.0 – modernes Frontend, offlinefaehig (nur System-Fonts)
   Konzept: warme Honig-Identitaet, dunkle "Beuten"-Sidebar zur klaren
   Bereichstrennung, violette KI-Aktionen mit ✦-Kennung, mobile-first Details. */

:root {
  /* Flaechen */
  --bg:        #f4f0e6;
  --panel:     #ffffff;
  --panel-2:   #faf7ef;
  --line:      #e5ddcb;
  --line-soft: #efe9da;

  /* Text */
  --ink:       #2a2318;
  --ink-soft:  #6f6553;
  --ink-faint: #9a8f7b;

  /* Honig (Primaeraktion) */
  --honey:     #e3a723;
  --honey-hi:  #f2bc3d;
  --honey-dk:  #8f6a10;
  --honey-ink: #3d2d05;
  --honey-bg:  #faf1d8;

  /* KI (deutlich abgesetzt: Violett) */
  --ki:        #6d4fd6;
  --ki-hi:     #8467e6;
  --ki-dk:     #563bb4;
  --ki-bg:     #f1edfc;
  --ki-ink:    #4a2fae;

  /* Sidebar ("Beuteninneres") */
  --side-bg:    #221b10;
  --side-bg-2:  #2c2315;
  --side-ink:   #d8cdb6;
  --side-faint: #9b8e73;

  /* Status */
  --propolis:  #55693f;
  --ok-bg:     #ecf2e2;
  --ok-line:   #d6e2c2;
  --warn-bg:   #fbece2;
  --warn-ink:  #a4552a;
  --warn-line: #f0d3bf;

  --radius:    14px;
  --radius-s:  10px;
  --shadow:    0 1px 2px rgba(42,35,24,.05), 0 8px 24px rgba(42,35,24,.06);
  --shadow-lg: 0 24px 70px rgba(28,22,12,.30);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(227,167,35,.10), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app { display: flex; min-height: 100vh; }

/* Fokus-Sichtbarkeit (Tastatur) */
:focus-visible {
  outline: 2px solid var(--ki);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------- Sidebar ------ */
.sidebar {
  width: 244px;
  flex-shrink: 0;
  color: var(--side-ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.045' stroke-width='1.4'%3E%3Cpath d='M28 8 52 22v28L28 64 4 50V22z'/%3E%3Cpath d='M28 56 52 70v28L28 112 4 98V70z'/%3E%3Cpath d='M0 32 24 46v28L0 88'/%3E%3Cpath d='M56 32 32 46v28l24 14'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--side-bg-2), var(--side-bg) 42%);
  background-color: var(--side-bg);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark {
  color: var(--honey-hi);
  display: flex;
  filter: drop-shadow(0 0 10px rgba(242,188,61,.35));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; color: #f4ecda; }
.brand-tag { font-size: 11.5px; color: var(--side-faint); }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.nav-spacer { flex: 1; }

/* --------------------------------------------- V10: Bereichs-Tabs -------- */
.bereich-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.bereich-tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.bereich-tab:hover { border-color: var(--honey); color: var(--ink); }
.bereich-tab.active {
  background: var(--honey-bg);
  border-color: var(--honey);
  color: var(--honey-ink);
}

/* --------------------------------------------- V10: Schnellstart --------- */
.schnellstart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.ss-karte {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s, box-shadow .12s;
  font-family: inherit;
  color: var(--ink);
}
.ss-karte:hover {
  transform: translateY(-2px);
  border-color: var(--honey);
}
.ss-ico { font-size: 22px; line-height: 1; }
.ss-titel { font-weight: 700; font-size: 15px; }
.ss-sub { font-size: 12.5px; color: var(--ink-faint); line-height: 1.35; }

/* --------------------------------------------- V10: Nächste Schritte ----- */
.naechste-schritte {
  margin-top: 16px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.ns-titel { font-weight: 700; margin-bottom: 8px; color: var(--propolis); }
.ns-hinweise {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 12px; font-size: 14px; color: var(--ink-soft);
}
.ns-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--side-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.nav-item .nav-ico {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  filter: grayscale(.35) brightness(1.05);
  transition: filter .14s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item:hover .nav-ico { filter: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(242,188,61,.20), rgba(242,188,61,.08));
  color: var(--honey-hi);
  font-weight: 650;
  box-shadow: inset 2.5px 0 0 var(--honey);
}
.nav-item.active .nav-ico { filter: none; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 0; }
.ki-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #d9cffa;
  background: rgba(109,79,214,.28);
  border: 1px solid rgba(132,103,230,.45);
  padding: 5px 11px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ki-badge::before { content: "✦"; font-size: 10px; color: var(--ki-hi); }

/* ---------------------------------------------------------- Content ------ */
.content { flex: 1; padding: 36px 48px 60px; max-width: 1140px; min-width: 0; }
.view.hidden { display: none; }

.page-head { margin-bottom: 26px; }
.page-title { font-size: 27px; font-weight: 750; letter-spacing: -.025em; margin: 0; }
.page-sub { color: var(--ink-soft); margin: 5px 0 0; font-size: 14px; max-width: 68ch; }

/* Raster */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.checkliste { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 14px;
       color: var(--ink-soft); cursor: pointer; padding: 4px 0; }
.chk input { width: 17px; height: 17px; accent-color: var(--honey-dk); flex-shrink: 0; }

/* Karten */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card.stat {
  position: relative;
  overflow: hidden;
  padding-top: 22px;
}
.card.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--honey-hi), var(--honey) 55%, transparent);
  opacity: .85;
}
.stat .stat-num { font-size: 32px; font-weight: 750; letter-spacing: -.025em; line-height: 1.1; }
.stat .stat-lbl { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.stat .stat-num.honey { color: var(--honey-dk); }

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  margin: 32px 0 13px;
  font-weight: 700;
}
.section-title::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--honey);
  flex-shrink: 0;
}

/* Wetterkarte */
.wetter-heute { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.wetter-icon-gross { font-size: 38px; line-height: 1; }
.wetter-temp { font-size: 34px; font-weight: 750; letter-spacing: -.02em; color: var(--honey-dk); }
.wetter-text { color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.wetter-tage { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: stretch; }
.wetter-tag {
  border: 1px solid var(--line-soft); border-radius: var(--radius-s); padding: 12px 8px;
  text-align: center; background: var(--panel-2);
  display: flex; flex-direction: column; align-items: center;
  min-height: 128px;
  transition: border-color .14s;
}
.wetter-tag:hover { border-color: var(--honey); }
.wetter-tag-name { font-weight: 650; font-size: 12.5px; text-transform: capitalize; white-space: nowrap; }
.wetter-tag-icon { font-size: 24px; margin: 5px 0 3px; line-height: 1; }
.wetter-tag-temp { font-size: 14px; margin: 0 0 4px; }
.wetter-tag-info { font-size: 11px; line-height: 1.3; min-height: 28px; display: flex; align-items: center; }
.pill-platzhalter { display: block; height: 20px; margin-top: 4px; }

/* Kalender */
.wochenmuster-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft);
  border-radius: 20px; padding: 7px 15px; font: inherit; font-size: 13px;
  font-weight: 500; cursor: pointer; transition: background .12s, border-color .12s;
}
.chip:hover { border-color: var(--honey); }
.chip-aktiv {
  background: var(--honey); border-color: var(--honey);
  color: var(--honey-ink); font-weight: 650;
}
#kalender-grid { width: 100%; }
.kalender-kopf {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-bottom: 10px; font-size: 15px; font-weight: 600;
}
.kalender-wochentage {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--ink-faint); margin-bottom: 4px; letter-spacing: .03em;
}
.kalender-tage { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.kalender-tag, .kalender-tag-leer {
  height: 36px; border-radius: 8px; border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: inherit; font-size: 11.5px; cursor: pointer; position: relative; background: none;
  color: var(--ink-faint);
  transition: transform .1s, font-size .12s;
}
.kalender-tag:hover { transform: scale(1.08); }
.kalender-tag-leer { visibility: hidden; }
.tag-verfuegbar { background: var(--panel-2); }
.tag-gesperrt { background: transparent; color: var(--ink-faint); opacity: .55; }
.tag-ausnahme { border: 1.5px dashed var(--honey-dk); }
.tag-heute { box-shadow: inset 0 0 0 2px var(--honey); }
.tag-ausgewaehlt { box-shadow: inset 0 0 0 2px var(--ink); }
.kalender-tag-nr { line-height: 1; }
/* Tage MIT Aufgaben deutlich praesenter statt nur ein kleiner Punkt: groesser,
   fett, honigfarben hervorgehoben – Tage ohne Eintrag treten bewusst zurueck. */
.kalender-tag.hat-aufgabe {
  background: var(--honey-bg);
  color: var(--honey-ink);
  font-weight: 750;
  font-size: 14px;
  transform: scale(1.05);
  box-shadow: 0 1px 4px rgba(143,106,16,.18);
}
.kalender-tag.hat-aufgabe:hover { transform: scale(1.12); }
.kalender-tag-punkt {
  width: 4px; height: 4px; border-radius: 50%; background: var(--honey-dk); margin-top: 2px;
}
.kalender-tag-punkt-rot {
  position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #c0392b; box-shadow: 0 0 0 1.5px var(--panel, #fff);
}

/* Balkendiagramme (Forschung) */
.balken-chart {
  display: flex; align-items: flex-end; gap: 10px; height: 150px;
  overflow-x: auto; padding-top: 18px;
}
.balken-spalte {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  flex: 1; min-width: 34px; height: 100%;
}
.balken-wert { font-size: 11px; color: var(--ink-soft); margin-bottom: 3px; white-space: nowrap; }
.balken {
  width: 70%; min-width: 14px;
  background: linear-gradient(180deg, var(--honey-hi), var(--honey));
  border-radius: 5px 5px 0 0;
}
.balken-label { font-size: 10.5px; color: var(--ink-soft); margin-top: 5px; white-space: nowrap; }

/* Listen */
.standort-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 28px 0 12px;
}
.standort-head:first-child { margin-top: 0; }
.standort-head .standort-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.005em;
  color: var(--ink);
}
.standort-head .standort-anzahl {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 3px 10px;
}
.list { display: flex; flex-direction: column; gap: 9px; }
.row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 14px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: border-color .14s, box-shadow .14s;
}
.row:hover { border-color: #d5cab2; box-shadow: var(--shadow); }
.row-main { min-width: 0; }
.row-title { font-weight: 640; }
.row-meta { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.row-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.pill {
  font-size: 11.5px;
  font-weight: 550;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-soft);
  white-space: nowrap;
}
.pill.aktiv { background: var(--ok-bg); color: var(--propolis); border-color: var(--ok-line); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.pill.storno { background: #f0ede6; color: #a39b8c; text-decoration: line-through; }

/* ---------------------------------------------------------- Buttons ------ */
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  border-radius: 10px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .13s, border-color .13s, box-shadow .13s, transform .08s;
}
.btn:hover { background: var(--panel-2); border-color: #d3c8ae; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn.primary {
  background: linear-gradient(180deg, var(--honey-hi), var(--honey));
  border-color: var(--honey);
  color: var(--honey-ink);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(143,106,16,.25), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn.primary:hover {
  background: linear-gradient(180deg, var(--honey), #d2960f);
  border-color: #c78e0e;
}

/* KI-Buttons: eigene, klar erkennbare Aktionsklasse */
.btn.ki {
  background: linear-gradient(180deg, var(--ki-hi), var(--ki));
  border-color: var(--ki);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 2px 10px rgba(109,79,214,.35), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn.ki::before { content: "✦"; font-size: 12px; opacity: .95; }
.btn.ki:hover {
  background: linear-gradient(180deg, var(--ki), var(--ki-dk));
  border-color: var(--ki-dk);
  box-shadow: 0 3px 14px rgba(109,79,214,.45);
}
.btn.ki:disabled { box-shadow: none; }

.btn.ghost { background: transparent; border-color: transparent; color: var(--honey-dk); }
.btn.ghost:hover { background: var(--honey-bg); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--warn-ink); border-color: var(--warn-line); }
.btn.danger:hover { background: var(--warn-bg); border-color: #e5bda3; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------- Formulare ---- */
.form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 640; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 14.5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  transition: border-color .13s, box-shadow .13s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #d3c8ae; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--honey);
  box-shadow: 0 0 0 3px rgba(227,167,35,.22);
}
.field textarea { resize: vertical; min-height: 90px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12.5px; color: var(--ink-soft); }

/* Durchsicht / Mikrofon */
.mic-wrap { display: flex; align-items: center; gap: 12px; }
.mic-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  font-size: 21px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  transition: background .15s, transform .1s, border-color .15s;
}
.mic-btn:hover { border-color: var(--honey); transform: scale(1.04); }
.mic-btn.recording {
  background: var(--warn-bg);
  border-color: #eabfa5;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(227,167,35,.45); }
  50%     { box-shadow: 0 0 0 10px rgba(227,167,35,0); }
}

.stockkarte { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 8px; }
.stockkarte .field label { color: var(--honey-dk); }

/* Audio-Drop-Zone (Kap. 12: Datei-Upload fuer Spracherkennung) */
.audio-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 22px 16px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-s);
  background: var(--panel-2);
  transition: border-color .15s, background .15s;
}
.audio-drop.dragover {
  border-color: var(--ki);
  background: var(--ki-bg);
}
.audio-drop-icon { font-size: 22px; line-height: 1; }
.audio-drop-text { font-size: 13.5px; color: var(--ink-soft); }

/* Warnbanner */
.banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-left: 4px solid var(--warn-ink);
  color: var(--warn-ink);
  padding: 12px 15px;
  border-radius: var(--radius-s);
  font-size: 14px;
  margin-bottom: 16px;
}
.banner strong { font-weight: 700; }

.empty {
  text-align: center;
  color: var(--ink-faint);
  padding: 44px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.4);
}

/* Tabelle Bestandsbuch */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 11px 13px;
  border-bottom: 1.5px solid var(--line);
  background: var(--panel-2);
  position: sticky; top: 0;
}
.tbl td { padding: 12px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tbody tr:hover td { background: #fdfbf4; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.storno td { color: #a9a49b; }
.tbl-wrap {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------- Modal -------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28,22,12,.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--panel);
  border-radius: 16px;
  width: 100%; max-width: 580px;
  max-height: 88vh; max-height: 88dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in .18s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 22px; }
.icon-btn {
  border: none; background: var(--panel-2); cursor: pointer;
  font-size: 15px; color: var(--ink-soft);
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%);
  background: var(--side-bg); color: #f2ead8;
  padding: 12px 22px; border-radius: 12px; font-size: 14px; font-weight: 550;
  box-shadow: 0 10px 34px rgba(0,0,0,.28); z-index: 60;
  max-width: calc(100vw - 32px);
  animation: modal-in .18s ease-out;
}
.toast.hidden { display: none; }
.toast.warn { background: var(--warn-ink); color: #fff; }

.hidden { display: none; }

/* Wiederverwendbare Lade-Animation fuer laufende KI-Aktionen */
.ki-arbeitet {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ki-ink); font-weight: 600;
}
.spinner-ki {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--ki-bg); border-top-color: var(--ki);
  animation: spinki .7s linear infinite; flex-shrink: 0;
}
@keyframes spinki { to { transform: rotate(360deg); } }

/* Transparenz: kennzeichnet Daten, die von einer externen Quelle stammen
   (z.B. Wetterdaten), statt selbst erfasst oder von der KI erzeugt zu sein. */
.quelle-tag {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--ink-faint);
  margin-top: 8px;
}
.quelle-tag::before { content: "🌐"; font-size: 10px; }

/* ------------------------------------------------------- Mobile ---------- */
@media (max-width: 860px) {
  body { font-size: 15px; }

  .app { flex-direction: column; }

  /* Sidebar wird kompakter Sticky-Header mit scrollbarer Navigation */
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 14px 0;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    box-shadow: 0 4px 18px rgba(28,22,12,.25);
  }
  .brand { padding: 0; flex: 1; min-width: 0; }
  .brand-tag { display: none; }
  .sidebar-foot { margin: 0; padding: 0; }

  .nav {
    order: 3;
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 10px 2px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 9px 13px;
    font-size: 14px;
    background: rgba(255,255,255,.06);
    border-radius: 20px;
  }
  .nav-item.active { box-shadow: inset 0 0 0 1.5px var(--honey); border-radius: 20px; }
  .nav-spacer { display: none; }

  .bereich-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bereich-tabs::-webkit-scrollbar { display: none; }
  .bereich-tab { white-space: nowrap; flex-shrink: 0; }
  .schnellstart { grid-template-columns: repeat(2, 1fr); }

  .content { padding: 20px 16px 48px; }
  .page-title { font-size: 23px; }

  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .field-row, .stockkarte, .checkliste { grid-template-columns: 1fr; }

  .wetter-tage {
    grid-template-columns: repeat(5, minmax(74px, 1fr));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Touch-Ziele & iOS-Zoom vermeiden (>=16px Eingaben) */
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn.small { min-height: 38px; }
  .icon-btn { width: 38px; height: 38px; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 11px 13px; }
  .chk input { width: 20px; height: 20px; }
  .mic-btn { width: 54px; height: 54px; }

  .toolbar { gap: 8px; }
  .toolbar .btn { flex: 1 1 auto; }

  .row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; }

  /* Modal als Bottom-Sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%;
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: sheet-in .22s ease-out;
  }
  @keyframes sheet-in {
    from { transform: translateY(24px); opacity: .6; }
    to   { transform: none; opacity: 1; }
  }
  .modal-actions { position: sticky; bottom: 0; background: var(--panel);
    padding: 12px 0 4px; margin-top: 18px; }
  .modal-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 460px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .card { padding: 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
