
/* ============================================
   modals.css — Bereich: modals
   ============================================ */
.chat-delete-modal{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-delete-modal[hidden]{
  display: none;
}

.chat-delete-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.chat-delete-modal__dialog{
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.chat-delete-modal__title{
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.chat-delete-modal__text{
  font-size: 14px;
  color: var(--text-light);
  margin: 0 0 20px;
}

.chat-delete-modal__actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.chat-delete-modal__options{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.chat-delete-modal__option{
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.chat-delete-modal__option:hover{
  border-color: var(--primary);
  background: var(--bg);
}

.chat-delete-modal__option--danger:hover{
  border-color: #e74c3c;
  background: #fff5f5;
}

.chat-delete-modal__option strong{
  font-size: 14px;
  color: var(--text);
}

.chat-delete-modal__option span{
  font-size: 12px;
  color: var(--text-muted);
}

.chat-delete-modal__option--danger strong{
  color: #e74c3c;
}

.chat-delete-modal__cancel--full{
  width: 100%;
  margin-top: 0;
}

.chat-delete-modal__text--danger{
  color: #e74c3c;
  font-weight: 500;
}

.chat-delete-modal__members{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 240px;
  overflow-y: auto;
}

.chat-delete-modal__member{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.chat-delete-modal__member:hover{
  border-color: var(--primary);
  background: var(--bg);
}

.chat-delete-modal__member input[type="radio"]{
  flex-shrink: 0;
}

.chat-delete-modal__member-name{
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
}

.chat-member-row__action--promote{
  color: var(--success);
}

.chat-member-row__action--demote{
  color: var(--text-muted);
}

.chat-delete-modal__cancel{
  padding: 8px 16px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.chat-delete-modal__cancel:hover{
  background: var(--bg);
}

.chat-delete-modal__confirm{
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: #e74c3c;
  color: var(--inverse-text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.chat-delete-modal__confirm:hover{
  background: #c0392b;
}

.mention-profile-modal .chat-forward-modal__dialog{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
}

.mention-profile__header{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.mention-profile__avatar{
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--inverse-text);
  font-size: 28px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.mention-profile__avatar-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mention-profile__avatar--image{
  cursor: zoom-in;
}

.avatar-zoom{
  position: fixed;
  inset: 0;
  z-index: 2002;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.avatar-zoom[hidden]{
  display: none;
}

.avatar-zoom__image{
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
}

.mention-profile__info{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mention-profile__name{
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.mention-profile__username{
  font-size: 14px;
  color: var(--text-muted);
}

.mention-profile__bio{
  font-size: 14px;
  color: var(--text);
  text-align: center;
  margin-top: 4px;
}

/* Memberliste im Chat-Info-Modal (Gruppen/Kanäle) */
.mention-profile__members{
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.mention-profile__member{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  color: var(--text);
}

.mention-profile__member:hover{
  background: var(--border-light);
}

.mention-profile__member-avatar{
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--inverse-text);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.mention-profile__member-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mention-profile__member-name{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-profile__member-role{
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mention-profile__message{
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-round);
  background: var(--primary);
  color: var(--inverse-text);
  font-size: 15px;
  cursor: pointer;
}

.mention-profile__message:hover{
  background: var(--primary-dark);
}

.message-delete-modal{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-delete-modal[hidden]{
  display: none;
}

.message-delete-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.message-delete-modal__dialog{
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  width: 280px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-delete-modal__title{
  margin: 0 0 8px;
  font-size: 16px;
  text-align: center;
}

.message-delete-modal__option,
.message-delete-modal__cancel{
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.message-delete-modal__option{
  background: var(--border-light);
  color: var(--text);
}

.message-delete-modal__option:hover{
  background: var(--primary);
  color: var(--inverse-text);
}

.message-delete-modal__cancel{
  background: transparent;
  color: var(--text-muted);
}

.message-delete-modal__cancel:hover{
  background: var(--border-light);
  color: var(--text);
}

/* Gemeinsames Turbo-Confirm-Dialog (#confirm): @rolemodel/turbo-confirm ersetzt
   native data-turbo-confirm-Alerts durch dieses Webview-kompatible Modal.
   Turbo-Confirm toggelt die Klasse modal--active; das Overlay liegt sonst
   display:none und wird bei modal--active als fix zentriertes Modal sichtbar.
   Optisch konsistent mit den übrigen Modals (message-delete-modal u.a.). */
.confirm-dialog{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.confirm-dialog.modal--active{
  display: flex;
}

.confirm-dialog__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.confirm-dialog__card{
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  width: 280px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1;
}

.confirm-dialog__title{
  margin: 0 0 8px;
  font-size: 16px;
  text-align: center;
}

.confirm-dialog__text{
  margin: 0 0 8px;
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
}

.confirm-dialog__cancel,
.confirm-dialog__confirm{
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  width: 100%;
}

.confirm-dialog__cancel{
  background: var(--border-light);
  color: var(--text);
}

.confirm-dialog__cancel:hover{
  background: var(--primary);
  color: var(--inverse-text);
}

.confirm-dialog__confirm{
  background: var(--danger);
  color: #fff;
}

.confirm-dialog__confirm:hover{
  filter: brightness(1.1);
}

.chat-forward-modal{
  position: fixed;
  inset: 0;
  /* Modals liegen über ALLEM Chat-UI: Message-Actions/Reaction-Picker
     (1100), Media-Viewer (1000), Scroll-FAB (50). Nur Flashes/Prompts
     (3000) und das Incognito-Gate (10000) sind noch höher. */
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-forward-modal[hidden]{
  display: none;
}

.chat-forward-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.chat-forward-modal__dialog{
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  width: 320px;
  max-height: 80vh;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-forward-modal__title{
  margin: 0 0 8px;
  font-size: 16px;
  text-align: center;
}

.chat-forward-modal__list{
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
  max-height: 50vh;
}

.chat-forward-modal__option[hidden]{
  /* `hidden` darf nicht von display:flex der Optionen überschrieben werden —
   sonst wirkt die Kontakt-Suche (neuer Chat, Gruppe, Invite) nicht. */
  display: none;
}

.chat-forward-modal__option{
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.chat-forward-modal__option:hover{
  background: var(--primary);
  color: var(--inverse-text);
}

.chat-forward-modal__avatar{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--inverse-text);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-forward-modal__avatar .chat-avatar__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-forward-modal__name{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-forward-modal__empty{
  margin: 0;
  padding: 16px;
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
}

.chat-forward-modal__cancel{
  border: 1px solid var(--border-input);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  background: var(--surface);
  color: var(--text);
}

.chat-forward-modal__cancel:hover{
  background: var(--surface-hover);
}

.new-chat-modal__search{
  padding-bottom: 4px;
}

.new-chat-modal__search-input{
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}

.new-chat-modal__search-input:focus{
  outline: none;
  border-color: var(--accent);
}

.new-chat-modal__switch{
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--border-light);
  border-radius: 10px;
  margin-bottom: 8px;
}

.new-chat-modal__switch-btn{
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.new-chat-modal__switch-btn--active{
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.chat-forward-modal__option--select{
  width: 100%;
  box-sizing: border-box;
}

.new-chat-modal__checkbox{
  flex-shrink: 0;
  accent-color: var(--primary);
}

.chat-forward-modal__option--select:has(input:checked){
  background: var(--primary);
  color: var(--inverse-text);
}

.new-chat-modal__error{
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
  border-radius: 8px;
  text-align: center;
}

.chat-member-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}

.chat-member-row:hover{
  background: #f8f9fa;
}

.chat-member-row__role{
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.chat-member-row__action{
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.chat-member-row__action:hover{
  background: #fee2e2;
  color: #9f1c1c;
}

.chat-member-row__action--add-contact:hover{
  background: #dcfce7;
  color: #166534;
}

.chat-member-row__action--added{
  color: #166534;
  opacity: 0.9;
}

.chat-member-row__action:disabled{
  opacity: 0.5;
  cursor: default;
}

.new-chat-modal__toggle{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 4px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.new-chat-modal__toggle-track{
  flex-shrink: 0;
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d5d9de;
  transition: background 0.2s ease;
}

.new-chat-modal__toggle-track::after{
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.new-chat-modal__toggle input:checked + .new-chat-modal__toggle-track{
  background: var(--primary);
}

.new-chat-modal__toggle input:checked + .new-chat-modal__toggle-track::after{
  transform: translateX(14px);
}

.new-chat-modal__toggle input:focus-visible + .new-chat-modal__toggle-track{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.new-chat-modal__submit{
  display: block;
  margin: 0 auto;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: var(--inverse-text);
}

.new-chat-modal__submit:hover{
  background: var(--primary-dark);
}

.chat-settings{
  /* --- Gruppen-/Kanal-Einstellungen (chat-settings-Modal) --- */
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-settings__section{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-settings__label{
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-settings__row{
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-settings__input{
  flex: 1;
  min-width: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
}

.chat-settings__input:focus{
  outline: none;
  border-color: var(--primary);
}

.chat-settings__input--error{
  border-color: #dc3545;
  box-shadow: 0 0 0 1px #dc3545;
}

.chat-settings__input--error:focus{
  border-color: #dc3545;
}

.chat-settings__submit{
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: var(--inverse-text);
  white-space: nowrap;
}

.chat-settings__submit:hover{
  background: var(--primary-dark);
}

.chat-settings__submit:disabled{
  opacity: 0.5;
  cursor: default;
}

.chat-settings__submit--danger{
  background: #fee2e2;
  color: #9f1c1c;
}

.chat-settings__submit--danger:hover{
  background: #fecaca;
}

.chat-settings__radio{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
}

.chat-settings__radio input{
  accent-color: var(--primary);
  margin-top: 2px;
}

.chat-settings__error{
  font-size: 13px;
  color: #9f1c1c;
  margin: 0;
}

.chat-settings__hint{
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
  margin: 0;
}

/* Dialog scrollt wie das Profil-Modal (max-height + overflow-y), damit die
   Actions-Leiste am unteren Rand kleben kann. padding-bottom: 0 — der
   untere Abstand gehört zur Leiste, sonst bliebe eine Lücke unter ihr. */
.chat-settings__dialog{
  width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: none;
  padding-bottom: 0;
}

/* Sticky Footer mit Fehlermeldung + Abbrechen/Speichern (Muster:
   .profile-modal__actions). Negative Seiten-Margins decken den Dialog-
   Padding vollflächig ab. */
.chat-settings__actions{
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -20px;
  padding: 12px 20px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  border-bottom-right-radius: 14px;
  border-bottom-left-radius: 14px;
}

.chat-settings__actions-row{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.chat-settings__actions .chat-settings__error{
  margin: 0 0 8px;
}

/* Feldnahe Validierungs-Meldung (Titelfeld), Muster:
   .profile-modal__field-error. */
.chat-settings__field-error{
  font-size: 12px;
  color: #9f1c1c;
  margin: -4px 0 0;
}

/* Frisch-Nachladen der Modals (open() setzt den Frame-Src neu): Solange der
   Load läuft, wird der Inhalt gesperrt — sonst interagiert man mit dem gleich
   ersetzten DOM und Eingaben/Stagings werden vom frame-load-Reset geschluckt.
   Die Invite-/Members-Frames per data-Attribut anvisieren (deren Dialoge sind
   der direkte Frame-Inhalt). */
.chat-forward-modal.is-loading .chat-settings,
.chat-forward-modal.is-loading .profile-modal__form,
.chat-forward-modal.is-loading [data-chat-invite-target="frame"],
.chat-forward-modal.is-loading [data-chat-members-target="frame"] {
  opacity: 0.6;
  pointer-events: none;
}

/* ============================================
   Profile Modal
   ============================================ */
.profile-modal__dialog {
  width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  /* Kein Rubberband/Overscroll-Bounce beim Scrollen des Formulars (und kein
     Scroll-Chaining an die Seite dahinter). */
  overscroll-behavior: none;
  /* padding-bottom: 0 — der untere Abstand steckt in der sticky Actions-
     Leiste (padding-bottom: 20px). Mit Dialog-Padding bliebe eine 20px-
     Lücke unter der Leiste: sticky kann nur innerhalb des Formulars
     wandern, und das endet am Content-Rand des Dialogs.
     scroll-padding-bottom hält per Tab fokussierte Felder oberhalb der
     sticky Leiste. */
  padding-bottom: 0;
  scroll-padding-bottom: 70px;
}

.profile-modal__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Geräte- & Sessions-Modal: etwas breiter, damit Device-Infos (Gerät,
   Angemeldet am, IP) in eigenen Zeilen gut lesbar bleiben. */
.sessions-modal__dialog {
  width: 480px;
}

.profile-modal__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.profile-modal__section--password {
  border-bottom: none;
}

.profile-modal__section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.profile-modal__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-modal__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-modal__input,
.profile-modal__select,
.profile-modal__textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  box-sizing: border-box;
}

.profile-modal__textarea {
  resize: vertical;
  min-height: 60px;
}

.profile-modal__input:focus,
.profile-modal__select:focus,
.profile-modal__textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.15);
}

.profile-modal__hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.profile-modal__errors {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.profile-modal__error {
  font-size: 13px;
  color: var(--danger);
  margin: 2px 0;
}

/* Feldnahe Validierungs-Meldung + rote Umrandung des zugehörigen Inputs. */
.profile-modal__field-error {
  font-size: 12px;
  color: var(--danger);
  margin: 4px 0 0;
}

.profile-modal__input--error {
  border-color: var(--danger);
}

/* Avatar */
.profile-modal__avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.profile-modal__avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Avatar-Picker (gemeinsames Widget in Profil- und Settings-Modal):
   Vorschau/Fallback mit Camera-Badge (unten rechts, File-Dialog) und
   ×-Badge (oben rechts, Entfernen — im Profil pending bis zum Save). */
.avatar-picker{
  flex-shrink: 0;
}

/* display:flex/-Regeln unten würden sonst das hidden-Attribut übergehen
   (Author-CSS schlägt UA-[hidden]) — deshalb explizit ausnehmen. */
.avatar-picker__preview[hidden],
.avatar-picker__fallback[hidden],
.avatar-picker__badge[hidden],
.avatar-picker__error[hidden]{
  display: none;
}

.avatar-picker__stage{
  position: relative;
  width: 72px;
  height: 72px;
}

.avatar-picker__preview,
.avatar-picker__fallback{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-picker__fallback{
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--inverse-text);
  font-size: 28px;
  font-weight: 700;
}

.avatar-picker__badge{
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--inverse-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.avatar-picker__badge--camera{
  right: -4px;
  bottom: -4px;
  background: var(--primary);
  color: var(--inverse-text);
}

.avatar-picker__badge--camera:hover{
  background: var(--primary-dark);
}

.avatar-picker__badge--remove{
  right: -4px;
  top: -4px;
  background: #fee2e2;
  color: #9f1c1c;
}

.avatar-picker__badge--remove:hover{
  background: #fecaca;
}

.avatar-picker__error{
  font-size: 13px;
  color: var(--danger);
  margin: 6px 0 0;
}

/* Theme-Auswahl */
.profile-modal__theme-row {
  display: flex;
  gap: 8px;
}

.profile-modal__theme-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.profile-modal__theme-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.06);
}

.profile-modal__theme-option input[type="radio"] {
  display: none;
}

/* Buttons */
.profile-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  /* Sticky am unteren Rand des scrollenden Dialogs (.profile-modal__dialog
     hat overflow-y:auto). Hintergrund + negative Seiten-Margins decken den
     Dialog-Padding (20px) vollflächig ab, damit durchscrollender Inhalt
     weder seitlich noch unter der Leiste sichtbar wird. Die Bottom-Corners
     folgen dem Dialog-Radius (14px); overflow-Clipping des Dialogs tut das
     aber ohnehin schon. */
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -20px;
  padding: 12px 20px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  border-bottom-right-radius: 14px;
  border-bottom-left-radius: 14px;
}

/* Sidebar trigger */
.sidebar-header__user-wrapper--clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}

.sidebar-header__user-wrapper--clickable:hover {
  opacity: 0.8;
}

.sidebar-header__edit-icon {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* --- Geräte & Sessions (Device-Management im Profil-Modal) --- */
.profile-sessions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.profile-sessions__hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 10px;
}

.profile-sessions__empty {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  padding: 8px 0;
}

.profile-sessions__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-sessions__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.profile-sessions__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-muted);
  background: var(--bg);
}

.profile-sessions__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-sessions__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.profile-sessions__current {
  font-size: 11px;
  font-weight: 700;
  color: #1f2937;
  background: var(--accent, #4f46e5);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.profile-sessions__remembered {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 6px;
  margin-right: 6px;
  vertical-align: middle;
  white-space: nowrap;
  display: inline-block;
}

.profile-sessions__detail {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.profile-sessions__detail-line {
  line-height: 1.4;
}

.profile-sessions__detail-label {
  font-weight: 600;
  color: var(--text-muted);
}

.profile-sessions__detail-label::after {
  content: ":";
}

.profile-sessions__action {
  flex-shrink: 0;
  min-width: 96px;
  justify-content: center;
}