/* ============================================================
   CONTEXT MENU
   ============================================================ */
.ctx-menu {
  position: fixed;
  z-index: 800;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 4px;
  min-width: 190px;
  animation: fadeIn 0.12s ease;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  color: var(--txt);
  font-size: 13.5px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background var(--ease);
  cursor: pointer;
}
.ctx-item:hover { background: var(--bg3); }
.ctx-item.danger { color: var(--danger); }
.ctx-item svg { flex-shrink: 0; color: var(--txt2); }
.ctx-item.danger svg { color: var(--danger); }

.ctx-divider {
  height: 1px;
  background: var(--border);
  margin: 3px 0;
}

/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */
.modal-overlay {
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
  padding: 16px;
}

.modal-box {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--txt3);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease);
}
.modal-close-btn:hover { background: var(--bg3); color: var(--txt); }

.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-body p {
  font-size: 14px;
  color: var(--txt2);
  line-height: 1.6;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}

/* ── Мобильный bottom sheet для профиля собеседника ─────── */
@media (max-width: 768px) {
  .modal-overlay.bottom-sheet {
    align-items: flex-end;
    padding: 0;
  }

  .modal-overlay.bottom-sheet .modal-box {
    max-width: 100%;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpSheet 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }

  /* Шапка фиксирована, контент скроллится */
  .modal-overlay.bottom-sheet .modal-box > div:not([id="user-profile-drag-handle"]):not(:first-child):not(:last-child),
  .modal-overlay.bottom-sheet .sheet-scroll {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
  }
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Скрываем drag handle на десктопе */
@media (min-width: 769px) {
  #user-profile-drag-handle { display: none !important; }
}

.modal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--txt);
  user-select: none;
}
.modal-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Join chat info block */
.join-chat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
}
.join-chat-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.join-chat-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--txt);
}
.join-chat-meta {
  font-size: 13px;
  color: var(--txt3);
}

/* Кнопки модалок */
.btn-ghost {
  padding: 9px 18px;
  border: 1.5px solid var(--border2);
  border-radius: var(--r-sm);
  background: none;
  color: var(--txt2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
}
.btn-ghost:hover { background: var(--bg3); color: var(--txt); }

.btn-danger {
  padding: 9px 18px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
}
.btn-danger:hover { background: #dc2626; }

/* ============================================================
   ПРАВАЯ ПАНЕЛЬ — доработки
   ============================================================ */
.rp-chat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.rp-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.rp-chat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
}

.rp-chat-handle {
  font-size: 12.5px;
  color: var(--txt3);
}

.rp-section-title {
  padding: 12px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt3);
}

.rp-actions {
  padding: 8px 12px 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.rp-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--ease);
}
.rp-action-btn.danger { color: var(--danger); }
.rp-action-btn.danger:hover { background: rgba(239,68,68,0.08); }

/* ============================================================
   REPLY PREVIEW (над полем ввода)
   ============================================================ */
.reply-preview {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 6px;
  background: var(--accent-light);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.rp-accent {
  width: 3px;
  background: var(--accent);
  align-self: stretch;
  flex-shrink: 0;
}

.rp-content {
  flex: 1;
  padding: 7px 10px;
  min-width: 0;
}

.rp-sender {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1px;
}

.rp-text {
  font-size: 12.5px;
  color: var(--txt2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-close {
  border: none;
  background: none;
  color: var(--txt3);
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color var(--ease);
  flex-shrink: 0;
}
.rp-close:hover { color: var(--txt); }

/* ============================================================

/* ============================================================
   ПАНЕЛЬ: вспомогательные элементы
   ============================================================ */

.panel-section-title {
  padding: 10px 14px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--txt3);
}

.panel-empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  text-align: center;
  color: var(--txt3);
}
.panel-empty-hint svg { opacity: 0.5; }
.panel-empty-hint p { font-size: 13px; line-height: 1.6; }
.panel-empty-hint strong { color: var(--txt2); }

/* Поиск — подсказка до ввода */
.search-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 16px;
  text-align: center;
  color: var(--txt3);
}
.search-hint svg { opacity: 0.45; }
.search-hint p { font-size: 13px; line-height: 1.6; }

/* Контакты — кнопка написать */
.contact-msg-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--txt3);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--ease);
}
.contact-msg-btn:hover { background: var(--accent-light); color: var(--accent); }

/* ============================================================
   УВЕДОМЛЕНИЯ в панели
   ============================================================ */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--ease);
  position: relative;
}
.notif-item:hover { background: var(--bg2); }
.notif-item.unread { background: var(--accent-light); }
.notif-item.unread:hover { background: var(--accent-light2); }

