:root {
  --linen: #f4ede0;
  --paper: #fffaf3;
  --ink: #4a3f35;
  --ink-soft: #7a6d5e;
  --sage: #7c8f6c;
  --sage-light: #dfe6d7;
  --rose: #c98a6b;
  --rust: #b5654a;
  --honey: #d4a24c;
  --border: #e4d8c3;
  --shadow: 0 4px 14px rgba(120, 100, 70, 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", "Noto Sans", Roboto, sans-serif;
  height: 100%;
}

body {
  background-image:
    radial-gradient(circle at 15% 10%, rgba(124,143,108,0.06) 0, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(201,138,107,0.08) 0, transparent 45%);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Noto Serif", serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; }
.pixel-icon { width: 18px; height: 18px; vertical-align: -4px; image-rendering: pixelated; }
.wunsch-bild .pixel-icon, .card-badge .pixel-icon { width: 28px; height: 28px; vertical-align: middle; }
/* Nicht wie die Fotos über die ganze Fläche legen: Das Icon ist nur der Platzhalter dahinter. */
.wunsch-bild .pixel-icon { position: static; background: none; }
.kachel-icon .pixel-icon { width: 40px; height: 40px; }
.group-section summary img { image-rendering: pixelated; }
/* Reiter in Icon-Farbe (TAB_FARBEN in app.js), der aktive mit Rahmen und fetter Schrift. */
#bereichSwitch { gap: 3px; padding: 3px; border: none; border-radius: 11px; background: var(--border); }
#bereichSwitch button { padding: 6px 10px; border-radius: 8px; background: var(--tab, var(--paper)); color: var(--tab-text, var(--ink)); }
#bereichSwitch button.active { background: var(--tab, var(--paper)); color: var(--tab-text, var(--ink)); font-weight: 700; box-shadow: inset 0 0 0 2px var(--tab-text, var(--ink)); }
.brand h1 { font-size: 1.4rem; letter-spacing: 0.2px; }

/* ---------- Bereich-Leiste (Küche | Werkstatt | …) ---------- */
/* Wird aus BEREICHE in app.js gebaut; bei mehr Bereichen als Platz ist,
   lässt sie sich seitlich wischen statt umzubrechen. */
.bereich-switch {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--linen);
}
.bereich-switch::-webkit-scrollbar { display: none; }
.bereich-switch button {
  flex: 0 0 auto;
  white-space: nowrap;
  border: none;
  background: transparent;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.bereich-switch button.active { background: var(--sage); color: #fff; }
/* Verlauf am Rand = "hier geht's weiter" (Klassen setzt bereichLeisteHinweise). */
.bereich-switch.kann-rechts { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.bereich-switch.kann-links { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px); mask-image: linear-gradient(to right, transparent, #000 44px); }
.bereich-switch.kann-links.kann-rechts {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}
.neu-buttons { display: contents; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Suche im Pixel-Look: helles Feld mit dunklem Rahmen, harter Schatten und
   Pixel-Lupe — in jedem Bereich gleich gut zu sehen, auch auf dunklen Köpfen. */
#searchInput {
  padding: 8px 12px 8px 36px;
  border-radius: 4px;
  border: 2px solid #2b1820;
  box-shadow: 2px 2px 0 #2b1820;
  background: #fbf6ee url("../icons/pixel/lupe.png") no-repeat 9px center / 20px 20px;
  image-rendering: auto;
  color: #2b1820;
  font-weight: 600;
  min-width: 180px;
}
#searchInput::placeholder { color: #5a4048; opacity: 1; font-weight: 500; }
#searchInput:focus { outline: 2px solid #f2c9cf; outline-offset: 1px; }

.btn {
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--sage); border-color: var(--sage); color: #fff; }
.btn-secondary { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--rust); border-color: var(--rust); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.mobile-only { display: none; }
.lupen, #btnLupeUeberall, .mehr-menue { display: none; } /* nur am Handy, Laptop hat Suchfeld und Mehr-Tab direkt */
.filter-zeile-knopf { display: none; } /* nur am Handy, am Laptop stehen Chips/Legende immer da */

/* Laptop: Export/Import sind Altlast (die App gleicht sich selbst ab) und
   stecken hinter ⋯, damit der Kopf ruhiger ist. Am Handy gibt es sie nicht. */
@media (min-width: 861px) {
  #btnExport, #btnImport, #btnLegende { display: none; }
  .app-header.mehr-offen #btnExport, .app-header.mehr-offen #btnImport, .app-header.mehr-offen #btnLegende { display: inline-flex; }
}

.unit-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.unit-toggle button {
  border: none;
  background: var(--paper);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.unit-toggle button:first-child { border-right: 1px solid var(--border); }
.unit-toggle button.active { background: var(--sage); color: #fff; }

/* ---------- Body layout ---------- */
.app-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 22px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.sidebar-backdrop { display: none; }

.sidebar {
  width: var(--sidebar-width, 270px);
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  display: flex;
  align-items: stretch;
}

.sidebar-inner {
  flex: 1;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.sidebar-resizer {
  flex-shrink: 0;
  width: 10px;
  margin-left: -5px;
  cursor: col-resize;
  position: relative;
  z-index: 1;
}
.sidebar-resizer::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: transparent;
}
.sidebar-resizer:hover::after,
.sidebar-resizer.dragging::after {
  background: var(--sage, #8a9a7b);
}

.sidebar h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 18px 0 8px;
}
.sidebar h4:first-child { margin-top: 0; }

.filter-reset {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--rust);
  cursor: pointer;
  padding: 4px 0 12px;
  font-size: 0.85rem;
}

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
/* Gruppen-Chips oben im Inhalt: eine Zeile, seitlich wischbar */
.gruppen-chips {
  display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 12px; padding-bottom: 2px;
  scrollbar-width: none;
}
.gruppen-chips::-webkit-scrollbar { display: none; }
.gruppen-chips .chip { flex: 0 0 auto; white-space: nowrap; }
.gruppen-chips .chip .count { opacity: 0.7; margin-left: 2px; }
.chip {
  border: 1px solid var(--border);
  background: var(--linen);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.chip.active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}
.chip.aufwand-einfach.active { background: var(--sage); border-color: var(--sage); }
.chip.aufwand-mittel.active { background: var(--honey); border-color: var(--honey); }
.chip.aufwand-aufwendig.active { background: var(--rust); border-color: var(--rust); }

.segmented { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.segmented button {
  border: none;
  background: var(--linen);
  padding: 7px 6px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--ink-soft);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.segmented button:nth-child(2n) { border-right: none; }
.segmented button:nth-child(n+3) { border-bottom: none; }
.segmented button.active { background: var(--sage); color: #fff; }
.segmented-3 { grid-template-columns: repeat(3, 1fr); }
.segmented-3 button { border-bottom: none; }
.segmented-3 button:nth-child(2n) { border-right: 1px solid var(--border); }
.segmented-3 button:last-child { border-right: none; }

.group-tree button.tree-item {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
  font-size: 0.92rem;
}
.group-tree button.tree-item:hover { background: var(--linen); }
.group-tree button.tree-item.active { background: var(--sage-light); font-weight: 600; }
.group-tree .subtree { padding-left: 14px; }
.group-tree .count { color: var(--ink-soft); font-size: 0.78rem; }

/* ---------- Content ---------- */
.content { flex: 1; min-width: 0; padding-bottom: 72px; /* Platz für den 📥-Knopf */ }

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 20px;
  font-size: 1.05rem;
}

details.group-section, details.subgroup-section {
  margin-bottom: 14px;
}

details.group-section > summary {
  list-style: none;
  cursor: pointer;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.25rem;
  padding: 10px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px dashed var(--border);
}
details.group-section > summary img { width: 20px; height: 20px; }
details.group-section > summary::-webkit-details-marker { display: none; }
details.group-section > summary::before {
  content: "▸";
  color: var(--sage);
  transition: transform .15s ease;
  display: inline-block;
}
details.group-section[open] > summary::before { transform: rotate(90deg); }

details.subgroup-section > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: 10px 6px 10px 18px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
details.subgroup-section > summary::-webkit-details-marker { display: none; }
details.subgroup-section > summary::before {
  content: "▸";
  color: var(--rose);
  transition: transform .15s ease;
}
details.subgroup-section[open] > summary::before { transform: rotate(90deg); }

.count {
  background: var(--linen);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-left: 4px;
}

.group-body { padding: 4px 4px 4px 6px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 8px 2px 16px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(120,100,70,0.18); }

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.15rem;
}

.card h3 {
  font-size: 1.05rem;
  padding-right: 26px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--linen);
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.badge.aufwand-einfach { background: var(--sage-light); color: #43573a; border-color: var(--sage); }
.badge.aufwand-mittel { background: #f6e6c4; color: #7a5c1c; border-color: var(--honey); }
.badge.aufwand-aufwendig { background: #f2d9cf; color: #7d3c26; border-color: var(--rust); }

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.card-tags .tag {
  font-size: 0.72rem;
  color: var(--rose);
  background: #f7e9e2;
  padding: 2px 8px;
  border-radius: 999px;
}
.card-tags .tag-todo {
  color: var(--rust);
  background: #f2d9cf;
  border: 1px dashed var(--rust);
  font-weight: 600;
}
/* Aufwand und Herkunft sind normale Tags, sehen aber weiter wie vorher aus. */
.card-tags .tag-aufwand { border: 1px solid transparent; font-weight: 600; }
.card-tags .tag-aufwand.aufwand-einfach { background: var(--sage-light); color: #43573a; border-color: var(--sage); }
.card-tags .tag-aufwand.aufwand-mittel { background: #f6e6c4; color: #7a5c1c; border-color: var(--honey); }
.card-tags .tag-aufwand.aufwand-aufwendig { background: #f2d9cf; color: #7d3c26; border-color: var(--rust); }
.card-tags .tag-land { background: var(--linen); color: var(--ink-soft); border: 1px solid var(--border); }

/* ---------- Fotos ---------- */
.card-foto {
  margin: -16px -16px 12px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--linen);
}
.card-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* ---------- Wunschliste: Zeilen statt Kacheln ---------- */
.wunsch-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 2px 16px;
}
.wunsch-zeile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 8px;
}
.wunsch-bild {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--linen);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.wunsch-bild img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.wunsch-text { flex: 1; min-width: 0; }
.wunsch-titel { font-weight: 600; line-height: 1.3; }
.wunsch-notiz { font-size: 0.85rem; color: var(--ink-soft); margin-top: 2px; white-space: pre-line; }
.wunsch-text .card-tags { margin-top: 4px; }
.zeile-poster .wunsch-bild { flex-basis: 44px; width: 44px; height: 66px; border-radius: 4px; }
.ressource-link { color: var(--rust); text-decoration: none; }
.ressource-link:hover { text-decoration: underline; }
.wunsch-preis { font-size: 0.9rem; color: var(--ink-soft); white-space: nowrap; }
.wunsch-gekauft { opacity: 0.55; }
.wunsch-gekauft .wunsch-titel { text-decoration: line-through; }

/* ---------- Ideen-Pinnwand (Werkstatt) ---------- */
.pinnwand-section { margin-bottom: 18px; }
.pinnwand-section h2 { font-size: 1.15rem; margin: 4px 2px 10px; }
.pinnwand-section h2 .count { font-size: 0.8rem; color: var(--ink-soft); font-weight: 400; }
.pinnwand { columns: 230px; column-gap: 14px; }
.pin {
  break-inside: avoid;
  margin-bottom: 14px;
  display: block;
  border-top: 4px solid var(--honey);
}
.pin-in-arbeit { border-top-color: var(--rose); }
.pin-fertig { border-top-color: var(--sage); opacity: 0.75; }
/* Bilder in voller Höhe statt Zuschnitt — sie sind auf der Pinnwand der Inhalt. */
.pin .card-foto { aspect-ratio: auto; border-radius: 10px 10px 0 0; }
.pin .card-foto img { height: auto; }
.pin-status { margin-bottom: 8px; }
.pin h3 { padding-right: 0; }
.pin-text { margin: 0 0 8px; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.45; white-space: pre-line; }
.pin-link { font-size: 0.8rem; color: var(--rust); margin-bottom: 8px; overflow-wrap: anywhere; }
.idee-link { color: var(--rust); overflow-wrap: anywhere; }
/* Eine Zeile: Umschalter links, Lupen rechts. Lieber bricht „Alle aufklappen“
   um, als dass die Lupen in eine eigene Zeile rutschen. */
.ansicht-zeile { display: flex; align-items: flex-start; }
.ansicht-zeile .todo-alle-knopf { white-space: normal; text-align: left; min-width: 0; }
.ansicht-umschalter { display: inline-flex; margin: 0 0 12px; }
.todo-alle-knopf { margin: 0 0 4px 4px; padding: 2px 4px; border: none; background: none; color: var(--sage); font-size: 0.8rem; vertical-align: top; }
.pin .card-foto { position: relative; }
.pin-anzahl {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(40,30,20,0.6); color: #fff;
  font-size: 0.72rem; padding: 2px 7px; border-radius: 999px;
}
/* Kleinere Pixel-Zeichen in den Marken auf dem Foto (Größe siehe .pixel-zeichen unten). */
.pin-anzahl, .poster-geguckt { --pixel-zeichen-groesse: 13px; }
.pin-anzahl img.pixel-zeichen { margin-right: 3px; vertical-align: -2px; }

/* Kompakt = Pinterest: schmale Spalten, nur Bild + Titel. Text, Link und
   Marken gibt es beim Antippen in der Detail-Ansicht. */
/* Feste Spaltenzahl statt Mindestbreite: sonst fällt ein schmaler Bildschirm
   (Bildschirmzoom, eingerückte Untergruppe) still auf 1 Spalte zurück. */
.pinnwand-kompakt { columns: 2; column-gap: 8px; }
@media (min-width: 600px) { .pinnwand-kompakt { columns: 3; } }
@media (min-width: 900px) { .pinnwand-kompakt { columns: 4; } }
@media (min-width: 1200px) { .pinnwand-kompakt { columns: 5; } }
/* Hochkante Bilder (Screenshots, Reels) höchstens 4:5, damit keine Kachel
   den ganzen Bildschirm füllt. cqw = Breite der Kachel. */
.pinnwand-kompakt .pin .card-foto { container-type: inline-size; }
.pinnwand-kompakt .pin .card-foto img { max-height: 125cqw; object-fit: cover; }
.pinnwand-kompakt .pin { margin-bottom: 8px; padding: 0 0 8px; border-top-width: 3px; overflow: hidden; }
.pinnwand-kompakt .pin .card-foto { margin: 0 0 6px; border-radius: 0; }
.pinnwand-kompakt .pin h3 { font-size: 0.85rem; line-height: 1.3; margin: 0; padding: 0 8px; }
.pinnwand-kompakt .pin-status,
.pinnwand-kompakt .pin-link,
.pinnwand-kompakt .card-tags { display: none; }
.pinnwand-kompakt .pin-text { display: none; }
.pinnwand-kompakt .pin-neutral { border-top-color: var(--border); }
/* Medien-Poster (2:3): am Handy 2 nebeneinander (User-Wunsch), breiter mehr. */
.pinnwand-poster { columns: 2; }
@media (min-width: 600px) { .pinnwand-poster { columns: 5; } }
@media (min-width: 900px) { .pinnwand-poster { columns: 6; } }
@media (min-width: 1200px) { .pinnwand-poster { columns: 8; } }
.pinnwand-poster .pin .card-foto img { max-height: 150cqw; }

/* ---------- 🎬 Medien: Kurzinfo, Sterne, Blatt, Zufall ---------- */
.medium-info { font-size: 0.8rem; color: var(--ink-soft); margin: 1px 0 2px; }
.sterne { color: #d9a128; letter-spacing: 1px; font-size: 0.9rem; white-space: nowrap; }
.kachel-sterne { padding: 2px 8px 0; font-size: 0.75rem; }
.sterne-filter { cursor: pointer; border-radius: 4px; }
.sterne-filter:hover { background: #fbefd9; }
.medium-klickbar { cursor: pointer; }
.medien-tipp { margin: 4px 0 14px; }
/* Art-Chips: eine Zeile, am Handy seitlich wischbar statt umzubrechen. */
.medien-arten { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 0 12px; padding-bottom: 2px; }
.medien-arten::-webkit-scrollbar { display: none; }
.medien-arten .chip { flex: 0 0 auto; }
.medien-tipp-offen { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 4px; }
.medien-tipp-offen h2 { font-size: 1.05rem; margin: 0; }
.medium-blatt { max-width: 520px; }
.medium-kopf { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.medium-poster { width: 110px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; flex: none; }
.medium-kopf p { margin: 0 0 6px; }
.medium-blatt .medium-info { font-size: 0.92rem; }
.medium-gruppe { font-size: 0.85rem; color: var(--ink-soft); }
.medium-kommentar { font-style: italic; }
.medium-notiz { margin: 0 0 10px; white-space: pre-line; }
#mediumAktion { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
#mediumAktion .medium-bewerten { flex: 1 1 100%; }
/* Tag-Editor im Medien-Blatt: Chip + ✕ zum Entfernen, darunter Hinzufügen. */
.medium-tags { margin: 6px 0 4px; }
.tag-bearbeiten { display: inline-flex; align-items: center; }
.tag-weg {
  border: none; background: none; cursor: pointer; color: var(--ink-soft);
  font-size: 0.75rem; padding: 4px 6px 4px 2px; margin-left: -2px;
}
.tag-weg:hover { color: #c0573e; }
.medium-tag-neu { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.medium-tag-neu input {
  flex: 1 1 140px; min-width: 0; font: inherit; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--linen);
}
.medium-bewerten { display: flex; flex-direction: column; gap: 10px; }
.medium-rewatch-frage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.medium-rewatch-frage .segmented { flex: 0 0 150px; }
/* Übersicht beim Antippen: Cover groß oben, darunter Status, grobe Infos,
   "Worum geht's". Ändern (Tags, Liste) ist eingeklappt. */
.medium-cover {
  display: block; width: min(240px, 68%); aspect-ratio: 2 / 3; object-fit: cover; margin: 2px auto 14px;
  border: 3px solid #2a1a1f; border-radius: 4px; box-shadow: 5px 5px 0 #e0a92e;
}
/* Wunsch-Blatt: wie das Medien-Blatt, aber Produktbilder sind meist quadratisch
   und ganz zu sehen (contain statt Zuschnitt). */
.wunsch-cover {
  display: block; width: min(300px, 82%); aspect-ratio: 1; object-fit: contain; margin: 2px auto 12px;
  background: #fff; border: 3px solid #2a1a1f; border-radius: 4px; box-shadow: 5px 5px 0 #c97b87; cursor: zoom-in;
}
.wunsch-cover-leer { display: grid; place-items: center; background: var(--linen); cursor: default; --pixel-zeichen-groesse: 64px; }
.wunsch-cover-leer .pixel-icon { width: 64px; height: 64px; image-rendering: pixelated; }
.wunsch-inspo { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0 0 14px; }
.wunsch-inspo img {
  width: 76px; height: 76px; object-fit: cover; border: 2px solid #2a1a1f; border-radius: 3px; cursor: zoom-in; background: #fff;
}
/* Inspo-Reihe in Ideen-Zeilen: wischbar, nicht umbrechend. */
.zeile-inspo { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0 2px; padding-bottom: 4px; scrollbar-width: thin; }
.zeile-inspo img {
  flex: 0 0 auto; width: 92px; height: 116px; object-fit: cover; border: 2px solid #2a1a1f; border-radius: 3px;
  cursor: zoom-in; background: #fff;
}
.wunsch-preis-marke { background: #f7dc9a; color: #2a1a1f; }
.wunsch-blatt-notiz { text-align: center; }
.wunsch-blatt #mediumAktion { justify-content: center; }
.wunsch-sortierung { display: inline-flex; vertical-align: top; margin: 0 0 12px 8px; }
.wunsch-sortierung button + button { border-left: 1px solid var(--border); }
.medium-uebersicht { text-align: center; }
.medium-uebersicht p { margin: 0 0 6px; }
.medium-uebersicht .card-tags { justify-content: center; margin: 4px 0 8px; }
.medium-marken { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
/* Status-Schild: kantig mit Pixel-Schatten, wie ein Kino-Ticket. */
.medium-status, .medium-marke {
  display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 3px 9px; white-space: nowrap;
  border: 2px solid #2a1a1f; border-radius: 2px; box-shadow: 2px 2px 0 #2a1a1f;
}
.medium-status.ist-geguckt, .medium-marke.ist-geguckt { background: #9c2f3a; color: #fff4e2; }
.medium-status.nicht-geguckt { background: #fffaf3; color: #66555a; border-style: dashed; box-shadow: none; }
.medium-status.ist-rewatch, .medium-marke.ist-rewatch { background: #f2c9cf; color: #2a1a1f; }
.medium-status.ist-bald { background: #f7dc9a; color: #2a1a1f; }
.medium-marke { font-size: 0.68rem; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; cursor: pointer; box-shadow: 1px 1px 0 #2a1a1f; border-width: 1.5px; }
.medium-beschreibung { background: var(--linen); border-left: 4px solid #9c2f3a; border-radius: 2px; padding: 10px 12px; margin: 10px 0 12px; }
.medium-beschreibung h3 { font-size: 0.95rem; margin: 0 0 4px; color: #9c2f3a; }
.medium-teaser { margin: 0; line-height: 1.5; }
.medium-beschreibung .medium-notiz { margin: 8px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.medium-aendern { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 8px; }
.medium-aendern summary { cursor: pointer; font-size: 0.85rem; color: var(--ink-soft); padding: 4px 0; }
.medium-listen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
/* Kompakt-Kachel: Haken aufs Poster. */
.poster-geguckt {
  position: absolute; top: 6px; left: 6px; background: #9c2f3a; color: #fff4e2; font-size: 0.75rem; font-weight: 700;
  padding: 1px 6px; border: 2px solid #2a1a1f; border-radius: 2px; box-shadow: 2px 2px 0 #2a1a1f;
}
/* Status-Filter oben: aktiver Chip in der Farbe des Schilds. */
.medien-status { margin-top: -4px; }
.medien-status .chip-status-ja.active { background: #9c2f3a; border-color: #9c2f3a; }
.medien-status .chip-status-rewatch.active { background: #f2c9cf; border-color: #c97b87; color: #2a1a1f; }
.medien-status .chip-status-nein.active { background: #2a1a1f; border-color: #2a1a1f; }
.medium-bewerten textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--paper); }
.reihe-teile { list-style: none; margin: 4px 0 10px; padding: 0; }
.reihe-teile li {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px; cursor: pointer;
  border-bottom: 1px dashed var(--border);
}
.reihe-teile li:hover { background: var(--linen); }
.reihe-haken { width: 1.2em; text-align: center; color: var(--ink-soft); }
.reihe-teile li.geguckt .reihe-haken { color: var(--sage); font-weight: 700; }
.reihe-titel { flex: 1; }
.reihe-teile small { color: var(--ink-soft); }
.sterne-wahl { display: flex; gap: 4px; }
.sterne-wahl button {
  font-size: 2rem; line-height: 1; background: none; border: none; padding: 2px 4px;
  color: #d8cfc0; cursor: pointer;
}
.sterne-wahl button.an { color: #d9a128; }
.pinnwand-poster .pin h3 { font-size: 0.75rem; padding: 0 6px; }
.kachel {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative;
}
.pinnwand-kompakt { padding: 8px 2px 16px; }
.pinnwand-kompakt .kachel { color: inherit; text-decoration: none; }
.pinnwand-kompakt .kachel:not(.card) { cursor: default; }
.pinnwand-kompakt a.kachel { cursor: pointer; }
/* Ohne Bild: nur Symbol + Titel. */
.kachel-icon {
  height: 64px; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; background: var(--linen); margin-bottom: 6px;
}
.pinnwand-kompakt .wunsch-gekauft { opacity: 0.55; }
.pinnwand-kompakt .wunsch-gekauft h3 { text-decoration: line-through; }

/* Tag-Chip zweimal angetippt: dieser Tag wird ausgeblendet. */
.chip.ausgeschlossen {
  background: #f7e1de; color: #9b3b2e; border-color: #e3b3ab;
  text-decoration: line-through;
}
/* Dasselbe am Tag eines Eintrags: an = im Filter, ohne = ausgeschlossen. */
.tag.tag-filter-an { outline: 2px solid var(--ink); outline-offset: -2px; }
.tag.tag-filter-ohne { background: #f7e1de; color: #9b3b2e; text-decoration: line-through; }

/* Inspo-Board unten in der Idee: Pinterest-Spalten, Bilder ungeschnitten. */
.inspo-board { columns: 2 150px; column-gap: 8px; }
.inspo-board figure {
  break-inside: avoid; margin: 0 0 8px;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--linen);
}
.inspo-board img { width: 100%; display: block; }
img.zoombar { cursor: zoom-in; }

/* Großansicht: Vollbild über der Detail-Ansicht, seitlich wischen. */
.bild-viewer {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(30, 22, 15, 0.94);
  display: flex; flex-direction: column; justify-content: center;
}
.bild-viewer .detail-galerie { margin: 0; padding: 0 4%; scrollbar-width: none; }
.bild-viewer .detail-galerie figure { flex-basis: 92%; background: transparent; }
.bild-viewer .detail-galerie img { max-height: 86vh; }
.bild-viewer-zu {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.85); font-size: 1.1rem; cursor: pointer;
}

/* Galerie in der Großansicht: seitlich wischen, Bilder ungeschnitten. */
.detail-galerie {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 4px 0 12px; padding-bottom: 4px;
}
.detail-galerie figure {
  flex: 0 0 88%; margin: 0; scroll-snap-align: center; position: relative;
  background: var(--linen); border-radius: var(--radius-sm); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.detail-galerie img { width: 100%; max-height: 62vh; object-fit: contain; display: block; }
.detail-galerie figcaption {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(40,30,20,0.6); color: #fff; font-size: 0.75rem; padding: 2px 8px; border-radius: 999px;
}

.detail-foto {
  margin: 4px 0 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 260px;
  background: var(--linen);
}
.detail-foto img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.detail-foto img.zoombar { cursor: zoom-in; }

/* ---------- Suche ---------- */
.such-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--sage-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #43573a;
}
/* Treffer-Bereich bei "Überall": Knopf rechts in der Bereichs-Zeile. */
.such-bereich > summary { display: flex; align-items: center; gap: 6px; }
.such-bereich .such-dorthin { margin-left: auto; font-size: 0.78rem; padding: 3px 10px; }
.aktiv-filter-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--sage-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #43573a;
}
.aktiv-filter-label { font-weight: 600; white-space: nowrap; }
.aktiv-filter-chip { cursor: pointer; }
.aktiv-filter-kopf .btn { margin-left: auto; }
.card-treffer {
  font-size: 0.76rem;
  color: var(--sage);
  background: var(--sage-light);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  margin-bottom: 8px;
  display: inline-block;
}

/* ---------- Vorschläge ("Heute vielleicht…?") ---------- */
/* Kein Kopf: der Würfel sitzt als kleiner Pixel-Knopf auf der oberen Kante. */
.vorschlag-section {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 2px;
  margin: 14px 0 18px;
  box-shadow: var(--shadow);
}
.vorschlag-wuerfel {
  /* Größer und in sattem Rosa, damit man den Würfel sofort sieht. */
  position: absolute; top: -18px; right: 12px; z-index: 2;
  --pixel-zeichen-groesse: 30px;
  width: 50px; height: 42px; padding: 0; display: grid; place-items: center;
  background: #eaa5b0; border: 2px solid #2b1820; border-radius: 5px; box-shadow: 3px 3px 0 #2b1820;
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.vorschlag-wuerfel:hover { transform: translateY(-1px); }
.vorschlag-wuerfel:active { transform: translate(2px, 2px); box-shadow: none; }
.vorschlag-wuerfel img.pixel-zeichen { vertical-align: 0; }
.vorschlag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.vorschlag-head h2 { font-size: 1.1rem; color: var(--sage); }
.vorschlag-hinweis { font-size: 0.8rem; font-weight: 400; opacity: 0.75; }
.vorschlag-section .card-grid { padding-bottom: 12px; align-items: start; }
/* Kompakt-Ansicht: Vorschläge als kleines Raster mit quadratischen
   Kacheln — am Handy 2 pro Reihe (4 Vorschläge = 2 × 2), breiter alle in einer Reihe. */
.vorschlag-raster {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 4px 0 12px;
}
@media (min-width: 700px) { .vorschlag-raster { grid-template-columns: repeat(4, 1fr); } }
.vorschlag-raster .kachel { margin: 0; padding-bottom: 6px; }
.vorschlag-raster .card-foto { aspect-ratio: 1; margin-bottom: 4px; }
.vorschlag-raster .card-foto img { width: 100%; height: 100%; object-fit: cover; }
.vorschlag-raster .kachel-icon { aspect-ratio: 1; height: auto; margin-bottom: 4px; }
.vorschlag-raster .pin-anzahl { display: none; }
.vorschlag-raster .kachel h3 {
  font-size: 0.75rem; padding: 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Art/Teig + passende Füllung stehen als Paar in einer Spalte. */
.vorschlag-paar { display: flex; flex-direction: column; gap: 6px; }
.paar-plus {
  text-align: center;
  color: var(--rose);
  font-weight: 600;
  line-height: 1;
}

/* ---------- Portionen-Umrechner ---------- */
.portionen-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--linen);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  margin: 2px 0 10px;
  font-size: 0.85rem;
}
.portionen-label { color: var(--ink-soft); }
.portionen-wert { font-weight: 600; min-width: 74px; text-align: center; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.portionen-stepper button[data-step] {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}
.portionen-stepper button[data-step]:hover { background: var(--sage-light); }
.portionen-reset {
  border: none;
  background: transparent;
  color: var(--rust);
  cursor: pointer;
  font-size: 0.8rem;
}
.portionen-reset:hover { text-decoration: underline; }
.portionen-hinweis { color: var(--ink-soft); font-size: 0.8rem; }

/* ---------- Tag-Eingabe im Formular ---------- */
.chip.chip-warn { border-color: var(--rust); color: var(--rust); }
.chip.chip-warn.active { background: var(--rust); border-color: var(--rust); color: #fff; }
.tag-input-warn { outline: 1px dashed var(--rust); outline-offset: 2px; border-radius: var(--radius-sm); }
.tag-warnung { color: var(--rust); font-size: 0.8rem; margin-top: 8px; }
.tag-vorschlag-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}
.tag-vorschlag-titel {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  min-width: 68px;
}
.tag-vorschlag {
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.75rem;
  cursor: pointer;
}
.tag-vorschlag:hover { border-style: solid; border-color: var(--sage); color: var(--sage); }

/* ---------- Modal / Dialog ---------- */
dialog.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(680px, 92vw);
  max-height: 88vh;
  background: var(--paper);
  box-shadow: 0 20px 60px rgba(60,45,25,0.35);
}
dialog.modal::backdrop { background: rgba(60,45,25,0.35); backdrop-filter: blur(1px); }

.modal-inner { padding: 22px 24px 26px; overflow-y: auto; max-height: 88vh; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.modal-header h2 { font-size: 1.35rem; padding-right: 8px; }
.modal-close {
  border: none;
  background: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink-soft);
  line-height: 1;
}

.modal-actions { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }

.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.detail-breadcrumb { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 6px; }

.detail-section { margin-top: 18px; }
.detail-section h3 {
  font-size: 1.02rem;
  border-bottom: 2px dashed var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 2px dashed var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.detail-section-head h3 { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.unit-toggle-sm button { padding: 5px 11px; font-size: 0.78rem; }

.detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
}

.step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--sage-light);
  color: #43573a;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Vom "mit Mengen"-Umschalter eingefügte Klammer-Mengen im Schritt-Text */
.schritt-menge {
  font-style: normal;
  font-weight: 600;
  color: var(--sage);
  white-space: nowrap;
}

.uebersicht-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.uebersicht-table th, .uebersicht-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.92rem;
}
.uebersicht-table th { background: var(--sage-light); color: #43573a; }
.uebersicht-table tr:nth-child(even) td { background: var(--linen); }

.notes-box {
  background: var(--linen);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  white-space: pre-wrap;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- Zutaten-Matrix (Komponenten-Spalten) ---------- */
.matrix-wrap { overflow-x: auto; }
.zutaten-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.zutaten-matrix th {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Noto Serif", serif;
  font-weight: 600;
  color: #43573a;
  text-align: left;
  padding: 7px 10px;
  border-bottom: 2px dashed var(--border);
  background: var(--sage-light);
}
.zutaten-matrix th:first-child { background: transparent; color: var(--ink-soft); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.zutaten-matrix td {
  padding: 7px 10px;
  border-bottom: 1px dashed var(--border);
  vertical-align: top;
}
.zutaten-matrix tr:last-child td { border-bottom: none; }
.matrix-name { font-weight: 600; white-space: nowrap; }
.matrix-cell em { color: var(--ink-soft); font-size: 0.85em; }
.matrix-empty { color: var(--border); text-align: center; }
.nach-geschmack { cursor: help; opacity: 0.75; }

/* Faustregel/Verhältnis — steht bewusst ganz oben, weil bei manchen
   Rezepten (Grießbrei, Milchreis, Streusel) das Verhältnis die eigentliche
   Information ist und der Rest sich von selbst versteht. */
.faustregel {
  background: var(--sage-light);
  border-left: 3px solid var(--sage);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 1.02rem;
  font-weight: 600;
  color: #3d5136;
  letter-spacing: 0.01em;
}
/* Dezente Variante: gleiche Position, aber ohne eigenen Kasten — sie
   gehört zum Rezepttext statt ihn zu überstrahlen. */
.faustregel-zeile {
  margin-bottom: 12px;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-soft, #6b6357);
}


/* Mix-Gruppen: gleiche Farbe = wird zusammen verrührt */
.mix-bg-0 { background: #e7edda; }
.mix-bg-1 { background: #f6e8c6; }
.mix-bg-2 { background: #f4dfd1; }
.mix-bg-3 { background: #dee8ec; }
.mix-bg-4 { background: #ebdfe9; }
.mix-bg-5 { background: #f1d7cc; }
.mixdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mix-dot-0 { background: #93a97e; }
.mix-dot-1 { background: #d4a24c; }
.mix-dot-2 { background: #c98a6b; }
.mix-dot-3 { background: #7d99a8; }
.mix-dot-4 { background: #a27d9c; }
.mix-dot-5 { background: #b5654a; }
.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.mix-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.detail-row[class*="mix-bg-"] { border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }

.subsection-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  color: var(--rose);
  margin: 10px 0 4px;
  font-weight: 600;
}
.subsection-label[data-open-basis] { cursor: pointer; }
.subsection-label[data-open-basis]:hover { text-decoration: underline; }

.badge-link { cursor: pointer; }
.badge-link:hover { text-decoration: underline; }

.hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input[type="text"], .field input[type="number"], .field select, .field textarea, .field input[type="search"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--linen);
}
.field textarea { resize: vertical; min-height: 140px; field-sizing: content; }

.type-toggle { display: flex; gap: 8px; margin-top: 14px; }
.type-toggle button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--linen);
  cursor: pointer;
  font-weight: 600;
}
.type-toggle button.active { background: var(--sage); color: #fff; border-color: var(--sage); }

.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--linen);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.tag-input-wrap input {
  border: none;
  background: none;
  flex: 1;
  min-width: 120px;
  outline: none;
}
.tag-chip {
  background: #f7e9e2;
  color: var(--rose);
  border-radius: 999px;
  padding: 3px 6px 3px 11px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tag-chip button { border: none; background: none; cursor: pointer; color: var(--rose); font-size: 0.85rem; }

.zutat-row, .col-row, .cell-row {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.zutat-row { grid-template-columns: 2fr 0.8fr 1fr 1.4fr auto; }
.zutat-item { margin-bottom: 12px; }
.zutat-item .zutat-row { margin-bottom: 4px; }
.zutat-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.zutat-extra input {
  padding: 6px 10px;
  font-size: 0.85rem;
  background: var(--paper);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
}
.schritt-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.komponente-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.komponente-row input { flex: 1; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--linen); }
.schritt-row textarea { flex: 1; min-height: 44px; }
.schritt-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--sage-light); color: #43573a;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; flex-shrink: 0; margin-top: 6px;
}

.row-remove {
  border: none;
  background: none;
  color: var(--rust);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

.add-row-btn {
  border: 1px dashed var(--sage);
  background: none;
  color: var(--sage);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  margin-top: 4px;
}

.uebersicht-editor-cols { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.col-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--linen); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 8px;
}
.col-chip input { border: none; background: none; width: 110px; }

.uebersicht-editor-row {
  display: flex; gap: 8px; margin-bottom: 8px; align-items: center;
}
.uebersicht-editor-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--linen);
}

.form-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--sage);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(60,45,25,0.25);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 100;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:has(.toast-aktion) { pointer-events: auto; display: flex; align-items: center; gap: 12px; }
.toast-aktion {
  border: none; background: rgba(255,255,255,0.25); color: #fff;
  border-radius: 999px; padding: 4px 12px; font: inherit; font-weight: 600; cursor: pointer;
}

/* 🔒 Private Notiz (aus /api/privat, nur mit Zugangscode) */
.privat-notiz {
  margin-top: 6px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--linen); border-left: 3px solid var(--sage);
  font-size: 0.82rem; color: var(--ink-soft); white-space: pre-line;
  user-select: text;
}

/* ---------- ✅ To-dos ---------- */
.todo-haken {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--sage); background: transparent; color: var(--sage);
  font-size: 1.1rem; line-height: 1; cursor: pointer; align-self: center;
}
.todo-haken:hover { background: var(--sage-light); }
/* Schlichte Textliste: keine Kästen, nur feine Trennlinien. */
.todo-liste { padding: 4px 2px 16px; }
.todo-liste + .todo-liste { margin-top: 20px; }
.todo-liste .todo-zeile {
  background: none; border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; box-shadow: none; padding: 10px 4px; gap: 0;
}
.todo-liste .todo-zeile:last-child { border-bottom: none; }
.todo-liste .wunsch-titel { font-weight: 500; }
.todo-mit-infos { cursor: pointer; }
.todo-liste .todo-zeile { align-items: flex-start; gap: 10px; position: relative; padding-right: 26px; }
.todo-kreuz { flex: 0 0 18px; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--sage); cursor: pointer; }
.todo-marken { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.todo-marke { font-size: 0.78rem; color: var(--ink-soft); }
/* Art als Farbkante links (Uni, Admin, Jobs, Projekte), Laptop als blaue Marke; Legende über der Liste. */
.todo-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 2px 4px 0; font-size: 0.78rem; color: var(--ink-soft); }
.todo-art-uni { --todo-art: #5d6b3c; }
.todo-art-admin { --todo-art: #c2506b; }
.todo-art-jobs { --todo-art: #8a5a2b; }
.todo-art-projekte { --todo-art: #6b2a3a; }
.todo-legende-art { display: inline-flex; align-items: center; gap: 5px; }
.todo-legende-art::before { content: ""; width: 12px; height: 12px; background: var(--todo-art); }
.todo-liste .todo-zeile[class*="todo-art-"] { border-left: 8px solid var(--todo-art); padding-left: 9px; }
.todo-ansicht { display: inline-flex; vertical-align: middle; margin: 0 8px 8px 0; }
/* Drei Stufen als eigene Abschnitte: "Jetzt dran" springt ins Auge, "Kann warten" tritt zurück. */
.todo-abschnitt + .todo-abschnitt { margin-top: 18px; }
.todo-stufe-titel { display: flex; align-items: baseline; gap: 8px; margin: 14px 4px 8px; padding-bottom: 3px; font-size: 1rem; border-bottom: 2px solid var(--ink); }
.todo-stufe-titel .count { padding: 0; background: none; font-size: 0.8rem; font-weight: 500; color: var(--ink-soft); }
.todo-stufe-1 .todo-stufe-titel { padding: 6px 10px; border: none; background: var(--rust); color: #fff; }
.todo-stufe-1 .todo-stufe-titel .count { color: #f6d6d6; }
.todo-stufe-3 .todo-stufe-titel { color: var(--ink-soft); border-bottom: 2px dashed var(--ink-soft); }
.todo-stufe-3 .todo-zeile { opacity: 0.8; }
/* Wartet (TODO_WARTET): noch offen, aber gerade nichts zu tun, daher blass, bleibt aber an seinem Platz. */
.todo-liste .todo-zeile.todo-wartend { opacity: 0.55; }
.todo-wartet { font-style: italic; }
.todo-stufe-0 .todo-stufe-titel { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; border-bottom: none; }
/* Kanban: eine Spalte je Stufe, am Handy seitlich wischen. */
.todo-board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 4px 12px; }
.todo-spalte { flex: 0 0 min(84%, 330px); scroll-snap-align: start; padding: 0 8px 10px; background: var(--linen); }
.todo-spalte .todo-stufe-titel { margin: 0 -8px 10px; }
.todo-spalte.todo-stufe-1 .todo-stufe-titel { margin-top: 0; }
.todo-spalte:not(.todo-stufe-1) .todo-stufe-titel { padding: 8px 8px 4px; }
.todo-ziel, .todo-ziel:visited { display: inline-block; margin-top: 7px; color: #fff; text-decoration: none; }
.todo-legende-knopf { display: inline-flex; align-items: center; min-height: 34px; padding: 2px 5px; border: none; background: none; font: inherit; color: inherit; cursor: pointer; }
.todo-legende-knopf.active { font-weight: 700; color: var(--ink); background: var(--linen); }
.todo-legende-knopf.ausgeschlossen { opacity: 0.45; text-decoration: line-through; }
.todo-bilder { display: flex; gap: 8px; overflow-x: auto; margin: 4px 0 8px; scrollbar-width: none; }
.todo-bilder img {
  flex: 0 0 auto; height: 120px; max-width: 70%; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: zoom-in;
}
/* Zweimal in der Legende angetippt: bleibt stehen, aber blass und unten. */
.todo-liste .todo-zeile.todo-ausgeschlossen { opacity: 0.3; filter: grayscale(0.7); }
.todo-laptop { color: #4f79a8; font-weight: 600; }
.todo-bereit { color: var(--sage); }
.todo-frist-knapp { color: var(--rust); font-weight: 600; }
.todo-infos a { color: var(--rust); }
.todo-infos a.btn-primary { color: #fff; text-decoration: none; }
.todo-mail { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--sage); background: var(--linen); border-radius: var(--radius-sm); font-size: 0.85rem; }
.todo-mail-kopf { color: var(--ink-soft); margin-bottom: 6px; }
.todo-mail-text { white-space: pre-line; user-select: text; }
.todo-mail-knoepfe { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.todo-ist-erledigt .wunsch-titel { text-decoration: line-through; color: var(--ink-soft); font-weight: 400; }
.todo-ist-erledigt { opacity: 0.7; }
/* Ziel eines Direktlinks (.../#todo-16) leuchtet kurz auf. */
.direktlink-ziel { animation: direktlink-leuchten 2.5s ease-out; }
@keyframes direktlink-leuchten {
  0%, 60% { outline: 3px solid var(--ink); outline-offset: 2px; }
  100% { outline: 3px solid transparent; outline-offset: 2px; }
}
.todo-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.todo-aktionen .btn.active { background: var(--sage); color: #fff; border-color: var(--sage); }
.todo-frist-feld { font-size: 0.85rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.todo-frist-feld input { font: inherit; padding: 3px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); }
/* Pfeil rechts statt Wort "Infos" in jeder Zeile. Im Builder öffnet ein Tipp
   das Formular, dort klappt nichts auf, also auch kein Pfeil. */
.todo-infos-knopf {
  position: absolute; top: 16px; right: 8px; width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink-soft); border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg); opacity: 0.6;
}
.todo-zeile.offen .todo-infos-knopf { top: 20px; transform: rotate(-135deg); }
body.builder-an .todo-infos-knopf { display: none; }
.todo-infos { display: none; cursor: auto; }
.todo-zeile.offen .todo-infos { display: block; }

/* Eigener Look nur für die To-dos: Hafer-Beige, Altrosa, Schokobraun (nach den
   Glanzfliesen aus der Inspo). Art = Farbkante links. Dazu ein Hauch alte
   Handheld-Spiele: Pixelkanten, Pixel-Symbole (selbst gezeichnet), Funkeln.
   Das data-bereich-Attribut setzt wendeBereichAn in js/app.js. */
html[data-bereich="todos"] {
  --todo-pixel-laptop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14' shape-rendering='crispEdges'%3E%3Cpath fill='%233a1b17' d='M2 0h12v1h-12z'/%3E%3Cpath fill='%233a1b17' d='M1 1h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 1h12v1h-12z'/%3E%3Cpath fill='%233a1b17' d='M14 1h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 2h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 2h1v1h-1z'/%3E%3Cpath fill='%23d6efe2' d='M3 2h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M4 2h10v1h-10z'/%3E%3Cpath fill='%233a1b17' d='M14 2h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 3h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 3h1v1h-1z'/%3E%3Cpath fill='%23d6efe2' d='M3 3h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M4 3h2v1h-2z'/%3E%3Cpath fill='%23a8d4c0' d='M6 3h2v1h-2z'/%3E%3Cpath fill='%23a8d4c0' d='M8 3h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M9 3h2v1h-2z'/%3E%3Cpath fill='%23a8d4c0' d='M11 3h3v1h-3z'/%3E%3Cpath fill='%233a1b17' d='M14 3h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 4h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 4h3v1h-3z'/%3E%3Cpath fill='%23a8d4c0' d='M5 4h7v1h-7z'/%3E%3Cpath fill='%23a8d4c0' d='M12 4h2v1h-2z'/%3E%3Cpath fill='%233a1b17' d='M14 4h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 5h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 5h3v1h-3z'/%3E%3Cpath fill='%23a8d4c0' d='M5 5h7v1h-7z'/%3E%3Cpath fill='%23a8d4c0' d='M12 5h2v1h-2z'/%3E%3Cpath fill='%233a1b17' d='M14 5h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 6h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 6h4v1h-4z'/%3E%3Cpath fill='%23a8d4c0' d='M6 6h5v1h-5z'/%3E%3Cpath fill='%23a8d4c0' d='M11 6h3v1h-3z'/%3E%3Cpath fill='%233a1b17' d='M14 6h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 7h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 7h5v1h-5z'/%3E%3Cpath fill='%23a8d4c0' d='M7 7h3v1h-3z'/%3E%3Cpath fill='%23a8d4c0' d='M10 7h4v1h-4z'/%3E%3Cpath fill='%233a1b17' d='M14 7h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 8h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 8h6v1h-6z'/%3E%3Cpath fill='%23a8d4c0' d='M8 8h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M9 8h5v1h-5z'/%3E%3Cpath fill='%233a1b17' d='M14 8h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 9h14v1h-14z'/%3E%3Cpath fill='%233a1b17' d='M0 10h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M1 10h14v1h-14z'/%3E%3Cpath fill='%233a1b17' d='M15 10h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 11h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M1 11h1v1h-1z'/%3E%3Cpath fill='%23a98a6a' d='M2 11h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M3 11h1v1h-1z'/%3E%3Cpath fill='%23a98a6a' d='M4 11h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M5 11h1v1h-1z'/%3E%3Cpath fill='%23a98a6a' d='M6 11h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M7 11h1v1h-1z'/%3E%3Cpath fill='%23a98a6a' d='M8 11h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M9 11h1v1h-1z'/%3E%3Cpath fill='%23a98a6a' d='M10 11h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M11 11h1v1h-1z'/%3E%3Cpath fill='%23a98a6a' d='M12 11h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M13 11h2v1h-2z'/%3E%3Cpath fill='%233a1b17' d='M15 11h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 12h1v1h-1z'/%3E%3Cpath fill='%23e7d2b4' d='M1 12h6v1h-6z'/%3E%3Cpath fill='%23a98a6a' d='M7 12h4v1h-4z'/%3E%3Cpath fill='%23e7d2b4' d='M11 12h4v1h-4z'/%3E%3Cpath fill='%233a1b17' d='M15 12h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M1 13h14v1h-14z'/%3E%3C/svg%3E");
  --todo-pixel-bus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14' shape-rendering='crispEdges'%3E%3Cpath fill='%233a1b17' d='M2 1h12v1h-12z'/%3E%3Cpath fill='%233a1b17' d='M1 2h1v1h-1z'/%3E%3Cpath fill='%23fff4c8' d='M2 2h12v1h-12z'/%3E%3Cpath fill='%233a1b17' d='M14 2h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 3h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M1 3h14v1h-14z'/%3E%3Cpath fill='%233a1b17' d='M15 3h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 4h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M1 4h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 4h3v1h-3z'/%3E%3Cpath fill='%23e0a92e' d='M5 4h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M6 4h3v1h-3z'/%3E%3Cpath fill='%23e0a92e' d='M9 4h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M10 4h3v1h-3z'/%3E%3Cpath fill='%23e0a92e' d='M13 4h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M14 4h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M15 4h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 5h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M1 5h1v1h-1z'/%3E%3Cpath fill='%23d6efe2' d='M2 5h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M3 5h2v1h-2z'/%3E%3Cpath fill='%23e0a92e' d='M5 5h1v1h-1z'/%3E%3Cpath fill='%23d6efe2' d='M6 5h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M7 5h2v1h-2z'/%3E%3Cpath fill='%23e0a92e' d='M9 5h1v1h-1z'/%3E%3Cpath fill='%23d6efe2' d='M10 5h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M11 5h2v1h-2z'/%3E%3Cpath fill='%23e0a92e' d='M13 5h1v1h-1z'/%3E%3Cpath fill='%23d6efe2' d='M14 5h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M15 5h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 6h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M1 6h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M2 6h3v1h-3z'/%3E%3Cpath fill='%23e0a92e' d='M5 6h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M6 6h3v1h-3z'/%3E%3Cpath fill='%23e0a92e' d='M9 6h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M10 6h3v1h-3z'/%3E%3Cpath fill='%23e0a92e' d='M13 6h1v1h-1z'/%3E%3Cpath fill='%23a8d4c0' d='M14 6h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M15 6h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 7h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M1 7h14v1h-14z'/%3E%3Cpath fill='%233a1b17' d='M15 7h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 8h1v1h-1z'/%3E%3Cpath fill='%235e2f40' d='M1 8h14v1h-14z'/%3E%3Cpath fill='%233a1b17' d='M15 8h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 9h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M1 9h14v1h-14z'/%3E%3Cpath fill='%233a1b17' d='M15 9h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 10h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M1 10h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M2 10h4v1h-4z'/%3E%3Cpath fill='%23e0a92e' d='M6 10h4v1h-4z'/%3E%3Cpath fill='%233a1b17' d='M10 10h4v1h-4z'/%3E%3Cpath fill='%23e0a92e' d='M14 10h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M15 10h1v1h-1z'/%3E%3Cpath fill='%233a1b17' d='M0 11h3v1h-3z'/%3E%3Cpath fill='%23f8f4ec' d='M3 11h2v1h-2z'/%3E%3Cpath fill='%233a1b17' d='M5 11h6v1h-6z'/%3E%3Cpath fill='%23f8f4ec' d='M11 11h2v1h-2z'/%3E%3Cpath fill='%233a1b17' d='M13 11h3v1h-3z'/%3E%3Cpath fill='%233a1b17' d='M2 12h4v1h-4z'/%3E%3Cpath fill='%233a1b17' d='M10 12h4v1h-4z'/%3E%3C/svg%3E");
  --todo-pixel-telefonat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14' shape-rendering='crispEdges'%3E%3Cpath fill='%233a1b17' d='M2 1h12v1h-12z'/%3E%3Cpath fill='%233a1b17' d='M1 2h1v3h-1z'/%3E%3Cpath fill='%233a1b17' d='M14 2h1v3h-1z'/%3E%3Cpath fill='%23d9607a' d='M2 2h12v2h-12z'/%3E%3Cpath fill='%23d9607a' d='M2 4h3v1h-3z'/%3E%3Cpath fill='%23d9607a' d='M11 4h3v1h-3z'/%3E%3Cpath fill='%233a1b17' d='M5 4h6v1h-6z'/%3E%3Cpath fill='%233a1b17' d='M1 5h5v1h-5z'/%3E%3Cpath fill='%233a1b17' d='M10 5h5v1h-5z'/%3E%3Cpath fill='%233a1b17' d='M4 6h8v1h-8z'/%3E%3Cpath fill='%233a1b17' d='M3 7h1v6h-1z'/%3E%3Cpath fill='%233a1b17' d='M12 7h1v6h-1z'/%3E%3Cpath fill='%23f0a0ae' d='M4 7h8v6h-8z'/%3E%3Cpath fill='%23f8f4ec' d='M6 8h4v4h-4z'/%3E%3Cpath fill='%233a1b17' d='M7 9h2v2h-2z'/%3E%3Cpath fill='%233a1b17' d='M3 13h10v1h-10z'/%3E%3C/svg%3E");
  --todo-pixel-drucken: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14' shape-rendering='crispEdges'%3E%3Cpath fill='%233a1b17' d='M4 0h8v1h-8zM4 1h1v3h-1zM11 1h1v3h-1z'/%3E%3Cpath fill='%23ffffff' d='M5 1h6v3h-6z'/%3E%3Cpath fill='%233a1b17' d='M1 4h14v1h-14zM0 5h1v5h-1zM15 5h1v5h-1zM1 10h2v1h-2zM13 10h2v1h-2z'/%3E%3Cpath fill='%238fa7c4' d='M1 5h14v5h-14z'/%3E%3Cpath fill='%23f3d36b' d='M12 6h2v1h-2z'/%3E%3Cpath fill='%233a1b17' d='M3 8h10v1h-10zM3 9h1v4h-1zM12 9h1v4h-1zM3 13h10v1h-10z'/%3E%3Cpath fill='%23ffffff' d='M4 9h8v4h-8z'/%3E%3Cpath fill='%23b9a99a' d='M5 10h6v1h-6zM5 12h4v1h-4z'/%3E%3C/svg%3E");
  --todo-pixel-draussen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14' shape-rendering='crispEdges'%3E%3Cpath fill='%233a1b17' d='M5 0h6v1h-6zM3 1h2v1h-2zM11 1h2v1h-2zM2 2h1v5h-1zM13 2h1v5h-1zM3 7h2v1h-2zM11 7h2v1h-2zM5 8h1v1h-1zM10 8h1v1h-1z'/%3E%3Cpath fill='%237d9a5a' d='M5 1h6v1h-6zM3 2h10v5h-10zM5 7h6v1h-6z'/%3E%3Cpath fill='%23a8c47e' d='M5 2h3v2h-3z'/%3E%3Cpath fill='%233a1b17' d='M6 8h1v5h-1zM9 8h1v5h-1z'/%3E%3Cpath fill='%238a5a3a' d='M7 8h2v5h-2z'/%3E%3Cpath fill='%233a1b17' d='M0 13h16v1h-16z'/%3E%3C/svg%3E");
  --todo-pixel-muenze: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%233a1b17' d='M2 0h4v1h-4zM1 1h1v1h-1zM6 1h1v1h-1zM0 2h1v4h-1zM7 2h1v4h-1zM1 6h1v1h-1zM6 6h1v1h-1zM2 7h4v1h-4z'/%3E%3Cpath fill='%23e0a92e' d='M2 1h4v1h-4zM1 2h6v4h-6zM2 6h4v1h-4z'/%3E%3Cpath fill='%23fff4c8' d='M2 2h1v2h-1z'/%3E%3Cpath fill='%23a8741a' d='M4 2h1v4h-1zM5 5h1v1h-1z'/%3E%3C/svg%3E");
  --todo-pixel-funkeln: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23e0a92e' d='M4 0h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M4 1h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M3 2h1v1h-1z'/%3E%3Cpath fill='%23fff4c8' d='M4 2h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M5 2h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M0 3h3v1h-3z'/%3E%3Cpath fill='%23fff4c8' d='M3 3h3v1h-3z'/%3E%3Cpath fill='%23e0a92e' d='M6 3h3v1h-3z'/%3E%3Cpath fill='%23e0a92e' d='M3 4h1v1h-1z'/%3E%3Cpath fill='%23fff4c8' d='M4 4h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M5 4h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M4 5h1v1h-1z'/%3E%3Cpath fill='%23e0a92e' d='M4 6h1v1h-1z'/%3E%3C/svg%3E");
  --todo-pixel-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 5' shape-rendering='crispEdges'%3E%3Cpath fill='%233a1b17' d='M0 0h9v1h-9z'/%3E%3Cpath fill='%233a1b17' d='M1 1h7v1h-7z'/%3E%3Cpath fill='%233a1b17' d='M2 2h5v1h-5z'/%3E%3Cpath fill='%233a1b17' d='M3 3h3v1h-3z'/%3E%3Cpath fill='%233a1b17' d='M4 4h1v1h-1z'/%3E%3C/svg%3E");
  --todo-pixel-haken: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffffff' d='M8 0h1v1h-1z'/%3E%3Cpath fill='%23ffffff' d='M7 1h2v1h-2z'/%3E%3Cpath fill='%23ffffff' d='M0 2h1v1h-1z'/%3E%3Cpath fill='%23ffffff' d='M6 2h2v1h-2z'/%3E%3Cpath fill='%23ffffff' d='M0 3h2v1h-2z'/%3E%3Cpath fill='%23ffffff' d='M5 3h2v1h-2z'/%3E%3Cpath fill='%23ffffff' d='M1 4h2v1h-2z'/%3E%3Cpath fill='%23ffffff' d='M4 4h2v1h-2z'/%3E%3Cpath fill='%23ffffff' d='M2 5h3v1h-3z'/%3E%3Cpath fill='%23ffffff' d='M3 6h1v1h-1z'/%3E%3C/svg%3E");
  --linen: #efe9df;
  --paper: #f8f4ec;
  --ink: #3a1b17;
  --ink-soft: #75584f;
  --sage: #4a1f1c;
  --sage-light: #eed3ca;
  --rose: #8e4a40;
  --rust: #8f1d22;
  --honey: #bd9140;
  --border: #e0d6c8;
  --shadow: 0 4px 14px rgba(58, 27, 23, 0.12);
  --todo-feld: #e9e1d4;
}
/* Geräteschrift, nur etwas kräftiger als im Rest der App. */
html[data-bereich="todos"] body { background-image: none; font-weight: 500; }
html[data-bereich="todos"] :is(button, input, select, textarea) { font-weight: 500; }
html[data-bereich="todos"] :is(h1, h2, h3, h4) { font-family: inherit; font-weight: 700; }
html[data-bereich="todos"] .bereich-switch { padding: 3px; border: none; border-radius: 11px; background: var(--todo-feld); }
html[data-bereich="todos"] .bereich-switch button { padding: 6px 11px; border-radius: 8px; }
html[data-bereich="todos"] #searchInput { background-color: var(--todo-feld); }
html[data-bereich="todos"] #btnToggleSidebar { border: none; border-radius: 10px; background: var(--todo-feld); }
html[data-bereich="todos"] .eingang-fab { border-radius: 16px; background: var(--sage); }
html[data-bereich="todos"] .todo-alle-knopf { color: var(--ink); }
html[data-bereich="todos"] #appTitle::after {
  content: ""; display: inline-block; width: 18px; height: 14px; margin-left: 7px; vertical-align: 1px;
  background: var(--todo-pixel-funkeln) center / contain no-repeat;
}
html[data-bereich="todos"] .todo-liste { display: grid; gap: 11px; padding-left: 4px; padding-right: 4px; }
html[data-bereich="todos"] .todo-liste + .todo-liste { margin-top: 14px; }
/* Pixelkante wie alte Spiel-Textboxen: vier harte Schatten, die Ecken bleiben frei. */
html[data-bereich="todos"] .todo-liste .todo-zeile {
  gap: 11px; padding: 13px 28px 13px 13px; background: var(--paper);
  border: none; border-radius: 0;
  box-shadow: -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink), inset 0 2px 0 #ffffff66;
}
html[data-bereich="todos"] .todo-liste .todo-zeile[class*="todo-art-"] { border-left: 9px solid var(--todo-art); padding-left: 10px; }
html[data-bereich="todos"] .todo-stufe-1 .todo-stufe-titel { margin-left: 2px; margin-right: 2px; box-shadow: -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink); }
html[data-bereich="todos"] .todo-spalte { background: var(--todo-feld); }
html[data-bereich="todos"] .todo-spalte.todo-stufe-1 .todo-stufe-titel { margin: 0 -8px 12px; }
html[data-bereich="todos"] .todo-ansicht { border: none; border-radius: 11px; background: var(--todo-feld); }
html[data-bereich="todos"] .todo-aktionen .btn[class*="todo-art-"]::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; background: var(--todo-art); }
html[data-bereich="todos"] .todo-aktionen .btn[class*="todo-art-"].active::before { background: #fff; }
html[data-bereich="todos"] .todo-aktionen .btn[class*="todo-art-"].active { background: var(--todo-art); }
html[data-bereich="todos"] .todo-liste .wunsch-titel { font-size: 1rem; font-weight: 700; }
html[data-bereich="todos"] .todo-ist-erledigt .wunsch-titel { font-weight: 400; color: var(--ink); }
html[data-bereich="todos"] .todo-kreuz {
  appearance: none; flex: 0 0 18px; width: 18px; height: 18px; margin: 3px 2px 0;
  border: none; border-radius: 0; background: #ffffffb0 center / 14px auto no-repeat;
  box-shadow: -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink);
}
html[data-bereich="todos"] .todo-kreuz:checked { background-color: var(--ink); background-image: var(--todo-pixel-haken); }
html[data-bereich="todos"] .todo-liste .wunsch-notiz, html[data-bereich="todos"] .todo-frist-feld { color: var(--ink); }
html[data-bereich="todos"] .todo-marke { color: var(--ink); }
html[data-bereich="todos"] .todo-telefonat { color: #8a2f45; }
html[data-bereich="todos"] .todo-draussen { color: #4d6534; }
html[data-bereich="todos"] .todo-drucken { color: #3e5878; }
html[data-bereich="todos"] :is(.todo-laptop, .todo-bus, .todo-telefonat, .todo-draussen, .todo-drucken) { display: inline-flex; align-items: center; gap: 5px; }
html[data-bereich="todos"] .todo-laptop { color: #2f5f6b; }
html[data-bereich="todos"] .todo-bus { color: #6d4f0e; }
html[data-bereich="todos"] :is(.todo-laptop, .todo-bus, .todo-telefonat, .todo-draussen, .todo-drucken)::before { content: ""; width: 32px; height: 28px; background: var(--todo-pixel-laptop) center / contain no-repeat; }
html[data-bereich="todos"] .todo-bus::before { background-image: var(--todo-pixel-bus); }
html[data-bereich="todos"] .todo-telefonat::before { background-image: var(--todo-pixel-telefonat); }
html[data-bereich="todos"] .todo-draussen::before { background-image: var(--todo-pixel-draussen); }
html[data-bereich="todos"] .todo-drucken::before { background-image: var(--todo-pixel-drucken); }
/* Langdruck-Menü: Blatt von unten mit Pixelkante wie die Zeilen. */
dialog.modal.blatt-unten {
  width: min(520px, 100vw); max-width: 100vw; height: fit-content; max-height: 85dvh;
  margin: auto auto 0; border-radius: 0;
  box-shadow: 0 -2px 0 var(--ink), 0 -10px 40px rgba(60,45,25,0.3);
}
.blatt-unten .modal-inner { max-height: 85dvh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.todo-menue h2 { font-size: 1.1rem; }
.todo-menue h3 { margin: 14px 0 8px; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.todo-menue-reihe { display: flex; flex-wrap: wrap; gap: 8px; }
.todo-menue-knopf {
  min-height: 44px; padding: 6px 14px; border: none; background: var(--linen); color: var(--ink);
  font: inherit; font-size: 0.95rem; cursor: pointer;
  box-shadow: -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink);
}
.todo-menue-knopf.active { background: var(--sage); color: #fff; }
.todo-menue-knopf.active .todo-marke { color: #fff; }
.todo-menue-ab { margin-top: 10px; }
.todo-menue-eigene { margin-top: 10px; }
.todo-menue-neu { display: flex; gap: 8px; margin-top: 12px; }
.todo-menue-neu input {
  flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: none; background: #fff; color: var(--ink);
  box-shadow: -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink);
}
.todo-menue-unten { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.todo-menue-unten .btn { flex: 1; }
/* Lange drücken soll das Menü öffnen, nicht Text markieren. */
.todo-liste .todo-zeile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.todo-liste .todo-zeile .todo-infos { -webkit-user-select: text; user-select: text; }
html[data-bereich="todos"] .todo-muenzen { display: inline-flex; gap: 2px; margin-left: 8px; vertical-align: -2px; }
html[data-bereich="todos"] .todo-muenze { width: 14px; height: 14px; background: var(--todo-pixel-muenze) center / contain no-repeat; image-rendering: pixelated; }
html[data-bereich="todos"] .todo-ist-erledigt .todo-muenze { filter: grayscale(1); opacity: 0.5; }
html[data-bereich="todos"] .todo-legende-knopf.active { background: #ffffffb0; box-shadow: -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink); }
html[data-bereich="todos"] .todo-bereit { color: #3f6247; }
html[data-bereich="todos"] .todo-liste .todo-zeile.todo-wartend { background: #fbf8f2; }
html[data-bereich="todos"] .todo-frist-knapp { color: var(--rust); }
html[data-bereich="todos"] .todo-infos-knopf {
  top: 18px; right: 11px; width: 13px; height: 7px; border: none; opacity: 1; transform: none;
  background: var(--todo-pixel-pfeil) center / contain no-repeat;
}
html[data-bereich="todos"] .todo-zeile.offen .todo-infos-knopf { top: 18px; transform: rotate(180deg); }
html[data-bereich="todos"] .todo-mail { padding: 0; border: none; background: none; }
html[data-bereich="todos"] .todo-aktionen .btn { border-color: transparent; background: #ffffffa8; color: var(--ink); }
html[data-bereich="todos"] .todo-aktionen .btn.active { background: var(--sage); color: #fff; }
html[data-bereich="todos"] .todo-infos .btn-ghost { border-color: transparent; background: #ffffffa8; color: var(--ink); }
html[data-bereich="todos"] .todo-frist-feld input { border-color: transparent; background: #ffffffa8; }
html[data-bereich="todos"] .card-tags .tag { background: #ffffffb0; color: var(--ink); }
html[data-bereich="todos"] .todo-legende-art::before { border: 2px solid var(--ink); }

/* Küche: Farbmischung statt einer Farbe. Olivgrüner Kopf, heller Grund, Feige als
   Akzent, Tags neutral (die rote todo-Marke bleibt), klare und etwas dickere Schrift. */
html[data-bereich="kueche"] {
  --linen: #f6efe9;
  --paper: #fffdf8;
  --ink: #2b1a20;
  --ink-soft: #65525a;
  --sage: #5e2f40;
  --sage-light: #f6efe9;
  --border: #e8dcd3;
}
html[data-bereich="kueche"] body { background-image: none; font-weight: 500; }
html[data-bereich="kueche"] :is(button, input) { font-weight: 500; }
html[data-bereich="kueche"] :is(h1, h2, h3, h4) { font-family: inherit; font-weight: 700; }
html[data-bereich="kueche"] .card-tags .tag:not(.tag-todo) { background: var(--linen); color: var(--ink-soft); }
html[data-bereich="kueche"] .card-tags .tag-land, html[data-bereich="kueche"] .card-tags .tag-aufwand.aufwand-einfach { border-color: var(--border); }
html[data-bereich="kueche"] .vorschlag-head h2 { color: var(--sage); }
html[data-bereich="kueche"] .eingang-fab { background: var(--sage); color: #fff; }
html[data-bereich="kueche"] .app-header {
  --paper: #68784a;
  --ink: #f7ede3;
  --ink-soft: #e6e0cc;
  --border: #ffffff33;
  --linen: #ffffff1a;
  color: var(--ink);
}
html[data-bereich="kueche"] .app-header .btn:not(.btn-primary, .btn-secondary) { background: transparent; color: var(--ink); }
html[data-bereich="kueche"] .app-header input { color: var(--ink); }
html[data-bereich="kueche"] .app-header input::placeholder { color: #f7ede3cc; }
html[data-bereich="kueche"] .bereich-switch button.active { background: #f4ecd9; color: #2b1820; }

/* Zitate: dunkel und moody, tiefes Grün mit warmem Gold, Kopf in Altgold. */
html[data-bereich="zitate"] {
  --linen: #15352a;
  --paper: #1f4637;
  --ink: #f5eedd;
  --ink-soft: #bccbb6;
  --sage: #dcb56c;
  --sage-light: #2c5545;
  --rose: #dcb56c;
  --rust: #e8a08c;
  --border: #30594a;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
html[data-bereich="zitate"] body { background-image: radial-gradient(circle at 50% 0, rgba(201, 163, 106, 0.09) 0, transparent 55%); }
html[data-bereich="zitate"] .app-header {
  --paper: #c9a36a; --ink: #2a1a10; --ink-soft: #4a3420; --border: #2a1a1033; --linen: #2a1a101a;
  color: var(--ink);
}
html[data-bereich="zitate"] .app-header .btn:not(.btn-primary, .btn-secondary) { background: transparent; color: var(--ink); }
html[data-bereich="zitate"] .app-header input { color: var(--ink); }
html[data-bereich="zitate"] .app-header input::placeholder { color: var(--ink); opacity: 0.8; }
html[data-bereich="zitate"] :is(.unit-toggle button.active, .chip.active, .btn-primary, .btn-secondary, .eingang-fab) { color: #17131c; }
html[data-bereich="zitate"] .wunsch-zeile .wunsch-titel { font-family: Georgia, "Iowan Old Style", "Noto Serif", serif; font-size: 1.08rem; font-style: italic; font-weight: 400; line-height: 1.45; }

/* ---------- Eingang (Dropbox an Claude) ---------- */
/* 📥 schwebt immer unten rechts — ein Tipp, kein Umweg über ⋯. */
.eingang-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 30;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 12px 18px; border: none; border-radius: 999px;
  background: var(--sage); color: #fff; font: inherit; font-weight: 600;
  box-shadow: 0 4px 14px rgba(40, 30, 20, 0.28); cursor: pointer;
}
.eingang-fab:hover { filter: brightness(1.06); }
/* Heller Grund, sonst geht der dunkle Briefkasten auf dem Knopf unter. */
.eingang-fab { padding: 10px 12px; }
.eingang-fab .pixel-icon { width: 28px; height: 28px; padding: 3px; border-radius: 7px; background: #eed3ca; }
.eingang-fab .eingang-badge-wartet { background: #fff; color: var(--sage); }
.eingang-badge {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 999px;
  background: var(--rust);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.4em;
  text-align: center;
}
/* Hochgeladen, wartet auf Claude: ruhiger als das Rot für "nicht hochgeladen". */
.eingang-badge-wartet { background: var(--sage, #7c9070); }
.eingang .field { margin-top: 12px; }
.eingang textarea { min-height: 90px; }
.eingang-ablage { border: 2px dashed var(--border); border-radius: var(--radius); padding: 12px; }
.eingang-ablage.drueber { border-color: var(--sage); background: var(--sage-light); }
.eingang-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.eingang-knoepfe .btn { flex: 1 1 auto; }
.eingang-ablage textarea { width: 100%; margin-bottom: 8px; }
.eingang-zeile-wege { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.eingang-zeile-wege .btn { padding: 2px 8px; font-size: 0.8rem; }
.eingang-feld {
  min-height: 110px; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); white-space: pre-wrap; word-break: break-word;
  user-select: text; -webkit-user-select: text;
}
.eingang-feld:empty::before { content: attr(data-platzhalter); color: var(--ink-soft); }
.eingang-feld:focus { outline: 2px solid var(--sage); }
.eingang-feld img { max-height: 40px; }
.eingang-bild-knopf { margin-bottom: 8px; }
.eingang-wohin > summary { cursor: pointer; color: var(--ink-soft); font-size: 0.9rem; }
.eingang-wohin[open] > summary { margin-bottom: 8px; }
#eingangErkannt:empty { display: none; }
.eingang-bereiche { display: flex; flex-wrap: wrap; gap: 6px; }
.eingang-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.eingang-thumbs:empty { display: none; }
.eingang-thumb { position: relative; }
.eingang-thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.eingang-thumb button {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: var(--ink); color: #fff; font-size: 0.7rem; cursor: pointer;
}
.eingang-liste h3 { font-size: 1rem; margin: 24px 0 8px; padding-top: 14px; border-top: 1px dashed var(--border); }
.eingang-zeile { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.eingang-zeile img, .eingang-ohnebild {
  flex: none; width: 48px; height: 48px; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--linen);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.eingang-zeile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.9rem; overflow-wrap: anywhere; }
.eingang-zeile-bereich { font-size: 0.75rem; color: var(--ink-soft); }
.eingang-hochladen { width: 100%; margin-top: 12px; }

/* ---------- Sidebar ein-/ausklappen (Desktop) ---------- */
@media (min-width: 861px) {
  .sidebar.collapsed { width: 0; min-width: 0; overflow: hidden; }
  .sidebar.collapsed .sidebar-inner,
  .sidebar.collapsed .sidebar-resizer { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .mobile-only { display: inline-flex; }
  /* stretch: sonst ist der Inhalt nur so breit wie das, was gerade drinsteht. */
  .app-body { flex-direction: column; align-items: stretch; padding: 14px; gap: 0; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 84vw;
    max-width: 320px;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-inner { max-height: 100vh; height: 100%; border-radius: 0; }
  .sidebar-resizer { display: none; }
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(30,20,10,0.35);
    z-index: 40;
  }
  .sidebar-backdrop.open { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .zutat-row { grid-template-columns: 1fr; }
  .zutat-extra { grid-template-columns: 1fr; }
  .brand h1 { font-size: 1.15rem; }
}

/* ---------- Handy-Feinschliff (PWA) ---------- */
@media (max-width: 860px) {
  /* Handy ist bewusst reine Lese-/Koch-Ansicht — Anlegen, Bearbeiten,
     Löschen, Import und Export gibt es nur am Laptop. */
  .btn-neu, #btnImport, #btnExport,
  #btnEditRecipe, #btnDeleteRecipe { display: none; }

  /* Kopf am Handy: Titel + ⋯ | Bereichsleiste | Suche + Filter.
     Eingang/Builder erst nach Tipp auf ⋯ (Klasse mehr-offen). */
  .app-header {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 10px;
    padding: 8px 14px; transition: transform .22s ease;
  }
  .app-header.versteckt { transform: translateY(-100%); }
  .brand { grid-column: 1; grid-row: 1; }
  .brand-icon { width: 26px; height: 26px; }
  .brand h1 { font-size: 1.1rem; }
  .bereich-switch button { padding: 5px 12px; }
  .header-actions .btn { padding: 6px 12px; font-size: 0.9rem; }
  #searchInput { padding: 6px 10px 6px 34px; }
  .todo-bereich { padding-bottom: 72px; } /* letzte Zeile nicht unter dem Eingang-Knopf */
  .form-footer .btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
  #btnMehr { grid-column: 2; grid-row: 1; position: relative; font-size: 1.2rem; line-height: 1; padding: 3px 12px; }
  #btnMehr.builder-an { background: var(--sage); border-color: var(--sage); color: #fff; }
  #btnMehr.hat-hinweis::after {
    content: ""; position: absolute; top: 4px; right: 6px; width: 8px; height: 8px;
    border-radius: 50%; background: #c0573e;
  }
  .bereich-switch { grid-column: 1 / -1; }
  .header-actions { grid-column: 1 / -1; width: 100%; flex-wrap: wrap; }
  /* Nie zu einem Stummel quetschen ("Su"): lieber rutschen die Knöpfe in die nächste Zeile. */
  #searchInput { flex: 1 1 9rem; min-width: 9rem; }
  #btnBuilder, #btnLegende { display: none; }
  .app-header.mehr-offen #btnBuilder, .app-header.mehr-offen #btnLegende { display: inline-flex; flex: 1; justify-content: center; }

  /* Kopf nur eine Zeile: Bereiche | Lupe „überall“ | ⋯ (kein Titel „Meine Rezepte“).
     Hinter ⋯ ein Menü mit weiteren Bereichen, Builder und Legende (#mehrMenue);
     das Suchfeld klappt per Lupe als zweite Zeile auf (.such-offen). */
  .app-header { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; position: sticky; }
  .app-header .brand { display: none; }
  .bereich-switch { grid-column: 1; grid-row: 1; }
  #btnLupeUeberall { display: inline-flex; grid-column: 2; grid-row: 1; position: relative; padding: 5px 6px; line-height: 1; }
  #btnMehr { grid-column: 3; }
  /* Der „Mehr“-Tab steht nur noch da, wenn gerade so ein Bereich offen ist. */
  #btnBereichMehr:not(.active) { display: none; }
  .mehr-menue {
    display: none; position: absolute; top: calc(100% - 4px); right: 10px; z-index: 60; min-width: 200px;
    padding: 8px; border: 2px solid #2b1820; border-radius: 6px; box-shadow: 3px 3px 0 #2b1820;
    background: #fbf6ee; color: #2b1820;
    max-height: calc(100dvh - 90px); overflow-y: auto;
  }
  .app-header.mehr-offen .mehr-menue { display: block; }
  .mehr-menue small { display: block; padding: 4px 10px 2px; color: #7a6a64; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; }
  .mehr-menue button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: none; border-radius: 4px;
    background: none; color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer;
  }
  .mehr-menue button.active { background: #f2e3d6; }
  .mehr-menue hr { margin: 4px 0; border: none; border-top: 1px dashed #b9a99f; }
  /* Symbole im Menü etwa dreimal so viel Fläche wie im Fließtext (User-Wunsch 2026-11-06). */
  .mehr-menue { --pixel-zeichen-groesse: 32px; }
  .mehr-menue .pixel-icon, .mehr-menue img.pixel-zeichen { width: 32px; height: 32px; vertical-align: middle; }
  .mehr-menue button { gap: 12px; padding: 6px 10px; }
  /* Bereichs-Lupe rechts in der Zeile mit Normal/Kompakt (Inhalt, nicht Kopf). */
  .lupen { display: flex; gap: 4px; margin: 0 0 12px auto; padding-left: 6px; }
  .lupen .btn-lupe { display: inline-flex; position: relative; padding: 5px 6px; line-height: 1; }
  /* Damit Umschalter, Sortierung, Filter und Lupe in eine Zeile passen. */
  .ansicht-zeile .wunsch-sortierung { margin-left: 6px; }
  .ansicht-zeile .wunsch-sortierung button { padding-left: 7px; padding-right: 7px; }
  /* Umschalter nur als Symbol (☰ ▦ / ☰ ▥ / ⇕), Langtext steht am Laptop. */
  .umschalter-text { display: none; }
  .ansicht-zeile .unit-toggle button { padding-left: 11px; padding-right: 11px; }
  .ansicht-zeile .todo-alle-knopf { margin: 0 0 12px 6px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px; font-size: 1.05rem; color: inherit; }
  /* Filter-Trichter, drei Stufen (filterStufe): 0 zu, 1 Chips/Legende auf, 2 Seitenleiste. */
  body:not(.filter-offen) :is(.gruppen-chips, .todo-legende) { display: none; }
  .ansicht-zeile .filter-zeile-knopf { display: inline-flex; position: relative; margin: 0 0 12px 6px; padding: 5px 6px; }
  .filter-zeile-knopf svg { display: block; width: 20px; height: 20px; }
  .filter-zeile-knopf svg path { fill: #2b1820; }
  .filter-zeile-knopf.stufe1 { background: #fbf6ee; border-color: #2b1820; }
  .filter-zeile-knopf.stufe2 { background: #2b1820; border-color: #2b1820; }
  .filter-zeile-knopf.stufe2 svg path { fill: #fbf6ee; }
  .filter-zeile-knopf.filter-aktiv::after {
    content: ""; position: absolute; top: 1px; right: 1px; width: 7px; height: 7px;
    border-radius: 50%; background: #c0573e;
  }
  .btn-lupe img { width: 20px; height: 20px; image-rendering: pixelated; }
  .btn-lupe .lupe-erde { position: absolute; right: 2px; bottom: 1px; width: 12px; height: 12px; }
  .btn-lupe.aktiv { background: #fbf6ee; border-color: #2b1820; }
  /* header-actions am Handy nur noch fürs aufgeklappte Suchfeld. */
  .header-actions { display: none; grid-row: 2; }
  .app-header.such-offen .header-actions { display: flex; }
  #searchInput { display: none; }
  .app-header.such-offen .header-actions > :not(#searchInput) { display: none; }
  .app-header.such-offen #searchInput { display: block; flex: 1 1 100%; min-width: 0; width: 100%; }
  /* Handy: Knopf größer und etwas höher (nicht an der Gestenleiste), die
     Hinweise (Toasts) stehen auf gleicher Höhe links daneben
     (User-Wunsch 2026-11-05, Eingang emw3wipp7s5gjn). */
  .eingang-fab { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); padding: 14px 16px; border-radius: 22px; }
  .eingang-fab .pixel-icon { width: 46px; height: 46px; padding: 5px; border-radius: 10px; }
  .toast, .toast.show { left: auto; right: 108px; transform: none; max-width: calc(100vw - 130px); bottom: calc(101px + env(safe-area-inset-bottom)); }

  /* Detail-Ansicht als Vollbild — beim Kochen zählt Lesbarkeit */
  dialog.modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .modal-inner { max-height: 100dvh; padding: 18px 16px 28px; }

  /* Größere Touch-Flächen */
  .btn { padding: 11px 16px; }
  .chip { padding: 8px 14px; }
  .portionen-stepper button[data-step] { width: 36px; height: 36px; }
  .unit-toggle button { padding: 10px 16px; }
  .unit-toggle-sm button { padding: 8px 13px; }
  .group-tree button.tree-item { padding: 9px 8px; }
  .detail-row { padding: 9px 4px; }
}

/* ---------- 🛠 Builder-Modus ---------- */
#btnBuilder.active { background: var(--sage); border-color: var(--sage); color: #fff; }
/* Am Handy sind Anlegen/Bearbeiten/Löschen sonst ausgeblendet — im
   Builder kommen sie zurück. */
@media (max-width: 860px) {
  body.builder-an .btn-neu,
  body.builder-an #btnEditRecipe,
  body.builder-an #btnDeleteRecipe { display: inline-block; }
}
/* Zeilen ohne Detail-Ansicht (Wünsche, Links, Medien) öffnen im Builder das Formular. */
body.builder-an .wunsch-zeile[data-id],
body.builder-an .kachel[data-id]:not(.card) { cursor: pointer; }
.builder-marke { font-size: 0.8em; margin-left: 2px; }

.builder-status {
  margin: 4px 0 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--linen); border: 1px solid var(--border); font-size: 0.9rem;
}
.builder-status-lokal { background: #fbefd9; border-color: #e9cf9f; }
.builder-status-claude { background: #e6ecf6; border-color: #bccbe3; }
.builder-status-live { background: var(--sage-light); border-color: var(--sage); }
.builder-status-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.builder-wahl p { margin: 4px 0 14px; }
.builder-wahl-knopf {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; margin-bottom: 8px; text-align: left; border-radius: var(--radius-sm);
}
.builder-wahl-knopf small { font-size: 0.78rem; opacity: 0.85; }

/* ⚙ Builder-Einstellungen: nur sichtbar, solange der Builder an ist. */
#btnBuilderEinstellungen { display: none; }
body.builder-an #btnBuilderEinstellungen { display: inline-flex; }
@media (max-width: 860px) {
  body.builder-an #btnBuilderEinstellungen { display: none; }
  body.builder-an .app-header.mehr-offen #btnBuilderEinstellungen { display: inline-flex; flex: 0 0 auto; justify-content: center; }
}
.planb-schalter { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 4px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--linen); cursor: pointer; }
.planb-schalter input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.planb-schalter small { display: block; font-size: 0.8rem; color: var(--ink-soft); margin-top: 2px; }
#planBStand { margin-bottom: 12px; }
.planb-zeile { display: flex; gap: 8px; }
.planb-zeile input { flex: 1; min-width: 0; }

.builder-bilder-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.builder-bilder-titel { font-size: 0.8rem; min-width: 64px; color: var(--muted, #776); }
.builder-thumb { position: relative; margin: 0; width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; background: var(--linen); }
.builder-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.builder-thumb .row-remove { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; font-size: 0.7rem; background: rgba(255,255,255,0.9); }

/* Ideen mit grober Anleitung: Material-Liste, Tipp, Video-Link. */
.idee-material { margin: 0; padding-left: 20px; }
.idee-material li { margin: 3px 0; }
.idee-tipp { margin: 10px 0 4px; padding: 8px 12px; border-radius: var(--radius-sm); background: #fbefd9; font-size: 0.92rem; }
.idee-tutorial { display: inline-block; margin-top: 8px; }

/* "Gehört zusammen": antippbare Verweise auf andere Einträge. */
.verwandt-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.verwandt-chip {
  border: 1px solid var(--border); background: var(--paper); border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: 0.9rem; cursor: pointer;
}
.verwandt-chip:hover { border-color: var(--sage); }
.idee-tutorial { margin-right: 14px; }

/* ---------- 📔 Journal ---------- */
.j-status {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--ink-soft);
  padding: 8px 12px; margin-bottom: 14px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--paper);
}
.j-status-fehler { border-color: var(--rust); color: var(--rust); }
.j-status-ohne-schluessel { border-color: var(--honey); }

.j-pdf-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 14px; }
.j-pdf-leiste .hint { margin: 0; }
.j-dateien { display: grid; gap: 6px; margin: 10px 0 14px; }
.j-datei { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--paper); }
.j-datei-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; padding: 4px 2px; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.j-datei-name span { overflow-wrap: anywhere; text-decoration: underline; }
.j-datei-name small { flex: none; color: var(--ink-soft); }
.j-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dok-oeffentlich { display: grid; gap: 12px; margin-bottom: 16px; }
.dok-karte {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px;
}
.dok-karte h3 { margin: 0 0 6px; }
.dok-text { font-size: 0.9rem; color: var(--ink-soft); white-space: pre-line; user-select: text; font-variant-numeric: tabular-nums; }
.j-karte {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform .15s ease;
}
.j-karte:hover, .j-karte:focus-visible { transform: translateY(-2px); }
.j-karte-bild { aspect-ratio: 16 / 10; background: var(--sage-light) center / cover no-repeat; }
.j-karte-text { padding: 12px 14px 14px; }
.j-karte h3 { font-size: 1.15rem; margin-bottom: 2px; }
.j-datum { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 6px; }
.j-auszug { margin: 0 0 8px; font-size: 0.92rem; color: var(--ink-soft); line-height: 1.45; }
.j-tag-person { border-color: #b9c9e0; }
.j-tag-ort { border-color: #d9c49a; }

/* Ein Kasten: angenehm lesbare Spaltenbreite, Text wie in einem Buch. */
.j-kasten {
  max-width: 760px; margin: 0 auto; background: var(--paper);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 26px 30px;
}
.j-kasten-kopf { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.j-titel { font-size: 1.8rem; margin-bottom: 4px; }
.j-kasten-tags { margin: 6px 0 4px; }
.j-inhalt {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Noto Serif", serif;
  font-size: 1.07rem; line-height: 1.7; color: var(--ink); margin-top: 16px;
  overflow-wrap: anywhere;
}
.j-inhalt p { margin: 0 0 0.9em; }
.j-inhalt h3 { font-size: 1.3rem; margin: 1.4em 0 0.4em; color: var(--sage); }
.j-inhalt ul, .j-inhalt ol { margin: 0 0 0.9em; padding-left: 1.4em; }
.j-inhalt blockquote {
  margin: 1em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--rose);
  color: var(--ink-soft); font-style: italic;
}
.j-inhalt hr { border: none; border-top: 1px solid var(--border); margin: 1.6em 25%; }
.j-inhalt a { color: var(--rust); }
.j-inhalt figure { margin: 1.2em 0; }
.j-inhalt figure img {
  display: block; width: 100%; max-height: 75vh; object-fit: contain;
  border-radius: var(--radius-sm); background: var(--linen); cursor: zoom-in; min-height: 60px;
}
.j-inhalt figure.j-klein { max-width: 55%; margin-left: auto; margin-right: auto; }
.j-inhalt figcaption { font-size: 0.85rem; color: var(--ink-soft); text-align: center; margin-top: 6px; font-family: inherit; font-style: italic; }
.j-inhalt .j-galerie { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 1.2em 0; }
.j-inhalt .j-galerie:has(> figure:nth-child(3):last-child),
.j-inhalt .j-galerie:has(> figure:nth-child(5)) { grid-template-columns: repeat(3, 1fr); }
.j-inhalt .j-galerie figure { margin: 0; }
.j-inhalt .j-galerie img { aspect-ratio: 1; object-fit: cover; height: 100%; }
.j-bild-fehlt { opacity: 0.4; }

.j-viewer {
  position: fixed; inset: 0; z-index: 1000; background: rgba(30, 22, 15, 0.94);
  display: flex; align-items: center; justify-content: center;
}
.j-viewer img { max-width: 96vw; max-height: 94vh; object-fit: contain; }

/* Bearbeiten */
.j-titel-input {
  width: 100%; border: none; border-bottom: 1px dashed var(--border); background: transparent;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Noto Serif", serif;
  font-size: 1.6rem; font-weight: 600; color: var(--ink); padding: 4px 0; outline: none;
}
.j-daten { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; font-size: 0.85rem; color: var(--ink-soft); }
.j-daten input { margin-left: 4px; }
.j-tags-edit { margin-bottom: 8px; }
.j-tag-neu { border-style: dashed; }
.j-tag-picker { margin-top: 8px; padding: 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.j-tag-picker .chip-list { margin-bottom: 8px; }
.j-tag-neu-zeile { display: flex; gap: 6px; flex-wrap: wrap; }
.j-tag-neu-zeile input { flex: 1; min-width: 140px; }
.j-toolbar {
  display: flex; gap: 2px; flex-wrap: wrap; padding: 4px;
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-sm);
  position: sticky; top: 74px; z-index: 15; box-shadow: var(--shadow);
}
.j-toolbar button {
  min-width: 38px; height: 36px; border: none; background: transparent; border-radius: 6px;
  font-size: 1rem; color: var(--ink); cursor: pointer;
}
.j-toolbar button:hover { background: var(--sage-light); }
.j-editor {
  min-height: 45vh; outline: none; padding: 6px 2px 40px;
}
.j-editor:empty::before, .j-editor > p:only-child:empty::before { content: "Erzähl …"; color: var(--ink-soft); }
.j-editor figure { cursor: pointer; }
.j-editor figure img { cursor: pointer; }
.j-editor .j-markiert img { outline: 3px solid var(--sage); outline-offset: 2px; }
.j-bild-menue {
  position: absolute; z-index: 40; display: flex; gap: 2px; flex-wrap: wrap; max-width: calc(100vw - 16px);
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(60, 45, 25, 0.25); padding: 4px;
}
.j-bild-menue button {
  border: none; background: transparent; border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 0.9rem; cursor: pointer;
}
.j-bild-menue button:hover { background: var(--sage-light); }
.j-loeschen { margin-top: 24px; color: var(--rust); }
.journal-pw .modal-inner input { width: 100%; margin-top: 10px; }
.j-pw-fehler { color: var(--rust); min-height: 1em; }
.j-wahl { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.j-wahl-zeile {
  text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--paper); font: inherit; cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
}
.j-wahl-zeile span { color: var(--ink-soft); font-size: 0.85rem; }
/* Beim Schreiben stört der schwebende 📥-Knopf. */
body.journal-schreiben .eingang-fab { display: none; }

@media (max-width: 860px) {
  .j-karten { grid-template-columns: 1fr; }
  .j-kasten { padding: 14px 14px 24px; border-radius: var(--radius-sm); }
  .j-titel { font-size: 1.5rem; }
  /* Formatierungsleiste klebt am Handy direkt über der Tastatur. */
  .j-toolbar {
    position: fixed; left: 0; right: 0; top: auto; bottom: var(--j-tastatur, 0px);
    border-radius: 0; border-width: 1px 0 0; flex-wrap: nowrap; overflow-x: auto; z-index: 35;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
  }
  .j-toolbar button { flex: 0 0 auto; min-width: 42px; height: 40px; }
  .j-editor { padding-bottom: 90px; }
}

/* Karte über einer Untergruppe (UNTERGRUPPEN_BILDER in app.js). */
.untergruppen-bild { display: block; width: 100%; max-width: 640px; margin: 6px 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* Kurzes Formular: alles außer Titel + Notiz eingeklappt. */
.form-mehr { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.form-mehr > summary { cursor: pointer; color: var(--ink-soft); font-size: 0.9rem; padding: 4px 0; }
.form-mehr[open] > summary { margin-bottom: 8px; }
.todo-form-felder { display: grid; gap: 10px; margin: 14px 0 6px; }
.todo-form-reihe { display: grid; grid-template-columns: 4.5rem 1fr; align-items: center; gap: 10px; }
.todo-form-titel { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.todo-form-reihe .todo-aktionen { margin-top: 0; gap: 6px; }
.todo-form-reihe .todo-frist-feld input { padding: 7px 10px; }
.todo-form-reihe .todo-frist-feld[hidden] { display: none; }
/* Am Handy Beschriftung über den Knöpfen, sonst bricht jede Reihe unruhig um. */
@media (max-width: 600px) {
  .todo-form-felder { gap: 12px; }
  .todo-form-reihe { grid-template-columns: 1fr; gap: 5px; }
  .todo-form-reihe .todo-aktionen .btn { padding: 7px 12px; }
}

/* Legende der Anfangswörter (⋯ → Legende) */
.legende-tabelle { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.9rem; }
.legende-tabelle th, .legende-tabelle td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legende-tabelle td:first-child { font-weight: 600; white-space: nowrap; }

/* Timeline: Hafer-Beige wie die To-dos, Linie mit Pixel-Punkten, Bilder seitlich wischbar */
html[data-bereich="timeline"] {
  --linen: #efe9df; --paper: #f8f4ec; --ink: #3a1b17; --ink-soft: #75584f;
  --sage: #4a1f1c; --sage-light: #eed3ca; --border: #e0d6c8;
}
html[data-bereich="timeline"] body { background-image: none; }
html[data-bereich="timeline"] :is(#searchInput, #btnToggleSidebar, .lupen) { display: none; }
html[data-bereich="timeline"] .sidebar { display: none; }
.timeline { max-width: 760px; margin: 0 auto; padding: 14px 16px 90px; }
.timeline-hinweis { margin: 0 0 22px; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.45; }
.timeline-station { position: relative; padding: 0 0 30px 22px; border-left: 2px solid #cf9a8d; margin-left: 5px; }
.timeline-station:last-child { border-left-color: transparent; }
.timeline-station::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; background: #4a1f1c; box-shadow: 0 0 0 2px #efe9df; }
.timeline-station time { display: block; color: #8e4a40; font-size: 0.85rem; font-weight: 600; }
.timeline-station h2 { margin: 2px 0 6px; font-family: inherit; font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.timeline-station p { margin: 0 0 6px; color: var(--ink); line-height: 1.45; }
.timeline-zahl { color: var(--ink-soft); font-size: 0.85rem; }
.timeline-bilder { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.timeline-bilder img { flex: none; height: 340px; width: auto; border: 2px solid #3a1b17; border-radius: 10px; background: var(--paper); cursor: zoom-in; scroll-snap-align: start; }

/* Pixel-Symbole statt Emojis im Text (js/pixel_zeichen.js). Auf dunklen Knöpfen
   mit hellem Grund, sonst gehen die dunklen Umrisse unter.
   Die Zeichen sind <img> — Foto-Regeln wie ".card-foto img", ".wunsch-bild img"
   oder ".detail-foto img" würden sie sonst auf Fotogröße aufblasen (Poster mit
   "✓ 🔁" zeigten nur noch das riesige 🔁). Deshalb gewinnen Größe und Lage hier
   immer; eine andere Größe geht nur über --pixel-zeichen-groesse. */
img.pixel-zeichen {
  width: var(--pixel-zeichen-groesse, 18px) !important; height: var(--pixel-zeichen-groesse, 18px) !important;
  min-width: 0 !important; min-height: 0 !important; max-width: none !important; max-height: none !important;
  position: static !important; display: inline-block !important; flex: none !important;
  aspect-ratio: auto !important; object-fit: contain !important;
  vertical-align: -4px; image-rendering: pixelated; border: 0; border-radius: 0; background: none; cursor: inherit;
}
.btn-primary .pixel-zeichen, .btn-danger .pixel-zeichen, .toast .pixel-zeichen, .eingang-fab .pixel-zeichen {
  box-sizing: content-box; padding: 1px; border-radius: 3px; background: #eed3ca;
}
html[data-bereich="zitate"] .pixel-zeichen { filter: drop-shadow(0 0 1px #f4e9d3); }

/* Gleiche Machart wie die Küche: ruhige Flächen, farbiger Kopf, Geräteschrift. */
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) body { background-image: none; font-weight: 500; }
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) :is(button, input) { font-weight: 500; }
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) :is(h1, h2, h3, h4) { font-family: inherit; font-weight: 700; }
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) .card-tags .tag:not(.tag-todo) { background: var(--linen); color: var(--ink-soft); }
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) .vorschlag-head h2 { color: var(--sage); }
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) .app-header { color: var(--ink); }
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) .app-header .btn:not(.btn-primary, .btn-secondary) { background: transparent; color: var(--ink); }
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) .app-header input { color: var(--ink); }
html:is([data-bereich="werkstatt"], [data-bereich="wunschliste"], [data-bereich="china"], [data-bereich="medien"], [data-bereich="journal"], [data-bereich="dokumente"], [data-bereich="ideen"]) .app-header input::placeholder { color: var(--ink); opacity: 0.8; }

/* Werkstatt: Walnuss und Mint. */
html[data-bereich="werkstatt"] {
  --linen: #f4ece0; --paper: #fffaf2; --ink: #2e1d18; --ink-soft: #6c5a4e;
  --sage: #2f6b5b; --sage-light: #f4ece0; --border: #e6dacb;
}
html[data-bereich="werkstatt"] .app-header {
  --paper: #6b4a38; --ink: #f8efe3; --ink-soft: #e6d6c5; --border: #f8efe333; --linen: #f8efe31a;
}
html[data-bereich="werkstatt"] .bereich-switch button.active { background: #a8d4c0; color: #1f3a30; }

/* Wünsche: Altrosa, Burgund, Gold. */
html[data-bereich="wunschliste"] {
  --linen: #f9eee9; --paper: #fffaf7; --ink: #33191a; --ink-soft: #6e5050;
  --sage: #7a2430; --sage-light: #f9eee9; --border: #efdcd5;
}
html[data-bereich="wunschliste"] .app-header {
  --paper: #cf9a8d; --ink: #3a1b17; --ink-soft: #57302a; --border: #3a1b1733; --linen: #3a1b171a;
}
html[data-bereich="wunschliste"] .bereich-switch button.active { background: #fff3d6; color: #3a1b17; }

/* China: Jade und Lackrot. */
html[data-bereich="china"] {
  --linen: #f3efe3; --paper: #fffcf4; --ink: #1f2a26; --ink-soft: #59645d;
  --sage: #9c3b2e; --sage-light: #f3efe3; --border: #e3ddcd;
}
html[data-bereich="china"] .app-header {
  --paper: #2f5f55; --ink: #f3efdf; --ink-soft: #d4dfd0; --border: #f3efdf33; --linen: #f3efdf1a;
}
html[data-bereich="china"] .bereich-switch button.active { background: #f0cfa8; color: #3a1b17; }

/* Medien: Kino mit Schoko, Kinorot und Gold. */
html[data-bereich="medien"] {
  --linen: #f3ece2; --paper: #fffaf3; --ink: #2a1a1f; --ink-soft: #66555a;
  --sage: #9c2f3a; --sage-light: #f3ece2; --border: #e6dccf;
}
html[data-bereich="medien"] .app-header {
  --paper: #2a1a1f; --ink: #f7ecd9; --ink-soft: #d9c8b6; --border: #f7ecd933; --linen: #f7ecd91a;
}
html[data-bereich="medien"] .bereich-switch button.active { background: #e0a92e; color: #2a1a1f; }

/* Journal: Beere und Altrosa. */
html[data-bereich="journal"] {
  --linen: #f9efe9; --paper: #fffaf6; --ink: #34191f; --ink-soft: #6f545c;
  --sage: #5e2f40; --sage-light: #f9efe9; --border: #efdfd8;
}
html[data-bereich="journal"] .app-header {
  --paper: #8a4f63; --ink: #fff1ec; --ink-soft: #f0d5d0; --border: #fff1ec33; --linen: #fff1ec1a;
}
html[data-bereich="journal"] .bereich-switch button.active { background: #eed3ca; color: #3a1b17; }

/* Dokumente: Karton und Schoko. */
html[data-bereich="dokumente"] {
  --linen: #f2ead9; --paper: #fffaef; --ink: #2e1d18; --ink-soft: #6a5848;
  --sage: #4a2a20; --sage-light: #f2ead9; --border: #e5d9c2;
}
html[data-bereich="dokumente"] .app-header {
  --paper: #b08d62; --ink: #2e1d12; --ink-soft: #46301f; --border: #2e1d1233; --linen: #2e1d121a;
}
html[data-bereich="dokumente"] .bereich-switch button.active { background: #fff5e0; color: #2e1d12; }

/* Ideen: Altrosa und Moos. */
html[data-bereich="ideen"] {
  --linen: #f8f4ec; --paper: #fffdf8; --ink: #2b1a20; --ink-soft: #65525a;
  --sage: #68784a; --sage-light: #f8f4ec; --border: #e8dcd3;
}
html[data-bereich="ideen"] .app-header {
  --paper: #eed3ca; --ink: #3a1b17; --ink-soft: #5c3a33; --border: #3a1b1733; --linen: #3a1b171a;
}
html[data-bereich="ideen"] .bereich-switch button.active { background: #68784a; color: #fff; }
