/* =========================================================
   Code Assistant — Modern Minimalist Design System
   ========================================================= */

:root {
  /* Neutral palette */
  --gray-50:  #f8fafc;
  --gray-100: #eef2ff;
  --gray-200: #dfe6ff;
  --gray-300: #c7d2fe;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020817;

  /* Semantic tokens */
  --bg:             #050816;
  --bg-elevated:    rgba(15, 23, 42, 0.86);
  --bg-surface:     rgba(15, 23, 42, 0.9);
  --bg-surface-hover: rgba(30, 41, 59, 0.95);
  --border:         rgba(148, 163, 184, 0.18);
  --border-subtle:  rgba(148, 163, 184, 0.12);
  --text:           #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary:  #94a3b8;
  --accent:         #60a5fa;
  --accent-hover:   #3b82f6;
  --accent-muted:   rgba(96, 165, 250, 0.14);
  --success:        #34d399;
  --warning:        #fbbf24;
  --danger:         #f87171;
  --code-bg:        #0b1120;
  --code-header:    #111827;

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 56px;
  --composer-max:  800px;
  --content-max:   800px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --radius-xl:     18px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
}

/* ── Reset ─────────────────────────────────────────────── */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  height: 100%;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.12), transparent 25%),
    var(--bg);
}

body {
  display: flex;
  overflow: hidden;
  overscroll-behavior-y: none;
}

body.login-body {
  overflow-y: auto;
  overflow-x: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Scrollbar ─────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-600);
}

/* ── Sidebar ───────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out);
  z-index: 40;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.2));
}

.logo-wrap {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(96, 165, 250, 0.18);
}

.logo-text-block {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-tagline {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 3px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60a5fa, #8b5cf6);
  color: white;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(96, 165, 250, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-mark-blackhole {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.4), 0 0 6px rgba(56, 189, 248, 0.3);
  overflow: hidden;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.brand-mark-blackhole:hover {
  transform: rotate(15deg) scale(1.05);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.6), 0 0 10px rgba(56, 189, 248, 0.5);
}

.blackhole-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.mobile-brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-logo-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.brand-mark-inner {
  display: inline-block;
  transform: translateY(-1px);
}

.brand-mark-login {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 22px;
  box-shadow: 0 16px 28px rgba(96, 165, 250, 0.2);
}

.logo svg {
  color: var(--accent);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

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

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 12px 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  transition: border-color var(--duration-fast) ease;
}

.sidebar-search:focus-within {
  border-color: var(--accent);
}

.sidebar-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
}

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

/* ── Conversation list ─────────────────────────────────── */

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

.conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  border: 1px solid transparent;
  transition: all var(--duration-fast) ease;
  user-select: none;
}

.conv-item:hover {
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.08), rgba(148, 163, 184, 0.03));
  color: var(--text);
}

.conv-item.active {
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.16), rgba(96, 165, 250, 0.08));
  color: var(--text);
  border-color: rgba(96, 165, 250, 0.28);
}

.conv-item svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.conv-item.active svg {
  opacity: 0.9;
  color: var(--accent);
}

.conv-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-delete {
  opacity: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.conv-item:hover .conv-delete {
  opacity: 1;
}

.conv-delete:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.conv-date-group {
  padding: 12px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

/* ── Sidebar footer ────────────────────────────────────── */

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.7));
}

.model-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
}

.model-select-wrapper:hover {
  border-color: var(--gray-600);
}

.model-select-wrapper svg {
  flex-shrink: 0;
}

.model-select-wrapper select {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.model-select-wrapper select option {
  background: var(--bg-surface);
  color: var(--text);
}

/* ── Main ──────────────────────────────────────────────── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  position: relative;
  background: rgba(2, 6, 23, 0.3);
}

/* ── Mobile header ─────────────────────────────────────── */

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(14px);
}

.mobile-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12);
}

/* ── Chat panel ────────────────────────────────────────── */

