/* =====================================================================
   Zuhause – Styles
   ---------------------------------------------------------------------
   Aufbau:
   1. Farben (hell/dunkel) und Bereichsfarben
   2. Grundlayout, Kopfzeile, Navigation
   3. Listeneinträge mit Fortschrittsring
   4. Einkauf, Pinnwand, Hinweiskarten
   5. Sheets, Formulare, Einstellungen
   6. Toast, Login, Sonstiges
   Farben ändern: nur Abschnitt 1 anfassen.
   ===================================================================== */

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

/* ---------- 1. Farben ---------- */
:root {
  color-scheme: light dark;
  --bg: #eef3f1;
  --surface: #ffffff;
  --surface-2: #f3f7f5;
  --ink: #14201c;
  --ink-2: #4a5b54;
  --ink-3: #7c8c85;
  --line: rgba(20, 32, 28, 0.09);
  --shadow: 0 1px 1px rgba(20, 32, 28, 0.03), 0 10px 26px -14px rgba(20, 32, 28, 0.2);

  --clean: #2a9db8;  --clean-soft: #dcf0f5; --clean-deep: #156478;
  --plant: #38a167;  --plant-soft: #dff2e6; --plant-deep: #1d673f;
  --shop:  #eab12a;  --shop-soft:  #fcefc8; --shop-deep:  #765404;
  --fert:  #8a9b26;  --fert-soft:  #eef2d3; --fert-deep:  #4d5810;
  --note:  #8a6fd8;  --note-soft:  #ece7fb; --note-deep:  #4f3a99;

  --late: #c46a12;
  --late-soft: #fbead7;
  --danger: #c2412d;
  --radius: 22px;
  --nav-h: 66px;
  --ring-c: 144.51; /* Umfang des Rings: 2 · π · 23 */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1412;
    --surface: #16201d;
    --surface-2: #1c2824;
    --ink: #e8f0ed;
    --ink-2: #a7b7b0;
    --ink-3: #73847d;
    --line: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 12px 30px -16px rgba(0, 0, 0, 0.7);

    --clean: #55bfd8;  --clean-soft: #15303a; --clean-deep: #9adbec;
    --plant: #5cc489;  --plant-soft: #17342a; --plant-deep: #a6e3bf;
    --shop:  #f2c14e;  --shop-soft:  #36290b; --shop-deep:  #f6d98c;
    --fert:  #b3c74a;  --fert-soft:  #2c3312; --fert-deep:  #d9e69a;
    --note:  #a993ee;  --note-soft:  #2a2343; --note-deep:  #d2c6fb;

    --late: #eba052;
    --late-soft: #3a2711;
    --danger: #ef7b67;
  }
}

