/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
input, select, button, textarea { font-family: inherit; font-size: inherit; }

/* ── Light Mode (default) ── */
:root {
  --bg-0: #f5f5f0;
  --bg-1: #ffffff;
  --bg-2: #f0f0ea;
  --bg-3: #e8e8e0;
  --accent: #3b6d11;
  --accent-light: #639922;
  --accent-bg: #f2f2ef;
  --green: #3b6d11;
  --amber: #ba7517;
  --amber-bg: #faeeda;
  --red: #a32d2d;
  --red-bg: #fcebeb;
  --text: #1a1a16;
  --text-muted: #76766b;
  --border: rgba(0,0,0,0.05);
  --border-md: rgba(0,0,0,0.09);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(20,20,15,0.04), 0 2px 8px rgba(20,20,15,0.04);
  --shadow-pop:  0 6px 28px rgba(20,20,15,0.10);
  --shadow-fab:  0 4px 16px rgba(59,109,17,0.30), 0 2px 6px rgba(20,20,15,0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Dark Mode (umschaltbar über .dark-Klasse; "System" setzt sie per JS) ── */
:root.dark {
    --bg-0: #0e0e0e;
    --bg-1: #1c1c1c;
    --bg-2: #262626;
    --bg-3: #303030;
    --accent: #6aaa2e;
    --accent-light: #a3d977;
    --accent-bg: #1e2419;
    --green: #6aaa2e;
    --amber: #e09020;
    --amber-bg: #231a08;
    --red: #e05050;
    --red-bg: #231010;
    --text: #f0f0ec;
    --text-muted: #888884;
    --border: rgba(255,255,255,0.06);
    --border-md: rgba(255,255,255,0.12);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 2px 10px rgba(0,0,0,0.35);
    --shadow-pop:  0 8px 30px rgba(0,0,0,0.55);
    --shadow-fab:  0 4px 18px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
}

/* ── Screens ── */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; }

/* ── Auth Screen ── */
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(59,109,17,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(186,117,23,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.auth-card {
  position: relative; z-index: 1;
  margin: auto;
  width: min(400px, 92vw);
  padding: 40px 32px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.logo { text-align: center; margin-bottom: 8px; }
.logo-icon { font-size: 48px; display: block; margin-bottom: 8px; }
.logo h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.5px; color: var(--text); }
.logo p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ── Form Elements ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.field input, .field select {
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6b60' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field-row { display: flex; gap: 10px; }

/* ── Theme-Umschalter (Profil) ── */
.theme-switch { display: flex; gap: 8px; }
.theme-switch button {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px;
  background: var(--bg-2);
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit; font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.theme-switch button .ti { font-size: 17px; }
.theme-switch button.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

/* ── Lagerort-Picker (Chips) ── */
.loc-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.loc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1.5px solid var(--border-md);
  background: var(--bg-1);
  color: var(--text);
  font-family: inherit; font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.loc-chip .ti { font-size: 17px; color: var(--text-muted); transition: color 0.15s; }
.loc-chip.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}
.loc-chip.selected .ti { color: var(--accent); }
.loc-chip:active { transform: scale(0.97); }

/* ── Buttons ── */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-ghost {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost:hover { background: var(--bg-2); }
.btn-ghost.danger { color: var(--red); border-color: rgba(162,45,45,0.3); }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.btn-google {
  width: 100%;
  padding: 13px;
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, transform 0.1s;
}
.btn-google:hover { background: var(--bg-2); }
.btn-google:active { transform: scale(0.98); }
.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--bg-2); }
.icon-btn .ti { font-size: 20px; }

/* ── Error / OK ── */
.error-msg {
  font-size: 13px; color: var(--red);
  background: var(--red-bg);
  border: 1px solid rgba(162,45,45,0.2);
  border-radius: 8px; padding: 10px 12px;
}
.ok-msg {
  font-size: 13px; color: var(--green);
  background: var(--accent-bg);
  border: 1px solid rgba(59,109,17,0.2);
  border-radius: 8px; padding: 10px 12px;
}

/* ── Topbar ── */
.topbar {
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  padding-top: max(var(--safe-top), 12px);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 12px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; position: relative; }
.logo-sm { font-size: 22px; }
.topbar-left h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; gap: 4px; }
.member-dots { display: flex; margin-top: 2px; }
.member-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg-1);
  margin-right: -5px;
  font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}