.chat-panel {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 24px;
}

/* ── Empty state ───────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 48px 24px;
  text-align: center;
  animation: fadeIn 0.4s var(--ease-out);
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(168, 85, 247, 0.14));
  color: var(--accent);
  margin-bottom: 20px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.12);
}

.empty-icon-blackhole {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: 0 0 36px rgba(99, 102, 241, 0.4), 0 0 16px rgba(56, 189, 248, 0.3);
  margin-bottom: 22px;
  overflow: hidden;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.empty-icon-blackhole:hover {
  transform: rotate(30deg) scale(1.08);
  box-shadow: 0 0 48px rgba(99, 102, 241, 0.6), 0 0 24px rgba(56, 189, 248, 0.5);
}

.empty-blackhole-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.empty-state h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-tertiary);
  font-size: 14px;
  max-width: 360px;
  margin-bottom: 28px;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-width: 560px;
  width: 100%;
}

.suggestion-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.95));
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.suggestion-chip:hover {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 1));
  border-color: rgba(96, 165, 250, 0.4);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.3);
}

.suggestion-chip svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--text-tertiary);
}

/* ── Messages ──────────────────────────────────────────── */

.message-row {
  padding: 20px 24px;
  animation: slideUp 0.3s var(--ease-out);
}

.message-row.assistant {
  background: rgba(15, 23, 42, 0.46);
  border-bottom: 1px solid var(--border-subtle);
}

.message-row.user {
  background: rgba(2, 6, 23, 0.1);
}

.message-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

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

.message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
}

.message-row.user .message-avatar {
  background: var(--gray-700);
  color: var(--gray-300);
}

.message-row.assistant .message-avatar {
  background: var(--accent-muted);
  color: var(--accent);
}

.message-sender {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.message-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.message-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-300);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.message-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.message-image-card {
  position: relative;
  display: inline-block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.message-image-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.message-image-card img {
  max-width: 340px;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.image-zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}

.message-image-card:hover .image-zoom-overlay {
  opacity: 1;
}

/* ── Image Viewer Lightbox ─────────────────────────────── */

.image-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s var(--ease-out);
}

.image-viewer-backdrop.hidden {
  display: none !important;
}

.image-viewer-container {
  display: flex;
  flex-direction: column;
  max-width: 92vw;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  animation: scaleIn 0.22s var(--ease-out);
}

.image-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.image-viewer-caption {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  text-decoration: none;
}

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

.image-viewer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.8);
  overflow: auto;
  max-height: calc(90vh - 60px);
}

.image-viewer-body img {
  max-width: 100%;
  max-height: calc(85vh - 70px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.composer-inner.drag-over {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3) !important;
  background: var(--bg-hover) !important;
}

.message-row.user .message-content {
  color: var(--gray-200);
}

/* ── Markdown Content ──────────────────────────────────── */

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 20px 0 8px;
}

.message-content h1 { font-size: 20px; }
.message-content h2 { font-size: 17px; }
.message-content h3 { font-size: 15px; }
.message-content h4 { font-size: 14px; }

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

.message-content strong {
  color: var(--text);
  font-weight: 600;
}

.message-content em {
  font-style: italic;
}

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

.message-content li {
  margin: 4px 0;
}

.message-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.message-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ── Inline code ───────────────────────────────────────── */

.message-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--gray-200);
}

/* ── Code blocks ───────────────────────────────────────── */

.code-block-wrapper {
  margin: 12px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--code-bg);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--code-header);
  border-bottom: 1px solid var(--border-subtle);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.copy-btn.copied {
  color: var(--success);
}

.code-block-wrapper pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-300);
  background: none;
}

.code-block-wrapper pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: inherit;
  color: inherit;
}

/* ── Thinking indicator ────────────────────────────────── */

.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thinking-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

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

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

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

/* ── Composer ──────────────────────────────────────────── */

.composer-wrapper {
  padding: 0 24px 24px;
  background: linear-gradient(to bottom, transparent, var(--bg) 20%);
  position: relative;
}

