:root {
  --color-primary:       #8b5e3c;
  --color-primary-dark:  #7a5234;
  --color-primary-light: #f0e6dc;
  --color-bg:            #faf6f1;
  --color-card:          #ffffff;
  --color-sidebar:       #2d1b0e;
  --color-text:          #1e140a;
  --color-text-muted:    #6b5a4e;
  --color-border:        #e8ddd5;
  --color-accent:        #f5ede5;
  --sidebar-width:       240px;
}

/* ===== Base ===== */
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
}

a {
  color: var(--color-primary);
}
a:hover {
  color: var(--color-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
}

.text-muted {
  color: var(--color-text-muted) !important;
}

/* ===== Sidebar Layout ===== */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--color-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.has-sidebar .app-content {
  margin-left: var(--sidebar-width);
}

.app-content {
  min-height: 100vh;
  padding: 2rem 2.5rem;
}

@media (max-width: 767.98px) {
  .has-sidebar .app-content {
    margin-left: 0;
    padding-top: 0;
  }
  .app-content {
    padding: 1rem;
  }
}

/* ===== Sidebar Inneres ===== */
.sidebar-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand:hover {
  color: #ffffff;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}
.sidebar-nav a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-left-color: var(--color-primary);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  overflow: hidden;
}
.sidebar-user::before {
  content: attr(data-initial);
  flex: 0 0 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--color-primary, #c2410c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}
.sidebar-user-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-gear {
  flex: 0 0 auto;
  opacity: 0.5;
  font-size: 0.95rem;
  transition: opacity 0.15s, transform 0.2s;
}
.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}
.sidebar-user:hover .sidebar-user-gear {
  opacity: 1;
  transform: rotate(45deg);
}
.sidebar-logout-btn {
  width: 100%;
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.sidebar-logout-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

/* ===== Mobile Topbar ===== */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 99;
  background: var(--color-sidebar);
  padding: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}
@media (max-width: 767.98px) {
  .mobile-topbar {
    display: flex;
  }
}
.mobile-topbar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
}
.mobile-topbar-brand:hover {
  color: #ffffff;
}
.mobile-menu-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}

/* Offcanvas sidebar (mobile) */
.offcanvas.sidebar-offcanvas {
  background: var(--color-sidebar);
  width: var(--sidebar-width) !important;
}
.offcanvas.sidebar-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem;
}
.offcanvas.sidebar-offcanvas .offcanvas-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ===== Bootstrap Overrides ===== */

/* Cards */
.card {
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 8px rgba(139, 94, 60, 0.06);
  background: var(--color-card);
}

/* btn-dark → Mocha */
.btn-dark {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}
.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active {
  background-color: var(--color-primary-dark) !important;
  border-color: var(--color-primary-dark) !important;
}

/* btn-primary → Mocha (Bootstrap-Blau passte nicht zum Rest der Seite) */
.btn-primary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--color-primary-dark) !important;
  border-color: var(--color-primary-dark) !important;
}
.btn-outline-primary {
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:active {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
}

/* btn-outline-dark → Mocha outline */
.btn-outline-dark {
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}
.btn-outline-dark:hover,
.btn-outline-dark:active {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}

/* btn-secondary → Mocha (used as active-tab indicator) */
.btn-secondary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}
.btn-secondary:hover {
  background-color: var(--color-primary-dark) !important;
  border-color: var(--color-primary-dark) !important;
}

/* btn-outline-secondary → subtle warm */
.btn-outline-secondary {
  border-color: var(--color-border) !important;
  color: var(--color-text-muted) !important;
  background: transparent !important;
}
.btn-outline-secondary:hover {
  background-color: var(--color-accent) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

/* Form focus */
.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(139, 94, 60, 0.16);
}

/* Alert messages */
.messages-wrapper {
  margin-bottom: 1.5rem;
}

/* ===== Mahlplan-Grid ===== */
.meal-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  transition: background .15s;
}
.meal-row:last-child { border-bottom: none; }
.meal-row:hover { background: var(--color-accent); }