/* ── Search Bar ── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}
.search-bar.hidden { display: none; }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }
.search-bar .ti { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none;
  color: var(--text); font-size: 15px; outline: none;
}
.search-bar button {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 18px; padding: 2px 6px;
}

/* ── Stats Bar ── */
.stats-bar {
  display: flex; gap: 10px;
  padding: 14px 16px 4px;
  background: var(--bg-0);
  overflow-x: auto; scrollbar-width: none;
}
.stats-bar::-webkit-scrollbar { display: none; }
.stat-chip {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 12px;
  flex: 1; min-width: 0;
}
.stat-chip.warn { border-color: rgba(186,117,23,0.18); }
.stat-chip.danger { border-color: rgba(162,45,45,0.18); }
.stat-ring {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.stat-ring .ti { font-size: 20px; color: var(--accent); }
.stat-chip.warn .stat-ring { border-color: var(--amber); }
.stat-chip.warn .stat-ring .ti { color: var(--amber); }
.stat-chip.danger .stat-ring { border-color: var(--red); }
.stat-chip.danger .stat-ring .ti { color: var(--red); }
.stat-num { font-size: 27px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; color: var(--text); }
.stat-chip.warn .stat-num { color: var(--amber); }
.stat-chip.danger .stat-num { color: var(--red); }
.stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: center; }

/* ── Greeting Bar ── */
.greeting-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px 4px;
  background: var(--bg-0);
}
.greeting-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.greeting-icon .ti { font-size: 22px; color: var(--accent); }
.greeting-text { min-width: 0; }
.greeting-hello { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.greeting-sub { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; color: var(--text); }

/* ── Main Content ── */
.main-content {
  flex: 1;
  padding: 16px 16px 104px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}

/* ── Section ── */
.section {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.section-header {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 18px;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--border);
}
.section-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.section-title { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; flex: 1; color: var(--text); }
.section-count {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-2);
  padding: 2px 8px; border-radius: 20px;
}
.section-chevron {
  color: var(--text-muted);
  transition: transform 0.2s; font-size: 16px;
}
.section.collapsed .section-chevron { transform: rotate(-90deg); }
.section.collapsed .items-list { display: none; }

/* ── Item ── */
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.item:last-child { border-bottom: none; }
.item:active { background: var(--bg-2); }
.item-color { width: 3px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.item-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.item-note { font-size: 11px; color: var(--text-muted); opacity: 0.7; font-style: italic; margin-top: 1px; }
.exp-badge {
  font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 20px;
  flex-shrink: 0; white-space: nowrap;
}
.exp-ok { background: var(--bg-2); color: var(--text-muted); }
.exp-soon { background: var(--amber-bg); color: var(--amber); }
.exp-bad { background: var(--red-bg); color: var(--red); }
.item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.item-btn {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer; padding: 4px 6px;
  border-radius: 6px; font-size: 15px;
  transition: color 0.1s, background 0.1s;
}
.item-btn:active { background: var(--bg-3); }
.item-btn .ti { font-size: 18px; }

/* ── Empty State ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 40px 20px;
  color: var(--text-muted); text-align: center;
}
.empty-state .empty-icon { font-size: 40px; opacity: 0.4; }
.empty-state .empty-icon .ti { font-size: 44px; }
.empty-state p { font-size: 14px; }

/* ── Cart ── */
.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-check {
  width: 20px; height: 20px;
  border: 1.5px solid var(--border-md);
  border-radius: 6px; flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.cart-check.checked { background: var(--accent); border-color: var(--accent); }
.cart-check.checked::after { content: '✓'; color: white; font-size: 12px; font-weight: 700; }
.cart-label { flex: 1; font-size: 14px; color: var(--text); transition: opacity 0.15s; }
.cart-label.done { text-decoration: line-through; opacity: 0.4; }
.cart-origin { font-size: 11px; color: var(--text-muted); }
.cart-del {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px;
}

/* ── Expiring ── */
.expiring-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.expiring-item:last-child { border-bottom: none; }

/* ── Member Card ── */
.member-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.member-card:last-child { border-bottom: none; }
.member-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.member-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--text); }
.member-role { font-size: 12px; color: var(--text-muted); }

