/* Hausplan — mobile-first, freundlich, hell/dunkel */
:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #2d3230;
  --muted: #7d867f;
  --accent: #7c9e84;
  --accent-dark: #5f8168;
  --accent-soft: #e3ede5;
  --p1: #7c9e84;
  --p2: #d9a066;
  --warn: #c76a4a;
  --ok: #4a8f5d;
  --border: #e6e2d8;
  --shadow: 0 1px 3px rgba(45, 50, 48, 0.08);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1f1d;
    --card: #262b28;
    --text: #e8eae7;
    --muted: #98a19a;
    --accent: #8fb497;
    --accent-dark: #a9c9b0;
    --accent-soft: #314035;
    --border: #343a36;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 24px;
  padding-top: calc(20px + env(safe-area-inset-top));
}
a { color: var(--accent-dark); }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2.day-head {
  font-size: 0.95rem; color: var(--muted); text-transform: none;
  margin: 22px 4px 8px; font-weight: 600;
}
h2.day-head.today { color: var(--accent-dark); }
.head { margin-bottom: 16px; }
.muted { color: var(--muted); margin: 0; font-size: 0.95rem; }
.error { color: var(--warn); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.warn { color: var(--warn); }

.progress {
  height: 8px; background: var(--accent-soft); border-radius: 99px;
  margin-top: 12px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border); padding: 14px;
}
.card.task { display: flex; align-items: center; gap: 12px; }
.card.task form { margin: 0; display: flex; gap: 6px; }
.task-body { flex: 1; min-width: 0; }
a.task-link { text-decoration: none; color: inherit; }
.task-title { font-weight: 600; font-size: 1.02rem; overflow-wrap: anywhere; }
.task-meta { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.is-done { opacity: 0.55; }
.is-done .task-title { text-decoration: line-through; }
.is-skipped { opacity: 0.45; }
.is-offered { border-color: var(--p2); }

.check {
  width: 34px; height: 34px; min-width: 34px; border-radius: 50%;
  border: 2px solid var(--accent); background: transparent;
  font-size: 1.1rem; color: #fff; cursor: pointer; line-height: 1;
}
.check.checked { background: var(--accent); border-color: var(--accent); }

.btn {
  display: inline-block; border: none; border-radius: 12px; cursor: pointer;
  font-size: 0.95rem; font-weight: 600; padding: 10px 16px;
  text-decoration: none; text-align: center; color: var(--text);
  background: var(--accent-soft);
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-dark); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn.small { padding: 6px 10px; font-size: 0.85rem; }
.btn.big { width: 100%; padding: 14px; font-size: 1.05rem; }

.badge {
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 8px; padding: 1px 7px; font-size: 0.85rem; font-weight: 700;
}

.input {
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px;
  font-size: 1rem; background: var(--card); color: var(--text); width: 100%;
}
.input.qty { width: 74px; flex: none; }
.input.time { width: 110px; flex: none; }
.grow { flex: 1; }
.add-row { display: flex; gap: 8px; margin-bottom: 16px; }
.add-row .btn { min-width: 52px; font-size: 1.3rem; padding: 8px; }
.center-row { text-align: center; margin: 16px 0; }

.form-card { display: block; }
.form-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.form-row { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.form-row.check-row { flex-direction: row; align-items: center; gap: 8px; }
details.form-card summary { list-style: none; }
details.form-card summary::-webkit-details-marker { display: none; }

.fairness { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.fair-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.fair-name { width: 52px; font-weight: 600; }
.fair-bar { flex: 1; height: 10px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; }
.fair-fill { height: 100%; border-radius: 99px; }
.fair-fill.p1 { background: var(--p1); }
.fair-fill.p2 { background: var(--p2); }
.fair-min { color: var(--muted); white-space: nowrap; }

.empty {
  text-align: center; color: var(--muted); padding: 40px 16px;
  font-size: 1.05rem; line-height: 1.7;
}

.login-wrap { text-align: center; padding-top: 8vh; }
.login-hero { font-size: 3.5rem; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.user-picker { display: flex; gap: 12px; justify-content: center; }
.user-tile input { display: none; }
.user-tile span {
  display: block; padding: 18px 26px; border-radius: var(--radius);
  background: var(--card); border: 2px solid var(--border);
  font-weight: 600; font-size: 1.05rem; cursor: pointer;
}
.user-tile input:checked + span { border-color: var(--accent); background: var(--accent-soft); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 0.68rem; color: var(--muted); text-decoration: none;
  min-width: 56px; padding: 2px 6px; border-radius: 10px;
}
.tab span { font-size: 1.35rem; }
.tab.on { color: var(--accent-dark); background: var(--accent-soft); }
