/* Familien-App – Gestaltung
   Leitidee: Jede Person hat ihre Farbe – im Chat, im Kalender, überall.
   Grund: kühles Papierweiß, Tinte in Schiefer, Kiefergrün für eigene Aktionen,
   Ringelblume für „heute“ und „neu“. */

/* Atkinson Hyperlegible: entwickelt für bestmögliche Lesbarkeit (Braille Institute) */
@font-face {
  font-family: "Atkinson";
  src: url("/fonts/atkinson.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson";
  src: url("/fonts/atkinson-ext.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: "Baloo"; src: url("/fonts/baloo.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Zilla"; src: url("/fonts/zilla-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ground: #F6F7F4;
  --surface: #FFFFFF;
  --sunk: #ECEFEA;
  --ink: #1D2A2C;
  --muted: #627177;
  --line: #E1E5E0;
  --pine: #2E6B5E;
  --pine-ink: #FFFFFF;
  --pine-soft: #DCEBE6;
  --marigold: #F2B33D;
  --marigold-ink: #3A2A05;
  --danger: #B3402F;
  --bubble-own: #2E6B5E;
  --bubble-own-ink: #FFFFFF;
  --bubble-other: #FFFFFF;
  --shadow: 0 1px 2px rgba(29, 42, 44, .06), 0 4px 16px rgba(29, 42, 44, .06);

  --font-display: "Atkinson", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Atkinson", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --zoom: 1;

  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: 62px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #101614;
    --surface: #18201E;
    --sunk: #1F2826;
    --ink: #E4EBE8;
    --muted: #93A39E;
    --line: #27322F;
    --pine: #6CBFA9;
    --pine-ink: #0D1F1A;
    --pine-soft: #1E3A33;
    --marigold: #E8B44F;
    --marigold-ink: #2A1E04;
    --danger: #E07A68;
    --bubble-own: #2B5F53;
    --bubble-own-ink: #F2FAF7;
    --bubble-other: #1F2826;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
a { color: var(--pine); }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
[hidden] { display: none !important; }

#app { height: calc(100dvh / var(--zoom)); display: flex; flex-direction: column; }
/* Schriftgröße (pro Gerät einstellbar) */
:root[data-size="l"] { --zoom: 1.12; }
:root[data-size="xl"] { --zoom: 1.25; }
body { zoom: var(--zoom); }

.boot { flex: 1; display: grid; place-items: center; }
.boot img { border-radius: 18px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .8; } }

/* ------------------------------------------------------------- Grundgerüst */

.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen-body {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(var(--tabbar) + var(--bottom) + 24px);
}
.wrap { width: 100%; max-width: 760px; margin: 0 auto; }

.appbar {
  padding: calc(var(--top) + 14px) 16px 10px;
  display: flex; align-items: center; gap: 10px;
  background: var(--ground);
}
.appbar h1 {
  font: 680 30px/1.1 var(--font-display);
  letter-spacing: -.01em;
  margin: 0; flex: 1;
}
.appbar .sub { color: var(--muted); font-size: 14px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding: 6px 8px calc(var(--bottom) + 6px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar .inner { display: flex; width: 100%; max-width: 520px; }
.tab {
  flex: 1; border: 0; background: none; padding: 6px 0 2px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 12px; font-weight: 600; position: relative;
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--pine); }
.tab .dot {
  position: absolute; top: 2px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--marigold); color: var(--marigold-ink);
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}

/* ------------------------------------------------------------- Bausteine */

.icon-btn {
  width: 42px; height: 42px; border-radius: 21px; border: 0;
  display: grid; place-items: center; background: transparent; color: var(--ink);
  flex: none;
}
.icon-btn:active { background: var(--sunk); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.filled { background: var(--pine); color: var(--pine-ink); }
.icon-btn.filled:disabled { opacity: .45; }

.btn {
  border: 0; border-radius: 14px; padding: 13px 18px;
  font-weight: 650; background: var(--sunk); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary { background: var(--pine); color: var(--pine-ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; }
.btn.small { padding: 8px 12px; border-radius: 10px; font-size: 14px; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 12px 13px; font-size: 16px; outline: none;
  appearance: none; -webkit-appearance: none;
}
.input:focus { border-color: var(--pine); }
textarea.input { resize: vertical; min-height: 80px; }
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.error { color: var(--danger); font-size: 14px; margin: 0 0 12px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; font-weight: 600; }
.switch input {
  appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px;
  background: var(--line); position: relative; transition: background .2s; flex: none; margin: 0;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.switch input:checked { background: var(--pine); }
.switch input:checked::after { transform: translateX(20px); }

.card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; margin: 0 0 16px; }
.section-title { font: 650 18px/1.3 var(--font-display); margin: 22px 2px 10px; }

.avatar {
  --c: var(--pine);
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--c); color: #fff; display: grid; place-items: center;
  font: 700 17px/1 var(--font-display); overflow: hidden; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; border: 2px solid var(--surface); }
.avatar.lg { width: 84px; height: 84px; font-size: 32px; }
.avatar.family { background: var(--pine-soft); color: var(--pine); }
.avatar.family svg { width: 26px; height: 26px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-left: -7px; }

.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px 6px 6px; display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 15px;
}
.chip[aria-pressed="true"] { border-color: var(--c, var(--pine)); background: color-mix(in srgb, var(--c, var(--pine)) 14%, var(--surface)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty strong { display: block; color: var(--ink); font: 650 19px/1.3 var(--font-display); margin-bottom: 6px; }

.fab {
  position: fixed; right: max(16px, calc(50% - 380px + 16px)); z-index: 15;
  bottom: calc(var(--tabbar) + var(--bottom) + 18px);
  width: 58px; height: 58px; border-radius: 20px; border: 0;
  background: var(--pine); color: var(--pine-ink); box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.fab svg { width: 28px; height: 28px; }

/* ------------------------------------------------------------- Sheets & Toast */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 18, 16, .42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease-out;
}
.sheet {
  width: 100%; max-width: 560px; max-height: calc(100dvh - var(--top) - 24px);
  background: var(--ground); border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; animation: up .24s cubic-bezier(.2,.8,.2,1);
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 18px; }
.sheet-head h2 { flex: 1; margin: 0; font: 650 20px/1.2 var(--font-display); }
.sheet-body { overflow-y: auto; padding: 8px 18px calc(var(--bottom) + 20px); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }

.menu { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.menu button {
  border: 0; background: var(--surface); text-align: left; padding: 15px 16px; font-weight: 600;
  display: flex; align-items: center; gap: 12px;
}
.menu button:first-child { border-radius: 14px 14px 0 0; }
.menu button:last-child { border-radius: 0 0 14px 14px; }
.menu button:only-child { border-radius: 14px; }
.menu button.danger { color: var(--danger); }

#toast {
  position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; z-index: 80; transform: translateY(20px);
  bottom: calc(var(--tabbar) + var(--bottom) + 18px);
  background: var(--ink); color: var(--ground); border-radius: 12px; padding: 11px 16px;
  font-weight: 600; font-size: 15px; max-width: 520px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: none; }

/* ------------------------------------------------------------- Anmelden */

.auth { flex: 1; overflow-y: auto; padding: calc(var(--top) + 48px) 24px calc(var(--bottom) + 24px); }
.auth .wrap { max-width: 400px; }
.auth .logo { width: 76px; height: 76px; border-radius: 20px; margin-bottom: 22px; }
.auth h1 { font: 700 34px/1.08 var(--font-display); letter-spacing: -.015em; margin: 0 0 8px; }
.auth p.tagline {
  margin: -2px 0 14px; color: var(--pine);
  font: 600 17px/1.3 var(--font-display); letter-spacing: .01em;
}
.auth p.lead { color: var(--muted); margin: 0 0 28px; }

.colophon { text-align: center; margin: 32px 0 0; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.colophon strong { font: 750 22px/1.1 var(--font-display); color: var(--pine); letter-spacing: .02em; }
.colophon span { font: 600 15px/1.3 var(--font-display); color: var(--ink); }
.colophon small { font-size: 13px; margin-top: 4px; }

/* ------------------------------------------------------------- Chatliste */

.chat-list { list-style: none; margin: 0; padding: 0; }
.chat-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 4px; width: 100%;
  border: 0; background: none; text-align: left; border-radius: 14px;
}
.chat-row:active { background: var(--sunk); }
.chat-row .meta { flex: 1; min-width: 0; }
.chat-row .top { display: flex; align-items: baseline; gap: 8px; }
.chat-row .name { flex: 1; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .time { font-size: 13px; color: var(--muted); flex: none; }
.chat-row .bottom { display: flex; align-items: center; gap: 8px; }
.chat-row .preview { flex: 1; color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .preview { color: var(--ink); }
.chat-row.unread .time { color: var(--ink); font-weight: 700; }
.badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; flex: none;
  background: var(--marigold); color: var(--marigold-ink);
  font-size: 13px; font-weight: 800; line-height: 22px; text-align: center;
}
.chat-row + .chat-row { box-shadow: 0 -1px 0 var(--line); }

/* ------------------------------------------------------------- Chat */

.chat-head {
  padding: calc(var(--top) + 6px) 8px 8px 4px;
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); z-index: 5;
}
.chat-head .title { flex: 1; min-width: 0; border: 0; background: none; text-align: left; display: flex; align-items: center; gap: 10px; padding: 2px; }
.chat-head .title > div { min-width: 0; }
.chat-head .t1 { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .t2 { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.messages {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 10px 12px 12px; display: flex; flex-direction: column;
}
.messages .inner { width: 100%; max-width: 760px; margin: auto auto 0; display: flex; flex-direction: column; }
.day-sep {
  align-self: center; margin: 14px 0 8px; padding: 4px 12px; border-radius: 10px;
  background: var(--sunk); color: var(--muted); font-size: 13px; font-weight: 650;
}
.msg { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; max-width: 86%; }
.msg.cont { margin-top: 2px; }
.msg.own { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar-slot { width: 28px; flex: none; }
.bubble {
  background: var(--bubble-other); border-radius: 18px; padding: 7px 12px 6px;
  box-shadow: 0 1px 1px rgba(29,42,44,.06); min-width: 0; overflow-wrap: anywhere;
  user-select: text; -webkit-user-select: text; -webkit-touch-callout: none;
}
.msg:not(.own) .bubble { border-bottom-left-radius: 6px; }
.msg:not(.own).cont-next .bubble { border-bottom-left-radius: 18px; }
.msg:not(.own).cont .bubble { border-top-left-radius: 6px; }
.msg.own .bubble { background: var(--bubble-own); color: var(--bubble-own-ink); border-bottom-right-radius: 6px; }
.msg.own.cont-next .bubble { border-bottom-right-radius: 18px; }
.msg.own.cont .bubble { border-top-right-radius: 6px; }
.bubble .author { font-size: 13px; font-weight: 750; color: var(--c); margin-bottom: 1px; }
.bubble .text { white-space: pre-wrap; }
.bubble .text a { color: inherit; text-decoration: underline; }
.bubble .time { font-size: 11px; opacity: .62; float: right; margin: 6px 0 -2px 10px; }
.bubble.media { padding: 4px; }
.bubble.media .author { padding: 3px 8px 2px; }
.bubble.media .text { padding: 4px 8px 2px; }
.bubble.media .time { margin-right: 8px; margin-bottom: 2px; }
.bubble.sending { opacity: .6; }
.media-grid { display: grid; gap: 3px; border-radius: 14px; overflow: hidden; }
.media-grid.n2, .media-grid.n4 { grid-template-columns: 1fr 1fr; }
.media-grid.n3, .media-grid.many { grid-template-columns: 1fr 1fr 1fr; }
.media-grid img, .media-grid video {
  width: 100%; height: 100%; object-fit: cover; background: var(--sunk); cursor: zoom-in;
  aspect-ratio: 1; display: block;
}
.media-grid.n1 img, .media-grid.n1 video { aspect-ratio: auto; max-height: 420px; min-height: 120px; max-width: 320px; }
.file-chip {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 2px 0;
  border-radius: 12px; background: color-mix(in srgb, currentColor 10%, transparent);
  color: inherit; text-decoration: none; font-weight: 600; font-size: 15px;
}
.load-more { align-self: center; color: var(--muted); font-size: 13px; padding: 8px; }

.composer {
  border-top: 1px solid var(--line); background: var(--ground);
  padding: 8px 8px calc(var(--bottom) + 8px);
}
.composer .inner { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: 21px; padding: 10px 15px; font-size: 16px; line-height: 1.35;
  max-height: 140px; min-height: 42px; outline: none;
}
.composer textarea:focus { border-color: var(--pine); }
.attachments { display: flex; gap: 8px; overflow-x: auto; max-width: 760px; margin: 0 auto 8px; padding: 2px; }
.attachments .att { position: relative; flex: none; }
.attachments img, .attachments .file {
  width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: var(--sunk);
}
.attachments .file { display: grid; place-items: center; font-size: 12px; color: var(--muted); padding: 4px; text-align: center; overflow: hidden; }
.attachments .remove {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 12px; border: 0;
  background: var(--ink); color: var(--ground); display: grid; place-items: center; font-size: 14px; line-height: 1;
}

.lightbox {
  position: fixed; inset: 0; z-index: 90; background: #000;
  display: flex; flex-direction: column;
}
.lightbox .bar { display: flex; justify-content: space-between; padding: calc(var(--top) + 6px) 8px 6px; color: #fff; }
.lightbox .bar .icon-btn { color: #fff; }
.lightbox .stage { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.lightbox .slide { flex: 0 0 100%; display: grid; place-items: center; scroll-snap-align: center; padding-bottom: var(--bottom); }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ------------------------------------------------------------- Kalender */

.cal-head { display: flex; align-items: center; gap: 4px; }
.cal-head h1 { flex: 1; }
.month { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 8px 6px 10px; }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays div { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0 6px; }
.day {
  border: 0; background: none; padding: 4px 0 6px; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 12px;
}
.day .num {
  width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center;
  font: 600 16px/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.day.other .num { color: var(--muted); opacity: .55; }
.day.weekend:not(.other) .num { color: var(--muted); }
.day.today .num { background: var(--marigold); color: var(--marigold-ink); font-weight: 750; }
.day[aria-selected="true"] { background: var(--pine-soft); }
.day[aria-selected="true"] .num { font-weight: 800; }
.day .dots { display: flex; gap: 3px; height: 6px; }
.day .dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--c); }

.agenda-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.agenda-title h2 { font: 650 19px/1.25 var(--font-display); margin: 0; }
.agenda { display: flex; flex-direction: column; gap: 8px; }
.event {
  display: flex; gap: 12px; align-items: stretch; width: 100%; text-align: left;
  border: 0; background: var(--surface); border-radius: 14px; padding: 12px 12px 12px 0;
  box-shadow: var(--shadow); overflow: hidden;
}
.event .bar { width: 5px; border-radius: 0 4px 4px 0; background: var(--c); flex: none; }
.event .when { width: 62px; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; }
.event .when small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.event .what { flex: 1; min-width: 0; }
.event .title { font-weight: 700; font-size: 16px; }
.event .info { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event .who { display: flex; align-items: center; flex: none; }
.event .who .avatar + .avatar { margin-left: -6px; }

/* ------------------------------------------------------------- Familie / Profil */

.me { display: flex; align-items: center; gap: 16px; }
.me .avatar { cursor: pointer; }
.me .who strong { display: block; font: 680 22px/1.2 var(--font-display); }
.me .who span { color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 36px; height: 36px; border-radius: 18px; border: 3px solid var(--surface);
  background: var(--c); box-shadow: 0 0 0 1px var(--line);
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.member + .member { border-top: 1px solid var(--line); }
.member .meta { flex: 1; min-width: 0; }
.member .meta strong { display: block; }
.member .meta span { color: var(--muted); font-size: 14px; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--pine-soft); color: var(--pine); margin-left: 6px; vertical-align: 2px; }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.avatar.figure svg { width: 100%; height: 100%; display: block; }

/* Avatar-Baukasten */
.av-top { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 8px; }
.av-preview { width: 132px; height: 132px; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow); }
.av-preview svg { width: 100%; height: 100%; display: block; }
.av-row { margin: 12px 0 0; }
.av-label { font-size: 14px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.av-opts { display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px 6px; scrollbar-width: none; }
.av-opts::-webkit-scrollbar { display: none; }
.av-opt { flex: none; width: 58px; height: 58px; border-radius: 50%; border: 0; padding: 0; overflow: hidden; background: var(--sunk); box-shadow: 0 0 0 1px var(--line); }
.av-opt svg { width: 100%; height: 100%; display: block; }
.av-opt.color { width: 40px; height: 40px; margin: 9px 0; }
.av-opt[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--pine); }

.vehicle-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.vehicle-opt { border: 2px solid var(--line); border-radius: 14px; background: var(--surface); padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: 12px; }
.vehicle-opt[aria-pressed="true"] { border-color: var(--pine); box-shadow: 0 0 0 2px var(--pine); }
.vehicle-opt .v-icon { width: 34px; height: 34px; display: grid; place-items: center; font-size: 28px; line-height: 1; }
.vehicle-opt .v-icon svg { width: 34px; height: 34px; }

/* Fliegende Nachrichten */
.flight-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 6; }
.flight-trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: currentColor; opacity: .55; transition: opacity .45s; }
.flight-trail.fade { opacity: 0; }
.flyer { position: absolute; left: 0; top: 0; width: 40px; height: 40px; will-change: transform; filter: drop-shadow(0 4px 4px rgba(0,0,0,.18)); }
.flyer svg { width: 100%; height: 100%; display: block; }
.flyer.emoji { font-size: 34px; line-height: 40px; text-align: center; }
.flyer.landed { transition: opacity .25s, transform .25s; opacity: 0; }

/* ------------------------------------------------------------- Startbild */
#splash {
  position: fixed; inset: 0; z-index: 200; background: var(--splash, #2E6B5E); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .5s ease, transform .5s ease;
}
#splash.gone { opacity: 0; transform: scale(1.04); pointer-events: none; }
#splash strong { font: 800 72px/1 var(--font-display); letter-spacing: .05em; animation: sp-in .7s cubic-bezier(.2,.8,.2,1) both; }
#splash span { font: 650 18px/1.3 var(--font-display); opacity: .92; animation: sp-in .7s .18s cubic-bezier(.2,.8,.2,1) both; }
.sp-table { position: relative; width: 92px; height: 92px; margin-bottom: 18px; animation: sp-in .6s cubic-bezier(.2,.8,.2,1) both; }
.sp-table::before { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: #D9A86C; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
.sp-table i { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; left: 38px; top: 38px; }
.sp-table i:nth-child(1) { transform: rotate(90deg) translate(38px) ; }
.sp-table i:nth-child(2) { transform: rotate(162deg) translate(38px); background: #F2B33D; }
.sp-table i:nth-child(3) { transform: rotate(234deg) translate(38px); background: #E0607E; }
.sp-table i:nth-child(4) { transform: rotate(306deg) translate(38px); background: #8FB6F0; }
.sp-table i:nth-child(5) { transform: rotate(18deg) translate(38px); background: #9FD9B8; }
@keyframes sp-in { from { opacity: 0; transform: translateY(14px); } }

/* ------------------------------------------------------------- Familientisch */
.table-head { display: flex; align-items: center; gap: 6px; }
.brand { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.brand strong { font: 800 30px/1 var(--font-display); letter-spacing: .02em; }
.brand span { font: 650 14px/1.3 var(--font-display); color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage { position: relative; width: 100%; max-width: 480px; margin: 4px auto 6px; }
.table {
  position: absolute; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 45% 38%, var(--wood-1, #DDAE73), var(--wood-2, #B57E40) 72%);
  box-shadow: 0 10px 24px rgba(90, 60, 20, .28), inset 0 -6px 0 rgba(0,0,0,.08);
}
.table-rim { position: absolute; inset: 7%; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); }

.seat {
  position: absolute; transform: translate(-50%, -50%); border: 0; background: none; padding: 0;
  width: var(--seat); height: var(--seat); display: grid; place-items: center; z-index: 2;
}
.seat-l { --seat: 64px; } .seat-m { --seat: 54px; } .seat-s { --seat: 44px; }
.seat .chair {
  position: absolute; left: 50%; top: 50%; width: calc(var(--seat) * 1.02); height: calc(var(--seat) * 1.02);
  border-radius: 30% 30% 26% 26%; background: var(--chair, #E9DFCB);
  border-top: calc(var(--seat) * .16) solid var(--chair-back, #CDBE9F);
  box-shadow: 0 2px 4px rgba(0,0,0,.08); transform-origin: 50% 50%;
}
.seat.away .chair { opacity: .85; }
.seat .avatar { position: relative; width: calc(var(--seat) * .86); height: calc(var(--seat) * .86); font-size: calc(var(--seat) * .34);
  box-shadow: 0 0 0 3px var(--surface), 0 3px 8px rgba(0,0,0,.18); animation: sit .45s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes sit { from { transform: translateY(-10px) scale(.7); opacity: 0; } }
.seat .empty {
  position: relative; width: calc(var(--seat) * .8); height: calc(var(--seat) * .8); border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--muted) 45%, transparent); display: grid; place-items: center;
  font: 700 12px/1 var(--font-display); color: var(--muted); background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.seat .here { position: absolute; right: 6%; top: 6%; width: 14px; height: 14px; border-radius: 50%; background: #34B36B; box-shadow: 0 0 0 2.5px var(--surface); }
.seat .seat-name {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, 2px); white-space: nowrap;
  font: 700 13px/1.2 var(--font-display); color: var(--ink); max-width: 90px; overflow: hidden; text-overflow: ellipsis;
}
.seat.away .seat-name { color: var(--muted); }
.seat .seat-badge { position: absolute; left: 0; top: 0; min-width: 22px; height: 22px; box-shadow: 0 0 0 2.5px var(--surface); }
.seat.bump .avatar { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

.note {
  position: absolute; z-index: 3; max-width: 40%; transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  border: 0; border-radius: 4px; padding: 6px 10px 8px; text-align: center; color: #2A2416;
  background: #FFFCF2; box-shadow: 0 3px 8px rgba(70, 45, 10, .25);
  border-top: 8px solid var(--n);
}
.note-name { display: block; font: 800 15px/1.15 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note .note-badge { position: absolute; right: -9px; top: -16px; min-width: 24px; height: 24px; line-height: 24px; box-shadow: 0 0 0 2px #FFFCF2; }
.note.more { border-top-color: #A79E8B; }
.note.bump { animation: note-bump .55s ease; }
@keyframes note-bump { 35% { transform: translate(-50%, -50%) rotate(var(--r)) scale(1.14); } }

.msg-popup {
  position: fixed; left: 12px; right: 12px; z-index: 30; max-width: 520px; margin: 0 auto;
  bottom: calc(var(--tabbar) + var(--bottom) + 12px);
  transform: translateY(16px); opacity: 0; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .25s;
}
.msg-popup.show { transform: none; opacity: 1; }
.msg-popup > button {
  width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; border: 0;
  background: var(--surface); border-radius: 20px; padding: 12px 14px; box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.msg-popup .p-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-popup .p-head { display: flex; align-items: center; gap: 8px; }
.msg-popup .p-head strong { font: 700 17px/1.2 var(--font-display); }
.msg-popup .p-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--pine-soft); color: var(--pine); }
.msg-popup .p-text { font-size: 16px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-screen .today-strip { margin-top: 18px; }

/* Tisch aufgehübscht: Teppich, Licht, Holzmaserung */
.room { position: relative; margin: 0 -16px; padding: 0 16px; }
.room::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: min(108%, 520px); aspect-ratio: 1 / .96;
  transform: translate(-50%, -50%); border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 88%, color-mix(in srgb, var(--rug, #E9DCC6) 70%, transparent) 89% 91%, transparent 92%),
    radial-gradient(closest-side, var(--rug, #F1E7D6), color-mix(in srgb, var(--rug, #F1E7D6) 40%, transparent) 78%, transparent 100%);
  pointer-events: none;
}
.table {
  background:
    radial-gradient(circle at 42% 36%, rgba(255,240,210,.45), transparent 46%),
    repeating-radial-gradient(circle at 58% 60%, rgba(0,0,0,0) 0 9px, rgba(90,55,20,.07) 10px 11px),
    radial-gradient(circle at 45% 38%, var(--wood-1, #DDAE73), var(--wood-2, #B57E40) 72%);
  box-shadow: 0 16px 34px rgba(90, 60, 20, .32), 0 0 0 7px var(--wood-edge, #A06A31), inset 0 -6px 0 rgba(0,0,0,.08);
}
.seat.me:not(.has-av) .avatar::after {
  content: "+"; position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pine); color: var(--pine-ink); font: 800 16px/22px var(--font-display); text-align: center;
  box-shadow: 0 0 0 2.5px var(--surface);
}
.seat .avatar { overflow: visible; }
.seat .avatar > svg, .seat .avatar > img { border-radius: inherit; overflow: hidden; }
.seat .avatar.figure { overflow: hidden; }
.seat.me:not(.has-av) .avatar { overflow: visible; }

.hints { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.hint-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0;
  background: var(--surface); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow);
  border: 2px dashed color-mix(in srgb, var(--pine) 40%, transparent);
}
.hint-icon { font-size: 30px; line-height: 1; }
.hint-text { display: flex; flex-direction: column; gap: 2px; }
.hint-text strong { font: 750 17px/1.2 var(--font-display); }
.hint-text span { color: var(--muted); font-size: 15px; }
@media (prefers-color-scheme: dark) {
  :root { --rug: #232838; --wood-edge: #7C5226; }
  .room::before { opacity: .9; }
}