.notif-body { flex: 1; min-width: 0; }

.notif-text {
  font-size: 13px;
  color: var(--txt);
  line-height: 1.5;
  margin-bottom: 3px;
}
.notif-text strong { font-weight: 600; }

.notif-time {
  font-size: 11px;
  color: var(--txt3);
}

.notif-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

/* ============================================================
   НАСТРОЙКИ в панели
   ============================================================ */
.settings-group {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.settings-group:last-child { border-bottom: none; }

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--txt);
  transition: background var(--ease);
}
.settings-item:hover { background: var(--bg3); }
.settings-item.danger { color: var(--danger); }
.settings-item.danger .settings-icon { opacity: 0.9; }

.settings-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.settings-item > span:not(.settings-badge) {
  flex: 1;
  font-size: 13.5px;
}

.settings-arrow {
  color: var(--txt3);
  flex-shrink: 0;
}

/* ============================================================
   ПРАВАЯ ПАНЕЛЬ — профиль собеседника (личный диалог)
   ============================================================ */

.rp-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px 18px;
  border-bottom: 1px solid var(--border);
}

.rp-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.rp-profile-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--txt);
}

.rp-profile-handle {
  font-size: 13px;
  color: var(--txt3);
}

.rp-profile-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--success);
  margin-top: 2px;
}

/* Быстрые действия под аватаром */
.rp-quick-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.rp-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
  border: none;
  background: var(--bg3);
  border-radius: var(--r-md);
  color: var(--txt2);
  font-size: 11.5px;
  cursor: pointer;
  transition: all var(--ease);
  flex: 1;
  max-width: 90px;
}
.rp-quick-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.rp-quick-btn svg { flex-shrink: 0; }

/* Секция с информацией */
.rp-info-section {
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
}

.rp-section-label {
  padding: 10px 14px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--txt3);
}

.rp-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--txt2);
}
.rp-info-row svg { flex-shrink: 0; color: var(--txt3); }

.rp-info-label {
  font-size: 11px;
  color: var(--txt3);
  margin-bottom: 1px;
}

.rp-info-value {
  font-size: 13.5px;
  color: var(--txt);
}

/* Опасные действия внизу */
.rp-danger-section {
  padding: 8px 10px;
  margin-top: 4px;
}


/* ============================================================
   МОДАЛКА УПРАВЛЕНИЯ УЧАСТНИКОМ
   ============================================================ */
.modal-member-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.modal-member-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-member-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--txt);
}

.modal-member-handle {
  font-size: 12px;
  color: var(--txt3);
  margin-top: 1px;
}

/* Кнопки действий внутри модалки участника */
.member-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  background: none;
  color: var(--txt);
  font-size: 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--ease);
  text-align: left;
}
.member-action-btn:hover { background: var(--bg3); }
.member-action-btn.danger { color: var(--danger); }

.mab-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.mab-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 12px;
}

/* ============================================================
   ЧЁРНЫЙ СПИСОК — модалка
   ============================================================ */
.blacklist-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--txt3);
}

.blacklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
}
.blacklist-item:hover { background: var(--bg2); }

.bl-unblock-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1.5px solid var(--border2);
  border-radius: var(--r-sm);
  background: none;
  color: var(--txt2);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--ease);
  flex-shrink: 0;
}
.bl-unblock-btn:hover {
  border-color: var(--success);
  color: var(--success);
}

.blacklist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  color: var(--txt3);
  text-align: center;
}
.blacklist-empty svg { opacity: 0.4; }

/* ============================================================
   НАСТРОЙКИ — badge и участники
   ============================================================ */
.settings-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  padding: 2px 8px;
  flex-shrink: 0;
  flex-grow: 0;
  width: auto;
  line-height: 1.4;
}

/* Участник с стрелкой */
.participant-clickable { transition: background var(--ease); }
.participant-clickable:hover { background: var(--bg3); border-radius: var(--r-sm); }

.participant-chevron {
  color: var(--txt3);
  flex-shrink: 0;
  margin-left: auto;
}

/* ============================================================
   ПРАВАЯ ПАНЕЛЬ — кнопка чёрного списка чата
   ============================================================ */
.rp-ban-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  padding: 2px 7px;
  flex-shrink: 0;
}

/* ============================================================
   УВЕДОМЛЕНИЯ — кнопка закрытия и иконка
   ============================================================ */
