/* ============================================================
   Komorga – Design System
   ============================================================ */

:root {
  --bg:        #0b0d17;
  --bg-2:      #0e1120;
  --surface:   rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.07);
  --surface-solid: #151a2c;
  --border:    rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);
  --text:      #eaeefb;
  --muted:     #99a1bb;
  --faint:     #6b7391;

  --accent:    #7c8bff;
  --accent-2:  #b06bff;
  --grad:      linear-gradient(135deg, #6d8bff 0%, #b06bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(109,139,255,.18), rgba(176,107,255,.18));

  --jan:       #4f8cff;
  --steffi:    #ff5da2;

  --overdue:   #ff5c72;
  --due:       #ffb020;
  --soon:      #4fb6ff;
  --upcoming:  #34d399;

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 11px;
  --pill: 999px;

  --shadow:   0 18px 40px -20px rgba(0,0,0,.75);
  --shadow-sm:0 6px 18px -10px rgba(0,0,0,.7);
  --ring: 0 0 0 3px rgba(124,139,255,.35);

  --ease: cubic-bezier(.22,.61,.36,1);
  --spring: cubic-bezier(.34,1.56,.64,1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 72px;
}

[data-theme="light"] {
  --bg:        #f4f6fd;
  --bg-2:      #eef1fb;
  --surface:   rgba(255,255,255,.75);
  --surface-2: rgba(255,255,255,.9);
  --surface-solid: #ffffff;
  --border:    rgba(20,28,60,.09);
  --border-strong: rgba(20,28,60,.16);
  --text:      #171b2e;
  --muted:     #5c6486;
  --faint:     #8a92b2;
  --grad-soft: linear-gradient(135deg, rgba(109,139,255,.14), rgba(176,107,255,.14));
  --shadow:   0 20px 45px -24px rgba(40,50,110,.4);
  --shadow-sm:0 8px 20px -12px rgba(40,50,110,.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Aurora-Hintergrund */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(70px); opacity: .5; will-change: transform;
}
.aurora::before { background: radial-gradient(circle, #6d8bff, transparent 62%); top: -18vmax; left: -12vmax; animation: drift1 22s var(--ease) infinite alternate; }
.aurora::after  { background: radial-gradient(circle, #b06bff, transparent 62%); bottom: -20vmax; right: -14vmax; animation: drift2 26s var(--ease) infinite alternate; }
[data-theme="light"] .aurora::before, [data-theme="light"] .aurora::after { opacity: .28; }
@keyframes drift1 { to { transform: translate(8vmax, 10vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-8vmax, -6vmax) scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after,
  .hello .wave, .skeleton, .screen, .task { animation: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Layout-Rahmen */
.app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px); position: relative; }
.screen { display: none; animation: fadeUp .35s var(--ease); }
.screen.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Header / Hero
   ============================================================ */
.hero { padding: calc(var(--safe-top) + 20px) 4px 8px; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.hello .wave { display: inline-block; animation: wave 2.4s var(--ease) infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100%{transform:rotate(0)} 10%{transform:rotate(16deg)} 20%{transform:rotate(-8deg)} 30%{transform:rotate(14deg)} 40%{transform:rotate(-4deg)} }
.hero h1 { margin: 2px 0 0; font-size: 27px; font-weight: 800; letter-spacing: -.5px; }
.hero .brand-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center;
  font-size: 19px; cursor: pointer; position: relative; transition: transform .15s var(--spring), background .2s;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.icon-btn:active { transform: scale(.9); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--pill); background: var(--overdue); color: #fff; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

/* Statistik-Karte */
.stats {
  margin-top: 16px; padding: 18px; border-radius: var(--r-xl); position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
}
.stats::after { content: ""; position: absolute; inset: 0; background: var(--grad-soft); pointer-events: none; }
.ring { --p: 0; --c: var(--upcoming); width: 76px; height: 76px; border-radius: 50%; position: relative; z-index: 1;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--faint) 0);
  display: flex; flex-direction: column; align-items: center; justify-content: center; transition: --p .8s var(--ease); }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface-solid); }
.ring .ring-num { position: relative; font-size: 24px; font-weight: 800; line-height: 1; }
.ring .ring-lbl { position: relative; font-size: 9px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; line-height: 1; margin-top: 3px; }
.stat-list { z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.stat { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.stat b { font-size: 16px; font-weight: 800; }
.stat .pip { width: 9px; height: 9px; border-radius: 50%; }
.pip.overdue{background:var(--overdue)} .pip.due{background:var(--due)} .pip.soon{background:var(--soon)} .pip.upcoming{background:var(--upcoming)}

/* ============================================================
   Sub-Navigation (Segmented) für Ansichten
   ============================================================ */
.subnav { display: flex; gap: 6px; margin: 18px 2px 6px; }
.subnav button {
  flex: 1; border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: 13.5px;
  padding: 9px 6px; border-radius: var(--pill); cursor: pointer; transition: color .2s, background .2s; position: relative;
}
.subnav button.active { color: var(--text); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.subnav .cnt { font-size: 11px; opacity: .7; margin-left: 3px; }

/* Toolbar (Suche/Filter) */
.toolbar { display: flex; gap: 8px; margin: 10px 2px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--pill); color: var(--muted); }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; }
.search input::placeholder { color: var(--faint); }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.filter-chip { white-space: nowrap; padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: .2s; flex: none; }
.filter-chip.active { background: var(--grad); color: #fff; border-color: transparent; }

/* ============================================================
   Buckets & Task-Cards
   ============================================================ */
.bucket { margin-top: 18px; }
.bucket-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.bucket-head .lbl { font-size: 13px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.bucket-head .ln { flex: 1; height: 1px; background: var(--border); }
.bucket-head .n { font-size: 12px; font-weight: 800; color: var(--muted); background: var(--surface); padding: 2px 9px; border-radius: var(--pill); }
.bucket[data-b="overdue"] .lbl { color: var(--overdue); }
.bucket[data-b="due"] .lbl { color: var(--due); }
.bucket[data-b="soon"] .lbl { color: var(--soon); }
.bucket[data-b="upcoming"] .lbl { color: var(--upcoming); }

.task {
  display: flex; align-items: center; gap: 13px; padding: 14px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden; cursor: pointer;
  transition: transform .18s var(--spring), border-color .2s, opacity .3s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.task:active { transform: scale(.985); }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.task::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--upcoming); }
.task[data-s="overdue"]::before { background: var(--overdue); }
.task[data-s="due"]::before { background: var(--due); }
.task[data-s="soon"]::before { background: var(--soon); }
.task[data-s="upcoming"]::before { background: var(--upcoming); }
.task.done { opacity: 0; transform: translateX(40px) scale(.9); pointer-events: none; }

.task-check {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong);
  background: transparent; cursor: pointer; display: grid; place-items: center; transition: .2s var(--spring); position: relative;
}
.task-check svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset .25s var(--ease) .05s; }
.task-check:hover { border-color: var(--upcoming); }
.task-check.checked { background: var(--upcoming); border-color: var(--upcoming); transform: scale(1.08); }
.task-check.checked svg { stroke-dashoffset: 0; }

.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 15.5px; font-weight: 650; margin: 0 0 4px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.task-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.room-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); padding: 3px 9px 3px 7px; border-radius: var(--pill); border: 1px solid var(--border);
  max-width: 100%; min-width: 0; }
.room-chip .em { font-size: 12.5px; flex: none; }
.room-chip .rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.freq-badge { font-size: 11px; font-weight: 800; color: var(--accent); background: rgba(124,139,255,.14); padding: 3px 8px; border-radius: var(--pill); }
.due-txt { font-size: 12px; font-weight: 700; color: var(--muted); }
.due-txt.overdue { color: var(--overdue); }
.due-txt.due { color: var(--due); }
.due-txt.soon { color: var(--soon); }

.avatar-stack { display: flex; flex: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800;
  color: #fff; border: 2px solid var(--surface-solid); margin-left: -8px; }
.avatar:first-child { margin-left: 0; }

/* Leerzustand */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .em { font-size: 52px; display: block; margin-bottom: 12px; filter: saturate(.6); }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; }
.empty p { margin: 0; font-size: 14px; }

/* ============================================================
   FAB & Bottom-Tabbar
   ============================================================ */
.fab {
  position: fixed; z-index: 40; right: max(18px, calc(50% - 360px + 18px)); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad); color: #fff; font-size: 28px; font-weight: 300; line-height: 1;
  box-shadow: 0 14px 30px -8px rgba(124,80,255,.7); display: grid; place-items: center;
  transition: transform .2s var(--spring); }
.fab:active { transform: scale(.88) rotate(90deg); }

.tabbar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--border); display: flex; justify-content: center; }
.tabbar-inner { width: 100%; max-width: 720px; display: flex; }
.tab { flex: 1; border: none; background: none; cursor: pointer; color: var(--faint); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding-top: 10px; transition: color .2s; }
.tab .ic { font-size: 21px; transition: transform .2s var(--spring); }
.tab.active { color: var(--text); }
.tab.active .ic { transform: translateY(-2px) scale(1.12); }

