@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Colors - Dark Mode */
  --bg-primary: #0a0f1c;
  --bg-secondary: #121827;
  --bg-tertiary: #1a2236;
  --surface: #1e2a42;
  --surface-hover: #253350;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.1);
  --border-strong: rgba(148, 163, 184, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glow: 0 0 24px var(--accent-glow);
  
  /* Sizes */
  --sidebar-width: 360px;
  --header-height: 140px;
  --composer-height: 72px;
  
  /* Radius */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
}

body[data-theme='light'] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(100, 116, 139, 0.12);
  --border-strong: rgba(100, 116, 139, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
  --glow: 0 0 24px var(--accent-glow);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* App Shell */
.app-shell {
  min-height: 100vh;
  position: relative;
}

/* Auth Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 12px 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header .pill {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.auth-header .muted {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 8px;
}

.auth-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-step label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
  font-size: 0.95rem;
}

.auth-step input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.auth-step input:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.auth-step input::placeholder {
  color: var(--text-muted);
}

.status {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 8px 0;
  margin-top: 4px;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

/* Buttons */
.btn {
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: var(--shadow-sm), var(--glow);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--glow);
}

.btn.primary:active {
  transform: translateY(0);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn.ghost:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-icon-primary {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-icon-primary:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

/* Chat Shell */
.chat-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.app-logo-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm), var(--glow);
  flex-shrink: 0;
}

.app-logo-text {
  flex: 1;
  min-width: 0;
}

.app-logo-text h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.app-logo-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.theme-toggle .theme-icon {
  font-size: 1.1rem;
}

.logout-btn span {
  font-size: 1.1rem;
}

.user-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-top: 24px;
  width: 100%;
  box-sizing: border-box;
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.user-info-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.user-info-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.user-info-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  /* Allow wrapping so long account names can occupy multiple lines */
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}

/* Sidebar Content */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-section {
  margin-bottom: 24px;
  flex-shrink: 0;
}

.chat-list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-badge {
  padding: 2px 8px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Chat List */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.chat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chat-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateX(-4px);
}

.chat-item:hover::before {
  opacity: 1;
}

.chat-item-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.chat-item-content {
  flex: 1;
  min-width: 0;
}

.chat-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-item__title {
  font-weight: 600;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item__time {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-item__preview {
  font-size: 0.9rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-item-badge {
  padding: 2px 8px;
  background: var(--accent);
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Search Section */
.search-input-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.search-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-item-content {
  flex: 1;
  min-width: 0;
}

.search-item__title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-item__meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chat Pane */
.chat-pane {
  display: grid;
  grid-template-rows: var(--header-height) 1fr auto auto;
  height: 100vh;
  background: var(--bg-primary);
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  min-height: var(--header-height);
}

.drawer-toggle {
  display: none;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: var(--shadow-sm), var(--glow);
  border: 2px solid var(--bg-secondary);
}

.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.avatar-status.online {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.avatar-status.offline {
  background: var(--text-muted);
}

.chat-header-text {
  flex: 1;
  min-width: 0;
}

.chat-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.chat-header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.chat-username-badge {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0;
  line-height: 1.4;
}

.chat-header-actions {
  display: none;
}

/* Messages Container */
.messages-container {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  background: var(--bg-primary);
}

.messages-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Message Bubbles */
.bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  word-wrap: break-word;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bubble.me {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: var(--accent-hover);
  color: white;
  box-shadow: var(--shadow-md), var(--glow);
}

.bubble .meta {
  display: block;
  font-size: 0.75rem;
  margin-top: 6px;
  opacity: 0.7;
}

.bubble.file {
  border-style: dashed;
}

/* File Preview */
.file-preview {
  margin: 0 24px 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.file-preview.error {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Message Status */
.message-status {
  padding: 8px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  text-align: center;
}

.message-status.error {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.message-status.success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

/* Message Composer */
.message-composer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
  min-height: auto;
}

.composer-actions {
  display: flex;
  gap: 8px;
}

.composer-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.composer-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.file-attach-btn input {
  display: none;
}

.composer-input-wrapper {
  flex: 1;
  min-width: 0;
}

.composer-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.composer-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.composer-input::placeholder {
  color: var(--text-muted);
}

.composer-send-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm), var(--glow);
}

.composer-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--glow);
}

.composer-send-btn:active {
  transform: translateY(0);
}

.send-icon {
  font-size: 1.2rem;
}

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -120%);
  padding: 14px 24px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.toast.success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.modal-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}

.modal-body {
  padding: 28px 32px;
}

.modal-body p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body .muted {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.modal-footer {
  padding: 20px 32px 28px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.modal-footer .btn {
  min-width: 120px;
}

/* Drawer Backdrop */
.drawer-backdrop {
  display: none;
}

/* Responsive */
@media (max-width: 960px) {
  .chat-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(360px, 85vw);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    box-shadow: var(--shadow-lg);
  }

  .chat-shell.drawer-open .sidebar {
    transform: translateX(0);
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 40;
  }

  .chat-shell.drawer-open .drawer-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .drawer-toggle {
    display: flex !important;
  }

  .chat-header-actions {
    display: none;
  }

  .bubble {
    max-width: 85%;
  }

  .messages-container {
    padding: 16px;
  }

  .message-composer {
    padding: 12px 16px;
  }

  .send-text {
    display: none;
  }

  .composer-send-btn {
    padding: 0;
    width: 44px;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 32px 24px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .app-logo-text h2 {
    font-size: 1.2rem;
  }

  .sidebar-header {
    padding: 20px;
  }

  .sidebar-content {
    padding: 12px;
  }
}