.meal-row.is-today {
  background: #fff8f2;
  border-left: 3px solid var(--color-primary);
}
.meal-row.is-today:hover { background: #fef2e6; }

.meal-row.is-yesterday {
  background: #fff8f2;
  border-left: 3px solid var(--color-primary);
}
.meal-row.is-yesterday:hover { background: #fef2e6; }

.meal-row.is-weekend .day-col { color: var(--color-text-muted); }
.meal-row.empty-row { opacity: .45; }

.day-col {
  padding: 14px 12px 14px 16px;
  line-height: 1.2;
}
.day-name {
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.day-date { font-size: .78rem; color: var(--color-text-muted); }

.is-today .day-name,
.is-yesterday .day-name { color: var(--color-primary); }
.is-today .day-date,
.is-yesterday .day-date { color: var(--color-primary); opacity: .75; }

.meal-col {
  padding: 10px 14px;
  border-left: 1px solid var(--color-border);
  min-height: 58px;
  display: flex;
  align-items: center;
}
.meal-col-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.meal-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.meal-title { font-size: .9rem; font-weight: 500; color: var(--color-text); }
.meal-person { font-size: .75rem; color: var(--color-text-muted); }
.meal-empty { font-size: .82rem; color: #c8b8ac; font-style: italic; }
.meal-content { padding-left: 10px; }

.meal-actions { display: flex; gap: 4px; flex-shrink: 0; }
.meal-actions a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: .85rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.meal-actions a:hover { color: var(--color-text); background: var(--color-accent); }
.meal-actions a.del:hover { color: #dc3545; background: #fde8ea; }

.add-link {
  font-size: .8rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1.5px dashed var(--color-border);
  border-radius: 6px;
  padding: 3px 10px;
  transition: border-color .15s, color .15s;
}
.add-link:hover { border-color: var(--color-primary); color: var(--color-primary); }

.week-header {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 10px 16px 4px;
  background: var(--color-accent);
  border-bottom: 1px solid var(--color-border);
}

/* ============================================================
   MOBILE (< 768px)
   Breakpoint deckungsgleich mit Bootstraps d-md-*.
   Alles hier ist ab 768px wirkungslos - die Desktop-Darstellung
   bleibt unveraendert.
   ============================================================ */
@media (max-width: 767.98px) {

  /* ---- Layout ---- */
  /* 100vh + sticky Topbar => jede Seite scrollt sonst mind. 50px */
  .app-content {
    min-height: 0;
  }
  /* Ueberschrift klebte bisher direkt unter der dunklen Topbar */
  .has-sidebar .app-content {
    padding-top: 0.75rem;
  }

  /* Doppeltes Padding: .container liegt bereits in .app-content,
     das mobil selbst 1rem setzt. Bootstrap nutzt hier kein !important. */
  .app-content > .container,
  .app-content > .container-fluid {
    padding-left: 0;
    padding-right: 0;
  }
  /* .mt-5 ist eine !important-Utility -> hoehere Spezifitaet noetig */
  .app-content > .container.mt-5 {
    margin-top: 1rem !important;
  }

  /* ---- Lange Woerter und URLs duerfen brechen ---- */
  /* 'anywhere' (nicht 'break-word') senkt auch die min-content-Breite,
     dadurch koennen Flex-Kinder wieder schrumpfen. Behebt u. a. den
     Einladungslink auf der Startseite. */
  h1, h2, h3, h4, h5, h6,
  p, code, .card-title, .badge, .list-group-item, .alert {
    overflow-wrap: anywhere;
  }

  /* ---- Flex-Zeilen duerfen umbrechen ---- */
  /* Trifft die Kopfzeilen der Listenseiten (Titel links, Buttons rechts) */
  .app-content > .d-flex.justify-content-between {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .app-content > .d-flex.justify-content-between > .d-flex {
    flex-wrap: wrap;
  }
  /* Button-Reihen. Umbruch tritt nur ein, wenn es sonst ueberliefe -
     wo alles passt, ist die Regel wirkungslos. */
  .d-flex.gap-2:not(.flex-column),
  .d-flex.gap-3:not(.flex-column) {
    flex-wrap: wrap;
  }
  .d-flex.justify-content-between {
    gap: 0.5rem;
  }

  /* ---- Tap-Flaechen >= 44px ---- */
  /* .btn deckt auch .btn-group-sm > .btn ab (die Pfeile der Wochen- und
     Monatsnavigation tragen selbst kein .btn-sm). Bewusst NICHT .btn-close
     ohne .btn: der AI-Generator erzeugt per JS ein .btn-close.btn-sm.
     min-height/min-width kollidiert mit keiner Bootstrap-Utility und wirkt
     deshalb auch gegen py-0/px-2. */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
  }
  /* Eingabefelder ebenfalls auf Daumengroesse. Checkboxen und Radios sind
     ausgenommen - deren Trefferflaeche ist das umschliessende Label. */
  .form-control,
  .form-select,
  .form-control-sm,
  .form-select-sm,
  .input-group-sm > .form-control,
  .input-group-sm > .form-select,
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    min-height: 44px;
  }
  /* .btn-close ist content-box: 1em + 2x0.875rem = 44px */
  .offcanvas-header .btn-close,
  .modal-header .btn-close {
    padding: 0.875rem;
  }
  .mobile-topbar-brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-block: -0.5rem;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-block: -0.5rem;
  }
  .sidebar-offcanvas .sidebar-nav a {
    padding-block: 0.85rem;
  }
  .sidebar-offcanvas .sidebar-user,
  .sidebar-offcanvas .sidebar-logout-btn {
    min-height: 44px;
  }
  .btn[data-filter] {
    margin: 0 0.25rem 0.5rem 0;
  }
  /* Menge im Rezept oeffnet per Klick die Inline-Bearbeitung */
  .qty-display {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 0.35rem;
  }
  /* Djangos CheckboxSelectMultiple: das <label> umschliesst die Checkbox.
     Bootstraps .form-check hat den Input als Geschwister und wird von
     diesem Selektor nicht getroffen. */
  label:has(> input[type="checkbox"]),
  label:has(> input[type="radio"]) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
  }
  label > input[type="checkbox"],
  label > input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
  }
  .form-check {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .form-check .form-check-input {
    margin-top: 0;
    margin-left: 0;
    float: none;
  }
  .form-check-input {
    width: 1.25em;
    height: 1.25em;
  }

  /* ---- iOS zoomt beim Fokus in Felder unter 16px hinein ---- */
  /* .form-control-sm muss namentlich stehen: der nackte input-Selektor
     verliert sonst gegen Bootstraps Klassenregel. */
  .form-control,
  .form-select,
  .form-control-sm,
  .form-select-sm,
  .input-group-sm > .form-control,
  .input-group-sm > .form-select,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* ---- Innenabstaende und Bilder ---- */
  .card-body.p-4 { padding: 1.25rem !important; }
  .card-body.p-5 { padding: 1.5rem !important; }
  /* Hoehe steht inline im Template -> !important ist hier der einzige Weg */
  #recipe-img        { height: 200px !important; }
  #image-placeholder { height: auto !important; padding: 1rem; }
}

/* ===== Arbeitszeit-Tabellen: Karten unter 768px =====
   Opt-in ueber .tt-stack am <table>. Rollen der Zellen:
     .tt-day     Kopfzeile der Karte
     .tt-type    gedaempfte Meta-Zeile darunter
     .tt-inline  Wert, der sich eine Zeile mit dem Nachbarn teilt
     .tt-actions Buttonzelle, oben rechts
     data-label  sichtbares Label vor dem Wert                          */
@media (max-width: 767.98px) {
  .tt-stack,
  .tt-stack tbody,
  .tt-stack tfoot,
  .tt-stack tr,
  .tt-stack td {
    display: block;
    width: auto;
  }
  .tt-stack thead { display: none; }

  .tt-stack tr {
    position: relative;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--color-border);
    /* Bootstrap faerbt table-warning/table-info sonst nur die Zellen,
       die hier keine Flaeche mehr haben. --bs-table-bg erbt vom <tr>. */
    background-color: var(--bs-table-bg, transparent);
  }
  .tt-stack tbody tr:last-child { border-bottom: 0; }

  /* .tt-stack td schlaegt .ps-3/.pe-3/.text-end ueber die Spezifitaet */
  .tt-stack td {
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  /* Leere Zellen (z. B. Soll am Wochenende) verschwinden ganz */
  .tt-stack td:empty { display: none !important; }

  .tt-stack td.tt-day {
    font-weight: 600;
    padding-right: 6.25rem !important;   /* Platz fuer .tt-actions */
  }
  .tt-stack td.tt-type {
    font-size: 0.85rem;
    color: var(--color-text-muted);
  }

  .tt-stack td[data-label]::before {
    content: attr(data-label) " ";
    font-weight: 400;
    color: var(--color-text-muted);
  }
  .tt-stack td.tt-inline { display: inline-block; }
  .tt-stack td.tt-inline + td.tt-inline { margin-left: 0.4rem; }
  /* \00a0 statt Leerzeichen: ein normales Leerzeichen nach einer
     4-stelligen CSS-Escape-Sequenz wird als deren Abschluss verschluckt. */
  .tt-stack td.tt-inline + td.tt-inline::before {
    content: "\00b7\00a0" attr(data-label) " ";
    color: var(--color-text-muted);
  }
  /* Ist der linke Nachbar leer und ausgeblendet, entfaellt der Trennpunkt */
  .tt-stack td.tt-inline:empty + td.tt-inline::before {
    content: attr(data-label) " ";
  }

  .tt-stack td.tt-actions {
    position: absolute;
    top: 0.3rem;
    right: 0.6rem;
    display: flex;
    gap: 0.3rem;
  }
  .tt-stack td.tt-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 1rem;
    line-height: 1;
  }
}

/* ===== Wochen-Essensplan: pro Tag gestapelt unter 768px ===== */
@media (max-width: 767.98px) {
  /* .meal-row hat genau drei direkte Kinder (Tag, Mittag, Abend);
     mit einer Spalte stapeln sie in Quellreihenfolge. */
  .meal-row { grid-template-columns: 1fr; }

  .day-col {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: 8px 16px 6px;
    /* halbtransparent, damit is-today/is-weekend/:hover durchscheinen */
    background: rgba(0, 0, 0, .025);
    border-bottom: 1px solid var(--color-border);
  }
  .day-name,
  .day-date { font-size: .8rem; }

  /* border-left wird bei Stapelung zu border-top, aber nur zwischen den
     beiden Mahlzeiten - sonst Doppellinie unter der Kopfzeile. */
  .meal-col {
    border-left: 0;
    padding: 8px 16px;
    min-height: 52px;
  }
  .meal-col + .meal-col { border-top: 1px solid var(--color-border); }

  /* Volle Breite -> Gerichtsnamen werden nicht mehr abgeschnitten */
  .meal-content { min-width: 0; padding-left: 0; }
  .meal-title { overflow-wrap: anywhere; }

  .meal-actions { gap: .25rem; }
  .meal-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 1.05rem;
  }
  .add-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 6px 14px;
    font-size: .875rem;
  }
}

