/* Familienzentrale – Liquid Glass
   Navigation, Knöpfe und Sheets sind Glas und schweben über dem Inhalt.
   Inhalte liegen auf ruhigen, halbtransparenten Flächen; das Board bleibt Papier mit Magneten. */

:root {
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;

  --bg: #E8EDF5;
  --a1: rgba(92, 156, 255, .55);    /* Himmel */
  --a2: rgba(255, 140, 196, .42);   /* Rosé */
  --a3: rgba(98, 220, 186, .42);    /* Minze */
  --a4: rgba(255, 210, 90, .45);    /* Sonne */

  --ink: #14203B;
  --ink-2: #4D5874;
  --ink-3: #8590A7;
  --line: rgba(20, 32, 59, .08);

  --card: rgba(255, 255, 255, .62);          /* Inhaltsflächen */
  --card-solid: rgba(255, 255, 255, .88);    /* Felder in Sheets */
  --glass: rgba(255, 255, 255, .34);         /* Navigation, Knöpfe */
  --glass-strong: rgba(246, 248, 252, .74);  /* Sheets, Dialoge */
  --blur: saturate(190%) blur(22px);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08) 42%, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, .14));
  --rim: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 0 0 .5px rgba(255, 255, 255, .6), inset 0 -1px 1px rgba(255, 255, 255, .3);
  --lift: 0 14px 34px -14px rgba(18, 32, 70, .32), 0 2px 6px rgba(18, 32, 70, .06);
  --lift-hi: 0 22px 50px -18px rgba(18, 32, 70, .45), 0 3px 10px rgba(18, 32, 70, .08);

  --accent: #0A6CFF;
  --accent-ink: #FFFFFF;
  --marker: #FFD43B;
  --marker-ink: #3B2F00;
  --danger: #E0352B;
  --ok: #24A148;
  --paper: #FFFDF5;
  --shadow-paper: 0 1px 0 rgba(30, 42, 74, .05), 0 12px 24px -14px rgba(30, 42, 74, .5);
  --spring: cubic-bezier(.34, 1.45, .55, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #070A12; --a1: rgba(45, 90, 255, .42); --a2: rgba(190, 50, 140, .3); --a3: rgba(16, 150, 125, .3); --a4: rgba(150, 110, 0, .28);
  --ink: #EEF2FA; --ink-2: #A9B3C8; --ink-3: #6E7992; --line: rgba(255, 255, 255, .08);
  --card: rgba(30, 36, 52, .55); --card-solid: rgba(38, 44, 60, .88); --glass: rgba(46, 52, 70, .36); --glass-strong: rgba(22, 26, 38, .74);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 50%);
  --rim: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 0 0 .5px rgba(255, 255, 255, .12), inset 0 -1px 1px rgba(255, 255, 255, .05);
  --lift: 0 16px 36px -14px rgba(0, 0, 0, .75); --lift-hi: 0 24px 52px -16px rgba(0, 0, 0, .85);
  --accent: #3D8BFF; --paper: #2A3144; --shadow-paper: 0 12px 24px -12px rgba(0, 0, 0, .8); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070A12; --a1: rgba(45, 90, 255, .42); --a2: rgba(190, 50, 140, .3); --a3: rgba(16, 150, 125, .3); --a4: rgba(150, 110, 0, .28);
    --ink: #EEF2FA; --ink-2: #A9B3C8; --ink-3: #6E7992; --line: rgba(255, 255, 255, .08);
    --card: rgba(30, 36, 52, .55); --card-solid: rgba(38, 44, 60, .88); --glass: rgba(46, 52, 70, .36); --glass-strong: rgba(22, 26, 38, .74);
    --sheen: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 50%);
    --rim: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 0 0 .5px rgba(255, 255, 255, .12), inset 0 -1px 1px rgba(255, 255, 255, .05);
    --lift: 0 16px 36px -14px rgba(0, 0, 0, .75); --lift-hi: 0 24px 52px -16px rgba(0, 0, 0, .85);
    --accent: #3D8BFF; --paper: #2A3144; --shadow-paper: 0 12px 24px -12px rgba(0, 0, 0, .8); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 17px; line-height: 1.4; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-text-size-adjust: 100%;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button, a, .note, .day, label { touch-action: manipulation; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 12px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Farbiger Hintergrund, durch den das Glas schimmert */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 42% at 8% 4%, var(--a1), transparent 72%),
    radial-gradient(48% 38% at 100% 18%, var(--a2), transparent 70%),
    radial-gradient(58% 44% at 86% 100%, var(--a3), transparent 72%),
    radial-gradient(46% 36% at 0% 78%, var(--a4), transparent 70%),
    var(--bg); }

