/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0C0D11;
  --bg2: #13141A;
  --bg3: #1A1B24;
  --bg4: #22232F;
  --border: #2A2C3A;
  --border2: #353749;
  --text: #E8E9F0;
  --text2: #9A9CB5;
  --text3: #666880;
  --accent: #7C6DFA;
  --accent2: #A78BFA;
  --accent-glow: rgba(124, 109, 250, 0.25);
  --green: #4ADE80;
  --red: #F87171;
  --yellow: #FBBF24;
  --user-bubble: #1E1F2E;
  --ai-bubble: #161720;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 280px;
  --font-ui: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-serif: 'Instrument Serif', serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

body.light {
  --bg: #F4F4F8;
  --bg2: #FFFFFF;
  --bg3: #EEEEF5;
  --bg4: #E4E4EE;
  --border: #D0D0E0;
  --border2: #C0C0D8;
  --text: #1A1B24;
  --text2: #555670;
  --text3: #8888A0;
  --user-bubble: #EAE9FF;
  --ai-bubble: #F8F8FF;
  --accent-glow: rgba(124,109,250,0.15);
}

html { font-size: 15px; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100dvh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition), width var(--transition);
  z-index: 100;
}

.sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-w)));
  position: fixed;
  left: 0;
  top: 0;
}

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

.logo-mark { flex-shrink: 0; }

.logo-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.logo-sub {
  font-size: 0.68rem;
  color: var(--text3);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color var(--transition), background var(--transition);
}
.sidebar-toggle:hover { color: var(--text); background: var(--bg3); }

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.profile-info { display: flex; flex-direction: column; }
.profile-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.profile-role {
  font-size: 0.68rem;
  color: var(--accent2);
  font-family: var(--font-mono);
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 8px;
}

.btn-new-chat, .btn-new-group, .btn-new-project {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.btn-new-chat {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn-new-chat:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-new-group:hover, .btn-new-project:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border2);
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px 4px;
}

.project-list, .chat-history-list {
  display: flex;
  flex-direction: column;
}

.history-item, .project-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin: 1px 8px;
  transition: background var(--transition);
  position: relative;
}

.history-item:hover, .project-item:hover { background: var(--bg3); }
.history-item.active, .project-item.active { background: var(--accent-glow); }

.history-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
}

.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.history-info, .project-info {
  flex: 1;
  overflow: hidden;
}

.history-name, .project-name {
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.history-preview {
  font-size: 0.7rem;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.history-delete, .project-delete {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
}
.history-item:hover .history-delete,
.project-item:hover .project-delete { opacity: 1; }
.history-delete:hover, .project-delete:hover { color: var(--red); }

.sidebar-footer {
  display: flex;
  gap: 4px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.footer-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text3);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
}
.footer-btn:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }

/* ===== MAIN AREA ===== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  min-height: 60px;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text2);
  border-radius: 1px;
  transition: all var(--transition);
}
.hamburger:hover span { background: var(--text); }

.chat-title-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.current-chat-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-chat-type {
  font-size: 0.68rem;
  color: var(--text3);
  font-family: var(--font-mono);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.model-selector {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.model-selector:hover, .model-selector:focus { border-color: var(--accent); color: var(--text); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  transition: background var(--transition);
}
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.error { background: var(--red); }

/* ===== CHAT CONTAINER ===== */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 8px;
  position: relative;
}

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeUp 0.6s ease;
}

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

.welcome-hero {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-hex {
  display: inline-block;
  margin-bottom: 20px;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

.welcome-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.2;
}
.welcome-title em {
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--accent2);
}

.welcome-sub {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.65;
}

.welcome-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.wcard {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wcard:hover {
  border-color: var(--accent);
  background: var(--bg3);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.wcard-icon { font-size: 1.5rem; }
.wcard-text {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.4;
}

/* ===== MESSAGES ===== */
.messages-area {
  display: none;
  flex-direction: column;
  gap: 0;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}

.messages-area.visible { display: flex; }

.message {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  animation: msgSlide 0.3s ease;
}

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

.message:last-child { border-bottom: none; }

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-avatar.user {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}

.msg-avatar.ai {
  background: var(--bg3);
  border: 1px solid var(--border);
}

.msg-content {
  flex: 1;
  min-width: 0;
}

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.msg-role {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.msg-time {
  font-size: 0.65rem;
  color: var(--text3);
  font-family: var(--font-mono);
}

.msg-body {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.75;
  word-break: break-word;
}

/* Markdown styles */
.msg-body p { margin-bottom: 0.8em; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body h1, .msg-body h2, .msg-body h3 {
  color: var(--text);
  margin: 1.2em 0 0.5em;
  font-weight: 600;
}
.msg-body h1 { font-size: 1.2em; }
.msg-body h2 { font-size: 1.05em; }
.msg-body h3 { font-size: 0.95em; }

.msg-body ul, .msg-body ol {
  padding-left: 1.4em;
  margin-bottom: 0.8em;
}
.msg-body li { margin-bottom: 0.3em; }

.msg-body code {
  font-family: var(--font-mono);
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.82em;
  color: var(--accent2);
}

.msg-body pre {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0.8em 0;
  overflow-x: auto;
  position: relative;
}

.msg-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text);
}

.code-block-wrap { position: relative; }
.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text3);
  padding: 3px 8px;
  font-size: 0.68rem;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: all var(--transition);
}
.copy-code-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.msg-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  margin: 0.8em 0;
  color: var(--text3);
  font-style: italic;
}

