:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --border: #e4e2da;
  --text: #23221f;
  --text-secondary: #6b6a64;
  --text-muted: #a3a199;
  --accent: #534ab7;
  --accent-bg: #eeedfe;
  --success: #0f6e56;
  --success-bg: #e1f5ee;
  --warning: #854f0b;
  --warning-bg: #faeeda;
  --danger: #993c1d;
  --danger-bg: #faece7;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 90px;
  min-height: 100vh;
}

h1, h2, h3 { font-weight: 500; margin: 0; }

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

.topbar h1 { font-size: 18px; }

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
}

.chip {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
  white-space: nowrap;
  cursor: pointer;
}

.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.chip.dashed { border-style: dashed; color: var(--text-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.card.needs-confirm { border: 2px solid var(--danger); }
.card.done { opacity: 0.6; }

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-title { font-size: 14px; font-weight: 500; }
.card-title.done { text-decoration: line-through; }
.card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  margin-top: 6px;
  margin-right: 4px;
}

.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.badge.offen { background: var(--warning-bg); color: var(--warning); }
.badge.uebernommen { background: var(--accent-bg); color: var(--accent); }
.badge.erledigt { background: var(--success-bg); color: var(--success); }
.badge.confirm { background: var(--danger-bg); color: var(--danger); }

button, .btn {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
button.primary { background: var(--text); color: #fff; border-color: var(--text); }
button.ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
button:active { transform: scale(0.98); }

.row { display: flex; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }

input[type=text], input[type=email], input[type=date], input[type=time], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
label.field-label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 4px; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.checklist-item input[type=checkbox] { width: 18px; height: 18px; }
.checklist-item .text { flex: 1; font-size: 13px; }
.checklist-item .text.done { text-decoration: line-through; color: var(--text-muted); }
.checklist-item .from { font-size: 10px; color: var(--text-muted); }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav a.active { color: var(--accent); font-weight: 500; }

.center-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 24px;
}

.empty { color: var(--text-muted); font-size: 13px; font-style: italic; }
.error-box { color: var(--danger); font-size: 13px; background: var(--danger-bg); padding: 10px; border-radius: var(--radius); margin-bottom: 10px; }
