/* Seite: Chats (chat_list_page.dart, chat/chat_list_row.dart) – ohne Karten, ohne Trennlinien. */

@media (min-width: 768px) {
  .page--chats { padding-top: 12px; }
}

/* ---------- Notizen-Leiste: Kachel 102, Ring 90, Foto 78 (wie die Story-Leiste) ---------- */
.notes {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 4px 6px;
  scroll-snap-type: x proximity;
}
.notes::-webkit-scrollbar { display: none; }
.note {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 102px;
  width: 102px;
  scroll-snap-align: start;
}
.note__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
}
.note__ring--none { border-color: transparent; }
.note__sk { width: 78px; height: 78px; }
.note__plus {
  position: absolute;
  right: 3px;
  top: 2px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 2.2px solid var(--bg);
  color: #fff;
}
.note__plus .icon { width: 16px; height: 16px; }

/* Sprechblase der Notiz: liegt oben auf dem Avatar, deckend, damit sie sich abhebt. */
.note__bubble {
  position: absolute;
  top: -4px;
  left: 50%;
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1.5px solid var(--bg);
  transform: translateX(-50%);
}
.note__name {
  margin-top: 6px;
  max-width: 94px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note .note__name .sk { margin: 2px auto 0; height: 10px; }

/* ---------- Suche „Chats durchsuchen...“ + Anfragen (Abstände 16/10) ---------- */
.chats-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--gutter);
}
.chats-search__field {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  text-align: left;
}
.chats-search__field span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Runder Knopf mit Verlaufsrand (_chatRequestsRoundButton), ohne Schein */
.chats-search__requests {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.7px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--accent-gradient) border-box;
}
.chats-search__requests .icon { width: 20px; height: 20px; }

/* ---------- Filter-Chips: Höhe 40, Schrift 13.5 w700 ---------- */
.chats-filters { padding-bottom: 6px; }
.chats-filters .chip {
  height: 40px;
  padding: 0 14px;
  font-weight: 700;
}
.chats-filters .chip:not(.is-active) {
  background: var(--surface);
  border-color: var(--border);
}

/* ---------- Chat-Zeilen: Avatar 46, 12 Abstand, Innenabstand 10/16 ---------- */
.chats-list { padding-top: 4px; }
.chat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 10px var(--gutter);
  text-align: left;
}
.chat-row__avatar {
  flex: none;
  width: 46px;
  height: 46px;
}
.chat-row__text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 9px;
}
.chat-row .chat-row__name { height: 13px; border-radius: 7px; }
.chat-row .chat-row__preview { height: 11px; border-radius: 6px; }

/* Hinweis unter den Platzhaltern */
.page--chats .empty { padding-top: 28px; }

/* =====================================================================
   Angemeldet: echte Chat-Liste (chat_list_row.dart), Anfragen, Archiv,
   Notizen (MyNote), Gruppe erstellen. Ohne Kacheln, ohne Trennlinien.
   ===================================================================== */

.chats-subhead { padding-left: 4px; }
.chats-subhead .page-header__title { font-size: 19px; }

/* Suchfeld mit echtem Eingabefeld */
label.chats-search__field { cursor: text; }
.chats-search__field input { font-size: 14.5px; }
.chats-search__requests { position: relative; }
.chats-search__dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FF5252;
  border: 1.5px solid var(--bg);
}
.chats-search__dot[hidden] { display: none; }

