/* ---------- Design-Tokens ---------- */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --text: #1c1f2e;
  --muted: #676c82;
  --border: #e2e4ee;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef0ff;
  --on-primary: #ffffff;
  --yes: #15803d;
  --yes-strong: #16a34a;
  --yes-soft: #dcfce7;
  --maybe: #b45309;
  --maybe-strong: #d97706;
  --maybe-soft: #fef3c7;
  --no: #b91c1c;
  --no-strong: #dc2626;
  --no-soft: #fee2e2;
  --info-soft: #e0f2fe;
  --info: #075985;
  --wa: #1fa855;
  --wa-600: #178a45;
  --wa-soft: #dcf8e6;
  --wa-text: #128c4a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 40, .05), 0 6px 20px rgba(20, 22, 40, .05);
  --nav-h: 62px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #181b24;
    --surface-2: #1f2330;
    --text: #e8eaf2;
    --muted: #9aa0b4;
    --border: #2b3040;
    --primary: #8b93fa;
    --primary-600: #a5abfb;
    --primary-soft: #262a4a;
    --on-primary: #0f1117;
    --yes: #4ade80;
    --yes-strong: #22c55e;
    --yes-soft: #12301f;
    --maybe: #fbbf24;
    --maybe-strong: #f59e0b;
    --maybe-soft: #3a2b0c;
    --no: #f87171;
    --no-strong: #ef4444;
    --no-soft: #3b1818;
    --info-soft: #0c2a3d;
    --info: #7dd3fc;
    --wa: #1fa855;
    --wa-600: #25c063;
    --wa-soft: #10311f;
    --wa-text: #4ade80;
    --shadow: none;
  }
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1 { font-size: 1.65rem; line-height: 1.25; margin: .15em 0 .3em; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .9rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h3 { font-size: 1.05rem; margin: .2rem 0 .4rem; }
h3.sub { margin-top: 1.2rem; font-size: .95rem; }
p { margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.small .icon, small .icon { width: 15px; height: 15px; vertical-align: -2px; }
.warn-text { color: var(--maybe); }
.yes-text { color: var(--yes); font-weight: 700; }
.maybe-text { color: var(--maybe); font-weight: 700; }
.star { color: var(--maybe-strong); }
.js .js-hide, html:not(.js) .js-only { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}
.narrow { max-width: 760px; }

/* ---------- Kopfzeile & Navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 60px; padding-top: 0; padding-bottom: 0; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 1.08rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand .icon { color: var(--primary); width: 26px; height: 26px; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav form { margin: 0; }
.nav a, .nav button {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font: inherit; font-size: .93rem; font-weight: 550;
  background: none; border: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--primary); background: var(--primary-soft); }
.pill { background: var(--no-strong); color: #fff; border-radius: 999px; font-size: .7rem; line-height: 18px; min-width: 18px; padding: 0 5px; text-align: center; font-weight: 700; }

.lbl-short { display: none; }
@media (max-width: 760px) {
  /* backdrop-filter würde die fixierte Tab-Leiste im Header "einfangen" */
  .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .nav:not(.nav-guest) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    justify-content: space-around; gap: 0;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border);
    padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  }
  .nav:not(.nav-guest) a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: .68rem; font-weight: 600; min-height: 50px; justify-content: center; }
  .nav:not(.nav-guest) a.active { background: none; }
  .nav:not(.nav-guest) a .icon { width: 24px; height: 24px; }
  .nav .pill { position: absolute; top: 2px; left: calc(50% + 6px); }
  .nav .desktop-only { display: none; }
  body.has-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .topbar-inner { height: 52px; justify-content: center; }
  h1 { font-size: 1.4rem; }
  .wrap { padding-top: 18px; }
}

