/* ============================================================
   SocketChat — Telegram-inspired UI
   ============================================================ */

/* ── Local Inter font (place WOFF2 files in assets/fonts/) ──
   Run download_fonts.php once from a connected machine, or
   drop the files manually. App falls back to system fonts if
   the files are absent — no internet required either way.
   ──────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style:  normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Inter-Light.woff2')   format('woff2'),
       url('../fonts/Inter-Light.woff')    format('woff');
}
@font-face {
  font-family: 'Inter';
  font-style:  normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-Regular.woff2') format('woff2'),
       url('../fonts/Inter-Regular.woff')  format('woff');
}
@font-face {
  font-family: 'Inter';
  font-style:  normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Inter-Medium.woff2')  format('woff2'),
       url('../fonts/Inter-Medium.woff')   format('woff');
}
@font-face {
  font-family: 'Inter';
  font-style:  normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-SemiBold.woff2') format('woff2'),
       url('../fonts/Inter-SemiBold.woff')  format('woff');
}

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --sidebar-bg:     #2b3a4a;
  --sidebar-hover:  #3c4e62;
  --sidebar-active: #4a6278;
  --sidebar-text:   #c5d2dd;
  --sidebar-muted:  #8a9ab0;

  --chat-bg:        #efeae2;
  --msg-sent-bg:    #d9fdd3;
  --msg-recv-bg:    #ffffff;
  --msg-text:       #111b21;
  --msg-time:       #8696a0;

  --header-bg:      #2b3a4a;
  --header-text:    #ffffff;

  --accent:         #2AABEE;
  --accent-dark:    #1e90cc;
  --accent-light:   #e8f4fd;

  --online:         #49bf6e;
  --danger:         #e53935;

  --input-bg:       #f0f2f5;
  --border:         #e0e0e0;
  --shadow:         0 2px 12px rgba(0,0,0,.15);
  --radius:         10px;
  --radius-sm:      6px;

  /* Inter loads from /assets/fonts/ if present; otherwise falls through
     to the native system UI font — looks great on Windows, macOS, Linux
     Tahoma added for better Persian/Arabic support */
  --font: 'Inter', Tahoma, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--msg-text);
  background: var(--sidebar-bg);
  overflow: hidden;
}

/* Hide online status when using polling */
body.polling-mode .chat-header-status.online,
body.polling-mode .avatar-online::after {
  display: none !important;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea { font-family: var(--font); outline: none; }

.hidden { display: none !important; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.35); }

/* ── Auth Screen ────────────────────────────────────────────── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1c2b3a 0%, #2b3a4a 100%);
  padding: 20px;
}

.auth-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
}

.auth-logo-icon svg { width: 100%; height: 100%; display: block; }

.auth-logo h1 {
  font-size: 24px;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
}

.auth-logo p {
  font-size: 14px;
  color: #888;
}

.auth-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #111;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.form-group label .hint {
  font-weight: 400;
  color: #999;
}

.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #111;
  background: #fafafa;
  transition: border-color .2s;
}

.form-group input:focus {
  border-color: var(--accent);
  background: #fff;
}

.form-error {
  background: #fde8e8;
  color: var(--danger);
  border: 1px solid #f8c4c4;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.form-success {
  background: #e8f8ed;
  color: #2e7d32;
  border: 1px solid #b9e4c2;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: background .2s, transform .1s;
}

.btn-primary:hover  { background: var(--accent-dark); }
.btn-primary:active { transform: scale(.98); }

.btn-primary:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 10px 18px;
  background: var(--input-bg);
  color: #444;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: background .2s;
}
.btn-secondary:hover { background: #e0e3e8; }

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #888;
}

/* ── Main Layout ────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 320px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,.05);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--header-bg);
  min-height: 56px;
}

.my-avatar {
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.sidebar-actions {
  display: flex;
  gap: 4px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,.06);
  margin: 8px 10px;
  border-radius: 20px;
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--sidebar-muted);
  flex-shrink: 0;
}

.search-bar input {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 14px;
  flex: 1;
  min-width: 0;
}

.search-bar input::placeholder { color: var(--sidebar-muted); }
.search-bar input:focus { outline: none; }

/* ── Contact List ───────────────────────────────────────────── */
.contact-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
  position: relative;
}

.contact-item:hover    { background: var(--sidebar-hover); }
.contact-item.active   { background: var(--sidebar-active); }

.contact-item .avatar  { flex-shrink: 0; }

.contact-item-info {
  flex: 1;
  min-width: 0;
}

.contact-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contact-item-name {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.contact-item-time {
  font-size: 12px;
  color: var(--sidebar-muted);
  flex-shrink: 0;
}

.contact-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
}

.contact-item-preview {
  font-size: 13px;
  color: var(--sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 185px;
}

.unread-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.empty-contacts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--sidebar-muted);
  gap: 12px;
}

.empty-contacts svg { width: 64px; height: 64px; opacity: .4; }
.empty-contacts p   { font-size: 15px; font-weight: 500; color: var(--sidebar-text); }
.empty-contacts small { font-size: 13px; }

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar-img, .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  position: relative;
  flex-shrink: 0;
}

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

.avatar-online::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: var(--online);
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
}

/* ── Chat Area ──────────────────────────────────────────────── */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  position: relative;
  overflow: hidden;
}

.chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  color: #888;
  background: #f0f2f5;
}

.welcome-icon { margin-bottom: 20px; }
.welcome-icon svg { width: 80px; height: 80px; }

.chat-welcome h2 {
  font-size: 20px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}

.chat-welcome p { font-size: 14px; color: #999; max-width: 320px; }

/* ── Chat Header ────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--header-bg);
  min-height: 56px;
  flex-shrink: 0;
  z-index: 1;
}

.chat-header-avatar { flex-shrink: 0; }
.chat-header-avatar .avatar { width: 38px; height: 38px; font-size: 15px; }

.chat-header-info { flex: 1; min-width: 0; }

.chat-header-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-status {
  font-size: 13px;
  color: rgba(255,255,255,.6);
}

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

/* ── Messages ───────────────────────────────────────────────── */
.messages-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
}

.messages-list {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
}

/* date divider */
.msg-date-divider {
  text-align: center;
  margin: 12px 0;
}

.msg-date-divider span {
  background: rgba(0,0,0,.15);
  color: #fff;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
}

/* bubble */
.msg-row {
  display: flex;
  margin-bottom: 2px;
}

.msg-row.sent  { justify-content: flex-end; }
.msg-row.recv  { justify-content: flex-start; }

.msg-row + .msg-row.sent.new-group,
.msg-row + .msg-row.recv.new-group { margin-top: 10px; }

.msg-bubble {
  max-width: 65%;
  min-width: 80px;
  border-radius: 12px;
  padding: 7px 10px 6px;
  position: relative;
  word-break: break-word;
  line-height: 1.45;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

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

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

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
  float: right;
  clear: both;
  margin-left: 8px;
}

.msg-time {
  font-size: 11px;
  color: var(--msg-time);
  white-space: nowrap;
}

/* ✓✓ read receipts */
.msg-status {
  font-size: 12px;
  line-height: 1;
}

.msg-status svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.msg-status.sent { color: var(--msg-time); }
.msg-status.delivered { color: var(--msg-time); }
.msg-status.read { color: #53bdeb; }

.msg-status.sent svg { color: var(--msg-time); }
.msg-status.delivered svg { color: var(--msg-time); }
.msg-status.read svg { color: #53bdeb; }

/* ── Image in bubble ────────────────────────────────────────── */
.msg-image {
  max-width: 280px;
  max-height: 300px;
  border-radius: 8px;
  display: block;
  cursor: pointer;
  object-fit: cover;
  margin-bottom: 4px;
}

/* ── File bubble ────────────────────────────────────────────── */
.msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.04);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}

.msg-file:hover { background: rgba(0,0,0,.08); }

.msg-file-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg-file-icon svg { width: 20px; height: 20px; color: var(--accent); }

.msg-file-info { min-width: 0; }
.msg-file-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.msg-file-size { font-size: 12px; color: var(--msg-time); }

/* ── Typing indicator ───────────────────────────────────────── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--msg-recv-bg);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  margin-left: 4px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #aaa;
  border-radius: 50%;
  animation: typing-bounce .9s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

.msgs-loading {
  display: flex;
  justify-content: center;
  padding: 30px;
}

/* ── Composer ───────────────────────────────────────────────── */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 12px;
  background: #f0f2f5;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.composer-input-wrap {
  flex: 1;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--border);
  min-height: 40px;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.composer-input {
  width: 100%;
  padding: 9px 0;
  font-size: 15px;
  color: #111;
  line-height: 1.45;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.composer-input:empty::before {
  content: attr(data-placeholder);
  color: #aaa;
  pointer-events: none;
}

.btn-send {
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .1s;
}

.btn-send:hover  { background: var(--accent-dark); }
.btn-send:active { transform: scale(.93); }

.btn-send svg { width: 18px; height: 18px; }

/* ── Icon buttons ───────────────────────────────────────────── */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-muted);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.icon-btn svg { width: 20px; height: 20px; }

.composer .icon-btn {
  color: #8696a0;
  width: 38px;
  height: 38px;
}

.composer .icon-btn:hover { background: rgba(0,0,0,.06); color: var(--accent); }

.back-btn { display: none; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 { font-size: 17px; font-weight: 600; color: #111; }

.modal-header .icon-btn { color: #888; }
.modal-header .icon-btn:hover { background: #f5f5f5; color: #333; }

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #f0f0f0;
}

.modal-footer .btn-primary { width: auto; padding: 10px 24px; }

/* ── Profile ────────────────────────────────────────────────── */
.profile-avatar-big {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  margin: 0 auto 20px;
  overflow: hidden;
}

.profile-avatar-big img { width: 100%; height: 100%; object-fit: cover; }

/* ── Emoji Picker ───────────────────────────────────────────── */
.emoji-picker {
  position: fixed;
  z-index: 300;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  width: 340px;
  padding: 12px;
  bottom: 70px;
  left: 360px;
}

.emoji-categories {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.emoji-cat-btn {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 13px;
  color: #666;
  background: none;
  white-space: nowrap;
  transition: background .15s;
}

.emoji-cat-btn.active,
.emoji-cat-btn:hover { background: var(--accent-light); color: var(--accent); }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}

.emoji-btn {
  font-size: 22px;
  padding: 5px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: background .1s;
  line-height: 1;
}

.emoji-btn:hover { background: var(--input-bg); }

/* ── Dropdown menu ──────────────────────────────────────────── */
.dropdown-menu {
  position: fixed;
  z-index: 300;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  padding: 6px 0;
  min-width: 180px;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  font-size: 14px;
  color: #333;
  transition: background .1s;
}

.dropdown-item:hover { background: var(--input-bg); }
.dropdown-item.danger { color: var(--danger); }

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

/* ── Lightbox ───────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
}

.lightbox-close:hover { background: rgba(255,255,255,.2); }
.lightbox-close svg { color: #fff; }

#lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  border-radius: 8px;
  padding: 10px 18px 6px;
  z-index: 500;
  min-width: 200px;
  text-align: center;
  box-shadow: var(--shadow);
}

.toast-text { font-size: 13px; margin-bottom: 6px; }

.toast-progress {
  height: 3px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  overflow: hidden;
}

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

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0,0,0,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── File drop overlay ──────────────────────────────────────── */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(42,171,238,.15);
  border: 3px dashed var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}

.drop-overlay.active { opacity: 1; }

.drop-overlay span {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .sidebar {
    width: 100%;
    position: absolute;
    top: 0; left: 0; bottom: 0;
    z-index: 10;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
  }

  .sidebar.hidden-mobile {
    transform: translateX(-100%);
  }

  .chat-area {
    position: absolute;
    inset: 0;
  }

  .back-btn { display: flex; }

  .emoji-picker {
    left: 50%;
    transform: translateX(-50%);
    bottom: 60px;
    width: 95vw;
    max-width: 340px;
  }
}
