/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; -webkit-overflow-scrolling: touch; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
html, body { scrollbar-width: none; }
body {
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--text-primary);
  background: var(--bg-page);
}
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea { font: inherit; color: inherit; border: none; outline: none; background: none; }

/* === AUTH PAGE === */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: auto;
  background: linear-gradient(135deg, #1a1520 0%, #2a1530 50%, #1a1520 100%);
  position: relative;
}

.auth-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-heart {
  position: absolute;
  bottom: -20px;
  color: var(--heart);
  animation: floatUp linear forwards;
  pointer-events: none;
}

@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.1; }
  100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  text-align: center;
}

.auth-header { margin-bottom: 40px; }

.auth-heart-icon {
  color: var(--heart);
  margin-bottom: 16px;
  animation: heartPulse 1.5s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
}

.auth-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.auth-amp {
  font-size: 24px;
  color: var(--heart);
  font-weight: 300;
}

.user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.user-card:hover {
  background: rgba(212, 116, 138, 0.15);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(212, 116, 138, 0.2);
}

.user-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--heart));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
}

.user-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
}

.token-form {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.token-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.token-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.token-input-wrap input {
  flex: 1;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  font-size: 20px;
  text-align: center;
  letter-spacing: 8px;
  color: var(--text-white);
  transition: border-color 0.2s;
}

.token-input-wrap input:focus {
  border-color: var(--accent);
}

.token-input-wrap .btn-primary {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.error-msg {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
  margin-bottom: 8px;
}

.btn-back {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 8px;
  transition: color 0.2s;
}
.btn-back:hover { color: var(--text-primary); }

/* === BUTTONS === */
.btn-primary {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-icon-sm {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.btn-icon-sm:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger { background: var(--red); }
.btn-danger:hover { background: #a04040; }

/* === CHAT HEARTS === */
.chat-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* === CHAT LAYOUT === */
.chat-page {
  display: flex;
  height: 100vh;
  height: 100dvh;
  height: calc(var(--app-height, 100vh));
  overflow: hidden;
  position: relative;
  overscroll-behavior: none;
}
.chat-page::-webkit-scrollbar { display: none; }
.chat-page { scrollbar-width: none; }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* === CHAT HEADER === */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: var(--bg-main);
  flex-shrink: 0;
  gap: 12px;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-header-names {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-heart {
  color: var(--heart);
  font-size: 14px;
  animation: heartPulse 1.5s ease-in-out infinite;
}

.chat-header-status {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-header-status.online {
  color: #7cb87c;
}

.chat-header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-header-text {
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.btn-header-text:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-logout-header { color: var(--red); }

/* === SEARCH BAR === */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.search-input:focus { border-color: var(--accent); }

.search-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.search-results {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
}

.search-result-item {
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.search-result-item:hover { background: var(--bg-hover); }
.search-result-author { font-weight: 600; color: var(--accent); margin-right: 8px; }
.search-result-time { font-size: 11px; color: var(--text-muted); margin-right: 8px; }
.search-result-text { color: var(--text-secondary); font-size: 13px; }

/* === PINNED BANNER === */
.pinned-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.pinned-banner:hover { background: var(--bg-hover); }
.pinned-banner-icon { font-size: 14px; color: var(--accent); }
.pinned-banner-content { flex: 1; min-width: 0; }
.pinned-banner-author { font-weight: 600; color: var(--accent); margin-right: 6px; font-size: 12px; }
.pinned-banner-text { color: var(--text-secondary); font-size: 12px; }
.pinned-banner-counter { font-size: 11px; color: var(--text-muted); }

/* === MESSAGES AREA === */
.messages-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

/* Scrollbar */
.messages-area::-webkit-scrollbar { width: 6px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }
.messages-area::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

/* === MESSAGE BUBBLE === */
.msg {
  max-width: 55%;
  padding: 0;
  position: relative;
}

.msg.own { align-self: flex-end; }
.msg.other { align-self: flex-start; }

.msg.continued { margin-top: -2px; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
  padding: 0 4px;
}

.msg.continued .msg-meta { display: none; }

.msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.msg-avatar-initials {
  background: linear-gradient(135deg, var(--accent), var(--heart));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.msg-meta-name { font-weight: 600; color: var(--text-secondary); }
.msg-meta-status { color: var(--text-muted); font-size: 11px; font-style: italic; margin-left: 6px; }
.msg-meta-time { color: var(--text-muted); margin-left: 6px; }

.msg-ticks {
  margin-left: 4px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: -2px;
}
.msg-ticks.read { color: var(--heart); }

.msg-bubble {
  padding: 8px 14px;
  border-radius: var(--radius);
  word-wrap: break-word;
  overflow-wrap: break-word;
  position: relative;
}

.msg.own .msg-bubble {
  background: var(--bg-message-own);
  color: var(--text-own);
  border-bottom-right-radius: 4px;
}

.msg.other .msg-bubble {
  background: var(--bg-message);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

/* Reply quote */
.msg-reply-quote {
  padding: 6px 10px;
  margin-bottom: 6px;
  border-left: 3px solid var(--accent);
  background: rgba(255,255,255,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-size: 12px;
}

.msg-reply-quote-author {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.msg-reply-quote-text {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

/* Image messages */
.msg-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: block;
}

/* File messages */
.msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s;
}
.msg-file:hover { background: rgba(255,255,255,0.1); }
.msg-file-icon { font-size: 24px; }
.msg-file-info { display: flex; flex-direction: column; min-width: 0; }
.msg-file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-file-size { font-size: 11px; color: var(--text-muted); }

/* Edited */
.msg-edited { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* Date separator */
.msg-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  align-self: center;
}

.msg-date-separator span {
  padding: 4px 16px;
  background: var(--bg-input);
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Message highlight (scroll to) */
.msg-highlight .msg-bubble {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  animation: highlightFade 1.5s ease;
}

@keyframes highlightFade {
  0% { outline-color: var(--accent); }
  100% { outline-color: transparent; }
}

/* Search highlight */
.msg-search-highlight {
  background: rgba(212, 116, 138, 0.3);
  border-radius: 2px;
  padding: 0 2px;
}

/* Unread divider */
.unread-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  position: relative;
  align-self: stretch;
}

.unread-divider::before,
.unread-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--accent);
  opacity: 0.3;
  margin: 0 12px;
}

/* === REACTIONS === */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.reaction-badge {
  padding: 2px 8px;
  font-size: 13px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.reaction-badge:hover { background: rgba(255,255,255,0.15); }
.reaction-badge.mine { border-color: var(--accent); background: rgba(212, 116, 138, 0.15); }

/* === LINK PREVIEW === */
.link-preview {
  display: flex;
  gap: 10px;
  padding: 8px;
  margin-top: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.link-preview:hover { background: rgba(255,255,255,0.1); }
.link-preview-image { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.link-preview-text { min-width: 0; }
.link-preview-title { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.link-preview-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-preview-domain { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* === MARKDOWN === */
.msg-code-block {
  background: rgba(0,0,0,0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin: 4px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre;
}
.msg-inline-code {
  background: rgba(0,0,0,0.3);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.mention, .mention-me {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.mention-me { background: rgba(212, 116, 138, 0.15); padding: 0 4px; border-radius: 3px; }

/* === TYPING INDICATOR === */
.typing-indicator {
  padding: 4px 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  flex-shrink: 0;
}

/* === REPLY / EDIT PREVIEW === */
.reply-preview {
  padding: 0 16px 4px;
  flex-shrink: 0;
}

.reply-preview-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.edit-preview-inner { border-left-color: var(--yellow); }

.reply-preview-text { flex: 1; min-width: 0; }
.reply-preview-author { font-weight: 600; color: var(--accent); font-size: 12px; display: block; }
.reply-preview-content { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.reply-cancel {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 14px;
  transition: background 0.15s;
}
.reply-cancel:hover { background: var(--bg-hover); }

/* === INPUT AREA === */
.input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-main);
  flex-shrink: 0;
}

.file-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.file-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.message-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: none;
  max-height: 160px;
  min-height: 40px;
  color: var(--text-primary);
  transition: border-color 0.15s;
}
.message-input::-webkit-scrollbar { display: none; }
.message-input { scrollbar-width: none; }
.message-input:focus { border-color: var(--accent); }
.message-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* === DRAG OVERLAY === */
.drag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 21, 32, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.drag-overlay-inner {
  padding: 32px 48px;
  background: var(--bg-input);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 16px;
}

/* === CONTEXT MENU === */
.context-menu {
  position: fixed;
  z-index: 200;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 180px;
  padding: 4px 0;
}

.context-menu-reactions {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  flex-wrap: wrap;
}

.ctx-emoji {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.1s;
}
.ctx-emoji:hover { background: var(--bg-hover); }

.context-menu-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.context-menu-item {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text-primary);
}
.context-menu-item:hover { background: var(--bg-hover); }
.context-menu-item.danger { color: var(--red); }

/* === MODALS === */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
}

.modal-box {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.modal-box h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-white);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.field input {
  padding: 10px 12px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--accent); }

/* === READERS MODAL === */
.readers-list { max-height: 200px; overflow-y: auto; }
.reader-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.reader-name { font-weight: 500; }
.reader-time { font-size: 12px; color: var(--text-muted); }
.readers-empty { text-align: center; color: var(--text-muted); padding: 16px; }

/* === PROFILE MODAL === */
.profile-avatar-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-avatar-preview {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--heart));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: white;
  overflow: hidden; flex-shrink: 0;
}
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-btn { font-size: 12px; padding: 8px 12px; cursor: pointer; }

/* === BOOKMARKS PANEL === */
.bookmarks-panel {
  position: absolute;
  right: 0;
  top: var(--header-height);
  bottom: 0;
  width: 300px;
  max-width: 90vw;
  background: var(--bg-input);
  border-left: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}

.bookmarks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}

.bookmarks-list { flex: 1; overflow-y: auto; padding: 8px; }
.bookmarks-empty { text-align: center; color: var(--text-muted); padding: 24px; }

.bookmark-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 4px;
}
.bookmark-item:hover { background: var(--bg-hover); }
.bookmark-header { font-weight: 600; font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.bookmark-text { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === LIGHTBOX === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
}

.lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}

/* === NOTIFICATION TOASTS === */
.notif-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-toast {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: slideIn 0.3s ease;
  max-width: 300px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.notif-toast-author { font-weight: 600; font-size: 13px; color: var(--accent); margin-bottom: 2px; }
.notif-toast-text { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === UPLOAD TOASTS === */
.upload-toasts {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upload-toast {
  padding: 8px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: var(--shadow);
}

/* === PWA INSTALL BANNER === */
#pwa-install-banner {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  transition: bottom 0.3s ease;
}
#pwa-install-banner.visible { bottom: 16px; }

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pwa-banner-icon { width: 40px; height: 40px; border-radius: 8px; }
.pwa-banner-text { display: flex; flex-direction: column; }
.pwa-banner-text strong { font-size: 14px; color: var(--text-white); }
.pwa-banner-text span { font-size: 12px; color: var(--text-secondary); }
.pwa-banner-install { padding: 8px 16px; background: var(--accent); color: white; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; white-space: nowrap; }
.pwa-banner-close { font-size: 20px; color: var(--text-muted); padding: 4px; flex-shrink: 0; }

/* iOS specific banner */
.pwa-ios .pwa-banner-content { flex-wrap: wrap; }
.pwa-ios-content { flex-direction: column; align-items: flex-start; position: relative; }
.pwa-ios-content .pwa-banner-close { position: absolute; top: 8px; right: 8px; }
.pwa-ios-steps { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.pwa-ios-step { font-size: 13px; color: var(--text-primary); line-height: 1.5; }

/* === MENTION DROPDOWN === */
.mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 120px;
  overflow-y: auto;
}

/* === STICKERS === */
.stickers-panel {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-input);
  flex-shrink: 0;
}

.stickers-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.sticker-item {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  object-fit: cover;
  flex-shrink: 0;
}
.sticker-item:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(212, 116, 138, 0.3);
}

.sticker-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.sticker-btn:hover { background: var(--bg-hover); }

/* Sticker messages */
.msg-sticker {
  max-width: 150px;
  max-height: 150px;
  border-radius: var(--radius-sm);
  display: block;
}

.msg-bubble-sticker {
  background: transparent !important;
  padding: 4px !important;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .msg { max-width: 80%; }
  .chat-header-actions { gap: 2px; }
  .btn-header-text { padding: 4px 4px; font-size: 10px; }
  .bookmarks-panel { width: 100%; }
  .chat-header-names { font-size: 14px; }
}