.msg-body strong { color: var(--text); font-weight: 600; }
.msg-body em { color: var(--text2); }

.msg-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
  font-size: 0.83rem;
}
.msg-body th, .msg-body td {
  padding: 7px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.msg-body th {
  background: var(--bg3);
  color: var(--text);
  font-weight: 600;
}
.msg-body tr:hover td { background: var(--bg3); }

.msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity var(--transition);
}

.message:hover .msg-actions { opacity: 1; }

.msg-action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text3);
  padding: 3px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.msg-action-btn:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }

/* Image in message */
.msg-image {
  max-width: 300px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  border: 1px solid var(--border);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ===== INPUT AREA ===== */
.input-wrapper {
  padding: 12px 20px 16px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  align-self: center;
  box-sizing: border-box;
}

.input-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text3);
  padding: 5px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: all var(--transition);
}
.toolbar-btn:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.toolbar-btn.active { background: var(--accent-glow); color: var(--accent2); border-color: var(--accent); }

.input-box-wrap {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-box-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.image-preview-strip {
  padding: 8px 12px 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-thumb {
  position: relative;
  width: 56px;
  height: 56px;
}

.preview-thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.preview-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--red);
  border: none;
  border-radius: 50%;
  color: white;
  width: 16px;
  height: 16px;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.input-row {
  display: flex;
  align-items: flex-end;
  padding: 10px 12px 10px 14px;
  gap: 10px;
}

textarea#userInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: none;
  max-height: 200px;
  overflow-y: auto;
}

textarea#userInput::placeholder { color: var(--text3); }

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.send-btn:hover { background: var(--accent2); transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { background: var(--bg4); color: var(--text3); cursor: not-allowed; transform: none; }

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.input-hint {
  font-size: 0.66rem;
  color: var(--text3);
  font-family: var(--font-mono);
}
.input-hint kbd {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.62rem;
}

.char-count {
  font-size: 0.66rem;
  color: var(--text3);
  font-family: var(--font-mono);
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 460px;
  max-width: 90vw;
  box-shadow: var(--shadow);
  animation: modalIn 0.25s ease;
}

.modal-wide { width: 560px; }

@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg3); color: var(--text); }

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.modal-input, .modal-textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 9px 12px;
  outline: none;
  width: 100%;
  transition: border-color var(--transition);
}
.modal-input:focus, .modal-textarea:focus { border-color: var(--accent); }
.modal-textarea { resize: vertical; min-height: 80px; }

.modal-hint {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: -4px;
}

.color-picker {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}
.color-opt {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.color-opt:hover, .color-opt.selected { border-color: var(--text); transform: scale(1.15); }

.theme-toggle-row { display: flex; gap: 8px; }
.theme-btn {
  flex: 1;
  padding: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.theme-btn:hover { background: var(--accent-glow); border-color: var(--accent); color: var(--accent2); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

.btn-cancel {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  padding: 9px 20px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel:hover { background: var(--bg3); border-color: var(--border2); }

.btn-confirm {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  padding: 9px 20px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-confirm:hover { background: var(--accent2); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 18px;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
  max-width: 300px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ===== GROUP CHAT TAG ===== */
.group-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-glow);
  color: var(--accent2);
  font-family: var(--font-mono);
  margin-left: 6px;
  vertical-align: middle;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }
  .welcome-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .welcome-title { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .welcome-cards { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; }
  .input-wrapper { padding: 10px 12px 14px; }
}

/* ===== SELECTION ===== */
::selection {
  background: var(--accent-glow);
  color: var(--accent2);
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== EMPTY STATE ===== */
.empty-list {
  padding: 12px 16px;
  font-size: 0.75rem;
  color: var(--text3);
  font-style: italic;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }
