/* Seite: Einzelchat (chat_messages_page.dart, chat/chat_message_widgets.dart).
   Ganze Höhe: Kopf oben, Nachrichten dazwischen, Eingabe unten. Bubbles wie die App:
   eigene im Sunset-Verlauf (deckend gemischt), fremde dunkel, Radius 16. Ohne Linien. */

/* Auf dem Handy braucht der Chat die volle Höhe (die App blendet die Leiste auch aus). */
html.cv-chat-open .main { padding-bottom: 0; }
@media (max-width: 767px) {
  html.cv-chat-open .tabbar { display: none; }
}

.page--chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

/* ---------- Kopf ---------- */
.chat-head {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  min-height: 62px;
  padding: max(8px, env(safe-area-inset-top)) 10px 6px 4px;
  background: var(--bg);
}
.chat-head__who {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  border-radius: 14px;
  text-align: left;
  color: var(--text);
}
@media (hover: hover) and (pointer: fine) {
  button.chat-head__who:hover { background: var(--line-soft); }
}
.chat-head__avatar { display: grid; flex: none; }
.chat-head__sk { width: 40px; height: 40px; }
.chat-head__text { display: grid; gap: 2px; min-width: 0; }
.chat-head__title {
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-head__sub {
  min-height: 15px;
  font-size: 12.5px;
  line-height: 1.2;
  color: var(--text-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-head__sub:empty { display: none; }

/* ---------- Nachrichtenbereich (unten verankert) ---------- */
.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column-reverse;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.chat-msgs {
  display: flex;
  flex-direction: column;
  padding: 6px 10px 10px;
}
.chat-sentinel { height: 1px; }
.chat-older { display: flex; justify-content: center; padding: 10px 0; }
.chat-older[hidden] { display: none; }
.chat-spinner {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: .8;
  animation: chat-spin .8s linear infinite;
}
@keyframes chat-spin { to { transform: rotate(360deg); } }
.chat-loading { display: grid; gap: 10px; padding-top: 24px; }
.chat-loading[hidden] { display: none; }
.chat-sk-bubble { border-radius: 16px; }
.chat-empty { padding: 48px 24px; text-align: center; }
.chat-empty[hidden] { display: none; }
.chat-empty__title { font-size: 17px; font-weight: 800; }
.chat-empty__text { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.chat-gone { padding-top: 24px; }

/* Datumstrenner und Systemzeilen: kleine Pillen in der Mitte */
.chat-day,
.chat-system {
  display: flex;
  justify-content: center;
  margin: 14px 0 8px;
}
.chat-day span,
.chat-system span {
  max-width: 86%;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--quiet-fill);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.chat-system { margin: 8px 0; }
.chat-system span { font-weight: 600; font-size: 12.5px; }

/* ---------- Eine Nachricht ---------- */
.msg {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 3px;
}
.msg--first { margin-top: 10px; }
.msg--me { justify-content: flex-end; }
.msg__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 78%;
}
.msg--me .msg__col { align-items: flex-end; }
.msg__avatar,
.msg__avatar-gap { flex: none; width: 28px; }
.msg__avatar { display: grid; margin-bottom: 2px; }
.msg__more {
  display: grid;
  place-items: center;
  flex: none;
  align-self: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-3);
  opacity: 0;
  transition: opacity .15s ease;
}
.msg__more .icon { width: 20px; height: 20px; }
.msg--me .msg__more { order: -1; }
.msg:hover .msg__more,
.msg__more:focus-visible { opacity: 1; }
@media (hover: none) {
  .msg__more { display: none; }
}
.msg.is-highlight .bubble { animation: msg-flash 1.6s ease; }
@keyframes msg-flash { 0%, 60% { filter: brightness(1.35); } 100% { filter: none; } }

/* ---------- Bubbles ---------- */
.bubble {
  position: relative;
  min-width: 64px;
  max-width: 100%;
  padding: 7px 12px 5px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-size: 15.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-touch-callout: none;
}
.bubble--me {
  color: #fff;
  background: linear-gradient(135deg, #EF4984, #DE6B02);
  border-color: rgba(255, 122, 0, .30);
}
.bubble--other {
  color: var(--text);
  background: linear-gradient(135deg, #222222, #121212);
  border-color: rgba(255, 255, 255, .06);
}
:root[data-theme="light"] .bubble--me {
  color: #111;
  background: linear-gradient(135deg, #FFA1C3, #FFD18C);
  border-color: rgba(255, 77, 141, .22);
}
:root[data-theme="light"] .bubble--other {
  background: linear-gradient(135deg, #FFFFFF, #F7F7F7);
  border-color: var(--border);
}
.bubble--media { padding: 3px 3px 4px; overflow: hidden; }
.bubble--media .bubble__meta { padding: 0 8px; }
.bubble--media .bubble__name { padding: 3px 9px 2px; }
.bubble--media > .bubble__quote { margin: 3px 3px 5px; width: auto; }
.bubble--bare {
  padding: 0;
  background: none;
  border-color: transparent;
}
:root[data-theme="light"] .bubble--bare { background: none; border-color: transparent; }
.bubble--bare .bubble__meta { color: var(--text-2); }
.bubble--card { min-width: 240px; }
.bubble--deleted { font-style: italic; }
.bubble--typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
}
.bubble--typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-2);
  animation: chat-dot 1.2s ease-in-out infinite;
}
.bubble--typing span:nth-child(2) { animation-delay: .15s; }
.bubble--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.msg--typing[hidden] { display: none; }

.bubble__name {
  display: block;
  margin-bottom: 2px;
  font-size: 12.5px;
  font-weight: 800;
  background: var(--accent-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bubble__text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble__caption { padding: 5px 9px 0; }
.bubble__muted { color: inherit; opacity: .72; font-size: 13px; }
.bubble__link { text-decoration: underline; text-underline-offset: 2px; }
.bubble__mention { font-weight: 800; }
.bubble--other .bubble__mention {
  background: var(--accent-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bubble__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  opacity: .78;
  white-space: nowrap;
}
.bubble__edited { font-style: italic; }
.bubble__star { width: 12px; height: 12px; }
.bubble__tick { width: 13px; height: 13px; }
.bubble__ticks { display: inline-flex; opacity: .7; }
.bubble__ticks .icon { width: 15px; height: 15px; }
.bubble__ticks.is-read { opacity: 1; }
.bubble__ticks.is-read .icon + .icon { margin-left: -9px; }

/* Antwort-Zitat (bündig, Balken im Verlauf) */
.bubble__quote {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 5px;
  padding: 5px 8px 5px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
  color: inherit;
  text-align: left;
  overflow: hidden;
}
.bubble--other .bubble__quote { background: rgba(255, 255, 255, .06); }
:root[data-theme="light"] .bubble__quote { background: rgba(0, 0, 0, .06); }
.bubble__quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-gradient);
}
.bubble--me .bubble__quote::before { background: rgba(255, 255, 255, .85); }
:root[data-theme="light"] .bubble--me .bubble__quote::before { background: rgba(0, 0, 0, .55); }
.bubble__quote-body { display: grid; gap: 1px; flex: 1 1 auto; min-width: 0; }
.bubble__quote-name { font-size: 12.5px; font-weight: 800; }
.bubble__quote-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  opacity: .85;
}
.bubble__quote-thumb { flex: none; width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

/* Medien: randlos in der Bubble */
.bubble__album {
  position: relative;
  display: grid;
  gap: 2px;
  width: min(260px, 64vw);
  border-radius: 13px;
  overflow: hidden;
}
.bubble__album.is-n2,
.bubble__album.is-n3,
.bubble__album.is-n4 { grid-template-columns: 1fr 1fr; }
.bubble__album.is-n3 > .bubble__tile:first-child { grid-column: span 2; aspect-ratio: 2 / 1; }
.bubble__tile {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--placeholder);
}
.bubble__album:not(.is-n1) .bubble__tile { aspect-ratio: 1; }
.bubble__album.is-n1 .bubble__tile { min-height: 140px; }
.bubble__img { display: block; width: 100%; height: 100%; max-height: 340px; object-fit: cover; }
.bubble__album.is-n1 .bubble__img { height: auto; min-height: 140px; }
.bubble__ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 140px;
  color: var(--text-3);
}
.bubble__ph .icon { width: 30px; height: 30px; }
.is-uploading .bubble__img { opacity: .72; }
.bubble__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--media-pill);
  border: 1px solid var(--media-pill-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  transform: translate(-50%, -50%);
}
.bubble__play .icon { width: 28px; height: 28px; }
.bubble__more-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.bubble__progress {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--media-pill);
  border: 1px solid var(--media-pill-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.bubble__progress .chat-spinner { width: 12px; height: 12px; }
.bubble__video { width: min(260px, 64vw); border-radius: 13px; overflow: hidden; }
.bubble__video .bubble__tile { min-height: 180px; }
.bubble__videoel { display: block; width: 100%; max-height: 420px; background: #000; }
.bubble__noaudio { position: absolute; top: 8px; left: 8px; }
.bubble__gif { display: block; width: min(220px, 60vw); border-radius: 13px; overflow: hidden; background: var(--placeholder); }
.bubble__gif.is-sticker { width: 150px; background: none; }
.bubble__gif img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bubble__gif.is-sticker img { object-fit: contain; }

/* Zeilen-Inhalte (Datei, Standort, Anruf, Einmalansicht) */
.bubble__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  padding: 3px 0;
  color: inherit;
  text-align: left;
}
button.bubble__row { width: 100%; }
.bubble__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
}
:root[data-theme="light"] .bubble__icon { background: rgba(0, 0, 0, .06); }
.bubble--me .bubble__icon .icon--accent { fill: currentColor; }
.bubble__icon .icon { width: 18px; height: 18px; }
.bubble__rowtext { display: grid; gap: 1px; flex: 1 1 auto; min-width: 0; }
.bubble__rowtext strong { font-size: 14.5px; }
.bubble__filename { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bubble__file-dl { flex: none; width: 20px; height: 20px; opacity: .8; }
.bubble__once {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-size: 13px;
  font-weight: 900;
}

/* Sprachnachricht */
.voice { display: flex; align-items: center; gap: 10px; width: min(240px, 62vw); padding: 3px 0; }
.voice__play {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: inherit;
}
:root[data-theme="light"] .voice__play { background: rgba(0, 0, 0, .08); }
.voice__play .icon { width: 22px; height: 22px; }
.voice__bars { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; height: 28px; }
.voice__bar { flex: 1 1 0; max-width: 3px; min-height: 3px; border-radius: 2px; background: currentColor; opacity: .4; }
.voice__bar.is-played { opacity: 1; }
.voice__time { flex: none; font-size: 12px; opacity: .8; }

/* Umfrage / Ereignis */
.poll { display: grid; gap: 10px; width: min(270px, 68vw); padding: 4px 0 0; }
.poll__q { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; opacity: .8; }
.poll__q .icon { flex: none; width: 17px; height: 17px; }
.bubble--me .poll__q .icon--accent { fill: currentColor; }
.poll__hint { margin-top: -6px; font-size: 12px; opacity: .7; }
.poll__opt {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: inherit;
  text-align: left;
}
.poll__opt:disabled { cursor: default; }
.poll__label { display: grid; gap: 6px; min-width: 0; }
.poll__text { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.poll__bar { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; }
:root[data-theme="light"] .poll__bar { background: rgba(0, 0, 0, .08); }
.poll__fill { display: block; height: 100%; border-radius: 3px; background: var(--accent-gradient); transition: width .25s var(--ease-out); }
.bubble--me .poll__fill { background: rgba(255, 255, 255, .92); }
:root[data-theme="light"] .bubble--me .poll__fill { background: rgba(0, 0, 0, .55); }
.bubble--me .sel-circle { border-color: currentColor; }
.bubble--me .sel-circle.is-on { background: #fff; color: #DE6B02; }
:root[data-theme="light"] .bubble--me .sel-circle.is-on { background: #111; color: #fff; }
.poll__count { font-size: 12.5px; opacity: .75; }
.poll__votes { padding: 8px 0 3px; font-size: 13.5px; font-weight: 600; color: inherit; opacity: .8; }
.poll__votes:disabled { opacity: .5; cursor: default; }
.chat-event { display: grid; gap: 8px; }
.chat-event__head { display: flex; align-items: center; gap: 10px; }

/* Geteilte Inhalte (Event, Beitrag) */
.share-card {
  display: flex;
  flex-direction: column;
  width: min(240px, 62vw);
  border-radius: 13px;
  overflow: hidden;
  color: inherit;
}
.share-card__media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 260px;
  background: var(--placeholder);
  overflow: hidden;
}
.share-card__media--empty { aspect-ratio: 2.2; }
.share-card__media img { width: 100%; height: 100%; object-fit: cover; }
.share-card__media .icon { width: 30px; height: 30px; }
.share-card__body { display: grid; gap: 2px; padding: 7px 9px 2px; }
.share-card__title { font-size: 14.5px; font-weight: 800; }
.share-card__sub { font-size: 12.5px; opacity: .75; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.story-quote { display: grid; gap: 6px; padding: 4px 6px 0; }
.story-quote__img { width: 120px; aspect-ratio: 9 / 16; border-radius: 10px; object-fit: cover; background: var(--placeholder); }
.story-quote__label { font-size: 12.5px; }

/* Reaktionen unter der Bubble (max. 4 Emojis + Zahl) */
.reaction-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin: -6px 8px 2px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--bg);
  background: var(--surface-soft);
  font-size: 14px;
  line-height: 1.3;
}
.reaction-pill.is-mine {
  border-color: transparent;
  background:
    linear-gradient(var(--surface-soft), var(--surface-soft)) padding-box,
    var(--accent-tint-border) border-box;
}
.reaction-pill__count { margin-left: 3px; font-size: 12px; font-weight: 700; color: var(--text-2); }

/* ---------- Hinweis über der Eingabe (Anfrage) ---------- */
.chat-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 8px var(--gutter);
  font-size: 13px;
  color: var(--text-2);
}
.chat-banner[hidden] { display: none; }
.chat-banner__text { flex: 1 1 auto; line-height: 1.35; }
.chat-banner__del { flex: none; color: var(--danger); font-weight: 800; font-size: 13px; }

/* ---------- Eingabe ---------- */
.chat-composer {
  flex: none;
  padding: 6px 10px max(10px, env(safe-area-inset-bottom));
  background: var(--bg);
}
@media (min-width: 768px) {
  .chat-composer { padding-bottom: 16px; }
}
.composer { display: grid; gap: 6px; }
.composer__row { display: flex; align-items: flex-end; gap: 8px; }
.composer__attach,
.composer__send {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--quiet-fill);
  color: var(--text-2);
  transition: background .15s ease, color .15s ease;
}
.composer__attach .icon { width: 26px; height: 26px; }
.composer__send .icon { width: 22px; height: 22px; }
.composer__send.is-ready { background: var(--accent-gradient); color: #fff; }
.composer__send:disabled { cursor: default; }
.composer__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 140px;
  padding: 11px 16px;
  border-radius: 22px;
  border: 1px solid var(--line-soft);
  background: var(--input-fill);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.35;
  resize: none;
  outline: none;
}
.composer__input::placeholder { color: var(--text-3); }
.composer__input:focus {
  border-color: transparent;
  background:
    linear-gradient(var(--input-fill), var(--input-fill)) padding-box,
    var(--accent-gradient) border-box;
}
.composer__ctx {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}
.composer__ctx[hidden] { display: none; }
.composer__ctx-body { display: grid; gap: 1px; flex: 1 1 auto; min-width: 0; }
.composer__ctx-label { font-size: 12.5px; font-weight: 800; }
.composer__ctx-text { font-size: 13px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.composer__ctx-x { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; color: var(--text-2); }
.composer__ctx-x .icon { width: 18px; height: 18px; }
.composer__drafts { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.composer__drafts[hidden] { display: none; }
.composer__draft {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--placeholder);
}
.composer__draft.is-file { width: auto; max-width: 100%; background: var(--surface-soft); }
.composer__draft-img { width: 100%; height: 100%; object-fit: cover; }
.composer__draft-ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-2); }
.composer__draft-file {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 64px;
  padding: 0 34px 0 12px;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.composer__draft-file .icon { flex: none; width: 18px; height: 18px; }
.composer__draft-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .62);
  color: #fff;
}
.composer__draft-x .icon { width: 14px; height: 14px; }
.composer__mentions { display: flex; flex-wrap: wrap; gap: 6px; }
.composer__mentions[hidden] { display: none; }
.composer__mention {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 5px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
}
.composer__mention > .icon { width: 22px; height: 22px; margin-left: 2px; }
.composer--locked { justify-items: center; gap: 6px; padding: 8px 16px 2px; text-align: center; }
.composer__locked-title { font-size: 14.5px; font-weight: 800; }
.composer__locked-text { font-size: 13px; color: var(--text-2); }