/* ============================================================
   Bottom-Sheet (Formulare / Details)
   ============================================================ */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(4,6,14,.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 720px;
  background: var(--surface-solid); border-radius: 26px 26px 0 0; border-top: 1px solid var(--border-strong);
  box-shadow: 0 -20px 60px -20px rgba(0,0,0,.6); padding: 10px 20px calc(24px + var(--safe-bottom));
  transform: translateY(101%); transition: transform .38s var(--spring); max-height: 92vh; overflow-y: auto; }
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 14px; }
.sheet-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 20px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; transition: transform .15s var(--spring), color .2s; z-index: 2; }
.sheet-close:active { transform: scale(.88); }
.sheet-close:hover { color: var(--text); }
.sheet h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.sheet .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 2px 7px; text-transform: uppercase; letter-spacing: .4px; }
.field input[type="text"], .field input[type="date"], .field textarea, .field select {
  width: 100%; padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font-size: 15.5px; font-family: inherit; outline: none; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: var(--ring); }

.seg { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--pill); padding: 4px; }
.seg button { flex: 1; border: none; background: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 9px; border-radius: var(--pill);
  cursor: pointer; transition: .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.active { background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }
.seg .av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; }

.freq-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.freq-chips button { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: 14px;
  padding: 10px 15px; border-radius: var(--r-md); cursor: pointer; transition: .2s; }
