/* ==========================================
   LIGHT THEME DESIGN SYSTEM (static/css/assistant.css)
   ========================================== */

/* Color Palette: Slate, Clean White, Indigo Accents */
:root {
  --bg-dark: #ffffff;             /* Main Sidebar background */
  --bg-darker: #f8fafc;           /* Main App background */
  --panel-bg: #ffffff;           /* Panel / Card background */
  --panel-border: #e2e8f0;       /* Border strokes */
  --text-main: #0f172a;          /* Primary dark slate text */
  --text-muted: #64748b;         /* Secondary slate text */
  --accent-primary: #4f46e5;     /* Main Indigo accent */
  --accent-hover: #4338ca;       /* Darker indigo on hover */
  --accent-success: #10b981;     /* Emerald green indicator */
  --message-user: #4f46e5;       /* User message bubble */
  --message-ai: #f1f5f9;         /* AI message bubble */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-darker);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

.small-tick {
  font-size: 0.65rem;
}

/* --- SIDEBAR STYLING --- */
.sidebar {
  width: 320px;
  background-color: var(--bg-dark);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand i {
  font-size: 1.5rem;
  color: var(--accent-primary);
}

.brand h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.brand h2 span {
  color: var(--accent-primary);
}

/* Upload Dropzone */
.drop-zone {
  border: 2px dashed var(--panel-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  background-color: #fafafa;
  transition: all 0.2s ease;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-primary);
  background-color: #e0e7ff;
}

.upload-icon {
  font-size: 2rem;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.drop-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.drop-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* File List */
.knowledge-base-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.doc-count {
  font-size: 0.75rem;
  background: #e2e8f0;
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 12px;
}

.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--panel-bg);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.file-item:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.file-icon {
  font-size: 1.2rem;
}

.file-icon.pdf { color: #ef4444; }
.file-icon.csv { color: #10b981; }

.file-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.delete-btn:hover {
  color: #ef4444;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--panel-border);
  padding-top: 16px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-success);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-success);
}

/* --- CHAT AREA STYLING --- */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-darker);
}

.chat-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-dark);
}

.header-info h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
}

.header-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.clear-chat-btn {
  background-color: #f1f5f9;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.clear-chat-btn:hover {
  background-color: #e2e8f0;
  color: var(--text-main);
}

