/* WhatsUp – minimalistisches Design. Hell/Dunkel folgt Windows. */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #8e8e93;
  --line: #ececec;
  --soft: #f4f4f5;
  --accent: #1a8cff;
  --on-accent: #ffffff;
  --danger: #e5484d;
  --online: #30a46c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10;
    --fg: #ededed;
    --muted: #7c7c84;
    --line: #1f1f23;
    --soft: #1a1a1d;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e10;
  --fg: #ededed;
  --muted: #7c7c84;
  --line: #1f1f23;
  --soft: #1a1a1d;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 13.5px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  display: flex; flex-direction: column; overflow: hidden; user-select: none;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.muted { color: var(--muted); font-size: 12.5px; }
.label { color: var(--muted); font-size: 11.5px; }

/* Icon-Buttons */
.ic {
  -webkit-app-region: no-drag;
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: var(--muted); flex-shrink: 0;
}
.ic:hover, .ic.active { color: var(--fg); background: var(--soft); }
.ic svg, .send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.close:hover { background: var(--danger); color: #fff; }

/* Titelleiste */
.titlebar {
  -webkit-app-region: drag;
  height: 40px; display: flex; align-items: center; gap: 2px; padding: 0 6px 0 10px; flex-shrink: 0;
}
.title { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-logo { width: 16px; height: 16px; border-radius: 4px; }
#backBtn { margin-left: -6px; }
#backBtn:not(.hidden) + .title .tb-logo { display: none; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.dot.on { background: var(--online); }

.view { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }

/* Formulare */
input {
  width: 100%; min-width: 0; background: var(--soft); color: var(--fg);
  border: 0; border-radius: 10px; padding: 9px 12px; font: inherit; outline: none; user-select: text;
}
textarea {
  width: 100%; min-width: 0; background: var(--soft); color: var(--fg); resize: none;
  border: 0; border-radius: 10px; padding: 9px 12px; font: inherit; outline: none; user-select: text;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus { box-shadow: 0 0 0 1.5px var(--accent) inset; }
.row.center { justify-content: center; }
button.primary { background: var(--fg); color: var(--bg); border-radius: 10px; padding: 9px 16px; font-weight: 600; }
button.primary:hover { opacity: .85; }
button.ghost, .link { color: var(--accent); font-weight: 500; text-decoration: none; cursor: pointer; }
button.ghost:hover, .link:hover { opacity: .75; }
.muted-link { color: var(--muted); }
button.danger { color: var(--danger); font-weight: 500; margin-right: auto; }
.small { font-size: 12px; }
.row { display: flex; gap: 16px; align-items: center; }

/* Avatare */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; position: relative;
  display: inline-grid; place-items: center; font-weight: 600; font-size: 14px; color: #fff;
}
.avatar.initial { background: var(--soft); color: var(--fg); }
/* Profilrahmen: 1,5x so groß wie der Avatar, mittig darüber */
.avatar .frame { position: absolute; left: -25%; top: -25%; width: 150%; height: 150%; z-index: 1; pointer-events: none; color: color-mix(in srgb, var(--fg) 80%, transparent); }
.avatar .frame svg { width: 100%; height: 100%; display: block; overflow: visible; }
.avatar .dot { z-index: 2; }
.avatar.md { width: 44px; height: 44px; font-size: 16px; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.avatar .dot { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; box-shadow: 0 0 0 2px var(--bg); background: transparent; }
.avatar .dot.on { background: var(--online); }
.avatar.sq { border-radius: 12px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.xl { width: 84px; height: 84px; font-size: 30px; }
.avatar.xl .dot { width: 14px; height: 14px; right: 4px; bottom: 4px; box-shadow: 0 0 0 3px var(--bg); }
.avatar.sq.xl { border-radius: 24px; }

/* Setup */
.setup { margin: auto; width: 100%; max-width: 260px; padding: 24px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.setup .logo { width: 64px; height: 64px; align-self: center; border-radius: 16px; }
.setup h1 { margin: 4px 0 12px; font-size: 18px; font-weight: 600; }
.setup p { margin: 0; line-height: 1.45; }
.setup .status { margin: 0; line-height: 1.45; }
.setup button.ghost { font-size: 12.5px; }
.setup button:disabled, .setup input:disabled { opacity: .45; cursor: default; }
#loginCode, #loginVerify { text-align: center; font-family: Consolas, monospace; letter-spacing: 3px; text-transform: uppercase; }

/* Anmeldung auf neuem Gerät: Bestätigungscode auf dem alten Gerät */
.login-code { margin: 6px 0 10px; text-align: center; font-family: Consolas, monospace; font-size: 30px; font-weight: 600; letter-spacing: 6px; user-select: text; }

/* Liste */
.me { display: flex; align-items: center; gap: 4px; padding: 6px 10px 10px 14px; }
.me-main { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.me-main:hover .fname { color: var(--accent); }
.me-info { display: flex; flex-direction: column; min-width: 0; }
.code-sm { font-family: Consolas, monospace; letter-spacing: 1.5px; color: var(--fg); user-select: text; }
.code { font: 600 18px Consolas, monospace; letter-spacing: 3px; color: var(--fg); user-select: text; }
.add { display: flex; gap: 6px; align-items: center; margin: 0 14px; }
.add input { letter-spacing: 1px; }
.add input:not(:placeholder-shown) { text-transform: uppercase; letter-spacing: 3px; font-family: Consolas, monospace; }
.status { margin: 4px 16px 0; min-height: 17px; font-size: 11.5px; color: var(--muted); }
.status.err { color: var(--danger); }
.listhead { display: flex; justify-content: space-between; align-items: center; margin: 6px 16px 4px; font-size: 11.5px; color: var(--muted); }
.listhead .link { font-size: 11.5px; }
.list { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; flex: 1; }
.list li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; cursor: pointer; }
.list li:hover { background: var(--soft); }
.fmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flast { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }
.empty { color: var(--muted); text-align: center; padding: 40px 20px; font-size: 12.5px; }

/* Chat */
.chathead { display: flex; align-items: center; gap: 10px; padding: 4px 14px 10px; text-align: left; width: 100%; border-bottom: 1px solid var(--line); }
.chathead .avatar { width: 32px; height: 32px; font-size: 12px; }
.chathead:hover .fname { color: var(--accent); }
.messages { flex: 1; overflow-y: auto; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 3px; }
.msg { max-width: 78%; padding: 7px 11px; border-radius: 16px; word-wrap: break-word; white-space: pre-wrap; user-select: text; }
.msg.them { background: var(--soft); align-self: flex-start; }
.msg.me { background: var(--accent); color: var(--on-accent); align-self: flex-end; }
.msg.big { background: none; font-size: 34px; line-height: 1.15; padding: 0; }
.msg.big .meta { color: var(--muted); }
.msg.has-media { padding: 3px; background: none; }
.msg.has-media .text { padding: 5px 8px 0; color: var(--fg); }
.msg .meta { font-size: 10px; opacity: .6; text-align: right; margin-top: 1px; }
.msg.has-media .meta { color: var(--muted); opacity: 1; padding: 0 6px; }
.media { display: block; max-width: 100%; border-radius: 14px; cursor: zoom-in; background: var(--soft); }
.sender { font-size: 11px; font-weight: 600; margin: 8px 0 1px 11px; }
.day, .sys { align-self: center; color: var(--muted); font-size: 11px; margin: 10px 0 6px; text-align: center; }
.sys { margin: 4px 0; }

/* Antworten, Reaktionen, Löschen */
.msg { transition: box-shadow .3s, transform .15s; }
.msg.menu-on { transform: scale(1.02); box-shadow: 0 0 0 2px var(--accent); }
.msg.flash { animation: msg-flash 1.2s ease; }
@keyframes msg-flash { 0%, 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.msg.deleted { background: none !important; border: 1px dashed var(--line); color: var(--muted); font-style: italic; }
.msg.deleted .meta { color: var(--muted); }
.quote { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--fg) 7%, transparent); border-radius: 8px; padding: 4px 8px; margin: 1px 0 5px; cursor: pointer; white-space: normal; min-width: 0; }
.msg.me .quote { background: color-mix(in srgb, #000 16%, transparent); border-color: var(--on-accent); }
.msg.has-media .quote, .msg.sticker .quote, .msg.has-voice .quote { color: var(--fg); background: var(--soft); }
.quote-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-text { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 -2px; }
.msg.me .reacts { justify-content: flex-end; }
/* Eigene Nachrichten sind (über .me) ein Flex-Container: Zitat und Reaktionen in eigene Zeilen */
.msg.me.has-quote, .msg.me.has-reacts { flex-wrap: wrap; align-items: flex-end; column-gap: 8px; }
.msg.me .quote, .msg.me .reacts { flex-basis: 100%; }
.msg.me.has-quote .text { flex: 1; }
.react-chip { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 1px 7px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.react-chip.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.react-chip:hover { filter: brightness(.96); }
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 10px -2px; padding: 6px 6px 6px 10px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 10px; }
.reply-bar-body { flex: 1; min-width: 0; }
.reply-bar .quote-name { color: var(--accent); }
.msg-menu-back { position: fixed; inset: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 35%, transparent); }
.msg-menu { position: fixed; min-width: 220px; max-width: calc(100vw - 16px); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 6px; display: flex; flex-direction: column; animation: menu-in .12s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: scale(.96); } }
.react-bar { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.react-pick { font-size: 22px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: transform .1s; }
.react-pick:hover { background: var(--soft); transform: scale(1.15); }
.react-pick.active { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.react-plus { font-size: 18px; color: var(--muted); }
.react-grid { display: grid; grid-template-columns: repeat(7, 36px); gap: 2px; max-height: 240px; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; text-align: left; cursor: pointer; color: var(--fg); }
button.menu-item.danger { color: var(--danger); margin-right: 0; }
.menu-item:hover { background: var(--soft); }
.menu-ic { width: 20px; text-align: center; }
.menu-title { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; }
/* Handy: langes Drücken soll das Menü öffnen, nicht Text markieren */
@media (pointer: coarse) {
  .msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .menu-item { padding: 12px 10px; font-size: 15px; }
}
.composer { display: flex; gap: 2px; align-items: center; padding: 8px 8px 10px; }
.composer input { flex: 1; margin: 0 4px; border-radius: 18px; padding: 8px 14px; }
.send { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex-shrink: 0; }
.send svg { width: 16px; height: 16px; stroke-width: 2.2; }
.send:hover { opacity: .85; }
.drop-hint { position: absolute; inset: 0; background: var(--bg); opacity: .95; display: grid; place-items: center; color: var(--muted); pointer-events: none; }

/* Emojis */
.emoji-panel { height: 200px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.emoji-tabs { display: flex; gap: 2px; padding: 6px 8px 2px; }
.emoji-tab { font-size: 16px; padding: 3px 6px; border-radius: 8px; opacity: .4; filter: grayscale(1); }
.emoji-tab:hover, .emoji-tab.active { opacity: 1; filter: none; background: var(--soft); }
.emoji-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); padding: 4px 8px; align-content: start; }
.emoji { font-size: 21px; height: 36px; border-radius: 8px; }
.emoji:hover { background: var(--soft); }

/* Einstellungen */
.settings { overflow-y: auto; padding: 0 18px 24px; display: flex; flex-direction: column; gap: 10px; }
.settings h2 { font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 18px 0 2px; }
.settings h2:first-child { margin-top: 6px; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head .avatar.xl { width: 64px; height: 64px; font-size: 24px; }
.profile-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; margin-top: 4px; }
.frame-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 2px 8px; border-radius: 12px; }
.frame-opt:hover { background: var(--soft); }
.frame-opt.active { background: var(--soft); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.frame-name { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.frame-opt.active .frame-name { color: var(--fg); font-weight: 600; }
.profile-head { padding: 14px 0 4px 16px; gap: 30px !important; }
.list { padding-top: 6px; }
.list li { gap: 14px; padding-left: 10px; }
.me-main { padding-left: 4px; gap: 16px !important; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; cursor: default; }
label.setting { cursor: pointer; }
.setting.disabled { opacity: .4; pointer-events: none; }
.danger-link { color: var(--danger) !important; }
.clear-row { border-top: 1px solid var(--line); padding-top: 10px; }
.storage-list li { gap: 10px; }
.row-end { display: flex; align-items: center; gap: 4px; }
.small-ic { width: 26px; height: 26px; }
.small-ic svg { width: 15px; height: 15px; }
.primary.full { width: 100%; }
button.primary:disabled { opacity: .35; cursor: default; }
.segmented { display: flex; background: var(--soft); border-radius: 10px; padding: 3px; }
.segmented button { flex: 1; padding: 6px 0; border-radius: 8px; color: var(--muted); font-size: 12.5px; }
.segmented button.active { background: var(--bg); color: var(--fg); font-weight: 600; }
.switch {
  appearance: none; -webkit-appearance: none; width: 34px; height: 20px; padding: 0; margin: 0; flex-shrink: 0;
  border-radius: 10px; background: var(--line); position: relative; cursor: pointer; transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px #0003;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(14px); }
.switch:focus { box-shadow: none; }
.update-box { display: flex; flex-direction: column; gap: 8px; }
.update-box .muted:empty { display: none; }
.update-box .bar { flex: none; }
.update-box .bar > div { background: var(--accent); }
.update-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
#settingsBtn { position: relative; }

/* Erfolge */
.ach-summary { display: flex; align-items: center; gap: 12px; padding: 4px 16px 12px; font-size: 12px; color: var(--muted); }
.bar { flex: 1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar > div { height: 100%; background: var(--fg); border-radius: 2px; transition: width .4s; }
.bar.small { flex: none; margin-top: 6px; height: 2px; }
.ach-list { list-style: none; margin: 0; padding: 0 8px 10px; overflow-y: auto; flex: 1; }
.ach-list li { display: flex; gap: 12px; align-items: center; padding: 9px 8px; }
.ach-icon { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.ach-list li:not(.got) .ach-icon { filter: grayscale(1); opacity: .3; }
.ach-list li:not(.got) .fname { color: var(--muted); font-weight: 500; }
.progress { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
/* Seltenste Erfolge im Profil */
.rare-ach { display: flex; flex-direction: column; gap: 2px; }
.rare-ach-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px; }
.rare-list { padding: 0; overflow: visible; flex: none; }
.rare-list li { padding: 7px 4px; }
.rare-count { font-size: 11px; color: var(--accent); margin-top: 2px; }
.rare-more { align-self: center; background: none; border: 0; font-size: 12.5px; padding: 4px 8px; }

/* Modal */
.modal { position: fixed; inset: 40px 0 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-box { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 18px; width: 100%; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-box h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-actions { display: flex; gap: 18px; justify-content: flex-end; align-items: center; margin-top: 4px; }
.modal-actions .primary { padding: 7px 14px; }
.modal-actions .ghost { color: var(--muted); }
.info-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.info-head h3 { margin-top: 6px; }
.info-head .row { width: 100%; gap: 8px; margin-top: 6px; }
.pill { color: var(--muted); font-size: 12px; }
.checklist, .members { list-style: none; margin: 0; padding: 0; max-height: 170px; overflow-y: auto; }
.checklist label, .members li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.checklist label:hover { background: var(--soft); }
.checklist input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.members li { cursor: default; }

/* Bildbetrachter */
.viewer { position: fixed; inset: 40px 0 0; background: var(--bg); z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 12px; }
.viewer img { max-width: 100%; max-height: calc(100% - 50px); border-radius: 12px; object-fit: contain; }
.viewer-actions { display: flex; gap: 24px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 30;
  background: var(--fg); color: var(--bg); padding: 7px 14px; border-radius: 18px; font-size: 12px; font-weight: 500;
  max-width: calc(100% - 32px); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: pop .2s ease-out;
}
@keyframes pop { from { transform: translate(-50%, 6px); opacity: 0; } }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ================= Leiste unten (Status · Chats · Du) ================= */
.tabbar {
  flex-shrink: 0; display: flex; justify-content: space-around; align-items: center;
  padding: 6px 10px 8px; border-top: 1px solid var(--line); background: var(--bg);
}
.tab {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0 3px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 500;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); background: var(--soft); font-weight: 600; }
.tab-ic { position: relative; width: 26px; height: 26px; display: grid; place-items: center; }
.tab-ic svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab.active .tab-ic svg { stroke-width: 2; }
.tab-ic .avatar { width: 24px; height: 24px; font-size: 10px; }
.tab.active .tab-ic .avatar { box-shadow: 0 0 0 1.5px var(--fg); }
.tab-dot { position: absolute; top: 0; right: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 2px var(--bg); z-index: 3; }
#updateDot.tab-dot { background: var(--accent); }
.tab-badge {
  position: absolute; top: -3px; left: 15px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ================= Status-Liste ================= */
:root { --st-seen: color-mix(in srgb, var(--muted) 55%, transparent); }
.st-list { padding-top: 4px; }
.st-list .listhead { margin: 12px 10px 4px; cursor: default; padding: 0; display: block; }
.st-list .listhead:hover { background: none; }
.st-ring { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.st-ring .avatar { width: 44px; height: 44px; box-shadow: 0 0 0 2px var(--bg); }
.st-ring.none .avatar { box-shadow: none; }
.st-add {
  position: absolute; right: -1px; bottom: -1px; width: 20px; height: 20px; border-radius: 50%; z-index: 3;
  background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}
.st-add svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.st-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 30px 24px !important; cursor: default !important; line-height: 1.5; display: block !important; }
.st-empty:hover { background: none !important; }

/* ================= Status: Vollbild (Erstellen + Ansehen) ================= */
.st-overlay {
  position: fixed; inset: 0; z-index: 40; background: #000; color: #fff;
  display: flex; flex-direction: column; user-select: none;
}
.st-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .08); flex-shrink: 0;
}
.st-btn:hover { background: rgba(255, 255, 255, .18); }
.st-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.st-btn.small { width: 28px; height: 28px; }

/* Erstellen */
.st-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.st-top-title { flex: 1; font-weight: 600; text-align: center; }
.st-stage { flex: 1; min-height: 0; position: relative; margin: 0 12px; }
.st-stage img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; border-radius: 10px; }
.st-thumbs { display: flex; gap: 6px; padding: 10px 12px 0; overflow-x: auto; }
.st-thumb {
  position: relative; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  opacity: .55; outline: 2px solid transparent; outline-offset: -2px; cursor: pointer; background: #222;
}
.st-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-thumb.active { opacity: 1; outline-color: #fff; }
.st-thumb.more { display: grid; place-items: center; opacity: 1; background: rgba(255, 255, 255, .1); color: #fff; }
.st-thumb.more svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.st-caption-row { display: flex; gap: 8px; align-items: center; padding: 10px 12px 14px; }
.st-caption-row input { background: rgba(255, 255, 255, .1); color: #fff; border-radius: 20px; padding: 10px 14px; }
.st-caption-row input::placeholder { color: rgba(255, 255, 255, .55); }
.st-caption-row input:focus { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .5) inset; }
.st-share { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.st-share svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(90deg); }

/* Ansehen: jede Person ist eine Karte, die beim Wechseln seitlich reinrutscht */
.st-cards { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.st-card { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; }
.st-card.in-next { animation: stInNext .32s cubic-bezier(.2, .8, .2, 1); }
.st-card.in-prev { animation: stInPrev .32s cubic-bezier(.2, .8, .2, 1); }
.st-card.out-next { animation: stOutNext .32s cubic-bezier(.2, .8, .2, 1) forwards; }
.st-card.out-prev { animation: stOutPrev .32s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes stInNext { from { transform: translateX(100%) scale(.96); } }
@keyframes stInPrev { from { transform: translateX(-100%) scale(.96); } }
@keyframes stOutNext { to { transform: translateX(-35%) scale(.92); opacity: .3; } }
@keyframes stOutPrev { to { transform: translateX(35%) scale(.92); opacity: .3; } }
.st-overlay.closing { animation: stClose .2s ease-in forwards; }
.st-overlay.opening { animation: stOpen .22s ease-out; }
@keyframes stOpen { from { opacity: 0; transform: scale(.94); } }
@keyframes stClose { to { opacity: 0; transform: scale(.94); } }

.st-bars { display: flex; gap: 3px; padding: 10px 10px 0; position: relative; z-index: 2; }
.st-bar { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 0; background: #fff; }
.st-bar.done i { width: 100%; }
.st-bar.run i { animation: stFill linear forwards; }
.st-viewer.paused .st-bar.run i { animation-play-state: paused; }
@keyframes stFill { to { width: 100%; } }
.st-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px; position: relative; z-index: 2; }
.st-head .avatar { width: 34px; height: 34px; font-size: 13px; }
.st-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-who span { font-size: 11.5px; color: rgba(255, 255, 255, .7); }
.st-img-wrap { flex: 1; min-height: 0; position: relative; }
.st-img-wrap img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; }
.st-zones { position: absolute; inset: 0; display: flex; z-index: 1; }
.st-zones div { flex: 1; cursor: pointer; }
.st-zones div:first-child { flex: .5; }
.st-text {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  padding: 40px 18px 14px; text-align: center; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}
.st-react { display: flex; justify-content: center; gap: 4px; padding: 10px 10px 14px; flex-wrap: wrap; }
.st-react button {
  width: 40px; height: 40px; border-radius: 50%; font-size: 22px; line-height: 1;
  display: grid; place-items: center; transition: transform .12s, background .12s;
}
.st-react button:hover { background: rgba(255, 255, 255, .12); transform: scale(1.12); }
.st-react button.picked { background: rgba(255, 255, 255, .22); }
.st-own { display: flex; justify-content: center; padding: 10px 10px 14px; }
.st-views { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 20px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 13px; }
.st-views svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.st-burst { position: absolute; left: 50%; bottom: 70px; font-size: 64px; z-index: 5; pointer-events: none; animation: stBurst .9s ease-out forwards; }
@keyframes stBurst { 0% { transform: translate(-50%, 20px) scale(.4); opacity: 0; } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { transform: translate(-50%, -140px) scale(1); opacity: 0; } }
.st-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 60%;
  background: #18181b; border-radius: 16px 16px 0 0; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px;
  animation: stSheet .2s ease-out;
}
@keyframes stSheet { from { transform: translateY(100%); } }
.st-sheet-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.st-sheet-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.st-sheet-list li { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.st-sheet-list .avatar { width: 32px; height: 32px; font-size: 12px; }
.st-sheet-list .fname { flex: 1; color: #fff; }
.st-sheet-list .emo { font-size: 20px; }
.st-sheet-list .muted { color: rgba(255, 255, 255, .55); }

/* ================= Anrufe ================= */
.chatbar { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding-right: 8px; }
.chatbar .chathead { border-bottom: 0; flex: 1; min-width: 0; }
.call-btns { display: flex; gap: 2px; padding-bottom: 6px; }
.call-btns .ic svg { width: 19px; height: 19px; }

.call {
  position: fixed; inset: 0; z-index: 50; background: #0b0b0d; color: #fff;
  display: flex; flex-direction: column; overflow: hidden; user-select: none;
}
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0b0b0d; display: none; }
.call.has-video .call-remote { display: block; }
.call-info {
  position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 20px; text-align: center; transition: opacity .2s;
}
.call-info .avatar { width: 112px; height: 112px; font-size: 40px; margin-bottom: 10px; }
.call-info b { font-size: 20px; font-weight: 600; }
#callState { color: rgba(255, 255, 255, .7); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.call.ringing-in .call-info .avatar { animation: callPulse 1.6s ease-out infinite; }
@keyframes callPulse { 0% { box-shadow: 0 0 0 0 rgba(48, 164, 108, .55); } 100% { box-shadow: 0 0 0 26px rgba(48, 164, 108, 0); } }
/* Im Videoanruf: Name klein oben statt großem Bild */
.call.has-video .call-info { flex: 0; justify-content: flex-start; padding-top: 16px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.call.has-video .call-info .avatar { display: none; }
.call.has-video .call-info b { font-size: 16px; }

/* Eigenes Bild klein in der Ecke, verschiebbar */
.call-local {
  position: absolute; z-index: 4; top: 14px; right: 14px; width: 104px; aspect-ratio: 3 / 4;
  border-radius: 14px; overflow: hidden; background: #222; box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  cursor: grab; touch-action: none; transition: box-shadow .15s;
}
.call-local:active { cursor: grabbing; }
.call-local video { width: 100%; height: 100%; object-fit: cover; display: block; }
.call-local.mirror video, .call.swapped .call-remote.mirror { transform: scaleX(-1); }
.call-local.cam-off video { visibility: hidden; }
.call-local.cam-off::after { content: 'Kamera aus'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: rgba(255, 255, 255, .7); }

.call-controls {
  position: relative; z-index: 5; display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: auto;
  padding: 18px 16px 26px; background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}
.call-btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); transition: background .15s, transform .1s;
}
.call-btn:hover { background: rgba(255, 255, 255, .24); }
.call-btn:active { transform: scale(.94); }
.call-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.call-btn.off { background: #fff; color: #111; }
.call-btn.end { background: var(--danger); }
.call-btn.end svg { transform: rotate(135deg); }
.call-btn.accept { background: var(--online); }
.call-btn.big { width: 64px; height: 64px; position: relative; }
.call-btn.big span { position: absolute; top: 72px; font-size: 12px; color: rgba(255, 255, 255, .8); white-space: nowrap; }
.call-controls.incoming { gap: 72px; padding-bottom: 48px; }
.call-btn.accept svg { animation: callShake 1.2s ease-in-out infinite; }
@keyframes callShake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }
.call.audio #callFlip, .call.audio #callCam { display: none; }
.call.no-flip #callFlip { display: none; }
.call.opening { animation: stOpen .22s ease-out; }

/* ================= Sprachnachrichten ================= */
/* Wie bei WhatsApp: leeres Feld = Mikrofon, mit Text = Senden */
.composer { position: relative; }
.composer:not(.has-text) #sendBtn { display: none; }
.composer.has-text #micBtn { display: none; }
.send.mic svg { width: 17px; height: 17px; stroke-width: 2; }
.recbar {
  position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 10px 6px; background: var(--bg);
}
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex-shrink: 0; animation: recBlink 1s ease-in-out infinite; }
@keyframes recBlink { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 34px; }
.rec-wave { flex: 1; min-width: 0; height: 28px; }

.msg.has-voice { padding: 6px 10px 5px 6px; min-width: 210px; }
.voice { display: flex; align-items: center; gap: 8px; }
.vplay {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.vplay svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.vbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vwave { display: flex; align-items: center; gap: 2px; height: 26px; cursor: pointer; }
.vwave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: .35; }
.vwave i.on { opacity: 1; }
.vinfo { display: flex; justify-content: space-between; font-size: 10.5px; opacity: .75; font-variant-numeric: tabular-nums; }
.vspeed {
  flex-shrink: 0; min-width: 34px; height: 22px; border-radius: 11px; font-size: 11px; font-weight: 600;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.msg.me .vplay, .msg.me .vspeed { color: var(--on-accent); }

/* ================= Sticker ================= */
.msg.sticker { background: none !important; padding: 0; }
.msg.sticker .meta { color: var(--muted); opacity: 1; }
/* Als Hintergrundbild statt <img>: kein „Bild sichern“, kein Kopieren, kein Ziehen */
.stk {
  width: 140px; height: 140px; background: center / contain no-repeat;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; pointer-events: none;
}
.emoji-grid.sticker-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; padding: 6px 8px; }
.stk-tile {
  aspect-ratio: 1; border-radius: 10px; background: center / 86% no-repeat; position: relative;
  -webkit-touch-callout: none; user-select: none;
}
.stk-tile:hover { background-color: var(--soft); }
.stk-tile.add { display: grid; place-items: center; border: 1.5px dashed var(--line); color: var(--muted); font-size: 12px; text-align: center; line-height: 1.3; }
.stk-tile.add:hover { color: var(--fg); border-color: var(--muted); }
.stk-modal { z-index: 45; }
.stk-box { max-width: 340px; align-items: stretch; }
.stk-canvas {
  width: 100%; aspect-ratio: 1; border-radius: 12px; cursor: grab; touch-action: none;
  background: repeating-conic-gradient(var(--soft) 0 25%, var(--bg) 0 50%) 0 0 / 20px 20px;
}
.stk-canvas:active { cursor: grabbing; }
.stk-zoom { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.stk-zoom input { flex: 1; padding: 0; background: none; accent-color: var(--accent); }
.stk-zoom input:focus { box-shadow: none; }

/* Streaks */
.fire { margin-left: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ================= Codes einlösen, exklusive Rahmen & Banner ================= */
.redeem { display: flex; gap: 6px; margin: 0 14px; }
.redeem input { text-transform: uppercase; letter-spacing: 1px; }
.redeem input:placeholder-shown { text-transform: none; letter-spacing: 0; }
.redeem .primary { flex-shrink: 0; padding: 8px 14px; }
.redeem-msg { margin: 6px 16px 4px; }
.redeem-msg.ok { color: var(--online); }
.frame-opt.locked { opacity: .45; }
.frame-opt.locked .frame-name::before { content: '🔒 '; }
.frame-opt.exclusive:not(.locked) .frame-name::before { content: '✨ '; }
.banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.banner-opt {
  height: 44px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  display: grid; place-items: center; padding: 0 4px; text-align: center; line-height: 1.2;
}
.banner-opt.none { background: var(--soft); color: var(--muted); text-shadow: none; }
.banner-opt.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.banner-opt.locked { opacity: .4; }
.banner-opt.locked::before { content: '🔒 '; }
/* Status als Banner: im Profil-Fenster und im Chat-Kopf */
.banner {
  width: 100%; border-radius: 14px; padding: 14px 16px; color: #fff; font-weight: 700; font-size: 15px; text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45); word-break: break-word; box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
.banner-pill {
  display: inline-block; padding: 1px 8px; border-radius: 8px; color: #fff; font-weight: 600; font-size: 11px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4); vertical-align: 1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.info-head { padding-top: 10px; }

/* Videos: Aufnahme (Kamera drehen geht auch während der Aufnahme) */
.vidrec { position: fixed; inset: 40px 0 0; z-index: 25; background: #000; color: #fff; display: flex; flex-direction: column; }
.vidrec-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.vid-src { position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.vid-canvas, .vid-preview { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.vid-canvas.mirror { transform: scaleX(-1); }
.vid-preview { width: 100%; height: 100%; background: #000; }
.vidrec-loading { position: absolute; color: #bbb; font-size: 13px; display: none; }
.vidrec.loading .vidrec-loading { display: block; }
.vidrec.loading .vid-canvas { visibility: hidden; }
.vidrec-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.vidrec-time { display: flex; align-items: center; gap: 7px; font-size: 14px; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .35); padding: 4px 10px; border-radius: 14px; }
.vidrec .rec-dot { display: none; }
.vidrec[data-mode="rec"] .rec-dot { display: block; }
.vidrec-prog { height: 3px; background: rgba(255, 255, 255, .15); }
.vidrec-prog > div { height: 100%; width: 0; background: var(--danger); transition: width .2s linear; }
.vidrec-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); gap: 12px; }
.vidrec-bar > :first-child { justify-self: start; }
.vid-ic { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vid-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vid-ic:hover { background: rgba(255, 255, 255, .24); }
.vid-ic-space { width: 44px; }
.vid-shutter { width: 70px; height: 70px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; cursor: pointer; background: none; }
.vid-shutter span { width: 54px; height: 54px; border-radius: 50%; background: var(--danger); transition: all .2s; }
.vidrec[data-mode="rec"] .vid-shutter span { width: 26px; height: 26px; border-radius: 6px; }
.vid-pill { color: #fff; background: rgba(255, 255, 255, .14); border-radius: 18px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
.vid-send { width: 52px; height: 52px; }
.vid-send svg { width: 22px; height: 22px; }
/* Was in welchem Schritt zu sehen ist */
.vidrec .vid-preview, .vidrec #vidRetake, .vidrec .vid-send { display: none; }
.vidrec[data-mode="done"] .vid-canvas, .vidrec[data-mode="done"] .vid-shutter, .vidrec[data-mode="done"] #vidFlip { display: none; }
.vidrec[data-mode="done"] .vid-preview, .vidrec[data-mode="done"] #vidRetake, .vidrec[data-mode="done"] .vid-send { display: grid; }
.vidrec[data-mode="done"] .vid-preview { display: block; }
.vidrec[data-mode="done"] .vidrec-bar > .vid-ic-space { display: none; }
.vidrec[data-mode="done"] .vidrec-bar { grid-template-columns: 1fr auto; }
.vidrec[data-mode="done"] .vid-send { justify-self: end; }

/* Videos im Chat */
.vid { position: relative; border-radius: 14px; overflow: hidden; background: #111; cursor: pointer; max-width: 100%; }
.vid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; }
.vid-play svg { width: 20px; height: 20px; fill: currentColor; stroke: none; margin-left: 3px; }
.vid-dur { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 11px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.vid:hover .vid-play { background: rgba(0, 0, 0, .65); }
.vid-full { max-width: 100%; max-height: calc(100% - 50px); border-radius: 12px; background: #000; }

/* ================= UpReels ================= */
#viewReels { background: #000; color: #fff; }
.reel-top { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #000; z-index: 2; }
.reel-title { flex: 1; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-top-btn { color: #fff; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.reel-top-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reel-pill { background: rgba(255, 255, 255, .14); border-radius: 16px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.reel-pill:hover { background: rgba(255, 255, 255, .24); }
.primary-pill { background: var(--accent); color: var(--on-accent); }
.primary-pill:hover { background: var(--accent); filter: brightness(1.1); }
.reel-feed { flex: 1; min-height: 0; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.reel-feed::-webkit-scrollbar { display: none; }
.reel { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; background: #000; overflow: hidden; }
.reel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.reel-empty { position: absolute; inset: 60px 24px auto; text-align: center; color: #bbb; font-size: 14px; line-height: 1.5; }
.reel-info { position: absolute; left: 0; right: 64px; bottom: 0; padding: 40px 12px 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); pointer-events: none; }
.reel-info > * { pointer-events: auto; }
.reel-who { display: inline-flex; align-items: center; gap: 7px; color: #fff; cursor: pointer; text-align: left; max-width: 100%; }
.reel-who .avatar { width: 30px; height: 30px; font-size: 11px; flex-shrink: 0; }
.reel-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.reel-ago { font-size: 12px; opacity: .75; white-space: nowrap; }
.reel-caption { margin-top: 6px; font-size: 13.5px; line-height: 1.35; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); white-space: pre-wrap; word-wrap: break-word; }
.reel-side { position: absolute; right: 6px; bottom: 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.reel-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; color: #fff; cursor: pointer; min-width: 48px; }
.reel-btn-ic { font-size: 27px; line-height: 1.1; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); transition: transform .15s; }
.reel-btn:active .reel-btn-ic { transform: scale(.85); }
.reel-btn.like.on .reel-btn-ic { animation: like-pop .35s ease; }
@keyframes like-pop { 50% { transform: scale(1.3); } }
.reel-btn-n { font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.reel-btn.more .reel-btn-ic { font-size: 24px; font-weight: 700; }
.reel-mute { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .4); color: #fff; font-size: 15px; display: grid; place-items: center; cursor: pointer; }
.reel-heart { position: absolute; inset: 0; margin: auto; width: 110px; height: 110px; font-size: 90px; display: grid; place-items: center; opacity: 0; pointer-events: none; }
.reel-heart.pop { animation: heart-pop .8s ease; }
@keyframes heart-pop { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.15); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
.reel-paused { position: absolute; inset: 0; margin: auto; width: 70px; height: 70px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 28px; display: none; place-items: center; pointer-events: none; padding-left: 5px; }
.reel.paused .reel-paused { display: grid; }
/* Blatt von unten: Kommentare, Aufrufe, Mehr */
.reel-sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; }
.reel-sheet { width: 100%; max-height: 70%; background: var(--bg); color: var(--fg); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); animation: sheet-in .2s ease-out; }
@keyframes sheet-in { from { transform: translateY(40%); opacity: .4; } }
.reel-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.reel-sheet-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.reel-comments { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; min-height: 80px; }
.reel-comments .center { text-align: center; padding: 18px 0; }
.reel-comment { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; }
.reel-comment .avatar { width: 30px; height: 30px; font-size: 11px; flex-shrink: 0; }
.reel-comment-body { flex: 1; min-width: 0; font-size: 13px; }
.reel-comment-head { font-size: 12.5px; }
.reel-comment-text { margin-top: 1px; white-space: pre-wrap; word-wrap: break-word; }
.reel-comment-del { opacity: .5; }
.reel-comment-del:hover { opacity: 1; }
.reel-comment-form { display: flex; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }
.reel-comment-form input { flex: 1; border-radius: 18px; padding: 8px 14px; }
/* Profil: kleine Vorschaubilder */
.reel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.reel-thumb { aspect-ratio: 9 / 14; border-radius: 8px; background: #222 center / cover no-repeat; position: relative; cursor: pointer; }
.reel-thumb span { position: absolute; left: 5px; bottom: 4px; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
/* Aufnahme als UpReel: Beschreibung und Hochladen */
.vid-caption { display: none; margin: 10px 12px 0; border-radius: 18px; padding: 9px 14px; background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .18); }
.vid-caption::placeholder { color: rgba(255, 255, 255, .55); }
.vidrec[data-target="reel"][data-mode="done"] .vid-caption { display: block; }
.vid-upload { margin: 10px 12px 0; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, .12); position: relative; overflow: hidden; }
.vid-upload > div { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width .2s; }
.vid-upload span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 22px; }

/* ================= UpReels: Musik ================= */
.vid-music { display: none; position: absolute; top: 58px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); z-index: 2;
  background: rgba(0, 0, 0, .5); color: #fff; border: 1px solid rgba(255, 255, 255, .25); border-radius: 18px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.vid-music.on { background: rgba(26, 140, 255, .85); border-color: transparent; }
.vid-music:disabled { opacity: .5; }
.vidrec[data-target="reel"]:not([data-mode="rec"]) .vid-music { display: block; }
.vid-mix { display: none; margin: 10px 12px 0; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .1); }
.vidrec[data-target="reel"][data-mode="done"] .vid-mix { display: block; }
.vid-mix-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 3px 0; color: #fff; }
.vid-mix-row span { width: 78px; flex-shrink: 0; }
.vid-mix-row input { flex: 1; accent-color: var(--accent); }
.vid-mix-row.off { opacity: .4; }
.reel-sound { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; max-width: 100%; color: #fff; font-size: 12.5px; cursor: pointer;
  background: rgba(0, 0, 0, .35); border-radius: 14px; padding: 4px 10px 4px 8px; }
.reel-sound.plain { cursor: default; opacity: .8; }
.reel-sound-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-sound-ic { animation: snd-spin 3s linear infinite; display: inline-block; }
.reel-sound.plain .reel-sound-ic { animation: none; }
@keyframes snd-spin { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
/* Auswahl-Blatt (über der Aufnahme) */
.mus-back { z-index: 45; }
.mus-sheet { max-height: 80%; }
.mus-title { flex: 1; margin: 0 6px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mus-cats { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; flex-shrink: 0; }
.mus-cats::-webkit-scrollbar { display: none; }
.mus-cat { flex-shrink: 0; border-radius: 16px; padding: 6px 12px; background: var(--soft); color: var(--fg); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.mus-cat.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.mus-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 120px; }
.mus-item { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 10px; cursor: pointer; }
.mus-item:hover { background: var(--soft); }
.mus-item.cur .mus-name { color: var(--accent); }
.mus-play { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--fg); display: grid; place-items: center; flex-shrink: 0; font-size: 13px; cursor: pointer; }
.mus-play.on { background: var(--accent); color: var(--on-accent); }
.mus-play.big { width: 46px; height: 46px; font-size: 16px; }
.mus-meta { flex: 1; min-width: 0; }
.mus-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mus-use { border-radius: 14px; padding: 6px 12px; background: var(--soft); color: var(--accent); font-weight: 600; font-size: 12.5px; cursor: pointer; flex-shrink: 0; }
.mus-cut { padding: 8px 4px 4px; display: flex; flex-direction: column; gap: 8px; }
.mus-cut-label { font-weight: 600; font-size: 14px; }
.mus-bar { position: relative; height: 34px; border-radius: 8px; overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--line) 0 3px, transparent 3px 6px), var(--soft); }
.mus-win { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 35%, transparent); border: 2px solid var(--accent); border-radius: 8px; }
.mus-range { width: 100%; accent-color: var(--accent); }
.mus-cut-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.mus-ok, .snd-use { margin: 10px 4px 2px; padding: 11px; border-radius: 22px; font-weight: 600; }
.mus-credit { font-size: 10.5px; color: var(--muted); text-align: center; padding: 8px 4px 2px; line-height: 1.4; }
.snd-head { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.snd-count { margin: 12px 4px 6px; }
.reel-sheet .reel-grid { overflow-y: auto; max-height: 40vh; }
.music-credit-row span { font-size: 11px; line-height: 1.4; }

/* ================= UpReels hell (wie der Rest der App) ================= */
#viewReels { background: var(--bg); color: var(--fg); }
.reel-top { background: var(--bg); }
.reel-top-btn { color: var(--fg); }
.reel-pill:not(.primary-pill) { background: var(--soft); color: var(--fg); }
.reel-pill:not(.primary-pill):hover { background: var(--line); }
.reel { background: var(--bg); }
/* Hochkant-Videos füllen den ganzen Bereich (keine Ränder), Querformat passt komplett hinein */
.reel-video { background: var(--bg); object-fit: cover; }
.reel.landscape .reel-video { object-fit: contain; }
.reel-empty { color: var(--muted); }
/* Knöpfe rechts mit dunklem Hintergrund, damit sie auf jedem Bild lesbar sind */
.reel-side { right: 8px; gap: 10px; }
.reel-btn { background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 24px; width: 50px; min-width: 0; padding: 6px 0 5px; }
.reel-btn.more { padding: 4px 0 6px; }
.reel-btn-ic { font-size: 24px; }
/* Musik-Knopf mit ✕ zum Entfernen */
.vid-music-wrap { display: none; position: absolute; top: 58px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); z-index: 2; align-items: center; gap: 6px; }
.vidrec[data-target="reel"]:not([data-mode="rec"]) .vid-music-wrap { display: flex; }
.vid-music-wrap .vid-music { display: block !important; position: static; transform: none; max-width: 100%; min-width: 0; }
.vid-music-x { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer; border: 1px solid rgba(255, 255, 255, .25); }
.vid-music-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.vid-music-x.hidden { display: none !important; }
/* Schrift auf dem Video: immer weiß mit Schatten (lesbar auf hellen und dunklen Videos) */
.reel-info { color: #fff; padding-top: 60px; background: linear-gradient(transparent, rgba(0, 0, 0, .25) 35%, rgba(0, 0, 0, .7)); }
.reel-name, .reel-ago, .reel-caption, .reel-sound-t { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .8), 0 0 8px rgba(0, 0, 0, .45); }
.reel-ago { opacity: .85; }
/* Querformat: Ränder mit unscharfem, abgedunkeltem Vorschaubild statt Weiß */
.reel.landscape { background: #111; }
.reel.landscape::before { content: ''; position: absolute; inset: -40px; background: var(--poster, none) center / cover no-repeat; filter: blur(28px) brightness(.55) saturate(1.2); transform: scale(1.1); }
.reel.landscape .reel-video { background: transparent; }
.reel.landscape .reel-info { background: linear-gradient(transparent, rgba(0, 0, 0, .35)); }
.reel.landscape .reel-btn { background: rgba(255, 255, 255, .14); }
/* Verlauf über die ganze Breite (keine Kante neben den Knöpfen), Text weicht den Knöpfen aus */
.reel-info { right: 0; padding-right: 72px; }

/* Einstellungen: „Personalisieren“ zum Ausklappen */
.personalize { border: 1px solid var(--line); border-radius: 14px; margin: 4px 0 8px; background: var(--bg); overflow: hidden; }
.personalize summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; user-select: none; }
.personalize summary::-webkit-details-marker { display: none; }
.personalize summary:hover { background: var(--soft); }
.pers-ic { font-size: 20px; width: 28px; text-align: center; }
.pers-title { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.pers-sub { font-weight: 400; font-size: 11.5px; }
.pers-arrow { font-size: 20px; color: var(--muted); transition: transform .2s; }
.personalize[open] .pers-arrow { transform: rotate(90deg); }
.pers-body { padding: 4px 12px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }

/* ================= UpReels: Galerie (Video kürzen, Fotos/Slideshow) ================= */
.vid-gallery svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.vidrec:not([data-target="reel"]) .vid-gallery, .vidrec[data-mode="rec"] .vid-gallery { visibility: hidden; }
.vidrec[data-mode="done"] .vid-gallery { display: none; }
/* Ohne Kamera: nur Galerie */
.vidrec-nocam { display: none; position: absolute; top: 40%; left: 24px; right: 24px; text-align: center; font-size: 16px; font-weight: 600; line-height: 1.5; }
.vidrec-nocam span { font-size: 13px; font-weight: 400; opacity: .75; }
.vidrec.nocam .vidrec-nocam { display: block; }
.vidrec.nocam .vid-canvas, .vidrec.nocam .vid-shutter, .vidrec.nocam #vidFlip { visibility: hidden; }
.vidrec.nocam .vid-gallery { background: var(--accent); width: 56px; height: 56px; animation: gal-pulse 1.6s ease-in-out infinite; }
@keyframes gal-pulse { 50% { box-shadow: 0 0 0 8px rgba(26, 140, 255, .25); } }
/* Fotos: Vorschau ist die Zeichenfläche, nicht das Video */
.vidrec[data-src="photos"][data-mode="done"] .vid-canvas { display: block; }
.vidrec[data-src="photos"][data-mode="done"] .vid-preview { display: none; }
.vidrec[data-src="photos"] #vidMixVoiceRow { display: none; }
/* Bearbeiten-Felder */
.vid-edit { display: none; margin: 10px 12px 0; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .1); color: #fff; }
.vidrec[data-src="video"][data-mode="done"] .vid-trim { display: block; }
.vidrec[data-src="photos"][data-mode="done"] .vid-slides { display: block; }
.vid-edit-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.vid-trim-bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .18); margin: 2px 0 6px; }
.vid-trim-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.personalize { flex-shrink: 0; } /* .settings ist ein Flex-Container: nicht zusammendrücken */
.vid-caption { width: calc(100% - 24px); box-sizing: border-box; }
.vidrec.nocam .vid-shutter span { visibility: hidden; transition: none; }

/* ================= Foto-Beiträge: Karussell zum Wischen (wie TikTok) ================= */
.pc { position: absolute; inset: 0; overflow: hidden; background: #111; }
.pc-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.pc-track::-webkit-scrollbar { display: none; }
.pc-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.pc-bg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(30px) brightness(.55) saturate(1.15); transform: scale(1.1); }
.pc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.pc-count { position: absolute; top: 12px; right: 54px; padding: 3px 10px; border-radius: 12px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12.5px; font-weight: 600; z-index: 2; pointer-events: none; }
.pc-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; z-index: 2; pointer-events: none; }
.pc-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: background .2s, transform .2s; }
.pc-dots i.on { background: #fff; transform: scale(1.15); }
.pc-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, .4); color: #fff; font-size: 24px; line-height: 1; display: grid; place-items: center; z-index: 2; cursor: pointer; opacity: 0; transition: opacity .2s; }
.pc-nav.prev { left: 10px; } .pc-nav.next { right: 10px; }
.pc:hover .pc-nav:not(.off) { opacity: 1; }
.pc-nav.off { pointer-events: none; }
@media (pointer: coarse) { .pc-nav { display: none; } }
/* Im Feed: Platz für die Infos unten und die Knöpfe rechts */
.reel.photo .pc-dots { bottom: auto; top: 16px; }
.reel.photo .pc-nav.next { right: 70px; }
.reel.photo { background: #111; }
/* Vorschau beim Posten */
.vid-photos { display: none; position: absolute; inset: 0; }
.vidrec[data-src="photos"][data-mode="done"] .vid-photos { display: block; }
.vidrec[data-src="photos"][data-mode="done"] .vid-canvas, .vidrec[data-src="photos"] .vid-preview { display: none !important; }
.vid-photos .pc-count { right: 12px; top: 110px; }

/* ================= Gelesen-Häkchen und Nachrichteninfo ================= */
.msg .tick { white-space: nowrap; }
.msg .tick.read { color: #8ff0ff; font-weight: 700; opacity: 1; }
.msg.big .tick.read, .msg.has-media .tick.read, .msg.sticker .tick.read, .msg.deleted .tick.read { color: var(--accent); }
.info-msg { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; word-wrap: break-word; }
.info-msg .muted { margin-top: 4px; font-size: 11.5px; }
.info-sec { display: flex; flex-direction: column; gap: 2px; }
.info-list { max-height: 200px; }
.info-list li { cursor: default; }
.info-list .avatar { width: 32px; height: 32px; font-size: 12px; }
.info-none { padding: 2px 4px 6px; }

/* ================= Admin ================= */
.admin-section { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.admin-stat { background: var(--soft); border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.admin-stat b { font-size: 20px; }
.admin-stat span { font-size: 11px; }
.admin-search { border-radius: 18px; padding: 8px 14px; }
.admin-list { max-height: 50vh; }
.admin-list .avatar { width: 34px; height: 34px; font-size: 12px; }
/* Gelesen-Häkchen auf der blauen Blase gut sichtbar (die Zeile selbst nicht mehr halb durchsichtig) */
.msg.me .meta { opacity: 1; color: rgba(255, 255, 255, .72); }
.msg.me .tick.read { color: #7df9ff; text-shadow: 0 0 1px rgba(0, 0, 0, .25); }
.msg.me.big .meta, .msg.me.has-media .meta, .msg.me.sticker .meta, .msg.me.deleted .meta { color: var(--muted); }
.msg.me.big .tick.read, .msg.me.has-media .tick.read, .msg.me.sticker .tick.read { color: var(--accent); text-shadow: none; }

/* Gruppenchat: Profilbild + Name über den Nachrichten, antippen öffnet das Profil */
button.sender { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 10px 0 2px 2px; padding: 2px 8px 2px 2px; border-radius: 14px; cursor: pointer; text-align: left; }
button.sender:hover { background: var(--soft); }
.sender .avatar.sender-av { width: 22px; height: 22px; font-size: 9px; flex-shrink: 0; }
.sender .avatar.sender-av .frame { display: none; } /* Rahmen ist bei der kleinen Größe zu unruhig */
.sender-name { font-size: 11.5px; font-weight: 600; }

/* ================= Umfragen ================= */
.msg.has-poll { min-width: 240px; max-width: 86%; }
.poll { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 4px; white-space: normal; }
.poll-q { font-weight: 700; font-size: 14.5px; }
.poll-hint { font-size: 11.5px; opacity: .75; margin-top: -3px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; overflow: hidden; text-align: left; cursor: pointer;
  background: color-mix(in srgb, currentColor 10%, transparent); color: inherit; font-size: 13.5px; }
.poll-opt:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: color-mix(in srgb, currentColor 18%, transparent); transition: width .35s ease; }
.poll-bar.top { background: color-mix(in srgb, currentColor 28%, transparent); }
.poll-check { position: relative; width: 18px; height: 18px; flex-shrink: 0; border: 2px solid currentColor; display: grid; place-items: center; font-size: 11px; font-weight: 800; opacity: .8; }
.poll-check.single { border-radius: 50%; }
.poll-check.multi { border-radius: 5px; }
.poll-opt.on .poll-check { background: currentColor; opacity: 1; }
.poll-opt.on .poll-check { color: inherit; }
.msg.me .poll-opt.on .poll-check { color: var(--on-accent); }
.poll-opt.on .poll-check::after { content: '✓'; position: absolute; color: var(--bg); }
.msg.me .poll-opt.on .poll-check::after { color: var(--accent); }
.poll-opt.on .poll-check { font-size: 0; }
.poll-text { position: relative; flex: 1; min-width: 0; word-wrap: break-word; }
.poll-n { position: relative; font-size: 11.5px; font-weight: 600; opacity: .85; white-space: nowrap; }
.poll-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; opacity: .85; padding-top: 2px; }
.poll-who { color: inherit; text-decoration: underline; font-size: 11.5px; cursor: pointer; }
.poll-in { width: 100%; box-sizing: border-box; }
.poll-in-list { display: flex; flex-direction: column; gap: 6px; }
.poll-in-row { display: flex; gap: 6px; align-items: center; }
.poll-more { align-self: flex-start; }
#pollBtn svg { stroke-width: 2.2; }
.msg.me.has-poll { flex-wrap: wrap; }
.msg.me.has-poll .poll { flex-basis: 100%; }
.msg.me.has-poll .meta { margin-left: auto; }

/* ================= Erfolge · Rangliste · Challenges ================= */
.ach-tabs { margin: 4px 14px 10px; flex-shrink: 0; }
.ach-tabs button { font-size: 12.5px; }
#viewAchievements[data-tab="lb"] > .ach-summary, #viewAchievements[data-tab="lb"] > .redeem, #viewAchievements[data-tab="lb"] > .redeem-msg, #viewAchievements[data-tab="lb"] > .ach-list,
#viewAchievements[data-tab="chall"] > .ach-summary, #viewAchievements[data-tab="chall"] > .redeem, #viewAchievements[data-tab="chall"] > .redeem-msg, #viewAchievements[data-tab="chall"] > .ach-list { display: none; }
.ach-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.setting-sub { display: block; font-size: 11px; margin-top: 2px; }
/* Rangliste */
.lb-types { flex-shrink: 0; }
.lb-types button { font-size: 12px; }
.lb-scope { display: flex; gap: 6px; flex-shrink: 0; }
.lb-scope button { border-radius: 14px; padding: 5px 12px; background: var(--soft); font-size: 12.5px; cursor: pointer; }
.lb-scope button.active { background: var(--fg); color: var(--bg); font-weight: 600; }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.lb-row:hover { background: var(--soft); }
.lb-row.me { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lb-row .avatar { width: 36px; height: 36px; font-size: 13px; flex-shrink: 0; }
.lb-rank { width: 32px; text-align: center; font-weight: 700; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.lb-rank.medal { font-size: 22px; }
.lb-val { font-weight: 700; font-size: 13px; white-space: nowrap; }
.lb-me { border-top: 1px solid var(--line); padding-top: 6px; }
.lb-hint { font-size: 12px; color: var(--muted); padding: 6px; }
.lb-list .center { text-align: center; padding: 18px 0; }
/* Challenges */
.chall-top { display: flex; flex-direction: column; gap: 2px; padding: 2px 4px; }
.chall-week { font-size: 12px; color: var(--muted); }
.chall-total { font-weight: 700; font-size: 15px; }
.chall-list { display: flex; flex-direction: column; gap: 8px; }
.chall-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.chall-card.done { border-color: color-mix(in srgb, var(--online) 55%, transparent); background: color-mix(in srgb, var(--online) 8%, var(--bg)); }
.chall-ic { font-size: 26px; width: 34px; text-align: center; flex-shrink: 0; }
.chall-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chall-title { font-weight: 700; font-size: 14px; }
.chall-desc { font-size: 12px; color: var(--muted); }
.chall-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.chall-bar > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.chall-card.done .chall-bar > div { background: var(--online); }
.chall-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.chall-actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.chall-go { padding: 7px 14px; border-radius: 18px; font-size: 13px; }
.chall-rewards { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.chall-reward { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; opacity: .65; }
.chall-reward.got { opacity: 1; }
.chall-reward .avatar { width: 40px; height: 40px; font-size: 14px; flex-shrink: 0; }
.chall-reward .banner-pill { flex-shrink: 0; max-width: 110px; }
.chall-lock { font-size: 16px; }
.chall-admin { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.chall-admin-btns { display: flex; gap: 16px; flex-wrap: wrap; }

/* Gruppen-Info: Mitglieder antippbar, „Mitglieder hinzufügen“ als eigener Knopf */
.members-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.members-add { font-size: 12.5px; font-weight: 600; }
.member-row { cursor: pointer; }
.member-row:hover { background: var(--soft); }
.member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-tag { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 1px 6px; white-space: nowrap; }
.member-go { color: var(--muted); font-size: 18px; padding: 0 2px; }

/* ================= Gruppen-Info groß (ganzes Fenster, nur die Seite scrollt) ================= */
.modal.modal-big { place-items: stretch; padding: 10px; }
.modal-box.modal-big { height: 100%; max-height: 100%; box-sizing: border-box; gap: 14px; }
.members.members-full { max-height: none; overflow: visible; }
.members-full .member-row { padding: 8px 6px; gap: 12px; border-radius: 12px; }
.members-full .member-row .avatar { width: 42px; height: 42px; font-size: 15px; }
.members-full .member-name { font-size: 15px; }
.modal-big .members-head .label { font-size: 13px; font-weight: 600; color: var(--fg); }
/* Unten, klein: Chatverlauf leeren, Gruppe verlassen */
.group-extra { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.group-extra .clear-row { font-size: 12.5px; color: var(--muted); padding: 8px 4px; border: 0; }
.group-extra .clear-row .danger-link { font-size: 12.5px; }
.group-leave { color: var(--danger); font-size: 12.5px; text-align: left; padding: 8px 4px; cursor: pointer; }
.group-leave:hover { text-decoration: underline; }
/* Speichern/Schließen bleibt unten sichtbar */
.modal-box.modal-big .sticky-actions { position: sticky; bottom: -18px; margin: auto -18px -18px; padding: 12px 18px; background: var(--bg); border-top: 1px solid var(--line); z-index: 2; }
