/* MielkyPlayer – Verwaltung. Design-System der redeyed.de-Oberflächen (aus TagHeart übernommen), Farben von MielkyPlayer. */
:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --surface-3: #e3e6f2;
  --text: #1b1d27;
  --muted: #646a80;
  --line: #e1e4ef;
  --primary: #4c5fd5;
  --primary-strong: #3646b3;
  --primary-ink: #ffffff;
  --primary-soft: #e6e9fb;
  --accent: #a35cff;
  --accent-soft: #f3eaff;
  --ok: #0c8f6a;
  --ok-soft: #e3f7ef;
  --warn: #b25e00;
  --warn-soft: #fff1db;
  --danger: #d6293e;
  --danger-soft: #fde6e8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(34, 28, 31, .05), 0 6px 20px rgba(34, 28, 31, .06);
  --shadow-lg: 0 12px 40px rgba(34, 28, 31, .16);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar: 252px;
  --bottom-nav: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #171a23;
    --surface-2: #1f2330;
    --surface-3: #282d3c;
    --text: #eef0f8;
    --muted: #a3a9c0;
    --line: #2a2f3e;
    --primary: #b4c5ff;
    --primary-strong: #cdd8ff;
    --primary-ink: #101834;
    --primary-soft: #232c4d;
    --accent: #c69bff;
    --accent-soft: #2c2342;
    --ok: #38d9a9;
    --ok-soft: #12302a;
    --warn: #ffc078;
    --warn-soft: #3a2a14;
    --danger: #ff8787;
    --danger-soft: #3d1c20;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .6rem; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 18px; height: 18px; }
.i-lg { width: 28px; height: 28px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Gerüst ---------- */
.app { min-height: 100vh; }
.sidebar { display: none; }
.main { padding: 16px 16px calc(var(--bottom-nav) + 28px); max-width: 2400px; margin: 0 auto; min-width: 0; }
.content { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; min-height: 56px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .title { font-weight: 750; font-size: 1.1rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.brand .logo .i { stroke-width: 2.3; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .72rem; font-weight: 600; position: relative; }
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a.active { color: var(--primary-strong); }
.bottom-nav a.active .pill { background: var(--primary-soft); }
.bottom-nav .pill { padding: 3px 16px; border-radius: 999px; display: grid; place-items: center; transition: background .15s; }

.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--primary); color: var(--primary-ink); font-size: .7rem; font-weight: 800;
  display: inline-grid; place-items: center; line-height: 1;
}
.bottom-nav .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface);
  }
  .sidebar .brand { padding: 4px 10px 18px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; }
  .side-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
    color: var(--text); font-weight: 600;
  }
  .side-link:hover { background: var(--surface-2); text-decoration: none; }
  .side-link.active { background: var(--primary-soft); color: var(--primary-strong); }
  .side-link .nav-badge { margin-left: auto; }
  .sidebar .me { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
  .bottom-nav, .topbar.mobile-only { display: none; }
  .main { padding: 28px 36px 48px; }
  .desktop-hidden { display: none !important; }
}
@media (max-width: 959px) { .mobile-hidden { display: none !important; } }

.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-head h1 { flex: 1; min-width: 0; }
.page-head .sub { flex-basis: 100%; color: var(--muted); margin-top: -10px; }

