:root {
  color-scheme: light dark;
  --bg: #F8F7F4;
  --surface: #FFFFFF;
  --surface-2: #F0EDE7;
  --border: #E5E1D8;
  --text: #1F2421;
  --text-muted: #6C706A;
  --accent: #2E6F5E;
  --accent-soft: #E5F0EC;
  --accent-text: #FFFFFF;
  --overdue-bg: #EFECE5;
  --overdue-text: #6E685F;
  --danger: #B54B4B;
  --shadow: 0 2px 10px rgba(31, 36, 33, 0.05);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #141615;
    --surface: #1D201E;
    --surface-2: #262A27;
    --border: #323734;
    --text: #EFECE6;
    --text-muted: #9BA19B;
    --accent: #5EA894;
    --accent-soft: #213630;
    --accent-text: #0F1A17;
    --overdue-bg: #292A26;
    --overdue-text: #A59F95;
    --danger: #D96B6B;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  }
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141615;
  --surface: #1D201E;
  --surface-2: #262A27;
  --border: #323734;
  --text: #EFECE6;
  --text-muted: #9BA19B;
  --accent: #5EA894;
  --accent-soft: #213630;
  --accent-text: #0F1A17;
  --overdue-bg: #292A26;
  --overdue-text: #A59F95;
  --danger: #D96B6B;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}

input,
textarea,
select {
  font-size: 16px;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.hidden {
  display: none !important;
}

#app-shell {
  min-height: 100dvh;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Header */
#app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  min-height: 58px;
}

.header-title-wrap {
  min-width: 0;
}

#header-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Main */
#app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 16px calc(92px + env(safe-area-inset-bottom));
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

#panel-todos.active {
  display: flex;
  flex-direction: column;
  flex: 1;
}

#todo-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.todo-bottom-footer {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Buttons */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background-color 140ms ease;
}

.icon-btn:active {
  background-color: var(--surface-2);
}

.icon-btn.subtle {
  color: var(--text-muted);
}

.pill-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: background-color 140ms ease;
}

.pill-action-btn:active {
  background-color: var(--surface-2);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity 140ms ease;
}

.primary-btn.compact {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.primary-btn:active {
  opacity: 0.86;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

.secondary-btn.compact {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background-color: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.92rem;
}

/* Segmented Control */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.seg-btn {
  min-height: 36px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background-color 140ms ease, color 140ms ease;
}

.seg-btn.active {
  background-color: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* Quick Add Form */
.quick-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 6px 4px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.quick-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: none;
  background: transparent;
  outline: none;
}

.quick-input::placeholder {
  color: var(--text-muted);
}

.add-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--accent);
  color: var(--accent-text);
  flex-shrink: 0;
}

/* Cards & Lists */
.card-group {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.group-title {
  margin: 0 0 6px 4px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  transition: background-color 140ms ease, opacity 140ms ease;
}

.item-row:last-child {
  border-bottom: none;
}

.item-row.shopping-large {
  padding: 13px 14px;
  min-height: 54px;
  align-items: center;
}

.item-row.is-done {
  opacity: 0.62;
}

.check-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: -1px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.check-btn::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.check-btn.checked .check-circle {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.item-main {
  flex: 1;
  min-width: 0;
}

.item-title-btn {
  display: block;
  width: 100%;
  text-align: left;
}

.item-title {
  font-size: 0.98rem;
  font-weight: 500;
  word-break: break-word;
}

.item-row.is-done .item-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background-color: var(--surface-2);
  color: var(--text-muted);
}

.badge.overdue {
  background-color: var(--overdue-bg);
  color: var(--overdue-text);
  font-weight: 500;
}

.badge.priority {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.badge.accent {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.item-note-preview {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Verknüpfte Einkaufsliste direkt im To-Do */
.linked-shop-box {
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  border: 1px solid var(--border);
}

.linked-shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.linked-shop-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.linked-shop-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-btn {
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.79rem;
  font-weight: 600;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.mini-btn.accent {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.linked-shop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.linked-chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.77rem;
  background-color: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.linked-shop-expanded {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.linked-shop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 0.88rem;
}

.linked-inline-add {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.linked-inline-input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  outline: none;
}

/* Shopping Tab */
.shopping-top-bar {
  margin-bottom: 10px;
}

.chips-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chips-scroll::-webkit-scrollbar {
  display: none;
}

.list-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: 999px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.list-chip.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.list-chip-count {
  font-size: 0.78rem;
  opacity: 0.82;
}

.mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.mode-banner.is-shopping {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

.mode-banner-info {
  flex: 1;
  min-width: 0;
}

.mode-banner-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.mode-banner-sub {
  font-size: 0.81rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 7px;
}

.progress-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: 999px;
  transition: width 180ms ease;
}

.shopping-add-wrap {
  position: relative;
}

.suggestions-list {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  margin-top: -6px;
  margin-bottom: 12px;
  overflow: hidden;
}

.suggestion-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}

.suggestion-row:last-child {
  border-bottom: none;
}

.suggestion-row:active {
  background-color: var(--surface-2);
}

.suggestion-cat {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.quick-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 999px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text);
}

.quick-chip:active {
  background-color: var(--surface-2);
}

.qty-pill {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background-color: var(--surface-2);
  color: var(--text-muted);
  margin-right: 6px;
}

/* Collapse toggle */
.collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Packlisten */
.pack-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  text-align: left;
  width: 100%;
}

.pack-card-title {
  font-size: 1rem;
  font-weight: 600;
}

.pack-card-meta {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.pack-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Notizen */
.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 8px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface);
  outline: none;
}

.note-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow);
}

