/* =====================================================================
   FamilyPlaner – Stylesheet
   Modern, verspielt, bunt. Design-Tokens siehe TECHDOC 1.2
   ===================================================================== */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

/* ---------- Tokens (hell) ---------- */
:root {
  --bg: #F5F3FF;
  --card: #FFFFFF;
  --card-2: #EFECFB;
  --ink: #1E1B3A;
  --muted: #5E5A7D;
  --line: #E2DCFF;
  --ring: #B9B4D6;
  --sun: #FFC93C;
  --shadow: 0 6px 18px rgba(46, 33, 120, 0.08);
  --shadow-strong: 0 10px 30px rgba(30, 27, 58, 0.16);

  /* Modulfarben: --c-x = Text/Akzent, --c-x-fill = Fläche mit weißer Schrift, --c-x-tint = helle Fläche */
  --c-todo: #5B3BE0;   --c-todo-fill: #5B3BE0;   --c-todo-tint: #ECE7FF;
  --c-shop: #0B7A47;   --c-shop-fill: #0B7A47;   --c-shop-tint: #DDF5E8;
  --c-event: #1F5FD9;  --c-event-fill: #1F5FD9;  --c-event-tint: #E1EBFF;
  --c-bday: #D6246E;   --c-bday-fill: #D6246E;   --c-bday-tint: #FFE3EF;
  --c-gift: #A34B00;   --c-gift-fill: #C25A00;   --c-gift-tint: #FFEBD6;
  --c-danger: #B3261E; --c-danger-tint: #FDE7E5;

  --accent: var(--c-todo);
  --accent-fill: var(--c-todo-fill);
  --accent-tint: var(--c-todo-tint);

  --radius-card: 24px;
  --radius-input: 18px;
  --radius-icon: 14px;
  --font-head: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

/* ---------- Tokens (dunkel) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16142B; --card: #221F3D; --card-2: #2B2750; --ink: #F1EFFF; --muted: #B5B0D6;
    --line: #3A3566; --ring: #6F68A3; --sun: #E0A92A;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.35); --shadow-strong: 0 10px 30px rgba(0, 0, 0, 0.5);
    --c-todo: #B3A3FF;  --c-todo-tint: #2E2760;
    --c-shop: #5FD6A0;  --c-shop-tint: #173A2C;
    --c-event: #8DB2FF; --c-event-tint: #1C2B52;
    --c-bday: #FF8CBB;  --c-bday-tint: #4A1C33;
    --c-gift: #FFAE66;  --c-gift-tint: #47290F;
    --c-danger: #FF8A80; --c-danger-tint: #4A1E1C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16142B; --card: #221F3D; --card-2: #2B2750; --ink: #F1EFFF; --muted: #B5B0D6;
  --line: #3A3566; --ring: #6F68A3; --sun: #E0A92A;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.35); --shadow-strong: 0 10px 30px rgba(0, 0, 0, 0.5);
  --c-todo: #B3A3FF;  --c-todo-tint: #2E2760;
  --c-shop: #5FD6A0;  --c-shop-tint: #173A2C;
  --c-event: #8DB2FF; --c-event-tint: #1C2B52;
  --c-bday: #FF8CBB;  --c-bday-tint: #4A1C33;
  --c-gift: #FFAE66;  --c-gift-tint: #47290F;
  --c-danger: #FF8A80; --c-danger-tint: #4A1E1C;
  color-scheme: dark;
}

/* Modul-Akzent je Ansicht */
.m-todo  { --accent: var(--c-todo);  --accent-fill: var(--c-todo-fill);  --accent-tint: var(--c-todo-tint); }
.m-shop  { --accent: var(--c-shop);  --accent-fill: var(--c-shop-fill);  --accent-tint: var(--c-shop-tint); }
.m-event { --accent: var(--c-event); --accent-fill: var(--c-event-fill); --accent-tint: var(--c-event-tint); }
.m-bday  { --accent: var(--c-bday);  --accent-fill: var(--c-bday-fill);  --accent-tint: var(--c-bday-tint); }
.m-gift  { --accent: var(--c-gift);  --accent-fill: var(--c-gift-fill);  --accent-tint: var(--c-gift-tint); }

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; line-height: 1.15; }
h1 { font-size: 32px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); font-weight: 800; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); font-weight: 700; font-size: 14px; }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
svg { flex: none; }
.noscript { padding: 24px; text-align: center; }

