/* Familien-App – modernes KI-Design: Aurora-Hintergrund, Glas-Karten, Verläufe Violett → Blau → Türkis. */

:root {
  --bg: #f4f3fb;
  --bg-aurora-1: rgb(139 92 246 / 0.18);
  --bg-aurora-2: rgb(56 189 248 / 0.16);
  --bg-aurora-3: rgb(45 212 191 / 0.12);
  --surface: rgb(255 255 255 / 0.72);
  --surface-solid: #ffffff;
  --surface-2: rgb(120 110 180 / 0.08);
  --text: #15142a;
  --muted: #6a6886;
  --line: rgb(90 80 160 / 0.14);
  --line-strong: rgb(90 80 160 / 0.26);
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #06b6d4 100%);
  --grad-soft: linear-gradient(135deg, rgb(139 92 246 / 0.14), rgb(6 182 212 / 0.12));
  --accent: #6d4ef2;
  --accent-text: #ffffff;
  --glow: 0 8px 30px rgb(109 78 242 / 0.28);
  --ok: #10b981;
  --warn: #f97316;
  --warn-bg: rgb(249 115 22 / 0.1);
  --danger: #e11d48;
  --shadow: 0 1px 1px rgb(20 16 60 / 0.04), 0 10px 30px rgb(20 16 60 / 0.06);
  --radius: 22px;
  --tabbar-h: 70px;
  --blur: saturate(160%) blur(18px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07070f;
    --bg-aurora-1: rgb(139 92 246 / 0.30);
    --bg-aurora-2: rgb(59 130 246 / 0.22);
    --bg-aurora-3: rgb(20 184 166 / 0.16);
    --surface: rgb(22 22 40 / 0.62);
    --surface-solid: #14142a;
    --surface-2: rgb(255 255 255 / 0.06);
    --text: #eeedfb;
    --muted: #9b99bd;
    --line: rgb(255 255 255 / 0.09);
    --line-strong: rgb(255 255 255 / 0.18);
    --grad-soft: linear-gradient(135deg, rgb(139 92 246 / 0.22), rgb(6 182 212 / 0.14));
    --accent: #a78bfa;
    --accent-text: #ffffff;
    --glow: 0 8px 34px rgb(139 92 246 / 0.38);
    --ok: #34d399;
    --warn: #fb923c;
    --warn-bg: rgb(251 146 60 / 0.12);
    --danger: #fb7185;
    --shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 12px 40px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(60vmax 50vmax at 0% -10%, var(--bg-aurora-1), transparent 60%),
    radial-gradient(50vmax 45vmax at 100% 10%, var(--bg-aurora-2), transparent 60%),
    radial-gradient(60vmax 50vmax at 50% 110%, var(--bg-aurora-3), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.005em;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }

h1 { font-size: 1.85rem; line-height: 1.15; margin: 0.2rem 0; letter-spacing: -0.03em; font-weight: 750; }
h2 { font-size: 0.8rem; margin: 1.6rem 0 0.6rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); font-weight: 650; }
h3 { font-size: 1rem; margin: 1rem 0 0.25rem; }
p { margin: 0.4rem 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; min-height: 1em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.icon { display: block; flex: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input, select, textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  min-height: 46px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(139 92 246 / 0.18); background: var(--surface); }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
input[type="color"] { padding: 4px; width: 52px; min-width: 52px; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }
label.inline { flex-direction: row; align-items: center; gap: 0.6rem; font-weight: 500; }
label.between { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; font-weight: 500; }
label.between input { width: 9rem; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.55rem; }
legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; padding: 0; }

.primary, .secondary {
  border: 0; border-radius: 14px; padding: 0.8rem 1.15rem; font-weight: 650; min-height: 46px;
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}
.primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.primary:not(:disabled):hover { filter: brightness(1.08); }
.primary:not(:disabled):active, .secondary:not(:disabled):active { transform: scale(0.98); }
.secondary { background: var(--surface-2); border: 1px solid var(--line); }
.primary.small, .secondary.small { padding: 0.45rem 0.85rem; min-height: 36px; font-size: 0.88rem; border-radius: 12px; }
.link { background: none; border: 0; color: var(--accent); padding: 0.4rem 0; font-weight: 650; }
.link.danger, .danger { color: var(--danger); }
.icon-btn {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  width: 44px; height: 44px; font-size: 1.25rem; display: grid; place-items: center; flex: none;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.icon-btn.subtle { border: 0; background: none; width: 36px; height: 36px; font-size: 1rem; backdrop-filter: none; }

.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1 1 8rem; }
.row > .narrow { flex: 0 0 auto; }
.row > .grow, .grow { flex: 1 1 auto; min-width: 0; }
.between-row { align-items: center; flex-wrap: nowrap; }

.card {
  background: var(--surface); border-radius: var(--radius); padding: 1.05rem; box-shadow: var(--shadow);
  border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.card.inner { background: var(--surface-2); box-shadow: none; }
.card-title { margin: 0; font-size: 1.05rem; text-transform: none; letter-spacing: -0.01em; color: var(--text); font-weight: 700; }

/* App-Rahmen */
.shell { min-height: 100dvh; }
.content {
  max-width: 780px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 34px);
}
.view > h1 { margin-top: 0.6rem; }
.tabbar {
  position: fixed; z-index: 10; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: min(560px, calc(100vw - 20px));
  display: flex; justify-content: space-around; gap: 2px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 26px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 12px 40px rgb(10 8 40 / 0.25);
  padding: 6px;
}
.tabbar button {
  flex: 1; min-width: 0; background: none; border: 0; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 0.66rem; font-weight: 600; color: var(--muted); padding: 7px 0 6px; min-height: 54px;
  transition: color 0.15s, background 0.2s;
}
.tabbar button.active { color: var(--text); background: var(--grad-soft); }
.tabbar button.active .icon { color: var(--accent); filter: drop-shadow(0 0 8px rgb(139 92 246 / 0.55)); }
.tab-icon { line-height: 0; }

/* Tageskopf */
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; text-align: center; margin: 0.4rem 0 1.1rem; }
.day-head > div { flex: 1; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 0.9rem; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 0.75rem 0.5rem;
  text-align: center; display: flex; flex-direction: column; gap: 2px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.stat b { font-size: 1.3rem; letter-spacing: -0.02em; }
.stat span { font-size: 0.72rem; color: var(--muted); }

.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--grad); border-radius: 999px; transition: width 0.4s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 12px rgb(139 92 246 / 0.6); }
.member-card .progress-bar { background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, #06b6d4)); box-shadow: none; }
.celebrate { text-align: center; font-weight: 700; font-size: 1.1rem; margin-top: 0.9rem; }

/* Listen */
.tasks, .events, .device-list, .task-admin-list, .inbox-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.task {
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 0.75rem 0.85rem;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: opacity 0.2s, transform 0.2s;
}
.task.done { opacity: 0.55; }
.task.done .task-title { text-decoration: line-through; }
.task.skipped { opacity: 0.4; }
.task.late { border-color: color-mix(in srgb, var(--warn) 60%, transparent); background: var(--warn-bg); }
.check {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--me, var(--accent)) 70%, transparent); background: transparent; color: #fff;
  font-size: 1rem; font-weight: 800; display: grid; place-items: center; transition: transform 0.15s, background 0.2s;
}
.check:not(:disabled):active { transform: scale(0.9); }
.task.done .check { background: var(--grad); border-color: transparent; box-shadow: var(--glow); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 620; }
.task-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; font-size: 0.78rem; margin-top: 0.2rem; }
.badge { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.08rem 0.55rem; font-weight: 650; font-size: 0.75rem; white-space: nowrap; }
.badge.warn { background: var(--warn); border-color: transparent; color: #fff; }
.badge.soft { font-weight: 500; }
.compact .task { padding: 0.5rem 0.6rem; border-radius: 14px; background: var(--surface-2); backdrop-filter: none; }
.compact .check { width: 28px; height: 28px; }

.event {
  display: flex; gap: 0.85rem; align-items: baseline;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 0.7rem 0.85rem;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  position: relative; overflow: hidden;
}
.event::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad); }
.event-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.86rem; min-width: 5.6rem; flex: none; padding-left: 0.2rem; }
.event-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.events.compact { margin: 0.6rem 0; }
.events.compact .event { background: var(--surface-2); border: 0; padding: 0.45rem 0.6rem; backdrop-filter: none; }
.empty { color: var(--muted); margin: 0.2rem 0; }