/* ---------- Karten, Layout ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
@media (max-width: 520px) { .card { padding: 16px; border-radius: 12px; } }
.section { margin-top: 28px; }
.section > h2 { margin-bottom: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: 2px; }
.back:hover { color: var(--primary); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin: 0; font-size: .92rem; }
.meta a { color: var(--muted); text-decoration: none; }
.meta .icon { width: 16px; height: 16px; vertical-align: -3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cards .card { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > h2, .stack > h3 { margin-bottom: 0; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 220px; }
.count { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 8px; border-radius: 999px; }
.desc { white-space: pre-line; }
.desc-text { white-space: pre-line; margin-top: 12px; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .74rem; font-weight: 700; color: var(--primary); margin: 0 0 4px; }
.empty { text-align: center; padding: 36px 20px; }
.empty > .icon { width: 42px; height: 42px; color: var(--primary); margin-bottom: 8px; }
.empty-inline { color: var(--muted); margin: 0; }
.footer { color: var(--muted); font-size: .8rem; text-align: center; padding-top: 8px; padding-bottom: 24px; }
@media (max-width: 760px) { .footer { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn.danger { color: var(--no); }
.btn.danger:hover { border-color: var(--no); background: var(--no-soft); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.big { min-height: 52px; font-size: 1.05rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent;
  background: none; color: var(--muted); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; min-height: 32px; }
.chip.yes { color: var(--yes); } .chip.maybe { color: var(--maybe); } .chip.no { color: var(--no); }
.chip:hover { border-color: currentColor; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.field > span { font-weight: 600; font-size: .9rem; }
.field.end { justify-content: flex-end; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-width: 0; min-height: 46px;
  font: inherit; font-size: 16px; /* verhindert Zoom in iOS Safari */
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type=date], input[type=time] { display: block; line-height: 1.4; color-scheme: light dark; }
/* iOS Safari: Wert-Text explizit einfärben, sonst bleibt er im Dunkelmodus dunkel */
input::-webkit-date-and-time-value { text-align: left; color: var(--text); min-height: 1.4em; }
input::-webkit-datetime-edit, input::-webkit-datetime-edit-fields-wrapper { color: var(--text); }
input::-webkit-calendar-picker-indicator { opacity: .7; cursor: pointer; }
::placeholder { color: var(--muted); opacity: .8; }
select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled, textarea:disabled { opacity: .7; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 0; min-height: 36px; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; }
.row-form input { flex: 1 1 160px; }
.form-actions { position: sticky; bottom: 12px; z-index: 5; }
@media (max-width: 760px) { .form-actions { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px); } }
.danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 6px 14px 10px; margin: 0; min-width: 0; }
legend { padding: 0 6px; margin-left: -6px; }
.members .member { border-top: 1px solid var(--border); padding: 6px 0; }
.members .member:first-of-type { border-top: 0; }
.member .mname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.member.is-invited { opacity: .6; }
.sub-details { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.sub-details summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .92rem; margin-bottom: 12px; }