/* Messages */
.chat-messages {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.ai {
  align-self: flex-start;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #e0e7ff;
  border: 1px solid #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.message.user .avatar {
  background-color: var(--accent-primary);
  border: none;
  color: #fff;
}

.message-content {
  background-color: var(--message-ai);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border-top-left-radius: 2px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.message.user .message-content {
  background-color: var(--message-user);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  border-top-right-radius: 2px;
}

/* Timestamp visibility fix */
.timestamp {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: right;
}

.message.user .timestamp {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Input Form */
.chat-input-area {
  padding: 20px 32px 28px;
  background-color: var(--bg-dark);
  border-top: 1px solid var(--panel-border);
}

.input-form {
  display: flex;
  gap: 12px;
  background-color: #ffffff;
  border: 1px solid var(--panel-border);
  padding: 6px 6px 6px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-form:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.95rem;
}

.send-btn {
  background-color: var(--accent-primary);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.send-btn:hover {
  background-color: var(--accent-hover);
}

/* Empty state styling */
.empty-docs-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--text-muted);
  gap: 8px;
  font-size: 0.85rem;
}

.empty-docs-state i {
  font-size: 1.8rem;
  opacity: 0.5;
}

/* --- LOGIN MODAL & FORMS --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-header .brand-icon {
  font-size: 2.2rem;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-header p {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  background-color: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #2563eb;
  background-color: #ffffff;
}

/* UNIFIED MAIN SUBMIT BUTTON (Log In / Sign Up) */
.login-btn,
button#auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(145deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.login-btn:hover,
button#auth-submit-btn:hover {
  background: linear-gradient(145deg, #1d4ed8, #1e40af) !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-1px);
}

/* TOP TAB SWITCHER ACTIVE STATE COLOR */
.auth-tab.active {
  background-color: #ffffff;
  color: #2563eb !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* --- USER PROFILE BAR --- */
.user-profile-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #f1f5f9;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.9rem;
}

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.role-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.role-badge.admin {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.role-badge.viewer {
  background-color: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s;
}

.logout-btn:hover {
  color: #ef4444;
}

/* --- READ-ONLY LOCK BANNER --- */
.read-only-banner {
  background-color: #fef2f2;
  border: 1px dashed #fecaca;
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: #991b1b;
  font-size: 0.8rem;
}

.read-only-banner i {
  font-size: 1.2rem;
  color: #dc2626;
}

/* Sidebar File Item & Status Badges */
.file-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.indexing {
  background-color: #fef3c7;
  color: #d97706;
}

.status-badge.ready {
  background-color: #d1fae5;
  color: #059669;
}

.status-badge.error {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Upload Progress Bar */
.upload-progress-container {
  width: 100%;
  background-color: #e2e8f0;
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent-primary);
  transition: width 0.2s ease-in-out;
}

/* Spinner Icon Animation */
.spin {
  animation: spin 1s linear infinite;
}

.spinner-circle {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid #fde68a;
  border-top: 2px solid #d97706;
  border-radius: 50%;
  box-sizing: border-box;
  animation: spin-round 0.75s linear infinite;
  -webkit-animation: spin-round 0.75s linear infinite;
}

@keyframes spin-round {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@-webkit-keyframes spin-round {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

/* Typing Indicator Container */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background-color: #94a3b8;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.3;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- MARKDOWN STYLING FOR AI MESSAGES --- */
.markdown-body a.chat-link,
.markdown-body a {
  color: #3b82f6; /* Blue accent color */
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.markdown-body a:hover {
  color: #1d4ed8;
}

.message-content .markdown-body {
  line-height: 1.6;
}

.message-content .markdown-body p {
  margin-bottom: 8px;
}

.message-content .markdown-body p:last-child {
  margin-bottom: 0;
}

.message-content .markdown-body ul, 
.message-content .markdown-body ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

.message-content .markdown-body li {
  margin-bottom: 4px;
}

.message-content .markdown-body h1,
.message-content .markdown-body h2,
.message-content .markdown-body h3 {
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

/* Code Blocks */
.message-content .markdown-body code {
  background-color: #e2e8f0;
  color: #0f172a;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

.message-content .markdown-body pre {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.message-content .markdown-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Markdown Tables - Light Theme Compatible */
.message-content .markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background-color: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-content .markdown-body th, 
.message-content .markdown-body td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  text-align: left;
}

.message-content .markdown-body th {
  background-color: #e2e8f0;
  color: #0f172a;
  font-weight: 600;
}

.message-content .markdown-body tr:nth-child(even) {
  background-color: #f8fafc;
}

/* --- SOURCE CITATION BADGES --- */
.message-sources {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #cbd5e1 !important;
}

.source-label {
  color: #64748b !important;
  font-size: 0.75rem;
  font-weight: 600;
}

.source-badge {
  background-color: #e0e7ff !important;
  color: #3730a3 !important;
  border: 1px solid #c7d2fe !important;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block !important;
}

/* Auth Tab Bar */
.auth-tabs {
  display: flex;
  background-color: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--panel-border);
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

/* Hide background content completely when logged out */
body.logged-out .app-container {
  display: none !important;
}

/* --- 2-COLUMN AUTH MODAL LAYOUT --- */
body.logged-out .modal-overlay {
  position: fixed;
  inset: 0;
  /* Split background: 50% white on left, 50% matching mascot blue on right */
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card-wrapper {
  display: flex;
  width: 100%;
  max-width: 880px;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

/* LEFT PANEL (Mascot & Tagline) */
.auth-left-panel {
  flex: 1;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
}

.mascot-container {
  width: 180px;
  height: 180px;
  margin-bottom: 20px;
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.hero-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-quote {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #e0e7ff;
  font-style: italic;
  max-width: 280px;
  margin-bottom: 24px;
}

.badge-tag {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* RIGHT PANEL (Login Form) */
.auth-right-panel {
  flex: 1.1;
  padding: 40px;
  background-color: #ffffff;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .modal-card-wrapper {
    flex-direction: column;
    max-width: 440px;
  }

  .auth-left-panel {
    padding: 24px;
  }

  .mascot-container {
    width: 110px;
    height: 110px;
    margin-bottom: 10px;
  }

  .hero-quote {
    display: none;
  }
}

/* AI Bot Mascot Avatar Styling */
.avatar.ai-avatar {
  background-color: #ffffff; /* Sets a clean white background for the mascot circle */
  border: 1px solid #e2e8f0;   /* Subtle border matching light theme slate */
  padding: 1px;              /* Slight padding for the mascot image */
  overflow: hidden;          /* Keeps everything inside the border-radius */
  display: flex;
  align-items: center;
  justify-content: center;
}

.bot-avatar-img {
  width: 90%;                /* Scales mascot to almost fill the bubble */
  height: 90%;
  object-fit: contain;       /* Ensures the image isn't stretched or squished */
  border-radius: 50%;        /* Keeps the image mask perfectly circular */
}

/* --- PASSWORD INPUT WITH SHOW/HIDE EYE BUTTON --- */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 42px !important; /* Space for eye button */
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.toggle-password-btn:hover {
  color: #2563eb;
}

/* Stop Generation Button styling */
.stop-mode {
  background-color: #dc3545 !important; /* Red background for stop button */
  color: #ffffff !important;
  border-color: #dc3545 !important;
}

.stop-mode:hover {
  background-color: #bd2130 !important;
}

/* Responsive Base Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.mobile-menu-btn, .sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: #64748b;
  cursor: pointer;
}

/* Sidebar Drawer Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile & Tablet Styles (Below 992px) */
@media (max-width: 992px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
  }

  .sidebar-close-btn {
    display: block;
  }

  .sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Auth Modal Mobile Reflow */
  .modal-card-wrapper {
    flex-direction: column;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .auth-left-panel {
    display: none; /* Hide decorative mascot on small screens to keep login concise */
  }

  .btn-text-desktop {
    display: none;
  }
}

.typing-cursor {
  display: inline-block;
  color: #4f46e5;
  font-weight: bold;
  animation: blink 0.7s infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.sources-tag-container {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.sources-label {
  font-weight: 600;
  color: #64748b;
}

.source-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}