*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-font-smoothing: antialiased; }

html.dark {
  --bg: #0a0a0f;
  --sidebar-bg: rgba(17, 17, 27, 0.85);
  --sidebar-border: rgba(255, 255, 255, 0.05);
  --main-bg: #0d0d16;
  --header-bg: rgba(13, 13, 22, 0.8);
  --input-bg: rgba(25, 25, 42, 0.6);
  --input-border: rgba(255, 255, 255, 0.07);
  --text: #e8e8ed;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b80;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --user-msg-bg: linear-gradient(135deg, #6366f1, #7c3aed);
  --assistant-bg: rgba(255, 255, 255, 0.03);
  --assistant-border: rgba(255, 255, 255, 0.06);
  --glass-bg: rgba(25, 25, 42, 0.5);
  --glass-border: rgba(255, 255, 255, 0.06);
  --scrollbar: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.04);
  --danger: #ef4444;
  --code-bg: rgba(0, 0, 0, 0.35);
  --code-inline-bg: rgba(99, 102, 241, 0.12);
}

html.light {
  --bg: #f0f0f4;
  --sidebar-bg: rgba(255, 255, 255, 0.85);
  --sidebar-border: rgba(0, 0, 0, 0.06);
  --main-bg: #f5f5f9;
  --header-bg: rgba(255, 255, 255, 0.85);
  --input-bg: rgba(255, 255, 255, 0.8);
  --input-border: rgba(0, 0, 0, 0.08);
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --user-msg-bg: linear-gradient(135deg, #6366f1, #7c3aed);
  --assistant-bg: rgba(0, 0, 0, 0.02);
  --assistant-border: rgba(0, 0, 0, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.06);
  --scrollbar: rgba(0, 0, 0, 0.08);
  --hover: rgba(0, 0, 0, 0.03);
  --danger: #dc2626;
  --code-bg: rgba(0, 0, 0, 0.06);
  --code-inline-bg: rgba(99, 102, 241, 0.1);
}

body {
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
}

#app {
  display: flex;
  height: 100vh;
  position: relative;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}

.logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.new-chat-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  font-family: inherit;
}
.new-chat-btn:hover {
  background: var(--hover);
  border-color: var(--accent);
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.conversation-list::-webkit-scrollbar { width: 4px; }
.conversation-list::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.conv-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.conv-item:hover { background: var(--hover); color: var(--text); }
.conv-item.active {
  background: var(--hover);
  color: var(--text);
  border-left: 2px solid var(--accent);
}

.conv-delete {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.conv-item:hover .conv-delete { display: flex; }
.conv-delete:hover { color: var(--danger); background: rgba(239, 68, 68, 0.15); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
}

.model-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.model-select:focus { border-color: var(--accent); }

/* ===== MAIN AREA ===== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--main-bg);
  min-width: 0;
  position: relative;
}

.main-header {
  padding: 10px 20px;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  min-height: 54px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.header-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.model-name { font-size: 14px; font-weight: 500; }

.model-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.3s;
}
.model-status.idle { background: rgba(107, 114, 128, 0.12); color: var(--text-muted); }
.model-status.thinking {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  animation: pulse 1.5s ease infinite;
}
.model-status.error { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== CHAT CONTAINER ===== */
.chat-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}
.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
.chat-container::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.welcome-content {
  text-align: center;
  max-width: 520px;
}

.welcome-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

.welcome-content h1 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.welcome-content p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.welcome-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

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

.hint-chip {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.hint-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
}

.model-cards {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.model-card {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  min-width: 130px;
}
.model-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.08);
}

.model-card-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.model-card-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
}
.model-card-size {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== CHAT MESSAGES ===== */
.chat-messages {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.message {
  padding: 18px 24px;
  display: flex;
  gap: 14px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.25s ease;
}

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

.message.user-message {
  background: var(--user-msg-bg);
  margin: 8px auto;
  border-radius: 14px 14px 4px 14px;
  max-width: 75%;
  margin-left: auto;
  margin-right: 24px;
  padding: 12px 16px;
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.message-avatar.user {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.message-avatar.assistant {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--assistant-border);
}

.user-message .message-avatar.user { display: none; }

.message-content {
  flex: 1;
  font-size: 14.5px;
  line-height: 1.7;
  min-width: 0;
}

.user-message .message-content {
  color: white;
}

.message-content p { margin-bottom: 8px; }
.message-content p:last-child { margin-bottom: 0; }

.message-content pre {
  margin: 10px 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--code-bg);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--assistant-border);
}

.message-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
}

.message-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--code-inline-bg);
  color: var(--accent);
  font-size: 13px;
}

.message-content br { content: ''; display: block; margin: 4px 0; }

.message-content strong { font-weight: 600; }

.message-content ul, .message-content ol {
  padding-left: 20px;
  margin-bottom: 8px;
}
.message-content li { margin-bottom: 4px; }

.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 8px;
}
.message-content h1 { font-size: 20px; }
.message-content h2 { font-size: 18px; }
.message-content h3 { font-size: 16px; }

.message-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 10px 0;
  color: var(--text-secondary);
}

.message-content table {
  border-collapse: collapse;
  margin: 10px 0;
  width: 100%;
  font-size: 13px;
}
.message-content th, .message-content td {
  border: 1px solid var(--assistant-border);
  padding: 8px 12px;
  text-align: left;
}
.message-content th {
  background: var(--hover);
  font-weight: 600;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.7;
}

.user-message .message-time { color: rgba(255, 255, 255, 0.6); }

/* ===== CHAT IMAGE ===== */
.chat-image {
  margin-top: 10px;
}
.chat-image img {
  max-width: 400px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}
.image-loading {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--glass-bg);
  color: var(--text-muted);
  font-size: 13px;
  display: inline-block;
  animation: pulse 1.5s ease infinite;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  padding: 18px 24px;
  display: flex;
  gap: 14px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--assistant-bg);
  border-radius: 12px;
  border: 1px solid var(--assistant-border);
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* ===== INPUT AREA ===== */
.input-area {
  padding: 12px 24px 10px;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--sidebar-border);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s;
}
.input-wrapper:focus-within {
  border-color: var(--accent);
}

#messageInput {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  resize: none;
  max-height: 160px;
  line-height: 1.5;
  padding: 2px 0;
}
#messageInput::placeholder { color: var(--text-muted); }

.send-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.send-btn svg { width: 15px; height: 15px; }

.input-footer {
  text-align: center;
  padding: 6px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .message { padding: 14px 16px; }
  .message.user-message { margin-right: 12px; max-width: 85%; }
  .input-area { padding: 10px 14px 8px; }
  .model-cards { flex-direction: column; align-items: center; }
  .model-card { min-width: 200px; }
}

/* ===== SCROLLBAR GLOBAL ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ===== SIDEBAR TABS ===== */
/* ===== SIDEBAR TABS ===== */
.sidebar-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.tab-panel.active { display: flex; }

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
}
.panel-title { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-border);
}

.footer-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.model-select {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.settings-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.settings-btn:hover { background: var(--hover); color: var(--text); }
.settings-btn.active { color: var(--accent); background: rgba(99, 102, 241, 0.1); }

.small-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.small-btn:hover { border-color: var(--accent); }
.small-btn.primary { background: var(--accent); color: white; border-color: var(--accent); }
.small-btn.primary:hover { background: var(--accent-hover); }

/* ===== SEARCH BAR ===== */
.search-bar {
  padding: 6px 12px;
}
.search-bar input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--text-muted); }

/* ===== APP LIST ===== */
.app-list, .todo-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}
.app-list::-webkit-scrollbar, .todo-list::-webkit-scrollbar { width: 4px; }
.app-list::-webkit-scrollbar-thumb, .todo-list::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.app-card {
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.app-card:hover { border-color: var(--accent); }
.app-card-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.app-card-desc { font-size: 11px; color: var(--text-muted); }
.app-card-actions { display: flex; gap: 4px; margin-top: 6px; }
.app-card-actions .small-btn { padding: 3px 8px; font-size: 11px; }

/* ===== TODO ===== */
.todo-input-row {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
}
.todo-input-row input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.todo-input-row input:focus { border-color: var(--accent); }
.todo-input-row input::placeholder { color: var(--text-muted); }
.todo-input-row .small-btn { padding: 8px 12px; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
}
.todo-item:hover { background: var(--hover); }
.todo-item.completed .todo-text { text-decoration: line-through; opacity: 0.5; }
.todo-checkbox {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 2px solid var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.todo-checkbox.checked { background: var(--accent); border-color: var(--accent); }
.todo-checkbox.checked::after { content: '\2713'; color: white; font-size: 11px; }
.todo-text { flex: 1; }
.todo-delete {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: none;
  align-items: center;
  justify-content: center;
}
.todo-item:hover .todo-delete { display: flex; }
.todo-delete:hover { color: var(--danger); background: rgba(239, 68, 68, 0.15); }

/* ===== VOICE BUTTON ===== */
.voice-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.voice-btn:hover { background: var(--hover); color: var(--accent); }
.voice-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.voice-btn.recording { color: var(--danger); animation: pulse 1s infinite; }
.voice-btn svg { width: 16px; height: 16px; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--main-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 22px; }
.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-input, .modal-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.modal-input:focus, .modal-textarea:focus { border-color: var(--accent); }
.modal-textarea { resize: vertical; min-height: 120px; font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* ===== PROVIDER TABS ===== */
.provider-tab {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.provider-tab:hover { border-color: var(--accent); color: var(--text); }
.provider-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.provider-panel {
  padding: 12px;
  background: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--input-border);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.85);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 13px;
  z-index: 9999;
  animation: toastIn 0.3s ease;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== THINKING TOGGLE ===== */
.thinking-toggle {
  font-size: 16px !important;
  transition: all 0.2s;
}
.thinking-toggle.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

/* ===== SETTINGS PANEL ===== */
.settings-section {
  padding: 8px;
}
.settings-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 14px 4px;
}
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 8px;
  transition: background 0.15s;
}
.settings-item:hover {
  background: var(--hover);
}
.settings-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.settings-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.settings-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.settings-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-left: 12px;
}
.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.settings-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: 0.25s;
}
.settings-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: 0.25s;
}
.settings-switch input:checked + .settings-slider {
  background: var(--accent);
}
.settings-switch input:checked + .settings-slider::before {
  transform: translateX(18px);
  background: #fff;
}

/* Unfiltered mode accent override */
.uncensored-mode {
  --accent: #e04040;
  --accent-soft: rgba(224, 64, 64, 0.1);
}
.uncensored-mode .welcome-icon {
  background: linear-gradient(135deg, #e04040, #b01010);
}
.uncensored-mode .logo-icon {
  background: linear-gradient(135deg, #e04040, #b01010);
}

/* ===== THINKING BLOCK ===== */
.thinking-block {
  margin: 4px 0 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  font-size: 13px;
  width: 100%;
}
.thinking-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
  user-select: none;
}
.thinking-text {
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
  font-size: 12.5px;
  white-space: pre-wrap;
}

.search-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  font-size: 13px;
  color: var(--accent);
  animation: pulse-search 1.5s ease-in-out infinite;
}
.search-icon {
  font-size: 14px;
}
@keyframes pulse-search {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.connect-status {
  font-size: 11px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}
.connect-status.connected {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   ASSET STUDIO
   ============================================================ */
.asset-controls {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.asset-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.asset-input:focus { border-color: var(--accent); }
.asset-type-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.asset-type-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.asset-type-btn.active,
.asset-type-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.asset-size-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.asset-size-row label {
  font-size: 11px;
  color: var(--text-muted);
}
.asset-select {
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 8px 12px;
  max-height: calc(100vh - 380px);
  overflow-y: auto;
}
.asset-grid-item {
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.asset-grid-item:hover { border-color: var(--accent); }
.asset-grid-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.asset-grid-item .asset-label {
  padding: 4px 6px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-grid-item .asset-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.asset-grid-item:hover .asset-delete { display: flex; }

.shader-preview {
  padding: 8px 12px;
  text-align: center;
}
.shader-preview canvas {
  width: 100%;
  max-width: 256px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}
.shader-controls {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}

/* ============================================================
   CODER GAME ENGINE
   ============================================================ */
.game-engine {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  min-height: 300px;
}
.game-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
}
.game-tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.game-tool-btn.active,
.game-tool-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.game-sep {
  width: 1px;
  height: 18px;
  background: var(--input-border);
  margin: 0 4px;
}
.game-select {
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  margin-left: auto;
}
.game-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.game-tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
}
.game-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
}
.game-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.game-tab:hover:not(.active) {
  color: var(--text-secondary);
}
.game-tab-content {
  display: none;
  flex: 1;
  overflow: hidden;
}
.game-tab-content.active {
  display: flex;
  flex-direction: column;
}
.game-code-editor {
  width: 100%;
  flex: 1;
  padding: 12px;
  border: none;
  background: var(--code-bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: none;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.game-preview {
  width: 100%;
  flex: 1;
  background: #000;
  border: none;
  image-rendering: pixelated;
}
.shader-editor {
  width: 100%;
  flex: 1;
  min-height: 120px;
  padding: 12px;
  border: none;
  background: var(--code-bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: none;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.shader-editor-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Game asset gen inside game tab */
.game-asset-gen {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--glass-border);
}
.game-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1;
}
.game-asset-grid .asset-grid-item img {
  aspect-ratio: 1;
}

/* ── Group Chat ─────────────────────────────────────────── */
.group-chat-controls {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.group-name-row, .group-members-row, .group-style-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.group-name-row label, .group-members-row label, .group-style-row label {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 70px;
}
.group-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 12px;
}
.group-input:focus {
  border-color: var(--accent);
  outline: none;
}
.group-input-small {
  width: 100px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 11px;
}
.group-input-small:focus {
  border-color: var(--accent);
  outline: none;
}
.group-select, .group-select-small {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 11px;
}
.group-member-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.group-member-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.group-member-tag .remove-member {
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
}
.group-member-tag .remove-member:hover {
  opacity: 1;
  color: var(--danger);
}
.group-chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.group-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.group-msg {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  animation: msgIn 0.15s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.group-msg-user {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.group-msg-bot {
  align-self: flex-end;
  background: var(--accent-dim);
  color: var(--accent-text, var(--text));
  border-bottom-right-radius: 4px;
}
.group-msg-split {
  border-bottom-right-radius: 4px;
  animation: splitIn 0.2s ease;
}
@keyframes splitIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
.group-msg-system {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 4px 0;
}
.group-msg-sender {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.group-msg-bot .group-msg-sender {
  color: var(--accent);
}
.group-msg-text {
  word-wrap: break-word;
}
.group-msg-time {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
  text-align: right;
}
.group-chat-input-row {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.group-chat-input-row .group-input {
  flex: 1;
}

/* ============================================================
   INPUT TOOLS BAR
   ============================================================ */
.input-tools {
  display: flex;
  gap: 4px;
  padding: 6px 12px 0;
}
.tool-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.tool-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.tool-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   SOURCE CITATIONS PANEL
   ============================================================ */
.sources-panel {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.1);
}
.sources-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.source-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 12px;
}
.source-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.source-link {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.source-link:hover {
  text-decoration: underline;
}

/* ============================================================
   CUSTOM PROMPT
   ============================================================ */
.settings-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.custom-prompt-input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
}
.custom-prompt-input:focus {
  border-color: var(--accent);
}
.settings-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.file-drop-zone {
  border: 2px dashed var(--input-border);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  transition: all 0.2s;
  cursor: pointer;
}
.file-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
}
.file-drop-zone p {
  margin-top: 8px;
  font-size: 14px;
}
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
}
.file-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.file-content-preview {
  margin-top: 8px;
  max-height: 200px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: var(--code-bg);
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

/* ============================================================
   CODE PLAYGROUND
   ============================================================ */
.playground-content {
  max-width: 900px;
  width: 95vw;
}
.playground-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.playground-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.playground-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 350px;
}
.playground-editor-wrap,
.playground-output-wrap {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  overflow: hidden;
}
.playground-label {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  background: var(--input-bg);
  border-bottom: 1px solid var(--input-border);
}
.playground-editor {
  flex: 1;
  min-height: 300px;
  padding: 12px;
  border: none;
  background: var(--code-bg);
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
  tab-size: 2;
}
.playground-output {
  flex: 1;
  min-height: 300px;
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
}
.playground-output iframe {
  width: 100%;
  height: 100%;
  border: none;
  min-height: 300px;
}
@media (max-width: 700px) {
  .playground-panels {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   DEEP RESEARCH
   ============================================================ */
.research-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.research-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  font-size: 13px;
  color: var(--text);
}
.research-step.active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
}
.research-step.done {
  opacity: 0.6;
}
.research-step-icon {
  font-size: 14px;
  flex-shrink: 0;
}

/* ============================================================
   WELCOME SCREEN
   ============================================================ */
.welcome-logo {
  margin-bottom: 16px;
}
.welcome-icon.animated-logo {
  width: 72px;
  height: 72px;
  font-size: 36px;
  border-radius: 20px;
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.welcome-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.welcome-features {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.welcome-feature {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--text-secondary);
}
.welcome-feature svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.hint-chip {
  cursor: pointer;
  transition: all 0.2s;
}
.hint-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* ============================================================
   HEADER ACTIONS
   ============================================================ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   FOLDER TABS
   ============================================================ */
.folder-tabs {
  display: flex;
  gap: 4px;
  padding: 4px 12px 8px;
  overflow-x: auto;
}
.folder-tab {
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.folder-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.folder-tab:hover:not(.active) {
  background: var(--hover);
}

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--sidebar-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  padding: 0 8px;
}
@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  .input-area {
    padding-bottom: 60px;
  }
  .main-area {
    height: calc(100vh - 56px);
  }
}
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s;
}
.mobile-nav-btn svg {
  width: 20px;
  height: 20px;
}
.mobile-nav-btn.active {
  color: var(--accent);
}

/* ============================================================
   PIN & FOLDER BADGES
   ============================================================ */
.conv-pin {
  font-size: 10px;
  margin-right: 4px;
  opacity: 0.6;
}
.conv-folder-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  margin-left: 6px;
  opacity: 0.7;
}
.conv-actions {
  display: none;
  gap: 2px;
  margin-left: auto;
}
.conv-item:hover .conv-actions {
  display: flex;
}
.conv-action-btn {
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
}
.conv-action-btn:hover {
  background: var(--hover);
  color: var(--text);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.message {
  animation: msgSlideIn 0.2s ease-out;
}
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.typing-dot {
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ============================================================
   EXPORT / SHARE MODAL
   ============================================================ */
.share-url-box {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.share-url-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--code-bg);
  color: var(--text);
  font-size: 13px;
  font-family: monospace;
}