.note-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.note-card-title {
  font-size: 1rem;
  font-weight: 650;
  margin: 0;
}

.note-card-body {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* Routinen */
.routine-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.routine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border);
}

.routine-dot.done {
  background-color: var(--accent);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 34px 20px;
  background-color: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* Bottom Navigation */
#bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 680px;
  margin: 0 auto;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.nav-btn.active {
  color: var(--accent);
}

/* Toast */
#toast-container {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 520px;
  width: 100%;
  background-color: var(--text);
  color: var(--bg);
  padding: 11px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
}

.toast-action {
  color: var(--accent-soft);
  font-weight: 700;
  white-space: nowrap;
  padding: 4px 6px;
}

/* Fullscreen Overlays (Fokus & Abend) */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 680px;
  margin: 0 auto;
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.overlay-badge {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
}

.overlay-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.focus-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}

.focus-task-title {
  margin: 8px 0 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.focus-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timer-box {
  background-color: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.timer-display {
  font-size: 2.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.overlay-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Bottom Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background-color: rgba(0, 0, 0, 0.38);
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  max-width: 680px;
  margin: 0 auto;
  max-height: 88vh;
  max-height: 88dvh;
  overflow: hidden;
  background-color: var(--surface);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.16);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background-color: var(--border);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.sheet-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-content > * {
  flex-shrink: 0;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.text-input,
.textarea-input,
.select-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg);
  outline: none;
}

.textarea-input {
  min-height: 110px;
  resize: vertical;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.choice-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.choice-chip.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  border: 1px solid var(--border);
}

.switch-input {
  width: 44px;
  height: 26px;
  accent-color: var(--accent);
}

.sheet-footer-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.sheet-footer-row > * {
  flex: 1;
}

.cat-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  border: 1px solid var(--border);
}

/* Geteilte Listen & Gemeinsam-Tab */
.shared-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background-color: var(--accent-soft);
  color: var(--accent);
}

.list-chip.active .shared-badge {
  background-color: rgba(255, 255, 255, 0.22);
  color: var(--accent-text);
}

.group-quick-wrap {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 6px 8px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.group-quick-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-quick-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.group-suggest-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.group-suggest-select {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
}

.suggestion-highlight {
  background-color: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.suggestion-highlight .item-row {
  border-bottom-color: rgba(46, 111, 94, 0.18);
}

.group-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.member-stat-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow);
}

.member-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.member-stat-name {
  font-size: 1rem;
  font-weight: 700;
}

.member-stat-nums {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-bar-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background-color: var(--surface-2);
  overflow: hidden;
  margin-top: 10px;
}

.stat-bar-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: 999px;
  transition: width 200ms ease;
}

.member-recent-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.admin-stat-box {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.admin-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
}

.admin-stat-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-entry-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.access-gate-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.access-gate-title {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.access-gate-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.access-gate-error {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--danger);
}

.member-chip {
  gap: 6px;
  padding: 4px 10px;
}

.member-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--text-muted);
}

.member-remove-btn:active {
  background-color: var(--border);
}

.help-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.help-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.help-card p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
}

/* Dark Mode Dropdown Fix */
select,
.select-input,
.group-suggest-select {
  background-color: var(--surface);
  color: var(--text);
}

select option {
  background-color: var(--surface);
  color: var(--text);
}

/* Abgelaufene geteilte Listen / Packlisten */
.expired-banner {
  background-color: var(--overdue-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expired-banner-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.expired-banner-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Produkt-Verwaltung & Vorrats-Check */
.shopping-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.pantry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.pantry-row:last-child {
  border-bottom: none;
}

.star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border-radius: 8px;
  color: var(--text-muted);
}

.star-btn.active {
  color: var(--accent);
}

/* Wochenplan */
.meal-day-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meal-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.meal-day-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.meal-entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  border: 1px solid var(--border);
}

/* Mehr-Menü */
.more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.more-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  background-color: var(--bg);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.94rem;
  text-align: left;
}

.more-tile.active {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
}

/* QR-Code-Karte */
.qr-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 260px;
  width: 100%;
  margin: 4px auto;
}

.qr-card svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Listen-Gruppenkopf & Vollbild-Notizen */
.group-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.group-head-row .group-title {
  margin: 0;
}

.note-card-hit {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-overlay-header {
  margin-bottom: 12px;
  gap: 8px;
  flex-shrink: 0;
}

.note-overlay-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-overlay-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-editor-title {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 8px 2px 10px;
  font-size: 1.25rem;
  font-weight: 700;
  outline: none;
  flex-shrink: 0;
}

.note-editor-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 2px;
  font-size: 1rem;
  line-height: 1.55;
  resize: none;
  outline: none;
}
