/* ============================================
   BisnisKita Chat - WhatsApp Web Style Dark UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #111b21;
  --surface: #202c33;
  --surface2: #2a3942;
  --surface3: #182229;
  --accent: #00a884;
  --accent-light: #25d366;
  --accent-dark: #008f6f;
  --text: #e9edef;
  --text-secondary: #8696a0;
  --text-muted: #667781;
  --border: #2a3942;
  --bubble-out: #005c4b;
  --bubble-in: #202c33;
  --danger: #ef4444;
  --warning: #f59e0b;
  --blue: #53bdeb;
  --shadow: rgba(0,0,0,0.4);
  --font: 'Inter', -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: 390px;
  min-width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
}

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

.my-avatar {
  width: 40px;
  height: 40px;
  background: var(--surface3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid var(--accent);
  overflow: hidden;
}

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

.sidebar-title {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

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

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

.icon-btn:hover { background: var(--surface3); }

/* Profile Menu */
.profile-menu {
  position: absolute;
  top: 56px;
  right: 8px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 180px;
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 100;
  border: 1px solid var(--border);
}

.profile-menu-item {
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text);
}

.profile-menu-item:hover { background: var(--surface3); }
.profile-menu-item.danger { color: var(--danger); }

/* Search */
.search-bar {
  padding: 8px 12px;
  background: var(--surface);
}

.search-bar input {
  width: 100%;
  background: var(--surface2);
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
}

.search-bar input::placeholder { color: var(--text-muted); }

/* Tabs */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Contact List */
.contact-list, .call-history {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface3) transparent;
}

.contact-list::-webkit-scrollbar,
.call-history::-webkit-scrollbar {
  width: 4px;
}
.contact-list::-webkit-scrollbar-thumb,
.call-history::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 4px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 13px;
  gap: 12px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.contact-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  position: relative;
}

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

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

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

.online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--accent-light);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

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

.contact-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.contact-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.contact-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

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

.role-badge {
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge.owner {
  background: #7c3aed;
}

/* Call history items */
.call-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
}

.call-item:hover { background: var(--surface2); }

.call-info { flex: 1; }
.call-name { font-weight: 500; font-size: 14px; }
.call-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.call-icon { font-size: 22px; }
.call-duration { font-size: 11px; color: var(--text-muted); }

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

/* Chat background pattern */
.chat-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.02) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Welcome Screen */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.welcome-icon {
  font-size: 64px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.welcome-screen h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.welcome-screen p {
  color: var(--text-secondary);
  font-size: 15px;
}

.welcome-features {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.welcome-features span {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* Chat Window */
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  min-height: 60px;
  flex-shrink: 0;
}

.back-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

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

.chat-header-info { flex: 1; }

.chat-header-name {
  font-weight: 600;
  font-size: 16px;
}

.chat-header-status {
  font-size: 12px;
  color: var(--accent);
}

.chat-header-status.offline { color: var(--text-muted); }

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

/* Messages */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8%;
  scrollbar-width: thin;
  scrollbar-color: var(--surface3) transparent;
}

.messages-container::-webkit-scrollbar { width: 4px; }
.messages-container::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 4px;
}

.messages-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Date separator */
.date-separator {
  text-align: center;
  margin: 16px 0 8px;
}

.date-separator span {
  background: var(--surface2);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  display: inline-block;
}

/* Message Bubbles */
.message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 65%;
  margin-bottom: 2px;
  animation: msgIn 0.15s ease-out;
}

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

.message-wrapper.outgoing {
  align-self: flex-end;
  align-items: flex-end;
}

.message-wrapper.incoming {
  align-self: flex-start;
  align-items: flex-start;
}

.bubble {
  padding: 8px 12px;
  border-radius: 12px;
  position: relative;
  max-width: 100%;
  word-break: break-word;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.message-wrapper.outgoing .bubble {
  background: var(--bubble-out);
  border-bottom-right-radius: 4px;
}

.message-wrapper.incoming .bubble {
  background: var(--bubble-in);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.04);
}