/* ------------------------------------------------------------------ Glas-Bausteine */
.tabs, .fab, .icon-btn, .pill, .seg, .chip, .star-card, .glass-btn, #toast, .offline-pill {
  background: var(--sheen), var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--rim), var(--lift);
}
.fab, .icon-btn, .pill, .chip, .star-card, .glass-btn, .btn, .advance, .tab {
  transition: transform .32s var(--spring), background-color .2s ease, color .2s ease;
}
.fab:active, .icon-btn:active, .pill:active, .chip:active, .star-card:active, .glass-btn:active, .btn:active { transform: scale(1.07); }
.tab:active { transform: scale(.94); }

/* ------------------------------------------------------------------ Gerüst */
.shell { position: relative; z-index: 1; height: 100vh; height: 100dvh; }
#main { height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: calc(env(safe-area-inset-bottom) + 120px); }

.dock { position: fixed; z-index: 10; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 10px); display: flex; justify-content: center; gap: 10px;
  padding: 0 max(14px, env(safe-area-inset-left)); pointer-events: none; }
.dock > * { pointer-events: auto; }
.tabs { position: relative; flex: 1; max-width: 430px; height: 66px; padding: 5px; border-radius: 999px; display: grid; grid-template-columns: repeat(3, 1fr); }
.tab-indicator { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 3); border-radius: 999px;
  background: var(--sheen), color-mix(in srgb, var(--accent) 13%, rgba(255, 255, 255, .45)); box-shadow: var(--rim);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .5s var(--spring); }
:root[data-theme="dark"] .tab-indicator { background: var(--sheen), color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, .08)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab-indicator { background: var(--sheen), color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, .08)); } }
.tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 999px;
  color: var(--ink-2); font-size: 11px; font-weight: 700; }
.tab[aria-current="page"] { color: var(--accent); }
.fab { flex: none; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--sheen), color-mix(in srgb, var(--accent) 82%, transparent); }
.fab svg.i { width: 28px; height: 28px; stroke-width: 2.5; }

/* ------------------------------------------------------------------ Kopfbereich mit weicher Scroll-Kante */
.top { position: sticky; top: 0; z-index: 4; isolation: isolate; padding: calc(env(safe-area-inset-top) + 10px) 18px 10px; }
.top::before { content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none;
  -webkit-backdrop-filter: blur(12px) saturate(170%); backdrop-filter: blur(12px) saturate(170%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 62%, transparent), color-mix(in srgb, var(--bg) 0%, transparent));
  -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent); mask-image: linear-gradient(180deg, #000 58%, transparent); }
.top-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 48px; }
.title { margin: 0; font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; }
.title .year { display: block; font-size: 15px; letter-spacing: 0; color: var(--accent); font-weight: 800; margin-bottom: 2px; }
.top-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 2px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.pill { height: 44px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.offline-pill { font-size: 12px; font-weight: 800; color: var(--marker-ink); background: var(--sheen), color-mix(in srgb, var(--marker) 85%, transparent); border-radius: 99px; padding: 3px 10px; }
.year .offline-pill { margin-left: 6px; vertical-align: 2px; }

.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: 999px; padding: 4px; gap: 2px; box-shadow: var(--rim); }
.seg button { padding: 7px 15px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--ink-2); transition: background-color .25s ease, color .25s ease, box-shadow .25s ease; }
.seg button[aria-pressed="true"] { background: var(--sheen), var(--card-solid); color: var(--ink); box-shadow: var(--rim), 0 2px 8px rgba(18, 32, 70, .14); }

.filters { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 4px 4px 12px; margin: -4px -4px -12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 5px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--ink); box-shadow: var(--rim); }
.chip.all { padding: 0 16px; }
.chip[aria-pressed="true"] { background: var(--sheen), color-mix(in srgb, var(--c, var(--ink)) 88%, transparent); color: #fff; }
.chip.all[aria-pressed="true"] { background: var(--sheen), var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] .av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }

/* Avatare: Foto oder Emoji im Farbring */
.av { --s: 28px; position: relative; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  background: color-mix(in srgb, var(--c, var(--accent)) 26%, var(--card-solid)); box-shadow: inset 0 0 0 2px var(--c, var(--accent));
  font-size: calc(var(--s) * .56); line-height: 1; }
.av.photo { background: var(--c); box-shadow: none; padding: 2px; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.av.lg { --s: 44px; }
.av.xl { --s: 96px; box-shadow: inset 0 0 0 3px var(--c), var(--lift); }
.av.xl.photo { padding: 3px; box-shadow: var(--lift); }
.avs { display: inline-flex; }
.avs .av { --s: 26px; margin-left: -7px; outline: 2px solid var(--card-solid); }
.avs .av:first-child { margin-left: 0; }

/* ------------------------------------------------------------------ Inhaltsflächen */
.month, .ev-row, .welcome, .group, .col, .login-card, .empty-card {
  background: var(--sheen), var(--card); box-shadow: var(--rim), var(--lift);
}

/* ------------------------------------------------------------------ Kalender */
.cal-wrap { padding: 6px 12px 0; }
.month { border-radius: 30px; padding: 6px 6px 10px; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.wd-row, .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.wd-row { font-size: 12px; font-weight: 800; color: var(--ink-3); text-align: center; padding: 8px 0 6px; }
.wd-row span:nth-child(n+6) { color: color-mix(in srgb, var(--accent) 70%, var(--ink-3)); }
.grid { gap: 2px; }
.grid.slide-l { animation: slideL .3s var(--spring); }
.grid.slide-r { animation: slideR .3s var(--spring); }
@keyframes slideL { from { transform: translateX(30px); opacity: .2; } }
@keyframes slideR { from { transform: translateX(-30px); opacity: .2; } }

.day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 50px; padding: 4px 2px; border-radius: 16px; text-align: center; transition: background-color .15s; }
.day .num { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; transition: transform .3s var(--spring); }
.day.out .num { color: var(--ink-3); opacity: .55; }
.day.today .num { background: var(--marker); color: var(--marker-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 4px 12px -4px rgba(200, 150, 0, .6); }
.day.sel .num { background: var(--sheen), var(--ink); color: var(--bg); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .45); transform: scale(1.06); }
.day.today.sel .num { background: var(--marker); color: var(--marker-ink); box-shadow: 0 0 0 2.5px var(--ink); }
.day:active { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.dots { display: flex; gap: 3px; height: 7px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cell-events { display: none; }

.day-panel { margin-top: 18px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 8px 10px; }
.day-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.day-head .kw { font-size: 13px; color: var(--ink-2); font-weight: 800; }

.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ev-row { width: 100%; display: grid; grid-template-columns: 56px 4px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; border-radius: 24px; transition: transform .3s var(--spring); }
.ev-row:active { transform: scale(.98); }
.ev-time { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ev-time small { display: block; color: var(--ink-3); font-weight: 700; font-size: 13px; }
.ev-time.allday { font-size: 12px; color: var(--ink-2); }
.ev-bar { align-self: stretch; border-radius: 4px; background: var(--c); }
.ev-body { min-width: 0; }
.ev-body strong { display: block; font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ev-body small { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-3); }
.rep svg.i { width: 14px; height: 14px; stroke-width: 2.2; vertical-align: -2px; margin-right: 4px; }
.note-meta .rep svg.i { margin-right: 0; }

.empty { text-align: center; color: var(--ink-2); padding: 22px 12px; font-size: 15px; }
.empty .link { color: var(--accent); font-weight: 800; margin-top: 6px; display: inline-block; padding: 6px 10px; }

.list-day { margin: 4px 6px 18px; }
.list-day h3 { margin: 0 0 8px 6px; font-size: 15px; font-weight: 800; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; }
.list-day h3 .rel { color: var(--ink); font-size: 17px; }
.list-day.is-today h3 .rel { background: var(--marker); color: var(--marker-ink); padding: 1px 10px; border-radius: 99px; }

.welcome { margin: 8px 4px 16px; padding: 20px; border-radius: 28px; }
.welcome h2 { margin: 0 0 6px; font-size: 21px; }
.welcome p { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }

/* ------------------------------------------------------------------ Board: Papier auf Glas */
.stars-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 4px 14px; margin: 0 -4px -10px; }
.stars-row::-webkit-scrollbar { display: none; }
.star-card { flex: none; display: flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.star-card[aria-pressed="true"] { background: var(--sheen), color-mix(in srgb, var(--c) 88%, transparent); color: #fff; }
.star-card .count { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; font-weight: 800; }
.star-card .count .st { width: 17px; height: 17px; }
.star-card .who { line-height: 1.1; text-align: left; }
.star-card .who small { display: block; font-size: 11px; opacity: .7; font-weight: 600; }

.board { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 18px 24px; scroll-padding: 0 18px; scrollbar-width: none; }
.board::-webkit-scrollbar { display: none; }
.col { flex: 0 0 min(84vw, 380px); scroll-snap-align: start; display: flex; flex-direction: column; min-height: 60vh; border-radius: 32px; padding: 14px 14px 18px; transition: box-shadow .2s; }
.col.drop { box-shadow: var(--rim), inset 0 0 0 3px var(--accent), var(--lift); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 12px; }
.col-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.col-head .count { min-width: 28px; height: 28px; padding: 0 9px; border-radius: 99px; display: grid; place-items: center; background: var(--sheen), var(--card-solid); box-shadow: var(--rim); font-size: 14px; font-weight: 800; color: var(--ink-2); }
.col-body { display: grid; gap: 20px; align-content: start; flex: 1; padding-top: 12px; }
.col-empty { color: var(--ink-2); font-size: 14px; text-align: center; padding: 18px 10px; border: 2px dashed color-mix(in srgb, var(--ink) 14%, transparent); border-radius: 20px; }

.note { --c: #F2C94C; position: relative; text-align: left; padding: 20px 14px 12px; border-radius: 6px 6px 14px 6px;
  background: color-mix(in oklab, var(--c) 24%, var(--paper)); box-shadow: var(--shadow-paper); transform: rotate(var(--tilt, 0deg));
  transition: transform .3s var(--spring), box-shadow .2s ease; cursor: pointer; }
.note.unassigned { background: color-mix(in oklab, #FFE066 55%, var(--paper)); }
@media (hover: hover) { .note:hover { transform: rotate(0deg) translateY(-3px); } }
.note:active { transform: rotate(0deg) scale(.98); }
.note.dragging { opacity: .5; }
.magnet { position: absolute; top: -15px; left: 50%; translate: -50% 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; overflow: hidden;
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--c) 25%, #fff) 0 20%, var(--c) 62%);
  box-shadow: 0 4px 8px -2px rgba(0, 0, 0, .38), inset 0 -2px 3px rgba(0, 0, 0, .18), inset 0 1px 1px rgba(255, 255, 255, .6); }
.magnet.photo { width: 38px; height: 38px; top: -18px; padding: 2.5px; background: var(--c); }
.magnet img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.magnet.photo::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .55), transparent 38%); pointer-events: none; }
.note h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.note .note-notes { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 36px; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.due { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.due.late { background: var(--danger); color: #fff; }
.due.soon { background: var(--marker); color: var(--marker-ink); }
.stars { display: inline-flex; gap: 1px; }
.st { width: 18px; height: 18px; flex: none; }
.st path { fill: var(--marker); stroke: #C99A00; stroke-width: 1.2; stroke-linejoin: round; }
.advance { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 800;
  background: var(--sheen), var(--ink); color: var(--bg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 14px -8px rgba(0, 0, 0, .6); }
.advance:active { transform: scale(1.08); }
.advance svg.i { width: 18px; height: 18px; stroke-width: 2.6; }
.advance.back { background: rgba(255, 255, 255, .35); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px currentColor; }
.note.done { opacity: .9; }
.note.done h3 { color: var(--ink-2); }
.note.done::after { content: "✓"; position: absolute; right: 12px; top: 8px; font-weight: 900; font-size: 22px; color: var(--ok); rotate: -8deg; }
.clear-done { margin-top: 16px; width: 100%; padding: 12px; border-radius: 999px; font-size: 14px; font-weight: 800; color: var(--ink-2); background: var(--sheen), var(--card-solid); box-shadow: var(--rim); }

.burst { position: fixed; pointer-events: none; z-index: 80; font-size: 20px; animation: burst 1s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.6); opacity: 0; } }

/* ------------------------------------------------------------------ Familie / Einstellungen */
.page { padding: 6px 18px 0; max-width: 720px; }
.group-title { margin: 26px 8px 8px; font-size: 15px; font-weight: 800; color: var(--ink-2); }
.group { border-radius: 26px; overflow: hidden; }
.group > * + * { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 8px 16px; width: 100%; text-align: left; }
.row > span:first-child { font-weight: 600; }
.row .muted { color: var(--ink-2); font-size: 15px; }
button.row:active, a.row:active { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.member-row { justify-content: flex-start; }
.member-row .name { flex: 1; font-weight: 700; }
.member-row .role { font-size: 14px; color: var(--ink-2); }
.tag { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--marker); color: var(--marker-ink); }
.add-row { color: var(--accent); font-weight: 800; justify-content: flex-start; }
.help { color: var(--ink-2); font-size: 15px; padding: 14px 16px; margin: 0; }
.url-box { display: flex; gap: 8px; align-items: center; padding: 10px 16px; }
.url-box code { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-family: ui-monospace, Menlo, Consolas, monospace; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer;
  color: var(--accent-ink); background: var(--sheen), var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 10px 22px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.ghost, .btn.glass-btn { color: var(--ink); background: var(--sheen), var(--glass); box-shadow: var(--rim), var(--lift); }
.btn.block { width: 100%; }
.foot { color: var(--ink-3); font-size: 13px; text-align: center; margin: 28px 0 8px; }
details.more summary { cursor: pointer; padding: 14px 16px; color: var(--accent); font-weight: 800; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.danger-text { color: var(--danger); font-weight: 700; }
.row select.plain-select { border: 0; background: var(--sheen), var(--card-solid); box-shadow: var(--rim); border-radius: 999px; padding: 7px 14px; font-size: 16px; font-weight: 600; max-width: 60%; }

/* ------------------------------------------------------------------ Sheets: schwebendes Glas */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px); }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 24, .28); opacity: 0; transition: opacity .3s ease; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--sheen), var(--glass-strong); -webkit-backdrop-filter: saturate(180%) blur(34px); backdrop-filter: saturate(180%) blur(34px);
  border-radius: 36px; box-shadow: var(--rim), var(--lift-hi); padding: 0 14px 18px;
  transform: translateY(calc(100% + 40px)); transition: transform .48s var(--spring); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: center; gap: 8px; padding: 18px 2px 12px; }
.sheet-head::before { content: ""; position: absolute; inset: 0 -14px -14px; z-index: -1;
  background: linear-gradient(180deg, var(--glass-strong) 60%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); border-radius: 36px 36px 0 0; }
.sheet-head::after { content: ""; position: absolute; top: 7px; left: 50%; translate: -50% 0; width: 38px; height: 5px; border-radius: 9px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .cancel, .sheet-head .save { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; transition: transform .32s var(--spring); }
.sheet-head .cancel { justify-self: start; color: var(--ink); background: var(--sheen), var(--glass); box-shadow: var(--rim), 0 4px 12px -6px rgba(18, 32, 70, .3); }
.sheet-head .save { justify-self: end; color: #fff; background: var(--sheen), var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.sheet-head .cancel:active, .sheet-head .save:active { transform: scale(1.1); }
.sheet-head svg.i { width: 22px; height: 22px; stroke-width: 2.5; }
.sheet-head > span { justify-self: end; }
.form { display: grid; gap: 14px; }
.form .group { background: var(--card-solid); box-shadow: var(--rim); border-radius: 24px; }
.field-title { width: 100%; font-size: 22px; font-weight: 700; padding: 15px 18px; border-radius: 24px; border: 0; background: var(--card-solid); box-shadow: var(--rim); }
.field-title::placeholder { color: var(--ink-3); }
.form .group .row input[type="date"], .form .group .row input[type="time"], .form .group .row select {
  border: 0; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 999px; padding: 6px 12px; font-size: 16px; font-weight: 600; min-height: 36px; max-width: 60%; }
.form .group .row select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.dt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.form .group .row .dt input { max-width: none; min-width: 0; }
.form .group .row .dt input[type="date"] { flex: 0 1 auto; }
.form .group .row .dt input[type="time"] { flex: 0 0 auto; }
.form textarea, .form .plain { width: 100%; border: 0; background: transparent; padding: 14px 16px; font-size: 16px; resize: vertical; min-height: 52px; }
.form textarea { min-height: 96px; }
.form .hint { font-size: 13px; color: var(--ink-2); padding: 0 16px 12px; margin: 0; border-top: 0 !important; }
.form .label { padding: 12px 16px 4px; font-weight: 600; border-top: 0; }
.form .label + .hint { padding-bottom: 4px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 14px 14px; border-top: 0 !important; }
.pick .chip { height: 42px; background: var(--sheen), color-mix(in srgb, var(--ink) 5%, transparent); box-shadow: var(--rim); -webkit-backdrop-filter: none; backdrop-filter: none; }
.pick .chip[aria-pressed="true"] { background: var(--sheen), var(--c); }
.notice { font-size: 14px; color: var(--ink-2); background: color-mix(in srgb, var(--marker) 30%, var(--card-solid)); border-radius: 20px; padding: 12px 14px; margin: 0; box-shadow: var(--rim); }
.danger-btn { width: 100%; padding: 15px; border-radius: 999px; background: var(--card-solid); color: var(--danger); font-weight: 800; box-shadow: var(--rim); }

.switch { appearance: none; -webkit-appearance: none; width: 54px; height: 32px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 14%, transparent); position: relative; transition: background .25s; flex: none; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 99px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .4s var(--spring), width .2s; }
.switch:active::after { width: 34px; }
.switch:checked { background: #34C759; }
.switch:checked::after { transform: translateX(22px); }
.switch:checked:active::after { transform: translateX(16px); }

.star-pick { display: flex; gap: 4px; }
.star-pick button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; transition: transform .3s var(--spring); }
.star-pick button:active { transform: scale(1.2); }
.star-pick .st { width: 28px; height: 28px; }
.star-pick button[aria-pressed="false"] .st path { fill: transparent; stroke: var(--ink-3); }

.photo-edit { display: grid; justify-items: center; gap: 12px; padding: 4px 0 6px; }
.photo-actions { display: flex; gap: 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 4px 10px 12px; border-top: 0 !important; }
.emoji-grid button { aspect-ratio: 1; font-size: 24px; border-radius: 14px; transition: transform .3s var(--spring); }
.emoji-grid button:active { transform: scale(1.2); }
.emoji-grid button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 2px var(--accent); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 16px 14px; border-top: 0 !important; }
.swatches button { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .45), transparent 45%), var(--c); box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .15); transition: transform .3s var(--spring); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--card-solid), 0 0 0 5.5px var(--c); transform: scale(1.06); }
.preview { display: flex; justify-content: center; }