.tomorrow { margin-top: 1.4rem; }
.week-day h2 { margin-top: 1.3rem; }

/* Familie */
.member-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 0.9rem; }
.member-card { display: flex; flex-direction: column; gap: 0.65rem; position: relative; overflow: hidden; }
.member-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c), transparent); }
.member-head { display: flex; align-items: center; gap: 0.75rem; }
.avatar {
  font-size: 1.5rem; width: 44px; height: 44px; display: grid; place-items: center; flex: none; border-radius: 15px;
  background: var(--grad-soft); border: 1px solid var(--line);
}

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.member-chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-weight: 620;
  background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.member-chip.small { font-size: 0.72rem; padding: 0.05rem 0.45rem; }
.member-chip.family { --c: var(--muted); }
.chip-toggle {
  --c: var(--accent); border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px;
  padding: 0.45rem 0.85rem; min-height: 40px; font-weight: 620; transition: background 0.15s, border-color 0.15s;
}
.chip-toggle[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 22%, transparent); border-color: var(--c); }
.weekdays .chip-toggle { min-width: 46px; }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 3px; gap: 2px; }
.segmented.wide { display: flex; overflow-x: auto; margin: 0.6rem 0 1rem; scrollbar-width: none; }
.segmented button { border: 0; background: none; padding: 0.45rem 0.8rem; border-radius: 11px; font-weight: 620; color: var(--muted); white-space: nowrap; flex: 1; }
.segmented button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 10px rgb(10 8 40 / 0.12); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }

/* Verwaltung */
.member-admin { display: flex; flex-direction: column; gap: 0.7rem; border-left: 3px solid var(--c); }
.member-admin .primary { align-self: flex-start; }
.inactive { opacity: 0.55; }
.device-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.task-admin { display: flex; align-items: center; gap: 0.8rem; cursor: pointer; }
.chevron { color: var(--muted); font-size: 1.4rem; }
.emoji-input { width: 3.4rem; text-align: center; font-size: 1.3rem; padding: 0.4rem; }
.big-code {
  font-size: 2.6rem; font-weight: 800; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums;
  padding: 0.8rem; border-radius: 18px; margin: 0.6rem 0; background: var(--grad-soft); border: 1px solid var(--line);
}
.steps { padding-left: 1.2rem; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }

/* Eingang */
.inbox-item { padding: 0.25rem; }
.inbox-item.important { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.inbox-item.error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.inbox-head { display: flex; align-items: flex-start; gap: 0.75rem; width: 100%; text-align: left; background: none; border: 0; padding: 0.7rem; border-radius: 18px; }
.inbox-head .grow { display: flex; flex-direction: column; gap: 0.15rem; }
.inbox-title { font-weight: 680; }
.inbox-summary { margin-top: 0.2rem; }
.inbox-item > .hint { margin: 0 0.7rem 0.7rem; }
.inbox-detail { padding: 0 0.9rem 0.9rem 4.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.inbox-detail ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }

/* Assistent */
.chat-view { display: flex; flex-direction: column; min-height: calc(100dvh - var(--tabbar-h) - 70px); }
.ai-head { display: flex; align-items: center; gap: 0.8rem; margin: 0.5rem 0 1rem; }
.ai-head h1 { font-size: 1.45rem; margin: 0; }
.ai-orb {
  width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex: none;
  background: var(--grad); box-shadow: var(--glow); animation: orb 6s ease-in-out infinite;
}
@keyframes orb { 0%, 100% { filter: hue-rotate(0deg); } 50% { filter: hue-rotate(25deg); } }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 0.7rem; padding-bottom: 0.8rem; }
.bubble { max-width: 88%; padding: 0.75rem 0.95rem; border-radius: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.bubble p { margin: 0 0 0.5rem; }
.bubble p:last-child { margin: 0; }
.bubble ul { margin: 0.2rem 0 0.5rem; padding-left: 1.2rem; }
.bubble.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; box-shadow: var(--glow); white-space: pre-wrap; }
.bubble.assistant {
  align-self: flex-start; border-bottom-left-radius: 6px;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid transparent;
  background-image: linear-gradient(var(--surface-solid), var(--surface-solid)), var(--grad);
  background-origin: border-box; background-clip: padding-box, border-box;
}
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 0.9rem 1rem; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.idea { text-align: left; border-radius: 16px; font-weight: 520; }
.chat-input {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px);
  display: flex; gap: 0.5rem; align-items: flex-end; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow);
}
.chat-input textarea { border: 0; background: transparent; resize: none; min-height: 44px; max-height: 160px; field-sizing: content; }
.chat-input textarea:focus { box-shadow: none; background: transparent; }
.send-btn { width: 44px; height: 44px; border-radius: 16px; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--glow); }