.bubble-text {
  font-size: 14.5px;
  color: var(--text);
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.bubble-time {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

.bubble-read {
  font-size: 12px;
  color: var(--blue);
}

.bubble-read.unread { color: rgba(255,255,255,0.4); }

/* Image bubbles */
.bubble-image {
  max-width: 260px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.bubble-image img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

/* File bubbles */
.bubble-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  min-width: 200px;
}

.bubble-file-icon { font-size: 28px; }

.bubble-file-info { flex: 1; min-width: 0; }
.bubble-file-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bubble-file-size { font-size: 11px; color: rgba(255,255,255,0.5); }

.bubble-file-download {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.bubble-file-download:hover { background: rgba(255,255,255,0.2); }

/* Voice note bubbles */
.bubble-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.voice-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voice-waveform {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.voice-bar {
  width: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  transition: height 0.1s;
}

.voice-duration {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

/* Typing indicator */
.typing-indicator {
  padding: 8px 24px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  border-top: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.typing-dots {
  display: inline-flex;
  gap: 2px;
}

.typing-dots span {
  animation: typingBounce 1.4s ease-in-out infinite;
  font-size: 16px;
  color: var(--accent);
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}

/* ============================================
   INPUT BAR
   ============================================ */
.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}

.attach-menu {
  position: absolute;
  bottom: 70px;
  left: 16px;
  background: var(--surface2);
  border-radius: 12px;
  box-shadow: 0 8px 32px var(--shadow);
  overflow: hidden;
  z-index: 50;
  border: 1px solid var(--border);
}

.attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background 0.15s;
  min-width: 160px;
}

.attach-item:hover { background: var(--surface3); }

.input-wrapper {
  flex: 1;
  background: var(--surface3);
  border-radius: 24px;
  padding: 10px 16px;
  min-height: 44px;
  max-height: 120px;
  display: flex;
  align-items: center;
}

.input-wrapper textarea {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 96px;
  overflow-y: auto;
  scrollbar-width: none;
}

.input-wrapper textarea::placeholder { color: var(--text-muted); }
.input-wrapper textarea::-webkit-scrollbar { display: none; }

.send-btn {
  background: var(--accent);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  transition: background 0.2s, transform 0.1s;
}

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

.voice-btn {
  color: var(--text-secondary);
  font-size: 22px;
}

.voice-btn.recording {
  color: var(--danger);
  animation: pulse 0.8s ease-in-out infinite;
}

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

/* ============================================
   CALL OVERLAY & MODAL
   ============================================ */
.call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.call-popup {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: callPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes callPopIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.call-popup-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 16px;
  border: 3px solid var(--accent);
  animation: callRing 1.5s ease-in-out infinite;
}

@keyframes callRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,168,132,0.4); }
  50% { box-shadow: 0 0 0 20px rgba(0,168,132,0); }
}

.call-popup-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.call-popup-type {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.call-popup-actions {
  display: flex;
  gap: 32px;
  justify-content: center;
}

.call-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.15s;
}

.call-btn:hover { transform: scale(1.1); }
.call-btn.accept { background: var(--accent); }
.call-btn.reject { background: var(--danger); }

/* Active Call Modal */
.call-modal {
  position: fixed;
  inset: 0;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
}

.call-modal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 500px;
  padding: 40px 24px;
}

.call-modal-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  border: 3px solid var(--accent);
}

.call-modal-name {
  font-size: 26px;
  font-weight: 700;
}

.call-modal-status {
  font-size: 14px;
  color: var(--text-secondary);
}

.call-modal-timer {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--accent);
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
}

#remoteVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.local-video {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 120px;
  border-radius: 8px;
  border: 2px solid var(--accent);
}

.call-modal-actions {
  display: flex;
  gap: 16px;
}

.call-action-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--surface2);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.15s;
}

.call-action-btn:hover { background: var(--surface); }
.call-action-btn.danger { background: var(--danger); }
.call-action-btn.active { background: var(--accent); }

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

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-header button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.modal-body { padding: 24px; }

.profile-avatar-display {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px;
  border: 3px solid var(--accent);
}

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

.profile-field label {
  display: block;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.profile-field p {
  font-size: 15px;
  color: var(--text);
}

.profile-field input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  margin-bottom: 8px;
}

.profile-field input:focus { border-color: var(--accent); }

.profile-field button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
}

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

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
}

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

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  margin-top: 8px;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--accent-dark); }

.error-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface2);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
  border: 1px solid var(--border);
  white-space: nowrap;
  max-width: 90vw;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar { width: 100%; }
  
  .chat-window { display: none; }
  .chat-window.mobile-active { display: flex; }
  
  .welcome-screen { display: none; }
  
  .back-btn { display: block; }
  
  .messages-container { padding: 8px 12px; }
  
  .message-wrapper { max-width: 85%; }
}
