:root {
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-hover: #e5e7eb;
  --border: #e5e7eb;
  --border-dark: #d1d5db;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --sidebar-bg: #f9fafb;
  --sidebar-hover: #f3f4f6;
  --sidebar-active: #e5e7eb;
  --accent: #1f2937;
  --blue: var(--text);
  --green: var(--text);
  --red: #ef4444;
  --code-bg: #0d1117;
}

.dark {
  --bg: #171717;
  --bg-secondary: #1f1f1f;
  --bg-tertiary: #262626;
  --bg-hover: #303030;
  --border: #303030;
  --border-dark: #404040;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --sidebar-bg: #1f1f1f;
  --sidebar-hover: #262626;
  --sidebar-active: #303030;
  --accent: #fafafa;
  --blue: var(--text);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.new-thread-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.new-thread-btn:hover {
  background: var(--bg-tertiary);
}

.new-thread-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-nav {
  padding: 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--text);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

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

.section-title {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.thread-item:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.thread-item.active {
  background: var(--sidebar-active);
  color: var(--text);
}

.thread-item svg.t-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.5;
}

.thread-item .t-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Thread action buttons (rename/delete) */
.thread-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}

.thread-item:hover .thread-actions {
  display: flex;
}

.thread-action-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
}

.thread-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.thread-action-btn svg {
  width: 13px;
  height: 13px;
}

.thread-item input.rename-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--blue);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  padding: 1px 0;
}

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

/* ── Main ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
}

.menu-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.logo svg {
  width: 24px;
  height: 24px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Home View ── */
.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: 100px;
}

.home-inner {
  width: 100%;
  max-width: 640px;
}

.home-title {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

/* Search Box */
.search-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  transition: all 0.15s;
}

.search-box:focus-within {
  border-color: var(--border-dark);
  box-shadow: 0 0 0 3px var(--bg-tertiary);
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.search-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.search-btn svg {
  width: 20px;
  height: 20px;
}

.search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.search-submit:hover {
  opacity: 0.9;
}

.search-submit svg {
  width: 18px;
  height: 18px;
}

/* Suggestions */
.suggestions-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  z-index: 100;
  overflow: hidden;
  display: none;
}

.suggestions-dropdown.show {
  display: block;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: all 0.1s;
}

.suggestion-item:hover {
  background: var(--bg-tertiary);
}

.suggestion-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Focus row */
.focus-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.focus-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.focus-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.focus-btn.active {
  background: var(--bg-tertiary);
  border-color: var(--border-dark);
  color: var(--text);
}

.focus-btn svg {
  width: 16px;
  height: 16px;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.quick-btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.quick-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-dark);
  color: var(--text);
}

/* ── Chat View ── */
.chat-content {
  flex: 1;
  overflow-y: auto;
}

.messages-container {
  max-width: 768px;
  margin: 0 auto;
  padding: 24px;
}

