/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d0d10;
  --bg2:         #15151a;
  --bg3:         #1c1c22;
  --border:      #28283280;
  --border-solid:#282832;
  --text:        #eaeaf5;
  --text-muted:  #7878a0;
  --accent:      #7c6af7;
  --accent-glow: rgba(124, 106, 247, 0.22);
  --accent2:     #a78bfa;
  --accent3:     #c4b5fd;
  --user-bubble: #2a284e;
  --ai-bubble:   #18181f;
  --input-bg:    #18181f;
  --sidebar-w:   260px;
  --radius:      14px;
  --transition:  0.2s ease;
  --glow-strong: rgba(124, 106, 247, 0.4);
  --glow-soft:   rgba(124, 106, 247, 0.12);
}

[data-theme="light"] {
  --bg:          #f3f3f8;
  --bg2:         #ffffff;
  --bg3:         #eaeaf2;
  --border:      #dcdce8;
  --border-solid:#dcdce8;
  --text:        #18181c;
  --text-muted:  #666688;
  --accent:      #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.18);
  --accent2:     #7c6af7;
  --accent3:     #a78bfa;
  --user-bubble: #ebe9ff;
  --ai-bubble:   #ffffff;
  --input-bg:    #ffffff;
  --glow-strong: rgba(108, 92, 231, 0.35);
  --glow-soft:   rgba(108, 92, 231, 0.08);
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ─── Layout ────────────────────────────────────────────────── */
body { display: flex; height: 100vh; }

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-w)));
  position: fixed;
  height: 100%;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}

/* Sidebar icon-only logo */
.logo-icon-img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  mix-blend-mode: screen;
  flex-shrink: 0;
}

/* Full logo (auth, pricing) */
.logo-img {
  height: 48px;
  width: auto;
  mix-blend-mode: screen;
  object-fit: contain;
}

[data-theme="light"] .logo-icon-img,
[data-theme="light"] .logo-img {
  mix-blend-mode: normal;
  filter: invert(30%) sepia(90%) saturate(600%) hue-rotate(240deg) brightness(0.9);
}

.new-chat-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.new-chat-btn:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-soft);
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 8px 12px;
  background: var(--bg3);
  border-radius: 9px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.sidebar-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-soft);
}
.sidebar-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}
.sidebar-search input::placeholder { color: var(--text-muted); }

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-solid) transparent;
}
.history-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 8px 4px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.history-item:hover { background: var(--bg3); color: var(--text); }
.history-item.active {
  background: linear-gradient(90deg, var(--accent-glow), transparent);
  color: var(--accent2);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}
.history-item svg { flex-shrink: 0; }
.history-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.history-delete-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.history-item:hover .history-delete-btn { opacity: 1; }
.history-delete-btn:hover { color: #ef4444; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-legal {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.sidebar-legal a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.sidebar-legal a:hover { color: var(--text); }

.signout-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.signout-btn:hover { background: rgba(239,68,68,0.1); color: #f87171; }
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease;
  flex: 1;
}
.user-info:hover { background: var(--bg3); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.beta-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 2px;
}

.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; }
.user-sub { font-size: 11px; color: var(--text-muted); }

/* ─── Main ──────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

/* ─── Topbar ────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 13, 16, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
[data-theme="light"] .topbar { background: rgba(243,243,248,0.85); }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: all 0.18s ease;
}
.sidebar-toggle:hover { background: var(--bg3); color: var(--text); }
.topbar-title { font-weight: 600; font-size: 15px; flex: 1; }
.topbar-actions { display: flex; gap: 6px; }
.upgrade-btn {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  text-decoration: none;
  transition: all 0.22s ease;
  box-shadow: 0 2px 14px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
  position: relative;
  overflow: hidden;
}
.upgrade-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.upgrade-btn:hover::before { transform: translateX(100%); }
.upgrade-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 24px var(--glow-strong);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.icon-btn:hover { background: var(--bg3); color: var(--text); border-color: var(--border-solid); }

/* ─── Chat Area ─────────────────────────────────────────────── */
.chat-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ─── Welcome Screen ────────────────────────────────────────── */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  padding: 0 24px 32px;
  text-align: center;
}

.welcome-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0 20px;
}

.welcome-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -1.5px;
  color: var(--text);
  line-height: 1.1;
}

.welcome-title span {
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-suggestions {
  width: 100%;
  max-width: 760px;
}

.welcome-sug-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: left;
}

.welcome-sug-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.welcome-sug-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-muted);
  font-family: inherit;
  transition: all 0.18s ease;
  white-space: nowrap;
  opacity: 0;
  animation: cardEntrance 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.welcome-sug-card:nth-child(1) { animation-delay: 0.05s; }
.welcome-sug-card:nth-child(2) { animation-delay: 0.11s; }
.welcome-sug-card:nth-child(3) { animation-delay: 0.17s; }
.welcome-sug-card:nth-child(4) { animation-delay: 0.23s; }

.welcome-sug-card:hover {
  background: var(--bg3);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--glow-soft);
}

.sug-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tag-smart   { background: rgba(124,106,247,0.18); color: var(--accent2); border: 1px solid rgba(124,106,247,0.3); }
.tag-discuss { background: rgba(34,197,94,0.12);  color: #4ade80;        border: 1px solid rgba(34,197,94,0.25); }

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Messages ──────────────────────────────────────────────── */
.messages-container {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-solid) transparent;
}
.messages {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  display: flex;
  gap: 12px;
  animation: msgSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.message.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}
.message.ai .msg-avatar {
  background: #18181f;
  border: 1.5px solid var(--border-solid);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
/* dual-logo avatar for AI collab */
.av-dual {
  display: flex;
  align-items: center;
  gap: 2px;
}
.message.user .msg-avatar {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  box-shadow: 0 2px 10px rgba(245,158,11,0.3);
}

.msg-body { max-width: 78%; display: flex; flex-direction: column; gap: 6px; }
.message.user .msg-body { align-items: flex-end; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
}
.message.user .msg-bubble {
  background: linear-gradient(135deg, var(--user-bubble), #342e62);
  border-bottom-right-radius: 5px;
  color: var(--text);
  border: 1px solid rgba(124,106,247,0.25);
}
.message.ai .msg-bubble {
  background: var(--ai-bubble);
  border: 1px solid var(--border);
  border-left: 2.5px solid var(--accent);
  border-bottom-left-radius: 5px;
  color: var(--text);
}

.msg-image-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.msg-image-row img {
  max-width: 240px;
  max-height: 200px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.msg-image-row img:hover { transform: scale(1.03); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

.msg-time {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* Typing indicator */
.typing-bubble {
  background: var(--ai-bubble);
  border: 1px solid var(--border);
  border-left: 2.5px solid var(--accent);
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  padding: 14px 18px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
    background: var(--accent2);
  }
  30% {
    transform: translateY(-7px);
    opacity: 1;
    background: var(--accent3);
  }
}

/* Markdown-like content */
.msg-bubble code {
  background: rgba(124,106,247,0.15);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--accent3);
  border: 1px solid rgba(124,106,247,0.2);
}
.msg-bubble pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  margin: 8px 0;
}
.msg-bubble pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 13px;
}
.msg-bubble strong { font-weight: 600; color: var(--accent3); }
.msg-bubble em { opacity: 0.85; }
.msg-bubble ul, .msg-bubble ol { padding-left: 20px; }
.msg-bubble li { margin: 3px 0; }
.msg-bubble h1,.msg-bubble h2,.msg-bubble h3 { font-weight: 700; margin: 10px 0 4px; }
.msg-bubble h1 { font-size: 18px; }
.msg-bubble h2 { font-size: 16px; }
.msg-bubble h3 { font-size: 15px; }
.msg-bubble blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 8px 0;
  opacity: 0.8;
}
.msg-bubble hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

/* ─── Input Area ────────────────────────────────────────────── */
.input-area {
  padding: 12px 20px 18px;
  flex-shrink: 0;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  align-self: center;
}

.image-preview-bar {
  margin-bottom: 8px;
}
.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preview-thumb {
  position: relative;
  display: inline-block;
}
.preview-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.input-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--input-bg);
  border: 1px solid var(--border-solid);
  border-radius: 18px;
  padding: 10px 12px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 2px 16px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.1);
}
.input-box:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-glow),
    0 0 20px var(--glow-soft),
    0 4px 20px rgba(0,0,0,0.2);
}

/* ─── Plus button & menu ────────────────────────────────────── */
.plus-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.plus-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-solid);
  background: var(--bg3);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.plus-btn:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: var(--accent-glow);
  transform: scale(1.08);
}
.plus-btn.open {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: rotate(45deg) scale(1.08);
  box-shadow: 0 0 14px var(--glow-strong);
}

.plus-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 14px;
  padding: 6px;
  min-width: 200px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom left;
}
.plus-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.plus-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}
.plus-menu-item:hover {
  background: var(--bg3);
  color: var(--accent2);
}
.plus-menu-item.active {
  background: var(--accent-glow);
  color: var(--accent2);
}
.plus-menu-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.plus-menu-item:hover .plus-menu-icon,
.plus-menu-item.active .plus-menu-icon {
  background: var(--accent-glow);
}
.plus-menu-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  letter-spacing: 0.03em;
}

.debate-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 8px;
  display: flex;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.debate-btn:hover {
  color: var(--accent2);
  background: var(--accent-glow);
  transform: scale(1.1);
}
.debate-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 12px var(--glow-soft);
  animation: debatePulse 2s ease-in-out infinite;
}
@keyframes debatePulse {
  0%, 100% { box-shadow: 0 0 0 1.5px var(--accent), 0 0 12px var(--glow-soft); }
  50%       { box-shadow: 0 0 0 1.5px var(--accent), 0 0 20px var(--accent-glow); }
}
.debate-btn::after {
  content: '⚡ AI Debate — Gemini & Groq each answer, then combine into one best response';
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 10px;
  width: 220px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transition-delay: 0s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
}
.debate-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0.5s;
}

.message-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  resize: none;
  max-height: 180px;
  line-height: 1.55;
  scrollbar-width: thin;
}
.message-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--accent-glow);
  position: relative;
  overflow: hidden;
}
.send-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  opacity: 0;
  transition: opacity 0.22s ease;
}
.send-btn:hover:not(:disabled) {
  transform: scale(1.1) translateY(-1px);
  box-shadow: 0 6px 20px var(--glow-strong);
}
.send-btn:hover:not(:disabled)::before { opacity: 1; }
.send-btn svg { position: relative; z-index: 1; }
.send-btn:disabled {
  background: var(--bg3);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.input-row .input-box { flex: 1; }

.input-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.7;
}

/* ─── Image Lightbox ────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox.open { display: flex; animation: fadeInOverlay 0.2s ease; }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 14px;
  object-fit: contain;
  animation: lightboxPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes lightboxPop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); transform: scale(1.1); }

/* ─── API Key Banner ────────────────────────────────────────── */
.api-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(245,158,11,0.15), rgba(239,68,68,0.1));
  border-bottom: 1px solid rgba(245,158,11,0.3);
  font-size: 13px;
  color: var(--text);
}
.api-banner.show { display: flex; }
.api-banner strong { color: #f59e0b; }
.api-banner input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: monospace;
}
.api-banner input:focus { border-color: var(--accent); }
.api-save-btn {
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.18s ease;
}
.api-save-btn:hover { background: var(--accent2); transform: scale(1.04); }

/* ─── Model Picker ──────────────────────────────────────────── */
.model-picker { position: relative; }

.model-picker-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  white-space: nowrap;
}
.model-picker-btn:hover { border-color: var(--accent); color: var(--accent2); box-shadow: 0 0 0 3px var(--glow-soft); }

.model-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 14px;
  padding: 8px;
  min-width: 240px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 200;
}
.model-dropdown.open {
  display: block;
  animation: dropdownOpen 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dropdownOpen {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.model-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 10px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-tag {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.model-option:hover:not(.locked) { background: var(--bg3); }
.model-option.active {
  background: var(--accent-glow);
  border-left: 2px solid var(--accent);
}
.model-option.locked { opacity: 0.45; cursor: not-allowed; }

.model-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.model-name { font-size: 13px; font-weight: 500; color: var(--text); }
.model-desc { font-size: 11px; color: var(--text-muted); }
.lock-icon { font-size: 13px; }

.model-cost-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(124,106,247,0.15);
  color: var(--accent2);
  border: 1px solid rgba(124,106,247,0.3);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.model-cost-free {
  background: rgba(74,222,128,0.12);
  color: #4ade80;
  border-color: rgba(74,222,128,0.25);
}
.model-cost-pro {
  background: rgba(251,146,60,0.12);
  color: #fb923c;
  border-color: rgba(251,146,60,0.25);
}
.provider-logo { flex-shrink: 0; display: block; }
.picker-logo { display: flex; align-items: center; flex-shrink: 0; }

.ai-model-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}

.max-collab-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent2);
  margin-right: 4px;
  white-space: nowrap;
}

.debate-disc-label { color: var(--text-muted); font-style: italic; }
.debate-disc-bubble {
  border: 1px dashed var(--border-solid);
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  border-left: 2.5px dashed var(--accent);
}

/* ─── Upgrade Toast ──────────────────────────────────────────── */
.upgrade-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--border-solid);
  z-index: 500;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
.upgrade-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.upgrade-toast a { color: var(--accent2); font-weight: 600; text-decoration: none; margin-left: 6px; }

/* ─── Limit Modal ────────────────────────────────────────────── */
.limit-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.limit-modal.show { opacity: 1; }