/* ---------- App-Rahmen ---------- */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  overflow: hidden;
}
@media (min-width: 600px) {
  body { background: radial-gradient(circle at 20% 10%, var(--accent-tint, #ECE7FF) 0, transparent 40%), var(--bg); }
  .app { box-shadow: var(--shadow-strong); background: var(--bg); }
}
.splash { margin: auto; text-align: center; display: grid; gap: 12px; justify-items: center; color: var(--muted); font-weight: 700; }
.splash img { border-radius: 20px; animation: bob 1.4s ease-in-out infinite; }

.view { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; isolation: isolate; }
.view-head { position: relative; display: flex; flex-direction: column; gap: 14px; padding: calc(20px + env(safe-area-inset-top)) 20px 0; }
.view-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Kinder dürfen im scrollenden Flex-Container nie schrumpfen – sonst werden Elemente mit
   overflow (z. B. .list-card, .bday-row) zusammengestaucht und unsichtbar (ERR-0009) */
.view-scroll > *, .auth > * { flex-shrink: 0; }
.view-scroll.with-fab { padding-bottom: 92px; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.head-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Deko-Formen */
.blob { position: absolute; z-index: -1; pointer-events: none; }
/* Ebene für Deko-Formen außerhalb der App (Installer, Gastansicht): schneidet Überstand ab,
   sonst wird die Seite auf dem Handy breiter als der Bildschirm (ERR-0007) */
.blob-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.blob-layer .blob { z-index: 0; }
.blob-sun { top: -70px; right: -60px; width: 210px; height: 210px; background: var(--sun); opacity: .55; border-radius: 62% 38% 55% 45% / 48% 58% 42% 52%; animation: floaty 8s ease-in-out infinite; }
.blob-pink { top: 120px; left: -80px; width: 160px; height: 160px; background: var(--c-bday-tint); border-radius: 45% 55% 40% 60% / 55% 45% 55% 45%; }
.blob-accent { top: -100px; right: -70px; width: 260px; height: 230px; background: var(--accent-tint); border-radius: 55% 45% 60% 40% / 45% 55% 45% 55%; }
.blob-dot { top: 28px; right: 150px; width: 20px; height: 20px; border-radius: 50%; background: var(--sun); }
.blob-orange { top: -90px; right: -50px; width: 260px; height: 240px; background: var(--c-gift-tint); border-radius: 48% 52% 60% 40% / 52% 48% 52% 48%; z-index: -1; }

/* ---------- Navigation unten ---------- */
.bottom-nav {
  flex: none;
  margin: 0 14px calc(14px + env(safe-area-inset-bottom));
  height: 74px;
  padding: 8px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow-strong);
  display: flex;
  gap: 4px;
  z-index: 5;
}
.bottom-nav a {
  flex: 1;
  min-width: 0;
  border-radius: 20px;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 800;
  transition: background .2s, color .2s, transform .2s;
}
.bottom-nav a[aria-current="page"] { background: var(--nav-active, var(--ink)); color: #fff; transform: translateY(-2px); }
.bottom-nav a[data-nav="start"][aria-current="page"] { --nav-active: var(--ink); }
:root[data-theme="dark"] .bottom-nav a[data-nav="start"][aria-current="page"] { --nav-active: #5B3BE0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bottom-nav a[data-nav="start"][aria-current="page"] { --nav-active: #5B3BE0; } }
.bottom-nav a[data-nav="aufgaben"][aria-current="page"] { --nav-active: var(--c-todo-fill); }
.bottom-nav a[data-nav="einkauf"][aria-current="page"] { --nav-active: var(--c-shop-fill); }
.bottom-nav a[data-nav="termine"][aria-current="page"] { --nav-active: var(--c-event-fill); }
.bottom-nav a[data-nav="geschenke"][aria-current="page"] { --nav-active: var(--c-gift-fill); }

/* ---------- Buttons ---------- */
.btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 16px;
  border: none;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform .15s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent-fill); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--accent-fill) 35%, transparent); }
.btn-outline { background: var(--card); color: var(--accent); border: 2px solid var(--accent); }
.btn-dashed { background: transparent; color: var(--accent); border: 2px dashed var(--accent); }
.btn-ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); }
.btn-danger { background: var(--c-danger-tint); color: var(--c-danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 14px; }
.icon-btn {
  width: 48px; height: 48px; flex: none;
  border: none; border-radius: 16px;
  background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.icon-btn.accent { background: var(--accent-fill); color: #fff; transform: rotate(-5deg); box-shadow: 0 8px 18px color-mix(in srgb, var(--accent-fill) 35%, transparent); }
.icon-btn.plain { background: transparent; box-shadow: none; }
.fab {
  position: absolute; right: 22px; bottom: 18px; z-index: 4;
  width: 60px; height: 60px; border: none; border-radius: 22px;
  background: var(--accent-fill); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-6deg);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-fill) 40%, transparent);
  transition: transform .2s;
}
.fab:active { transform: rotate(-6deg) scale(.92); }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { border-color: transparent; background: var(--ink); color: var(--bg); }
.chip.accent[aria-pressed="true"] { background: var(--accent-fill); color: #fff; }
.chip.add { border-style: dashed; border-color: var(--accent); color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.pill.today { background: var(--c-bday-tint); color: var(--c-bday); }
.pill.soon { background: var(--c-gift-tint); color: var(--c-gift); }
.pill.later, .pill.neutral { background: var(--card-2); color: var(--muted); }
.pill.overdue { background: var(--c-danger-tint); color: var(--c-danger); }
.pill.live { background: var(--c-shop-fill); color: #fff; }
.pill.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9EF0C4; }
.pill.offline { background: var(--card-2); color: var(--muted); }
.pill.offline::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ring); }