/* Foto zuschneiden */
.crop-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(6, 10, 20, .5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.crop { width: 100%; max-width: 380px; text-align: center; padding: 22px 18px 18px; border-radius: 36px;
  background: var(--sheen), var(--glass-strong); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--rim), var(--lift-hi); }
.crop h2 { margin: 0; font-size: 19px; }
.crop p { margin: 4px 0 16px; color: var(--ink-2); font-size: 14px; }
.crop-view { position: relative; margin: 0 auto; border-radius: 50%; overflow: hidden; touch-action: none; cursor: grab; background: #000;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .8), var(--lift); }
.crop-view:active { cursor: grabbing; }
.crop-view img { position: absolute; max-width: none; user-select: none; -webkit-user-select: none; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 18px 6px 16px; font-weight: 800; color: var(--ink-2); }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Auswahl-Dialog */
.action-sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px); background: rgba(8, 12, 24, .3); }
.action-sheet .box { max-width: 520px; width: 100%; margin: 0 auto; display: grid; gap: 8px; animation: up .4s var(--spring); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.action-sheet .opts, .action-sheet .cancel-btn { background: var(--sheen), var(--glass-strong); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--rim), var(--lift-hi); border-radius: 30px; }
.action-sheet .opts { overflow: hidden; }
.action-sheet .opts p { margin: 0; padding: 16px; text-align: center; color: var(--ink-2); font-size: 14px; }
.action-sheet .opts button { display: block; width: 100%; padding: 17px; font-size: 18px; font-weight: 600; color: var(--accent); border-top: 1px solid var(--line); }
.action-sheet .opts button.destructive { color: var(--danger); }
.action-sheet .cancel-btn { padding: 17px; font-size: 18px; font-weight: 800; color: var(--ink); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); translate: -50% 0; z-index: 90; pointer-events: none;
  padding: 11px 18px; border-radius: 99px; font-size: 15px; font-weight: 800; white-space: nowrap; color: var(--ink);
  opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .25s ease, transform .45s var(--spring); }