/* Einstieg */
.onboarding { max-width: 440px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 44px) 16px 40px; display: flex; flex-direction: column; gap: 1rem; text-align: center; }
.onboarding.wide { max-width: 640px; text-align: left; }
.onboarding .card { text-align: left; display: flex; flex-direction: column; gap: 0.8rem; }
.brand {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 24px; display: grid; place-items: center; font-size: 2.2rem;
  background: var(--grad); box-shadow: var(--glow);
}
.onboarding.wide h1, .onboarding.wide > .muted { text-align: center; }
.code-input { font-size: 1.8rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.setup-row { display: grid; grid-template-columns: 3.4rem 1fr auto 52px; gap: 0.5rem; align-items: center; }
.setup-row select { width: auto; }
@media (max-width: 420px) {
  .setup-row { grid-template-columns: 3.4rem 1fr 52px; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
  .setup-row input[type="color"] { grid-column: 3; grid-row: 1; }
  .setup-row select { grid-column: 2 / 4; grid-row: 2; width: 100%; }
}
.hint { background: var(--grad-soft); border: 1px solid var(--line); border-radius: 16px; padding: 0.75rem 0.9rem; text-align: left; font-size: 0.92rem; }
.error-text { color: var(--danger); font-weight: 600; }
.error-box { background: var(--warn-bg); color: var(--warn); border-radius: 16px; padding: 0.8rem; margin: 1rem 0; font-weight: 600; }
.loading { padding: 3rem 1rem; text-align: center; color: var(--muted); }

/* Dialog */
.modal-backdrop { position: fixed; inset: 0; background: rgb(5 4 20 / 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--surface-solid); width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  border-radius: 26px 26px 0 0; padding: 0 16px calc(env(safe-area-inset-bottom) + 20px);
  border: 1px solid var(--line-strong); box-shadow: 0 -10px 50px rgb(0 0 0 / 0.3);
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 26px; }
}
.modal-head { position: sticky; top: 0; background: var(--surface-solid); display: flex; align-items: center; justify-content: space-between; padding: 16px 0 10px; z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.15rem; text-transform: none; letter-spacing: -0.01em; color: var(--text); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 26px); transform: translate(-50%, 20px);
  background: var(--surface-solid); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--glow);
  padding: 0.7rem 1.1rem; border-radius: 16px; font-weight: 620;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.25s; z-index: 100; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* Stufe 3: Coach, Foto-Beleg, Anfragen */