.composer {
  max-width: var(--composer-max);
  margin: 0 auto;
}

.composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.96));
  padding: 4px 4px 4px 16px;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.28);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  flex-wrap: wrap;
}

.composer-inner:focus-within {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18), 0 20px 40px rgba(2, 6, 23, 0.35);
}

.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 8px 0 0;
}

.attachment-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
}

.attachment-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(134, 239, 172, 0.35);
  color: #bbf7d0;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.attachment-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.attachment-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.85));
  color: var(--text);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-inner textarea {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  resize: none;
  padding: 10px 0;
  min-height: 44px;
  max-height: 200px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.composer-inner textarea::placeholder {
  color: var(--text-tertiary);
}

.vision-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 10px auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-tertiary);
  transition: all var(--duration-fast) ease;
}

.vision-status.active {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.4);
  color: #a7f3d0;
}

.vision-status.inactive {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.vision-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.composer-actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 4px;
}

.char-count {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 8px 4px;
  min-width: 32px;
  text-align: right;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}

.char-count.visible {
  opacity: 1;
}

.attach-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.attach-btn:hover {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.5);
}

#send-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.28);
  transition: all var(--duration-fast) ease;
}

#send-btn:hover {
  background: linear-gradient(135deg, #7aaefb, var(--accent-hover));
  transform: translateY(-1px);
}

#send-btn:disabled {
  background: var(--gray-700);
  color: var(--gray-500);
  cursor: not-allowed;
}

#send-btn.btn-stop {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  cursor: pointer;
}

#send-btn.btn-stop:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  transform: translateY(-1px);
}

.composer-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 8px;
  letter-spacing: 0.01em;
}

.composer-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Animations ────────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ── Sidebar overlay (mobile) ──────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 35;
}

.sidebar-overlay.active {
  display: block;
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 768px) {
  body {
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(82vw, 360px);
    min-width: 0;
    max-width: 360px;
    height: 100dvh;
    transform: translateX(-105%);
    z-index: 40;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  }

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

  .mobile-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .main {
    height: 100dvh;
    min-height: 100dvh;
  }

  .chat-panel {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .message-row {
    padding: 16px;
  }

  .message-inner {
    max-width: 100%;
  }

  .composer-wrapper {
    padding: 0 12px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, transparent, var(--bg) 28%);
  }

  .composer-inner {
    padding-left: 12px;
  }

  .composer-inner textarea {
    font-size: 15px;
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
  }

  .composer-hint {
    display: none;
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .login-body {
    padding: 18px 12px;
  }

  .login-header h1 {
    font-size: 18px;
  }

  .auth-form {
    gap: 14px;
  }

  .demo-badge {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .user-profile-bar {
    padding: 10px 10px;
  }

  .modal-card {
    padding: 20px 14px;
  }

  .modal-tabs {
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .modal-tab-btn {
    white-space: nowrap;
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 360px) {
  .mobile-header {
    padding-inline: 12px;
  }

  .message-row {
    padding: 14px 12px;
  }

  .composer-wrapper {
    padding-inline: 8px;
  }

  .composer-inner {
    padding-left: 10px;
  }

  .login-card {
    padding: 22px 14px;
  }

  .form-input {
    font-size: 16px;
  }
}

@media (min-width: 769px) {
  .mobile-header {
    display: none !important;
  }
}

/* ── Utility ───────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ── Login Page ────────────────────────────────────────── */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 18%, rgba(59, 130, 246, 0.1) 0%, rgba(10, 10, 11, 0.96) 55%, #0a0a0b 100%);
  overflow-y: auto;
  padding: 24px 16px;
}

.login-wrapper {
  width: 100%;
  max-width: 410px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.4s var(--ease-out);
}

.login-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.84));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 30px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(96, 165, 250, 0.08);
  backdrop-filter: blur(12px);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(168, 85, 247, 0.15));
  color: var(--accent);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.12);
}