.freq-chips button.active { background: var(--grad); color: #fff; border-color: transparent; }
.freq-chips input[type="number"] { width: 92px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text); font-size: 15px; font-weight: 700; font-family: inherit; outline: none; -moz-appearance: textfield; }
.freq-chips input[type="number"]::-webkit-outer-spin-button, .freq-chips input[type="number"]::-webkit-inner-spin-button { opacity: .5; }
.freq-chips input[type="number"]:focus { border-color: var(--accent); box-shadow: var(--ring); }

.sheet-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn { flex: 1; border: none; padding: 15px; border-radius: var(--r-md); font-size: 15.5px; font-weight: 800; cursor: pointer;
  transition: transform .15s var(--spring), opacity .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 12px 26px -12px rgba(124,80,255,.8); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); flex: 0 0 auto; padding-inline: 20px; }
.btn-danger { background: rgba(255,92,114,.14); color: var(--overdue); border: 1px solid rgba(255,92,114,.3); flex: 0 0 auto; padding-inline: 18px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Detail-Meta im Sheet */
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }

/* ============================================================
   Einstellungen
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.card p.muted { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.row:first-of-type { border-top: none; }
.row .rt { font-size: 14.5px; font-weight: 600; }
.row .rs { font-size: 12.5px; color: var(--muted); }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--faint); border-radius: var(--pill); transition: .25s; cursor: pointer; }
.switch .track::before { content: ""; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .25s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::before { transform: translateX(20px); }

.theme-seg { display: flex; gap: 6px; }
.theme-seg button { flex: 1; padding: 9px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.theme-seg button.active { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

.link-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; margin-top: 8px; }
.link-box code { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.link-box button { border: none; background: var(--grad); color: #fff; font-weight: 700; font-size: 12px; padding: 7px 12px; border-radius: var(--r-sm); cursor: pointer; }

/* ============================================================
   Onboarding / Startscreen
   ============================================================ */