.icon-btn.on { color: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
.tool-btn { width: 44px; height: 44px; border-radius: 16px; border: 0; background: var(--surface-2); color: var(--text); display: grid; place-items: center; flex: none; }
.send-btn.listening { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(139 92 246 / 0.6); } 50% { box-shadow: 0 0 0 10px rgb(139 92 246 / 0); } }
.bubble { position: relative; }
.bubble-photo { display: block; max-width: 220px; width: 100%; border-radius: 14px; margin-bottom: 0.5rem; }
.bubble-time { font-size: 0.7rem; opacity: 0.6; margin-top: 0.3rem; }
.read-btn { position: absolute; right: -8px; bottom: -8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-solid); color: var(--accent); display: grid; place-items: center; }
.photo-pending { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem; margin-bottom: 0.5rem; }
.photo-pending img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; }
.check.photo { border-style: dashed; color: var(--accent); }
.photo-flow .challenge { text-align: center; padding: 1.2rem 1rem; border-radius: 20px; background: var(--grad-soft); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.4rem; }
.challenge-text { font-size: 1.35rem; font-weight: 750; letter-spacing: -0.02em; }
.photo-preview { width: 100%; max-height: 42vh; object-fit: contain; border-radius: 18px; background: var(--surface-2); }
.btn-icon { display: inline-block; vertical-align: -4px; margin-right: 0.3rem; }
.primary .icon, .btn-icon .icon { display: inline-block; }
.center { text-align: center; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.verdict { border-radius: 18px; padding: 0.9rem 1rem; border: 1px solid var(--line); }
.verdict.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.verdict.fast { background: var(--grad-soft); }
.verdict.nein, .verdict.abgelehnt { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.verdict ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.request-card { display: flex; flex-direction: column; gap: 0.7rem; border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.check-list li::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.check-list li.warn::before { content: "! "; color: var(--warn); }
.flag-card { display: flex; align-items: center; gap: 0.6rem; border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* Stufe 4: Bildschirmzeit */
.screen-card { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.9rem; }
.screen-card.locked { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.screen-card.free { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.usage-week { display: flex; gap: 6px; align-items: flex-end; height: 70px; }
.usage-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.usage-bar span { width: 100%; border-radius: 6px 6px 3px 3px; background: var(--grad); min-height: 3px; }
.usage-bar small { font-size: 0.65rem; color: var(--muted); }

/* Essen, Oma */
.top-switch { margin-top: 0.4rem; }
.ai-plan { display: flex; align-items: center; gap: 0.8rem; border-color: color-mix(in srgb, var(--accent) 35%, transparent); background-image: var(--grad-soft); }
.meal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.meal { display: flex; gap: 0.9rem; align-items: flex-start; cursor: pointer; }
.meal.today { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: var(--glow); }
.meal-day { min-width: 3.6rem; display: flex; flex-direction: column; }
.shop-item .check { border-radius: 10px; }
details summary { cursor: pointer; }
.helper-card { display: flex; flex-direction: column; gap: 0.7rem; font-size: 1.1rem; border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.helper-title { font-size: 1.45rem; font-weight: 750; letter-spacing: -0.02em; }
.helper-when { font-size: 1.2rem; font-weight: 600; }
.helper-buttons { display: flex; flex-direction: column; gap: 0.5rem; }
.big { min-height: 56px; font-size: 1.15rem; }
.warn-text { color: var(--warn); font-weight: 600; }
.transcript { min-height: 120px; max-height: 40vh; overflow: auto; padding: 0.9rem; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.55; }
.listening-btn { animation: pulse 1.2s ease-in-out infinite; }
.protocol { background: var(--surface-2); border-radius: 14px; padding: 0.7rem 0.9rem; }
.protocol p { margin: 0.35rem 0; }
.protocol-li { padding-left: 0.3rem; margin: 0.15rem 0; }
.card.accent { border-color: color-mix(in srgb, #8b5cf6 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, #8b5cf6 35%, transparent); }
.sport-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; border-top: 1px solid var(--line, rgba(127,127,127,0.15)); }
.sport-row:first-of-type { border-top: 0; }
.sport-row.done .grow > div:first-child, .sport-row.skipped .grow > div:first-child { opacity: 0.6; }
.sport-row.skipped .grow > div:first-child { text-decoration: line-through; }
.feelings { gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.list-row { display: flex; width: 100%; align-items: center; gap: 0.5rem; background: none; border: 0; padding: 0.4rem 0; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.report p { margin: 0.4rem 0; }
.report ul { margin: 0.2rem 0 0.6rem; padding-left: 1.2rem; }
label.inline select { width: auto; min-width: 7rem; }
label.inline { white-space: nowrap; }

/* Freisprech-Modus */
.voice-mode { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.9rem; padding: 1.5rem; text-align: center; background: radial-gradient(120% 80% at 50% 0%, rgba(139,92,246,0.35), rgba(8,10,20,0.96) 60%), rgba(8,10,20,0.98); backdrop-filter: blur(14px); }
.voice-close { position: absolute; top: max(1rem, env(safe-area-inset-top)); right: 1rem; background: none; border: 0; color: inherit; font-size: 1.3rem; padding: 0.4rem 0.6rem; cursor: pointer; }
.voice-mode .orb { position: relative; width: 132px; height: 132px; }
.voice-mode .orb span { position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #6366f1 45%, #06b6d4); opacity: 0.55; }
.voice-mode .orb span:nth-child(2) { animation: orb-pulse 2.6s ease-in-out infinite; }
.voice-mode .orb span:nth-child(3) { animation: orb-pulse 2.6s ease-in-out infinite 1.3s; }
.voice-mode .orb.hoeren span:nth-child(2), .voice-mode .orb.hoeren span:nth-child(3) { animation-duration: 1.1s; }
.voice-mode .orb.denken span { filter: saturate(0.6); }
.voice-mode .orb.sprechen span:nth-child(2) { animation-duration: 0.8s; }
@keyframes orb-pulse { 0%, 100% { transform: scale(0.82); opacity: 0.25; } 50% { transform: scale(1.12); opacity: 0.6; } }
.voice-state { font-weight: 600; letter-spacing: 0.02em; }
.voice-heard { margin: 0; opacity: 0.85; max-width: 32rem; }
.voice-answer { margin: 0; max-width: 32rem; font-size: 1.05rem; line-height: 1.5; }
.voice-actions .big { font-size: 1.05rem; padding: 0.9rem 2rem; }
@media (prefers-reduced-motion: reduce) { .voice-mode .orb span { animation: none !important; } }

/* Küchenmodus: großer Bildschirm am Ladekabel */
.kitchen { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 1rem; padding: clamp(1rem, 3vw, 2rem);
  background: radial-gradient(120% 90% at 20% 0%, rgba(99,102,241,0.30), rgba(8,10,20,0.98) 65%), #080a14; color: #eef1f8; overflow: hidden; }
.kitchen-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.kitchen-clock { font-size: clamp(3rem, 12vw, 6rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; flex: 1; align-content: start; }
.kitchen-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); border-radius: 1.2rem; padding: 1rem 1.2rem; }
.kitchen-line { font-size: clamp(1rem, 2.4vw, 1.35rem); margin: 0.25rem 0; }
.kitchen-meal { font-size: clamp(1.3rem, 3.4vw, 2rem); font-weight: 600; }
.kitchen-talk { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; }
.kitchen-talk .orb { position: relative; width: clamp(90px, 18vw, 150px); height: clamp(90px, 18vw, 150px); }
.kitchen-talk .orb span { position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #6366f1 45%, #06b6d4); opacity: 0.5; }
.kitchen-talk .orb.hoeren span:nth-child(2), .kitchen-talk .orb.sprechen span:nth-child(3) { animation: orb-pulse 1.2s ease-in-out infinite; }
.kitchen-question { font-size: clamp(1rem, 2.2vw, 1.3rem); opacity: 0.75; margin: 0; }
.kitchen-answer { font-size: clamp(1.2rem, 3vw, 1.9rem); line-height: 1.4; margin: 0; max-width: 40rem; }
.kitchen-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
