:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --surface: rgba(255,255,255,.82);
  --surface-strong: #fffdf8;
  --text: #2d2926;
  --muted: #716963;
  --line: rgba(45,41,38,.10);
  --primary: #7c9c88;
  --primary-strong: #557462;
  --accent: #e9b9a7;
  --danger: #b75d5d;
  --warning: #c38b36;
  --shadow: 0 18px 50px rgba(87, 68, 56, .10);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  --safe-top: max(12px, env(safe-area-inset-top));
  font-family: Inter, ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

[data-theme="pastell"] {
  --bg: #fbf1f6;
  --surface: rgba(255,255,255,.85);
  --surface-strong: #fffafd;
  --primary: #9c86b8;
  --primary-strong: #705789;
  --accent: #f0b9c9;
}

[data-theme="apple"] {
  --bg: #f3f4f6;
  --surface: rgba(255,255,255,.78);
  --surface-strong: #fff;
  --primary: #5e7fef;
  --primary-strong: #315acb;
  --accent: #9bbbf6;
  --radius-xl: 24px;
}

[data-theme="cozy"] {
  --bg: #f6f1e8;
  --surface: rgba(255,253,248,.84);
  --surface-strong: #fffaf2;
  --primary: #78937d;
  --primary-strong: #516b57;
  --accent: #dfaa94;
}

[data-theme="cats"] {
  --bg: #fff2f4;
  --surface: rgba(255,255,255,.84);
  --surface-strong: #fffafb;
  --primary: #a87ab5;
  --primary-strong: #765381;
  --accent: #f0adbf;
  --cat-pattern: radial-gradient(circle at 20% 20%, rgba(168,122,181,.07) 0 4px, transparent 5px), radial-gradient(circle at 80% 70%, rgba(240,173,191,.09) 0 5px, transparent 6px);
}

[data-mode="dark"] {
  color-scheme: dark;
  --bg: #171717;
  --surface: rgba(36,36,36,.88);
  --surface-strong: #242424;
  --text: #f7f3ee;
  --muted: #b7aea8;
  --line: rgba(255,255,255,.10);
  --shadow: 0 20px 55px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100vh;
  background: var(--cat-pattern, none), var(--bg);
  padding-top: calc(70px + var(--safe-top));
  padding-bottom: calc(102px + var(--safe-bottom));
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(22px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 15px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--primary));
  box-shadow: var(--shadow);
  font-size: 22px;
}
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 17px; line-height: 1.1; }
.brand-copy span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-button, .avatar-button {
  border: 0; background: var(--surface); box-shadow: 0 8px 28px rgba(0,0,0,.07);
  min-width: 44px; height: 44px; border-radius: 15px; cursor: pointer;
  display: grid; place-items: center;
}
.avatar-button { font-weight: 800; background: linear-gradient(145deg, var(--surface-strong), color-mix(in srgb, var(--primary) 20%, var(--surface-strong))); }

main { width: min(100%, 1080px); margin: 0 auto; padding: 18px 16px 24px; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 24px;
  min-height: 190px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 92%, white), color-mix(in srgb, var(--accent) 85%, white));
  color: #fff;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px; border-radius: 50%;
  right: -35px; top: -48px;
  background: rgba(255,255,255,.18);
  transform: translate3d(var(--parallax-x, 0), var(--parallax-y, 0), 0);
  transition: transform .15s ease-out;
}
.hero::before {
  content: "";
  position: absolute;
  width: 90px; height: 90px; border-radius: 50%;
  right: 76px; bottom: -34px;
  background: rgba(255,255,255,.13);
}
.hero h1 { margin: 0 0 8px; font-size: clamp(29px, 7vw, 42px); line-height: 1.04; letter-spacing: -.04em; position: relative; z-index: 1; }
.hero p { margin: 0; max-width: 560px; opacity: .92; line-height: 1.5; position: relative; z-index: 1; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; position: relative; z-index: 1; }
.hero-badge { padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.19); backdrop-filter: blur(10px); font-size: 13px; font-weight: 700; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 24px 2px 12px; }
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }

.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card.compact { padding: 13px; border-radius: var(--radius-lg); box-shadow: 0 10px 32px rgba(0,0,0,.06); }
.stat-card strong { display: block; font-size: 28px; letter-spacing: -.04em; }
.stat-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.stat-icon { width: 38px; height: 38px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 16%, var(--surface-strong)); display: grid; place-items: center; margin-bottom: 14px; }