.notification {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-close {
  border: none;
  background: none;
  color: var(--txt3);
  font-size: 18px;
  line-height: 1;
  padding: 0 0 0 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: color var(--ease);
}
.notif-close:hover { color: var(--txt); }

/* icon-eye-off для поля пароля */
.icon-eye-off::before { content: "🙈"; font-style: normal; font-size: 13px; }


/* ============================================================
   УВЕДОМЛЕНИЯ — кнопка закрытия и иконка
   ============================================================ */
.notification {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-close {
  border: none;
  background: none;
  color: var(--txt3);
  font-size: 18px;
  line-height: 1;
  padding: 0 0 0 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: color var(--ease);
}
.notif-close:hover { color: var(--txt); }

/* icon-eye-off для поля пароля */
.icon-eye-off::before { content: "🙈"; font-style: normal; font-size: 13px; }


/* ============================================================
   IMAGE VIEWER
   ============================================================ */
.img-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: fadeIn 0.15s ease;
}

.img-viewer-controls {
  display: flex;
  gap: 8px;
  position: absolute;
  top: 16px;
  right: 16px;
}

.img-viewer-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-sm);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
}
.img-viewer-btn:hover { background: rgba(255,255,255,0.15); }

.img-viewer-wrap {
  max-width: 90vw;
  max-height: 78vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-viewer-img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--r-sm);
  transition: transform 0.15s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.img-viewer-footer {
  display: flex;
  gap: 12px;
  align-items: center;
}

.img-viewer-name {
  font-size: 13.5px;
  color: rgba(255,255,255,0.85);
}

.img-viewer-size {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   DRAG & DROP — состояние перетаскивания
   ============================================================ */
.chat-area.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
  background: var(--accent-light);
}

.chat-area.drag-over::after {
  content: 'Отпустите для отправки файла';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  pointer-events: none;
  border-radius: var(--r-md);
}

/* ============================================================
   UPLOAD TOAST — прогресс загрузки файла
   ============================================================ */
.upload-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  width: 280px;
  animation: slideRight 0.2s ease;
  position: relative;
}

.ut-preview {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ut-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ut-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ut-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ut-size {
  font-size: 11px;
  color: var(--txt3);
}

.ut-bar-wrap {
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

.ut-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.ut-status {
  font-size: 11px;
  color: var(--txt3);
}

.ut-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  color: var(--txt3);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--ease);
  padding: 0;
  line-height: 1;
}
.ut-close:hover { background: var(--bg3); color: var(--txt); }

/* ============================================================
   JOIN CHAT BANNER — баннер для незарегистрированных в чате
   ============================================================ */
.join-chat-banner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 32px;
  text-align: center;
  background: var(--bg3);
}

.jcb-avatar {
  width: 72px;
  height: 72px;
  color: #fff;
  font-weight: 700;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.jcb-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--txt);
}

.jcb-meta {
  font-size: 13px;
  color: var(--txt3);
}

.jcb-desc {
  font-size: 14px;
  color: var(--txt2);
  max-width: 300px;
  line-height: 1.6;
  margin: 4px 0 8px;
}

.jcb-btn {
  padding: 12px 32px;
  font-size: 15px;
}

/* ── Settings icons (Tabler) ─────────────────────────────── */
.settings-icon i {
  font-size: 18px;
  color: #ffffff;
  line-height: 1;
}

/* ── Profile modal ───────────────────────────────────────── */
.profile-modal {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--bg1);
  padding: 0;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #6366f1;
}

.profile-back-btn,
.profile-edit-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-back-btn:hover,
.profile-edit-btn:hover {
  background: rgba(255,255,255,0.25);
}

.profile-hero {
  background: #6366f1;
  padding: 0 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-avatar-wrap {
  position: relative;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 500;
  color: #fff;
}

.profile-name {
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 4px;
}

.profile-handle {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  margin: 0;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 0.5px solid var(--border);
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px;
}

.profile-stat + .profile-stat {
  border-left: 0.5px solid var(--border);
}

.profile-stat-val {
  font-size: 20px;
  font-weight: 500;
  color: var(--txt1);
}

.profile-stat-label {
  font-size: 11px;
  color: var(--txt3);
  margin-top: 2px;
}

.profile-section {
  padding: 16px 20px;
  border-top: 0.5px solid var(--border);
}

.profile-section-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 12px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
}

.profile-row:last-child { border-bottom: none; }

.profile-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.profile-row-label {
  font-size: 11px;
  color: var(--txt3);
  margin: 0;
}

.profile-row-val {
  font-size: 14px;
  color: var(--txt1);
  margin: 2px 0 0;
}

.profile-danger-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 0.5px solid var(--border);
  background: var(--bg2);
  color: #dc2626;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-danger-btn:hover { background: #fef2f2; }

/* ── Toggle switch ───────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: 12px;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: #6366f1;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