.onboard { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; padding: calc(var(--safe-top) + 8vh) 26px calc(var(--safe-bottom) + 30px);
  overflow-y: auto; background: var(--bg); }
.onboard.show { display: flex; animation: fadeUp .5s var(--ease); }
.onboard-logo { width: 96px; height: 96px; border-radius: 26px; margin: 0 auto 22px; box-shadow: 0 20px 50px -16px rgba(124,80,255,.7); }
.onboard h1 { text-align: center; font-size: 34px; font-weight: 850; letter-spacing: -1px; margin: 0 0 6px; }
.onboard h1 .brand-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.onboard .tag { text-align: center; color: var(--muted); font-size: 15.5px; max-width: 340px; margin: 0 auto 34px; }
.onboard-feats { display: grid; gap: 12px; max-width: 380px; margin: 0 auto 30px; width: 100%; }
.feat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; }
.feat .fi { width: 42px; height: 42px; border-radius: 13px; background: var(--grad-soft); display: grid; place-items: center; font-size: 21px; flex: none; }
.feat .ft { font-size: 14.5px; font-weight: 700; }
.feat .fs { font-size: 12.5px; color: var(--muted); }
.onboard-access { max-width: 380px; margin: 0 auto; width: 100%; }
.onboard-access label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; display: block; margin: 0 2px 8px; }
.onboard-access .hint { font-size: 12.5px; color: var(--faint); margin: 10px 2px 0; text-align: center; }

/* iOS-Install-Hinweis */
.ios-tip { max-width: 380px; margin: 20px auto 0; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; font-size: 13.5px; color: var(--muted); display: none; }
.ios-tip.show { display: block; }
.ios-tip b { color: var(--text); }

/* ============================================================
   Toasts
   ============================================================ */
.toast-wrap { position: fixed; z-index: 200; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--surface-solid); border: 1px solid var(--border-strong);
  color: var(--text); padding: 12px 16px; border-radius: var(--pill); box-shadow: var(--shadow); font-size: 14px; font-weight: 600;
  animation: toastIn .35s var(--spring); max-width: calc(100% - 32px); }
.toast .undo { border: none; background: none; color: var(--accent); font-weight: 800; font-size: 14px; cursor: pointer; padding: 2px 4px; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(16px) scale(.95); } }

/* Skeleton-Ladeanimation */
.skeleton { height: 66px; border-radius: var(--r-lg); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   Tab-Badges (Bottom-Nav)
   ============================================================ */
.tab { position: relative; }
.tab-badge { position: absolute; top: 4px; left: calc(50% + 12px); min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--pill); background: var(--overdue); color: #fff; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }

/* ============================================================
   Wegräumen
   ============================================================ */
.pa-card { display: flex; align-items: center; gap: 13px; padding: 12px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: transform .18s var(--spring), opacity .3s; }
.pa-card.done { opacity: 0; transform: translateX(40px) scale(.9); pointer-events: none; }
.pa-photo { width: 68px; height: 68px; flex: none; border-radius: var(--r-md); object-fit: cover; cursor: zoom-in;
  border: 1px solid var(--border); background: var(--surface-2); }
.pa-noimg { display: grid; place-items: center; font-size: 30px; cursor: default; }
.pa-body { flex: 1; min-width: 0; }
.pa-note { font-size: 15px; font-weight: 650; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pa-meta { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pa-done { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border-strong);
  background: transparent; cursor: pointer; display: grid; place-items: center; transition: .2s var(--spring); }
.pa-done svg { width: 17px; height: 17px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pa-done:active { background: var(--upcoming); border-color: var(--upcoming); transform: scale(1.1); }
.pa-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.pa-remove { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: color .2s, background .2s, transform .15s var(--spring); }
.pa-remove:active { transform: scale(.86); }
.pa-remove:hover { color: var(--overdue); }

/* Foto-Uploader im Sheet */
.pa-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 140px; border: 2px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface);
  color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; transition: border-color .2s, background .2s; }
.pa-drop:active { border-color: var(--accent); background: var(--surface-2); }
.pa-drop .em { font-size: 34px; }
.pa-preview { width: 100%; max-height: 300px; object-fit: contain; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; }

/* Foto-Lightbox */
.photo-lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(4,6,14,.9); display: grid; place-items: center;
  padding: 24px; cursor: zoom-out; animation: fadeUp .2s var(--ease); }