.message {
  margin-bottom: 32px;
  animation: fadeIn 0.2s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-user {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.user-query {
  flex: 1;
  font-size: 17px;
  font-weight: 500;
  padding-top: 4px;
}

.message-answer {
  padding-left: 44px;
}

.answer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.answer-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.answer-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* Model + free tag shown in answer header */
.model-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.free-tag {
  display: none;
}

.answer-content {
  font-size: 15px;
  line-height: 1.7;
}

.answer-content p {
  margin-bottom: 16px;
}

.answer-content p:last-child {
  margin-bottom: 0;
}

.answer-content ul,
.answer-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.answer-content li {
  margin-bottom: 8px;
}

.answer-content h1,
.answer-content h2,
.answer-content h3 {
  margin: 20px 0 10px;
  font-weight: 600;
}

.answer-content h1 {
  font-size: 1.4em;
}

.answer-content h2 {
  font-size: 1.2em;
}

.answer-content h3 {
  font-size: 1.1em;
}

.answer-content code:not(pre code) {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "Source Code Pro", monospace;
  color: var(--text);
}

.answer-content pre {
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.answer-content pre code {
  display: block;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  font-family: "Source Code Pro", monospace;
  overflow-x: auto;
  background: transparent !important;
  color: inherit;
}

.answer-content a {
  color: var(--blue);
  text-decoration: none;
}

.answer-content a:hover {
  text-decoration: underline;
}

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

.answer-content blockquote {
  border-left: 3px solid var(--border-dark);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-secondary);
}

.answer-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.answer-content th,
.answer-content td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.answer-content th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

/* Code block header */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-lang {
  font-size: 12px;
  color: #7d8590;
  font-family: "Source Code Pro", monospace;
}

.code-header-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn,
.preview-btn,
.download-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  color: #a1a1aa;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.copy-btn:hover,
.preview-btn:hover,
.download-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.copy-btn svg,
.preview-btn svg,
.download-btn svg {
  width: 12px;
  height: 12px;
}

/* Answer actions */
.answer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* Related */
.related-section {
  margin-top: 20px;
}

.related-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.related-btn:hover {
  background: var(--bg-tertiary);
}

.related-btn svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Typing */
.typing {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing span {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

/* ── Chat Input ── */
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: var(--bg);
}

.chat-input-container {
  max-width: 768px;
  margin: 0 auto;
}

/* Input box with model inside it */
.chat-input-box {
  display: flex;
  flex-direction: column;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  transition: all 0.15s;
}

.chat-input-box:focus-within {
  border-color: var(--border-dark);
  box-shadow: 0 0 0 3px var(--bg-tertiary);
}

.chat-textarea-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--text);
  outline: none;
  resize: none;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.input-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.input-btn svg {
  width: 18px;
  height: 18px;
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.send-btn:hover {
  opacity: 0.9;
  color: var(--text);
}

.send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.send-btn svg {
  width: 16px;
  height: 16px;
}

/* Model row INSIDE the input box */
.chat-model-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 2px 2px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.model-select-pill {
  padding: 3px 24px 3px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
  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='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  transition: all 0.12s;
}

.model-select-pill:hover {
  border-color: var(--border-dark);
}

.model-select-pill:focus {
  outline: none;
  border-color: var(--blue);
}

.free-pill {
  display: none;
}

/* ── Code Preview Modal ── */
.preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.preview-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-width: 980px;
  height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.preview-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.preview-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.preview-dots span:nth-child(1) {
  background: #ef4444;
}

.preview-dots span:nth-child(2) {
  background: #f59e0b;
}

.preview-dots span:nth-child(3) {
  background: #22c55e;
}

.preview-title {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.preview-actions {
  display: flex;
  gap: 6px;
}

.preview-close-btn,
.preview-dl-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.preview-close-btn {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.preview-close-btn:hover {
  color: var(--text);
}

.preview-dl-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.preview-dl-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.preview-dl-btn svg,
.preview-close-btn svg {
  width: 13px;
  height: 13px;
}

.preview-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.preview-tab {
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border: none;
  background: none;
  font-family: inherit;
  transition: all 0.12s;
}

.preview-tab:hover {
  color: var(--text);
}

.preview-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.preview-iframe {
  flex: 1;
  border: none;
  background: #fff;
}

/* ── Voice Overlay ── */
.voice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.voice-modal {
  text-align: center;
  color: white;
}

.voice-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: pulsate 1.5s ease-in-out infinite;
}

@keyframes pulsate {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 16px rgba(239, 68, 68, 0);
  }
}

.voice-icon svg {
  width: 36px;
  height: 36px;
}

.voice-text {
  font-size: 18px;
  margin-bottom: 8px;
}

.voice-transcript {
  font-size: 14px;
  color: #a1a1aa;
  margin-bottom: 24px;
  min-height: 20px;
}

.voice-stop {
  padding: 12px 24px;
  border: 1px solid #525252;
  background: none;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.voice-stop:hover {
  background: #262626;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.toast {
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  font-size: 13.5px;
  animation: toastIn 0.18s ease;
  white-space: nowrap;
  z-index: 9999;
}

.toast.success {
  border-color: var(--text);
}

.toast.error {
  border-color: var(--red);
  color: var(--red);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Sidebar overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}

.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
  }

  .menu-btn {
    display: flex;
  }

  .home-title {
    font-size: 24px;
  }

  .focus-row {
    gap: 6px;
  }

  .focus-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .messages-container {
    padding: 16px;
  }

  .message-answer {
    padding-left: 0;
  }

  .chat-input-area {
    padding: 12px 16px;
  }
}