/* ── Action Card ── */
.action-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.action-card:last-child { border-bottom: none; }
.action-card:active { background: var(--bg-2); }
.action-icon {
  width: 34px; height: 34px;
  border-radius: 10px; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.action-label { font-size: 14px; font-weight: 500; flex: 1; color: var(--text); }
.action-arrow { color: var(--text-muted); font-size: 16px; }
.action-icon .ti { font-size: 19px; color: var(--accent); }
.action-arrow .ti { font-size: 18px; }
.section-icon .ti { font-size: 17px; color: var(--accent); }

/* ── FAB ── */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(68px + var(--safe-bottom) + 16px);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none; color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 40;
}
.fab:active { transform: scale(0.92); }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
  z-index: 50;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px 8px;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer; font-size: 11px;
  position: relative; transition: color 0.15s;
}
.nav-item.active { color: var(--accent); }
.nav-item svg { transition: transform 0.15s; }
.nav-item.active svg { transform: scale(1.1); }
.nav-item .ti { font-size: 23px; transition: transform 0.15s; }
.nav-item.active .ti { transform: scale(1.1); }
.badge {
  position: absolute; top: 6px; right: calc(50% - 18px);
  background: var(--red); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── Modals ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-pop);
  padding: 24px 22px calc(24px + var(--safe-bottom));
  width: 100%; max-width: 500px;
  display: flex; flex-direction: column; gap: 18px;
  animation: slideUp 0.25s ease;
  max-height: 92vh; overflow-y: auto;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--bg-3);
  border-radius: 2px; margin: 0 auto 4px; flex-shrink: 0;
}
.modal-sheet h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; color: var(--text); }

/* ── Invite Code ── */
.invite-code-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px; text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 28px; letter-spacing: 6px;
  color: var(--accent); font-weight: 500;
}

/* ── Location Colors ── */
.loc-kuehl { background: rgba(55,138,221,0.5); }
.loc-gefriere { background: rgba(127,119,221,0.5); }
.loc-speise { background: rgba(59,109,17,0.5); }
.loc-gemuese { background: rgba(99,153,34,0.5); }
.loc-keller { background: rgba(136,135,128,0.5); }

/* ── Section icon backgrounds ── */
.si-kuehl { background: var(--bg-2); }
.si-gefriere { background: var(--bg-2); }
.si-speise { background: var(--bg-2); }
.si-gemuese { background: var(--bg-2); }
.si-keller { background: var(--bg-2); }

/* ── Loader ── */
.loader { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner {
  width: 26px; height: 26px;
  border: 2.5px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg-1);
  padding: 9px 18px;
  border-radius: 20px; font-size: 13px; font-weight: 500;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 200;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Emoji Picker ── */
.emoji-btn {
  width: 38px; height: 38px;
  border-radius: 10px; border: 1.5px solid transparent;
  background: var(--bg-2); font-size: 20px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, transform 0.1s;
}
.emoji-btn:active { transform: scale(0.9); }
.emoji-btn.selected { border-color: var(--accent); background: var(--accent-bg); }

/* ── Profile Button ── */
.profile-btn {
  width: 32px; height: 32px;
  border-radius: 50%; background: var(--bg-2);
  border: 1.5px solid var(--border-md);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s; overflow: hidden; flex-shrink: 0;
}
.profile-btn:hover { border-color: var(--accent); }

/* ── Dropdown ── */
.dropdown-overlay { display: none; position: fixed; inset: 0; z-index: 90; }
.dropdown-overlay.open { display: block; }
.dropdown-menu {
  position: fixed; top: calc(var(--safe-top) + 58px); right: 12px;
  background: var(--bg-1); border: 1px solid var(--border-md);
  border-radius: var(--radius); min-width: 220px; overflow: hidden;
  box-shadow: var(--shadow-pop);
  animation: fadeInDown 0.15s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.dropdown-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; border: 1px solid var(--border);
}
.dropdown-name { font-size: 14px; font-weight: 600; color: var(--text); }
.dropdown-email { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; font-size: 14px; color: var(--text);
  cursor: pointer; transition: background 0.1s;
}
.dropdown-item:hover { background: var(--bg-2); }
.dropdown-item.danger { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); }

/* ── Household Switcher ── */
.hh-switcher {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm); transition: background 0.15s; max-width: 200px;
}
.hh-switcher:hover { background: var(--bg-2); }
.hh-switcher h2 {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}