.photo-lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); box-shadow: var(--shadow); }

/* ============================================================
   Einkaufsliste
   ============================================================ */
.shop-add { display: flex; gap: 8px; margin: 6px 0 16px; }
.shop-add input { flex: 1; padding: 13px 15px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--pill); color: var(--text); font-size: 15.5px; outline: none; transition: border-color .2s, box-shadow .2s; }
.shop-add input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.shop-add button { flex: none; width: 48px; border: none; border-radius: 50%; background: var(--grad); color: #fff;
  font-size: 26px; font-weight: 300; cursor: pointer; transition: transform .15s var(--spring); }
.shop-add button:active { transform: scale(.9); }

.shop-list { margin-bottom: 8px; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: opacity .25s, background .2s; }
.shop-check { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong);
  background: transparent; cursor: pointer; display: grid; place-items: center; transition: .2s var(--spring); }
.shop-check svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3.4; fill: none; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transition: opacity .15s; }
.shop-check.checked { background: var(--upcoming); border-color: var(--upcoming); }
.shop-check.checked svg { opacity: 1; }
.shop-title { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-item.done .shop-title { text-decoration: line-through; color: var(--muted); }
.shop-by { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #fff; }
.shop-del { flex: none; border: none; background: none; color: var(--faint); font-size: 22px; line-height: 1; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%; transition: color .2s, background .2s; }
.shop-del:active { color: var(--overdue); background: var(--surface-2); }
.shop-done-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 10px;
  font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.linkbtn { border: none; background: none; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; }

/* ============================================================
   Erledigt-Feier (Party-Dino + Feuerwerk)
   ============================================================ */
.celebrate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; pointer-events: none; }
.celebrate-stage { position: relative; width: 240px; height: 240px;
  animation: celebIn .45s var(--spring) both, celebOut .4s var(--ease) 1.25s forwards; }
@keyframes celebIn { from { transform: scale(.3) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes celebOut { to { transform: scale(1.12) translateY(-14px); opacity: 0; } }
.celebrate-scene { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.celebrate-dino-img { position: absolute; inset: 0; margin: auto; width: 152px; height: 152px; object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.35)); animation: dinoBounce .5s var(--ease) .1s 2 alternate; transform-origin: 50% 85%; }
@keyframes dinoBounce { from { transform: translateY(5px) scale(1, .97); } to { transform: translateY(-10px) scale(.98, 1.03); } }

/* Feuerwerk-Bursts */
.fw { transform-box: fill-box; transform-origin: center; opacity: 0; animation: fwBurst .95s ease-out both; }
.fw line { stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fw circle { fill: currentColor; }
@keyframes fwBurst {
  0%   { transform: scale(.12); opacity: 0; }
  18%  { opacity: 1; }
  65%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Konfetti */
.confetti { position: absolute; top: -8px; width: 8px; height: 13px; border-radius: 2px; opacity: 0;
  animation-name: confFall; animation-timing-function: cubic-bezier(.3,.5,.5,1); animation-fill-mode: forwards; }
@keyframes confFall {
  0%   { transform: translateY(-12px) rotate(0deg); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translateY(220px) rotate(var(--rot, 360deg)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .celebrate { display: none !important; } }

/* Desktop-Feinschliff */
@media (min-width: 760px) {
  .tabbar { border-radius: 0; }
  .task:hover { border-color: var(--border-strong); transform: translateY(-1px); }
}
.hidden { display: none !important; }