/* ---------- Bausteine ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { flex: 1; font-size: 1.02rem; }
.card-head .icon-bubble { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary-strong); }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid > *, .stack > * { min-width: 0; }
@media (min-width: 720px) { .grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); } .grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); } }
@media (min-width: 1100px) { .grid.home { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 650; cursor: pointer;
  transition: transform .06s, background .15s, border-color .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .875rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.icon { width: 42px; padding: 0; }
.btn.icon.small { width: 34px; }
.btn[disabled] { opacity: .55; cursor: default; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--bottom-nav) + 18px + env(safe-area-inset-bottom)); z-index: 25;
  width: 58px; height: 58px; border-radius: 18px; border: none; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-lg); cursor: pointer;
}
.fab:hover { text-decoration: none; background: var(--primary-strong); }
@media (min-width: 960px) { .fab { display: none; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-weight: 650; font-size: .9rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.input.big { font-size: 1.05rem; font-weight: 650; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.hint { font-size: .85rem; color: var(--muted); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .15s; cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { left: 21px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; cursor: pointer; user-select: none;
}
.chip input { display: none; }
.chip:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.tag.primary { background: var(--primary-soft); color: var(--primary-strong); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }

.avatar {
  --c: var(--accent);
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: .8rem; font-weight: 800; letter-spacing: .02em;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--c); border: 2px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.avatar.lg { width: 52px; height: 52px; font-size: 1.05rem; }
.avatar.sm { width: 28px; height: 28px; font-size: .68rem; border-width: 1.5px; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar:first-child { margin-left: 0; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.list-item:last-child { border-bottom: none; }
a.list-item:hover { text-decoration: none; background: var(--surface-2); border-radius: 12px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title, .list-item .meta { display: block; }
.list-item .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .i { width: 44px; height: 44px; stroke-width: 1.6; color: var(--primary); opacity: .8; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--danger-soft); color: var(--danger); }

.banner-important {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--warn-soft), var(--primary-soft)); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}
.banner-important .i { color: var(--warn); }
.banner-important:hover { text-decoration: none; }

/* Dialoge */
dialog {
  border: none; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(20, 12, 16, .45); backdrop-filter: blur(3px); }
.dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: calc(100vh - 32px); }
.dialog-head { display: flex; align-items: center; gap: 10px; }
.dialog-head h2 { flex: 1; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Alarm */
.alarm-dialog .dialog-body { align-items: center; text-align: center; padding: 30px 24px; }
.alarm-ring { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); animation: ring 1.1s ease-in-out infinite; }
.alarm-ring .i { width: 42px; height: 42px; }
.alarm-time { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-8deg); } 60% { transform: rotate(4deg); } }

.toast-area { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-nav) + 18px); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 960px) { .toast-area { bottom: 24px; } }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .2s ease-out; pointer-events: auto; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent),
  radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent) 18%, transparent), transparent), var(--bg); }