/* ── HH Dropdown ── */
.hh-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--bg-1); border: 1px solid var(--border-md);
  border-radius: var(--radius); min-width: 220px; overflow: hidden;
  box-shadow: var(--shadow-pop); z-index: 60;
  animation: fadeInDown 0.15s ease;
}
.hh-dropdown.open { display: block; }
.hh-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer;
  transition: background 0.1s; font-size: 14px; color: var(--text);
}
.hh-dd-item:hover { background: var(--bg-2); }
.hh-dd-item.active { color: var(--accent); }
.hh-dd-emoji { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.hh-dd-name { flex: 1; }
.hh-dd-check { color: var(--accent); font-weight: 700; }
.hh-dd-divider { height: 1px; background: var(--border); }

/* ── My Households Modal ── */
.my-hh-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.my-hh-item:last-child { border-bottom: none; }
.my-hh-item.active { background: var(--bg-2); }
.my-hh-emoji {
  width: 36px; height: 36px; border-radius: 10px; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.my-hh-name { font-size: 14px; font-weight: 500; color: var(--text); }

/* ── HH Emoji Buttons ── */
.hh-emoji-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1.5px solid transparent; background: var(--bg-2);
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, transform 0.1s;
}
.hh-emoji-btn:active { transform: scale(0.9); }
.hh-emoji-btn.selected { border-color: var(--accent); background: var(--accent-bg); }
.hh-emoji-btn .ti { font-size: 20px; color: var(--text); }
.hh-emoji-btn.selected .ti { color: var(--accent); }

/* ── System Banners ── */
.system-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
}
.system-banner.danger { background: var(--red-bg); color: var(--red); border-bottom: 1px solid rgba(162,45,45,0.2); }
.system-banner.warn   { background: var(--amber-bg); color: var(--amber); border-bottom: 1px solid rgba(186,117,23,0.2); }

/* ── Select Mode ── */
.select-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-2);
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  margin-bottom: 4px; font-size: 14px; font-weight: 500; color: var(--text);
}
.select-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.select-check.checked { background: var(--accent); border-color: var(--accent); }
.select-check.checked::after { content: '✓'; color: white; font-size: 12px; font-weight: 700; }
.item.selected { background: var(--bg-2); }

/* ── Cart Add Bar ── */
.cart-add-bar {
  display: flex; gap: 8px; padding: 12px 14px;
  background: var(--bg-1); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-card); margin-bottom: 4px;
}
.cart-add-bar input {
  flex: 1; background: transparent; border: none;
  color: var(--text); font-size: 14px; outline: none;
}
.cart-add-bar button {
  background: var(--accent); border: none;
  border-radius: 8px; color: white;
  font-size: 20px; font-weight: 300;
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ── Emoji font fix ── */
.section-icon, .member-avatar, .member-dot, .hh-dd-emoji,
.my-hh-emoji, .dropdown-avatar, .logo-icon, .logo-sm,
.action-icon, .emoji-btn, .hh-emoji-btn, .household-topbar-emoji,
#household-topbar-emoji, #profile-topbar-emoji, #profile-menu-avatar {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

/* ── Location List ── */
.loc-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.loc-list-item:last-child { border-bottom: none; }
.loc-list-emoji { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.loc-list-name { flex: 1; font-size: 13px; color: var(--text); }

/* ── Cart Actions (erscheinen nur bei abgehakten Artikeln) ── */
.cart-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.cart-actions button { flex: 1; width: auto; }

/* ── Category Grid (Vorrat-Tab) ── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.cat-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  text-align: left;
  padding: 18px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.cat-badges {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 4px;
}
.cat-badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px;
  font-size: 11px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.cat-badge-bad  { background: var(--red); }
.cat-badge-soon { background: var(--amber); }
.cat-tile:active { transform: scale(0.97); }
.cat-tile-icon { font-size: 26px; line-height: 1; color: var(--accent); }
.cat-tile-name { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.cat-tile-count { font-size: 12px; color: var(--text-muted); }

/* ── Category Detail (Vorrat-Tab) ── */
.cat-view-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 4px;
}
.cat-back {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex-shrink: 0;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.cat-back:hover { background: var(--bg-2); }
.cat-back:active { transform: scale(0.92); }
.cat-view-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 600; letter-spacing: -0.3px; color: var(--text);
}
.cat-view-title .ti { font-size: 22px; color: var(--accent); }

/* ── Onboarding ── */
.onboarding-sheet { text-align: left; }
.onboarding-hero { text-align: center; padding: 8px 0 16px; }
.onboarding-icon { font-size: 52px; margin-bottom: 10px; display: block; }
.onboarding-hero h2 { font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.onboarding-hero p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