/* ---------- Zeilen ---------- */
.chat-row-wrap { position: relative; }
a.chat-row,
button.chat-row {
  color: var(--text);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  a.chat-row:hover,
  button.chat-row:hover { background: var(--line-soft); }
}
.chat-row__title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
}
.chat-row.is-unread .chat-row__title { font-weight: 800; }
.chat-row__name-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-row__flag { flex: none; width: 13px; height: 13px; }
.chat-row__flag--muted { color: var(--text-2); }
.chat-row__preview-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-2);
}
.chat-row__type { flex: none; width: 16px; height: 16px; }
.chat-row__preview-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Ungelesen: Vorschau im Verlauf, fett (wie die App) */
.chat-row.is-unread .chat-row__preview-text {
  font-weight: 700;
  background: var(--accent-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chat-row.is-unread .chat-row__type { fill: url(#cv-accent); }
.chat-row__text:has(.chat-row__title) { gap: 0; }
.chat-row__dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 30px;
  border-radius: 50%;
  background: var(--accent-gradient);
}
.chat-row__end-icon { flex: none; margin-right: 34px; }
.chat-row__end-icon .icon { width: 22px; height: 22px; }

/* „Mehr“ an der Zeile: am Desktop beim Darüberfahren, sonst lange drücken */
.chat-row__more {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-2);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .15s ease;
}
.chat-row__more .icon { width: 22px; height: 22px; }
.chat-row-wrap:hover .chat-row__more,
.chat-row__more:focus-visible,
.chat-row__more--visible { opacity: 1; }
@media (hover: none) {
  .chat-row__more:not(.chat-row__more--visible) { opacity: 0; pointer-events: none; }
}

/* Gruppen-Avatar ohne Bild */
.chat-avatar--group { background: var(--surface-soft); }
.chat-avatar--group .icon { width: 52%; height: 52%; }

/* „Archiviert“ als erste Zeile */
.chat-row--archived { min-height: 56px; }
.chat-row__icon-slot {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  color: var(--text-2);
}
.chat-row__icon-slot .icon { width: 22px; height: 22px; }
.chat-row__archived-label { flex: 1 1 auto; font-size: 16px; font-weight: 800; }
.chat-count {
  flex: none;
  min-width: 22px;
  padding: 3px 8px;
  margin-right: 30px;
  border-radius: var(--r-pill);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

/* Anfragen: kleines Sprechblasen-Abzeichen, „Neu“-Pille, Bio */
.chat-row__avatar-wrap { position: relative; flex: none; }
.chat-row__badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 2px solid var(--bg);
  color: #000;
}
.chat-row__badge .icon { width: 10px; height: 10px; }
.chat-new {
  flex: none;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    var(--accent-tint-border) border-box;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.1;
}
.chat-row__bio {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-row__chevron { flex: none; width: 22px; height: 22px; margin-right: 30px; color: var(--text-3); }

/* Hinweise und leere Zustände */
.chats-status { padding-bottom: 12px; }
.chats-hint {
  padding: 18px 32px;
  font-size: 13.5px;
  text-align: center;
  color: var(--text-2);
}
.chats-suggest { margin-top: 18px; }
.chats-suggest[hidden] { display: none; }
.chats-suggest__title {
  padding: 0 var(--gutter) 4px;
  font-size: 15px;
  font-weight: 800;
}

/* ---------- Notizen-Leiste mit echtem Text ---------- */
html.is-signed-in .note { color: var(--text); }
.note__bubble--text {
  z-index: 1;
  display: grid;
  gap: 1px;
  height: auto;
  min-height: 24px;
  width: max-content;
  max-width: 98px;
  padding: 4px 8px;
  border-color: var(--line);
  text-align: center;
}
.note__bubble-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.note__bubble-text.is-single { -webkit-line-clamp: 1; }
.note__bubble-music {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.2;
}
.note__bubble-music .icon { flex: none; width: 11px; height: 11px; fill: url(#cv-accent); }
.note__bubble-music span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.note__dots { position: absolute; left: 22px; bottom: -9px; display: block; pointer-events: none; }
.note__dots span {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: var(--surface-soft);
  border: .8px solid var(--line);
}
.note__dots span:first-child { left: 0; top: 0; width: 6px; height: 6px; }
.note__dots span:last-child { left: -4px; top: 7px; width: 3px; height: 3px; }
html.is-signed-in .notes .note { padding-top: 14px; }

/* Notiz ansehen */
.note-view {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px 18px 18px;
  text-align: center;
}
.note-view__who { display: grid; justify-items: center; gap: 8px; color: var(--text); }
.note-view__name { font-size: 16px; font-weight: 800; }
.note-view__text {
  width: 100%;
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note-view__music { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; }
.note-view__music .icon { width: 18px; height: 18px; }
.note-view__tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.note-view .btn { margin-top: 4px; }
.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--quiet-fill);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 800;
}
.pill-tag__x { display: grid; place-items: center; width: 18px; height: 18px; color: var(--text-2); }
.pill-tag__x .icon { width: 14px; height: 14px; }

/* Notiz schreiben */
.chats-sheet { display: grid; gap: 12px; padding: 16px; }
.chats-sheet__actions { display: flex; gap: 10px; }
.chats-sheet__actions .btn { flex: 1 1 0; }
.chats-sheet__stack { display: grid; gap: 10px; }
.chats-menu { padding: 6px 0 10px; }
.note-edit__head { display: flex; justify-content: center; }
.note-edit__input { min-height: 72px; font-size: 16px; text-align: center; }
.note-edit__count { justify-self: end; }
.note-edit__music { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.note-edit__music:empty, .note-edit__tags:empty { display: none; }
.note-edit__music .icon { flex: none; width: 18px; height: 18px; }
.note-edit__music-text { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.note-edit__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.note-edit__hours { padding: 0; }
.note-edit__info { text-align: center; }
.note-edit__delete { justify-self: center; color: var(--danger); font-weight: 800; }
.chats-sheet__stack .btn:disabled,
.chats-sheet .btn:disabled,
.btn.is-disabled { opacity: .55; cursor: default; }

/* ---------- Neue Gruppe / Mitglieder hinzufügen ---------- */
.group-new { display: grid; gap: 12px; padding: 14px 0 8px; }
.group-new > :not(.group-new__list) { margin: 0 var(--gutter); }
.group-new__head { display: flex; align-items: center; gap: 14px; }
.group-new__image {
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--surface-soft), var(--surface-soft)) padding-box,
    var(--accent-gradient) border-box;
}
.group-new__image .icon { width: 28px; height: 28px; }
.group-new__image .avatar { width: 100% !important; height: 100% !important; }
.group-new__preview { width: 100%; height: 100%; object-fit: cover; }
.group-new__fields { display: grid; flex: 1 1 auto; min-width: 0; gap: 8px; }
.group-new__fields .link-btn { justify-self: start; font-size: 13px; color: var(--text-2); }
/* .link-btn setzt display: inline – sonst bliebe „Bild entfernen“ trotz hidden stehen. */
.group-new__fields .link-btn[hidden] { display: none; }
.group-new__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.group-new__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--quiet-fill);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
}
.group-new__pill .icon { width: 16px; height: 16px; }
.group-new__search input { font-size: 14.5px; }
.group-new__inforow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.group-new__count { font-weight: 800; }
.group-new__list { padding-bottom: 8px; }
.group-new__row .sel-circle { margin-right: 4px; }
.group-new__empty { padding: 28px 24px; text-align: center; }