.limit-modal-box {
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 22px;
  padding: 36px 32px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,106,247,0.15);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modalPop {
  from { transform: scale(0.9) translateY(12px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.limit-icon { font-size: 36px; animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both; }
@keyframes iconBounce {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.limit-modal-box h3 { font-size: 18px; font-weight: 700; }
.limit-modal-box p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.limit-modal-box strong { color: var(--text); }

.limit-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.limit-upgrade-btn {
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s ease;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.limit-upgrade-btn:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 8px 24px var(--glow-strong); }
.limit-close-btn {
  padding: 10px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-solid);
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}
.limit-close-btn:hover { background: var(--bg3); color: var(--text); }

/* ─── Usage Circle ──────────────────────────────────────────── */
.usage-circle-wrap { position: relative; flex-shrink: 0; }

.usage-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--border-solid);
  background: conic-gradient(var(--accent) 0%, var(--border-solid) 0%);
  cursor: pointer;
  transition: all 0.22s ease;
  padding: 0;
  position: relative;
}
.usage-circle::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--input-bg);
}
.usage-circle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-soft);
  transform: scale(1.08);
}

.usage-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  left: auto;
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 16px;
  padding: 14px 16px;
  width: 240px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 300;
  flex-direction: column;
  gap: 10px;
}
.usage-popup.open {
  display: flex;
  animation: dropdownOpen 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.usage-popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.usage-popup-label { color: var(--text-muted); }
.usage-popup-value { font-weight: 600; color: var(--text); font-size: 12px; }

.usage-bar-wrap { width: 100%; }
.usage-bar-track {
  width: 100%;
  height: 5px;
  background: var(--bg3);
  border-radius: 999px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
  background-size: 200% 100%;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0%;
  animation: barShimmer 2s linear infinite;
}
@keyframes barShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.usage-popup-plan {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent2);
  border: 1px solid var(--accent);
}

.usage-upgrade-link {
  font-size: 12px;
  color: var(--accent2);
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  background: var(--accent-glow);
  transition: all 0.18s ease;
}
.usage-upgrade-link:hover { background: var(--accent); color: white; transform: scale(1.02); }

/* ─── Error message ─────────────────────────────────────────── */
.error-bubble {
  background: rgba(239,68,68,0.08) !important;
  border-color: rgba(239,68,68,0.3) !important;
  border-left-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sidebar { position: fixed; height: 100%; transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.5); }
  .suggestion-grid { grid-template-columns: 1fr; }
  .welcome-title { font-size: 24px; }
}

/* ─── Settings Panel ────────────────────────────────────────── */
.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(3px);
}
.settings-overlay.open { opacity: 1; pointer-events: all; }

/* Two-column centered modal */
.settings-panel {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(740px, 95vw);
  height: min(560px, 92vh);
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 18px;
  z-index: 201;
  opacity: 0; pointer-events: none;
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
  display: flex; overflow: hidden;
  box-shadow: 0 28px 72px rgba(0,0,0,0.45);
}
.settings-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1; pointer-events: all;
}

/* ── Left Nav ─────────────────────────────────────── */
.settings-nav {
  width: 210px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 12px 16px;
  background: var(--bg);
}
.settings-nav-profile {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; text-align: center;
  padding-bottom: 18px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.settings-avatar-lg {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden; margin-bottom: 6px;
  box-shadow: 0 4px 16px var(--accent-glow), 0 0 0 3px var(--glow-soft);
}
.settings-nav-name { font-size: 13px; font-weight: 600; }
.settings-nav-email { font-size: 11px; color: var(--text-muted); }
.settings-plan-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px; margin-top: 2px;
  border-radius: 20px;
  background: var(--accent-glow); color: var(--accent2);
  border: 1px solid var(--accent);
}
.settings-nav-list {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.settings-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 10px;
  border: none; background: none;
  color: var(--text-muted); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left; width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
}
.settings-nav-item:hover { background: var(--bg3); color: var(--text); }
.settings-nav-item.active { background: var(--bg3); color: var(--text); }
.settings-nav-footer {
  padding-top: 12px; border-top: 1px solid var(--border);
}
.settings-signout-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border-solid);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
  transition: all 0.18s ease; width: 100%; justify-content: center;
  font-family: inherit;
}
.settings-signout-btn:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.06); }

/* ── Right Content ────────────────────────────────── */
.settings-content {
  flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}
.settings-content-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.settings-content-title { font-size: 17px; font-weight: 700; }
.settings-close-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 5px; border-radius: 7px;
  display: flex; transition: all 0.18s ease;
}
.settings-close-btn:hover { background: var(--bg3); color: var(--text); }

.settings-page {
  display: none; flex-direction: column; gap: 0;
  overflow-y: auto; flex: 1;
}
.settings-page.active { display: flex; }