/* Bereichsfarben: setzen --accent für alles darin */
.t-clean { --accent: var(--clean); --accent-soft: var(--clean-soft); --accent-deep: var(--clean-deep); --on-accent: #fff; }
.t-plant { --accent: var(--plant); --accent-soft: var(--plant-soft); --accent-deep: var(--plant-deep); --on-accent: #fff; }
.t-shop  { --accent: var(--shop);  --accent-soft: var(--shop-soft);  --accent-deep: var(--shop-deep);  --on-accent: #2a1f02; }
.t-fert  { --accent: var(--fert);  --accent-soft: var(--fert-soft);  --accent-deep: var(--fert-deep);  --on-accent: #fff; }
.t-note  { --accent: var(--note);  --accent-soft: var(--note-soft);  --accent-deep: var(--note-deep);  --on-accent: #fff; }
@media (prefers-color-scheme: dark) {
  .t-clean, .t-plant, .t-fert, .t-note { --on-accent: #0a1210; }
}

body { --accent: var(--plant); --accent-soft: var(--plant-soft); --accent-deep: var(--plant-deep); --on-accent: #fff; }
body[data-route="putzen"] { --accent: var(--clean); --accent-soft: var(--clean-soft); --accent-deep: var(--clean-deep); --on-accent: #fff; }
body[data-route="einkauf"] { --accent: var(--shop); --accent-soft: var(--shop-soft); --accent-deep: var(--shop-deep); --on-accent: #2a1f02; }
body[data-route="pinnwand"] { --accent: var(--note); --accent-soft: var(--note-soft); --accent-deep: var(--note-deep); --on-accent: #fff; }
@media (prefers-color-scheme: dark) {
  body, body[data-route="putzen"], body[data-route="pinnwand"] { --on-accent: #0a1210; }
}

/* ---------- 2. Grundlayout ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Figtree", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(90% 36% at 100% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%),
    radial-gradient(70% 28% at 0% 100%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-user-select: none; user-select: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 10px; }
.icon { display: block; flex: none; }
.icon.inline { display: inline-block; vertical-align: -3px; }
[hidden] { display: none !important; }

.shell {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 40px);
}

.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.top h1 {
  margin: 0;
  font-size: clamp(29px, 8.2vw, 36px);
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.top p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.top-actions { display: flex; gap: 8px; padding-top: 2px; }

.round-btn, .avatar-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 750; font-size: 16px;
  transition: transform 0.15s;
}
.round-btn:active, .avatar-btn:active { transform: scale(0.93); }
.round-btn.accent { background: var(--accent); color: var(--on-accent); }
.avatar-btn { background: var(--accent-soft); color: var(--accent-deep); }

/* Navigation: schwebende Leiste unten */
.nav {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: min(calc(100% - 20px), 480px);
  height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  padding: 6px;
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -16px rgba(0, 0, 0, 0.32);
  z-index: 20;
  view-transition-name: nav;
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 20px;
  color: var(--ink-3);
  font-size: 11px; font-weight: 650; letter-spacing: 0.01em;
  text-decoration: none;
  position: relative;
  transition: background 0.2s, color 0.2s;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.nav a:active { transform: scale(0.95); }
.nav a[data-r="heute"].on, .nav a[data-r="pflanzen"].on { background: var(--plant-soft); color: var(--plant-deep); }
.nav a[data-r="putzen"].on { background: var(--clean-soft); color: var(--clean-deep); }
.nav a[data-r="einkauf"].on { background: var(--shop-soft); color: var(--shop-deep); }
.nav a[data-r="pinnwand"].on { background: var(--note-soft); color: var(--note-deep); }
.nav .badge {
  position: absolute; top: 4px; left: calc(50% + 5px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--late); color: #fff; font-size: 10.5px; font-weight: 750; font-style: normal;
}
.nav a[data-r="pinnwand"] .badge { background: var(--note); min-width: 9px; width: 9px; height: 9px; padding: 0; font-size: 0; top: 9px; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; }

/* ---------- 3. Abschnitte & Einträge ---------- */
.group { margin-top: 24px; }
.cards + .group, .hint + .group { margin-top: 18px; }
.group-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 4px 10px;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.group-title .count {
  font-size: 12.5px; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
}
.group-title .text-btn { margin-left: auto; }
.group.muted .item { opacity: 0.78; }
.list { display: grid; gap: 10px; }

.item {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px 11px 11px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.item.done-flash { animation: done-flash 0.4s ease forwards; }
@keyframes done-flash { to { transform: translateX(18px); opacity: 0.35; } }
.item .body {
  flex: 1; min-width: 0; text-align: left; padding: 3px 0; border-radius: 12px;
  display: flex; flex-direction: column;
}
.item .name { font-weight: 680; font-size: 16.5px; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; font-size: 13.5px; color: var(--ink-2); }
.item .meta2 { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.item .meta2 b { font-weight: 650; color: var(--ink-2); }
.due.late { color: var(--late); font-weight: 680; }
.due.now { color: var(--accent-deep); font-weight: 680; }
.due.soon { color: var(--ink-2); font-weight: 600; }
.dot-sep::before { content: "·"; margin-right: 8px; color: var(--ink-3); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 650;
  background: var(--accent-soft); color: var(--accent-deep);
}
.item.other .chip.person { background: var(--surface-2); color: var(--ink-2); }

/* Fortschrittsring: füllt sich, je näher die Fälligkeit rückt */
.ring {
  position: relative; width: 52px; height: 52px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--accent);
  transition: transform 0.18s;
}
.ring:active { transform: scale(0.9); }
.ring svg.r { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--accent-soft); stroke-width: 4; }
.ring .prog {
  fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: var(--ring-c);
  stroke-dashoffset: calc(var(--ring-c) * (1 - var(--p, 0)));
  transition: stroke-dashoffset 0.5s cubic-bezier(.3, .7, .2, 1), stroke 0.2s;
}
.ring.late .prog { stroke: var(--late); }
.ring .face {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
  transition: background 0.25s, color 0.25s, transform 0.25s;
  overflow: hidden;
}
.ring.due .face { background: var(--accent); color: var(--on-accent); }
.ring.late .face { background: var(--late); color: #fff; }
.ring .face .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ring .face .badge-ico {
  position: absolute; right: 1px; bottom: 1px; width: 16px; height: 16px; padding: 2px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent);
}
.ring .tick {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  opacity: 0; transform: scale(0.6); transition: opacity 0.2s, transform 0.25s cubic-bezier(.2, .9, .3, 1.4);
}
.ring.is-done .tick { opacity: 1; transform: none; }
.ring.is-done .prog { stroke-dashoffset: 0; stroke: var(--accent); }

/* Heute: Karten oben */
.cards { display: grid; gap: 10px; margin-bottom: 4px; }
.mini-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent-deep);
  text-decoration: none;
}
.mini-card b { display: block; font-weight: 720; }
.mini-card small { display: block; font-size: 13.5px; opacity: 0.85; overflow-wrap: anywhere; }
.mini-card .chev { margin-left: auto; opacity: 0.6; }
.mini-card:active { transform: scale(0.99); }

/* Leere Zustände */
.empty { text-align: center; padding: 26px 16px 8px; }
.empty.small { padding: 18px 16px; }
.empty h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.015em; }
.empty p { margin: 0 auto 18px; color: var(--ink-2); max-width: 32ch; }
.empty .row { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.art {
  position: relative; width: 120px; height: 120px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
}
.empty.small .art { width: 88px; height: 88px; }
.art::before, .art::after { content: ""; position: absolute; border-radius: 50%; background: var(--accent); opacity: 0.35; }
.art::before { width: 15px; height: 15px; top: 8px; right: 9px; }
.art::after { width: 9px; height: 9px; bottom: 13px; left: 5px; }

/* Hinweiskarten (Installieren, Erinnerungen) */
.hint {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px 12px 14px; margin-bottom: 12px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink);
}
.hint > .icon { color: var(--accent); }
.hint div { flex: 1; min-width: 0; }
.hint b { display: block; font-weight: 700; }
.hint span { display: block; font-size: 13.5px; color: var(--ink-2); }
.hint .x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); flex: none; }

/* ---------- 4. Einkauf ---------- */
.add-bar {
  display: flex; gap: 8px; margin-bottom: 10px;
  background: var(--surface); border-radius: 20px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow);
}
.add-bar input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 16.5px; padding: 8px 0; }
.add-bar input::placeholder, .compose textarea::placeholder { color: var(--ink-3); }
.go {
  width: 44px; height: 44px; border-radius: 15px; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; flex: none; transition: transform 0.15s;
}
.go:active { transform: scale(0.92); }

.suggest {
  display: flex; gap: 8px; overflow-x: auto; align-items: center;
  margin: 0 -16px 8px; padding: 2px 16px 8px;
  scrollbar-width: none; min-height: 8px;
}
.suggest::-webkit-scrollbar { display: none; }
.suggest .pick { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 4px; background: var(--surface); box-shadow: var(--shadow); }
.sugg-label { font-size: 12.5px; font-weight: 650; color: var(--ink-3); white-space: nowrap; flex: none; }

.shop-group .group-title { margin-bottom: 8px; }
.shop-group .list, .basket .list { gap: 6px; }
.shop-item {
  display: flex; align-items: center; gap: 4px; padding: 3px 12px 3px 4px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
}
.shop-item .tick { width: 46px; height: 46px; display: grid; place-items: center; flex: none; border-radius: 50%; }
.shop-item .tick span {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--shop) 75%, var(--ink-3));
  display: grid; place-items: center; color: transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}
.shop-item .tick:active span { transform: scale(0.85); }
.shop-item .label { flex: 1; min-width: 0; text-align: left; padding: 11px 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.shop-item .n { font-size: 16.5px; font-weight: 600; overflow-wrap: anywhere; }
.shop-item .q { font-size: 13.5px; color: var(--shop-deep); font-weight: 650; background: var(--shop-soft); padding: 1px 8px; border-radius: 9px; }
.shop-item.checked { box-shadow: none; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.shop-item.checked .tick span { background: var(--shop); border-color: var(--shop); color: #2a1f02; }
.shop-item.checked .n { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; font-weight: 500; }
.shop-item.checked .q { opacity: 0.5; }
.text-btn { color: var(--accent-deep); font-weight: 700; font-size: 14px; padding: 6px 4px; border-radius: 8px; }

/* Pinnwand */
.compose {
  display: flex; align-items: flex-end; gap: 8px; margin-bottom: 18px;
  background: var(--surface); border-radius: 20px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow);
}
.compose textarea {
  flex: 1; min-width: 0; border: 0; background: none; outline: 0; resize: none;
  font-size: 16.5px; line-height: 1.4; padding: 10px 0; max-height: 220px;
}
.notes { display: grid; gap: 10px; }
.note {
  padding: 12px 14px 14px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.note.theirs { background: var(--note-soft); box-shadow: none; }
.note header { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.note header time { color: var(--ink-3); font-size: 13px; }
.note .note-del { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.note p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; }
.mini-avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--note); color: #fff; font-weight: 750; font-size: 13px;
}
.note.mine .mini-avatar { background: var(--plant); }

/* ---------- 5. Buttons, Sheets, Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 16px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 16px;
  transition: transform 0.15s, filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.soft { background: var(--accent-soft); color: var(--accent-deep); }
.btn.plain { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: none; color: var(--danger); }
.btn.danger-fill { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 17px; }
.btn.small { min-height: 36px; padding: 0 14px; border-radius: 12px; font-size: 14px; flex: none; }
.btn:disabled { opacity: 0.5; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--fert-deep); font-weight: 650; font-size: 14.5px; padding: 10px 2px; }

.backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(6, 14, 11, 0.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.2s ease;
}
.backdrop.closing { animation: fade-out 0.2s ease forwards; }
.sheet {
  width: 100%; max-width: 540px; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 8px 20px calc(env(safe-area-inset-bottom) + 22px);
  animation: rise 0.32s cubic-bezier(.2, .8, .2, 1);
  transition: transform 0.25s ease;
}
.sheet.swap { animation: swap 0.22s ease; }
.sheet.closing { animation: sink 0.2s ease forwards; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; flex: 1; font-size: 22px; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.sheet-head .x, .device .x {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; color: var(--ink-2); flex: none;
}
.sheet-text { color: var(--ink-2); margin: 0 0 18px; }
@media (min-width: 700px) {
  .backdrop { align-items: center; }
  .sheet { border-radius: 28px; padding-top: 20px; padding-bottom: 22px; }
  .sheet .grab { display: none; }
}
@keyframes rise { from { transform: translateY(48px); opacity: 0; } }
@keyframes sink { to { transform: translateY(60px); opacity: 0; } }
@keyframes swap { from { opacity: 0.4; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 14px; color: var(--ink-2); font-size: 14.5px; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts .icon { color: var(--accent); }
.status {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  background: var(--surface-2); border-radius: 18px; overflow: hidden; margin-bottom: 12px;
}
.status > div { padding: 12px 14px; }
.status .lbl, .sub-lbl, .field > label, .field > .lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 650; color: var(--ink-2);
}
.status b { display: block; font-size: 16px; margin-top: 2px; }
.status.now > div:first-child { background: var(--accent-soft); color: var(--accent-deep); }
.status.now > div:first-child .lbl { color: inherit; }
.status.late > div:first-child { background: var(--late-soft); color: var(--late); }
.status.late > div:first-child .lbl { color: inherit; }
.sub-lbl { margin: 18px 2px 8px; }
.chips.snooze .pick { flex: 1; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.history li { display: flex; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.history li:last-child { border-bottom: 0; }
.history li.snz { color: var(--ink-3); }
.history .d { min-width: 92px; color: var(--ink-3); }
.actions { display: flex; gap: 10px; margin-top: 10px; }
.actions .btn:first-child { flex: 1; }
.actions.foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.actions.foot .btn { flex: 1; }

.care { margin-top: 14px; padding: 14px; border-radius: 22px; background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.care header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--accent-deep); }
.care header span { margin-left: auto; font-size: 13.5px; color: var(--ink-2); }
.care .status { background: var(--surface); }
.care .chips { margin-top: 10px; }
.plant-note { margin: 0 0 6px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); font-size: 14.5px; white-space: pre-wrap; }

.photo-box { margin: 0 0 14px; }
.photo-box img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 20px; }
.photo-actions { display: flex; gap: 8px; margin-top: 8px; }
.photo-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 104px; border-radius: 20px; border: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent-deep); font-weight: 650; font-size: 14.5px; cursor: pointer;
}
.photo-add.inline { flex-direction: row; height: 52px; margin-bottom: 8px; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.help { margin: 0; font-size: 13px; color: var(--ink-3); }
.help.center { text-align: center; margin-top: 14px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px;
  border: 1.5px solid transparent; background: var(--surface-2); outline: 0;
  font-size: 16px; /* < 16px würde iOS beim Antippen hineinzoomen lassen */
  transition: border-color 0.15s, background 0.15s;
}
.input:focus { border-color: var(--accent); background: var(--surface); }
textarea.input { min-height: 72px; resize: vertical; }
.input.num { width: 84px; text-align: center; min-height: 40px; padding: 6px 8px; }
.input.time { width: auto; min-height: 40px; padding: 6px 10px; flex: none; }
.inline-num { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  min-height: 36px; padding: 0 14px; border-radius: 18px; font-weight: 650; font-size: 14.5px;
  background: var(--surface-2); color: var(--ink-2); border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.pick:active { transform: scale(0.96); }
.pick.on { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent); }
.sheet .suggest { margin: -8px -20px 14px; padding: 2px 20px 6px; }
.sheet .suggest .pick { box-shadow: none; background: var(--accent-soft); color: var(--accent-deep); }

.checklist { display: grid; gap: 2px; margin-bottom: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-row .box {
  width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center;
  border: 2px solid var(--line); color: transparent; transition: background 0.15s, border-color 0.15s;
}
.check-row input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check-row input:focus-visible + .box { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.check-row .t b { display: block; font-weight: 650; }
.check-row .t small { color: var(--ink-3); font-size: 13px; }

/* Einstellungen */
.settings .who { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.settings .who b { display: block; font-size: 18px; }
.settings .who span { color: var(--ink-3); font-size: 13.5px; }
.settings .who .btn { margin-left: auto; }
.set-title { display: flex; align-items: center; gap: 8px; margin: 24px 0 4px; font-size: 14px; color: var(--ink-2); }
.setting {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  border-top: 1px solid var(--line); cursor: pointer;
}
.set-title + .setting { border-top: 0; }
.setting .t { flex: 1; min-width: 0; }
.setting .t b { display: block; font-weight: 680; }
.setting .t span { display: block; font-size: 13.5px; color: var(--ink-2); }
.toggle-row { margin: -4px 0 14px; border-top: 0; padding: 6px 0; }

/* Schalter im iOS-Stil – ein echtes <input type=checkbox> */
.switch {
  -webkit-appearance: none; appearance: none; margin: 0;
  position: relative; width: 52px; height: 32px; flex: none; border-radius: 16px; cursor: pointer;
  background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink-3); transition: transform 0.2s, background 0.2s;
}
.switch:checked { background: var(--plant); box-shadow: none; }
.switch:checked::after { transform: translateX(20px); background: #fff; }
.switch:disabled { opacity: 0.4; }

.notice {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; margin: 10px 0;
  background: var(--shop-soft); color: var(--shop-deep); font-size: 14px;
}
.devices { display: grid; }
.device { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.device:first-child { border-top: 0; }
.device .t { flex: 1; min-width: 0; }
.device .t b { display: block; color: var(--ink); font-weight: 650; font-size: 15px; }
.device .t span { font-size: 13px; }
.settings > .btn.plain { margin-top: 22px; }

.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 22px; font-weight: 760; background: var(--plant-soft); color: var(--plant-deep);
}

/* ---------- 6. Toast ---------- */
#toast-root {
  position: fixed; left: 0; right: 0; z-index: 60; pointer-events: none;
  bottom: calc(env(safe-area-inset-bottom) + var(--nav-h) + 22px);
  display: flex; justify-content: center; padding: 0 16px;
}
body.sheet-open #toast-root { bottom: calc(env(safe-area-inset-bottom) + 18px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 520px;
  padding: 12px 14px 12px 18px; border-radius: 18px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.45);
  animation: rise 0.25s ease;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.leaving { animation: fade-out 0.2s ease forwards; }
.toast button { color: inherit; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px; white-space: nowrap; }

/* Anmeldung & "Wer bist du?" */
.login {
  min-height: 100dvh; display: grid; place-items: center;
  padding: calc(env(safe-area-inset-top) + 24px) 22px calc(env(safe-area-inset-bottom) + 24px);
}
.login-card { width: 100%; max-width: 380px; }
.login .logo { width: 76px; height: 76px; border-radius: 22px; margin-bottom: 22px; box-shadow: 0 16px 30px -14px rgba(42, 157, 184, 0.6); }
.login h1 { margin: 0 0 6px; font-size: 34px; letter-spacing: -0.03em; font-weight: 780; }
.login p { margin: 0 0 24px; color: var(--ink-2); }
.login .btn[type="submit"] { background: linear-gradient(135deg, var(--plant), var(--clean)); color: #fff; margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 52px; }
.pw-eye { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-3); border-radius: 12px; }
.err { color: var(--danger); font-weight: 650; font-size: 14.5px; min-height: 22px; margin: -6px 0 8px; }
.steps { margin: 0 0 24px; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.steps li .icon { color: var(--clean); }

.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.who-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 10px;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); font-size: 17px;
  border: 2px solid transparent; transition: transform 0.15s;
}
.who-btn:active { transform: scale(0.97); }
.who-btn.on { border-color: var(--plant); }
.who-btn .avatar { width: 64px; height: 64px; font-size: 26px; }
.who-btn.c1 .avatar { background: var(--note-soft); color: var(--note-deep); }
.who-btn.c2 .avatar { background: var(--clean-soft); color: var(--clean-deep); }
.who-btn.c3 .avatar { background: var(--shop-soft); color: var(--shop-deep); }

/* Offline-Hinweis oben */
body.offline::before {
  content: "Offline – Änderungen gehen erst wieder mit Verbindung";
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  padding: calc(env(safe-area-inset-top) + 4px) 12px 4px;
  background: var(--late); color: #fff; font-size: 12.5px; font-weight: 650; text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