/* Terminzeilen im Formular */
.opt-rows { display: flex; flex-direction: column; gap: 10px; }
.opt-row {
  display: grid; grid-template-columns: minmax(150px, 1.6fr) minmax(100px, 1fr) minmax(100px, 1fr) auto;
  gap: 8px 10px; align-items: end;
  padding: 10px 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.mini { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini > span { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mini > span em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; }
.opt-row .icon-btn { margin-bottom: 3px; }
@media (max-width: 560px) {
  .opt-row { grid-template-columns: 1fr 1fr auto; grid-template-areas: "d d x" "s e e"; }
  .opt-row .mini-date { grid-area: d; }
  .opt-row .mini:nth-child(2) { grid-area: s; }
  .opt-row .mini:nth-child(3) { grid-area: e; }
  .opt-row .icon-btn { grid-area: x; align-self: end; }
}
.existing-opts { display: flex; flex-direction: column; gap: 2px; }
.opt-existing { padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; background: var(--surface-2); }

/* ---------- Meldungen & Badges ---------- */
.flash-wrap { padding-top: 14px; padding-bottom: 0; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: .94rem; border: 1px solid transparent; }
.alert.success { background: var(--yes-soft); color: var(--yes); border-color: color-mix(in srgb, var(--yes) 25%, transparent); }
.alert.error { background: var(--no-soft); color: var(--no); border-color: color-mix(in srgb, var(--no) 25%, transparent); }
.alert.warning { background: var(--maybe-soft); color: var(--maybe); border-color: color-mix(in srgb, var(--maybe) 25%, transparent); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.link-alert { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; vertical-align: middle; letter-spacing: .01em; white-space: nowrap; }
h1 .badge { vertical-align: 4px; }
.badge.open, .badge.active { background: var(--yes-soft); color: var(--yes); }
.badge.closed { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.pending { background: var(--maybe-soft); color: var(--maybe); }
.badge.disabled, .badge.rejected { background: var(--no-soft); color: var(--no); }
.badge.admin { background: var(--primary-soft); color: var(--primary); }
.tag { font-size: .7rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }

/* ---------- Login ---------- */
.auth { display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px 60px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px 28px; }
.auth-card h1 { text-align: center; margin-top: 4px; }
.auth-card > p.muted { text-align: center; }
.auth-logo { display: flex; justify-content: center; }
.auth-logo .icon { width: 52px; height: 52px; padding: 12px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.auth form { margin: 18px 0; }

/* ---------- Übersicht ---------- */
.event-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.event-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.event-card h3 { margin: 4px 0 2px; overflow-wrap: anywhere; }
.event-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.event-card p { margin: 0; }
.final-line { color: var(--yes); font-weight: 600; font-size: .92rem; }
.final-line .icon { width: 16px; height: 16px; vertical-align: -3px; }
.progress-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.fill { display: block; height: 100%; background: var(--yes-strong); border-radius: 99px; width: 0; }
.fill.w10 { width: 10%; } .fill.w20 { width: 20%; } .fill.w30 { width: 30%; } .fill.w40 { width: 40%; } .fill.w50 { width: 50%; }
.fill.w60 { width: 60%; } .fill.w70 { width: 70%; } .fill.w80 { width: 80%; } .fill.w90 { width: 90%; } .fill.w100 { width: 100%; }
.new-group { border-style: dashed; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Listen (Teilnehmer, Benutzer) ---------- */
.plist, .ulist, .link-list, .comments { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.plist li:first-child { border-top: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; background: var(--primary-soft); color: var(--primary); }
.avatar.ok { background: var(--yes-soft); color: var(--yes); }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pinfo strong, .pinfo small { overflow-wrap: anywhere; }
.pinfo .status { color: var(--muted); }
.pinfo .status.ok { color: var(--yes); }
.pinfo .comment { color: var(--text); font-style: italic; margin-top: 2px; }
.pmenu { position: relative; }
.pmenu > summary { list-style: none; }
.pmenu > summary::-webkit-details-marker { display: none; }
.pmenu[open] > summary { background: var(--surface-2); border-color: var(--border); }
.pmenu-body {
  position: absolute; right: 0; top: 46px; z-index: 10; width: min(340px, calc(100vw - 48px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.pmenu-body form { margin: 0; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { font-size: 13px !important; min-height: 36px !important; padding: 6px 8px !important; }
.urow { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); flex-wrap: wrap; align-items: flex-start; }
.urow:first-child { border-top: 0; padding-top: 0; }
.uinfo { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.uinfo > * { overflow-wrap: anywhere; }
.uactions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; flex: 0 1 auto; }
.uactions form { margin: 0; }
@media (max-width: 640px) { .uinfo { flex-basis: 0; } .uactions { flex-basis: 100%; padding-left: 52px; } }
.inline-details > summary { list-style: none; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details .details-body { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.link-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.link-list li:first-child { border-top: 0; }
.comments li { padding: 8px 0; border-top: 1px solid var(--border); font-size: .93rem; overflow-wrap: anywhere; }
.comments li:first-child { border-top: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border: 1px solid var(--border); background: var(--surface); }
.tabs a.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.tabs a.active .count { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--on-primary) 40%, transparent); }

/* ---------- Profilbilder ---------- */
img.avatar { object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.avatar.ok { box-shadow: 0 0 0 2px var(--yes-strong); }
img.avatar.ok { border-color: transparent; }
.avatar.big { width: 52px; height: 52px; font-size: 1.05rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 1.8rem; }
.nav-avatar.avatar { width: 24px; height: 24px; font-size: .6rem; border: 0; }
.hello { display: flex; align-items: center; gap: 14px; }
.hello h1 { margin: 0; }
.hello p { margin: 0; }
.avatar-edit { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar-edit form { margin: 0; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 100px; }
.danger-card { border-color: color-mix(in srgb, var(--no) 30%, var(--border)); }
.danger-card h2 { color: var(--no); }
em.req { font-style: normal; font-weight: 500; color: var(--muted); font-size: .85em; }
.grow { flex: 1; }

/* ---------- Eigene Antwort (Zusammenfassung) ---------- */
.my-answer { border-color: color-mix(in srgb, var(--yes-strong) 45%, var(--border)); }
.my-answer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.my-answer-head h2 { margin: 0; color: var(--yes); }
.answer-chips { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-answer { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .88rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); }
.chip-answer .ico { font-weight: 800; }
.chip-answer.yes { background: var(--yes-soft); color: var(--yes); border-color: transparent; }
.chip-answer.maybe { background: var(--maybe-soft); color: var(--maybe); border-color: transparent; }
.chip-answer.no { color: var(--muted); }
.chip-answer.no .ico { color: var(--no); }
.signed-in { margin: -4px 0 0; }
.signed-in .icon { width: 15px; height: 15px; }
[id] { scroll-margin-top: 76px; }

/* ---------- Gruppenbilder ---------- */
.group-img { width: 56px; height: 56px; border-radius: 14px; flex: none; object-fit: cover; border: 1px solid var(--border); background: var(--surface-2); }
.group-img.placeholder { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; color: #fff; border: 0; }
.group-img.mini { width: 22px; height: 22px; border-radius: 6px; font-size: .55rem; vertical-align: middle; }
.group-img.big { width: 72px; height: 72px; border-radius: 18px; font-size: 1.4rem; }
.group-img.xl { width: 96px; height: 96px; border-radius: 22px; font-size: 1.8rem; }
.hue-0 { background: #6366f1; } .hue-1 { background: #0ea5e9; } .hue-2 { background: #14b8a6; } .hue-3 { background: #22c55e; }
.hue-4 { background: #84cc16; } .hue-5 { background: #eab308; } .hue-6 { background: #f97316; } .hue-7 { background: #ef4444; }
.hue-8 { background: #ec4899; } .hue-9 { background: #a855f7; } .hue-10 { background: #8b5cf6; } .hue-11 { background: #64748b; }
.group-card { display: flex; align-items: flex-start; gap: 14px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.group-card:hover, .group-card-link:hover h3 { border-color: var(--primary); color: inherit; }
.group-card h3 { margin: 0 0 2px; overflow-wrap: anywhere; }
.group-card p { margin: 0; }
.group-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.group-card.foreign { flex-direction: column; align-items: stretch; gap: 10px; border-style: dashed; }
.group-card-link { display: flex; gap: 14px; text-decoration: none; color: inherit; }
.group-card.foreign form { margin: 0; }
.foreign-badge { align-self: flex-start; background: var(--info-soft); color: var(--info); }
.group-head { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.group-head h1 { margin: 0; }
.group-head p { margin: 2px 0 0; }
.owner-line { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.avatar.tiny { width: 22px; height: 22px; font-size: .55rem; }
.group-chip { display: inline-flex; align-items: center; gap: 6px; }
.check .group-img.mini { margin-right: 2px; }
.section.first { margin-top: 0; }

/* ---------- Umfragebilder ---------- */
.event-banner { display: block; width: 100%; aspect-ratio: 16 / 6; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--border); }
@media (max-width: 760px) { .event-banner { aspect-ratio: 16 / 8; border-radius: 12px; } }
.event-card.has-img { padding-top: 0; overflow: hidden; }
.event-card-img { display: block; width: calc(100% + 40px); margin: 0 -20px 10px; aspect-ratio: 16 / 7; object-fit: cover; border-bottom: 1px solid var(--border); }
@media (max-width: 520px) { .event-card-img { width: calc(100% + 32px); margin: 0 -16px 10px; } }
.event-head.has-img { padding-top: 0; overflow: hidden; }
.event-head-img { display: block; width: calc(100% + 40px); margin: 0 -20px 16px; aspect-ratio: 16 / 8; object-fit: cover; }
@media (max-width: 520px) { .event-head-img { width: calc(100% + 32px); margin: 0 -16px 14px; } }
.event-image-pick { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.event-image-pick > .stack { flex: 1 1 220px; }
.event-img-frame { width: 240px; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px dashed var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.event-img-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-img-frame img[hidden], .img-placeholder[hidden] { display: none; }
.img-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: .8rem; }
.img-placeholder .icon { width: 28px; height: 28px; }
@media (max-width: 520px) { .event-img-frame { width: 100%; } }

/* ---------- Gemeinsamer Einladungslink ---------- */
.share-card { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.share-card h2 { margin-bottom: 4px; }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.share-actions form { margin: 0; }
.share-card .copy-row input { font-size: 14px !important; }

/* ---------- Benutzerverwaltung: Bearbeiten-Panel ---------- */
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 3px 0; }
.badge.role-voter { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.role-user { background: var(--info-soft); color: var(--info); }
.badge.role-admin { background: var(--primary-soft); color: var(--primary); }
.edit-panel { display: none; flex-basis: 100%; margin-top: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.edit-toggle:checked ~ .edit-panel { display: block; }
.edit-toggle:checked ~ .uactions .edit-open { display: none; }
.edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.group-picker { grid-column: 1 / -1; background: var(--surface); }
.grid-form .group-picker { grid-column: 1 / -1; }
.group-picker legend { font-weight: 600; font-size: .9rem; }
.group-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.group-line { color: var(--primary); }
.group-line .icon { width: 14px; height: 14px; }
.panel-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .edit-form { grid-template-columns: 1fr; }
  .panel-actions .btn.primary, .panel-actions label.btn { flex: 1; }
  .panel-actions .grow { display: none; }
  .panel-actions .btn.danger { order: 3; flex-basis: 100%; }
}

/* ---------- Einladungskanäle (E-Mail / WhatsApp) ---------- */
.channel-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.channel-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.channel-tabs > label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  font-weight: 650; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.channel-tabs > input:checked + label { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.channel-tabs > input#ch-wa:checked + label { background: var(--wa-soft); border-color: var(--wa); color: var(--wa-text); }
.channel-tabs > input:focus-visible + label { outline: 3px solid var(--primary-soft); }
.channel-panel { display: none; flex-basis: 100%; margin-top: 10px; }
#ch-mail:checked ~ .panel-mail, #ch-wa:checked ~ .panel-wa { display: flex; flex-direction: column; }
.panel-mail > form { width: 100%; }
.btn.wa-btn { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.wa-btn:hover { background: var(--wa-600); border-color: var(--wa-600); }
.btn.wa-btn.done { background: var(--surface); color: var(--wa-text); border-color: var(--wa); }
.avatar.wa { background: var(--wa-soft); color: var(--wa-text); }
.icon-btn.wa-icon { color: var(--wa-text); }
.icon-btn.wa-icon:hover { background: var(--wa-soft); border-color: var(--wa); }
.wa-list form { margin: 0; }
.wa-ready { background: var(--wa-soft); border: 1px solid var(--wa); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.wa-ready p { margin-bottom: 10px; }
.wa-form { border-top: 1px dashed var(--border); padding-top: 14px; }

/* ---------- Ergebnis-Matrix ---------- */
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
.matrix th, .matrix td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom-color: var(--border); }
.matrix thead th { background: var(--surface-2); font-weight: 500; vertical-align: bottom; }
.matrix .sticky {
  position: sticky; left: 0; z-index: 1; text-align: left;
  background: var(--surface); border-right: 1px solid var(--border);
  min-width: 130px; max-width: 190px; padding-left: 12px;
}
.matrix thead .sticky, .matrix tfoot .sticky { background: var(--surface-2); font-size: .8rem; color: var(--muted); font-weight: 600; }
.matrix .name { font-weight: 600; }
.matrix .name .pname { display: block; overflow: hidden; text-overflow: ellipsis; }
.matrix .name small { display: block; font-weight: 400; font-size: .72rem; }
.matrix tr.me .name .pname { color: var(--primary); }
.matrix tr.pending td { opacity: .55; }
.opt { min-width: 62px; }
.opt span { display: block; line-height: 1.15; }
.opt .wd { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.opt .day { font-size: 1.3rem; font-weight: 750; }
.opt .mon { font-size: .78rem; }
.opt .time { font-size: .7rem; color: var(--muted); margin-top: 3px; }
.opt.best { box-shadow: inset 0 3px 0 var(--yes-strong); }
.opt.final, td.final { background: color-mix(in srgb, var(--yes-soft) 60%, var(--surface)); }
.cell { font-weight: 700; font-size: 1rem; }
.cell.yes { background: var(--yes-soft); color: var(--yes); }
.cell.maybe { background: var(--maybe-soft); color: var(--maybe); font-size: .85rem; }
.cell.no { color: var(--no); opacity: .75; }
.cell.none { color: var(--muted); }
.matrix tfoot td, .matrix tfoot th { background: var(--surface-2); border-bottom: 0; }
.sum strong { font-size: 1.05rem; }
.sum small { color: var(--maybe); font-weight: 700; }
.sum.best strong { color: var(--yes); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; color: var(--muted); }
.lg.yes { color: var(--yes); } .lg.maybe { color: var(--maybe); } .lg.no { color: var(--no); }

/* ---------- Abschluss / finaler Termin ---------- */
.final-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--yes-strong) 45%, var(--border)); background: color-mix(in srgb, var(--yes-soft) 55%, var(--surface)); }
.final-card .eyebrow { color: var(--yes); }
.final-date { font-size: 1.25rem; font-weight: 750; margin: 0; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface-2); }
.radio-card input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
.radio-card .rc-main { flex: 1; min-width: 0; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card.best .rc-main strong::after { content: ""; }

/* ---------- Abstimmen ---------- */
.event-head h1 { margin-bottom: 8px; overflow-wrap: anywhere; }
.quick-set { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vote-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vote-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.vote-row.final { border-color: var(--yes-strong); }
.vote-date { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vote-date > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.vote-date .t { color: var(--muted); font-size: .86rem; }
.vote-date strong { white-space: nowrap; }
@media (max-width: 480px) { .vote-date .yr { display: none; } }
.vote-date .cnt { color: var(--yes); font-size: .76rem; font-weight: 600; }
.cal { display: flex; flex-direction: column; align-items: center; width: 46px; flex: none; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.cal-m { width: 100%; text-align: center; background: var(--primary); color: var(--on-primary); font-size: .65rem; font-weight: 700; text-transform: uppercase; padding: 1px 0; }
.cal-d { font-size: 1.2rem; font-weight: 750; line-height: 1.5; }
.seg { position: relative; display: flex; gap: 6px; flex: none; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; height: 54px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface);
  font-weight: 800; font-size: 1.1rem; line-height: 1.1; color: var(--muted); cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .12s, color .12s, border-color .12s, transform .08s;
}
.seg label small { font-size: .6rem; font-weight: 600; margin-top: 2px; letter-spacing: .02em; }
.seg label:active { transform: scale(.95); }
.seg label.yes:hover { border-color: var(--yes-strong); color: var(--yes); }
.seg label.maybe:hover { border-color: var(--maybe-strong); color: var(--maybe); }
.seg label.no:hover { border-color: var(--no-strong); color: var(--no); }
.seg input:checked + label.yes { background: var(--yes-strong); border-color: var(--yes-strong); color: #fff; }
.seg input:checked + label.maybe { background: var(--maybe-strong); border-color: var(--maybe-strong); color: #fff; }
.seg input:checked + label.no { background: var(--no-strong); border-color: var(--no-strong); color: #fff; }
.seg input:focus-visible + label { outline: 3px solid var(--primary-soft); outline-offset: 1px; }
.seg input:disabled + label { cursor: default; opacity: .65; }
@media (max-width: 480px) {
  .vote-row { padding: 10px; gap: 8px; }
  .seg { gap: 4px; }
  .seg label { width: 48px; height: 50px; font-size: 1rem; }
  .cal { width: 40px; }
  .vote-date { gap: 9px; }
}
@media (max-width: 360px) {
  .vote-row { flex-direction: column; align-items: stretch; }
  .seg label { flex: 1; width: auto; }
}