.item-list { display: grid; gap: 10px; }
.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}
.item.done { opacity: .62; }
.item.done .item-title { text-decoration: line-through; }
.item-check {
  width: 30px; height: 30px; border-radius: 11px; border: 2px solid color-mix(in srgb, var(--primary) 60%, var(--line));
  background: transparent; cursor: pointer; display: grid; place-items: center; font-weight: 900;
}
.item.done .item-check { background: var(--primary); color: #fff; border-color: var(--primary); }
.item-body { min-width: 0; }
.item-title { font-weight: 800; line-height: 1.25; }
.item-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 12px; }
.item-actions { display: flex; gap: 4px; }
.item-actions button { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 11px; cursor: pointer; }
.item-actions button:hover { background: var(--line); }

.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 27px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--primary) 13%, var(--surface-strong)); }
.chip.danger { background: color-mix(in srgb, var(--danger) 14%, var(--surface-strong)); color: var(--danger); }
.chip.warning { background: color-mix(in srgb, var(--warning) 16%, var(--surface-strong)); color: color-mix(in srgb, var(--warning) 80%, var(--text)); }

.subject-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.10); flex: 0 0 auto; }
.subject-rainbow { background: linear-gradient(90deg,#ef4444,#f59e0b,#eab308,#22c55e,#06b6d4,#3b82f6,#8b5cf6); }

.segmented { display: flex; gap: 5px; background: var(--line); border-radius: 15px; padding: 4px; }
.segmented button { flex: 1; min-height: 38px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.segmented button.active { background: var(--surface-strong); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.06); }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-button { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); padding: 9px 12px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--muted); }
.filter-button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(72px,1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.day-card { min-width: 74px; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 12px 8px; text-align: center; cursor: pointer; }
.day-card.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.day-card .weekday { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .74; }
.day-card .daynumber { font-size: 24px; font-weight: 900; margin: 4px 0; }
.day-dots { display: flex; justify-content: center; gap: 3px; min-height: 6px; }
.day-dots span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .45; }

.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 5px; }
.month-label { text-align: center; color: var(--muted); font-size: 11px; padding: 4px 0; }
.month-day { min-height: 62px; border: 1px solid var(--line); background: var(--surface); border-radius: 15px; padding: 7px; cursor: pointer; }
.month-day.outside { opacity: .35; }
.month-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.month-day strong { font-size: 13px; }
.month-day .count { display: block; margin-top: 10px; font-size: 10px; color: var(--muted); }

.fab {
  position: fixed; right: 18px; bottom: calc(86px + var(--safe-bottom)); z-index: 40;
  width: 58px; height: 58px; border: 0; border-radius: 20px; color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  box-shadow: 0 18px 36px color-mix(in srgb, var(--primary) 35%, transparent);
  font-size: 28px; cursor: pointer;
}

