/* =============================================
   NovaMind — Antigravity Black & White UI v2
   ============================================= */

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

/* ── API Key Modal ───────────────────────────── */
#key-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
  animation: fadeSlideIn 0.25s ease;
  backdrop-filter: blur(6px);
}

.key-modal {
  background: #111; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  animation: fadeSlideIn 0.3s ease;
}

.key-modal-icon { font-size: 2rem; text-align: center; }

.key-modal-title {
  font-size: 1.15rem; font-weight: 800; color: #f0f0f0;
  text-align: center; letter-spacing: -0.3px; margin-bottom: 2px;
}

.key-modal-desc {
  font-size: 0.82rem; color: #888; line-height: 1.6; text-align: center;
}
.key-modal-desc a { color: #ccc; text-decoration: underline; text-underline-offset: 3px; }
.key-modal-desc strong { color: #bbb; }

.key-modal-input-wrap {
  display: flex; align-items: center; gap: 0;
  background: #0a0a0a; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; overflow: hidden; margin-top: 6px;
  transition: border-color 0.2s;
}
.key-modal-input-wrap:focus-within { border-color: rgba(255,255,255,0.35); }

#key-modal-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #f0f0f0; font-family: 'Inter', monospace; font-size: 0.88rem;
  padding: 11px 14px; letter-spacing: 0.5px;
}
#key-modal-input::placeholder { color: #444; letter-spacing: 0; }

.key-modal-eye {
  background: transparent; border: none; border-left: 1px solid rgba(255,255,255,0.08);
  padding: 0 12px; cursor: pointer; color: #555; font-size: 0.9rem;
  height: 100%; transition: color 0.15s;
}
.key-modal-eye:hover { color: #aaa; }

.key-modal-error {
  font-size: 0.75rem; color: #f87171; min-height: 16px;
  text-align: center; padding: 0 4px;
}

.key-modal-btn {
  background: #ffffff; color: #000; border: none;
  border-radius: 8px; padding: 11px 20px;
  font-size: 0.88rem; font-weight: 700; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all 0.18s; margin-top: 4px;
}
.key-modal-btn:hover { background: #e5e5e5; transform: translateY(-1px); }
.key-modal-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.key-modal-hint { font-size: 0.69rem; color: #444; text-align: center; }


/* ── CSS Variables ───────────────────────────── */
:root {
  --bg-base:        #0a0a0a;
  --bg-surface:     #111111;
  --bg-sidebar:     #0d0d0d;
  --bg-hover:       #1a1a1a;
  --bg-active:      #222222;
  --bg-input:       #141414;

  --accent:         #ffffff;
  --accent-dim:     rgba(255,255,255,0.10);

  --text-primary:   #f0f0f0;
  --text-secondary: #888888;
  --text-muted:     #555555;

  --border:         rgba(255,255,255,0.07);
  --border-strong:  rgba(255,255,255,0.14);
  --border-focus:   rgba(255,255,255,0.38);

  --shadow-sm:      0 1px 4px rgba(0,0,0,0.6);
  --shadow-md:      0 4px 24px rgba(0,0,0,0.7);
  --shadow-input:   0 0 0 2px rgba(255,255,255,0.13);

  --radius-full:    9999px;
  --radius-xl:      18px;
  --radius-lg:      14px;
  --radius-md:      10px;
  --radius-sm:      6px;

  --sidebar-w:      268px;
  --font:           'Inter', system-ui, sans-serif;
  --transition:     all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark (secondary) variant */
body.dark {
  --bg-base:    #050505;
  --bg-surface: #0a0a0a;
  --bg-sidebar: #080808;
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.sidebar-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.logo-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  background: #fff; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 10px rgba(255,255,255,0.12);
}
.logo-icon svg { width: 20px; height: 20px; display: block; }

.logo-text { font-size: 0.98rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }

.online-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: #777; font-size: 0.65rem; font-weight: 600;
  padding: 3px 9px; border-radius: var(--radius-full);
  letter-spacing: 0.3px; margin-bottom: 12px;
}

.pulse-dot {
  width: 5px; height: 5px; background: #4ade80;
  border-radius: 50%; animation: pulse 2s infinite; display: inline-block;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Sidebar action buttons row */
.sidebar-action-btns { display: flex; gap: 6px; align-items: center; }

.new-chat-btn {
  flex: 1;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  background: #ffffff; border: none; border-radius: var(--radius-sm);
  color: #000; font-size: 0.81rem; font-weight: 700;
  font-family: var(--font); cursor: pointer; transition: var(--transition);
}
.new-chat-btn:hover { background: #e5e5e5; transform: translateY(-1px); }
.new-chat-btn svg { flex-shrink: 0; }

.incognito-sidebar-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.incognito-sidebar-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.incognito-sidebar-btn.active { background: #fff; color: #000; border-color: #fff; }

/* Search */
.sidebar-search { padding: 10px 10px 6px; flex-shrink: 0; }

.search-wrapper {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 8px;
  transition: var(--transition);
}
.search-wrapper:focus-within { border-color: var(--border-strong); }

.search-icon { flex-shrink: 0; color: var(--text-muted); }

#search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font);
  font-size: 0.79rem;
}
#search-input::placeholder { color: var(--text-muted); }

.search-clear-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); display: none;
  align-items: center; justify-content: center; padding: 2px;
  transition: var(--transition); flex-shrink: 0;
}
.search-clear-btn:hover { color: var(--text-primary); }
.search-clear-btn.visible { display: flex; }

/* Sidebar scrollable content */
.sidebar-content {
  flex: 1; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  display: flex; flex-direction: column; gap: 0;
}
.sidebar-content::-webkit-scrollbar { width: 3px; }
.sidebar-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* History section */
.sidebar-history-section { padding: 10px 10px 0; }

.section-label {
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
  padding: 0 4px; margin-bottom: 6px;
}

.session-list { display: flex; flex-direction: column; gap: 1px; }

.no-sessions {
  font-size: 0.75rem; color: var(--text-muted);
  padding: 6px 4px; font-style: italic;
}

.session-item {
  display: flex; align-items: center;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: var(--transition); overflow: hidden;
  cursor: pointer;
}
.session-item:hover { background: var(--bg-hover); border-color: var(--border); }
.session-item.active { background: rgba(255,255,255,0.06); border-color: var(--border-strong); }

.session-info { flex: 1; padding: 7px 8px; min-width: 0; }

.session-title {
  display: block; font-size: 0.79rem; color: var(--text-primary);
  font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-time { display: block; font-size: 0.6rem; color: var(--text-muted); margin-top: 1px; }

.session-delete {
  width: 24px; height: 24px;
  background: transparent; border: none; border-radius: 4px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-right: 4px;
  transition: var(--transition); opacity: 0;
}
.session-item:hover .session-delete { opacity: 1; }
.session-delete:hover { background: rgba(239,68,68,0.12); color: #f87171; }

/* Topic chips */
.sidebar-section { padding: 10px; }

.topic-chips { display: flex; flex-direction: column; gap: 1px; }

.chip {
  background: transparent; border: 1px solid transparent;
  color: var(--text-secondary); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 0.81rem; font-family: var(--font);
  font-weight: 500; cursor: pointer; text-align: left;
  transition: var(--transition); display: flex; align-items: center;
  gap: 8px; width: 100%;
}
.chip:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.chip:active { background: var(--bg-active); color: #fff; }

/* Footer */
.sidebar-footer { padding: 12px 10px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }

.stats-row { display: flex; gap: 8px; }

.stat-card {
  flex: 1; background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; text-align: center;
}
.stat-value { display: block; font-weight: 700; font-size: 1rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }

/* ══════════════════════════════════════════════
   CHAT AREA
   ══════════════════════════════════════════════ */
.chat-area { flex: 1; display: flex; flex-direction: column; background: var(--bg-surface); overflow: hidden; min-width: 0; }

/* Header */
.chat-header {
  padding: 13px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-surface); flex-shrink: 0;
}

.bot-info { display: flex; align-items: center; gap: 12px; }

.bot-avatar-header {
  width: 38px; height: 38px; border-radius: 10px;
  background: #ffffff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.88rem; color: #000;
  position: relative; flex-shrink: 0;
  box-shadow: 0 0 14px rgba(255,255,255,0.10);
}
.status-ring {
  position: absolute; bottom: -2px; right: -2px;
  width: 9px; height: 9px; background: #4ade80;
  border-radius: 50%; border: 2px solid var(--bg-surface);
}

.bot-name { font-size: 0.93rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }
.bot-status { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }
.bot-status:empty { display: none; }

.header-actions { display: flex; gap: 7px; align-items: center; }

.persona-select {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 0.8rem; font-family: var(--font);
  cursor: pointer; transition: var(--transition); outline: none;
}
.persona-select:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.persona-select option { background: var(--bg-surface); color: var(--text-primary); }

.icon-btn {
  width: 33px; height: 33px; border: 1px solid var(--border);
  background: transparent; border-radius: var(--radius-sm);
  color: var(--text-secondary); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.icon-btn.active { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); color: #fff; }

.nlp-view-btn { font-size: 0.88rem; opacity: 0.45; border-color: transparent !important; }
.nlp-view-btn.active { opacity: 1; border-color: var(--border-strong) !important; background: var(--bg-hover) !important; color: #fff !important; }
.nlp-view-btn:hover { opacity: 1; }

/* ML Status Badge */
.ml-status-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 4px 10px 4px 7px;
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
}
.ml-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; transition: background 0.4s; }
.ml-dot--loading { background: #f59e0b; animation: mlPulse 1s ease-in-out infinite; }
.ml-dot--ready   { background: #4ade80; box-shadow: 0 0 5px rgba(74,222,128,0.4); animation: none; }
.ml-dot--error   { background: #f87171; animation: none; }
@keyframes mlPulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.4; transform:scale(0.7); } }

/* Incognito Banner */
.incognito-banner {
  display: none; align-items: center; gap: 8px;
  padding: 8px 24px;
  background: rgba(255,255,255,0.035);
  border-bottom: 1px solid var(--border);
  font-size: 0.73rem; color: #999; font-weight: 500;
  flex-shrink: 0; letter-spacing: 0.1px; animation: fadeSlideIn 0.2s ease;
}
.incognito-banner.visible { display: flex; }

/* ══════════════════════════════════════════════
   MESSAGES
   ══════════════════════════════════════════════ */
.messages-container {
  flex: 1; overflow-y: auto;
  padding: 24px 0 8px;
  display: flex; flex-direction: column; gap: 0;
  scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.messages-container::-webkit-scrollbar { width: 3px; }
.messages-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.message {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 24px; animation: fadeSlideIn 0.22s ease;
  max-width: 860px; width: 100%; margin: 0 auto;
}
.user-message { flex-direction: row-reverse; justify-content: flex-start; }

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

/* Avatars */
.avatar {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.76rem; flex-shrink: 0; margin-top: 2px;
}
.bot-avatar  { background: #ffffff; color: #000; box-shadow: 0 0 8px rgba(255,255,255,0.10); }
.user-avatar { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border-strong); }

/* Bubbles */
.bubble-wrapper { max-width: 74%; display: flex; flex-direction: column; gap: 4px; }
.user-message .bubble-wrapper { align-items: flex-end; }

.bubble {
  padding: 11px 15px; border-radius: var(--radius-lg);
  font-size: 0.88rem; line-height: 1.65; word-break: break-word;
}
.bot-bubble {
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-primary); border-top-left-radius: 4px;
}
.user-bubble {
  background: #ffffff; color: #000;
  border-top-right-radius: 4px; font-weight: 500;
}

.timestamp { font-size: 0.61rem; color: var(--text-muted); padding: 0 4px; }

/* Message file chip */
.msg-file-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.11);
  border-radius: 6px; padding: 3px 8px;
  font-size: 0.73rem; color: var(--text-secondary); margin-bottom: 7px;
}
.user-bubble .msg-file-chip {
  background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.12); color: #444;
}

.msg-image-preview {
  max-width: 100%; max-height: 220px; border-radius: var(--radius-sm);
  margin-top: 6px; display: block; object-fit: contain;
  border: 1px solid rgba(255,255,255,0.08);
}
.user-bubble .msg-image-preview { border-color: rgba(0,0,0,0.1); }

/* ══════════════════════════════════════════════
   HERO / GREETING
   ══════════════════════════════════════════════ */
.copilot-hero {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px 24px;
  text-align: center; gap: 14px;
  max-width: 560px; margin: 0 auto 6px; width: 100%;
}
.copilot-hero-icon {
  width: 60px; height: 60px; border-radius: 15px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px; font-size: 1.5rem; font-weight: 800; color: #000;
  box-shadow: 0 0 28px rgba(255,255,255,0.13), 0 0 0 1px rgba(255,255,255,0.09);
}
.copilot-hero-title { font-size: 1.65rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; line-height: 1.2; }
.copilot-hero-sub { font-size: 0.87rem; color: var(--text-muted); max-width: 340px; line-height: 1.65; }

/* Suggestion cards */
.suggestion-cards {
  display: flex; gap: 9px; flex-wrap: wrap; justify-content: center;
  padding: 0 24px 24px; max-width: 860px; margin: 0 auto; width: 100%;
}
.suggestion-card {
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px;
  font-size: 0.81rem; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  font-family: var(--font); font-weight: 500;
  text-align: left; flex: 1 1 165px; max-width: 205px; line-height: 1.45;
}
.suggestion-card:hover {
  border-color: var(--border-strong); background: var(--bg-active);
  color: var(--text-primary); transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.suggestion-icon { font-size: 1.1rem; margin-bottom: 5px; display: block; }

/* ══════════════════════════════════════════════
   TYPING INDICATOR
   ══════════════════════════════════════════════ */
.typing-indicator {
  display: none; align-items: center; gap: 12px;
  padding: 9px 24px; max-width: 860px; width: 100%;
  margin: 0 auto; animation: fadeSlideIn 0.22s ease;
}
.typing-indicator.visible { display: flex; }

.typing-dots {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-lg); border-top-left-radius: 4px;
  padding: 11px 14px;
}
.typing-dots span {
  width: 6px; height: 6px; background: var(--text-muted);
  border-radius: 50%; animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* ══════════════════════════════════════════════
   INPUT AREA
   ══════════════════════════════════════════════ */
.input-area { padding: 12px 24px 18px; flex-shrink: 0; background: var(--bg-surface); border-top: 1px solid var(--border); align-self: stretch; }
.chat-area > .input-area { max-width: 100%; padding: 12px 0 18px; }

.input-area-inner {
  max-width: 820px; margin: 0 auto; padding: 0 24px;
  transition: var(--transition);
}
.input-area-inner.drag-over .input-wrapper {
  border-color: var(--border-focus); box-shadow: var(--shadow-input);
}

/* File preview chip */
.file-preview-area { display: none; margin-bottom: 8px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-hover); border: 1px solid var(--border-strong);
  border-radius: var(--radius-full); padding: 4px 4px 4px 10px;
  font-size: 0.77rem; color: var(--text-secondary); max-width: 100%;
}
.file-chip-remove {
  width: 20px; height: 20px; background: rgba(255,255,255,0.07);
  border: none; border-radius: 50%; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; line-height: 1; flex-shrink: 0; transition: var(--transition);
}
.file-chip-remove:hover { background: rgba(239,68,68,0.15); color: #f87171; }

/* Attach & Mic buttons */
.attach-btn, .mic-btn {
  width: 32px; height: 32px; background: transparent; border: none;
  border-radius: var(--radius-sm); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
}
.attach-btn:hover, .mic-btn:hover { color: var(--text-primary); background: var(--bg-active); }

/* Mic active listening animation */
.mic-btn.listening {
  color: #ef4444; background: rgba(239, 68, 68, 0.1);
  animation: pulse-mic 1.5s infinite;
}
@keyframes pulse-mic {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Input wrapper */
.input-wrapper {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); padding: 8px 8px 8px 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrapper:focus-within { border-color: var(--border-focus); box-shadow: var(--shadow-input); }

#user-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font); font-size: 0.9rem;
  resize: none; line-height: 1.55; max-height: 120px;
  overflow-y: auto; scrollbar-width: none;
  padding: 6px 0; margin: 0;
}
#user-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  border: none; background: #ffffff; color: #000;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.send-btn:disabled { opacity: 0.18; cursor: not-allowed; }
.send-btn:not(:disabled):hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(255,255,255,0.18); }
.send-btn:not(:disabled):active { transform: scale(0.96); }

.input-hint { margin-top: 7px; font-size: 0.64rem; color: var(--text-muted); text-align: center; }

kbd {
  display: inline-block; background: var(--bg-hover); border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 1px 5px; font-size: 0.61rem;
  font-family: monospace; color: var(--text-secondary);
}

/* ══════════════════════════════════════════════
   ML PANEL (below bot messages)
   ══════════════════════════════════════════════ */
.ml-panel {
  background: rgba(255,255,255,0.025); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 13px; margin-top: 6px;
  font-size: 0.72rem; line-height: 1.5; animation: fadeSlideIn 0.3s ease;
}
.ml-panel--hidden { display: none; }

.ml-pipeline-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 9px; }

.ml-arch-chip {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-muted); padding: 2px 7px; border-radius: 5px;
  font-size: 0.63rem; font-weight: 600; font-family: monospace;
}
.ml-arch-arrow { color: var(--text-muted); font-size: 0.63rem; }

.ml-stats-row { display: flex; gap: 5px; }
.ml-stat {
  flex: 1; background: rgba(255,255,255,0.025); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 5px; text-align: center;
}
.ml-stat-val { display: block; font-weight: 700; font-size: 0.8rem; color: var(--text-primary); }
.ml-stat-lbl { display: block; font-size: 0.57rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 1px; }

.ml-note { font-size: 0.71rem; color: var(--text-muted); }

/* Error panel override */
.ml-panel[style*="rgba(239"] { background: rgba(239,68,68,0.05) !important; }

/* ══════════════════════════════════════════════
   MARKDOWN (bot bubble content)
   ══════════════════════════════════════════════ */
.bot-bubble h2 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 12px 0 6px; }
.bot-bubble h3 { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); margin: 10px 0 5px; }
.bot-bubble h4 { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin: 8px 0 4px; }
.bot-bubble p { margin: 0 0 6px; line-height: 1.65; }
.bot-bubble p:last-child { margin-bottom: 0; }
.bot-bubble ul, .bot-bubble ol { padding-left: 20px; margin: 6px 0; display: flex; flex-direction: column; gap: 3px; }
.bot-bubble li { line-height: 1.55; font-size: 0.87rem; }

.inline-code {
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
  font-family: 'Cascadia Code','Fira Code','Consolas',monospace;
  font-size: 0.8em; color: var(--text-primary);
}
.code-block {
  background: #0a0a0a; border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; margin: 10px 0;
  font-family: 'Cascadia Code','Fira Code','Consolas',monospace;
  font-size: 0.81rem; line-height: 1.6;
}
.code-header {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.035); padding: 5px 14px;
  border-bottom: 1px solid var(--border);
}
.code-lang {
  color: var(--text-muted); font-size: 0.63rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.copy-code-btn {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 0.68rem; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 4px; padding: 2px 6px;
  border-radius: 4px; transition: var(--transition);
}
.copy-code-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.copy-code-btn.copied { color: #4ade80; }
.code-block pre { margin: 0; padding: 14px; overflow-x: auto; }
.code-block code { color: #e2e8f0; background: transparent; font-family: inherit; font-size: inherit; }

/* Message voice buttons */
.message-footer {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.speak-btn {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px; display: inline-flex; align-items: center;
  justify-content: center; transition: var(--transition); border-radius: 4px;
}
.speak-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.speak-btn.speaking { color: #f87171; }

/* Bot generated images and links */
.bot-generated-img {
  max-width: 100%; height: auto; border-radius: var(--radius-md);
  border: 1px solid var(--border); margin: 10px 0; display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.bot-link {
  color: #fff; text-decoration: underline; font-weight: 500;
}
.bot-link:hover { color: var(--text-muted); }

/* Share Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7); display: none; align-items: center;
  justify-content: center; z-index: 1000; padding: 20px;
  backdrop-filter: blur(4px); transition: opacity 0.2s ease;
}
.modal-overlay.visible { display: flex; }
.modal-card {
  background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); max-width: 440px; width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.modal-close-btn {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close-btn:hover { color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-desc { font-size: 0.81rem; color: var(--text-muted); margin: 0 0 16px; line-height: 1.5; }
.share-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px;
}
.share-option {
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 6px; display: flex;
  flex-direction: column; align-items: center; gap: 8px; cursor: pointer;
  transition: var(--transition); color: var(--text-secondary);
}
.share-option:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.04); color: var(--text-primary); }
.share-icon {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; transition: var(--transition);
}
.share-icon.green { background: rgba(74, 222, 128, 0.1); color: #4ade80; }
.share-icon.pink { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.share-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.share-icon.white { background: rgba(255, 255, 255, 0.05); color: #fff; }
.share-icon.gray { background: rgba(156, 163, 175, 0.1); color: #9ca3af; }
.share-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.share-option:hover .share-icon { transform: scale(1.08); }
.share-label { font-size: 0.72rem; font-weight: 500; }

.share-link-input-wrapper {
  display: flex; gap: 8px; border: 1px solid var(--border);
  background: var(--bg-hover); border-radius: var(--radius-md);
  padding: 4px; align-items: center;
}
.share-link-input-wrapper input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 0.75rem; color: var(--text-secondary); padding: 6px 8px;
}
.share-link-input-wrapper button {
  background: #fff; color: #000; border: none; font-size: 0.75rem;
  font-weight: 600; padding: 6px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
}
.share-link-input-wrapper button:hover { background: #e5e5e5; }

/* Quota Tracker styles */
.quota-container {
  margin: 0 4px 12px 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}
.quota-header-title {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin: 0 0 6px 2px;
}
.quota-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.quota-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 42px;
}
.quota-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}
.quota-lbl {
  font-size: 0.56rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

/* ── Auth overlay & lockout screen ── */
.auth-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: #000000; display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
.auth-card {
  background: #0a0a0a; border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); max-width: 400px; width: 100%;
  padding: 32px 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  position: relative; overflow: hidden;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 24px;
}
.auth-logo .logo-icon {
  width: 32px; height: 32px; border-radius: 8px; background: #fff;
  color: #000; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.82rem;
}
.auth-logo .logo-text {
  font-size: 1.15rem; font-weight: 800; color: #fff; letter-spacing: -0.3px;
}
.auth-section h2 {
  font-size: 1.12rem; font-weight: 700; color: #fff; margin: 0 0 4px; text-align: center;
}
.auth-subtitle {
  font-size: 0.76rem; color: var(--text-muted); margin: 0 0 20px; text-align: center;
}
.form-group {
  margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px;
}
.form-group label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
}
.form-group .label-row {
  display: flex; justify-content: space-between; align-items: center;
}
.form-group input {
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 9px 12px; font-size: 0.82rem;
  color: #fff; outline: none; transition: var(--transition);
}
.form-group input:focus {
  border-color: var(--border-focus); background: rgba(255, 255, 255, 0.04);
}
.auth-submit-btn {
  width: 100%; background: #ffffff; color: #000000; border: none;
  border-radius: var(--radius-md); padding: 10px; font-size: 0.84rem;
  font-weight: 700; cursor: pointer; transition: var(--transition);
  margin-top: 8px; margin-bottom: 8px;
}
.auth-submit-btn:hover { background: #e5e5e5; }
.auth-guest-btn {
  width: 100%; background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px; font-size: 0.84rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); margin-bottom: 4px;
}
.auth-guest-btn:hover { background: var(--bg-hover); color: #fff; border-color: var(--border-strong); }
.text-link {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 0.72rem; font-weight: 500; cursor: pointer; padding: 0;
  transition: var(--transition); text-decoration: underline;
}
.text-link:hover { color: #fff; }
.text-link.font-bold { font-weight: 700; }
.auth-footer {
  font-size: 0.72rem; color: var(--text-muted); text-align: center; margin-top: 16px;
}

/* User profile row in sidebar */
.user-profile-row {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px;
}
.user-profile-info {
  display: flex; align-items: center; gap: 8px; overflow: hidden;
}
.user-profile-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--bg-hover);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 0.65rem; color: var(--text-secondary);
  flex-shrink: 0;
}
.user-profile-email {
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.signout-btn {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 6px; border-radius: 4px; transition: var(--transition);
}
.signout-btn:hover { color: #f87171; background: rgba(248, 113, 113, 0.08); }

/* Gmail Simulator Panel */
.simulator-notification {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  background: #111; border: 1px solid #333; border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.8); z-index: 2500;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.sim-header {
  background: #1c1c1c; padding: 6px 10px; font-size: 0.65rem;
  font-weight: 700; color: #fff; display: flex; justify-content: space-between;
  align-items: center; border-bottom: 1px solid #333;
}
.sim-close {
  background: transparent; border: none; color: #888; font-size: 0.88rem; cursor: pointer;
}
.sim-close:hover { color: #fff; }
.sim-body { padding: 10px; font-size: 0.68rem; color: #ccc; }
.sim-body p { margin: 3px 0; }
.sim-body hr { border: none; border-top: 1px solid #222; margin: 6px 0; }
.otp-highlight {
  color: #4ade80; font-size: 0.95rem; font-weight: 800; letter-spacing: 1px;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    width: 100%; flex-direction: column; flex-shrink: 0;
    height: auto; border-right: none; border-bottom: 1px solid var(--border);
    max-height: 130px; overflow: hidden;
  }
  .sidebar-header { padding: 10px 12px; }
  .logo { margin-bottom: 0; }
  .online-badge { display: none; }
  .sidebar-action-btns { margin-top: 8px; }
  .sidebar-search, .sidebar-content, .sidebar-footer { display: none; }
  .app-container { flex-direction: column; }
  .bubble-wrapper { max-width: 88%; }
  .message { padding: 8px 16px; }
  .chat-header { padding: 11px 16px; }
  .chat-area > .input-area { padding: 10px 0 14px; }
  .input-area-inner { padding: 0 16px; }
}