.login-logo-blackhole {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 32px rgba(99, 102, 241, 0.45), 0 0 14px rgba(56, 189, 248, 0.35);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  overflow: hidden;
}

.login-logo-blackhole:hover {
  transform: rotate(20deg) scale(1.06);
  box-shadow: 0 0 42px rgba(99, 102, 241, 0.65), 0 0 20px rgba(56, 189, 248, 0.5);
}

.login-blackhole-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.login-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.login-header p {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-size: 13px;
  margin-bottom: 20px;
}

.auth-alert svg {
  flex-shrink: 0;
  color: var(--danger);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color var(--duration-fast) ease;
}

.form-input {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 14px;
  padding: 0 14px 0 40px;
  outline: none;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.input-container:focus-within .input-icon {
  color: var(--accent);
}

.form-input.has-action {
  padding-right: 42px;
}

.input-action-btn {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: color var(--duration-fast) ease;
}

.input-action-btn:hover {
  color: var(--text);
}

.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: -2px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  transition: all var(--duration-fast) ease;
  flex-shrink: 0;
}

.custom-checkbox svg {
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
  color: white;
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox svg {
  opacity: 1;
}

.auth-submit-btn {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.22);
  transition: all var(--duration-fast) ease;
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #7aaefb, var(--accent-hover));
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  background: var(--gray-700);
  color: var(--gray-500);
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}

.login-note {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.demo-badge:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.demo-label {
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.05em;
}

.demo-code {
  font-family: var(--font-mono);
  color: var(--text);
  background: transparent;
  padding: 0;
  border: none;
}

.login-bottom-info {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

/* ── User Profile Bar (Sidebar Footer) ─────────────────── */

.user-profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(96, 165, 250, 0.18);
  margin-top: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(59, 130, 246, 0.2);
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-subtle-btn,
.logout-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--duration-fast) ease;
  flex-shrink: 0;
}

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

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

/* ── Settings & API Keys Modal ─────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fadeIn 0.2s var(--ease-out);
}

.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title-group h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--duration-fast) ease;
}

.modal-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text);
  border-color: var(--border);
}

.modal-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.modal-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--duration-fast) ease;
}

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

.modal-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-tab-pane {
  animation: fadeIn 0.25s var(--ease-out);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.secondary-btn {
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.secondary-btn:hover {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(96, 165, 250, 0.08);
}

.select-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%), linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.status-banner {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUp 0.2s var(--ease-out);
}

.status-banner.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.status-banner.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.saved-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: -2px;
}

.saved-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* API Keys Tab */

.api-keys-top {
  margin-bottom: 16px;
}

.api-keys-copy h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.api-keys-copy p {
  font-size: 12px;
  color: var(--text-tertiary);
}

.create-key-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.create-key-inline .form-input {
  flex: 1;
}

.btn-inline {
  width: auto;
  white-space: nowrap;
  padding: 0 16px;
  margin-top: 0;
}

.new-key-banner {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
  animation: slideUp 0.3s var(--ease-out);
}

.new-key-header {
  margin-bottom: 8px;
}

.badge-success {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--success);
  margin-bottom: 4px;
}

.new-key-header p {
  font-size: 12px;
  color: var(--text-secondary);
}

.key-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.key-display-box code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  user-select: all;
  border: none;
  background: transparent;
  padding: 0;
}

.btn-copy-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) ease;
}

.btn-copy-action:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.keys-table-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--bg-surface);
}

.keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.keys-table th {
  background: var(--bg-surface-hover);
  padding: 8px 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.keys-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.keys-table tr:last-child td {
  border-bottom: none;
}

.keys-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.key-prefix-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gray-300);
}

.btn-delete-key {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--duration-fast) ease;
}

.btn-delete-key:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.integration-guide {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.guide-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.guide-code pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--gray-300);
  overflow-x: auto;
}

.guide-code code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}