.auth-card { width: min(440px, 100%); }
.auth-card .brand { justify-content: center; font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .brand .logo { width: 46px; height: 46px; border-radius: 15px; }
.auth-tagline { text-align: center; color: var(--muted); margin-bottom: 22px; }
.feature-row { display: flex; justify-content: center; gap: 18px; color: var(--muted); margin-top: 18px; flex-wrap: wrap; }
.feature-row span { display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; font-weight: 600; }

/* ---------- Start ---------- */
.hello { margin: 2px 0 18px; }
.hello h1 { font-size: 1.75rem; }
.hello .date { color: var(--muted); font-weight: 600; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat .num { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat .lbl { font-size: .8rem; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.stat.hot { background: var(--primary-soft); border-color: transparent; }
.stat.hot .num { color: var(--primary-strong); }

.event-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.event-row:last-child { border-bottom: none; }
.event-row:hover { text-decoration: none; }
.event-bar { width: 4px; border-radius: 4px; background: var(--c, var(--accent)); flex: none; }
.event-when { width: 92px; flex: none; font-size: .85rem; font-weight: 700; color: var(--muted); }
.event-what { flex: 1; min-width: 0; }
.event-what .title { font-weight: 650; }

/* ---------- Kalender ---------- */
.cal-layout { display: grid; gap: 16px; }
@media (min-width: 1000px) { .cal-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 28%); align-items: start; } }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { flex: 1; font-size: 1.25rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-day {
  min-height: 54px; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 3px;
  color: var(--text); background: var(--surface-2); border: 2px solid transparent; overflow: hidden;
}
.cal-day:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.cal-day.out { opacity: .45; }
.cal-day .num { font-size: .85rem; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .num { background: var(--primary); color: var(--primary-ink); }
.cal-day.selected { border-color: var(--primary); background: var(--surface); }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); }
.cal-ev { display: none; }
@media (min-width: 760px) {
  .cal-day { min-height: 104px; }
  .cal-dots { display: none; }
  .cal-ev { display: block; font-size: .72rem; font-weight: 650; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: color-mix(in srgb, var(--c, var(--accent)) 75%, var(--text)); }
  .cal-more { font-size: .7rem; color: var(--muted); font-weight: 700; padding-left: 4px; }
}

/* ---------- Chat ---------- */
.chat-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
/* Zweigeteilt wie WhatsApp: links die Chats mit letzter Nachricht, rechts der geöffnete Chat (am Handy nacheinander) */
.wa { display: flex; height: calc(100vh - 56px - var(--bottom-nav) - env(safe-area-inset-bottom)); margin: -16px -16px 0; background: var(--surface); overflow: hidden; }
@media (min-width: 960px) { .wa { height: calc(100vh - 76px); margin: -28px -36px 0; } }
.wa-side { display: flex; flex-direction: column; width: 100%; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.wa-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wa-empty-pane { display: none; align-items: center; justify-content: center; background: var(--bg); }
@media (min-width: 820px) {
  .wa-side { width: 360px; flex: none; }
  .wa-empty-pane { display: flex; }
}
@media (max-width: 819px) {
  .wa-open .wa-side { display: none; }
  .wa-closed .wa-main { display: none; }
}
@media (min-width: 820px) { .wa-back { display: none; } }
.wa-side-head { padding: 14px 16px 6px; }
.wa-side-head h1 { font-size: 1.3rem; }
.wa-search { display: flex; align-items: center; gap: 8px; margin: 6px 12px 8px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.wa-search input { flex: 1; min-width: 0; border: none; background: transparent; padding: 10px 0; color: var(--text); font: inherit; outline: none; }
.wa-chats { flex: 1; overflow-y: auto; min-height: 0; }
.wa-chat { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--text); border-bottom: 1px solid var(--line); }
.wa-chat:hover { text-decoration: none; background: var(--surface-2); }
.wa-chat.active { background: var(--surface-2); }
.wa-chat .avatar { width: 48px; height: 48px; flex: none; font-size: 1rem; }
.wa-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-title { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-time { flex: none; font-size: .75rem; color: var(--muted); }
.wa-chat.unread .wa-time { color: #1fa855; font-weight: 700; }
.wa-preview { flex: 1; min-width: 0; font-size: .9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat.unread .wa-preview { color: var(--text); font-weight: 600; }
.wa-badge { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: #25d366; color: #fff; font-size: .75rem; font-weight: 800; }
.wa-new-title { padding: 14px 16px 6px; font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.wa-new { max-height: 34%; overflow-y: auto; border-top: 1px solid var(--line); }
.wa-none { padding: 20px; text-align: center; color: var(--muted); }
/* Sprachnachricht */
.voice { display: flex; align-items: center; gap: 10px; min-width: min(250px, 62vw); padding: 2px 0; }
.voice-play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: none; display: grid; place-items: center; background: color-mix(in srgb, currentColor 14%, transparent); color: inherit; cursor: pointer; }
.voice-body { flex: 1; min-width: 0; }
.voice-bar { position: relative; height: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 25%, transparent); cursor: pointer; margin: 14px 0 12px; }
.voice-bar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: currentColor; }
.voice-bar > b { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: currentColor; }
.voice-time { font-size: .72rem; opacity: .75; }
.voice > .i { flex: none; opacity: .6; }
/* Aufnahme */
.rec-bar { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.rec-bar.hidden { display: none; }
.rec-cancel { color: #d33; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e53935; animation: rec-pulse 1s infinite; }
@keyframes rec-pulse { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 1.05rem; min-width: 3ch; }
.rec-wave { flex: 1; min-width: 0; height: 28px; }
.composer.recording > :not(.rec-bar) { display: none !important; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-head .grow { flex: 1; min-width: 0; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; background:
  radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 40%), var(--bg); }
.day-sep { align-self: center; margin: 12px 0 6px; font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 3px 12px; border-radius: 999px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: min(78%, 620px); }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 8px 12px 6px; border-radius: 18px 18px 18px 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 1px rgba(0,0,0,.04); min-width: 64px; }
.msg.mine .bubble { border-radius: 18px 18px 6px 18px; background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.msg .sender { font-size: .75rem; font-weight: 750; margin-bottom: 2px; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .text a { color: inherit; text-decoration: underline; }
.msg .time { font-size: .68rem; opacity: .7; text-align: right; margin-top: 2px; }
.msg .photo { display: block; max-width: 280px; max-height: 320px; border-radius: 12px; margin: 2px 0 4px; cursor: zoom-in; }
.msg.deleted .bubble { font-style: italic; opacity: .7; }
.msg .del { opacity: 0; border: none; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.msg:hover .del { opacity: 1; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; border-radius: 22px; padding: 11px 16px; }
.composer .btn.icon { border-radius: 50%; width: 44px; height: 44px; min-height: 44px; }
.load-older { align-self: center; }
.chat-item .preview { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.unread .title { font-weight: 800; }
.chat-item.unread .preview { color: var(--text); font-weight: 600; }

/* ---------- Einkauf ---------- */
.list-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.list-tab { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 650; color: var(--text); display: inline-flex; gap: 8px; align-items: center; }
.list-tab:hover { text-decoration: none; }
.list-tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.list-tab .count { font-size: .75rem; opacity: .75; }
.quick-add { display: flex; gap: 8px; }
.quick-add .input:first-child { flex: 1; }
.quick-add .qty { width: 110px; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item .box { padding: 0; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; cursor: pointer; flex: none; background: var(--surface); color: transparent; transition: all .15s; }
.item.done .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.item .name { flex: 1; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.item.done .name { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.item .qty { font-size: .85rem; color: var(--muted); font-weight: 650; }
.item .by { font-size: .75rem; color: var(--muted); }

/* ---------- Notizen ---------- */
.notes { columns: 1; column-gap: 14px; }
@media (min-width: 640px) { .notes { columns: 2; } }
@media (min-width: 1100px) { .notes { columns: 3; } }
.note { break-inside: avoid; margin-bottom: 14px; cursor: pointer; transition: transform .1s; }
.note:hover { transform: translateY(-2px); }
.note .text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); max-height: 260px; overflow: hidden; }
.note.c-yellow { background: color-mix(in srgb, #fcc419 18%, var(--surface)); }
.note.c-green { background: color-mix(in srgb, #20c997 16%, var(--surface)); }
.note.c-blue { background: color-mix(in srgb, #339af0 16%, var(--surface)); }
.note.c-pink { background: color-mix(in srgb, #f06595 16%, var(--surface)); }
.note.c-purple { background: color-mix(in srgb, #9775fa 18%, var(--surface)); }
.swatches { display: flex; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; display: grid; place-items: center; }
.swatch input { display: none; }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--primary); }

/* ---------- Fundstücke ---------- */
.feed { display: grid; gap: 16px; }
@media (min-width: 900px) { .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.share-media { position: relative; border-radius: 14px; overflow: hidden; background: #000; margin: 10px 0; }
.share-media.portrait { aspect-ratio: 9 / 16; max-height: 640px; margin-inline: auto; max-width: 380px; }
.share-media.landscape { aspect-ratio: 16 / 9; }
.share-media iframe { width: 100%; height: 100%; border: 0; display: block; }
.share-media .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.share-media .play { position: absolute; inset: 0; display: grid; place-items: center; border: none; background: linear-gradient(transparent, rgba(0,0,0,.35)); cursor: pointer; color: #fff; }
.share-media .play span { width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.92); color: #111; display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.share-link { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); color: var(--text); margin: 10px 0; overflow: hidden; }
.share-link:hover { text-decoration: none; }
.share-link .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--muted); }
.platform { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; color: #fff; background: #555; }
.platform.TIKTOK { background: #111; }
.platform.INSTAGRAM { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.platform.YOUTUBE { background: #e02020; }
.platform.FACEBOOK { background: #1877f2; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.reaction { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: .95rem; display: inline-flex; gap: 5px; align-items: center; }
.reaction.mine { background: var(--primary-soft); border-color: var(--primary); }
.reaction .n { font-size: .78rem; font-weight: 750; }

/* ---------- Mitteilungen ---------- */
.announcement.important { border-left: 5px solid var(--warn); }
.ack-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); }

/* Mehr-Menü (Handy) */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tiles > a.tile { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 700; }
.tiles > a.tile:hover { text-decoration: none; border-color: var(--primary); }
.tiles > a.tile .i { color: var(--primary-strong); width: 28px; height: 28px; }

.invite-code { font-size: 2rem; font-weight: 800; letter-spacing: .18em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--primary-strong); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

/* ---------- Erweiterungen: Profilbilder, Startseite mit Karten, Einkauf, Video ---------- */
.avatar.has-img { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }
.avatar.xl { width: 84px; height: 84px; font-size: 1.6rem; border-width: 3px; }

/* Startseite: Kartenraster */
.hello .btn { align-self: flex-start; }
.tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
/* Mauerwerk: jede Kachel behält ihre Höhe, die Zeilen sind fein (4px) und die Kacheln belegen mehrere davon;
   „dense“ füllt Lücken (z. B. unter einer kurzen Kachel) mit der nächsten passenden Kachel. */
.tiles-grid.masonry { grid-auto-rows: 4px; row-gap: 0; column-gap: 16px; grid-auto-flow: row dense; }
.tiles-grid.masonry > .tile-ph { align-self: start; }
.tile { position: relative; min-width: 0; touch-action: manipulation; transition: box-shadow .15s, transform .15s, opacity .15s; }
.tile.pressing { transform: scale(.985); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile.dragging { box-shadow: var(--shadow-lg); transform: scale(1.025) rotate(.5deg); opacity: .97; cursor: grabbing; user-select: none; -webkit-user-select: none; }
.tile-ph { border: 2px dashed var(--primary); border-radius: var(--radius); background: var(--primary-soft); opacity: .55; }
.tile.is-hidden { display: none; }
.tiles-grid.editing .tile.is-hidden { display: block; opacity: .5; }
.tiles-grid.editing .tile { cursor: grab; }
.tile-tools { display: none; align-items: center; gap: 6px; margin: -4px -4px 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.tiles-grid.editing .tile-tools { display: flex; }
.edit-bar { margin-bottom: 16px; }
body.dragging-tile { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.news-icon { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.news-icon.unread { background: var(--primary-soft); color: var(--primary-strong); }
.card-head .btn { flex: none; }

/* Einkauf: Anzahl mit +/- */
.stepper { display: inline-flex; align-items: center; gap: 2px; flex: none; background: var(--surface-2); border-radius: 12px; padding: 2px; }
.stepper .btn.icon.small { width: 30px; min-height: 30px; font-size: 1.15rem; font-weight: 700; line-height: 1; border: none; background: transparent; padding: 0; }
.stepper .btn.icon.small:hover { background: var(--surface-3); }
.stepper .amount { min-width: 26px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.item .name { display: block; }
.quick-add .qty { width: 96px; }

/* Fundstücke: heruntergeladenes Video, Status */
.share-media video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.video-status { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: .85rem; margin: 6px 0; }
.video-status.failed { background: var(--danger-soft); color: var(--danger); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Listen und Karten nutzen die volle Breite */
.card { min-width: 0; }
.feed { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .feed { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.qr-box { width: min(100%, 320px); margin: 0 auto; background: #fff; padding: 8px; border-radius: 14px; border: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 650; }
.facts dd { margin: 0; }

/* Sticker aus der App: ohne Sprechblase, animiert */
.msg.sticker-msg .bubble { background: transparent !important; box-shadow: none; padding: 0; }
.msg .sticker { width: 140px; height: 140px; object-fit: contain; display: block; }
.msg video.photo { max-width: 100%; border-radius: 12px; background: #000; display: block; }

/* ---------- Momente ---------- */
.moment-form { margin-bottom: 16px; }
.moments-grid, .shop-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.moments-grid > .moment { margin: 0; }
.count-pill { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); font-size: .8rem; font-weight: 800; }
.moment-form textarea { min-height: 84px; }
.moment { margin-bottom: 14px; }
.moment-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; }
.moment-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 10px; }
.moment-media .media-item { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2, #f4ecea); }
.moment-media .media-item img, .moment-media .media-item video { width: 100%; height: 100%; max-height: 360px; object-fit: cover; display: block; }
.moment-media .media-item.AUDIO, .moment-media .media-item.PDF { grid-column: 1 / -1; background: transparent; }
.moment-media .media-item.AUDIO audio { width: 100%; }
.moment-media .media-item form { position: absolute; top: 6px; right: 6px; }
.list-item .thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }

/* ---------- Video-Links im Chat ---------- */
.msg.link-msg .bubble { max-width: min(380px, 80vw); }
.link-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; font-size: .85rem; }
.link-head .link-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ---------- Verwaltung (MielkyPlayer) ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 650; }
.stat .value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.stat .hint { color: var(--muted); font-size: .78rem; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.chart .bar { flex: 1; min-width: 4px; background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent))); border-radius: 5px 5px 2px 2px; position: relative; }
.chart .bar.zero { background: var(--surface-3); }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: 6px; }
.dist { display: flex; flex-direction: column; gap: 8px; }
.dist-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 48px; align-items: center; gap: 10px; font-size: .9rem; }
.dist-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.dist-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.dist-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data .actions { text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.pill-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pill-tag.on { background: var(--ok-soft); color: var(--ok); }
.pill-tag.off { background: var(--surface-2); color: var(--muted); }
.pill-tag.bad { background: var(--danger-soft); color: var(--danger); }
.pill-tag.info { background: var(--primary-soft); color: var(--primary-strong); }
.key-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.key-row .key-box { flex: 1 1 260px; }
.key-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: .04em; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-strong); text-align: center; user-select: all; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; cursor: pointer; }
.switch input { width: 40px; height: 22px; accent-color: var(--primary); }
@media (min-width: 960px) { .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Anteile direkt in der Funktionsliste */
.share-form { display: flex; gap: 6px; align-items: end; flex-wrap: wrap; margin: 0; }
.share-form label { display: flex; flex-direction: column; gap: 2px; }
.tiny-input { width: 72px; padding: 6px 8px; }
.form-grid.three { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Laufende Version (Seitenleiste, Anmeldung, auf dem Handy unter dem Inhalt) */
.app-version { margin: 14px 0 0; text-align: center; font-size: .78rem; color: var(--muted); }
.sidebar .app-version { margin: 10px 0 0; padding: 0 10px; text-align: left; }
@media (min-width: 960px) { .app-version.mobile-only { display: none; } }

/* Anmeldung, Zwei-Faktor, Nutzer und Sicherung */
@media (min-width: 900px) { .grid.two-cols { grid-template-columns: 1fr 1fr; } }
.qr { width: min(240px, 100%); margin: 4px auto; padding: 10px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-size: 1.05rem; letter-spacing: .06em; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); word-break: break-all; user-select: all; margin: 0; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 14px 18px; margin: 14px 0; list-style: none;
  border-radius: var(--radius-sm); background: var(--surface-2); font-size: 1.02rem; user-select: all; }
table.data tr.warn td { background: var(--warn-soft); }
.backup { padding: 12px 0; border-bottom: 1px solid var(--line); }
.backup:last-child { border-bottom: 0; }
.backup-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.backup-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.backup-head strong { word-break: break-all; }
.backup details > summary { list-style: none; display: inline-flex; margin-top: 6px; }
.backup details > summary::-webkit-details-marker { display: none; }