/* Letzte Instanz gegen horizontalen Scroll. Bewusst in eigener Query,
   damit sie beim Debuggen einzeln abschaltbar ist. 'clip' statt 'hidden'
   erzeugt keinen Scroll-Container und laesst die sticky Topbar intakt. */
@media (max-width: 767.98px) {
  body { overflow-x: clip; }
}

/* ===== Barrierefreiheit: Sprung zum Inhalt ===== */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1100;
  background: var(--color-card);
  color: var(--color-text);
  padding: 0.75rem 1rem;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ===== Mobile Tab-Leiste ===== */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  /* Home-Indikator (iOS) bzw. Gestenleiste (Android) frei lassen */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 12px rgba(45, 27, 14, 0.06);
}
.bottom-nav a,
.bottom-nav button {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 6px 2px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  background: none;
  border: 0;
}
.bottom-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottom-nav a.active {
  color: var(--color-primary);
  font-weight: 700;
}
@media (max-width: 767.98px) {
  /* Inhalt endet über der Tab-Leiste */
  body.has-bottom-nav .app-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

/* ===== Kurzmeldungen (wochii.toast) ===== */
.wochii-toasts {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
@media (max-width: 767.98px) {
  body.has-bottom-nav .wochii-toasts {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}
.wochii-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #2d1b0e;
  color: #fff;
  font-size: 0.92rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.wochii-toast.is-danger { background: #9b2226; }
.wochii-toast-action {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffe8c7;
  font-weight: 700;
}

/* Aktiver Filter-Knopf war nicht von den anderen zu unterscheiden */
.btn-outline-secondary.active,
.btn-outline-secondary[aria-pressed="true"] {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}

/* ===== Einkaufsliste als Checkliste ===== */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.shop-session {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  background: #fff8e6;
  border: 1.5px solid #f5a623;
  border-radius: 0.75rem;
}
.shop-add {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.shop-add .form-control { min-height: 48px; }
.shop-add .shop-add-qty { flex: 0 0 7.5rem; }
.shop-add .btn { flex: 0 0 48px; min-height: 48px; font-size: 1.4rem; line-height: 1; }

.shop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
}
.shop-list:empty { display: none; }
.shop-item {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.3s;
}
.shop-item:last-child { border-bottom: 0; }
.shop-item.is-highlighted { background: #fff3cd; }
.shop-item-toggle {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 56px;
  padding: 0.55rem 0.9rem;
  background: none;
  border: 0;
  text-align: left;
  color: var(--color-text);
  min-width: 0;
}
.shop-check {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.is-bought .shop-check {
  background: var(--color-primary);
}
.is-bought .shop-check::after {
  content: "✓";
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
.shop-item-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.6rem;
  min-width: 0;
}
.shop-item-name {
  font-size: 1.02rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.shop-item-qty { color: var(--color-text-muted); font-size: 0.9rem; }
.shop-item-by { color: var(--color-text-muted); font-size: 0.75rem; opacity: 0.8; }
.is-bought .shop-item-name {
  text-decoration: line-through;
  color: var(--color-text-muted);
}
.shop-item-action {
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.shop-item-action:hover { color: var(--color-primary); }
.shop-item-delete:hover { color: #b02a37; }
.shop-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
}
.shop-bought { margin-top: 1.25rem; }
.shop-bought > summary {
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  color: var(--color-text-muted);
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.shop-bought .shop-list { opacity: 0.85; }
.shop-clear { margin-top: 0.75rem; text-align: right; }