#toast.show { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ Anmeldung */
.login { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; text-align: center; padding: 32px 24px 24px; border-radius: 40px;
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); }
.login-card .logo { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 26px; box-shadow: var(--lift); }
.login-card h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.02em; }
.login-card p { margin: 0 0 22px; color: var(--ink-2); font-size: 16px; }
.login-card input { width: 100%; height: 54px; border-radius: 999px; border: 0; padding: 0 20px; font-size: 18px; background: var(--card-solid); box-shadow: var(--rim); margin-bottom: 12px; }
.login-card .err { color: var(--danger); font-weight: 700; font-size: 15px; min-height: 22px; margin: 10px 0 0; }
.boot { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; color: var(--ink-2); }

/* ------------------------------------------------------------------ Tablet & Rechner */
@media (min-width: 760px) {
  .cell-events { display: grid; gap: 2px; width: 100%; margin-top: 2px; }
  .dots { display: none; }
  .month { padding: 8px 10px 12px; }
  .day { min-height: 106px; align-items: stretch; padding: 5px; border-radius: 16px; background: color-mix(in srgb, var(--card-solid) 55%, transparent); }
  .day.out { background: transparent; }
  .day .num { width: 30px; height: 30px; font-size: 15px; align-self: flex-start; }
  .day.sel { box-shadow: inset 0 0 0 2px var(--ink); }
  .day.sel .num { transform: none; }
  .ev-chip { display: block; font-size: 12px; font-weight: 700; text-align: left; padding: 2px 7px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: color-mix(in srgb, var(--c) 20%, var(--card-solid)); border-left: 3px solid var(--c); }
  .ev-chip.more { background: none; border: 0; color: var(--ink-3); }
  .grid { gap: 5px; }
}
@media (min-width: 900px) {
  #main { padding: 0 0 40px 120px; }
  .dock { left: 18px; right: auto; top: calc(env(safe-area-inset-top) + 18px); bottom: auto; flex-direction: column; align-items: center; padding: 0; gap: 12px; }
  .tabs { flex: none; width: 88px; height: auto; grid-template-columns: 1fr; grid-template-rows: repeat(3, 76px); border-radius: 44px; }
  .tab-indicator { left: 5px; right: 5px; top: 5px; bottom: auto; width: auto; height: calc((100% - 10px) / 3); border-radius: 38px; transform: translateY(calc(var(--i, 0) * 100%)); }
  .tab { font-size: 12px; }
  .fab { width: 64px; height: 64px; }
  #toast { bottom: 36px; }
  .top { padding-left: 28px; padding-right: 28px; }
  .cal-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 24px; padding: 6px 28px 0; align-items: start; }
  .day-panel { margin-top: 0; position: sticky; top: 160px; }
  .board { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; padding: 10px 28px 24px; }
  .col { min-height: 70vh; }
  .page { padding: 6px 28px 0; }
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-height: 88vh; transform: translateY(30px) scale(.96); opacity: 0; transition: transform .45s var(--spring), opacity .2s ease; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet-head::after { display: none; }
}

/* ------------------------------------------------------------------ Barrierefreiheit & Rückfallebenen */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(250, 251, 254, .92); --glass-strong: rgba(248, 250, 253, .97); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: var(--card-solid); --glass-strong: var(--card-solid); --card: var(--card-solid); }
  .ambient { background: var(--bg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .note { transform: none; }
}

/* ------------------------------------------------------------------ Apple-Kalender */
.member-row .name small.sub { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.member-row .name { min-width: 0; }
.steps { margin: 0; padding: 0 8px 0 26px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.steps a { color: var(--accent); font-weight: 700; }
.cal-block + .cal-block { border-top: 1px solid var(--line); }
.cal-block > * + * { border-top: 0 !important; }
.cal-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.cal-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.sub-row { min-height: 44px; padding-top: 0; padding-left: 38px; }
.sub-row > span:first-child { font-weight: 500; color: var(--ink-2); font-size: 15px; }
.form .group input:disabled, .form .group select:disabled, .form textarea:disabled, .field-title:disabled { opacity: .6; }
.form .group .row select:disabled { opacity: .6; }
