/* ================================================
   SECURECHAT v3.1 — All Bugs Fixed
   Fix 1: Emoji picker uses position:fixed (no clip issue)
   Fix 2: Mobile viewport 100dvh / fallback
   Fix 3: Input area always at bottom
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1a1a25;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --accent: #25d366;
  --accent2: #128c7e;
  --accent-glow: rgba(37,211,102,0.25);
  --sent-bg: linear-gradient(135deg, #1e7e4e, #25d366);
  --recv-bg: #1e1e2e;
  --text: #e8e8f0;
  --text-muted: #7a7a9a;
  --danger: #ff4757;
  --danger-glow: rgba(255,71,87,0.3);
  --shadow: 0 8px 40px rgba(0,0,0,0.6);
  --transition: 0.2s ease;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- RESET ---- */
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Mobile: use dvh if available, fallback to 100% */
html { height: 100dvh; }
body { height: 100dvh; }
@supports not (height: 100dvh) {
  html, body { height: 100vh; }
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

/* ================================================
   SCREENS
   ================================================ */
.screen {
  display: none; position: absolute;
  inset: 0; width: 100%; height: 100%;
}
.screen.active { display: flex; }

/* ================================================
   LOGIN / CONNECT BG
   ================================================ */
#loginScreen, #connectScreen {
  align-items: center; justify-content: center;
  position: relative;
  overflow-y: auto; overflow-x: hidden;
  background:
    radial-gradient(ellipse at 20% 50%, #0d2818 0%, #0a0a0f 60%),
    radial-gradient(ellipse at 80% 20%, #0d1a2e 0%, transparent 50%);
  padding: 20px;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.login-blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.12;
  animation: blobFloat 8s ease-in-out infinite;
}
.blob1 { width: 400px; height: 400px; background: #25d366; top: -150px; left: -100px; }
.blob2 { width: 350px; height: 350px; background: #128c7e; bottom: -100px; right: -80px; animation-delay: 3s; }
.blob3 { width: 250px; height: 250px; background: #007bff; top: 50%; left: 50%; animation-delay: 6s; }
@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(20px,-30px) scale(1.05); }
  66% { transform: translate(-15px,15px) scale(0.95); }
}

/* ================================================
   LOGIN CARD
   ================================================ */
.login-card {
  position: relative; z-index: 10;
  width: 100%; max-width: 420px;
  padding: 32px 28px; border-radius: 28px;
  border: 1px solid rgba(37,211,102,0.15);
  box-shadow: 0 25px 80px rgba(0,0,0,0.7), 0 0 60px rgba(37,211,102,0.05);
  animation: slideUp 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo { text-align: center; margin-bottom: 24px; }
.logo-icon { font-size: 48px; margin-bottom: 10px; display: block; animation: iconPulse 3s ease-in-out infinite; }
@keyframes iconPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.login-logo h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.tabs { display: flex; gap: 4px; background: var(--surface); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 10px; border: none; border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: all var(--transition); color: var(--text-muted); background: transparent; }
.tab-btn.active { background: var(--accent); color: #000; box-shadow: 0 4px 15px var(--accent-glow); }

.form-section { display: flex; flex-direction: column; gap: 12px; }
.form-section.hidden { display: none; }

.input-group {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 13px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-icon { font-size: 18px; flex-shrink: 0; }
.input-group input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 15px; color: var(--text); min-width: 0;
}
.input-group input::placeholder { color: var(--text-muted); }

.toggle-pass {
  background: none; border: none; cursor: pointer;
  font-size: 16px; padding: 2px; opacity: 0.5;
  transition: opacity var(--transition); flex-shrink: 0;
}
.toggle-pass:hover { opacity: 1; }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #000; font-family: inherit; font-size: 15px; font-weight: 600;
  transition: all var(--transition); margin-top: 2px;
  box-shadow: 0 4px 20px var(--accent-glow);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.6; pointer-events: none; }
.btn-arrow { font-size: 18px; transition: transform var(--transition); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.error-msg { color: var(--danger); font-size: 13px; text-align: center; min-height: 16px; }
.register-note { font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.5; padding: 6px 4px; }
.register-note strong { color: var(--accent); }

.quick-logins, .quick-connect { margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ql-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ql-btn {
  background: var(--surface2); border: 1px solid var(--glass-border);
  color: var(--text-muted); border-radius: 20px; padding: 6px 12px;
  font-size: 12px; cursor: pointer; transition: all var(--transition);
  font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.ql-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ================================================
   CONNECT CARD
   ================================================ */
.connect-card {
  position: relative; z-index: 10;
  width: 100%; max-width: 440px;
  padding: 28px; border-radius: 28px;
  border: 1px solid rgba(37,211,102,0.15);
  box-shadow: 0 25px 80px rgba(0,0,0,0.7);
  animation: slideUp 0.5s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; flex-direction: column; gap: 14px;
}
.connect-topbar { display: flex; align-items: center; gap: 12px; }
.back-btn {
  background: var(--surface); border: 1px solid var(--glass-border);
  color: var(--text-muted); padding: 8px 12px; border-radius: 10px;
  cursor: pointer; font-family: inherit; font-size: 13px; transition: all var(--transition);
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); }
#connectWelcome { font-weight: 600; font-size: 15px; flex: 1; }

.my-id-section {
  background: var(--surface); border-radius: 16px; padding: 18px;
  text-align: center; border: 1px solid var(--glass-border);
}
.uid-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; }
.uid-display {
  font-size: 36px; font-weight: 700; letter-spacing: 8px; color: var(--accent);
  font-variant-numeric: tabular-nums; margin-bottom: 10px;
  text-shadow: 0 0 30px var(--accent-glow);
}
.copy-uid-btn {
  background: var(--accent-glow); border: 1px solid var(--accent);
  color: var(--accent); padding: 7px 18px; border-radius: 20px;
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  transition: all var(--transition);
}
.copy-uid-btn:hover { background: var(--accent); color: #000; }
.uid-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.connect-divider { text-align: center; font-size: 11px; color: var(--text-muted); letter-spacing: 1px; }

/* ================================================
   CHAT SCREEN — KEY FIX: Use flex column on full height
   ================================================ */
#chatScreen {
  display: none;
  flex-direction: row;
  width: 100%; height: 100%;
  overflow: hidden;
}
#chatScreen.active { display: flex; }

/* ---- SIDEBAR OVERLAY ---- */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(3px);
  display: none;
}
.sidebar-overlay.show { display: block; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: 280px; min-width: 260px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--glass-border);
  background: rgba(13,13,20,0.97);
  flex-shrink: 0;
  z-index: 201;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px; border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.my-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #000; flex-shrink: 0;
}
.my-info { flex: 1; overflow: hidden; }
.my-info span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-info span:first-child { font-weight: 600; font-size: 13px; }
.my-uid-small { font-size: 11px; color: var(--accent); font-weight: 600; }

.chat-list-label { padding: 10px 14px 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }

.chat-contact-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin: 4px 6px; border-radius: 12px;
  background: rgba(37,211,102,0.05); border: 1px solid rgba(37,211,102,0.1);
  cursor: pointer; transition: background var(--transition);
}
.chat-contact-card:hover { background: rgba(37,211,102,0.1); }
.contact-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #3a1a8c, #6c3adf);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; color: #fff; flex-shrink: 0;
}
.contact-info { flex: 1; overflow: hidden; }
.contact-name { display: block; font-weight: 600; font-size: 13px; }
.contact-last-msg { display: block; font-size: 11px; color: var(--text-muted); }
.contact-uid { display: block; font-size: 11px; color: var(--accent); font-weight: 600; }
.sidebar-footer {
  padding: 12px 14px; margin-top: auto;
  font-size: 11px; color: var(--text-muted);
  border-top: 1px solid var(--glass-border); text-align: center;
}

/* ---- CHAT AREA — KEY FIX ---- */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* NO overflow:hidden here — that was clipping emoji picker */
  min-width: 0;
  min-height: 0;
  position: relative;  /* needed for emoji picker fixed ancestor */
}