.settings-group {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
}
.settings-group:last-child { border-bottom: none; }
.settings-group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.settings-field-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.settings-row-info { display: flex; flex-direction: column; gap: 2px; }
.settings-row-title { font-size: 14px; font-weight: 500; }
.settings-row-sub { font-size: 12px; color: var(--text-muted); }

.settings-toggle-btn {
  flex-shrink: 0;
  background: var(--bg3); border: 1px solid var(--border-solid);
  color: var(--text); font-size: 12px; font-weight: 500;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  transition: all 0.18s ease; white-space: nowrap;
  text-decoration: none; display: inline-flex; align-items: center;
}
.settings-toggle-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--glow-soft); }

.settings-danger-btn {
  flex-shrink: 0;
  background: none; border: 1px solid rgba(239,68,68,0.35);
  color: #ef4444; font-size: 12px; font-weight: 500;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  transition: all 0.18s ease;
}
.settings-danger-btn:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; }

@media (max-width: 600px) {
  .settings-panel {
    width: 100vw; height: 100dvh; border-radius: 0;
    top: 0; left: 0; transform: translateY(6px) scale(0.99);
  }
  .settings-panel.open { transform: none; }
  .settings-nav { width: 150px; padding: 14px 8px 12px; }
  .settings-avatar-lg { width: 40px; height: 40px; font-size: 15px; }
  .settings-nav-item { font-size: 12.5px; padding: 8px 9px; }
  .settings-group { padding: 16px 18px; }
  .settings-content-header { padding: 14px 18px 12px; }
}

/* ─── Settings inputs & admin ───────────────────────────────── */
.settings-input {
  flex: 1; min-width: 0;
  background: var(--bg3);
  border: 1px solid var(--border-solid);
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.settings-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow-soft); }

.settings-labeled-field { display: flex; flex-direction: column; gap: 6px; }
.settings-field-label { font-size: 13px; font-weight: 500; color: var(--text); }
.settings-text-input {
  width: 100%; box-sizing: border-box;
  background: var(--bg3); border: 1px solid var(--border-solid);
  color: var(--text); font-size: 14px; padding: 9px 12px;
  border-radius: 10px; outline: none; font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.settings-text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow-soft); }
.settings-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

.settings-select {
  background: var(--bg3);
  border: 1px solid var(--border-solid);
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s ease;
}
.settings-select:focus { border-color: var(--accent); }

.redeem-row { display: flex; gap: 8px; align-items: center; }
.redeem-status { font-size: 13px; margin-top: 2px; min-height: 18px; }
.redeem-status.success { color: #4ade80; }
.redeem-status.error   { color: #f87171; }

.admin-section { border-color: rgba(124,106,247,0.25); background: rgba(124,106,247,0.04); }
.admin-form { display: flex; flex-direction: column; gap: 12px; }

.settings-generate-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: white;
  font-size: 13px; font-weight: 600;
  padding: 10px; border-radius: 9px;
  cursor: pointer; width: 100%;
  transition: all 0.22s ease;
  box-shadow: 0 2px 12px var(--accent-glow);
  position: relative; overflow: hidden;
}
.settings-generate-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}
.settings-generate-btn:hover::before { transform: translateX(100%); }
.settings-generate-btn:hover { box-shadow: 0 4px 20px var(--glow-strong); transform: translateY(-1px); }
.settings-generate-btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }

.generated-code-wrap { display: flex; flex-direction: column; gap: 6px; }
.generated-code-box {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border: 1.5px dashed var(--accent);
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.generated-code-box:hover { background: var(--accent-glow); border-style: solid; }
.generated-code-text {
  font-size: 20px; font-family: 'Courier New', monospace;
  font-weight: 700; letter-spacing: 0.12em; color: var(--accent2);
}
.generated-code-meta {
  font-size: 12px; color: var(--text-muted); text-align: center;
}

/* ─── Memory ────────────────────────────────────────────────── */
.memories-list { display: flex; flex-direction: column; gap: 6px; }
.memories-empty { font-size: 13px; color: var(--text-muted); font-style: italic; }
.memory-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  transition: border-color 0.18s ease;
  animation: msgSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.memory-item:hover { border-color: var(--accent); }
.memory-text { font-size: 13px; flex: 1; line-height: 1.4; }
.memory-delete-btn {
  background: none; border: none;
  color: var(--text-muted); font-size: 20px;
  cursor: pointer; padding: 0 2px; line-height: 1; flex-shrink: 0;
  transition: all 0.15s ease;
}
.memory-delete-btn:hover { color: #ef4444; transform: scale(1.2); }
.memory-toast { background: var(--bg2); border: 1px solid var(--border-solid); }

/* ─── Ambient Background ────────────────────────────────────── */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-ambient::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,106,247,0.07) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  animation: ambientDrift1 18s ease-in-out infinite;
}
.bg-ambient::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,0.05) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation: ambientDrift2 22s ease-in-out infinite;
}
@keyframes ambientDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-60px, 40px) scale(1.1); }
  66%       { transform: translate(40px, -30px) scale(0.95); }
}
@keyframes ambientDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(50px, -40px) scale(1.08); }
  70%       { transform: translate(-30px, 30px) scale(0.92); }
}
[data-theme="light"] .bg-ambient::before { background: radial-gradient(circle, rgba(108,92,231,0.05) 0%, transparent 70%); }
[data-theme="light"] .bg-ambient::after  { background: radial-gradient(circle, rgba(124,106,247,0.04) 0%, transparent 70%); }

/* ─── Orb Ring ──────────────────────────────────────────────── */
.welcome-orb-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 6px;
}
.welcome-orb-wrap .welcome-orb {
  margin-bottom: 0;
}
.welcome-orb-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box,
              conic-gradient(from 0deg, var(--accent), var(--accent2), var(--accent3), transparent 60%) border-box;
  animation: ringRotate 4s linear infinite;
  opacity: 0.7;
}
.welcome-orb-ring2 {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box,
              conic-gradient(from 180deg, transparent 40%, var(--accent2), var(--accent3), transparent 80%) border-box;
  animation: ringRotate 7s linear infinite reverse;
  opacity: 0.4;
}
@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Smooth Scroll & Focus ─────────────────────────────────── */
html { scroll-behavior: smooth; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Subtle topbar bottom glow ─────────────────────────────── */
.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  pointer-events: none;
}

/* ─── Logo glow shimmer ─────────────────────────────────────── */
.logo-icon-img {
  animation: logoGlow 4s ease-in-out infinite;
}
@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(124,106,247,0.4)); }
  50%       { filter: drop-shadow(0 0 14px rgba(167,139,250,0.65)); }
}
.auth-logo-img {
  filter: drop-shadow(0 0 16px rgba(124,106,247,0.45));
}

/* ─── Chat area z-index fix ─────────────────────────────────── */
.chat-area { z-index: 1; }
.input-area { z-index: 1; }

/* ─── Message hover reveal time ─────────────────────────────── */
.msg-time {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.message:hover .msg-time { opacity: 1; }

/* ─── AI bubble shimmer on load ─────────────────────────────── */
.message.ai .msg-bubble {
  background: linear-gradient(135deg, var(--ai-bubble) 0%, rgba(124,106,247,0.04) 100%);
}

/* ─── Scroll-to-bottom button ───────────────────────────────── */
.scroll-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 34px;
  height: 34px;
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.scroll-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.scroll-btn:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--glow-soft);
}

/* ─── Welcome screen entrance ───────────────────────────────── */
.welcome-screen > *:not(.suggestion-grid) {
  animation: welcomeFade 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.welcome-screen > *:nth-child(1) { animation-delay: 0s; }
.welcome-screen > *:nth-child(2) { animation-delay: 0.08s; }
.welcome-screen > *:nth-child(3) { animation-delay: 0.14s; }
@keyframes welcomeFade {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── GPU hints ─────────────────────────────────────────────── */
.welcome-orb,
.welcome-orb-ring,
.welcome-orb-ring2,
.bg-ambient::before,
.bg-ambient::after,
.send-btn,
.upgrade-btn {
  will-change: transform;
}

/* ─── AI Team Modal ─────────────────────────────────────────── */
.ai-team-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(3px);
}
.ai-team-overlay.open { opacity: 1; pointer-events: all; }

.ai-team-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: 82vh;
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 22px;
  z-index: 301;
  opacity: 0; pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(124,106,247,0.12);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ai-team-modal.open {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.ai-team-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-team-title  { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.ai-team-sub    { font-size: 13px; color: var(--text-muted); }
.ai-team-close-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease; flex-shrink: 0;
}
.ai-team-close-btn:hover { color: var(--text); background: var(--bg3); }

.ai-team-grid {
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border-solid) transparent;
}

/* ─── Provider rows ─────────────────────────────────────────── */
.ai-provider-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--border-solid);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: var(--bg3);
  user-select: none;
}
.ai-provider-row:hover:not(.locked) {
  border-color: var(--pcolor, var(--accent));
  box-shadow: 0 0 0 3px rgba(0,0,0,0);
  background: var(--bg2);
}
.ai-provider-row.selected {
  border-color: var(--pcolor, var(--accent));
  background: var(--bg2);
  box-shadow: 0 0 0 3px var(--glow-soft),
              inset 3px 0 0 var(--pcolor, var(--accent));
  padding-left: 11px;
}
.ai-provider-row.locked { opacity: 0.42; cursor: default; }

.provider-badge {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--border-solid);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.provider-badge.visible {
  background: var(--pcolor, var(--accent));
  border-color: var(--pcolor, var(--accent));
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  animation: numPop 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes numPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.provider-logo-wrap {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: box-shadow 0.2s ease;
}
.ai-provider-row.selected .provider-logo-wrap {
  box-shadow: 0 0 0 2px var(--pcolor, var(--accent));
}

.provider-info {
  display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0;
}
.provider-name       { font-size: 15px; font-weight: 700; }
.provider-model-label { font-size: 12px; color: var(--text-muted); }
.ai-provider-row.selected .provider-model-label {
  color: var(--pcolor, var(--accent));
  opacity: 0.85;
}

.provider-role-chip {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--pcolor, var(--accent));
  color: var(--pcolor, var(--accent));
  flex-shrink: 0;
  animation: numPop 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}

.ai-team-footer {
  padding: 13px 18px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-shrink: 0;
}
.ai-team-hint { font-size: 13px; color: var(--text-muted); flex: 1; }
.ai-team-start-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: white; font-family: inherit;
  font-size: 13px; font-weight: 600;
  padding: 9px 20px; border-radius: 10px; cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px var(--accent-glow);
  white-space: nowrap;
}
.ai-team-start-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--glow-strong);
}
.ai-team-start-btn:disabled {
  opacity: 0.38; cursor: not-allowed;
  transform: none; box-shadow: none;
}

/* ─── Input area glass floor ────────────────────────────────── */
.input-area {
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  padding-top: 24px;
}

/* ─── Plan badge colors ─────────────────────────────────────── */
.plan-basic  { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.4); }
.plan-pro    { background: rgba(168,85,247,0.15); color: #c084fc; border-color: rgba(168,85,247,0.4); }
.plan-max    {
  background: linear-gradient(135deg, rgba(124,106,247,0.2), rgba(196,181,253,0.15));
  color: var(--accent3);
  border-color: var(--accent);
}


/* ─── Map card ──────────────────────────────────────────────── */
.map-card {
  margin-top: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-solid);
  background: var(--bg2);
  max-width: 480px;
}
.map-card iframe {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}
.map-open-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent2);
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background var(--transition);
}
.map-open-btn:hover { background: var(--bg3); }

/* ─── Thinking mode toggle ──────────────────────────────────── */
.think-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.think-toggle-icon { font-size: 16px; line-height: 1; }
.think-toggle:hover { border-color: var(--accent); color: var(--text); background: var(--bg3); }
.think-toggle.thinking {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent2);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ─── Thinking indicator (while <think> block streams) ─────── */
.think-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 2px 0;
}
.think-dots {
  display: flex; gap: 4px; align-items: center;
}
.think-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent2);
  animation: thinkPulse 1.4s ease-in-out infinite;
}
.think-dots span:nth-child(2) { animation-delay: 0.22s; }
.think-dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes thinkPulse {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.3; }
  40%            { transform: scale(1);    opacity: 1;   }
}

/* ─── Streaming cursor ──────────────────────────────────────── */
.stream-cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--accent2);
  border-radius: 1px;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.6s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ─── New Input Card ────────────────────────────────────────── */
.input-area {
  padding: 0 20px 20px !important;
  background: linear-gradient(to top, var(--bg) 70%, transparent) !important;
  padding-top: 0 !important;
}

.input-card-wrap {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.input-card {
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 20px;
  padding: 14px 16px 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 30px rgba(0,0,0,0.25), 0 1px 6px rgba(0,0,0,0.15);
}
.input-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 4px 30px rgba(0,0,0,0.25);
}

.input-card .message-input {
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 15px;
  min-height: 28px;
}

/* Toolbar */
.input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 6px;
}
.input-toolbar-left  { display: flex; align-items: center; gap: 2px; }
.input-toolbar-right { display: flex; align-items: center; gap: 6px; }

/* Toolbar icon buttons */
.tb-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-family: inherit;
  flex-shrink: 0;
}
.tb-btn:hover  { background: var(--bg3); color: var(--text); }
.tb-btn.active { background: var(--accent-glow); color: var(--accent2); }

/* Thinking button — wider pill inside toolbar */
.tb-think-btn {
  width: auto;
  padding: 0 10px;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tb-think-btn.thinking {
  background: var(--accent-glow);
  color: var(--accent2);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Model picker inside toolbar */
.tb-model-wrap {
  position: relative;
}
.tb-model-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tb-model-btn:hover { border-color: var(--accent); color: var(--text); background: var(--bg3); }
.tb-model-btn .picker-logo { margin-right: 2px; }

/* Model dropdown opens upward from input */
.tb-model-wrap .model-dropdown {
  bottom: calc(100% + 10px) !important;
  top: auto !important;
  right: 0 !important;
  left: auto !important;
}

/* Send button — filled circle */
.send-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: var(--accent) !important;
  border: none !important;
  color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0;
}
.send-btn:not(:disabled):hover {
  background: var(--accent2) !important;
  transform: scale(1.08) !important;
  box-shadow: 0 0 16px var(--accent-glow) !important;
}
.send-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}

/* Image preview bar inside card wrap */
.input-card-wrap .image-preview-bar {
  background: var(--bg2);
  border: 1px solid var(--border-solid);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

/* ─── Guest Banner ──────────────────────────────────────────────── */
.guest-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 20px;
  background: linear-gradient(90deg, rgba(139,92,246,0.15), rgba(139,92,246,0.08));
  border-bottom: 1px solid rgba(139,92,246,0.3);
  font-size: 13px; color: var(--text-muted);
  backdrop-filter: blur(8px);
}
.guest-banner strong { color: #8B5CF6; }
.guest-signup-btn {
  margin-left: 8px; padding: 4px 12px; border-radius: 8px;
  background: #8B5CF6; color: #fff; font-size: 12px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: opacity 0.15s ease;
}
.guest-signup-btn:hover { opacity: 0.85; }

/* Push main content down when banner is visible */
body:has(#guestBanner[style*="flex"]) .main,
body:has(#guestBanner[style*="flex"]) aside { margin-top: 38px; }

/* ─── Signup Nudge Modal ─────────────────────────────────────────── */
.signup-nudge-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.signup-nudge-modal {
  position: fixed; top: 50%; left: 50%; z-index: 401;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(420px, 92vw);
  background: var(--bg2); border: 1px solid var(--border-solid);
  border-radius: 20px; padding: 36px 32px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; pointer-events: none;
  transition: transform 0.24s cubic-bezier(0.4,0,0.2,1), opacity 0.22s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.signup-nudge-modal.open,
.signup-nudge-modal.open ~ .signup-nudge-overlay,
#signupNudgeModal.open ~ #signupNudgeOverlay { opacity: 1; pointer-events: all; }
#signupNudgeModal.open { transform: translate(-50%,-50%) scale(1); opacity: 1; pointer-events: all; }
#signupNudgeOverlay.open { opacity: 1; pointer-events: all; }
.signup-nudge-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(139,92,246,0.12); border: 1.5px solid rgba(139,92,246,0.35);
  display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.signup-nudge-title { font-size: 20px; font-weight: 700; }
.signup-nudge-msg { font-size: 14px; color: var(--text-muted); margin: 0; }
.signup-nudge-sub { font-size: 13px; color: var(--text-muted); margin: 0; }
.signup-nudge-cta {
  margin-top: 8px; width: 100%; padding: 13px;
  background: #8B5CF6; color: #fff; font-size: 15px; font-weight: 600;
  border-radius: 12px; text-decoration: none; display: block;
  transition: opacity 0.15s ease;
}
.signup-nudge-cta:hover { opacity: 0.88; }
.signup-nudge-login { font-size: 12px; color: var(--text-muted); margin: 0; }
.signup-nudge-login a { color: #8B5CF6; text-decoration: none; }
@keyframes nudgeShake {
  0%,100% { transform: translate(-50%,-50%) scale(1); }
  20%      { transform: translate(calc(-50% + 8px),-50%) scale(1); }
  40%      { transform: translate(calc(-50% - 8px),-50%) scale(1); }
  60%      { transform: translate(calc(-50% + 5px),-50%) scale(1); }
  80%      { transform: translate(calc(-50% - 4px),-50%) scale(1); }
}

/* ─── Cookie Consent Banner ─────────────────────────────────────── */
.consent-banner {
  position: fixed; bottom: -120px; left: 50%; transform: translateX(-50%);
  width: min(680px, 94vw);
  background: var(--bg2); border: 1px solid var(--border-solid);
  border-radius: 16px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.consent-banner.show { bottom: 20px; }
.consent-text { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.consent-text a { color: var(--accent2); text-decoration: none; }
.consent-text a:hover { text-decoration: underline; }
.consent-btns { display: flex; gap: 8px; flex-shrink: 0; }
.consent-decline {
  background: none; border: 1px solid var(--border-solid);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.consent-decline:hover { border-color: var(--text-muted); color: var(--text); }
.consent-accept {
  background: var(--accent); border: none;
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.consent-accept:hover { opacity: 0.88; }
@media (max-width: 500px) {
  .consent-banner { flex-direction: column; align-items: flex-start; }
  .consent-btns { width: 100%; justify-content: flex-end; }
}