/* ---------- Sheets im Chat ---------- */
.msg-menu { padding: 6px 0 10px; }
.react-bar {
  display: flex;
  gap: 2px;
  padding: 12px 12px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.react-bar__btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  font-size: 24px;
  line-height: 1;
}
.react-bar__btn.is-on {
  background:
    linear-gradient(var(--sheet-bg), var(--sheet-bg)) padding-box,
    var(--accent-tint-border) border-box;
}
.voters { padding: 6px 16px 16px; }
.voters__opt { margin: 14px 0 6px; font-size: 14px; font-weight: 800; }
.voters__row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 6px 0;
  color: var(--text);
  text-align: left;
  font-size: 14.5px;
  font-weight: 600;
}
.voters__name { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.voters__emoji { flex: none; font-size: 20px; }

/* Medien-Ansicht */
dialog.sheet--viewer { background: #000; color: #fff; }
dialog.sheet--viewer .sheet__head { border-bottom-color: rgba(255, 255, 255, .1); }
dialog.sheet--viewer .glass-btn { color: #fff; }
.viewer { position: relative; display: grid; place-items: center; height: 100%; min-height: 60vh; background: #000; }
.viewer__stage { display: grid; place-items: center; width: 100%; height: 100%; }
.viewer__media { max-width: 100%; max-height: calc(92dvh - 70px); object-fit: contain; }
.viewer__wait { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; }
.viewer__nav[hidden] { display: none; }
.viewer__nav--prev { left: 10px; }
.viewer__nav--next { right: 10px; }
.viewer__count {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .55);
  font-size: 12.5px;
  font-weight: 700;
}
.viewer__count:empty { display: none; }

/* GIF-Auswahl */
.gif-picker { display: grid; gap: 10px; padding: 12px 16px 16px; }
.gif-picker .search-field input { font-size: 14.5px; }
.gif-kinds { padding: 0; }
.gif-grid { column-count: 2; column-gap: 8px; }
@media (min-width: 560px) {
  .gif-grid { column-count: 3; }
}
.gif-grid__item {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--placeholder);
  break-inside: avoid;
}
.gif-grid__item img { width: 100%; height: 100%; object-fit: cover; }
.gif-status { text-align: center; font-size: 13.5px; color: var(--text-2); }
.gif-status:empty { display: none; }
.gif-more { justify-self: center; }
.gif-more[hidden] { display: none; }
.gif-credit { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .4px; color: var(--text-2); }

/* Umfrage erstellen */
.poll-new__opts { display: grid; gap: 8px; }
.poll-new .btn--small { justify-self: start; }
.poll-new .btn--small[hidden] { display: none; }
.poll-new__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  font-size: 14.5px;
  font-weight: 600;
}
.poll-new__toggle-text { display: grid; gap: 2px; }

/* Notizen (gemeinsame Liste) */
.shop { padding: 6px 0; }
.shop__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px var(--gutter);
  color: var(--text);
  text-align: left;
}
.shop__text { display: grid; gap: 1px; min-width: 0; }
.shop__label { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.shop__who { font-size: 12px; color: var(--text-3); }
.shop__item.is-done .shop__label { text-decoration: line-through; color: var(--text-3); }
.shop__empty { padding: 40px 24px; font-size: 14px; line-height: 1.45; text-align: center; white-space: pre-line; color: var(--text-2); }
.shop__foot { display: grid; gap: 8px; }
.shop__modes { padding: 0; }
.shop__add { display: flex; align-items: center; gap: 8px; }
.shop__add .field__input { flex: 1 1 auto; min-width: 0; }

/* Chat-Info (Person / Gruppe) */
.cinfo { padding-bottom: 16px; }
.cinfo__head {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 22px 16px 12px;
  color: var(--text);
  text-align: center;
}
.cinfo__name { margin-top: 4px; font-size: 20px; font-weight: 800; }
.cinfo__sub { font-size: 13px; color: var(--text-2); }
.cinfo__desc { max-width: 360px; font-size: 14px; line-height: 1.4; color: var(--text-2); white-space: pre-wrap; }
.cinfo__head .btn { margin-top: 6px; }
.cinfo__section { padding: 14px var(--gutter) 2px; font-size: 16px; font-weight: 800; }
.cinfo__members .chat-row { min-height: 56px; }

/* Melden */
.report__reasons { display: grid; }
.report__reason {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  .chat-spinner,
  .bubble--typing span,
  .msg.is-highlight .bubble { animation: none; }
}