/* ---------- Avatare ---------- */
.avatar {
  flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  color: #fff; font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar.lg { width: 36px; height: 36px; font-size: 14px; border: 3px solid var(--bg); }
.avatar.xl { width: 56px; height: 56px; font-size: 22px; }
.avatar.family { background: var(--card-2) !important; color: var(--muted); }
.avatars { display: flex; align-items: center; }
.avatars .avatar + .avatar { margin-left: -8px; }

/* ---------- Fortschritt ---------- */
.progress { height: 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, var(--card)); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--accent-fill); transition: width .4s ease; }

/* ---------- Karten / Kacheln ---------- */
.card { background: var(--card); border-radius: var(--radius-card); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  min-height: 128px; padding: 16px; border-radius: 26px;
  background: var(--accent-tint); color: var(--ink); text-decoration: none;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  transition: transform .15s;
}
.tile:active { transform: scale(.97); }
.tile-title { font-family: var(--font-head); font-size: 19px; font-weight: 600; }
.tile-sub { font-size: 13px; font-weight: 800; color: var(--accent); }
.icon-bubble {
  flex: none; width: 44px; height: 44px; border-radius: var(--radius-icon);
  background: var(--accent-fill); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.icon-bubble.soft { background: var(--accent-tint); color: var(--accent); }
.tilt-l { transform: rotate(-6deg); }
.tilt-r { transform: rotate(5deg); }

.feature-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--card); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.feature-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eyebrow { font-size: 12px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.section-head a { font-size: 14px; text-decoration: none; }

/* ---------- Listen-Zeilen ---------- */
.row {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px 10px 14px;
  border: none;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  position: relative;
  touch-action: pan-y;
  transition: transform .2s ease, opacity .2s;
}
.row.is-done { background: var(--card-2); box-shadow: none; color: var(--muted); }
.row.is-done .row-title { text-decoration: line-through; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; background: none; border: none; padding: 0; text-align: left; color: inherit; }
.row-title { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; font-weight: 700; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swipe-wrap { position: relative; border-radius: 20px; }
.swipe-wrap .swipe-bg {
  position: absolute; inset: 0; border-radius: 20px; background: var(--c-danger);
  color: #fff; display: flex; align-items: center; justify-content: flex-end; padding-right: 22px; font-weight: 800; gap: 6px;
  opacity: 0; transition: opacity .15s;
}
.swipe-wrap.swiping .swipe-bg { opacity: 1; }

.check {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid var(--ring); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  padding: 0;
}
.check.on { border: none; background: var(--accent-fill); animation: pop .4s ease-out; }
.check-hit { flex: none; width: 44px; height: 44px; margin: -7px -7px -7px -9px; border: none; background: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

.group-title { display: flex; align-items: center; gap: 8px; margin: 6px 0 0 4px; font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--muted); }
.group-dot { width: 12px; height: 12px; border-radius: 4px; transform: rotate(12deg); }
.qty { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--card-2); color: var(--muted); font-size: 12px; font-weight: 800; }

.empty {
  padding: 24px; border-radius: 22px; background: var(--card); border: 2px dashed var(--line);
  text-align: center; font-weight: 700; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .icon-bubble { transform: rotate(-6deg); }

/* ---------- Eingabezeile (Hinzufügen) ---------- */
.add-row { display: flex; gap: 10px; }
.add-row input {
  flex: 1; min-width: 0; height: 52px; padding: 0 18px;
  border-radius: var(--radius-input); border: 2px solid color-mix(in srgb, var(--accent) 25%, var(--card));
  background: var(--card); font-size: 16px; font-weight: 700;
}
.add-row input:focus { outline: none; border-color: var(--accent); }
.add-row .icon-btn { width: 52px; height: 52px; border-radius: 18px; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
.field small { font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border-radius: 16px; border: 2px solid var(--line); background: var(--card);
  font-size: 16px; font-weight: 700; color: var(--ink);
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--c-danger); }
.field-error { color: var(--c-danger); font-size: 13px; font-weight: 800; }
.row-2 { display: flex; gap: 10px; }
.row-2 > * { flex: 1; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.w-port { flex: 0 0 96px !important; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-weight: 800; }
.switch input { appearance: none; width: 52px; height: 30px; border-radius: 999px; background: var(--ring); position: relative; flex: none; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--accent-fill); }
.switch input:checked::after { transform: translateX(22px); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--card); }
.segmented { display: flex; background: var(--card-2); border-radius: 16px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; min-height: 40px; border: none; border-radius: 12px; background: transparent; font-weight: 800; font-size: 14px; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions > .btn { flex: 1; }

/* ---------- Bottom-Sheet (Dialog) ---------- */
dialog.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh;
  margin: auto auto 0; padding: 0; border: none;
  border-radius: 28px 28px 0 0;
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-strong);
}
dialog.sheet[open] { animation: sheet-in .25s ease-out; display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: rgba(22, 20, 43, .45); backdrop-filter: blur(2px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--line); }
.sheet-body { padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(104px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto;
  max-width: 520px; width: fit-content;
  padding: 12px 16px; border-radius: 16px;
  background: var(--ink); color: var(--bg);
  font-weight: 800; font-size: 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-strong);
  animation: rise .25s ease-out;
}
.toast.error { background: var(--c-danger); color: #fff; }
.toast button { border: none; background: transparent; color: var(--sun); font-weight: 900; min-height: 32px; padding: 0 4px; }

/* ---------- Kalender ---------- */
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav .icon-btn { width: 44px; height: 44px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day {
  height: 72px; border-radius: 18px; border: none; background: var(--card); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0;
  transition: transform .15s, background .15s;
}
.day .wd { font-size: 11px; font-weight: 800; opacity: .85; }
.day .num { font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.day .dots { display: flex; gap: 3px; height: 6px; }
.day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-event); }
.day .dots i.b { background: var(--c-bday); }
.day.today { box-shadow: inset 0 0 0 2px var(--c-event); }
.day[aria-pressed="true"] { background: var(--c-event-fill); color: #fff; transform: translateY(-3px); box-shadow: 0 8px 16px color-mix(in srgb, var(--c-event-fill) 35%, transparent); }
.day[aria-pressed="true"] .dots i { background: #fff; }
.time-pill { flex: none; min-width: 58px; padding: 8px 6px; border-radius: 14px; background: var(--c-event-tint); color: var(--c-event); text-align: center; font-weight: 800; font-size: 15px; }
.bday-card { background: var(--c-bday-tint); }
.bday-card .icon-bubble { background: var(--c-bday-fill); }
.bday-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.bday-mini {
  flex: 0 0 150px; padding: 14px; border-radius: 22px; background: var(--card); color: var(--ink); text-decoration: none;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); border: none; text-align: left;
}
.bday-mini .name { font-family: var(--font-head); font-size: 17px; font-weight: 600; }

/* ---------- Geschenke ---------- */
.share-card { padding: 16px; border-radius: var(--radius-card); background: var(--c-gift-fill); color: #fff; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 24px rgba(194, 90, 0, .3); }
.share-card .icon-bubble { background: rgba(255, 255, 255, .2); }
.share-url { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 14px; background: rgba(255, 255, 255, .18); display: flex; align-items: center; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-card .btn { background: #fff; color: #8F4200; min-height: 44px; border-radius: 14px; }
.share-card .btn-ghost-light { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .6); }
.idea { display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.idea.reserved { background: color-mix(in srgb, var(--c-gift-tint) 60%, var(--card)); box-shadow: none; }
.idea.reserved .row-title { color: var(--muted); }
.idea-top { display: flex; align-items: center; gap: 12px; }
.price { font-size: 13px; font-weight: 800; color: var(--c-gift); }
.reserve-btn { flex: none; min-height: 44px; padding: 0 12px; border-radius: 14px; border: 2px solid var(--c-gift-fill); background: var(--card); color: var(--c-gift); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.reserve-btn[aria-pressed="true"] { border-color: transparent; background: var(--c-bday-fill); color: #fff; }
.reserve-btn[aria-pressed="true"] svg { animation: wiggle .4s ease-in-out; }
.link-btn { min-height: 44px; padding: 0 14px; border-radius: 14px; background: var(--c-gift-tint); color: var(--c-gift); text-decoration: none; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.link-btn .domain { margin-left: auto; font-size: 12px; font-weight: 700; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Einstellungen / Admin ---------- */
.list-card { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden; }
.list-card > * + * { border-top: 2px solid var(--card-2); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; color: var(--ink); text-decoration: none; background: none; border-left: none; border-right: none; border-bottom: none; width: 100%; text-align: left; }
.list-item:first-child { border-top: none; }
.list-item .grow { display: flex; flex-direction: column; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; background: var(--c-todo-tint); color: var(--c-todo); }
.badge.off { background: var(--card-2); color: var(--muted); }
.code-line { display: block; padding: 10px 12px; border-radius: 12px; background: var(--card-2); font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.info-box, .warn-box, .error-box { padding: 14px 16px; border-radius: 18px; font-weight: 700; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.info-box { background: var(--c-event-tint); }
.warn-box { background: var(--c-gift-tint); color: var(--ink); }
.error-box { background: var(--c-danger-tint); color: var(--c-danger); }

/* ---------- Login / Beitreten ---------- */
.auth { flex: 1; overflow-y: auto; padding: calc(40px + env(safe-area-inset-top)) 22px 30px; display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.auth-head img { border-radius: 22px; transform: rotate(-4deg); box-shadow: var(--shadow-strong); }
.offline-bar { position: fixed; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%); z-index: 60; }

/* ---------- Installer ---------- */
.install-page { min-height: 100vh; position: relative; overflow-x: hidden; }
.install { position: relative; max-width: 560px; margin: 0 auto; padding: 32px 18px 40px; display: flex; flex-direction: column; gap: 18px; }
.install-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.install-logo { border-radius: 18px; transform: rotate(-5deg); }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.steps li { flex: 1; text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--card); font-size: 12px; font-weight: 800; color: var(--muted); }
.steps li.active { background: var(--c-todo-fill); color: #fff; }
.steps li.done { background: var(--c-todo-tint); color: var(--c-todo); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--card-2); }
.check-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; background: var(--c-shop-fill); }
.checklist li.fail .check-icon { background: var(--c-danger); }
.checklist li.warn .check-icon { background: var(--c-gift-fill); }
.result { font-weight: 800; font-size: 14px; padding: 0; }
.result.ok { color: var(--c-shop); padding: 12px 14px; border-radius: 14px; background: var(--c-shop-tint); }
.result.fail { color: var(--c-danger); padding: 12px 14px; border-radius: 14px; background: var(--c-danger-tint); }
.install-foot { text-align: center; }

/* ---------- Öffentliche Wunschliste ---------- */
.share-page { min-height: 100vh; position: relative; overflow-x: hidden; }
.share { position: relative; max-width: 560px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 20px 40px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Animationen ---------- */
@keyframes pop { 0% { transform: scale(.3) rotate(-20deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(6deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes sheet-in { 0% { transform: translateY(40px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
.rise { animation: rise .3s ease-out both; }
.confetti { position: fixed; pointer-events: none; z-index: 70; width: 9px; height: 9px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