.bottom-nav {
  position: fixed !important; left: 0; right: 0; bottom: 0; z-index: 55;
  width: min(100%, 720px);
  margin: 0 auto;
  transform: none !important;
  display: grid; grid-template-columns: repeat(5,1fr);
  padding: 9px 10px var(--safe-bottom);
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,.08);
}
.bottom-nav button { border: 0; background: transparent; min-height: 56px; border-radius: 16px; color: var(--muted); cursor: pointer; display: grid; place-items: center; gap: 3px; font-size: 11px; font-weight: 800; }
.bottom-nav button span:first-child { font-size: 21px; line-height: 1; }
.bottom-nav button.active { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary-strong); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 10%, color-mix(in srgb,var(--accent) 30%,transparent), transparent 38%), radial-gradient(circle at 80% 80%, color-mix(in srgb,var(--primary) 25%,transparent), transparent 38%), var(--bg); }
.login-card { width: min(100%, 460px); background: var(--surface); border: 1px solid var(--line); border-radius: 34px; padding: 24px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.login-logo { width: 74px; height: 74px; border-radius: 26px; display: grid; place-items: center; font-size: 40px; background: linear-gradient(145deg,var(--accent),var(--primary)); margin-bottom: 18px; }
.login-card h1 { margin: 0; font-size: 32px; letter-spacing: -.04em; }
.login-card > p { color: var(--muted); line-height: 1.5; }
.profile-list { display: grid; gap: 10px; margin-top: 18px; }
.profile-choice { display: flex; align-items: center; gap: 12px; width: 100%; border: 1px solid var(--line); background: var(--surface-strong); border-radius: 18px; padding: 13px; cursor: pointer; text-align: left; }
.profile-choice strong { display: block; }
.profile-choice small { display: block; color: var(--muted); margin-top: 3px; }
.avatar { width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 900; background: var(--primary); flex: 0 0 auto; }

.form-grid { display: grid; gap: 13px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 800; font-size: 13px; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface-strong); color: var(--text);
  border-radius: 15px; min-height: 48px; padding: 11px 13px; outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb,var(--primary) 18%,transparent); }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.primary-button, .secondary-button, .danger-button {
  border: 0; border-radius: 15px; min-height: 48px; padding: 11px 16px; font-weight: 900; cursor: pointer;
}
.primary-button { background: var(--primary); color: #fff; }
.secondary-button { background: var(--line); color: var(--text); }
.danger-button { background: color-mix(in srgb,var(--danger) 15%,var(--surface-strong)); color: var(--danger); }
.button-row { display: flex; gap: 10px; }
.button-row > * { flex: 1; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(20,17,15,.46); backdrop-filter: blur(5px); display: grid; align-items: end; }
.modal { width: min(100%, 620px); max-height: 91vh; overflow: auto; margin: 0 auto; background: var(--surface-strong); border-radius: 28px 28px 0 0; padding: 18px 18px calc(20px + var(--safe-bottom)); box-shadow: 0 -24px 70px rgba(0,0,0,.28); }
.modal-handle { width: 48px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 23px; }

.empty { text-align: center; padding: 28px 18px; color: var(--muted); }
.empty .emoji { font-size: 42px; display: block; margin-bottom: 10px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(102px + var(--safe-bottom)); z-index: 100; max-width: calc(100% - 32px); background: #24211f; color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 15px 45px rgba(0,0,0,.3); font-weight: 700; }

.budget-bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.budget-bar span { display: block; height: 100%; background: linear-gradient(90deg,var(--primary),var(--accent)); border-radius: inherit; }
.money-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.money-row strong { font-size: 27px; letter-spacing: -.035em; }
.money-row span { color: var(--muted); font-size: 13px; }

.theme-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.theme-choice { border: 2px solid transparent; background: var(--surface); border-radius: 20px; padding: 13px; cursor: pointer; text-align: left; }
.theme-choice.active { border-color: var(--primary); }
.theme-preview { height: 72px; border-radius: 15px; margin-bottom: 9px; position: relative; overflow: hidden; }
.theme-preview::before, .theme-preview::after { content:""; position:absolute; border-radius:14px; background:rgba(255,255,255,.8); }
.theme-preview::before { width:62%; height:22px; left:10px; top:11px; }
.theme-preview::after { width:40%; height:18px; left:10px; top:42px; }
.preview-pastell { background: linear-gradient(145deg,#f2bccc,#bca8d6); }
.preview-apple { background: linear-gradient(145deg,#e8ebf2,#7aa0ff); }
.preview-cozy { background: linear-gradient(145deg,#ead5bf,#8da692); }
.preview-cats { background: linear-gradient(145deg,#ffd7df,#c8a5d2); }

.cat-helper { display: none; }
[data-theme="cats"] .cat-helper { display: inline; }

@media (min-width: 760px) {
  main { padding: 24px 24px 42px; }
  .dashboard-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; align-items: start; }
  .modal-backdrop { align-items: center; padding: 22px; }
  .modal { border-radius: 28px; padding-bottom: 20px; }
  .fab { right: max(24px, calc((100vw - 1080px)/2 + 24px)); }
}

@media (max-width: 520px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 176px; padding: 21px; }
  .inline-fields { grid-template-columns: 1fr; }
  .item { grid-template-columns: auto minmax(0,1fr); }
  .item-actions { grid-column: 2; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .hero::after { transform: none !important; }
}

/* Familiennest Build 2.0 */
[data-theme="cats"][data-mode="dark"] {
  --bg: #151119;
  --surface: rgba(37, 29, 42, .90);
  --surface-strong: #2b2230;
  --text: #fff8fc;
  --muted: #cdbfca;
  --line: rgba(255, 220, 238, .13);
  --primary: #c995d6;
  --primary-strong: #e5b4ee;
  --accent: #f3a9c2;
  --cat-pattern:
    radial-gradient(circle at 18% 16%, rgba(242,169,194,.10) 0 4px, transparent 5px),
    radial-gradient(circle at 82% 74%, rgba(201,149,214,.11) 0 5px, transparent 6px),
    linear-gradient(135deg, rgba(255,255,255,.018) 25%, transparent 25% 50%, rgba(255,255,255,.018) 50% 75%, transparent 75%);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.menu-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 28px rgba(0,0,0,.07);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.menu-symbol { font-size: 23px; line-height: 1; font-weight: 900; }
.paw-menu-button { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 28%, var(--surface-strong)), color-mix(in srgb, var(--primary) 18%, var(--surface-strong))); }
.paw-menu-button .menu-symbol { font-size: 22px; transform: rotate(-12deg); }

.menu-backdrop {
  align-items: stretch;
  justify-content: end;
  background: rgba(20,17,15,.38);
}
.menu-drawer {
  width: min(88vw, 390px);
  height: 100%;
  margin-left: auto;
  overflow-y: auto;
  padding: calc(14px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px rgba(0,0,0,.22);
  animation: menu-slide-in .22s ease-out both;
}
@keyframes menu-slide-in { from { transform: translateX(100%); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.menu-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.menu-drawer-title { display: flex; align-items: center; gap: 9px; font-size: 20px; }
.menu-drawer-title > span { font-size: 22px; }
.menu-profile-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border: 1px solid var(--line); overflow: hidden; }
.menu-profile-card strong, .menu-profile-card small { display: block; }
.menu-profile-card small { color: var(--muted); margin-top: 3px; font-size: 11px; overflow-wrap: anywhere; }
.menu-profile-cat { font-size: 31px; }
.menu-navigation { display: grid; gap: 7px; margin-top: 16px; }
.menu-nav-item, .menu-logout { width: 100%; min-height: 50px; border: 0; border-radius: 16px; background: transparent; color: var(--text); display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; text-align: left; cursor: pointer; font-weight: 800; }
.menu-nav-item:hover, .menu-nav-item.active { background: color-mix(in srgb, var(--primary) 13%, var(--surface)); color: var(--primary-strong); }
.menu-nav-icon { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); font-size: 18px; }
.menu-nav-count { min-width: 23px; height: 23px; border-radius: 999px; padding: 0 6px; background: #e64255; color: #fff; display: grid; place-items: center; font-size: 10px; }
.menu-logout { margin-top: 18px; color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); grid-template-columns: 34px 1fr; }
.menu-cat-footer { display: flex; justify-content: center; gap: 24px; margin-top: 22px; color: var(--accent); opacity: .55; font-size: 20px; }
[data-theme="cats"] .menu-drawer { background: var(--cat-pattern, none), color-mix(in srgb, var(--surface-strong) 97%, transparent); border-left-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
[data-theme="cats"] .menu-drawer::before { content: "🐾"; position: fixed; right: -19px; top: 23%; opacity: .06; font-size: 112px; pointer-events: none; transform: rotate(18deg); }
[data-theme="cats"] .menu-nav-item.active::after { content: "🐾"; font-size: 12px; opacity: .65; }
.notification-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0,0,0,.07);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 19px;
}
.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  padding: 0 5px;
  background: #e64255;
  color: #fff;
  border: 2px solid var(--bg);
  font-size: 10px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.bottom-nav { grid-template-columns: repeat(4, 1fr); }
.bottom-nav button { position: relative; }
.nav-icon-wrap { position: relative; display: grid !important; place-items: center; width: 32px; height: 26px; margin: 0 !important; }
.nav-icon { font-size: 21px !important; line-height: 1; }
.nav-count {
  position: absolute;
  top: -8px;
  right: -12px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e64255;
  color: #fff !important;
  display: grid !important;
  place-items: center;
  font-size: 9px !important;
  font-weight: 900;
  border: 2px solid var(--surface-strong);
  margin: 0 !important;
}
.nav-unread {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e64255;
  box-shadow: 0 0 0 3px var(--surface-strong);
  margin: 0 !important;
}

.calendar-header-row { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.calendar-title { margin-top: 4px; }
.today-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary-strong);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 850;
  cursor: pointer;
  margin-bottom: 12px;
}
.calendar-segmented { margin-bottom: 14px; }
.calendar-mode-content { min-width: 0; }

.date-rail {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 3px 2px 13px;
  margin: 0 -2px;
}
.date-rail::-webkit-scrollbar { display: none; }
.date-rail-card {
  flex: 0 0 82px;
  min-height: 112px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 21px;
  padding: 10px 7px 8px;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: center;
  box-shadow: 0 7px 22px rgba(0,0,0,.045);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.date-rail-card:active { transform: scale(.97); }
.date-rail-card.active {
  background: linear-gradient(155deg, var(--primary), var(--primary-strong));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 28%, transparent);
}
.date-rail-card.is-today:not(.active) { border-color: color-mix(in srgb, var(--primary) 70%, var(--line)); }
.date-rail-weekday { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 850; opacity: .72; }
.date-rail-card > strong { display: block; font-size: 27px; line-height: 1; margin: 6px 0 3px; }
.date-rail-month { display: block; font-size: 10px; opacity: .72; }

.mini-category-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 21px;
  margin-top: 7px;
}
.mini-category {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 19px;
  padding: 0 4px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--category) 78%, #111);
  background: color-mix(in srgb, var(--category) 17%, var(--surface-strong));
  border: 1px solid color-mix(in srgb, var(--category) 34%, transparent);
  font-size: 8px;
  line-height: 1;
}
.mini-category span { font-size: 9px; }
.mini-category b { font-size: 8px; }
.date-rail-card.active .mini-category,
.day-card.active .mini-category {
  background: rgba(255,255,255,.20);
  border-color: rgba(255,255,255,.22);
  color: #fff;
}

.calendar-hero { min-height: 216px; display: flex; align-items: stretch; justify-content: space-between; margin-top: 2px; }
.calendar-hero .hero-copy { position: relative; z-index: 2; max-width: 680px; }
.eyebrow { display: inline-flex; align-items: center; min-height: 27px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.19); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 13px; }
.hero-alert { background: rgba(133, 24, 43, .35); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 11px;
  margin-top: 13px;
}
.summary-card {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 25px;
  padding: 15px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.summary-card::before {
  content: "";
  position: absolute;
  inset: auto -32px -40px auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: .17;
  background: currentColor;
}
.summary-card.task-summary { background: linear-gradient(145deg, color-mix(in srgb, #3b82f6 10%, var(--surface)), var(--surface)); }
.summary-card.meal-summary { background: linear-gradient(145deg, color-mix(in srgb, #22c55e 10%, var(--surface)), var(--surface)); }
.summary-card.shopping-summary { background: linear-gradient(145deg, color-mix(in srgb, #8b5cf6 10%, var(--surface)), var(--surface)); }
.summary-icon { width: 45px; height: 45px; border-radius: 16px; background: color-mix(in srgb, var(--primary) 13%, var(--surface-strong)); display: grid; place-items: center; font-size: 22px; }
.summary-copy { min-width: 0; }
.summary-copy strong { display: block; font-size: 26px; line-height: 1; letter-spacing: -.04em; }
.summary-copy > span { display: block; margin-top: 5px; font-weight: 850; }
.summary-copy small { display: block; margin-top: 4px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-arrow { font-size: 28px; color: var(--muted); }
.calendar-dashboard { margin-top: 4px; }

.category-legend { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.category-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.category-legend-item.has-items { color: color-mix(in srgb, var(--category) 75%, var(--text)); border-color: color-mix(in srgb, var(--category) 30%, var(--line)); background: color-mix(in srgb, var(--category) 9%, var(--surface)); }
.category-legend-item b { font-size: 10px; }

.agenda-item { position: relative; overflow: hidden; }
.agenda-item::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary); opacity: .65; }
.agenda-meal::before { background: #22c55e; }
.agenda-shopping::before { background: #8b5cf6; }
.agenda-type-icon { border: 0; background: color-mix(in srgb, #22c55e 13%, var(--surface-strong)); }

.next-up-list { display: grid; gap: 9px; margin-bottom: 12px; }
.upcoming-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 11px;
  text-align: left;
  cursor: pointer;
}
.upcoming-card strong, .upcoming-card small { display: block; }
.upcoming-card small { color: var(--muted); margin-top: 3px; }
.upcoming-icon { width: 36px; height: 36px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--category) 14%, var(--surface-strong)); }

.calendar-navigation, .month-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.month-navigation { margin-bottom: 16px; }
.month-navigation > div { text-align: center; }
.month-navigation h2 { margin: 0; font-size: 21px; text-transform: capitalize; }
.month-navigation p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.enhanced-week-strip { margin-bottom: 13px; }
.day-card .daymonth { font-size: 10px; opacity: .7; }
.enhanced-month-grid .month-day { min-height: 76px; display: flex; flex-direction: column; align-items: flex-start; }
.enhanced-month-grid .month-day.selected { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); border-color: var(--primary); }
.enhanced-month-grid .mini-category-counts { justify-content: flex-start; margin-top: auto; }
.enhanced-month-grid .mini-category { padding: 0 3px; }
.enhanced-month-grid .mini-category span { display: none; }

.personal-task-pill { display: inline-flex; min-height: 30px; align-items: center; padding: 5px 10px; border-radius: 999px; color: var(--primary-strong); background: color-mix(in srgb, var(--primary) 13%, var(--surface)); font-size: 11px; font-weight: 850; }
.task-segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.task-segmented button span { min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 999px; background: var(--line); font-size: 10px; }
.task-segmented button.active span { background: color-mix(in srgb, var(--primary) 18%, var(--surface-strong)); }

.notification-modal { min-height: min(720px, 82vh); }
.notification-intro { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 18px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); margin-bottom: 12px; }
.notification-intro > span { width: 42px; height: 42px; border-radius: 15px; background: var(--surface-strong); display: grid; place-items: center; font-size: 20px; }
.notification-intro p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.notification-list { display: grid; gap: 8px; }
.notification-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}
.notification-item.unread::after { content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #e64255; }
.notification-item-icon { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--category) 14%, var(--surface-strong)); }
.notification-item-copy strong, .notification-item-copy small { display: block; }
.notification-item-copy small { margin-top: 4px; color: var(--muted); }
.notification-chevron { color: var(--muted); font-size: 24px; }
.quick-add-date { display: flex; align-items: center; gap: 9px; min-height: 43px; border-radius: 15px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); padding: 9px 12px; margin-bottom: 12px; }
.category-avatar.school { background: #3b82f6; }
.category-avatar.chore { background: #f59e0b; }
.category-avatar.meal { background: #22c55e; }
.category-avatar.shopping { background: #8b5cf6; }
.build-info { text-align: center; color: var(--muted); font-size: 10px; margin-top: 15px; }
.empty-paws { display: block; margin-top: 9px; letter-spacing: 7px; opacity: .5; }

/* Katzenwelt: sichtbar in allen Bereichen und in Hell- sowie Dunkelmodus */
[data-theme="cats"] .app-shell { position: relative; overflow-x: hidden; }
[data-theme="cats"] .app-shell::before,
[data-theme="cats"] .app-shell::after {
  content: "🐾";
  position: fixed;
  z-index: 0;
  opacity: .055;
  font-size: 110px;
  pointer-events: none;
  transform: rotate(-18deg);
}
[data-theme="cats"] .app-shell::before { left: -30px; top: 18vh; }
[data-theme="cats"] .app-shell::after { right: -35px; bottom: 20vh; transform: rotate(22deg); }
[data-theme="cats"] main { position: relative; z-index: 2; }
[data-theme="cats"] .topbar { z-index: 60; }
[data-theme="cats"] .bottom-nav { z-index: 55; }
[data-theme="cats"] .fab { z-index: 56; }
[data-theme="cats"] .topbar { border-bottom-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
[data-theme="cats"] .brand-mark { border-radius: 48% 48% 42% 42%; position: relative; }
[data-theme="cats"] .brand-mark::before,
[data-theme="cats"] .brand-mark::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
[data-theme="cats"] .brand-mark::before { left: 5px; transform: rotate(-10deg); }
[data-theme="cats"] .brand-mark::after { right: 5px; transform: rotate(10deg); }
[data-theme="cats"] .card,
[data-theme="cats"] .item,
[data-theme="cats"] .summary-card,
[data-theme="cats"] .upcoming-card,
[data-theme="cats"] .notification-item,
[data-theme="cats"] .profile-choice { position: relative; overflow: hidden; }
[data-theme="cats"] .card::after,
[data-theme="cats"] .summary-card::after {
  content: "🐾";
  position: absolute;
  right: 12px;
  bottom: 8px;
  opacity: .065;
  font-size: 25px;
  transform: rotate(-18deg);
  pointer-events: none;
}
[data-theme="cats"] .item::after,
[data-theme="cats"] .upcoming-card::after,
[data-theme="cats"] .notification-item::before {
  content: "🐾";
  position: absolute;
  right: 8px;
  bottom: 4px;
  opacity: .045;
  font-size: 17px;
  pointer-events: none;
}
[data-theme="cats"] .modal { border-top: 2px solid color-mix(in srgb, var(--accent) 48%, transparent); }
[data-theme="cats"] .modal-head h2::after { content: "  🐾"; color: var(--accent); }
[data-theme="cats"] .bottom-nav button.active::after { content: "🐾"; position: absolute; bottom: 2px; right: 14px; font-size: 8px; }
[data-theme="cats"] .fab { border-radius: 48% 48% 40% 40%; }
[data-theme="cats"] .fab::before,
[data-theme="cats"] .fab::after { content: ""; position: absolute; top: -7px; width: 17px; height: 17px; background: var(--primary); clip-path: polygon(50% 0, 0 100%, 100% 100%); }
[data-theme="cats"] .fab::before { left: 8px; transform: rotate(-12deg); }
[data-theme="cats"] .fab::after { right: 8px; transform: rotate(12deg); }
[data-theme="cats"] .fab span { position: relative; z-index: 2; }
.cat-hero-scene { position: relative; z-index: 2; min-width: 150px; align-self: stretch; }
.cat-face { position: absolute; right: 4px; bottom: -16px; font-size: 105px; filter: drop-shadow(0 15px 20px rgba(70,25,65,.18)); }
.cat-paw { position: absolute; font-size: 24px; opacity: .55; }
.cat-paw.p1 { right: 104px; top: 24px; transform: rotate(-18deg); }
.cat-paw.p2 { right: 24px; top: 10px; transform: rotate(19deg); }
[data-theme="cats"][data-mode="dark"] .card,
[data-theme="cats"][data-mode="dark"] .item,
[data-theme="cats"][data-mode="dark"] .summary-card,
[data-theme="cats"][data-mode="dark"] .date-rail-card,
[data-theme="cats"][data-mode="dark"] .upcoming-card,
[data-theme="cats"][data-mode="dark"] .notification-item { box-shadow: 0 15px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.025); }
[data-theme="cats"][data-mode="dark"] .calendar-hero { background: linear-gradient(145deg, #8c588f, #aa627c); }
[data-theme="cats"][data-mode="dark"] .mini-category { color: #fff; }

.paw-burst { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.paw-burst span {
  position: absolute;
  left: var(--x);
  bottom: -12vh;
  font-size: var(--size);
  opacity: 0;
  filter: drop-shadow(0 6px 8px rgba(70,25,65,.18));
  animation: paw-flight 1.35s cubic-bezier(.17,.72,.28,1) var(--delay) forwards;
}
@keyframes paw-flight {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg) scale(.6); }
  12% { opacity: .95; }
  70% { opacity: .9; }
  100% { opacity: 0; transform: translate3d(var(--drift), -112vh, 0) rotate(var(--rotation)) scale(1.2); }
}

@media (max-width: 760px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 100px; }
  .cat-hero-scene { min-width: 92px; }
  .cat-face { font-size: 76px; right: -8px; }
  .cat-paw.p1 { right: 52px; }
  .category-legend { justify-content: flex-start; margin-top: 6px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .calendar-header-row .section-head { flex-direction: row; }
}

@media (max-width: 420px) {
  .date-rail-card { flex-basis: 76px; }
  .calendar-hero { min-height: 225px; }
  .hero-badges { max-width: 88%; }
  .cat-hero-scene { min-width: 64px; }
  .cat-face { font-size: 62px; right: -13px; bottom: -9px; }
  .enhanced-month-grid .month-day { min-height: 66px; padding: 5px; }
  .enhanced-month-grid .mini-category { min-width: 12px; padding: 0 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .paw-burst { display: none !important; }
  .date-rail-card { transition: none !important; }
  .menu-drawer { animation: none !important; }
}