.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(13,13,20,0.97);
  flex-shrink: 0;
  z-index: 10;
}
.hamburger { display: none; margin-right: 2px; font-size: 18px; }
.header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #3a1a8c, #6c3adf);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.header-info { flex: 1; overflow: hidden; }
.header-info h2 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-status { font-size: 11px; color: var(--accent); white-space: nowrap; }
.header-actions { display: flex; gap: 4px; flex-shrink: 0; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--glass); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); color: var(--text);
  -webkit-tap-highlight-color: transparent; flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.1); }
.logout-btn:hover { background: rgba(255,71,87,0.15); color: var(--danger); }

/* ---- MESSAGES ---- */
.messages-container {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  min-height: 0; /* critical for flex child scroll */
}
.messages-container::-webkit-scrollbar { width: 3px; }
.messages-container::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

.empty-chat {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); text-align: center; gap: 10px; margin: auto;
  pointer-events: none;
}
.empty-icon { font-size: 48px; opacity: 0.3; }
.empty-chat h3 { font-size: 16px; font-weight: 600; }
.empty-chat p  { font-size: 13px; }

.message-wrapper {
  display: flex; flex-direction: column;
  max-width: 75%;
  animation: msgIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.message-wrapper.sent     { align-self: flex-end;   align-items: flex-end; }
.message-wrapper.received { align-self: flex-start;  align-items: flex-start; }

.message-bubble { padding: 9px 13px; border-radius: 18px; word-break: break-word; max-width: 100%; }
.sent     .message-bubble { background: var(--sent-bg); color: #000; border-bottom-right-radius: 4px; box-shadow: 0 3px 12px rgba(37,211,102,0.2); }
.received .message-bubble { background: var(--recv-bg); color: var(--text); border-bottom-left-radius: 4px; border: 1px solid var(--glass-border); }

.msg-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.msg-photo { max-width: 240px; max-height: 280px; border-radius: 12px; cursor: pointer; display: block; transition: transform var(--transition); width: 100%; object-fit: cover; }
.msg-photo:hover { transform: scale(1.02); }
.msg-caption { font-size: 12px; margin-top: 4px; }

.msg-meta { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.msg-status { color: #25d366; }
.msg-delete-btn { background: none; border: none; cursor: pointer; font-size: 11px; color: transparent; transition: color var(--transition); padding: 2px 3px; }
.message-wrapper:hover .msg-delete-btn { color: var(--danger); }

.date-divider { text-align: center; font-size: 11px; color: var(--text-muted); position: relative; margin: 8px 0; padding: 0 10px; flex-shrink: 0; }
.date-divider::before, .date-divider::after { content: ''; position: absolute; top: 50%; width: 30%; height: 1px; background: var(--glass-border); }
.date-divider::before { left: 0; }
.date-divider::after  { right: 0; }

/* ---- TYPING ---- */
.typing-bar { padding: 5px 16px; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 26px; }
.typing-dots { display: flex; gap: 3px; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: typingDot 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---- INPUT AREA — ALWAYS VISIBLE ---- */
.input-area {
  flex-shrink: 0;
  padding: 8px 10px;
  padding-bottom: calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--glass-border);
  background: rgba(10,10,15,0.98);
  position: relative; /* for emoji picker */
  z-index: 30;
}

.image-preview-container {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; padding: 8px 10px;
  background: var(--surface); border-radius: 12px;
  border: 1px dashed var(--accent);
}
.image-preview-container img { height: 52px; width: auto; border-radius: 8px; object-fit: cover; }
.preview-label { font-size: 12px; color: var(--accent); flex: 1; }
.remove-img-btn {
  background: var(--danger); color: #fff; border: none;
  border-radius: 50%; width: 22px; height: 22px;
  cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ================================================
   EMOJI PICKER — FIX: position:fixed so nothing clips it
   ================================================ */
.emoji-picker {
  position: fixed;       /* KEY FIX — was absolute, got clipped */
  bottom: 0;             /* will be set by JS dynamically */
  left: 0; right: 0;
  background: rgba(15,15,22,0.99);
  border-top: 1px solid var(--glass-border);
  z-index: 500;          /* above everything */
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
.emoji-tabs {
  display: flex; gap: 2px;
  padding: 10px 10px 6px;
  border-bottom: 1px solid var(--glass-border);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: rgba(20,20,30,0.98);
}
.emoji-tabs::-webkit-scrollbar { display: none; }
.etab {
  background: none; border: none; font-size: 20px;
  padding: 6px 9px; border-radius: 8px; cursor: pointer;
  transition: background var(--transition); flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.etab.active { background: var(--surface2); }
.etab:hover  { background: var(--surface2); }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 2px; padding: 8px;
  height: 200px;           /* fixed height, not max-height */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(15,15,22,0.99);
}
.emoji-cell {
  font-size: 24px; text-align: center; padding: 5px 2px;
  border-radius: 8px; cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  border: none; background: none; line-height: 1; display: block;
  -webkit-tap-highlight-color: transparent; width: 100%;
}
.emoji-cell:hover  { background: var(--surface2); }
.emoji-cell:active { transform: scale(1.3); background: var(--surface2); }

/* ---- INPUT ROW ---- */
.input-row { display: flex; align-items: flex-end; gap: 6px; }
.attach-btn { font-size: 20px; cursor: pointer; }
.emoji-btn  { font-size: 20px; }

textarea#messageInput {
  flex: 1; background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 22px; padding: 10px 14px;
  color: var(--text); font-family: inherit; font-size: 14px;
  resize: none; outline: none;
  max-height: 100px; overflow-y: auto;
  transition: border-color var(--transition);
  min-height: 42px;
  -webkit-appearance: none;
  line-height: 1.4;
}
textarea#messageInput:focus { border-color: var(--accent); }
textarea#messageInput::placeholder { color: var(--text-muted); }

.send-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #000; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--transition);
  box-shadow: 0 4px 15px var(--accent-glow);
  -webkit-tap-highlight-color: transparent;
}
.send-btn:hover  { transform: scale(1.1) rotate(15deg); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: 0.5; }

/* ---- LIGHTBOX ---- */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.95); display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img { max-width: 95vw; max-height: 92vh; border-radius: 10px; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 16px; background: var(--surface2); border: 1px solid var(--glass-border); color: var(--text); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }

/* ---- LOADING ---- */
.loading-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(10,10,15,0.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--glass-border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loadingText { color: var(--text-muted); font-size: 14px; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: calc(74px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--surface2); color: var(--text);
  padding: 10px 20px; border-radius: 28px; font-size: 13px;
  border: 1px solid var(--glass-border); z-index: 4000;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 90vw; text-align: center; word-break: break-word;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

.hidden { display: none !important; }

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  /* Sidebar: drawer from left */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    height: 100%;
    transform: translateX(-100%);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }

  /* Hamburger visible */
  .hamburger { display: flex !important; }

  /* Messages */
  .message-wrapper { max-width: 86%; }

  /* Emoji grid on mobile: smaller fixed height */
  .emoji-grid { height: 170px; }
  .emoji-cell { font-size: 22px; }

  /* Login card */
  .login-card { padding: 22px 18px; border-radius: 20px; }
  .uid-display { font-size: 28px; letter-spacing: 6px; }
}

@media (max-width: 400px) {
  .login-logo h1 { font-size: 22px; }
  .logo-icon { font-size: 38px; }
  .message-wrapper { max-width: 90%; }
  .msg-photo { max-width: 200px; }
  .emoji-cell { font-size: 20px; }
}
